@http-forge/core 0.6.22 → 0.6.24
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/README.md +1 -0
- package/dist/index.js +56 -56
- package/dist/index.mjs +56 -56
- package/dist/infrastructure/execution/request-preparer.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";var u2=Object.create;var Qh=Object.defineProperty;var c2=Object.getOwnPropertyDescriptor;var f2=Object.getOwnPropertyNames;var d2=Object.getPrototypeOf,p2=Object.prototype.hasOwnProperty;var le=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var V=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Rs=(t,e)=>{for(var r in e)Qh(t,r,{get:e[r],enumerable:!0})},vq=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of f2(e))!p2.call(t,i)&&i!==r&&Qh(t,i,{get:()=>e[i],enumerable:!(n=c2(e,i))||n.enumerable});return t};var ve=(t,e,r)=>(r=t!=null?u2(d2(t)):{},vq(e||!t||!t.__esModule?Qh(r,"default",{value:t,enumerable:!0}):r,t)),Ia=t=>vq(Qh({},"__esModule",{value:!0}),t);function Bt(t){return t.replace(/[^a-zA-Z0-9-_]/g,"_").replace(/\s+/g,"-").toLowerCase().substring(0,100)}function It(t){let e=Date.now().toString(36)+(h2++).toString(36)+Math.random().toString(36).slice(2,7);return t?`${Bt(t)}_${e}`:e}function Zh(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function gu(t,e){let r={},n={};for(let[i,s]of Object.entries(t)){let o=i.toLowerCase();n[o]=i,r[i]=s}for(let[i,s]of Object.entries(e)){let o=i.toLowerCase(),l=n[o];l&&delete r[l],n[o]=i,r[i]=s}return r}function bq(t){return JSON.parse(JSON.stringify(t))}function Sq(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function wq(t,e){try{return JSON.parse(t)}catch{return e}}function _q(t){if(t===0)return"0 B";let e=1024,r=["B","KB","MB","GB"],n=Math.floor(Math.log(t)/Math.log(e));return`${parseFloat((t/Math.pow(e,n)).toFixed(1))} ${r[n]}`}function Rq(t){return t<1e3?`${t} ms`:`${(t/1e3).toFixed(2)} s`}var h2,Un=le(()=>{"use strict";h2=0});function qf(t){if(!ht.existsSync(t))return;let e={},r=_n.join(t,Ef.preRequest);ht.existsSync(r)&&(e.preRequest=ht.readFileSync(r,"utf-8"));let n=_n.join(t,Ef.postResponse);return ht.existsSync(n)&&(e.postResponse=ht.readFileSync(n,"utf-8")),Object.keys(e).length>0?e:void 0}async function If(t,e){await ht.promises.mkdir(t,{recursive:!0});let r=_n.join(t,Ef.preRequest);e.preRequest?await ht.promises.writeFile(r,e.preRequest,"utf-8"):ht.existsSync(r)&&await ht.promises.unlink(r);let n=_n.join(t,Ef.postResponse);e.postResponse?await ht.promises.writeFile(n,e.postResponse,"utf-8"):ht.existsSync(n)&&await ht.promises.unlink(n)}function WS(t){for(let[e,r]of Object.entries(VS)){let n=_n.join(t,e);if(ht.existsSync(n))try{let i=ht.readFileSync(n,"utf-8"),s;if(r.type==="graphql")try{s=JSON.parse(i)}catch{s=i}else s=i;return{type:r.type,format:r.format,content:s}}catch(i){console.error(`[FolderIO] Failed to load body from ${n}:`,i)}}}function zS(t){if(!t||t.type==="none")return{bodyForMetadata:t};if(t.type==="raw"){let e=t.format||"json",n={json:"body.json",xml:"body.xml",text:"body.txt",html:"body.html",javascript:"body.js"}[e];if(n){let i=e==="json"?typeof t.content=="string"?t.content:JSON.stringify(t.content,null,2):String(t.content||"");return{bodyForMetadata:{type:t.type,format:t.format},externalBodyFile:{filename:n,content:i}}}}if(t.type==="graphql"){let e=typeof t.content=="string"?t.content:JSON.stringify(t.content,null,2);return{bodyForMetadata:{type:t.type},externalBodyFile:{filename:"body.graphql",content:e}}}return{bodyForMetadata:t}}async function JS(t,e){for(let r of Object.keys(VS))if(r!==e){let n=_n.join(t,r);if(ht.existsSync(n))try{await ht.promises.unlink(n)}catch{}}}function GS(t){if(ht.existsSync(t))try{let e=ht.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){console.error(`[FolderIO] Failed to load schema file ${t}:`,e);return}}async function YS(t,e,r){let n=_n.join(t,yu.responseSchema),i=_n.join(t,yu.bodySchema);e?await ht.promises.writeFile(n,JSON.stringify(e,null,2),"utf-8"):ht.existsSync(n)&&await ht.promises.unlink(n),r?await ht.promises.writeFile(i,JSON.stringify(r,null,2),"utf-8"):ht.existsSync(i)&&await ht.promises.unlink(i)}function Xh(t,e){for(let r of t){if(r.id===e)return r;if(r.type==="folder"&&r.items){let n=Xh(r.items,e);if(n)return n}}}function em(t,e){for(let r=0;r<t.length;r++){let n=t[r];if(n.id===e)return t.splice(r,1),!0;if(n.type==="folder"&&n.items&&em(n.items,e))return!0}return!1}function KS(t,e){let r=new Map(t.map(i=>[i.id,i])),n=[];for(let i of e){let s=r.get(i);s&&(n.push(s),r.delete(i))}for(let i of r.values())n.push(i);return n}function tm(t,e){let r;try{r=ht.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===rn)continue;if(n.name===e)return _n.join(t,n.name);let i=tm(_n.join(t,n.name),e);if(i)return i}}function m2(t){for(let e of[Cr.request,Cr.folder]){let r=_n.join(t,e);if(ht.existsSync(r))try{let n=ht.readFileSync(r,"utf-8");return JSON.parse(n).id}catch{return}}}function rm(t,e){let r;try{r=ht.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===rn)continue;let i=_n.join(t,n.name);if(m2(i)===e)return i;let s=rm(i,e);if(s)return s}}function Rn(t,e=[]){let r=t.toLowerCase().trim(),n=r.match(/^(get|post|put|patch|delete|head|options)[_\s-]/i),i=n?n[1]:"",s=r.match(/t(\d+)/gi)||[],o=0;for(let y of s){let b=parseInt(y.substring(1));b>o&&(o=b)}let l="";if(o>0)l=`t${o}`;else{let y=r.match(/[_\s-](\d+\.\d+)[_\s-]/);y&&(l=`v${y[1].replace(".","_")}`)}let c=r;n&&(c=c.substring(n[0].length)),c=c.replace(/[_\s-]?t\d+(?:\.\d+)?[_\s-]?/gi,"-"),c=c.replace(/[_\s-]?\d+\.\d+[_\s-]?/g,"-"),c=c.replace(/\([^)]+\)/g,""),c=c.replace(/:[a-z_][a-z0-9_]*/gi,""),c=c.replace(/\{[^}]+\}/g,""),c=c.replace(/\?$/g,"").replace(/[_/\\ ]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"");let d=c.split("-").filter(y=>y.length>0),p=[];i&&p.push(i),p.push(...d),l&&p.push(l);let m=p.join("-");if(m||(m="item"),e.includes(m)){let y=2;for(;e.includes(`${m}-${y}`);)y++;m=`${m}-${y}`}return m}var ht,_n,Ef,Cr,VS,yu,rn,Pa=le(()=>{"use strict";ht=ve(require("fs")),_n=ve(require("path")),Ef={preRequest:"pre-request.js",postResponse:"post-response.js"},Cr={collection:"collection.json",folder:"folder.json",request:"request.json"},VS={"body.json":{type:"raw",format:"json"},"body.xml":{type:"raw",format:"xml"},"body.txt":{type:"raw",format:"text"},"body.html":{type:"raw",format:"html"},"body.js":{type:"raw",format:"javascript"},"body.graphql":{type:"graphql"}},yu={responseSchema:"response.schema.json",bodySchema:"body.schema.json"},rn="scripts"});var Ne,je,xs,nm=le(()=>{"use strict";Ne=ve(require("fs")),je=ve(require("path"));Un();Pa();xs=class{collectionsDir;cache=new Map;slugToIdMap=new Map;idToSlugMap=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}getSlugById(e){return this.idToSlugMap.get(e)}getIdBySlug(e){return this.slugToIdMap.get(e)}ensureDirectory(){Ne.existsSync(this.collectionsDir)||Ne.mkdirSync(this.collectionsDir,{recursive:!0})}readJsonFileSafe(e,r){let n;try{n=Ne.readFileSync(e,"utf-8")}catch(i){console.error(`[FolderCollectionStore] Failed to read ${r} ${e}:`,i);return}if(n.trim().length!==0)try{return JSON.parse(n)}catch(i){if(i instanceof SyntaxError&&/Unexpected end of JSON input/.test(i.message))return;console.error(`[FolderCollectionStore] Failed to parse ${r} ${e}:`,i);return}}loadAll(){if(this.cache.clear(),this.slugToIdMap.clear(),this.idToSlugMap.clear(),!Ne.existsSync(this.collectionsDir))return[];let e=Ne.readdirSync(this.collectionsDir,{withFileTypes:!0}),r=[];for(let n of e)if(n.isDirectory())try{let i=this.loadCollectionFromFolder(n.name);i&&(this.cache.set(i.id,i),this.slugToIdMap.set(n.name,i.id),this.idToSlugMap.set(i.id,n.name),r.push(i))}catch(i){console.error(`[FolderCollectionStore] Failed to load ${n.name}:`,i)}return r}loadCollectionFromFolder(e){let r=je.join(this.collectionsDir,e),n=je.join(r,Cr.collection);if(!Ne.existsSync(n))return;let i=this.readJsonFileSafe(n,"collection");if(i)try{let s=this.loadScriptsFromDir(je.join(r,rn)),o=this.loadItemsFromDir(r,i.id,i.order);return{id:i.id,name:i.name,description:i.description,version:i.version,variables:i.variables,auth:i.auth,scripts:s,items:o}}catch(s){console.error(`[FolderCollectionStore] Failed to parse ${n}:`,s);return}}loadItemsFromDir(e,r,n){let i=[],s=new Map,o=Ne.readdirSync(e,{withFileTypes:!0});for(let l of o){if(!l.isDirectory()||l.name===rn)continue;let c=je.join(e,l.name);if(Ne.existsSync(je.join(c,Cr.folder))){let d=this.loadFolderFromDir(c,l.name);d&&s.set(l.name,d)}else if(Ne.existsSync(je.join(c,Cr.request))){let d=this.loadRequestFromDir(c,l.name);d&&s.set(l.name,d)}}if(n&&n.length>0){for(let l of n){let c=s.get(l);c&&(i.push(c),s.delete(l))}for(let l of s.values())i.push(l)}else for(let l of s.values())i.push(l);return i}loadFolderFromDir(e,r){let n=je.join(e,Cr.folder),i=this.readJsonFileSafe(n,"folder");if(i)try{let s=this.loadScriptsFromDir(je.join(e,rn)),o=this.loadItemsFromDir(e,i.id,i.order);return this.slugToIdMap.set(r,i.id),this.idToSlugMap.set(i.id,r),{id:i.id,type:"folder",name:i.name,description:i.description,auth:i.auth,scripts:s,items:o}}catch(s){console.error(`[FolderCollectionStore] Failed to load folder ${e}:`,s);return}}loadRequestFromDir(e,r){let n=je.join(e,Cr.request),i=this.readJsonFileSafe(n,"request");if(i)try{let s=this.loadScriptsFromDir(je.join(e,rn)),o=i.body,l=this.loadBodyFromDir(e);l&&(o=l);let c=this.loadSchemaFile(je.join(e,yu.responseSchema)),d=this.loadSchemaFile(je.join(e,yu.bodySchema)),p=je.join(e,"doc.md"),m=Ne.existsSync(p)?Ne.readFileSync(p,"utf-8"):void 0;return this.slugToIdMap.set(r,i.id),this.idToSlugMap.set(i.id,r),{id:i.id,type:"request",name:i.name,description:i.description,method:i.method,url:i.url,params:i.params,query:i.query,headers:i.headers,body:o,bodyContentType:i.bodyContentType,auth:i.auth,settings:i.settings,scripts:s,disabled:i.disabled,deprecated:i.deprecated,operationId:i.operationId,summary:i.summary,tags:i.tags,examples:i.examples,responses:i.responses,security:i.security,...m&&{doc:m},...c&&{responseSchema:c},...d&&{bodySchema:d}}}catch(s){console.error(`[FolderCollectionStore] Failed to load request ${e}:`,s);return}}loadScriptsFromDir(e){return qf(e)}loadBodyFromDir(e){return WS(e)}loadSchemaFile(e){return GS(e)}async saveSchemaFiles(e,r){return YS(e,r.responseSchema,r.bodySchema)}load(e){if(this.cache.has(e))return this.cache.get(e);let r=this.idToSlugMap.get(e);if(r){let n=this.loadCollectionFromFolder(r);return n&&this.cache.set(e,n),n}return this.loadAll(),this.cache.get(e)}async save(e){if(this.ensureDirectory(),!e.name)throw new Error("Collection name is required");e.id||(e.id=It(e.name));let r=this.idToSlugMap.get(e.id);if(!r){let l=Ne.readdirSync(this.collectionsDir);r=Rn(e.name,l),this.idToSlugMap.set(e.id,r),this.slugToIdMap.set(r,e.id)}let n=je.join(this.collectionsDir,r),i=!Ne.existsSync(n);await Ne.promises.mkdir(n,{recursive:!0});let s={id:e.id,name:e.name,description:e.description,version:e.version,variables:e.variables,auth:e.auth},[o]=await Promise.all([this.saveItemsToDir(n,e.items,i),e.scripts?this.saveScriptsToDir(je.join(n,rn),e.scripts):Promise.resolve()]);o.length>0&&(s.order=o),await Ne.promises.writeFile(je.join(n,Cr.collection),JSON.stringify(s,null,2),"utf-8"),this.cache.set(e.id,e)}async saveItemsToDir(e,r,n=!1){let i=[],s=[];for(let o of r){let l=this.idToSlugMap.get(o.id);l||(l=Rn(o.name,i),this.idToSlugMap.set(o.id,l),this.slugToIdMap.set(l,o.id)),i.push(l),s.push({item:o,slug:l})}return await Promise.all(s.map(async({item:o,slug:l})=>{let c=je.join(e,l);await Ne.promises.mkdir(c,{recursive:!0}),o.type==="folder"?await this.saveFolderToDir(c,o,n):await this.saveRequestToDir(c,o,n)})),i}async saveFolderToDir(e,r,n=!1){let i={id:r.id,name:r.name,description:r.description,auth:r.auth},[s]=await Promise.all([r.items?this.saveItemsToDir(e,r.items,n):Promise.resolve([]),r.scripts?this.saveScriptsToDir(je.join(e,rn),r.scripts):Promise.resolve()]);s.length>0&&(i.order=s),await Ne.promises.writeFile(je.join(e,Cr.folder),JSON.stringify(i,null,2),"utf-8")}async saveRequestToDir(e,r,n=!1){let{bodyForMetadata:i,externalBodyFile:s}=this.prepareBodyForSave(r.body),o={id:r.id,name:r.name,method:r.method||"GET",url:r.url||"",description:r.description,params:r.params,query:r.query,headers:r.headers,body:i,bodyContentType:r.bodyContentType,auth:r.auth,settings:r.settings,...r.disabled!==void 0&&{disabled:r.disabled},...r.deprecated&&{deprecated:r.deprecated},...r.operationId&&{operationId:r.operationId},...r.summary&&{summary:r.summary},...r.tags&&r.tags.length>0&&{tags:r.tags},...r.examples&&r.examples.length>0&&{examples:r.examples},...r.responses&&Object.keys(r.responses).length>0&&{responses:r.responses},...r.security&&r.security.length>0&&{security:r.security}},l=[Ne.promises.writeFile(je.join(e,Cr.request),JSON.stringify(o,null,2),"utf-8")];s&&l.push(Ne.promises.writeFile(je.join(e,s.filename),s.content,"utf-8")),n||l.push(this.cleanupOldBodyFiles(e,s?.filename)),(!n||r.responseSchema||r.bodySchema)&&l.push(this.saveSchemaFiles(e,r)),r.doc&&l.push(Ne.promises.writeFile(je.join(e,"doc.md"),r.doc,"utf-8")),r.scripts&&l.push(this.saveScriptsToDir(je.join(e,rn),r.scripts)),await Promise.all(l)}prepareBodyForSave(e){return zS(e)}async cleanupOldBodyFiles(e,r){return JS(e,r)}async saveScriptsToDir(e,r){return If(e,r)}async delete(e){let r=this.idToSlugMap.get(e);if(!r&&(this.loadAll(),r=this.idToSlugMap.get(e),!r))return!1;let n=je.join(this.collectionsDir,r);if(!Ne.existsSync(n))return!1;try{return await Ne.promises.rm(n,{recursive:!0,force:!0}),this.cache.delete(e),this.idToSlugMap.delete(e),this.slugToIdMap.delete(r),!0}catch(i){return console.error(`[FolderCollectionStore] Failed to delete collection ${e}:`,i),!1}}exists(e){let r=this.idToSlugMap.get(e);return r?Ne.existsSync(je.join(this.collectionsDir,r,Cr.collection)):!1}getCollectionPath(e){let r=this.idToSlugMap.get(e)||e;return je.join(this.collectionsDir,r)}getItemPath(e,r){return this.findItemPath(e,r)}async create(e,r){let n={id:r||It(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemPath(e,r);if(!s)throw new Error(`Item ${r} not found in collection ${e}`);await this.saveScriptsToDir(je.join(s,rn),n);let o=this.findItemById(i.items,r);o&&(o.scripts=n)}loadScripts(e,r){let n=this.findItemPath(e,r);if(n)return this.loadScriptsFromDir(je.join(n,rn))}async updateCollectionMetadata(e,r){let n=this.load(e);if(!n)throw new Error(`Collection ${e} not found`);let i=this.idToSlugMap.get(e);if(!i)throw new Error(`Collection slug not found for ${e}`);let s=je.join(this.collectionsDir,i),o=je.join(s,Cr.collection),l=Ne.readFileSync(o,"utf-8"),d={...JSON.parse(l),...r,id:e};await Ne.promises.writeFile(o,JSON.stringify(d,null,2),"utf-8"),r.name!==void 0&&(n.name=r.name),r.description!==void 0&&(n.description=r.description),r.version!==void 0&&(n.version=r.version),r.variables!==void 0&&(n.variables=r.variables),r.auth!==void 0&&(n.auth=r.auth)}async saveItem(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.idToSlugMap.get(e);if(!s)throw new Error(`Collection slug not found for ${e}`);let o;if(n){let p=this.findItemPath(e,n);if(!p)throw new Error(`Parent folder ${n} not found`);o=p}else o=je.join(this.collectionsDir,s);let l=this.idToSlugMap.get(r.id);if(!l){let p=Ne.readdirSync(o).filter(m=>Ne.statSync(je.join(o,m)).isDirectory()&&m!==rn);l=Rn(r.name,p),this.idToSlugMap.set(r.id,l),this.slugToIdMap.set(l,r.id)}let c=je.join(o,l);await Ne.promises.mkdir(c,{recursive:!0}),r.type==="folder"?await this.saveFolderToDir(c,r):await this.saveRequestToDir(c,r);let d=this.findItemById(i.items,r.id);if(d)Object.assign(d,r);else if(n){let p=this.findItemById(i.items,n);p&&p.type==="folder"&&(p.items=p.items||[],p.items.push(r))}else i.items.push(r)}async deleteItem(e,r){let n=this.load(e);if(!n)return!1;let i=this.findItemPath(e,r);if(!i||!Ne.existsSync(i))return!1;try{await Ne.promises.rm(i,{recursive:!0,force:!0}),this.deleteItemFromTree(n.items,r);let s=this.idToSlugMap.get(r);return s&&(this.slugToIdMap.delete(s),this.idToSlugMap.delete(r)),!0}catch(s){return console.error(`[FolderCollectionStore] Failed to delete item ${r}:`,s),!1}}async updateItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemPath(e,r);if(!s)return!1;let o=this.findItemById(i.items,r);if(!o)return!1;let{id:l,type:c,items:d,...p}=n;return Object.assign(o,p),o.type==="folder"?await this.saveFolderToDir(s,o):await this.saveRequestToDir(s,o),!0}async moveItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.idToSlugMap.get(e);if(!s)return!1;let o=this.findItemPath(e,r);if(!o||!Ne.existsSync(o))return!1;let l;if(n){let p=this.findItemPath(e,n);if(!p)return!1;l=p}else l=je.join(this.collectionsDir,s);let c=this.idToSlugMap.get(r);if(!c)return!1;let d=je.join(l,c);if(Ne.existsSync(d))return!1;try{await Ne.promises.rename(o,d);let p=this.findItemById(i.items,r);if(p){let m=p.type==="folder"?{...p,items:p.items?[...p.items]:[]}:{...p};if(this.deleteItemFromTree(i.items,r),n){let y=this.findItemById(i.items,n);y&&y.type==="folder"&&(y.items=y.items||[],y.items.push(m))}else i.items.push(m)}return!0}catch(p){return console.error(`[FolderCollectionStore] Failed to move item ${r}:`,p),!1}}async reorderItems(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.idToSlugMap.get(e);if(!s)return!1;let o=[];for(let l of n){let c=this.idToSlugMap.get(l);c&&o.push(c)}try{if(r){let l=this.findItemPath(e,r);if(!l)return!1;let c=je.join(l,Cr.folder),d=Ne.readFileSync(c,"utf-8"),p=JSON.parse(d);p.order=o,await Ne.promises.writeFile(c,JSON.stringify(p,null,2),"utf-8");let m=this.findItemById(i.items,r);m&&m.type==="folder"&&m.items&&(m.items=this.sortItemsByOrder(m.items,n))}else{let l=je.join(this.collectionsDir,s,Cr.collection),c=Ne.readFileSync(l,"utf-8"),d=JSON.parse(c);d.order=o,await Ne.promises.writeFile(l,JSON.stringify(d,null,2),"utf-8"),i.items=this.sortItemsByOrder(i.items,n)}return!0}catch(l){return console.error("[FolderCollectionStore] Failed to reorder items:",l),!1}}sortItemsByOrder(e,r){return KS(e,r)}findItemPath(e,r){let n=this.idToSlugMap.get(e);if(!n)return;let i=je.join(this.collectionsDir,n),s=rm(i,r);if(s)return s;let o=this.load(e);if(o){let c=this.buildSlugPath(o.items,r);if(c)return je.join(i,...c)}let l=this.idToSlugMap.get(r);if(l)return tm(i,l)}buildSlugPath(e,r){for(let n of e){let i=this.idToSlugMap.get(n.id);if(i){if(n.id===r)return[i];if(n.type==="folder"&&n.items){let s=this.buildSlugPath(n.items,r);if(s)return[i,...s]}}}}findItemById(e,r){return Xh(e,r)}deleteItemFromTree(e,r){return em(e,r)}}});var _t,ka=le(()=>{"use strict";_t=class{static parseSetCookie(e,r){let n=e.split(";").map(p=>p.trim());if(n.length===0)return null;let[i,...s]=n,o=i.indexOf("=");if(o===-1)return null;let l=i.substring(0,o).trim(),c=i.substring(o+1).trim(),d={name:l,value:c,domain:r};for(let p of s){let m=p.indexOf("="),y=(m===-1?p:p.substring(0,m)).toLowerCase(),b=m===-1?"":p.substring(m+1);switch(y){case"domain":d.domain=b.startsWith(".")?b.substring(1):b;break;case"path":d.path=b;break;case"expires":d.expires=b;break;case"max-age":d.maxAge=parseInt(b,10);break;case"httponly":d.httpOnly=!0;break;case"secure":d.secure=!0;break;case"samesite":d.sameSite=b;break}}return d}static parseCookieHeaders(e,r){let n=[],i=e["set-cookie"]||e["Set-Cookie"];if(!i)return n;let s=Array.isArray(i)?i:[i];for(let o of s){let l=this.parseSetCookie(o,r);l&&n.push(l)}return n}static formatCookieHeader(e){return e.map(r=>`${r.name}=${r.value}`).join("; ")}static isExpired(e){return!!(e.expires&&new Date(e.expires).getTime()<Date.now()||e.maxAge!==void 0&&e.maxAge<=0)}static domainMatches(e,r){if(r==="*")return!0;let n=e.toLowerCase().split(".").reverse(),i=r.toLowerCase().split(".").reverse();if(i.length>n.length)return!1;for(let s=0;s<i.length;s++)if(i[s]!==n[s])return!1;return!0}static extractDomain(e){try{return new URL(e).hostname}catch{return""}}static extractPath(e){try{return new URL(e).pathname}catch{return"/"}}}});function Of(t){let e=t.toLowerCase();return e==="_global.json"||e==="_global.local.json"||e.endsWith(".local.json")}function wu(t){if(!ho.existsSync(t))return y2();let e=im(Aa.join(t,"_global.json"))||{},r=e.variables||{},n=e.defaultHeaders||{},i=ho.readdirSync(t).filter(d=>d.endsWith(".json")).filter(d=>!d.endsWith(".local.json")).filter(d=>!Of(d)),s={};for(let d of i){let p=im(Aa.join(t,d))||{},m=Aa.basename(d,".json");s[m]={description:p.description,requiresConfirmation:p.requiresConfirmation,variables:p.variables||{},secretVariables:p.secretVariables}}let l=(im(Aa.join(t,"_global.local.json"))||{}).variables||{},c={};for(let d of Object.keys(s)){let p=Aa.join(t,`${d}.local.json`);if(ho.existsSync(p)){let m=im(p)||{};c[d]={variables:m.variables||{}}}}return{globalVariables:r,defaultHeaders:n,environments:s,localVariables:l,localCredentials:c}}function y2(){return{globalVariables:{},defaultHeaders:{},environments:{},localVariables:{},localCredentials:{}}}function im(t){try{if(!ho.existsSync(t))return null;let e=ho.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){return console.error(`[environment-file-loader] Failed to load JSON from ${t}:`,e),null}}var ho,Aa,sm=le(()=>{"use strict";ho=ve(require("fs")),Aa=ve(require("path"))});var Hn,_u=le(()=>{"use strict";Hn=class{buildUrl(e,r={},n={}){let i=e;return i=this.replacePathParams(i,r),i=this.appendQueryParams(i,n),i}replacePathParams(e,r){let n="",i="",s=e,o="",l=e.indexOf("?");l!==-1&&(o=e.substring(l),s=e.substring(0,l));let c=s.match(/^(https?:\/\/)([^\/]*)(\/.*)?$/);c&&(n=c[1],i=c[2],s=c[3]||"/");let d=/:(\w+)(?:\([^)]*\))?(\?)?/g,p=s.replace(d,(m,y,b)=>{let q=r[y];return q!==void 0&&q!==""?encodeURIComponent(q):b?"":(console.warn(`[UrlBuilder] Missing required path parameter: ${y}`),m)});return p=p.replace(/([^:])\/+/g,"$1/"),p.length>1&&p.endsWith("/")&&(p=p.slice(0,-1)),`${n}${i}${p}${o}`}extractPathParams(e){let r=/:(\w+)(?:\([^)]*\))?(\?)?/g,n=[],i;for(;(i=r.exec(e))!==null;)n.push(i[1]);return[...new Set(n)]}appendQueryParams(e,r){let n=e,i={};if(e.includes("?")){let[c,d]=e.split("?");n=c,d&&new URLSearchParams(d).forEach((m,y)=>{i[y]=m})}let s={...i,...r},o=new URLSearchParams;for(let[c,d]of Object.entries(s))d!=null&&o.append(c,d);let l=o.toString();return l?`${n}?${l}`:n}}});function Cq(t,e=0){return(gr[t[e+0]]+gr[t[e+1]]+gr[t[e+2]]+gr[t[e+3]]+"-"+gr[t[e+4]]+gr[t[e+5]]+"-"+gr[t[e+6]]+gr[t[e+7]]+"-"+gr[t[e+8]]+gr[t[e+9]]+"-"+gr[t[e+10]]+gr[t[e+11]]+gr[t[e+12]]+gr[t[e+13]]+gr[t[e+14]]+gr[t[e+15]]).toLowerCase()}var gr,Eq=le(()=>{gr=[];for(let t=0;t<256;++t)gr.push((t+256).toString(16).slice(1))});function XS(){return crypto.getRandomValues(v2)}var v2,qq=le(()=>{v2=new Uint8Array(16)});function b2(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():S2(t,e,r)}function S2(t,e,r){t=t||{};let n=t.random??t.rng?.()??XS();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){if(r=r||0,r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let i=0;i<16;++i)e[r+i]=n[i];return e}return Cq(n)}var Ru,Iq=le(()=>{qq();Eq();Ru=b2});var ew=le(()=>{Iq()});function w2(t=0,e=999){return Math.floor(Math.random()*(e-t+1))+t}function _2(){return Date.now()}function Oq(){return Ru()}function R2(){return Ru()}function Pq(t=10){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r="";for(let n=0;n<t;n++)r+=e.charAt(Math.floor(Math.random()*e.length));return r}function x2(){let t=Pq(8).toLowerCase(),e=["example.com","test.org","mail.dev","sample.net"];return`${t}@${e[Math.floor(Math.random()*e.length)]}`}function C2(){return Math.random()<.5}function E2(t=10){let e="0123456789abcdef",r="";for(let n=0;n<t;n++)r+=e.charAt(Math.floor(Math.random()*e.length));return r}function q2(){return Math.floor(Date.now()/1e3)}function I2(){return new Date().toISOString()}function O2(){return new Date().toISOString().split("T")[0]}function P2(){return new Date().toISOString().split("T")[1].split(".")[0]}function k2(){return new Date().toISOString()}function A2(t=""){return Buffer.from(String(t)).toString("base64")}function T2(t=""){return Buffer.from(String(t),"base64").toString("utf-8")}function $2(t=""){return encodeURIComponent(String(t))}function N2(t=""){return decodeURIComponent(String(t))}function M2(t){return t?t.split(",").map(e=>{let r=e.trim(),n=Number(r);return!isNaN(n)&&r!==""?n:r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'")?r.slice(1,-1):r}):[]}function Vi(t,e){let r=tw[t];return r?e&&e.length>0?r(...e):r():null}function kq(t){return!t||typeof t!="string"?t:t.replace(/\{\{\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?\}\}/g,(e,r,n)=>{try{let i=n?M2(n):void 0,s=Vi(r,i);return s===null?e:String(s)}catch{return e}})}function mo(t,e){let r=/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,n=null,i;for(;(i=r.exec(t))!==null;){let s=i[0],o=i[1];if(!(s in e)){let l=Vi(o);l!==null&&(n||(n={...e}),n[s]=l)}}return n??e}var tw,om=le(()=>{"use strict";ew();tw={randomInt:w2,timestamp:_2,guid:R2,uuid:Oq,randomUUID:Oq,randomString:Pq,randomHexadecimal:E2,randomEmail:x2,randomBoolean:C2,isoTimestamp:k2,timestamp_s:q2,datetime:I2,date:O2,time:P2,base64Encode:A2,base64Decode:T2,urlEncode:$2,urlDecode:N2}});function go(t){let e=t.trim();return!e||/^(\$?)[a-zA-Z_][a-zA-Z0-9_]*(\([^)]*\))?$/.test(e)||/(?<!\|)\|(?!\|)/.test(e)?!1:/[+\-*/%<>=!&|?:~^()[\]{}.,`]/.test(e)}function ui(t,e={}){try{let r={...e,Math,Date,JSON,Number,String,Boolean,Array,Object,parseInt,parseFloat,isNaN,isFinite,encodeURIComponent,decodeURIComponent,encodeURI,decodeURI,undefined:void 0,null:null,true:!0,false:!1,NaN:NaN,Infinity:1/0},n=am.createContext(r);return am.runInContext(t,n,{timeout:F2,displayErrors:!1})}catch{return}}var am,F2,Pf=le(()=>{"use strict";am=ve(require("vm")),F2=100});function D2(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function xu(t){if(!t||!t.includes("|"))return null;let e=j2(t);if(e.length<2)return null;let r=e[0].trim(),n=[];for(let i=1;i<e.length;i++){let s=e[i].trim();if(!s)continue;let o=L2(s);o&&n.push(o)}return n.length===0?null:{input:r,filters:n}}function j2(t){let e=[],r="",n=0,i=!1,s=!1;for(let o=0;o<t.length;o++){let l=t[o],c=o>0?t[o-1]:"",d=o<t.length-1?t[o+1]:"";if(c==="\\"){r+=l;continue}if(l==="'"&&!s)i=!i;else if(l==='"'&&!i)s=!s;else if(l==="("&&!i&&!s)n++;else if(l===")"&&!i&&!s)n--;else if(l==="|"&&n===0&&!i&&!s){if(d==="|"){r+="||",o++;continue}e.push(r),r="";continue}r+=l}return r&&e.push(r),e}function L2(t){let e=t.indexOf("(");if(e===-1)return{name:t.trim(),args:[]};let r=t.substring(0,e).trim(),n=t.substring(e+1,t.lastIndexOf(")"));return{name:r,args:U2(n)}}function U2(t){if(!t||!t.trim())return[];let e=[],r="",n=!1,i=!1;for(let s=0;s<t.length;s++){let o=t[s];if((s>0?t[s-1]:"")==="\\"){r+=o;continue}if(o==="'"&&!i){n=!n,r+=o;continue}else if(o==='"'&&!n){i=!i,r+=o;continue}else if(o===","&&!n&&!i){e.push(r.trim()),r="";continue}r+=o}return r.trim()&&e.push(r.trim()),e}function zt(t,e){if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);let r=Number(t);if(!isNaN(r)&&t!=="")return r;if(t==="true")return!0;if(t==="false")return!1;if(e&&t in e){let n=D2(e[t]),i=Number(n);return!isNaN(i)&&n!==""?i:n}return t}function Cu(t,e,r={}){let n=t;for(let i of e)n=H2(n,i.name,i.args,r);return n}function H2(t,e,r,n){switch(e){case"upper":return String(t).toUpperCase();case"lower":return String(t).toLowerCase();case"trim":return String(t).trim();case"length":return Array.isArray(t)?t.length:String(t).length;case"substring":{let i=zt(r[0],n),s=r[1]!==void 0?zt(r[1],n):void 0;return String(t).substring(i<0?String(t).length+i:i,s!==void 0?s<0?String(t).length+s:s:void 0)}case"replace":{let i=r[0]!==void 0?String(zt(r[0],n)):"",s=r[1]!==void 0?String(zt(r[1],n)):"";return String(t).replace(new RegExp(V2(i),"g"),s)}case"split":{let i=r[0]!==void 0?String(zt(r[0],n)):",";return String(t).split(i)}case"join":{let i=r[0]!==void 0?String(zt(r[0],n)):",";return Array.isArray(t)?t.join(i):String(t)}case"removeQuotes":return String(t).replace(/["']/g,"");case"removeSpaces":return String(t).replace(/\s/g,"");case"format":{let i=r[0]!==void 0?String(zt(r[0],n)):"{0}";i=i.replace("{0}",String(t));for(let s=1;s<r.length;s++){let o=zt(r[s],n);i=i.replace(`{${s}}`,String(o))}return i}case"add":{let i=zt(r[0],n);return Number(t)+i}case"subtract":{let i=zt(r[0],n);return Number(t)-i}case"multiply":{let i=zt(r[0],n);return Number(t)*i}case"abs":return Math.abs(Number(t));case"btoa":return Buffer.from(String(t)).toString("base64");case"atob":return Buffer.from(String(t),"base64").toString("utf-8");case"urlEncode":return encodeURIComponent(String(t));case"urlDecode":return decodeURIComponent(String(t));case"hash":{let i=String(r[0]!==void 0?zt(r[0],n):"md5").toLowerCase(),s=String(r[1]!==void 0?zt(r[1],n):"base64"),l={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[i]||"md5";return lm.createHash(l).update(String(t)).digest(s)}case"hmac":{let i=r[0]?String(zt(r[0],n)):"",s=String(r[1]!==void 0?zt(r[1],n):"sha256").toLowerCase(),o=String(r[2]!==void 0?zt(r[2],n):"base64"),c={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[s]||"sha256";return lm.createHmac(c,i).update(String(t)).digest(o)}case"first":return Array.isArray(t)?t[0]:t;case"last":return Array.isArray(t)?t[t.length-1]:t;case"at":{let i=zt(r[0],n);return Array.isArray(t)?t.at(i):t}case"slice":{let i=zt(r[0],n),s=r[1]!==void 0?zt(r[1],n):void 0;return Array.isArray(t)?t.slice(i,s):String(t).slice(i,s)}case"unique":return Array.isArray(t)?[...new Set(t)]:t;case"filter":return!Array.isArray(t)||!r[0]?t:B2(t,r[0],n);case"map":{if(!Array.isArray(t))return t;let i=r.map(s=>String(zt(s,n)));return i.length===1?t.map(s=>kf(s,i[0])):t.map(s=>{let o={};for(let l of i){let c=kf(s,l);c!==void 0&&(o[l]=c)}return o})}case"prop":{let i=r[0]!==void 0?String(zt(r[0],n)):"";if(Array.isArray(t)){let s=t.map(o=>kf(o,i)).filter(o=>o!==void 0);return s.length===1?s[0]:s.join(",")}return t&&typeof t=="object"?kf(t,i):t}case"parseJSON":try{return JSON.parse(String(t))}catch{return t}case"stringify":try{return JSON.stringify(t)}catch{return String(t)}case"isEmail":return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(t));case"isUrl":try{return new URL(String(t)),!0}catch{return!1}case"setIfValue":return t||void 0;case"setNull":return t===null?null:t;default:return t}}function B2(t,e,r){let n=e.match(/^([\w.]+)\s*(>=|<=|!=|\*=|\^=|\$=|>|<|=)\s*(.+)$/);if(!n)return t;let[,i,s,o]=n,l=zt(o,r);return t.filter(c=>{let d=kf(c,i);if(d===void 0)return!1;switch(s){case">":return Number(d)>Number(l);case">=":return Number(d)>=Number(l);case"<":return Number(d)<Number(l);case"<=":return Number(d)<=Number(l);case"=":return String(d)===String(l);case"!=":return String(d)!==String(l);case"*=":return String(d).includes(String(l));case"^=":return String(d).startsWith(String(l));case"$=":return String(d).endsWith(String(l));default:return!0}})}function kf(t,e){if(!(!t||typeof t!="object"))return e in t?t[e]:e.split(".").reduce((r,n)=>r?.[n],t)}function V2(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var lm,um=le(()=>{"use strict";lm=ve(require("crypto"))});function Aq(t,e){if(t)return t.split(",").map(r=>{let n=r.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);let i=Number(n);if(!isNaN(i)&&n!=="")return i;if(e&&n in e){let s=e[n],o=Number(s);return!isNaN(o)&&s!==""?o:s}return n})}function Tq(t){return new yo(t)}var yo,vo,Af=le(()=>{"use strict";om();Pf();um();yo=class t{allVariables;static MAX_RESOLUTION_DEPTH=20;constructor(e){this.allVariables={...e.globals,...e.collectionVariables,...e.environmentVariables,...e.variables}}resolveString(e,r=!1){return typeof e!="string"?e:this.resolveUntilStable(e,this.allVariables,r)}resolveStringWithExtra(e,r,n=!1){if(typeof e!="string")return e;let i={...this.allVariables,...r};return this.resolveUntilStable(e,i,n)}resolveUntilStable(e,r,n){let i=e;for(let s=0;s<t.MAX_RESOLUTION_DEPTH;s++){let o=this.resolveSinglePass(i,r,n);if(o===i)break;i=o}return i}resolveSinglePass(e,r,n){if(!n)return e.replace(/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,(c,d)=>this.resolveTemplateContent(d.trim(),r,c));let i="",s=0,o=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,l;for(;(l=o.exec(e))!==null;){let c=l[1].trim(),d=this.resolveTemplateContent(c,r,l[0]);if(d!==l[0]){i+=e.slice(s,l.index);let p=this.getStringContext(e,l.index);i+=p?this.escapeForString(String(d),p):String(d)}else i+=e.slice(s,l.index+l[0].length);s=l.index+l[0].length}return i+=e.slice(s),i}resolveObject(e,r=!1){if(typeof e=="string")return this.resolveString(e,r);if(Array.isArray(e))return e.map(n=>this.resolveObject(n,r));if(e!==null&&typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.resolveObject(s,r);return n}return e}resolveObjectWithExtra(e,r,n=!1){if(typeof e=="string")return this.resolveStringWithExtra(e,r,n);if(Array.isArray(e))return e.map(i=>this.resolveObjectWithExtra(i,r,n));if(e!==null&&typeof e=="object"){let i={};for(let[s,o]of Object.entries(e))i[s]=this.resolveObjectWithExtra(o,r,n);return i}return e}resolveTemplateContent(e,r,n){let i=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(i){let l=Aq(i[2],r),c=Vi(i[1],l);return c!==null?String(c):n}let s=xu(e);if(s){let l=this.resolveFilterInput(s.input,r);if(l!==void 0){let c=Cu(l,s.filters,r);return c!==void 0?String(c):n}return n}let o=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(o){let l=o[1];if(r[l]!==void 0){let c=this.deserializeValue(r[l]),d=o[2],p=this.resolvePropertyAccess(c,d);if(p!==void 0)return typeof p=="object"?JSON.stringify(p):String(p)}}if(r[e]!==void 0){let l=r[e];if(typeof l=="string"&&l.charCodeAt(0)===30){let c=l.slice(1);return c==="undefined"?"":c}return String(l)}if(go(e)){let l=this.deserializeVariables(r),c=mo(e,l),d=ui(e,c);if(d!==void 0)return String(d)}return n}resolveFilterInput(e,r){if(e==="@")return"";if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1);let n=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(n){let s=Aq(n[2],r),o=Vi(n[1],s);return o!==null?o:void 0}let i=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(i){let s=i[1];if(r[s]!==void 0){let o=this.deserializeValue(r[s]),l=this.resolvePropertyAccess(o,i[2]);if(l!==void 0)return l}}if(r[e]!==void 0)return this.deserializeValue(r[e]);if(go(e)){let s=this.deserializeVariables(r),o=mo(e,s),l=ui(e,o);if(l!==void 0)return l}}deserializeValue(e){if(typeof e=="string"&&e.charCodeAt(0)===30){let r=e.slice(1);if(r==="undefined")return;try{return JSON.parse(r)}catch{return e}}return e}deserializeVariables(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.deserializeValue(i);return r}resolvePropertyAccess(e,r){let n=e,i=/\[(\d+|"[^"]*"|'[^']*')\]|\.([a-zA-Z_][a-zA-Z0-9_]*)/g,s;for(;(s=i.exec(r))!==null;){if(n==null)return;if(s[1]!==void 0){let o=s[1];/^\d+$/.test(o)?n=n[Number(o)]:n=n[o.slice(1,-1)]}else s[2]!==void 0&&(n=n[s[2]])}return n}escapeForString(e,r){let n=e.replace(/\\/g,"\\\\");return r==='"'?n=n.replace(/"/g,'\\"'):n=n.replace(/'/g,"\\'"),n.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}getStringContext(e,r){let n=null;for(let i=0;i<r;i++){let s=e[i];(i>0?e[i-1]:"")!=="\\"&&(s==='"'||s==="'")&&(n===null?n=s:n===s&&(n=null))}return n}},vo=class{interpolate(e,r){return!e||typeof e!="string"?e:new yo({globals:{},collectionVariables:{},environmentVariables:{},variables:r}).resolveString(e,!0)}extractVariables(e){if(!e||typeof e!="string")return[];let r=[],n,i=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g;for(;(n=i.exec(e))!==null;){let s=n[1].trim();!s.startsWith("$")&&!s.includes("|")&&/^[a-zA-Z_]\w*$/.test(s)&&(r.includes(s)||r.push(s))}return r}interpolateObject(e,r){if(e==null)return e;if(typeof e=="string")return this.interpolate(e,r);if(Array.isArray(e))return e.map(n=>this.interpolateObject(n,r));if(typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.interpolateObject(s,r);return n}return e}}});var Wi,Tf=le(()=>{"use strict";Wi=class{constructor(e,r,n){this.urlBuilder=e;this.interceptors=r;this.httpClient=n}urlBuilder;interceptors;httpClient;async execute(e){let r={},n;try{n=await this.interceptors.executeRequestInterceptors(e,r)}catch(i){let s=await this.interceptors.executeErrorInterceptors(i,e,r);if(s)return s;throw i}try{let i=await this.httpClient.send(n);return await this.interceptors.executeResponseInterceptors(i,n,r)}catch(i){let s=await this.interceptors.executeErrorInterceptors(i,n,r);if(s)return s;throw i}}buildUrl(e,r={},n={}){return this.urlBuilder.buildUrl(e,r,n)}}});var zi,cm,fm,dm,$f=le(()=>{"use strict";zi=class{requestInterceptors=[];responseInterceptors=[];errorInterceptors=[];addRequestInterceptor(e){return this.requestInterceptors.push(e),this.sortByPriority(this.requestInterceptors),this}addResponseInterceptor(e){return this.responseInterceptors.push(e),this.sortByPriority(this.responseInterceptors),this}addErrorInterceptor(e){return this.errorInterceptors.push(e),this.sortByPriority(this.errorInterceptors),this}removeRequestInterceptor(e){let r=this.requestInterceptors.findIndex(n=>n.name===e);return r>=0?(this.requestInterceptors.splice(r,1),!0):!1}removeResponseInterceptor(e){let r=this.responseInterceptors.findIndex(n=>n.name===e);return r>=0?(this.responseInterceptors.splice(r,1),!0):!1}removeErrorInterceptor(e){let r=this.errorInterceptors.findIndex(n=>n.name===e);return r>=0?(this.errorInterceptors.splice(r,1),!0):!1}async executeRequestInterceptors(e,r){let n=e;for(let i of this.requestInterceptors)try{n=await i.intercept(n,r)}catch(s){throw console.error(`[InterceptorChain] Request interceptor '${i.name}' failed:`,s),s}return n}async executeResponseInterceptors(e,r,n){let i=e;for(let s of this.responseInterceptors)try{i=await s.intercept(i,r,n)}catch(o){throw console.error(`[InterceptorChain] Response interceptor '${s.name}' failed:`,o),o}return i}async executeErrorInterceptors(e,r,n){for(let i of this.errorInterceptors)try{let s=await i.handle(e,r,n);if(s)return s}catch(s){console.error(`[InterceptorChain] Error interceptor '${i.name}' failed:`,s)}}clear(){this.requestInterceptors=[],this.responseInterceptors=[],this.errorInterceptors=[]}getRegisteredInterceptors(){return{request:this.requestInterceptors.map(e=>e.name),response:this.responseInterceptors.map(e=>e.name),error:this.errorInterceptors.map(e=>e.name)}}sortByPriority(e){e.sort((r,n)=>(r.priority??100)-(n.priority??100))}},cm=class{name="logging";priority=1e3;intercept(e,r){return e}},fm=class{name="timing";priority=1;intercept(e,r,n){return e}},dm=class{name="retry";priority=1;maxRetries;retryableErrors;constructor(e=3,r=["ECONNRESET","ETIMEDOUT"]){this.maxRetries=e,this.retryableErrors=r}handle(e,r,n){let i=this.retryableErrors.some(s=>e.message.includes(s))}}});var $q=V((Eu,Nf)=>{(function(){var t,e="4.18.1",r=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",s="Invalid `variable` option passed into `_.template`",o="Invalid `imports` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,d="__lodash_placeholder__",p=1,m=2,y=4,b=1,q=2,x=1,v=2,_=4,E=8,k=16,P=32,M=64,j=128,I=256,R=512,A=30,F="...",U=800,D=16,J=1,Q=2,se=3,fe=1/0,Be=9007199254740991,Re=17976931348623157e292,ye=NaN,ke=4294967295,mt=ke-1,Nt=ke>>>1,he=[["ary",j],["bind",x],["bindKey",v],["curry",E],["curryRight",k],["flip",R],["partial",P],["partialRight",M],["rearg",I]],Yt="[object Arguments]",Tr="[object Array]",lt="[object AsyncFunction]",$r="[object Boolean]",wr="[object Date]",xt="[object DOMException]",St="[object Error]",Gr="[object Function]",Ws="[object GeneratorFunction]",At="[object Map]",Ai="[object Number]",On="[object Null]",te="[object Object]",re="[object Promise]",Te="[object Proxy]",ge="[object RegExp]",we="[object Set]",Ze="[object String]",Ct="[object Symbol]",or="[object Undefined]",oe="[object WeakMap]",fr="[object WeakSet]",Lt="[object ArrayBuffer]",gt="[object DataView]",qe="[object Float32Array]",Pn="[object Float64Array]",Ol="[object Int8Array]",zs="[object Int16Array]",ea="[object Int32Array]",Js="[object Uint8Array]",Ti="[object Uint8ClampedArray]",Gs="[object Uint16Array]",Bc="[object Uint32Array]",Pl=/\b__p \+= '';/g,Ov=/\b(__p \+=) '' \+/g,ta=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ls=/&(?:amp|lt|gt|quot|#39);/g,kl=/[&<>"']/g,Al=RegExp(ls.source),me=RegExp(kl.source),Pv=/<%-([\s\S]+?)%>/g,kv=/<%([\s\S]+?)%>/g,kn=/<%=([\s\S]+?)%>/g,Yr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ve=/^\w*$/,Vc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ft=/[\\^$.*+?()[\]{}|]/g,ra=RegExp(ft.source),Wc=/^\s+/,Tl=/\s/,dr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Qn=/\{\n\/\* \[wrapped with (.+)\] \*/,An=/,? & /,Kt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Kr=/[()=,{}\[\]\/\s]/,Zn=/\\(\\)?/g,us=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Lp=/\w*$/,Av=/^[-+]0x[0-9a-f]+$/i,na=/^0b[01]+$/i,Up=/^\[object .+?Constructor\]$/,Tv=/^0o[0-7]+$/i,Ys=/^(?:0|[1-9]\d*)$/,ia=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,sa=/($^)/,$v=/['\n\r\u2028\u2029\\]/g,$l="\\ud800-\\udfff",Nv="\\u0300-\\u036f",Ut="\\ufe20-\\ufe2f",zc="\\u20d0-\\u20ff",Hp=Nv+Ut+zc,Jc="\\u2700-\\u27bf",Gc="a-z\\xdf-\\xf6\\xf8-\\xff",Mv="\\xac\\xb1\\xd7\\xf7",Fv="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Dv="\\u2000-\\u206f",jv=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Bp="A-Z\\xc0-\\xd6\\xd8-\\xde",Vp="\\ufe0e\\ufe0f",Yc=Mv+Fv+Dv+jv,Nl="['\u2019]",Lv="["+$l+"]",Wp="["+Yc+"]",Ml="["+Hp+"]",Kc="\\d+",Uv="["+Jc+"]",Ks="["+Gc+"]",oa="[^"+$l+Yc+Kc+Jc+Gc+Bp+"]",Fl="\\ud83c[\\udffb-\\udfff]",aa="(?:"+Ml+"|"+Fl+")",Tn="[^"+$l+"]",Qc="(?:\\ud83c[\\udde6-\\uddff]){2}",Zc="[\\ud800-\\udbff][\\udc00-\\udfff]",Qs="["+Bp+"]",zp="\\u200d",Jp="(?:"+Ks+"|"+oa+")",Hv="(?:"+Qs+"|"+oa+")",Gp="(?:"+Nl+"(?:d|ll|m|re|s|t|ve))?",Yp="(?:"+Nl+"(?:D|LL|M|RE|S|T|VE))?",Dl=aa+"?",Kp="["+Vp+"]?",Qp="(?:"+zp+"(?:"+[Tn,Qc,Zc].join("|")+")"+Kp+Dl+")*",Bv="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Vv="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Zp=Kp+Dl+Qp,Wv="(?:"+[Uv,Qc,Zc].join("|")+")"+Zp,zv="(?:"+[Tn+Ml+"?",Ml,Qc,Zc,Lv].join("|")+")",Jv=RegExp(Nl,"g"),Gv=RegExp(Ml,"g"),Xc=RegExp(Fl+"(?="+Fl+")|"+zv+Zp,"g"),Yv=RegExp([Qs+"?"+Ks+"+"+Gp+"(?="+[Wp,Qs,"$"].join("|")+")",Hv+"+"+Yp+"(?="+[Wp,Qs+Jp,"$"].join("|")+")",Qs+"?"+Jp+"+"+Gp,Qs+"+"+Yp,Vv,Bv,Kc,Wv].join("|"),"g"),Kv=RegExp("["+zp+$l+Hp+Vp+"]"),Qv=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Zv=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Xv=-1,Pt={};Pt[qe]=Pt[Pn]=Pt[Ol]=Pt[zs]=Pt[ea]=Pt[Js]=Pt[Ti]=Pt[Gs]=Pt[Bc]=!0,Pt[Yt]=Pt[Tr]=Pt[Lt]=Pt[$r]=Pt[gt]=Pt[wr]=Pt[St]=Pt[Gr]=Pt[At]=Pt[Ai]=Pt[te]=Pt[ge]=Pt[we]=Pt[Ze]=Pt[oe]=!1;var Et={};Et[Yt]=Et[Tr]=Et[Lt]=Et[gt]=Et[$r]=Et[wr]=Et[qe]=Et[Pn]=Et[Ol]=Et[zs]=Et[ea]=Et[At]=Et[Ai]=Et[te]=Et[ge]=Et[we]=Et[Ze]=Et[Ct]=Et[Js]=Et[Ti]=Et[Gs]=Et[Bc]=!0,Et[St]=Et[Gr]=Et[oe]=!1;var ef={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},tf={"&":"&","<":"<",">":">",'"':""","'":"'"},eb={"&":"&","<":"<",">":">",""":'"',"'":"'"},Xp={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},eh=parseFloat,tb=parseInt,th=typeof global=="object"&&global&&global.Object===Object&&global,rb=typeof self=="object"&&self&&self.Object===Object&&self,er=th||rb||Function("return this")(),jl=typeof Eu=="object"&&Eu&&!Eu.nodeType&&Eu,dt=jl&&typeof Nf=="object"&&Nf&&!Nf.nodeType&&Nf,Zs=dt&&dt.exports===jl,cs=Zs&&th.process,Qr=(function(){try{var W=dt&&dt.require&&dt.require("util").types;return W||cs&&cs.binding&&cs.binding("util")}catch{}})(),rf=Qr&&Qr.isArrayBuffer,rh=Qr&&Qr.isDate,nh=Qr&&Qr.isMap,la=Qr&&Qr.isRegExp,Xn=Qr&&Qr.isSet,Ll=Qr&&Qr.isTypedArray;function Nr(W,Z,Y){switch(Y.length){case 0:return W.call(Z);case 1:return W.call(Z,Y[0]);case 2:return W.call(Z,Y[0],Y[1]);case 3:return W.call(Z,Y[0],Y[1],Y[2])}return W.apply(Z,Y)}function ei(W,Z,Y,pe){for(var Oe=-1,ut=W==null?0:W.length;++Oe<ut;){var vt=W[Oe];Z(pe,vt,Y(vt),W)}return pe}function Mr(W,Z){for(var Y=-1,pe=W==null?0:W.length;++Y<pe&&Z(W[Y],Y,W)!==!1;);return W}function nf(W,Z){for(var Y=W==null?0:W.length;Y--&&Z(W[Y],Y,W)!==!1;);return W}function ih(W,Z){for(var Y=-1,pe=W==null?0:W.length;++Y<pe;)if(!Z(W[Y],Y,W))return!1;return!0}function $i(W,Z){for(var Y=-1,pe=W==null?0:W.length,Oe=0,ut=[];++Y<pe;){var vt=W[Y];Z(vt,Y,W)&&(ut[Oe++]=vt)}return ut}function Ul(W,Z){var Y=W==null?0:W.length;return!!Y&&fs(W,Z,0)>-1}function Xs(W,Z,Y){for(var pe=-1,Oe=W==null?0:W.length;++pe<Oe;)if(Y(Z,W[pe]))return!0;return!1}function qt(W,Z){for(var Y=-1,pe=W==null?0:W.length,Oe=Array(pe);++Y<pe;)Oe[Y]=Z(W[Y],Y,W);return Oe}function Ni(W,Z){for(var Y=-1,pe=Z.length,Oe=W.length;++Y<pe;)W[Oe+Y]=Z[Y];return W}function sf(W,Z,Y,pe){var Oe=-1,ut=W==null?0:W.length;for(pe&&ut&&(Y=W[++Oe]);++Oe<ut;)Y=Z(Y,W[Oe],Oe,W);return Y}function nb(W,Z,Y,pe){var Oe=W==null?0:W.length;for(pe&&Oe&&(Y=W[--Oe]);Oe--;)Y=Z(Y,W[Oe],Oe,W);return Y}function Hl(W,Z){for(var Y=-1,pe=W==null?0:W.length;++Y<pe;)if(Z(W[Y],Y,W))return!0;return!1}var ib=ua("length");function sb(W){return W.split("")}function ob(W){return W.match(Kt)||[]}function sh(W,Z,Y){var pe;return Y(W,function(Oe,ut,vt){if(Z(Oe,ut,vt))return pe=ut,!1}),pe}function Bl(W,Z,Y,pe){for(var Oe=W.length,ut=Y+(pe?1:-1);pe?ut--:++ut<Oe;)if(Z(W[ut],ut,W))return ut;return-1}function fs(W,Z,Y){return Z===Z?mb(W,Z,Y):Bl(W,ds,Y)}function ab(W,Z,Y,pe){for(var Oe=Y-1,ut=W.length;++Oe<ut;)if(pe(W[Oe],Z))return Oe;return-1}function ds(W){return W!==W}function oh(W,Z){var Y=W==null?0:W.length;return Y?af(W,Z)/Y:ye}function ua(W){return function(Z){return Z==null?t:Z[W]}}function of(W){return function(Z){return W==null?t:W[Z]}}function Vl(W,Z,Y,pe,Oe){return Oe(W,function(ut,vt,Xe){Y=pe?(pe=!1,ut):Z(Y,ut,vt,Xe)}),Y}function lb(W,Z){var Y=W.length;for(W.sort(Z);Y--;)W[Y]=W[Y].value;return W}function af(W,Z){for(var Y,pe=-1,Oe=W.length;++pe<Oe;){var ut=Z(W[pe]);ut!==t&&(Y=Y===t?ut:Y+ut)}return Y}function lf(W,Z){for(var Y=-1,pe=Array(W);++Y<W;)pe[Y]=Z(Y);return pe}function ub(W,Z){return qt(Z,function(Y){return[Y,W[Y]]})}function uf(W){return W&&W.slice(0,fh(W)+1).replace(Wc,"")}function Fr(W){return function(Z){return W(Z)}}function Wl(W,Z){return qt(Z,function(Y){return W[Y]})}function yt(W,Z){return W.has(Z)}function ah(W,Z){for(var Y=-1,pe=W.length;++Y<pe&&fs(Z,W[Y],0)>-1;);return Y}function lh(W,Z){for(var Y=W.length;Y--&&fs(Z,W[Y],0)>-1;);return Y}function uh(W,Z){for(var Y=W.length,pe=0;Y--;)W[Y]===Z&&++pe;return pe}var cb=of(ef),fb=of(tf);function db(W){return"\\"+Xp[W]}function ca(W,Z){return W==null?t:W[Z]}function eo(W){return Kv.test(W)}function pb(W){return Qv.test(W)}function hb(W){for(var Z,Y=[];!(Z=W.next()).done;)Y.push(Z.value);return Y}function to(W){var Z=-1,Y=Array(W.size);return W.forEach(function(pe,Oe){Y[++Z]=[Oe,pe]}),Y}function fa(W,Z){return function(Y){return W(Z(Y))}}function $n(W,Z){for(var Y=-1,pe=W.length,Oe=0,ut=[];++Y<pe;){var vt=W[Y];(vt===Z||vt===d)&&(W[Y]=d,ut[Oe++]=Y)}return ut}function zl(W){var Z=-1,Y=Array(W.size);return W.forEach(function(pe){Y[++Z]=pe}),Y}function ch(W){var Z=-1,Y=Array(W.size);return W.forEach(function(pe){Y[++Z]=[pe,pe]}),Y}function mb(W,Z,Y){for(var pe=Y-1,Oe=W.length;++pe<Oe;)if(W[pe]===Z)return pe;return-1}function cf(W,Z,Y){for(var pe=Y+1;pe--;)if(W[pe]===Z)return pe;return pe}function Mi(W){return eo(W)?yb(W):ib(W)}function Dr(W){return eo(W)?vb(W):sb(W)}function fh(W){for(var Z=W.length;Z--&&Tl.test(W.charAt(Z)););return Z}var gb=of(eb);function yb(W){for(var Z=Xc.lastIndex=0;Xc.test(W);)++Z;return Z}function vb(W){return W.match(Xc)||[]}function bb(W){return W.match(Yv)||[]}var Sb=(function W(Z){Z=Z==null?er:Fi.defaults(er.Object(),Z,Fi.pick(er,Zv));var Y=Z.Array,pe=Z.Date,Oe=Z.Error,ut=Z.Function,vt=Z.Math,Xe=Z.Object,Jl=Z.RegExp,wb=Z.String,jr=Z.TypeError,da=Y.prototype,_b=ut.prototype,ro=Xe.prototype,pa=Z["__core-js_shared__"],Gl=_b.toString,pt=ro.hasOwnProperty,Rb=0,dh=(function(){var a=/[^.]+$/.exec(pa&&pa.keys&&pa.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""})(),Yl=ro.toString,xb=Gl.call(Xe),Cb=er._,Eb=Jl("^"+Gl.call(pt).replace(ft,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Kl=Zs?Z.Buffer:t,Di=Z.Symbol,Ql=Z.Uint8Array,ph=Kl?Kl.allocUnsafe:t,Zl=fa(Xe.getPrototypeOf,Xe),hh=Xe.create,ha=ro.propertyIsEnumerable,Xl=da.splice,mh=Di?Di.isConcatSpreadable:t,ma=Di?Di.iterator:t,ps=Di?Di.toStringTag:t,eu=(function(){try{var a=Ca(Xe,"defineProperty");return a({},"",{}),a}catch{}})(),qb=Z.clearTimeout!==er.clearTimeout&&Z.clearTimeout,Ib=pe&&pe.now!==er.Date.now&&pe.now,Ob=Z.setTimeout!==er.setTimeout&&Z.setTimeout,ga=vt.ceil,ya=vt.floor,tu=Xe.getOwnPropertySymbols,ru=Kl?Kl.isBuffer:t,hs=Z.isFinite,nu=da.join,gh=fa(Xe.keys,Xe),Tt=vt.max,ar=vt.min,yh=pe.now,Pb=Z.parseInt,vh=vt.random,kb=da.reverse,ff=Ca(Z,"DataView"),va=Ca(Z,"Map"),df=Ca(Z,"Promise"),no=Ca(Z,"Set"),ba=Ca(Z,"WeakMap"),Sa=Ca(Xe,"create"),iu=ba&&new ba,io={},Ab=Ea(ff),Tb=Ea(va),$b=Ea(df),Nb=Ea(no),Mb=Ea(ba),su=Di?Di.prototype:t,wa=su?su.valueOf:t,bh=su?su.toString:t;function $(a){if(Wt(a)&&!$e(a)&&!(a instanceof We)){if(a instanceof _r)return a;if(pt.call(a,"__wrapped__"))return ME(a)}return new _r(a)}var so=(function(){function a(){}return function(u){if(!Ht(u))return{};if(hh)return hh(u);a.prototype=u;var h=new a;return a.prototype=t,h}})();function ou(){}function _r(a,u){this.__wrapped__=a,this.__actions__=[],this.__chain__=!!u,this.__index__=0,this.__values__=t}$.templateSettings={escape:Pv,evaluate:kv,interpolate:kn,variable:"",imports:{_:$}},$.prototype=ou.prototype,$.prototype.constructor=$,_r.prototype=so(ou.prototype),_r.prototype.constructor=_r;function We(a){this.__wrapped__=a,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ke,this.__views__=[]}function Fb(){var a=new We(this.__wrapped__);return a.__actions__=Zr(this.__actions__),a.__dir__=this.__dir__,a.__filtered__=this.__filtered__,a.__iteratees__=Zr(this.__iteratees__),a.__takeCount__=this.__takeCount__,a.__views__=Zr(this.__views__),a}function Db(){if(this.__filtered__){var a=new We(this);a.__dir__=-1,a.__filtered__=!0}else a=this.clone(),a.__dir__*=-1;return a}function pf(){var a=this.__wrapped__.value(),u=this.__dir__,h=$e(a),S=u<0,O=h?a.length:0,N=FM(0,O,this.__views__),L=N.start,B=N.end,z=B-L,X=S?B:L-1,ee=this.__iteratees__,ne=ee.length,ce=0,be=ar(z,this.__takeCount__);if(!h||!S&&O==z&&be==z)return sE(a,this.__actions__);var Ee=[];e:for(;z--&&ce<be;){X+=u;for(var De=-1,xe=a[X];++De<ne;){var Ke=ee[De],et=Ke.iteratee,Sn=Ke.type,Hr=et(xe);if(Sn==Q)xe=Hr;else if(!Hr){if(Sn==J)continue e;break e}}Ee[ce++]=xe}return Ee}We.prototype=so(ou.prototype),We.prototype.constructor=We;function Nn(a){var u=-1,h=a==null?0:a.length;for(this.clear();++u<h;){var S=a[u];this.set(S[0],S[1])}}function jb(){this.__data__=Sa?Sa(null):{},this.size=0}function Lb(a){var u=this.has(a)&&delete this.__data__[a];return this.size-=u?1:0,u}function Ub(a){var u=this.__data__;if(Sa){var h=u[a];return h===l?t:h}return pt.call(u,a)?u[a]:t}function Hb(a){var u=this.__data__;return Sa?u[a]!==t:pt.call(u,a)}function Bb(a,u){var h=this.__data__;return this.size+=this.has(a)?0:1,h[a]=Sa&&u===t?l:u,this}Nn.prototype.clear=jb,Nn.prototype.delete=Lb,Nn.prototype.get=Ub,Nn.prototype.has=Hb,Nn.prototype.set=Bb;function ti(a){var u=-1,h=a==null?0:a.length;for(this.clear();++u<h;){var S=a[u];this.set(S[0],S[1])}}function Sh(){this.__data__=[],this.size=0}function Vb(a){var u=this.__data__,h=lu(u,a);if(h<0)return!1;var S=u.length-1;return h==S?u.pop():Xl.call(u,h,1),--this.size,!0}function Wb(a){var u=this.__data__,h=lu(u,a);return h<0?t:u[h][1]}function wh(a){return lu(this.__data__,a)>-1}function zb(a,u){var h=this.__data__,S=lu(h,a);return S<0?(++this.size,h.push([a,u])):h[S][1]=u,this}ti.prototype.clear=Sh,ti.prototype.delete=Vb,ti.prototype.get=Wb,ti.prototype.has=wh,ti.prototype.set=zb;function ri(a){var u=-1,h=a==null?0:a.length;for(this.clear();++u<h;){var S=a[u];this.set(S[0],S[1])}}function Jb(){this.size=0,this.__data__={hash:new Nn,map:new(va||ti),string:new Nn}}function ji(a){var u=Hh(this,a).delete(a);return this.size-=u?1:0,u}function _h(a){return Hh(this,a).get(a)}function Gb(a){return Hh(this,a).has(a)}function Yb(a,u){var h=Hh(this,a),S=h.size;return h.set(a,u),this.size+=h.size==S?0:1,this}ri.prototype.clear=Jb,ri.prototype.delete=ji,ri.prototype.get=_h,ri.prototype.has=Gb,ri.prototype.set=Yb;function ms(a){var u=-1,h=a==null?0:a.length;for(this.__data__=new ri;++u<h;)this.add(a[u])}function ie(a){return this.__data__.set(a,l),this}function Kb(a){return this.__data__.has(a)}ms.prototype.add=ms.prototype.push=ie,ms.prototype.has=Kb;function mn(a){var u=this.__data__=new ti(a);this.size=u.size}function Rh(){this.__data__=new ti,this.size=0}function nt(a){var u=this.__data__,h=u.delete(a);return this.size=u.size,h}function au(a){return this.__data__.get(a)}function xh(a){return this.__data__.has(a)}function hf(a,u){var h=this.__data__;if(h instanceof ti){var S=h.__data__;if(!va||S.length<r-1)return S.push([a,u]),this.size=++h.size,this;h=this.__data__=new ri(S)}return h.set(a,u),this.size=h.size,this}mn.prototype.clear=Rh,mn.prototype.delete=nt,mn.prototype.get=au,mn.prototype.has=xh,mn.prototype.set=hf;function Ch(a,u){var h=$e(a),S=!h&&qa(a),O=!h&&!S&&po(a),N=!h&&!S&&!O&&hu(a),L=h||S||O||N,B=L?lf(a.length,wb):[],z=B.length;for(var X in a)(u||pt.call(a,X))&&!(L&&(X=="length"||O&&(X=="offset"||X=="parent")||N&&(X=="buffer"||X=="byteLength"||X=="byteOffset")||bs(X,z)))&&B.push(X);return B}function Eh(a){var u=a.length;return u?a[uS(0,u-1)]:t}function Qb(a,u){return Bh(Zr(a),Li(u,0,a.length))}function Zb(a){return Bh(Zr(a))}function mf(a,u,h){(h!==t&&!ai(a[u],h)||h===t&&!(u in a))&&gn(a,u,h)}function Lr(a,u,h){var S=a[u];(!(pt.call(a,u)&&ai(S,h))||h===t&&!(u in a))&&gn(a,u,h)}function lu(a,u){for(var h=a.length;h--;)if(ai(a[h][0],u))return h;return-1}function qh(a,u,h,S){return Ui(a,function(O,N,L){u(S,O,h(O),L)}),S}function Ih(a,u){return a&&Hi(u,pr(u),a)}function Xb(a,u){return a&&Hi(u,en(u),a)}function gn(a,u,h){u=="__proto__"&&eu?eu(a,u,{configurable:!0,enumerable:!0,value:h,writable:!0}):a[u]=h}function gf(a,u){for(var h=-1,S=u.length,O=Y(S),N=a==null;++h<S;)O[h]=N?t:NS(a,u[h]);return O}function Li(a,u,h){return a===a&&(h!==t&&(a=a<=h?a:h),u!==t&&(a=a>=u?a:u)),a}function Rr(a,u,h,S,O,N){var L,B=u&p,z=u&m,X=u&y;if(h&&(L=O?h(a,S,O,N):h(a)),L!==t)return L;if(!Ht(a))return a;var ee=$e(a);if(ee){if(L=jM(a),!B)return Zr(a,L)}else{var ne=xr(a),ce=ne==Gr||ne==Ws;if(po(a))return lE(a,B);if(ne==te||ne==Yt||ce&&!O){if(L=z||ce?{}:qE(a),!B)return z?IM(a,Xb(L,a)):qM(a,Ih(L,a))}else{if(!Et[ne])return O?a:{};L=LM(a,ne,B)}}N||(N=new mn);var be=N.get(a);if(be)return be;N.set(a,L),rq(a)?a.forEach(function(xe){L.add(Rr(xe,u,h,xe,a,N))}):eq(a)&&a.forEach(function(xe,Ke){L.set(Ke,Rr(xe,u,h,Ke,a,N))});var Ee=X?z?SS:bS:z?en:pr,De=ee?t:Ee(a);return Mr(De||a,function(xe,Ke){De&&(Ke=xe,xe=a[Ke]),Lr(L,Ke,Rr(xe,u,h,Ke,a,N))}),L}function eS(a){var u=pr(a);return function(h){return Mn(h,a,u)}}function Mn(a,u,h){var S=h.length;if(a==null)return!S;for(a=Xe(a);S--;){var O=h[S],N=u[O],L=a[O];if(L===t&&!(O in a)||!N(L))return!1}return!0}function yf(a,u,h){if(typeof a!="function")throw new jr(i);return xf(function(){a.apply(t,h)},u)}function _a(a,u,h,S){var O=-1,N=Ul,L=!0,B=a.length,z=[],X=u.length;if(!B)return z;h&&(u=qt(u,Fr(h))),S?(N=Xs,L=!1):u.length>=r&&(N=yt,L=!1,u=new ms(u));e:for(;++O<B;){var ee=a[O],ne=h==null?ee:h(ee);if(ee=S||ee!==0?ee:0,L&&ne===ne){for(var ce=X;ce--;)if(u[ce]===ne)continue e;z.push(ee)}else N(u,ne,S)||z.push(ee)}return z}var Ui=pE(Fn),Oh=pE(ni,!0);function tS(a,u){var h=!0;return Ui(a,function(S,O,N){return h=!!u(S,O,N),h}),h}function uu(a,u,h){for(var S=-1,O=a.length;++S<O;){var N=a[S],L=u(N);if(L!=null&&(B===t?L===L&&!bn(L):h(L,B)))var B=L,z=N}return z}function rS(a,u,h,S){var O=a.length;for(h=Me(h),h<0&&(h=-h>O?0:O+h),S=S===t||S>O?O:Me(S),S<0&&(S+=O),S=h>S?0:iq(S);h<S;)a[h++]=u;return a}function Ph(a,u){var h=[];return Ui(a,function(S,O,N){u(S,O,N)&&h.push(S)}),h}function lr(a,u,h,S,O){var N=-1,L=a.length;for(h||(h=HM),O||(O=[]);++N<L;){var B=a[N];u>0&&h(B)?u>1?lr(B,u-1,h,S,O):Ni(O,B):S||(O[O.length]=B)}return O}var vf=hE(),kh=hE(!0);function Fn(a,u){return a&&vf(a,u,pr)}function ni(a,u){return a&&kh(a,u,pr)}function cu(a,u){return $i(u,function(h){return Ss(a[h])})}function gs(a,u){u=co(u,a);for(var h=0,S=u.length;a!=null&&h<S;)a=a[oi(u[h++])];return h&&h==S?a:t}function Ah(a,u,h){var S=u(a);return $e(a)?S:Ni(S,h(a))}function mr(a){return a==null?a===t?or:On:ps&&ps in Xe(a)?MM(a):YM(a)}function bf(a,u){return a>u}function nS(a,u){return a!=null&&pt.call(a,u)}function iS(a,u){return a!=null&&u in Xe(a)}function sS(a,u,h){return a>=ar(u,h)&&a<Tt(u,h)}function yn(a,u,h){for(var S=h?Xs:Ul,O=a[0].length,N=a.length,L=N,B=Y(N),z=1/0,X=[];L--;){var ee=a[L];L&&u&&(ee=qt(ee,Fr(u))),z=ar(ee.length,z),B[L]=!h&&(u||O>=120&&ee.length>=120)?new ms(L&&ee):t}ee=a[0];var ne=-1,ce=B[0];e:for(;++ne<O&&X.length<z;){var be=ee[ne],Ee=u?u(be):be;if(be=h||be!==0?be:0,!(ce?yt(ce,Ee):S(X,Ee,h))){for(L=N;--L;){var De=B[L];if(!(De?yt(De,Ee):S(a[L],Ee,h)))continue e}ce&&ce.push(Ee),X.push(be)}}return X}function oo(a,u,h,S){return Fn(a,function(O,N,L){u(S,h(O),N,L)}),S}function Ra(a,u,h){u=co(u,a),a=kE(a,u);var S=a==null?a:a[oi(jn(u))];return S==null?t:Nr(S,a,h)}function Th(a){return Wt(a)&&mr(a)==Yt}function oS(a){return Wt(a)&&mr(a)==Lt}function aS(a){return Wt(a)&&mr(a)==wr}function xa(a,u,h,S,O){return a===u?!0:a==null||u==null||!Wt(a)&&!Wt(u)?a!==a&&u!==u:Sf(a,u,h,S,xa,O)}function Sf(a,u,h,S,O,N){var L=$e(a),B=$e(u),z=L?Tr:xr(a),X=B?Tr:xr(u);z=z==Yt?te:z,X=X==Yt?te:X;var ee=z==te,ne=X==te,ce=z==X;if(ce&&po(a)){if(!po(u))return!1;L=!0,ee=!1}if(ce&&!ee)return N||(N=new mn),L||hu(a)?xE(a,u,h,S,O,N):$M(a,u,z,h,S,O,N);if(!(h&b)){var be=ee&&pt.call(a,"__wrapped__"),Ee=ne&&pt.call(u,"__wrapped__");if(be||Ee){var De=be?a.value():a,xe=Ee?u.value():u;return N||(N=new mn),O(De,xe,h,S,N)}}return ce?(N||(N=new mn),NM(a,u,h,S,O,N)):!1}function ao(a){return Wt(a)&&xr(a)==At}function lo(a,u,h,S){var O=h.length,N=O,L=!S;if(a==null)return!N;for(a=Xe(a);O--;){var B=h[O];if(L&&B[2]?B[1]!==a[B[0]]:!(B[0]in a))return!1}for(;++O<N;){B=h[O];var z=B[0],X=a[z],ee=B[1];if(L&&B[2]){if(X===t&&!(z in a))return!1}else{var ne=new mn;if(S)var ce=S(X,ee,z,a,u,ne);if(!(ce===t?xa(ee,X,b|q,S,ne):ce))return!1}}return!0}function Ye(a){if(!Ht(a)||VM(a))return!1;var u=Ss(a)?Eb:Up;return u.test(Ea(a))}function f(a){return Wt(a)&&mr(a)==ge}function g(a){return Wt(a)&&xr(a)==we}function w(a){return Wt(a)&&Yh(a.length)&&!!Pt[mr(a)]}function C(a){return typeof a=="function"?a:a==null?tn:typeof a=="object"?$e(a)?ze(a[0],a[1]):Ie(a):gq(a)}function T(a){if(!Rf(a))return gh(a);var u=[];for(var h in Xe(a))pt.call(a,h)&&h!="constructor"&&u.push(h);return u}function H(a){if(!Ht(a))return GM(a);var u=Rf(a),h=[];for(var S in a)S=="constructor"&&(u||!pt.call(a,S))||h.push(S);return h}function K(a,u){return a<u}function de(a,u){var h=-1,S=Xr(a)?Y(a.length):[];return Ui(a,function(O,N,L){S[++h]=u(O,N,L)}),S}function Ie(a){var u=_S(a);return u.length==1&&u[0][2]?OE(u[0][0],u[0][1]):function(h){return h===a||lo(h,a,u)}}function ze(a,u){return xS(a)&&IE(u)?OE(oi(a),u):function(h){var S=NS(h,a);return S===t&&S===u?MS(h,a):xa(u,S,b|q)}}function tr(a,u,h,S,O){a!==u&&vf(u,function(N,L){if(O||(O=new mn),Ht(N))ii(a,u,L,h,tr,S,O);else{var B=S?S(ES(a,L),N,L+"",a,u,O):t;B===t&&(B=N),mf(a,L,B)}},en)}function ii(a,u,h,S,O,N,L){var B=ES(a,h),z=ES(u,h),X=L.get(z);if(X){mf(a,h,X);return}var ee=N?N(B,z,h+"",a,u,L):t,ne=ee===t;if(ne){var ce=$e(z),be=!ce&&po(z),Ee=!ce&&!be&&hu(z);ee=z,ce||be||Ee?$e(B)?ee=B:Qt(B)?ee=Zr(B):be?(ne=!1,ee=lE(z,!0)):Ee?(ne=!1,ee=uE(z,!0)):ee=[]:Cf(z)||qa(z)?(ee=B,qa(B)?ee=sq(B):(!Ht(B)||Ss(B))&&(ee=qE(z))):ne=!1}ne&&(L.set(z,ee),O(ee,z,S,N,L),L.delete(z)),mf(a,h,ee)}function si(a,u){var h=a.length;if(h)return u+=u<0?h:0,bs(u,h)?a[u]:t}function ZC(a,u,h){u.length?u=qt(u,function(N){return $e(N)?function(L){return gs(L,N.length===1?N[0]:N)}:N}):u=[tn];var S=-1;u=qt(u,Fr(Ce()));var O=de(a,function(N,L,B){var z=qt(u,function(X){return X(N)});return{criteria:z,index:++S,value:N}});return lb(O,function(N,L){return EM(N,L,h)})}function hM(a,u){return XC(a,u,function(h,S){return MS(a,S)})}function XC(a,u,h){for(var S=-1,O=u.length,N={};++S<O;){var L=u[S],B=gs(a,L);h(B,L)&&wf(N,co(L,a),B)}return N}function mM(a){return function(u){return gs(u,a)}}function lS(a,u,h,S){var O=S?ab:fs,N=-1,L=u.length,B=a;for(a===u&&(u=Zr(u)),h&&(B=qt(a,Fr(h)));++N<L;)for(var z=0,X=u[N],ee=h?h(X):X;(z=O(B,ee,z,S))>-1;)B!==a&&Xl.call(B,z,1),Xl.call(a,z,1);return a}function eE(a,u){for(var h=a?u.length:0,S=h-1;h--;){var O=u[h];if(h==S||O!==N){var N=O;bs(O)?Xl.call(a,O,1):dS(a,O)}}return a}function uS(a,u){return a+ya(vh()*(u-a+1))}function gM(a,u,h,S){for(var O=-1,N=Tt(ga((u-a)/(h||1)),0),L=Y(N);N--;)L[S?N:++O]=a,a+=h;return L}function cS(a,u){var h="";if(!a||u<1||u>Be)return h;do u%2&&(h+=a),u=ya(u/2),u&&(a+=a);while(u);return h}function Ue(a,u){return qS(PE(a,u,tn),a+"")}function yM(a){return Eh(mu(a))}function vM(a,u){var h=mu(a);return Bh(h,Li(u,0,h.length))}function wf(a,u,h,S){if(!Ht(a))return a;u=co(u,a);for(var O=-1,N=u.length,L=N-1,B=a;B!=null&&++O<N;){var z=oi(u[O]),X=h;if(z==="__proto__"||z==="constructor"||z==="prototype")return a;if(O!=L){var ee=B[z];X=S?S(ee,z,B):t,X===t&&(X=Ht(ee)?ee:bs(u[O+1])?[]:{})}Lr(B,z,X),B=B[z]}return a}var tE=iu?function(a,u){return iu.set(a,u),a}:tn,bM=eu?function(a,u){return eu(a,"toString",{configurable:!0,enumerable:!1,value:DS(u),writable:!0})}:tn;function SM(a){return Bh(mu(a))}function Dn(a,u,h){var S=-1,O=a.length;u<0&&(u=-u>O?0:O+u),h=h>O?O:h,h<0&&(h+=O),O=u>h?0:h-u>>>0,u>>>=0;for(var N=Y(O);++S<O;)N[S]=a[S+u];return N}function wM(a,u){var h;return Ui(a,function(S,O,N){return h=u(S,O,N),!h}),!!h}function $h(a,u,h){var S=0,O=a==null?S:a.length;if(typeof u=="number"&&u===u&&O<=Nt){for(;S<O;){var N=S+O>>>1,L=a[N];L!==null&&!bn(L)&&(h?L<=u:L<u)?S=N+1:O=N}return O}return fS(a,u,tn,h)}function fS(a,u,h,S){var O=0,N=a==null?0:a.length;if(N===0)return 0;u=h(u);for(var L=u!==u,B=u===null,z=bn(u),X=u===t;O<N;){var ee=ya((O+N)/2),ne=h(a[ee]),ce=ne!==t,be=ne===null,Ee=ne===ne,De=bn(ne);if(L)var xe=S||Ee;else X?xe=Ee&&(S||ce):B?xe=Ee&&ce&&(S||!be):z?xe=Ee&&ce&&!be&&(S||!De):be||De?xe=!1:xe=S?ne<=u:ne<u;xe?O=ee+1:N=ee}return ar(N,mt)}function rE(a,u){for(var h=-1,S=a.length,O=0,N=[];++h<S;){var L=a[h],B=u?u(L):L;if(!h||!ai(B,z)){var z=B;N[O++]=L===0?0:L}}return N}function nE(a){return typeof a=="number"?a:bn(a)?ye:+a}function vn(a){if(typeof a=="string")return a;if($e(a))return qt(a,vn)+"";if(bn(a))return bh?bh.call(a):"";var u=a+"";return u=="0"&&1/a==-fe?"-0":u}function uo(a,u,h){var S=-1,O=Ul,N=a.length,L=!0,B=[],z=B;if(h)L=!1,O=Xs;else if(N>=r){var X=u?null:AM(a);if(X)return zl(X);L=!1,O=yt,z=new ms}else z=u?[]:B;e:for(;++S<N;){var ee=a[S],ne=u?u(ee):ee;if(ee=h||ee!==0?ee:0,L&&ne===ne){for(var ce=z.length;ce--;)if(z[ce]===ne)continue e;u&&z.push(ne),B.push(ee)}else O(z,ne,h)||(z!==B&&z.push(ne),B.push(ee))}return B}function dS(a,u){u=co(u,a);var h=-1,S=u.length;if(!S)return!0;for(;++h<S;){var O=oi(u[h]);if(O==="__proto__"&&!pt.call(a,"__proto__")||(O==="constructor"||O==="prototype")&&h<S-1)return!1}var N=kE(a,u);return N==null||delete N[oi(jn(u))]}function iE(a,u,h,S){return wf(a,u,h(gs(a,u)),S)}function Nh(a,u,h,S){for(var O=a.length,N=S?O:-1;(S?N--:++N<O)&&u(a[N],N,a););return h?Dn(a,S?0:N,S?N+1:O):Dn(a,S?N+1:0,S?O:N)}function sE(a,u){var h=a;return h instanceof We&&(h=h.value()),sf(u,function(S,O){return O.func.apply(O.thisArg,Ni([S],O.args))},h)}function pS(a,u,h){var S=a.length;if(S<2)return S?uo(a[0]):[];for(var O=-1,N=Y(S);++O<S;)for(var L=a[O],B=-1;++B<S;)B!=O&&(N[O]=_a(N[O]||L,a[B],u,h));return uo(lr(N,1),u,h)}function oE(a,u,h){for(var S=-1,O=a.length,N=u.length,L={};++S<O;){var B=S<N?u[S]:t;h(L,a[S],B)}return L}function hS(a){return Qt(a)?a:[]}function mS(a){return typeof a=="function"?a:tn}function co(a,u){return $e(a)?a:xS(a,u)?[a]:NE(wt(a))}var _M=Ue;function fo(a,u,h){var S=a.length;return h=h===t?S:h,!u&&h>=S?a:Dn(a,u,h)}var aE=qb||function(a){return er.clearTimeout(a)};function lE(a,u){if(u)return a.slice();var h=a.length,S=ph?ph(h):new a.constructor(h);return a.copy(S),S}function gS(a){var u=new a.constructor(a.byteLength);return new Ql(u).set(new Ql(a)),u}function RM(a,u){var h=u?gS(a.buffer):a.buffer;return new a.constructor(h,a.byteOffset,a.byteLength)}function xM(a){var u=new a.constructor(a.source,Lp.exec(a));return u.lastIndex=a.lastIndex,u}function CM(a){return wa?Xe(wa.call(a)):{}}function uE(a,u){var h=u?gS(a.buffer):a.buffer;return new a.constructor(h,a.byteOffset,a.length)}function cE(a,u){if(a!==u){var h=a!==t,S=a===null,O=a===a,N=bn(a),L=u!==t,B=u===null,z=u===u,X=bn(u);if(!B&&!X&&!N&&a>u||N&&L&&z&&!B&&!X||S&&L&&z||!h&&z||!O)return 1;if(!S&&!N&&!X&&a<u||X&&h&&O&&!S&&!N||B&&h&&O||!L&&O||!z)return-1}return 0}function EM(a,u,h){for(var S=-1,O=a.criteria,N=u.criteria,L=O.length,B=h.length;++S<L;){var z=cE(O[S],N[S]);if(z){if(S>=B)return z;var X=h[S];return z*(X=="desc"?-1:1)}}return a.index-u.index}function fE(a,u,h,S){for(var O=-1,N=a.length,L=h.length,B=-1,z=u.length,X=Tt(N-L,0),ee=Y(z+X),ne=!S;++B<z;)ee[B]=u[B];for(;++O<L;)(ne||O<N)&&(ee[h[O]]=a[O]);for(;X--;)ee[B++]=a[O++];return ee}function dE(a,u,h,S){for(var O=-1,N=a.length,L=-1,B=h.length,z=-1,X=u.length,ee=Tt(N-B,0),ne=Y(ee+X),ce=!S;++O<ee;)ne[O]=a[O];for(var be=O;++z<X;)ne[be+z]=u[z];for(;++L<B;)(ce||O<N)&&(ne[be+h[L]]=a[O++]);return ne}function Zr(a,u){var h=-1,S=a.length;for(u||(u=Y(S));++h<S;)u[h]=a[h];return u}function Hi(a,u,h,S){var O=!h;h||(h={});for(var N=-1,L=u.length;++N<L;){var B=u[N],z=S?S(h[B],a[B],B,h,a):t;z===t&&(z=a[B]),O?gn(h,B,z):Lr(h,B,z)}return h}function qM(a,u){return Hi(a,RS(a),u)}function IM(a,u){return Hi(a,CE(a),u)}function Mh(a,u){return function(h,S){var O=$e(h)?ei:qh,N=u?u():{};return O(h,a,Ce(S,2),N)}}function fu(a){return Ue(function(u,h){var S=-1,O=h.length,N=O>1?h[O-1]:t,L=O>2?h[2]:t;for(N=a.length>3&&typeof N=="function"?(O--,N):t,L&&Ur(h[0],h[1],L)&&(N=O<3?t:N,O=1),u=Xe(u);++S<O;){var B=h[S];B&&a(u,B,S,N)}return u})}function pE(a,u){return function(h,S){if(h==null)return h;if(!Xr(h))return a(h,S);for(var O=h.length,N=u?O:-1,L=Xe(h);(u?N--:++N<O)&&S(L[N],N,L)!==!1;);return h}}function hE(a){return function(u,h,S){for(var O=-1,N=Xe(u),L=S(u),B=L.length;B--;){var z=L[a?B:++O];if(h(N[z],z,N)===!1)break}return u}}function OM(a,u,h){var S=u&x,O=_f(a);function N(){var L=this&&this!==er&&this instanceof N?O:a;return L.apply(S?h:this,arguments)}return N}function mE(a){return function(u){u=wt(u);var h=eo(u)?Dr(u):t,S=h?h[0]:u.charAt(0),O=h?fo(h,1).join(""):u.slice(1);return S[a]()+O}}function du(a){return function(u){return sf(hq(pq(u).replace(Jv,"")),a,"")}}function _f(a){return function(){var u=arguments;switch(u.length){case 0:return new a;case 1:return new a(u[0]);case 2:return new a(u[0],u[1]);case 3:return new a(u[0],u[1],u[2]);case 4:return new a(u[0],u[1],u[2],u[3]);case 5:return new a(u[0],u[1],u[2],u[3],u[4]);case 6:return new a(u[0],u[1],u[2],u[3],u[4],u[5]);case 7:return new a(u[0],u[1],u[2],u[3],u[4],u[5],u[6])}var h=so(a.prototype),S=a.apply(h,u);return Ht(S)?S:h}}function PM(a,u,h){var S=_f(a);function O(){for(var N=arguments.length,L=Y(N),B=N,z=pu(O);B--;)L[B]=arguments[B];var X=N<3&&L[0]!==z&&L[N-1]!==z?[]:$n(L,z);if(N-=X.length,N<h)return SE(a,u,Fh,O.placeholder,t,L,X,t,t,h-N);var ee=this&&this!==er&&this instanceof O?S:a;return Nr(ee,this,L)}return O}function gE(a){return function(u,h,S){var O=Xe(u);if(!Xr(u)){var N=Ce(h,3);u=pr(u),h=function(B){return N(O[B],B,O)}}var L=a(u,h,S);return L>-1?O[N?u[L]:L]:t}}function yE(a){return vs(function(u){var h=u.length,S=h,O=_r.prototype.thru;for(a&&u.reverse();S--;){var N=u[S];if(typeof N!="function")throw new jr(i);if(O&&!L&&Uh(N)=="wrapper")var L=new _r([],!0)}for(S=L?S:h;++S<h;){N=u[S];var B=Uh(N),z=B=="wrapper"?wS(N):t;z&&CS(z[0])&&z[1]==(j|E|P|I)&&!z[4].length&&z[9]==1?L=L[Uh(z[0])].apply(L,z[3]):L=N.length==1&&CS(N)?L[B]():L.thru(N)}return function(){var X=arguments,ee=X[0];if(L&&X.length==1&&$e(ee))return L.plant(ee).value();for(var ne=0,ce=h?u[ne].apply(this,X):ee;++ne<h;)ce=u[ne].call(this,ce);return ce}})}function Fh(a,u,h,S,O,N,L,B,z,X){var ee=u&j,ne=u&x,ce=u&v,be=u&(E|k),Ee=u&R,De=ce?t:_f(a);function xe(){for(var Ke=arguments.length,et=Y(Ke),Sn=Ke;Sn--;)et[Sn]=arguments[Sn];if(be)var Hr=pu(xe),wn=uh(et,Hr);if(S&&(et=fE(et,S,O,be)),N&&(et=dE(et,N,L,be)),Ke-=wn,be&&Ke<X){var Zt=$n(et,Hr);return SE(a,u,Fh,xe.placeholder,h,et,Zt,B,z,X-Ke)}var li=ne?h:this,_s=ce?li[a]:a;return Ke=et.length,B?et=KM(et,B):Ee&&Ke>1&&et.reverse(),ee&&z<Ke&&(et.length=z),this&&this!==er&&this instanceof xe&&(_s=De||_f(_s)),_s.apply(li,et)}return xe}function vE(a,u){return function(h,S){return oo(h,a,u(S),{})}}function Dh(a,u){return function(h,S){var O;if(h===t&&S===t)return u;if(h!==t&&(O=h),S!==t){if(O===t)return S;typeof h=="string"||typeof S=="string"?(h=vn(h),S=vn(S)):(h=nE(h),S=nE(S)),O=a(h,S)}return O}}function yS(a){return vs(function(u){return u=qt(u,Fr(Ce())),Ue(function(h){var S=this;return a(u,function(O){return Nr(O,S,h)})})})}function jh(a,u){u=u===t?" ":vn(u);var h=u.length;if(h<2)return h?cS(u,a):u;var S=cS(u,ga(a/Mi(u)));return eo(u)?fo(Dr(S),0,a).join(""):S.slice(0,a)}function kM(a,u,h,S){var O=u&x,N=_f(a);function L(){for(var B=-1,z=arguments.length,X=-1,ee=S.length,ne=Y(ee+z),ce=this&&this!==er&&this instanceof L?N:a;++X<ee;)ne[X]=S[X];for(;z--;)ne[X++]=arguments[++B];return Nr(ce,O?h:this,ne)}return L}function bE(a){return function(u,h,S){return S&&typeof S!="number"&&Ur(u,h,S)&&(h=S=t),u=ws(u),h===t?(h=u,u=0):h=ws(h),S=S===t?u<h?1:-1:ws(S),gM(u,h,S,a)}}function Lh(a){return function(u,h){return typeof u=="string"&&typeof h=="string"||(u=Ln(u),h=Ln(h)),a(u,h)}}function SE(a,u,h,S,O,N,L,B,z,X){var ee=u&E,ne=ee?L:t,ce=ee?t:L,be=ee?N:t,Ee=ee?t:N;u|=ee?P:M,u&=~(ee?M:P),u&_||(u&=~(x|v));var De=[a,u,O,be,ne,Ee,ce,B,z,X],xe=h.apply(t,De);return CS(a)&&AE(xe,De),xe.placeholder=S,TE(xe,a,u)}function vS(a){var u=vt[a];return function(h,S){if(h=Ln(h),S=S==null?0:ar(Me(S),292),S&&hs(h)){var O=(wt(h)+"e").split("e"),N=u(O[0]+"e"+(+O[1]+S));return O=(wt(N)+"e").split("e"),+(O[0]+"e"+(+O[1]-S))}return u(h)}}var AM=no&&1/zl(new no([,-0]))[1]==fe?function(a){return new no(a)}:US;function wE(a){return function(u){var h=xr(u);return h==At?to(u):h==we?ch(u):ub(u,a(u))}}function ys(a,u,h,S,O,N,L,B){var z=u&v;if(!z&&typeof a!="function")throw new jr(i);var X=S?S.length:0;if(X||(u&=~(P|M),S=O=t),L=L===t?L:Tt(Me(L),0),B=B===t?B:Me(B),X-=O?O.length:0,u&M){var ee=S,ne=O;S=O=t}var ce=z?t:wS(a),be=[a,u,h,S,O,ee,ne,N,L,B];if(ce&&JM(be,ce),a=be[0],u=be[1],h=be[2],S=be[3],O=be[4],B=be[9]=be[9]===t?z?0:a.length:Tt(be[9]-X,0),!B&&u&(E|k)&&(u&=~(E|k)),!u||u==x)var Ee=OM(a,u,h);else u==E||u==k?Ee=PM(a,u,B):(u==P||u==(x|P))&&!O.length?Ee=kM(a,u,h,S):Ee=Fh.apply(t,be);var De=ce?tE:AE;return TE(De(Ee,be),a,u)}function _E(a,u,h,S){return a===t||ai(a,ro[h])&&!pt.call(S,h)?u:a}function RE(a,u,h,S,O,N){return Ht(a)&&Ht(u)&&(N.set(u,a),tr(a,u,t,RE,N),N.delete(u)),a}function TM(a){return Cf(a)?t:a}function xE(a,u,h,S,O,N){var L=h&b,B=a.length,z=u.length;if(B!=z&&!(L&&z>B))return!1;var X=N.get(a),ee=N.get(u);if(X&&ee)return X==u&&ee==a;var ne=-1,ce=!0,be=h&q?new ms:t;for(N.set(a,u),N.set(u,a);++ne<B;){var Ee=a[ne],De=u[ne];if(S)var xe=L?S(De,Ee,ne,u,a,N):S(Ee,De,ne,a,u,N);if(xe!==t){if(xe)continue;ce=!1;break}if(be){if(!Hl(u,function(Ke,et){if(!yt(be,et)&&(Ee===Ke||O(Ee,Ke,h,S,N)))return be.push(et)})){ce=!1;break}}else if(!(Ee===De||O(Ee,De,h,S,N))){ce=!1;break}}return N.delete(a),N.delete(u),ce}function $M(a,u,h,S,O,N,L){switch(h){case gt:if(a.byteLength!=u.byteLength||a.byteOffset!=u.byteOffset)return!1;a=a.buffer,u=u.buffer;case Lt:return!(a.byteLength!=u.byteLength||!N(new Ql(a),new Ql(u)));case $r:case wr:case Ai:return ai(+a,+u);case St:return a.name==u.name&&a.message==u.message;case ge:case Ze:return a==u+"";case At:var B=to;case we:var z=S&b;if(B||(B=zl),a.size!=u.size&&!z)return!1;var X=L.get(a);if(X)return X==u;S|=q,L.set(a,u);var ee=xE(B(a),B(u),S,O,N,L);return L.delete(a),ee;case Ct:if(wa)return wa.call(a)==wa.call(u)}return!1}function NM(a,u,h,S,O,N){var L=h&b,B=bS(a),z=B.length,X=bS(u),ee=X.length;if(z!=ee&&!L)return!1;for(var ne=z;ne--;){var ce=B[ne];if(!(L?ce in u:pt.call(u,ce)))return!1}var be=N.get(a),Ee=N.get(u);if(be&&Ee)return be==u&&Ee==a;var De=!0;N.set(a,u),N.set(u,a);for(var xe=L;++ne<z;){ce=B[ne];var Ke=a[ce],et=u[ce];if(S)var Sn=L?S(et,Ke,ce,u,a,N):S(Ke,et,ce,a,u,N);if(!(Sn===t?Ke===et||O(Ke,et,h,S,N):Sn)){De=!1;break}xe||(xe=ce=="constructor")}if(De&&!xe){var Hr=a.constructor,wn=u.constructor;Hr!=wn&&"constructor"in a&&"constructor"in u&&!(typeof Hr=="function"&&Hr instanceof Hr&&typeof wn=="function"&&wn instanceof wn)&&(De=!1)}return N.delete(a),N.delete(u),De}function vs(a){return qS(PE(a,t,jE),a+"")}function bS(a){return Ah(a,pr,RS)}function SS(a){return Ah(a,en,CE)}var wS=iu?function(a){return iu.get(a)}:US;function Uh(a){for(var u=a.name+"",h=io[u],S=pt.call(io,u)?h.length:0;S--;){var O=h[S],N=O.func;if(N==null||N==a)return O.name}return u}function pu(a){var u=pt.call($,"placeholder")?$:a;return u.placeholder}function Ce(){var a=$.iteratee||jS;return a=a===jS?C:a,arguments.length?a(arguments[0],arguments[1]):a}function Hh(a,u){var h=a.__data__;return BM(u)?h[typeof u=="string"?"string":"hash"]:h.map}function _S(a){for(var u=pr(a),h=u.length;h--;){var S=u[h],O=a[S];u[h]=[S,O,IE(O)]}return u}function Ca(a,u){var h=ca(a,u);return Ye(h)?h:t}function MM(a){var u=pt.call(a,ps),h=a[ps];try{a[ps]=t;var S=!0}catch{}var O=Yl.call(a);return S&&(u?a[ps]=h:delete a[ps]),O}var RS=tu?function(a){return a==null?[]:(a=Xe(a),$i(tu(a),function(u){return ha.call(a,u)}))}:HS,CE=tu?function(a){for(var u=[];a;)Ni(u,RS(a)),a=Zl(a);return u}:HS,xr=mr;(ff&&xr(new ff(new ArrayBuffer(1)))!=gt||va&&xr(new va)!=At||df&&xr(df.resolve())!=re||no&&xr(new no)!=we||ba&&xr(new ba)!=oe)&&(xr=function(a){var u=mr(a),h=u==te?a.constructor:t,S=h?Ea(h):"";if(S)switch(S){case Ab:return gt;case Tb:return At;case $b:return re;case Nb:return we;case Mb:return oe}return u});function FM(a,u,h){for(var S=-1,O=h.length;++S<O;){var N=h[S],L=N.size;switch(N.type){case"drop":a+=L;break;case"dropRight":u-=L;break;case"take":u=ar(u,a+L);break;case"takeRight":a=Tt(a,u-L);break}}return{start:a,end:u}}function DM(a){var u=a.match(Qn);return u?u[1].split(An):[]}function EE(a,u,h){u=co(u,a);for(var S=-1,O=u.length,N=!1;++S<O;){var L=oi(u[S]);if(!(N=a!=null&&h(a,L)))break;a=a[L]}return N||++S!=O?N:(O=a==null?0:a.length,!!O&&Yh(O)&&bs(L,O)&&($e(a)||qa(a)))}function jM(a){var u=a.length,h=new a.constructor(u);return u&&typeof a[0]=="string"&&pt.call(a,"index")&&(h.index=a.index,h.input=a.input),h}function qE(a){return typeof a.constructor=="function"&&!Rf(a)?so(Zl(a)):{}}function LM(a,u,h){var S=a.constructor;switch(u){case Lt:return gS(a);case $r:case wr:return new S(+a);case gt:return RM(a,h);case qe:case Pn:case Ol:case zs:case ea:case Js:case Ti:case Gs:case Bc:return uE(a,h);case At:return new S;case Ai:case Ze:return new S(a);case ge:return xM(a);case we:return new S;case Ct:return CM(a)}}function UM(a,u){var h=u.length;if(!h)return a;var S=h-1;return u[S]=(h>1?"& ":"")+u[S],u=u.join(h>2?", ":" "),a.replace(dr,`{
|
|
1
|
+
"use strict";var u2=Object.create;var Qh=Object.defineProperty;var c2=Object.getOwnPropertyDescriptor;var f2=Object.getOwnPropertyNames;var d2=Object.getPrototypeOf,p2=Object.prototype.hasOwnProperty;var le=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var V=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Rs=(t,e)=>{for(var r in e)Qh(t,r,{get:e[r],enumerable:!0})},vq=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of f2(e))!p2.call(t,i)&&i!==r&&Qh(t,i,{get:()=>e[i],enumerable:!(n=c2(e,i))||n.enumerable});return t};var ve=(t,e,r)=>(r=t!=null?u2(d2(t)):{},vq(e||!t||!t.__esModule?Qh(r,"default",{value:t,enumerable:!0}):r,t)),Ia=t=>vq(Qh({},"__esModule",{value:!0}),t);function Bt(t){return t.replace(/[^a-zA-Z0-9-_]/g,"_").replace(/\s+/g,"-").toLowerCase().substring(0,100)}function It(t){let e=Date.now().toString(36)+(h2++).toString(36)+Math.random().toString(36).slice(2,7);return t?`${Bt(t)}_${e}`:e}function Zh(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function gu(t,e){let r={},n={};for(let[i,s]of Object.entries(t)){let o=i.toLowerCase();n[o]=i,r[i]=s}for(let[i,s]of Object.entries(e)){let o=i.toLowerCase(),l=n[o];l&&delete r[l],n[o]=i,r[i]=s}return r}function bq(t){return JSON.parse(JSON.stringify(t))}function Sq(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function wq(t,e){try{return JSON.parse(t)}catch{return e}}function _q(t){if(t===0)return"0 B";let e=1024,r=["B","KB","MB","GB"],n=Math.floor(Math.log(t)/Math.log(e));return`${parseFloat((t/Math.pow(e,n)).toFixed(1))} ${r[n]}`}function Rq(t){return t<1e3?`${t} ms`:`${(t/1e3).toFixed(2)} s`}var h2,Un=le(()=>{"use strict";h2=0});function qf(t){if(!ht.existsSync(t))return;let e={},r=_n.join(t,Ef.preRequest);ht.existsSync(r)&&(e.preRequest=ht.readFileSync(r,"utf-8"));let n=_n.join(t,Ef.postResponse);return ht.existsSync(n)&&(e.postResponse=ht.readFileSync(n,"utf-8")),Object.keys(e).length>0?e:void 0}async function If(t,e){await ht.promises.mkdir(t,{recursive:!0});let r=_n.join(t,Ef.preRequest);e.preRequest?await ht.promises.writeFile(r,e.preRequest,"utf-8"):ht.existsSync(r)&&await ht.promises.unlink(r);let n=_n.join(t,Ef.postResponse);e.postResponse?await ht.promises.writeFile(n,e.postResponse,"utf-8"):ht.existsSync(n)&&await ht.promises.unlink(n)}function WS(t){for(let[e,r]of Object.entries(VS)){let n=_n.join(t,e);if(ht.existsSync(n))try{let i=ht.readFileSync(n,"utf-8"),s;if(r.type==="graphql")try{s=JSON.parse(i)}catch{s=i}else s=i;return{type:r.type,format:r.format,content:s}}catch(i){console.error(`[FolderIO] Failed to load body from ${n}:`,i)}}}function zS(t){if(!t||t.type==="none")return{bodyForMetadata:t};if(t.type==="raw"){let e=t.format||"json",n={json:"body.json",xml:"body.xml",text:"body.txt",html:"body.html",javascript:"body.js"}[e];if(n){let i=e==="json"?typeof t.content=="string"?t.content:JSON.stringify(t.content,null,2):String(t.content||"");return{bodyForMetadata:{type:t.type,format:t.format},externalBodyFile:{filename:n,content:i}}}}if(t.type==="graphql"){let e=typeof t.content=="string"?t.content:JSON.stringify(t.content,null,2);return{bodyForMetadata:{type:t.type},externalBodyFile:{filename:"body.graphql",content:e}}}return{bodyForMetadata:t}}async function JS(t,e){for(let r of Object.keys(VS))if(r!==e){let n=_n.join(t,r);if(ht.existsSync(n))try{await ht.promises.unlink(n)}catch{}}}function GS(t){if(ht.existsSync(t))try{let e=ht.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){console.error(`[FolderIO] Failed to load schema file ${t}:`,e);return}}async function YS(t,e,r){let n=_n.join(t,yu.responseSchema),i=_n.join(t,yu.bodySchema);e?await ht.promises.writeFile(n,JSON.stringify(e,null,2),"utf-8"):ht.existsSync(n)&&await ht.promises.unlink(n),r?await ht.promises.writeFile(i,JSON.stringify(r,null,2),"utf-8"):ht.existsSync(i)&&await ht.promises.unlink(i)}function Xh(t,e){for(let r of t){if(r.id===e)return r;if(r.type==="folder"&&r.items){let n=Xh(r.items,e);if(n)return n}}}function em(t,e){for(let r=0;r<t.length;r++){let n=t[r];if(n.id===e)return t.splice(r,1),!0;if(n.type==="folder"&&n.items&&em(n.items,e))return!0}return!1}function KS(t,e){let r=new Map(t.map(i=>[i.id,i])),n=[];for(let i of e){let s=r.get(i);s&&(n.push(s),r.delete(i))}for(let i of r.values())n.push(i);return n}function tm(t,e){let r;try{r=ht.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===rn)continue;if(n.name===e)return _n.join(t,n.name);let i=tm(_n.join(t,n.name),e);if(i)return i}}function m2(t){for(let e of[Cr.request,Cr.folder]){let r=_n.join(t,e);if(ht.existsSync(r))try{let n=ht.readFileSync(r,"utf-8");return JSON.parse(n).id}catch{return}}}function rm(t,e){let r;try{r=ht.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===rn)continue;let i=_n.join(t,n.name);if(m2(i)===e)return i;let s=rm(i,e);if(s)return s}}function Rn(t,e=[]){let r=t.toLowerCase().trim(),n=r.match(/^(get|post|put|patch|delete|head|options)[_\s-]/i),i=n?n[1]:"",s=r.match(/t(\d+)/gi)||[],o=0;for(let y of s){let b=parseInt(y.substring(1));b>o&&(o=b)}let l="";if(o>0)l=`t${o}`;else{let y=r.match(/[_\s-](\d+\.\d+)[_\s-]/);y&&(l=`v${y[1].replace(".","_")}`)}let c=r;n&&(c=c.substring(n[0].length)),c=c.replace(/[_\s-]?t\d+(?:\.\d+)?[_\s-]?/gi,"-"),c=c.replace(/[_\s-]?\d+\.\d+[_\s-]?/g,"-"),c=c.replace(/\([^)]+\)/g,""),c=c.replace(/:[a-z_][a-z0-9_]*/gi,""),c=c.replace(/\{[^}]+\}/g,""),c=c.replace(/\?$/g,"").replace(/[_/\\ ]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"");let d=c.split("-").filter(y=>y.length>0),p=[];i&&p.push(i),p.push(...d),l&&p.push(l);let m=p.join("-");if(m||(m="item"),e.includes(m)){let y=2;for(;e.includes(`${m}-${y}`);)y++;m=`${m}-${y}`}return m}var ht,_n,Ef,Cr,VS,yu,rn,Pa=le(()=>{"use strict";ht=ve(require("fs")),_n=ve(require("path")),Ef={preRequest:"pre-request.js",postResponse:"post-response.js"},Cr={collection:"collection.json",folder:"folder.json",request:"request.json"},VS={"body.json":{type:"raw",format:"json"},"body.xml":{type:"raw",format:"xml"},"body.txt":{type:"raw",format:"text"},"body.html":{type:"raw",format:"html"},"body.js":{type:"raw",format:"javascript"},"body.graphql":{type:"graphql"}},yu={responseSchema:"response.schema.json",bodySchema:"body.schema.json"},rn="scripts"});var Ne,je,xs,nm=le(()=>{"use strict";Ne=ve(require("fs")),je=ve(require("path"));Un();Pa();xs=class{collectionsDir;cache=new Map;slugToIdMap=new Map;idToSlugMap=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}getSlugById(e){return this.idToSlugMap.get(e)}getIdBySlug(e){return this.slugToIdMap.get(e)}ensureDirectory(){Ne.existsSync(this.collectionsDir)||Ne.mkdirSync(this.collectionsDir,{recursive:!0})}readJsonFileSafe(e,r){let n;try{n=Ne.readFileSync(e,"utf-8")}catch(i){console.error(`[FolderCollectionStore] Failed to read ${r} ${e}:`,i);return}if(n.trim().length!==0)try{return JSON.parse(n)}catch(i){if(i instanceof SyntaxError&&/Unexpected end of JSON input/.test(i.message))return;console.error(`[FolderCollectionStore] Failed to parse ${r} ${e}:`,i);return}}loadAll(){if(this.cache.clear(),this.slugToIdMap.clear(),this.idToSlugMap.clear(),!Ne.existsSync(this.collectionsDir))return[];let e=Ne.readdirSync(this.collectionsDir,{withFileTypes:!0}),r=[];for(let n of e)if(n.isDirectory())try{let i=this.loadCollectionFromFolder(n.name);i&&(this.cache.set(i.id,i),this.slugToIdMap.set(n.name,i.id),this.idToSlugMap.set(i.id,n.name),r.push(i))}catch(i){console.error(`[FolderCollectionStore] Failed to load ${n.name}:`,i)}return r}loadCollectionFromFolder(e){let r=je.join(this.collectionsDir,e),n=je.join(r,Cr.collection);if(!Ne.existsSync(n))return;let i=this.readJsonFileSafe(n,"collection");if(i)try{let s=this.loadScriptsFromDir(je.join(r,rn)),o=this.loadItemsFromDir(r,i.id,i.order);return{id:i.id,name:i.name,description:i.description,version:i.version,variables:i.variables,auth:i.auth,scripts:s,items:o}}catch(s){console.error(`[FolderCollectionStore] Failed to parse ${n}:`,s);return}}loadItemsFromDir(e,r,n){let i=[],s=new Map,o=Ne.readdirSync(e,{withFileTypes:!0});for(let l of o){if(!l.isDirectory()||l.name===rn)continue;let c=je.join(e,l.name);if(Ne.existsSync(je.join(c,Cr.folder))){let d=this.loadFolderFromDir(c,l.name);d&&s.set(l.name,d)}else if(Ne.existsSync(je.join(c,Cr.request))){let d=this.loadRequestFromDir(c,l.name);d&&s.set(l.name,d)}}if(n&&n.length>0){for(let l of n){let c=s.get(l);c&&(i.push(c),s.delete(l))}for(let l of s.values())i.push(l)}else for(let l of s.values())i.push(l);return i}loadFolderFromDir(e,r){let n=je.join(e,Cr.folder),i=this.readJsonFileSafe(n,"folder");if(i)try{let s=this.loadScriptsFromDir(je.join(e,rn)),o=this.loadItemsFromDir(e,i.id,i.order);return this.slugToIdMap.set(r,i.id),this.idToSlugMap.set(i.id,r),{id:i.id,type:"folder",name:i.name,description:i.description,auth:i.auth,scripts:s,items:o}}catch(s){console.error(`[FolderCollectionStore] Failed to load folder ${e}:`,s);return}}loadRequestFromDir(e,r){let n=je.join(e,Cr.request),i=this.readJsonFileSafe(n,"request");if(i)try{let s=this.loadScriptsFromDir(je.join(e,rn)),o=i.body,l=this.loadBodyFromDir(e);l&&(o=l);let c=this.loadSchemaFile(je.join(e,yu.responseSchema)),d=this.loadSchemaFile(je.join(e,yu.bodySchema)),p=je.join(e,"doc.md"),m=Ne.existsSync(p)?Ne.readFileSync(p,"utf-8"):void 0;return this.slugToIdMap.set(r,i.id),this.idToSlugMap.set(i.id,r),{id:i.id,type:"request",name:i.name,description:i.description,method:i.method,url:i.url,params:i.params,query:i.query,headers:i.headers,body:o,bodyContentType:i.bodyContentType,auth:i.auth,settings:i.settings,scripts:s,disabled:i.disabled,deprecated:i.deprecated,operationId:i.operationId,summary:i.summary,tags:i.tags,examples:i.examples,responses:i.responses,security:i.security,...m&&{doc:m},...c&&{responseSchema:c},...d&&{bodySchema:d}}}catch(s){console.error(`[FolderCollectionStore] Failed to load request ${e}:`,s);return}}loadScriptsFromDir(e){return qf(e)}loadBodyFromDir(e){return WS(e)}loadSchemaFile(e){return GS(e)}async saveSchemaFiles(e,r){return YS(e,r.responseSchema,r.bodySchema)}load(e){if(this.cache.has(e))return this.cache.get(e);let r=this.idToSlugMap.get(e);if(r){let n=this.loadCollectionFromFolder(r);return n&&this.cache.set(e,n),n}return this.loadAll(),this.cache.get(e)}async save(e){if(this.ensureDirectory(),!e.name)throw new Error("Collection name is required");e.id||(e.id=It(e.name));let r=this.idToSlugMap.get(e.id);if(!r){let l=Ne.readdirSync(this.collectionsDir);r=Rn(e.name,l),this.idToSlugMap.set(e.id,r),this.slugToIdMap.set(r,e.id)}let n=je.join(this.collectionsDir,r),i=!Ne.existsSync(n);await Ne.promises.mkdir(n,{recursive:!0});let s={id:e.id,name:e.name,description:e.description,version:e.version,variables:e.variables,auth:e.auth},[o]=await Promise.all([this.saveItemsToDir(n,e.items,i),e.scripts?this.saveScriptsToDir(je.join(n,rn),e.scripts):Promise.resolve()]);o.length>0&&(s.order=o),await Ne.promises.writeFile(je.join(n,Cr.collection),JSON.stringify(s,null,2),"utf-8"),this.cache.set(e.id,e)}async saveItemsToDir(e,r,n=!1){let i=[],s=[];for(let o of r){let l=this.idToSlugMap.get(o.id);l||(l=Rn(o.name,i),this.idToSlugMap.set(o.id,l),this.slugToIdMap.set(l,o.id)),i.push(l),s.push({item:o,slug:l})}return await Promise.all(s.map(async({item:o,slug:l})=>{let c=je.join(e,l);await Ne.promises.mkdir(c,{recursive:!0}),o.type==="folder"?await this.saveFolderToDir(c,o,n):await this.saveRequestToDir(c,o,n)})),i}async saveFolderToDir(e,r,n=!1){let i={id:r.id,name:r.name,description:r.description,auth:r.auth},[s]=await Promise.all([r.items?this.saveItemsToDir(e,r.items,n):Promise.resolve([]),r.scripts?this.saveScriptsToDir(je.join(e,rn),r.scripts):Promise.resolve()]);s.length>0&&(i.order=s),await Ne.promises.writeFile(je.join(e,Cr.folder),JSON.stringify(i,null,2),"utf-8")}async saveRequestToDir(e,r,n=!1){let{bodyForMetadata:i,externalBodyFile:s}=this.prepareBodyForSave(r.body),o={id:r.id,name:r.name,method:r.method||"GET",url:r.url||"",description:r.description,params:r.params,query:r.query,headers:r.headers,body:i,bodyContentType:r.bodyContentType,auth:r.auth,settings:r.settings,...r.disabled!==void 0&&{disabled:r.disabled},...r.deprecated&&{deprecated:r.deprecated},...r.operationId&&{operationId:r.operationId},...r.summary&&{summary:r.summary},...r.tags&&r.tags.length>0&&{tags:r.tags},...r.examples&&r.examples.length>0&&{examples:r.examples},...r.responses&&Object.keys(r.responses).length>0&&{responses:r.responses},...r.security&&r.security.length>0&&{security:r.security}},l=[Ne.promises.writeFile(je.join(e,Cr.request),JSON.stringify(o,null,2),"utf-8")];s&&l.push(Ne.promises.writeFile(je.join(e,s.filename),s.content,"utf-8")),n||l.push(this.cleanupOldBodyFiles(e,s?.filename)),(!n||r.responseSchema||r.bodySchema)&&l.push(this.saveSchemaFiles(e,r)),r.doc&&l.push(Ne.promises.writeFile(je.join(e,"doc.md"),r.doc,"utf-8")),r.scripts&&l.push(this.saveScriptsToDir(je.join(e,rn),r.scripts)),await Promise.all(l)}prepareBodyForSave(e){return zS(e)}async cleanupOldBodyFiles(e,r){return JS(e,r)}async saveScriptsToDir(e,r){return If(e,r)}async delete(e){let r=this.idToSlugMap.get(e);if(!r&&(this.loadAll(),r=this.idToSlugMap.get(e),!r))return!1;let n=je.join(this.collectionsDir,r);if(!Ne.existsSync(n))return!1;try{return await Ne.promises.rm(n,{recursive:!0,force:!0}),this.cache.delete(e),this.idToSlugMap.delete(e),this.slugToIdMap.delete(r),!0}catch(i){return console.error(`[FolderCollectionStore] Failed to delete collection ${e}:`,i),!1}}exists(e){let r=this.idToSlugMap.get(e);return r?Ne.existsSync(je.join(this.collectionsDir,r,Cr.collection)):!1}getCollectionPath(e){let r=this.idToSlugMap.get(e)||e;return je.join(this.collectionsDir,r)}getItemPath(e,r){return this.findItemPath(e,r)}async create(e,r){let n={id:r||It(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemPath(e,r);if(!s)throw new Error(`Item ${r} not found in collection ${e}`);await this.saveScriptsToDir(je.join(s,rn),n);let o=this.findItemById(i.items,r);o&&(o.scripts=n)}loadScripts(e,r){let n=this.findItemPath(e,r);if(n)return this.loadScriptsFromDir(je.join(n,rn))}async updateCollectionMetadata(e,r){let n=this.load(e);if(!n)throw new Error(`Collection ${e} not found`);let i=this.idToSlugMap.get(e);if(!i)throw new Error(`Collection slug not found for ${e}`);let s=je.join(this.collectionsDir,i),o=je.join(s,Cr.collection),l=Ne.readFileSync(o,"utf-8"),d={...JSON.parse(l),...r,id:e};await Ne.promises.writeFile(o,JSON.stringify(d,null,2),"utf-8"),r.name!==void 0&&(n.name=r.name),r.description!==void 0&&(n.description=r.description),r.version!==void 0&&(n.version=r.version),r.variables!==void 0&&(n.variables=r.variables),r.auth!==void 0&&(n.auth=r.auth)}async saveItem(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.idToSlugMap.get(e);if(!s)throw new Error(`Collection slug not found for ${e}`);let o;if(n){let p=this.findItemPath(e,n);if(!p)throw new Error(`Parent folder ${n} not found`);o=p}else o=je.join(this.collectionsDir,s);let l=this.idToSlugMap.get(r.id);if(!l){let p=Ne.readdirSync(o).filter(m=>Ne.statSync(je.join(o,m)).isDirectory()&&m!==rn);l=Rn(r.name,p),this.idToSlugMap.set(r.id,l),this.slugToIdMap.set(l,r.id)}let c=je.join(o,l);await Ne.promises.mkdir(c,{recursive:!0}),r.type==="folder"?await this.saveFolderToDir(c,r):await this.saveRequestToDir(c,r);let d=this.findItemById(i.items,r.id);if(d)Object.assign(d,r);else if(n){let p=this.findItemById(i.items,n);p&&p.type==="folder"&&(p.items=p.items||[],p.items.push(r))}else i.items.push(r)}async deleteItem(e,r){let n=this.load(e);if(!n)return!1;let i=this.findItemPath(e,r);if(!i||!Ne.existsSync(i))return!1;try{await Ne.promises.rm(i,{recursive:!0,force:!0}),this.deleteItemFromTree(n.items,r);let s=this.idToSlugMap.get(r);return s&&(this.slugToIdMap.delete(s),this.idToSlugMap.delete(r)),!0}catch(s){return console.error(`[FolderCollectionStore] Failed to delete item ${r}:`,s),!1}}async updateItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemPath(e,r);if(!s)return!1;let o=this.findItemById(i.items,r);if(!o)return!1;let{id:l,type:c,items:d,...p}=n;return Object.assign(o,p),o.type==="folder"?await this.saveFolderToDir(s,o):await this.saveRequestToDir(s,o),!0}async moveItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.idToSlugMap.get(e);if(!s)return!1;let o=this.findItemPath(e,r);if(!o||!Ne.existsSync(o))return!1;let l;if(n){let p=this.findItemPath(e,n);if(!p)return!1;l=p}else l=je.join(this.collectionsDir,s);let c=this.idToSlugMap.get(r);if(!c)return!1;let d=je.join(l,c);if(Ne.existsSync(d))return!1;try{await Ne.promises.rename(o,d);let p=this.findItemById(i.items,r);if(p){let m=p.type==="folder"?{...p,items:p.items?[...p.items]:[]}:{...p};if(this.deleteItemFromTree(i.items,r),n){let y=this.findItemById(i.items,n);y&&y.type==="folder"&&(y.items=y.items||[],y.items.push(m))}else i.items.push(m)}return!0}catch(p){return console.error(`[FolderCollectionStore] Failed to move item ${r}:`,p),!1}}async reorderItems(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.idToSlugMap.get(e);if(!s)return!1;let o=[];for(let l of n){let c=this.idToSlugMap.get(l);c&&o.push(c)}try{if(r){let l=this.findItemPath(e,r);if(!l)return!1;let c=je.join(l,Cr.folder),d=Ne.readFileSync(c,"utf-8"),p=JSON.parse(d);p.order=o,await Ne.promises.writeFile(c,JSON.stringify(p,null,2),"utf-8");let m=this.findItemById(i.items,r);m&&m.type==="folder"&&m.items&&(m.items=this.sortItemsByOrder(m.items,n))}else{let l=je.join(this.collectionsDir,s,Cr.collection),c=Ne.readFileSync(l,"utf-8"),d=JSON.parse(c);d.order=o,await Ne.promises.writeFile(l,JSON.stringify(d,null,2),"utf-8"),i.items=this.sortItemsByOrder(i.items,n)}return!0}catch(l){return console.error("[FolderCollectionStore] Failed to reorder items:",l),!1}}sortItemsByOrder(e,r){return KS(e,r)}findItemPath(e,r){let n=this.idToSlugMap.get(e);if(!n)return;let i=je.join(this.collectionsDir,n),s=rm(i,r);if(s)return s;let o=this.load(e);if(o){let c=this.buildSlugPath(o.items,r);if(c)return je.join(i,...c)}let l=this.idToSlugMap.get(r);if(l)return tm(i,l)}buildSlugPath(e,r){for(let n of e){let i=this.idToSlugMap.get(n.id);if(i){if(n.id===r)return[i];if(n.type==="folder"&&n.items){let s=this.buildSlugPath(n.items,r);if(s)return[i,...s]}}}}findItemById(e,r){return Xh(e,r)}deleteItemFromTree(e,r){return em(e,r)}}});var _t,ka=le(()=>{"use strict";_t=class{static parseSetCookie(e,r){let n=e.split(";").map(p=>p.trim());if(n.length===0)return null;let[i,...s]=n,o=i.indexOf("=");if(o===-1)return null;let l=i.substring(0,o).trim(),c=i.substring(o+1).trim(),d={name:l,value:c,domain:r};for(let p of s){let m=p.indexOf("="),y=(m===-1?p:p.substring(0,m)).toLowerCase(),b=m===-1?"":p.substring(m+1);switch(y){case"domain":d.domain=b.startsWith(".")?b.substring(1):b;break;case"path":d.path=b;break;case"expires":d.expires=b;break;case"max-age":d.maxAge=parseInt(b,10);break;case"httponly":d.httpOnly=!0;break;case"secure":d.secure=!0;break;case"samesite":d.sameSite=b;break}}return d}static parseCookieHeaders(e,r){let n=[],i=e["set-cookie"]||e["Set-Cookie"];if(!i)return n;let s=Array.isArray(i)?i:[i];for(let o of s){let l=this.parseSetCookie(o,r);l&&n.push(l)}return n}static formatCookieHeader(e){return e.map(r=>`${r.name}=${r.value}`).join("; ")}static isExpired(e){return!!(e.expires&&new Date(e.expires).getTime()<Date.now()||e.maxAge!==void 0&&e.maxAge<=0)}static domainMatches(e,r){if(r==="*")return!0;let n=e.toLowerCase().split(".").reverse(),i=r.toLowerCase().split(".").reverse();if(i.length>n.length)return!1;for(let s=0;s<i.length;s++)if(i[s]!==n[s])return!1;return!0}static extractDomain(e){try{return new URL(e).hostname}catch{return""}}static extractPath(e){try{return new URL(e).pathname}catch{return"/"}}}});function Of(t){let e=t.toLowerCase();return e==="_global.json"||e==="_global.local.json"||e.endsWith(".local.json")}function wu(t){if(!ho.existsSync(t))return y2();let e=im(Aa.join(t,"_global.json"))||{},r=e.variables||{},n=e.defaultHeaders||{},i=ho.readdirSync(t).filter(d=>d.endsWith(".json")).filter(d=>!d.endsWith(".local.json")).filter(d=>!Of(d)),s={};for(let d of i){let p=im(Aa.join(t,d))||{},m=Aa.basename(d,".json");s[m]={description:p.description,requiresConfirmation:p.requiresConfirmation,variables:p.variables||{},secretVariables:p.secretVariables}}let l=(im(Aa.join(t,"_global.local.json"))||{}).variables||{},c={};for(let d of Object.keys(s)){let p=Aa.join(t,`${d}.local.json`);if(ho.existsSync(p)){let m=im(p)||{};c[d]={variables:m.variables||{}}}}return{globalVariables:r,defaultHeaders:n,environments:s,localVariables:l,localCredentials:c}}function y2(){return{globalVariables:{},defaultHeaders:{},environments:{},localVariables:{},localCredentials:{}}}function im(t){try{if(!ho.existsSync(t))return null;let e=ho.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){return console.error(`[environment-file-loader] Failed to load JSON from ${t}:`,e),null}}var ho,Aa,sm=le(()=>{"use strict";ho=ve(require("fs")),Aa=ve(require("path"))});var Hn,_u=le(()=>{"use strict";Hn=class{buildUrl(e,r={},n={}){let i=e;return i=this.replacePathParams(i,r),i=this.appendQueryParams(i,n),i}replacePathParams(e,r){let n="",i="",s=e,o="",l=e.indexOf("?");l!==-1&&(o=e.substring(l),s=e.substring(0,l));let c=s.match(/^(https?:\/\/)([^\/]*)(\/.*)?$/);c&&(n=c[1],i=c[2],s=c[3]||"/");let d=/:(\w+)(?:\([^)]*\))?(\?)?/g,p=s.replace(d,(m,y,b)=>{let q=r[y];return q!==void 0&&q!==""?encodeURIComponent(q):b?"":(console.warn(`[UrlBuilder] Missing required path parameter: ${y}`),m)});return p=p.replace(/([^:])\/+/g,"$1/"),`${n}${i}${p}${o}`}extractPathParams(e){let r=/:(\w+)(?:\([^)]*\))?(\?)?/g,n=[],i;for(;(i=r.exec(e))!==null;)n.push(i[1]);return[...new Set(n)]}appendQueryParams(e,r){let n=e,i={};if(e.includes("?")){let[c,d]=e.split("?");n=c,d&&new URLSearchParams(d).forEach((m,y)=>{i[y]=m})}let s={...i,...r},o=new URLSearchParams;for(let[c,d]of Object.entries(s))d!=null&&o.append(c,d);let l=o.toString();return l?`${n}?${l}`:n}}});function Cq(t,e=0){return(gr[t[e+0]]+gr[t[e+1]]+gr[t[e+2]]+gr[t[e+3]]+"-"+gr[t[e+4]]+gr[t[e+5]]+"-"+gr[t[e+6]]+gr[t[e+7]]+"-"+gr[t[e+8]]+gr[t[e+9]]+"-"+gr[t[e+10]]+gr[t[e+11]]+gr[t[e+12]]+gr[t[e+13]]+gr[t[e+14]]+gr[t[e+15]]).toLowerCase()}var gr,Eq=le(()=>{gr=[];for(let t=0;t<256;++t)gr.push((t+256).toString(16).slice(1))});function XS(){return crypto.getRandomValues(v2)}var v2,qq=le(()=>{v2=new Uint8Array(16)});function b2(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():S2(t,e,r)}function S2(t,e,r){t=t||{};let n=t.random??t.rng?.()??XS();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){if(r=r||0,r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let i=0;i<16;++i)e[r+i]=n[i];return e}return Cq(n)}var Ru,Iq=le(()=>{qq();Eq();Ru=b2});var ew=le(()=>{Iq()});function w2(t=0,e=999){return Math.floor(Math.random()*(e-t+1))+t}function _2(){return Date.now()}function Oq(){return Ru()}function R2(){return Ru()}function Pq(t=10){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r="";for(let n=0;n<t;n++)r+=e.charAt(Math.floor(Math.random()*e.length));return r}function x2(){let t=Pq(8).toLowerCase(),e=["example.com","test.org","mail.dev","sample.net"];return`${t}@${e[Math.floor(Math.random()*e.length)]}`}function C2(){return Math.random()<.5}function E2(t=10){let e="0123456789abcdef",r="";for(let n=0;n<t;n++)r+=e.charAt(Math.floor(Math.random()*e.length));return r}function q2(){return Math.floor(Date.now()/1e3)}function I2(){return new Date().toISOString()}function O2(){return new Date().toISOString().split("T")[0]}function P2(){return new Date().toISOString().split("T")[1].split(".")[0]}function k2(){return new Date().toISOString()}function A2(t=""){return Buffer.from(String(t)).toString("base64")}function T2(t=""){return Buffer.from(String(t),"base64").toString("utf-8")}function $2(t=""){return encodeURIComponent(String(t))}function N2(t=""){return decodeURIComponent(String(t))}function M2(t){return t?t.split(",").map(e=>{let r=e.trim(),n=Number(r);return!isNaN(n)&&r!==""?n:r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'")?r.slice(1,-1):r}):[]}function Vi(t,e){let r=tw[t];return r?e&&e.length>0?r(...e):r():null}function kq(t){return!t||typeof t!="string"?t:t.replace(/\{\{\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?\}\}/g,(e,r,n)=>{try{let i=n?M2(n):void 0,s=Vi(r,i);return s===null?e:String(s)}catch{return e}})}function mo(t,e){let r=/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,n=null,i;for(;(i=r.exec(t))!==null;){let s=i[0],o=i[1];if(!(s in e)){let l=Vi(o);l!==null&&(n||(n={...e}),n[s]=l)}}return n??e}var tw,om=le(()=>{"use strict";ew();tw={randomInt:w2,timestamp:_2,guid:R2,uuid:Oq,randomUUID:Oq,randomString:Pq,randomHexadecimal:E2,randomEmail:x2,randomBoolean:C2,isoTimestamp:k2,timestamp_s:q2,datetime:I2,date:O2,time:P2,base64Encode:A2,base64Decode:T2,urlEncode:$2,urlDecode:N2}});function go(t){let e=t.trim();return!e||/^(\$?)[a-zA-Z_][a-zA-Z0-9_]*(\([^)]*\))?$/.test(e)||/(?<!\|)\|(?!\|)/.test(e)?!1:/[+\-*/%<>=!&|?:~^()[\]{}.,`]/.test(e)}function ui(t,e={}){try{let r={...e,Math,Date,JSON,Number,String,Boolean,Array,Object,parseInt,parseFloat,isNaN,isFinite,encodeURIComponent,decodeURIComponent,encodeURI,decodeURI,undefined:void 0,null:null,true:!0,false:!1,NaN:NaN,Infinity:1/0},n=am.createContext(r);return am.runInContext(t,n,{timeout:F2,displayErrors:!1})}catch{return}}var am,F2,Pf=le(()=>{"use strict";am=ve(require("vm")),F2=100});function D2(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function xu(t){if(!t||!t.includes("|"))return null;let e=j2(t);if(e.length<2)return null;let r=e[0].trim(),n=[];for(let i=1;i<e.length;i++){let s=e[i].trim();if(!s)continue;let o=L2(s);o&&n.push(o)}return n.length===0?null:{input:r,filters:n}}function j2(t){let e=[],r="",n=0,i=!1,s=!1;for(let o=0;o<t.length;o++){let l=t[o],c=o>0?t[o-1]:"",d=o<t.length-1?t[o+1]:"";if(c==="\\"){r+=l;continue}if(l==="'"&&!s)i=!i;else if(l==='"'&&!i)s=!s;else if(l==="("&&!i&&!s)n++;else if(l===")"&&!i&&!s)n--;else if(l==="|"&&n===0&&!i&&!s){if(d==="|"){r+="||",o++;continue}e.push(r),r="";continue}r+=l}return r&&e.push(r),e}function L2(t){let e=t.indexOf("(");if(e===-1)return{name:t.trim(),args:[]};let r=t.substring(0,e).trim(),n=t.substring(e+1,t.lastIndexOf(")"));return{name:r,args:U2(n)}}function U2(t){if(!t||!t.trim())return[];let e=[],r="",n=!1,i=!1;for(let s=0;s<t.length;s++){let o=t[s];if((s>0?t[s-1]:"")==="\\"){r+=o;continue}if(o==="'"&&!i){n=!n,r+=o;continue}else if(o==='"'&&!n){i=!i,r+=o;continue}else if(o===","&&!n&&!i){e.push(r.trim()),r="";continue}r+=o}return r.trim()&&e.push(r.trim()),e}function zt(t,e){if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);let r=Number(t);if(!isNaN(r)&&t!=="")return r;if(t==="true")return!0;if(t==="false")return!1;if(e&&t in e){let n=D2(e[t]),i=Number(n);return!isNaN(i)&&n!==""?i:n}return t}function Cu(t,e,r={}){let n=t;for(let i of e)n=H2(n,i.name,i.args,r);return n}function H2(t,e,r,n){switch(e){case"upper":return String(t).toUpperCase();case"lower":return String(t).toLowerCase();case"trim":return String(t).trim();case"length":return Array.isArray(t)?t.length:String(t).length;case"substring":{let i=zt(r[0],n),s=r[1]!==void 0?zt(r[1],n):void 0;return String(t).substring(i<0?String(t).length+i:i,s!==void 0?s<0?String(t).length+s:s:void 0)}case"replace":{let i=r[0]!==void 0?String(zt(r[0],n)):"",s=r[1]!==void 0?String(zt(r[1],n)):"";return String(t).replace(new RegExp(V2(i),"g"),s)}case"split":{let i=r[0]!==void 0?String(zt(r[0],n)):",";return String(t).split(i)}case"join":{let i=r[0]!==void 0?String(zt(r[0],n)):",";return Array.isArray(t)?t.join(i):String(t)}case"removeQuotes":return String(t).replace(/["']/g,"");case"removeSpaces":return String(t).replace(/\s/g,"");case"format":{let i=r[0]!==void 0?String(zt(r[0],n)):"{0}";i=i.replace("{0}",String(t));for(let s=1;s<r.length;s++){let o=zt(r[s],n);i=i.replace(`{${s}}`,String(o))}return i}case"add":{let i=zt(r[0],n);return Number(t)+i}case"subtract":{let i=zt(r[0],n);return Number(t)-i}case"multiply":{let i=zt(r[0],n);return Number(t)*i}case"abs":return Math.abs(Number(t));case"btoa":return Buffer.from(String(t)).toString("base64");case"atob":return Buffer.from(String(t),"base64").toString("utf-8");case"urlEncode":return encodeURIComponent(String(t));case"urlDecode":return decodeURIComponent(String(t));case"hash":{let i=String(r[0]!==void 0?zt(r[0],n):"md5").toLowerCase(),s=String(r[1]!==void 0?zt(r[1],n):"base64"),l={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[i]||"md5";return lm.createHash(l).update(String(t)).digest(s)}case"hmac":{let i=r[0]?String(zt(r[0],n)):"",s=String(r[1]!==void 0?zt(r[1],n):"sha256").toLowerCase(),o=String(r[2]!==void 0?zt(r[2],n):"base64"),c={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[s]||"sha256";return lm.createHmac(c,i).update(String(t)).digest(o)}case"first":return Array.isArray(t)?t[0]:t;case"last":return Array.isArray(t)?t[t.length-1]:t;case"at":{let i=zt(r[0],n);return Array.isArray(t)?t.at(i):t}case"slice":{let i=zt(r[0],n),s=r[1]!==void 0?zt(r[1],n):void 0;return Array.isArray(t)?t.slice(i,s):String(t).slice(i,s)}case"unique":return Array.isArray(t)?[...new Set(t)]:t;case"filter":return!Array.isArray(t)||!r[0]?t:B2(t,r[0],n);case"map":{if(!Array.isArray(t))return t;let i=r.map(s=>String(zt(s,n)));return i.length===1?t.map(s=>kf(s,i[0])):t.map(s=>{let o={};for(let l of i){let c=kf(s,l);c!==void 0&&(o[l]=c)}return o})}case"prop":{let i=r[0]!==void 0?String(zt(r[0],n)):"";if(Array.isArray(t)){let s=t.map(o=>kf(o,i)).filter(o=>o!==void 0);return s.length===1?s[0]:s.join(",")}return t&&typeof t=="object"?kf(t,i):t}case"parseJSON":try{return JSON.parse(String(t))}catch{return t}case"stringify":try{return JSON.stringify(t)}catch{return String(t)}case"isEmail":return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(t));case"isUrl":try{return new URL(String(t)),!0}catch{return!1}case"setIfValue":return t||void 0;case"setNull":return t===null?null:t;default:return t}}function B2(t,e,r){let n=e.match(/^([\w.]+)\s*(>=|<=|!=|\*=|\^=|\$=|>|<|=)\s*(.+)$/);if(!n)return t;let[,i,s,o]=n,l=zt(o,r);return t.filter(c=>{let d=kf(c,i);if(d===void 0)return!1;switch(s){case">":return Number(d)>Number(l);case">=":return Number(d)>=Number(l);case"<":return Number(d)<Number(l);case"<=":return Number(d)<=Number(l);case"=":return String(d)===String(l);case"!=":return String(d)!==String(l);case"*=":return String(d).includes(String(l));case"^=":return String(d).startsWith(String(l));case"$=":return String(d).endsWith(String(l));default:return!0}})}function kf(t,e){if(!(!t||typeof t!="object"))return e in t?t[e]:e.split(".").reduce((r,n)=>r?.[n],t)}function V2(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var lm,um=le(()=>{"use strict";lm=ve(require("crypto"))});function Aq(t,e){if(t)return t.split(",").map(r=>{let n=r.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);let i=Number(n);if(!isNaN(i)&&n!=="")return i;if(e&&n in e){let s=e[n],o=Number(s);return!isNaN(o)&&s!==""?o:s}return n})}function Tq(t){return new yo(t)}var yo,vo,Af=le(()=>{"use strict";om();Pf();um();yo=class t{allVariables;static MAX_RESOLUTION_DEPTH=20;constructor(e){this.allVariables={...e.globals,...e.collectionVariables,...e.environmentVariables,...e.variables}}resolveString(e,r=!1){return typeof e!="string"?e:this.resolveUntilStable(e,this.allVariables,r)}resolveStringWithExtra(e,r,n=!1){if(typeof e!="string")return e;let i={...this.allVariables,...r};return this.resolveUntilStable(e,i,n)}resolveUntilStable(e,r,n){let i=e;for(let s=0;s<t.MAX_RESOLUTION_DEPTH;s++){let o=this.resolveSinglePass(i,r,n);if(o===i)break;i=o}return i}resolveSinglePass(e,r,n){if(!n)return e.replace(/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,(c,d)=>this.resolveTemplateContent(d.trim(),r,c));let i="",s=0,o=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,l;for(;(l=o.exec(e))!==null;){let c=l[1].trim(),d=this.resolveTemplateContent(c,r,l[0]);if(d!==l[0]){i+=e.slice(s,l.index);let p=this.getStringContext(e,l.index);i+=p?this.escapeForString(String(d),p):String(d)}else i+=e.slice(s,l.index+l[0].length);s=l.index+l[0].length}return i+=e.slice(s),i}resolveObject(e,r=!1){if(typeof e=="string")return this.resolveString(e,r);if(Array.isArray(e))return e.map(n=>this.resolveObject(n,r));if(e!==null&&typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.resolveObject(s,r);return n}return e}resolveObjectWithExtra(e,r,n=!1){if(typeof e=="string")return this.resolveStringWithExtra(e,r,n);if(Array.isArray(e))return e.map(i=>this.resolveObjectWithExtra(i,r,n));if(e!==null&&typeof e=="object"){let i={};for(let[s,o]of Object.entries(e))i[s]=this.resolveObjectWithExtra(o,r,n);return i}return e}resolveTemplateContent(e,r,n){let i=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(i){let l=Aq(i[2],r),c=Vi(i[1],l);return c!==null?String(c):n}let s=xu(e);if(s){let l=this.resolveFilterInput(s.input,r);if(l!==void 0){let c=Cu(l,s.filters,r);return c!==void 0?String(c):n}return n}let o=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(o){let l=o[1];if(r[l]!==void 0){let c=this.deserializeValue(r[l]),d=o[2],p=this.resolvePropertyAccess(c,d);if(p!==void 0)return typeof p=="object"?JSON.stringify(p):String(p)}}if(r[e]!==void 0){let l=r[e];if(typeof l=="string"&&l.charCodeAt(0)===30){let c=l.slice(1);return c==="undefined"?"":c}return String(l)}if(go(e)){let l=this.deserializeVariables(r),c=mo(e,l),d=ui(e,c);if(d!==void 0)return String(d)}return n}resolveFilterInput(e,r){if(e==="@")return"";if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1);let n=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(n){let s=Aq(n[2],r),o=Vi(n[1],s);return o!==null?o:void 0}let i=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(i){let s=i[1];if(r[s]!==void 0){let o=this.deserializeValue(r[s]),l=this.resolvePropertyAccess(o,i[2]);if(l!==void 0)return l}}if(r[e]!==void 0)return this.deserializeValue(r[e]);if(go(e)){let s=this.deserializeVariables(r),o=mo(e,s),l=ui(e,o);if(l!==void 0)return l}}deserializeValue(e){if(typeof e=="string"&&e.charCodeAt(0)===30){let r=e.slice(1);if(r==="undefined")return;try{return JSON.parse(r)}catch{return e}}return e}deserializeVariables(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.deserializeValue(i);return r}resolvePropertyAccess(e,r){let n=e,i=/\[(\d+|"[^"]*"|'[^']*')\]|\.([a-zA-Z_][a-zA-Z0-9_]*)/g,s;for(;(s=i.exec(r))!==null;){if(n==null)return;if(s[1]!==void 0){let o=s[1];/^\d+$/.test(o)?n=n[Number(o)]:n=n[o.slice(1,-1)]}else s[2]!==void 0&&(n=n[s[2]])}return n}escapeForString(e,r){let n=e.replace(/\\/g,"\\\\");return r==='"'?n=n.replace(/"/g,'\\"'):n=n.replace(/'/g,"\\'"),n.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}getStringContext(e,r){let n=null;for(let i=0;i<r;i++){let s=e[i];(i>0?e[i-1]:"")!=="\\"&&(s==='"'||s==="'")&&(n===null?n=s:n===s&&(n=null))}return n}},vo=class{interpolate(e,r){return!e||typeof e!="string"?e:new yo({globals:{},collectionVariables:{},environmentVariables:{},variables:r}).resolveString(e,!0)}extractVariables(e){if(!e||typeof e!="string")return[];let r=[],n,i=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g;for(;(n=i.exec(e))!==null;){let s=n[1].trim();!s.startsWith("$")&&!s.includes("|")&&/^[a-zA-Z_]\w*$/.test(s)&&(r.includes(s)||r.push(s))}return r}interpolateObject(e,r){if(e==null)return e;if(typeof e=="string")return this.interpolate(e,r);if(Array.isArray(e))return e.map(n=>this.interpolateObject(n,r));if(typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.interpolateObject(s,r);return n}return e}}});var Wi,Tf=le(()=>{"use strict";Wi=class{constructor(e,r,n){this.urlBuilder=e;this.interceptors=r;this.httpClient=n}urlBuilder;interceptors;httpClient;async execute(e){let r={},n;try{n=await this.interceptors.executeRequestInterceptors(e,r)}catch(i){let s=await this.interceptors.executeErrorInterceptors(i,e,r);if(s)return s;throw i}try{let i=await this.httpClient.send(n);return await this.interceptors.executeResponseInterceptors(i,n,r)}catch(i){let s=await this.interceptors.executeErrorInterceptors(i,n,r);if(s)return s;throw i}}buildUrl(e,r={},n={}){return this.urlBuilder.buildUrl(e,r,n)}}});var zi,cm,fm,dm,$f=le(()=>{"use strict";zi=class{requestInterceptors=[];responseInterceptors=[];errorInterceptors=[];addRequestInterceptor(e){return this.requestInterceptors.push(e),this.sortByPriority(this.requestInterceptors),this}addResponseInterceptor(e){return this.responseInterceptors.push(e),this.sortByPriority(this.responseInterceptors),this}addErrorInterceptor(e){return this.errorInterceptors.push(e),this.sortByPriority(this.errorInterceptors),this}removeRequestInterceptor(e){let r=this.requestInterceptors.findIndex(n=>n.name===e);return r>=0?(this.requestInterceptors.splice(r,1),!0):!1}removeResponseInterceptor(e){let r=this.responseInterceptors.findIndex(n=>n.name===e);return r>=0?(this.responseInterceptors.splice(r,1),!0):!1}removeErrorInterceptor(e){let r=this.errorInterceptors.findIndex(n=>n.name===e);return r>=0?(this.errorInterceptors.splice(r,1),!0):!1}async executeRequestInterceptors(e,r){let n=e;for(let i of this.requestInterceptors)try{n=await i.intercept(n,r)}catch(s){throw console.error(`[InterceptorChain] Request interceptor '${i.name}' failed:`,s),s}return n}async executeResponseInterceptors(e,r,n){let i=e;for(let s of this.responseInterceptors)try{i=await s.intercept(i,r,n)}catch(o){throw console.error(`[InterceptorChain] Response interceptor '${s.name}' failed:`,o),o}return i}async executeErrorInterceptors(e,r,n){for(let i of this.errorInterceptors)try{let s=await i.handle(e,r,n);if(s)return s}catch(s){console.error(`[InterceptorChain] Error interceptor '${i.name}' failed:`,s)}}clear(){this.requestInterceptors=[],this.responseInterceptors=[],this.errorInterceptors=[]}getRegisteredInterceptors(){return{request:this.requestInterceptors.map(e=>e.name),response:this.responseInterceptors.map(e=>e.name),error:this.errorInterceptors.map(e=>e.name)}}sortByPriority(e){e.sort((r,n)=>(r.priority??100)-(n.priority??100))}},cm=class{name="logging";priority=1e3;intercept(e,r){return e}},fm=class{name="timing";priority=1;intercept(e,r,n){return e}},dm=class{name="retry";priority=1;maxRetries;retryableErrors;constructor(e=3,r=["ECONNRESET","ETIMEDOUT"]){this.maxRetries=e,this.retryableErrors=r}handle(e,r,n){let i=this.retryableErrors.some(s=>e.message.includes(s))}}});var $q=V((Eu,Nf)=>{(function(){var t,e="4.18.1",r=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",s="Invalid `variable` option passed into `_.template`",o="Invalid `imports` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,d="__lodash_placeholder__",p=1,m=2,y=4,b=1,q=2,x=1,v=2,R=4,E=8,k=16,P=32,M=64,j=128,I=256,_=512,A=30,F="...",U=800,D=16,J=1,Q=2,se=3,fe=1/0,Be=9007199254740991,Re=17976931348623157e292,ye=NaN,ke=4294967295,mt=ke-1,Nt=ke>>>1,he=[["ary",j],["bind",x],["bindKey",v],["curry",E],["curryRight",k],["flip",_],["partial",P],["partialRight",M],["rearg",I]],Yt="[object Arguments]",Tr="[object Array]",lt="[object AsyncFunction]",$r="[object Boolean]",wr="[object Date]",xt="[object DOMException]",St="[object Error]",Gr="[object Function]",Ws="[object GeneratorFunction]",At="[object Map]",Ai="[object Number]",On="[object Null]",te="[object Object]",re="[object Promise]",Te="[object Proxy]",ge="[object RegExp]",we="[object Set]",Ze="[object String]",Ct="[object Symbol]",or="[object Undefined]",oe="[object WeakMap]",fr="[object WeakSet]",Lt="[object ArrayBuffer]",gt="[object DataView]",qe="[object Float32Array]",Pn="[object Float64Array]",Ol="[object Int8Array]",zs="[object Int16Array]",ea="[object Int32Array]",Js="[object Uint8Array]",Ti="[object Uint8ClampedArray]",Gs="[object Uint16Array]",Bc="[object Uint32Array]",Pl=/\b__p \+= '';/g,Ov=/\b(__p \+=) '' \+/g,ta=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ls=/&(?:amp|lt|gt|quot|#39);/g,kl=/[&<>"']/g,Al=RegExp(ls.source),me=RegExp(kl.source),Pv=/<%-([\s\S]+?)%>/g,kv=/<%([\s\S]+?)%>/g,kn=/<%=([\s\S]+?)%>/g,Yr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ve=/^\w*$/,Vc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ft=/[\\^$.*+?()[\]{}|]/g,ra=RegExp(ft.source),Wc=/^\s+/,Tl=/\s/,dr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Qn=/\{\n\/\* \[wrapped with (.+)\] \*/,An=/,? & /,Kt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Kr=/[()=,{}\[\]\/\s]/,Zn=/\\(\\)?/g,us=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Lp=/\w*$/,Av=/^[-+]0x[0-9a-f]+$/i,na=/^0b[01]+$/i,Up=/^\[object .+?Constructor\]$/,Tv=/^0o[0-7]+$/i,Ys=/^(?:0|[1-9]\d*)$/,ia=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,sa=/($^)/,$v=/['\n\r\u2028\u2029\\]/g,$l="\\ud800-\\udfff",Nv="\\u0300-\\u036f",Ut="\\ufe20-\\ufe2f",zc="\\u20d0-\\u20ff",Hp=Nv+Ut+zc,Jc="\\u2700-\\u27bf",Gc="a-z\\xdf-\\xf6\\xf8-\\xff",Mv="\\xac\\xb1\\xd7\\xf7",Fv="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Dv="\\u2000-\\u206f",jv=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Bp="A-Z\\xc0-\\xd6\\xd8-\\xde",Vp="\\ufe0e\\ufe0f",Yc=Mv+Fv+Dv+jv,Nl="['\u2019]",Lv="["+$l+"]",Wp="["+Yc+"]",Ml="["+Hp+"]",Kc="\\d+",Uv="["+Jc+"]",Ks="["+Gc+"]",oa="[^"+$l+Yc+Kc+Jc+Gc+Bp+"]",Fl="\\ud83c[\\udffb-\\udfff]",aa="(?:"+Ml+"|"+Fl+")",Tn="[^"+$l+"]",Qc="(?:\\ud83c[\\udde6-\\uddff]){2}",Zc="[\\ud800-\\udbff][\\udc00-\\udfff]",Qs="["+Bp+"]",zp="\\u200d",Jp="(?:"+Ks+"|"+oa+")",Hv="(?:"+Qs+"|"+oa+")",Gp="(?:"+Nl+"(?:d|ll|m|re|s|t|ve))?",Yp="(?:"+Nl+"(?:D|LL|M|RE|S|T|VE))?",Dl=aa+"?",Kp="["+Vp+"]?",Qp="(?:"+zp+"(?:"+[Tn,Qc,Zc].join("|")+")"+Kp+Dl+")*",Bv="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Vv="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Zp=Kp+Dl+Qp,Wv="(?:"+[Uv,Qc,Zc].join("|")+")"+Zp,zv="(?:"+[Tn+Ml+"?",Ml,Qc,Zc,Lv].join("|")+")",Jv=RegExp(Nl,"g"),Gv=RegExp(Ml,"g"),Xc=RegExp(Fl+"(?="+Fl+")|"+zv+Zp,"g"),Yv=RegExp([Qs+"?"+Ks+"+"+Gp+"(?="+[Wp,Qs,"$"].join("|")+")",Hv+"+"+Yp+"(?="+[Wp,Qs+Jp,"$"].join("|")+")",Qs+"?"+Jp+"+"+Gp,Qs+"+"+Yp,Vv,Bv,Kc,Wv].join("|"),"g"),Kv=RegExp("["+zp+$l+Hp+Vp+"]"),Qv=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Zv=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Xv=-1,Pt={};Pt[qe]=Pt[Pn]=Pt[Ol]=Pt[zs]=Pt[ea]=Pt[Js]=Pt[Ti]=Pt[Gs]=Pt[Bc]=!0,Pt[Yt]=Pt[Tr]=Pt[Lt]=Pt[$r]=Pt[gt]=Pt[wr]=Pt[St]=Pt[Gr]=Pt[At]=Pt[Ai]=Pt[te]=Pt[ge]=Pt[we]=Pt[Ze]=Pt[oe]=!1;var Et={};Et[Yt]=Et[Tr]=Et[Lt]=Et[gt]=Et[$r]=Et[wr]=Et[qe]=Et[Pn]=Et[Ol]=Et[zs]=Et[ea]=Et[At]=Et[Ai]=Et[te]=Et[ge]=Et[we]=Et[Ze]=Et[Ct]=Et[Js]=Et[Ti]=Et[Gs]=Et[Bc]=!0,Et[St]=Et[Gr]=Et[oe]=!1;var ef={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},tf={"&":"&","<":"<",">":">",'"':""","'":"'"},eb={"&":"&","<":"<",">":">",""":'"',"'":"'"},Xp={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},eh=parseFloat,tb=parseInt,th=typeof global=="object"&&global&&global.Object===Object&&global,rb=typeof self=="object"&&self&&self.Object===Object&&self,er=th||rb||Function("return this")(),jl=typeof Eu=="object"&&Eu&&!Eu.nodeType&&Eu,dt=jl&&typeof Nf=="object"&&Nf&&!Nf.nodeType&&Nf,Zs=dt&&dt.exports===jl,cs=Zs&&th.process,Qr=(function(){try{var W=dt&&dt.require&&dt.require("util").types;return W||cs&&cs.binding&&cs.binding("util")}catch{}})(),rf=Qr&&Qr.isArrayBuffer,rh=Qr&&Qr.isDate,nh=Qr&&Qr.isMap,la=Qr&&Qr.isRegExp,Xn=Qr&&Qr.isSet,Ll=Qr&&Qr.isTypedArray;function Nr(W,Z,Y){switch(Y.length){case 0:return W.call(Z);case 1:return W.call(Z,Y[0]);case 2:return W.call(Z,Y[0],Y[1]);case 3:return W.call(Z,Y[0],Y[1],Y[2])}return W.apply(Z,Y)}function ei(W,Z,Y,pe){for(var Oe=-1,ut=W==null?0:W.length;++Oe<ut;){var vt=W[Oe];Z(pe,vt,Y(vt),W)}return pe}function Mr(W,Z){for(var Y=-1,pe=W==null?0:W.length;++Y<pe&&Z(W[Y],Y,W)!==!1;);return W}function nf(W,Z){for(var Y=W==null?0:W.length;Y--&&Z(W[Y],Y,W)!==!1;);return W}function ih(W,Z){for(var Y=-1,pe=W==null?0:W.length;++Y<pe;)if(!Z(W[Y],Y,W))return!1;return!0}function $i(W,Z){for(var Y=-1,pe=W==null?0:W.length,Oe=0,ut=[];++Y<pe;){var vt=W[Y];Z(vt,Y,W)&&(ut[Oe++]=vt)}return ut}function Ul(W,Z){var Y=W==null?0:W.length;return!!Y&&fs(W,Z,0)>-1}function Xs(W,Z,Y){for(var pe=-1,Oe=W==null?0:W.length;++pe<Oe;)if(Y(Z,W[pe]))return!0;return!1}function qt(W,Z){for(var Y=-1,pe=W==null?0:W.length,Oe=Array(pe);++Y<pe;)Oe[Y]=Z(W[Y],Y,W);return Oe}function Ni(W,Z){for(var Y=-1,pe=Z.length,Oe=W.length;++Y<pe;)W[Oe+Y]=Z[Y];return W}function sf(W,Z,Y,pe){var Oe=-1,ut=W==null?0:W.length;for(pe&&ut&&(Y=W[++Oe]);++Oe<ut;)Y=Z(Y,W[Oe],Oe,W);return Y}function nb(W,Z,Y,pe){var Oe=W==null?0:W.length;for(pe&&Oe&&(Y=W[--Oe]);Oe--;)Y=Z(Y,W[Oe],Oe,W);return Y}function Hl(W,Z){for(var Y=-1,pe=W==null?0:W.length;++Y<pe;)if(Z(W[Y],Y,W))return!0;return!1}var ib=ua("length");function sb(W){return W.split("")}function ob(W){return W.match(Kt)||[]}function sh(W,Z,Y){var pe;return Y(W,function(Oe,ut,vt){if(Z(Oe,ut,vt))return pe=ut,!1}),pe}function Bl(W,Z,Y,pe){for(var Oe=W.length,ut=Y+(pe?1:-1);pe?ut--:++ut<Oe;)if(Z(W[ut],ut,W))return ut;return-1}function fs(W,Z,Y){return Z===Z?mb(W,Z,Y):Bl(W,ds,Y)}function ab(W,Z,Y,pe){for(var Oe=Y-1,ut=W.length;++Oe<ut;)if(pe(W[Oe],Z))return Oe;return-1}function ds(W){return W!==W}function oh(W,Z){var Y=W==null?0:W.length;return Y?af(W,Z)/Y:ye}function ua(W){return function(Z){return Z==null?t:Z[W]}}function of(W){return function(Z){return W==null?t:W[Z]}}function Vl(W,Z,Y,pe,Oe){return Oe(W,function(ut,vt,Xe){Y=pe?(pe=!1,ut):Z(Y,ut,vt,Xe)}),Y}function lb(W,Z){var Y=W.length;for(W.sort(Z);Y--;)W[Y]=W[Y].value;return W}function af(W,Z){for(var Y,pe=-1,Oe=W.length;++pe<Oe;){var ut=Z(W[pe]);ut!==t&&(Y=Y===t?ut:Y+ut)}return Y}function lf(W,Z){for(var Y=-1,pe=Array(W);++Y<W;)pe[Y]=Z(Y);return pe}function ub(W,Z){return qt(Z,function(Y){return[Y,W[Y]]})}function uf(W){return W&&W.slice(0,fh(W)+1).replace(Wc,"")}function Fr(W){return function(Z){return W(Z)}}function Wl(W,Z){return qt(Z,function(Y){return W[Y]})}function yt(W,Z){return W.has(Z)}function ah(W,Z){for(var Y=-1,pe=W.length;++Y<pe&&fs(Z,W[Y],0)>-1;);return Y}function lh(W,Z){for(var Y=W.length;Y--&&fs(Z,W[Y],0)>-1;);return Y}function uh(W,Z){for(var Y=W.length,pe=0;Y--;)W[Y]===Z&&++pe;return pe}var cb=of(ef),fb=of(tf);function db(W){return"\\"+Xp[W]}function ca(W,Z){return W==null?t:W[Z]}function eo(W){return Kv.test(W)}function pb(W){return Qv.test(W)}function hb(W){for(var Z,Y=[];!(Z=W.next()).done;)Y.push(Z.value);return Y}function to(W){var Z=-1,Y=Array(W.size);return W.forEach(function(pe,Oe){Y[++Z]=[Oe,pe]}),Y}function fa(W,Z){return function(Y){return W(Z(Y))}}function $n(W,Z){for(var Y=-1,pe=W.length,Oe=0,ut=[];++Y<pe;){var vt=W[Y];(vt===Z||vt===d)&&(W[Y]=d,ut[Oe++]=Y)}return ut}function zl(W){var Z=-1,Y=Array(W.size);return W.forEach(function(pe){Y[++Z]=pe}),Y}function ch(W){var Z=-1,Y=Array(W.size);return W.forEach(function(pe){Y[++Z]=[pe,pe]}),Y}function mb(W,Z,Y){for(var pe=Y-1,Oe=W.length;++pe<Oe;)if(W[pe]===Z)return pe;return-1}function cf(W,Z,Y){for(var pe=Y+1;pe--;)if(W[pe]===Z)return pe;return pe}function Mi(W){return eo(W)?yb(W):ib(W)}function Dr(W){return eo(W)?vb(W):sb(W)}function fh(W){for(var Z=W.length;Z--&&Tl.test(W.charAt(Z)););return Z}var gb=of(eb);function yb(W){for(var Z=Xc.lastIndex=0;Xc.test(W);)++Z;return Z}function vb(W){return W.match(Xc)||[]}function bb(W){return W.match(Yv)||[]}var Sb=(function W(Z){Z=Z==null?er:Fi.defaults(er.Object(),Z,Fi.pick(er,Zv));var Y=Z.Array,pe=Z.Date,Oe=Z.Error,ut=Z.Function,vt=Z.Math,Xe=Z.Object,Jl=Z.RegExp,wb=Z.String,jr=Z.TypeError,da=Y.prototype,_b=ut.prototype,ro=Xe.prototype,pa=Z["__core-js_shared__"],Gl=_b.toString,pt=ro.hasOwnProperty,Rb=0,dh=(function(){var a=/[^.]+$/.exec(pa&&pa.keys&&pa.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""})(),Yl=ro.toString,xb=Gl.call(Xe),Cb=er._,Eb=Jl("^"+Gl.call(pt).replace(ft,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Kl=Zs?Z.Buffer:t,Di=Z.Symbol,Ql=Z.Uint8Array,ph=Kl?Kl.allocUnsafe:t,Zl=fa(Xe.getPrototypeOf,Xe),hh=Xe.create,ha=ro.propertyIsEnumerable,Xl=da.splice,mh=Di?Di.isConcatSpreadable:t,ma=Di?Di.iterator:t,ps=Di?Di.toStringTag:t,eu=(function(){try{var a=Ca(Xe,"defineProperty");return a({},"",{}),a}catch{}})(),qb=Z.clearTimeout!==er.clearTimeout&&Z.clearTimeout,Ib=pe&&pe.now!==er.Date.now&&pe.now,Ob=Z.setTimeout!==er.setTimeout&&Z.setTimeout,ga=vt.ceil,ya=vt.floor,tu=Xe.getOwnPropertySymbols,ru=Kl?Kl.isBuffer:t,hs=Z.isFinite,nu=da.join,gh=fa(Xe.keys,Xe),Tt=vt.max,ar=vt.min,yh=pe.now,Pb=Z.parseInt,vh=vt.random,kb=da.reverse,ff=Ca(Z,"DataView"),va=Ca(Z,"Map"),df=Ca(Z,"Promise"),no=Ca(Z,"Set"),ba=Ca(Z,"WeakMap"),Sa=Ca(Xe,"create"),iu=ba&&new ba,io={},Ab=Ea(ff),Tb=Ea(va),$b=Ea(df),Nb=Ea(no),Mb=Ea(ba),su=Di?Di.prototype:t,wa=su?su.valueOf:t,bh=su?su.toString:t;function $(a){if(Wt(a)&&!$e(a)&&!(a instanceof We)){if(a instanceof _r)return a;if(pt.call(a,"__wrapped__"))return ME(a)}return new _r(a)}var so=(function(){function a(){}return function(u){if(!Ht(u))return{};if(hh)return hh(u);a.prototype=u;var h=new a;return a.prototype=t,h}})();function ou(){}function _r(a,u){this.__wrapped__=a,this.__actions__=[],this.__chain__=!!u,this.__index__=0,this.__values__=t}$.templateSettings={escape:Pv,evaluate:kv,interpolate:kn,variable:"",imports:{_:$}},$.prototype=ou.prototype,$.prototype.constructor=$,_r.prototype=so(ou.prototype),_r.prototype.constructor=_r;function We(a){this.__wrapped__=a,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ke,this.__views__=[]}function Fb(){var a=new We(this.__wrapped__);return a.__actions__=Zr(this.__actions__),a.__dir__=this.__dir__,a.__filtered__=this.__filtered__,a.__iteratees__=Zr(this.__iteratees__),a.__takeCount__=this.__takeCount__,a.__views__=Zr(this.__views__),a}function Db(){if(this.__filtered__){var a=new We(this);a.__dir__=-1,a.__filtered__=!0}else a=this.clone(),a.__dir__*=-1;return a}function pf(){var a=this.__wrapped__.value(),u=this.__dir__,h=$e(a),S=u<0,O=h?a.length:0,N=FM(0,O,this.__views__),L=N.start,B=N.end,z=B-L,X=S?B:L-1,ee=this.__iteratees__,ne=ee.length,ce=0,be=ar(z,this.__takeCount__);if(!h||!S&&O==z&&be==z)return sE(a,this.__actions__);var Ee=[];e:for(;z--&&ce<be;){X+=u;for(var De=-1,xe=a[X];++De<ne;){var Ke=ee[De],et=Ke.iteratee,Sn=Ke.type,Hr=et(xe);if(Sn==Q)xe=Hr;else if(!Hr){if(Sn==J)continue e;break e}}Ee[ce++]=xe}return Ee}We.prototype=so(ou.prototype),We.prototype.constructor=We;function Nn(a){var u=-1,h=a==null?0:a.length;for(this.clear();++u<h;){var S=a[u];this.set(S[0],S[1])}}function jb(){this.__data__=Sa?Sa(null):{},this.size=0}function Lb(a){var u=this.has(a)&&delete this.__data__[a];return this.size-=u?1:0,u}function Ub(a){var u=this.__data__;if(Sa){var h=u[a];return h===l?t:h}return pt.call(u,a)?u[a]:t}function Hb(a){var u=this.__data__;return Sa?u[a]!==t:pt.call(u,a)}function Bb(a,u){var h=this.__data__;return this.size+=this.has(a)?0:1,h[a]=Sa&&u===t?l:u,this}Nn.prototype.clear=jb,Nn.prototype.delete=Lb,Nn.prototype.get=Ub,Nn.prototype.has=Hb,Nn.prototype.set=Bb;function ti(a){var u=-1,h=a==null?0:a.length;for(this.clear();++u<h;){var S=a[u];this.set(S[0],S[1])}}function Sh(){this.__data__=[],this.size=0}function Vb(a){var u=this.__data__,h=lu(u,a);if(h<0)return!1;var S=u.length-1;return h==S?u.pop():Xl.call(u,h,1),--this.size,!0}function Wb(a){var u=this.__data__,h=lu(u,a);return h<0?t:u[h][1]}function wh(a){return lu(this.__data__,a)>-1}function zb(a,u){var h=this.__data__,S=lu(h,a);return S<0?(++this.size,h.push([a,u])):h[S][1]=u,this}ti.prototype.clear=Sh,ti.prototype.delete=Vb,ti.prototype.get=Wb,ti.prototype.has=wh,ti.prototype.set=zb;function ri(a){var u=-1,h=a==null?0:a.length;for(this.clear();++u<h;){var S=a[u];this.set(S[0],S[1])}}function Jb(){this.size=0,this.__data__={hash:new Nn,map:new(va||ti),string:new Nn}}function ji(a){var u=Hh(this,a).delete(a);return this.size-=u?1:0,u}function _h(a){return Hh(this,a).get(a)}function Gb(a){return Hh(this,a).has(a)}function Yb(a,u){var h=Hh(this,a),S=h.size;return h.set(a,u),this.size+=h.size==S?0:1,this}ri.prototype.clear=Jb,ri.prototype.delete=ji,ri.prototype.get=_h,ri.prototype.has=Gb,ri.prototype.set=Yb;function ms(a){var u=-1,h=a==null?0:a.length;for(this.__data__=new ri;++u<h;)this.add(a[u])}function ie(a){return this.__data__.set(a,l),this}function Kb(a){return this.__data__.has(a)}ms.prototype.add=ms.prototype.push=ie,ms.prototype.has=Kb;function mn(a){var u=this.__data__=new ti(a);this.size=u.size}function Rh(){this.__data__=new ti,this.size=0}function nt(a){var u=this.__data__,h=u.delete(a);return this.size=u.size,h}function au(a){return this.__data__.get(a)}function xh(a){return this.__data__.has(a)}function hf(a,u){var h=this.__data__;if(h instanceof ti){var S=h.__data__;if(!va||S.length<r-1)return S.push([a,u]),this.size=++h.size,this;h=this.__data__=new ri(S)}return h.set(a,u),this.size=h.size,this}mn.prototype.clear=Rh,mn.prototype.delete=nt,mn.prototype.get=au,mn.prototype.has=xh,mn.prototype.set=hf;function Ch(a,u){var h=$e(a),S=!h&&qa(a),O=!h&&!S&&po(a),N=!h&&!S&&!O&&hu(a),L=h||S||O||N,B=L?lf(a.length,wb):[],z=B.length;for(var X in a)(u||pt.call(a,X))&&!(L&&(X=="length"||O&&(X=="offset"||X=="parent")||N&&(X=="buffer"||X=="byteLength"||X=="byteOffset")||bs(X,z)))&&B.push(X);return B}function Eh(a){var u=a.length;return u?a[uS(0,u-1)]:t}function Qb(a,u){return Bh(Zr(a),Li(u,0,a.length))}function Zb(a){return Bh(Zr(a))}function mf(a,u,h){(h!==t&&!ai(a[u],h)||h===t&&!(u in a))&&gn(a,u,h)}function Lr(a,u,h){var S=a[u];(!(pt.call(a,u)&&ai(S,h))||h===t&&!(u in a))&&gn(a,u,h)}function lu(a,u){for(var h=a.length;h--;)if(ai(a[h][0],u))return h;return-1}function qh(a,u,h,S){return Ui(a,function(O,N,L){u(S,O,h(O),L)}),S}function Ih(a,u){return a&&Hi(u,pr(u),a)}function Xb(a,u){return a&&Hi(u,en(u),a)}function gn(a,u,h){u=="__proto__"&&eu?eu(a,u,{configurable:!0,enumerable:!0,value:h,writable:!0}):a[u]=h}function gf(a,u){for(var h=-1,S=u.length,O=Y(S),N=a==null;++h<S;)O[h]=N?t:NS(a,u[h]);return O}function Li(a,u,h){return a===a&&(h!==t&&(a=a<=h?a:h),u!==t&&(a=a>=u?a:u)),a}function Rr(a,u,h,S,O,N){var L,B=u&p,z=u&m,X=u&y;if(h&&(L=O?h(a,S,O,N):h(a)),L!==t)return L;if(!Ht(a))return a;var ee=$e(a);if(ee){if(L=jM(a),!B)return Zr(a,L)}else{var ne=xr(a),ce=ne==Gr||ne==Ws;if(po(a))return lE(a,B);if(ne==te||ne==Yt||ce&&!O){if(L=z||ce?{}:qE(a),!B)return z?IM(a,Xb(L,a)):qM(a,Ih(L,a))}else{if(!Et[ne])return O?a:{};L=LM(a,ne,B)}}N||(N=new mn);var be=N.get(a);if(be)return be;N.set(a,L),rq(a)?a.forEach(function(xe){L.add(Rr(xe,u,h,xe,a,N))}):eq(a)&&a.forEach(function(xe,Ke){L.set(Ke,Rr(xe,u,h,Ke,a,N))});var Ee=X?z?SS:bS:z?en:pr,De=ee?t:Ee(a);return Mr(De||a,function(xe,Ke){De&&(Ke=xe,xe=a[Ke]),Lr(L,Ke,Rr(xe,u,h,Ke,a,N))}),L}function eS(a){var u=pr(a);return function(h){return Mn(h,a,u)}}function Mn(a,u,h){var S=h.length;if(a==null)return!S;for(a=Xe(a);S--;){var O=h[S],N=u[O],L=a[O];if(L===t&&!(O in a)||!N(L))return!1}return!0}function yf(a,u,h){if(typeof a!="function")throw new jr(i);return xf(function(){a.apply(t,h)},u)}function _a(a,u,h,S){var O=-1,N=Ul,L=!0,B=a.length,z=[],X=u.length;if(!B)return z;h&&(u=qt(u,Fr(h))),S?(N=Xs,L=!1):u.length>=r&&(N=yt,L=!1,u=new ms(u));e:for(;++O<B;){var ee=a[O],ne=h==null?ee:h(ee);if(ee=S||ee!==0?ee:0,L&&ne===ne){for(var ce=X;ce--;)if(u[ce]===ne)continue e;z.push(ee)}else N(u,ne,S)||z.push(ee)}return z}var Ui=pE(Fn),Oh=pE(ni,!0);function tS(a,u){var h=!0;return Ui(a,function(S,O,N){return h=!!u(S,O,N),h}),h}function uu(a,u,h){for(var S=-1,O=a.length;++S<O;){var N=a[S],L=u(N);if(L!=null&&(B===t?L===L&&!bn(L):h(L,B)))var B=L,z=N}return z}function rS(a,u,h,S){var O=a.length;for(h=Me(h),h<0&&(h=-h>O?0:O+h),S=S===t||S>O?O:Me(S),S<0&&(S+=O),S=h>S?0:iq(S);h<S;)a[h++]=u;return a}function Ph(a,u){var h=[];return Ui(a,function(S,O,N){u(S,O,N)&&h.push(S)}),h}function lr(a,u,h,S,O){var N=-1,L=a.length;for(h||(h=HM),O||(O=[]);++N<L;){var B=a[N];u>0&&h(B)?u>1?lr(B,u-1,h,S,O):Ni(O,B):S||(O[O.length]=B)}return O}var vf=hE(),kh=hE(!0);function Fn(a,u){return a&&vf(a,u,pr)}function ni(a,u){return a&&kh(a,u,pr)}function cu(a,u){return $i(u,function(h){return Ss(a[h])})}function gs(a,u){u=co(u,a);for(var h=0,S=u.length;a!=null&&h<S;)a=a[oi(u[h++])];return h&&h==S?a:t}function Ah(a,u,h){var S=u(a);return $e(a)?S:Ni(S,h(a))}function mr(a){return a==null?a===t?or:On:ps&&ps in Xe(a)?MM(a):YM(a)}function bf(a,u){return a>u}function nS(a,u){return a!=null&&pt.call(a,u)}function iS(a,u){return a!=null&&u in Xe(a)}function sS(a,u,h){return a>=ar(u,h)&&a<Tt(u,h)}function yn(a,u,h){for(var S=h?Xs:Ul,O=a[0].length,N=a.length,L=N,B=Y(N),z=1/0,X=[];L--;){var ee=a[L];L&&u&&(ee=qt(ee,Fr(u))),z=ar(ee.length,z),B[L]=!h&&(u||O>=120&&ee.length>=120)?new ms(L&&ee):t}ee=a[0];var ne=-1,ce=B[0];e:for(;++ne<O&&X.length<z;){var be=ee[ne],Ee=u?u(be):be;if(be=h||be!==0?be:0,!(ce?yt(ce,Ee):S(X,Ee,h))){for(L=N;--L;){var De=B[L];if(!(De?yt(De,Ee):S(a[L],Ee,h)))continue e}ce&&ce.push(Ee),X.push(be)}}return X}function oo(a,u,h,S){return Fn(a,function(O,N,L){u(S,h(O),N,L)}),S}function Ra(a,u,h){u=co(u,a),a=kE(a,u);var S=a==null?a:a[oi(jn(u))];return S==null?t:Nr(S,a,h)}function Th(a){return Wt(a)&&mr(a)==Yt}function oS(a){return Wt(a)&&mr(a)==Lt}function aS(a){return Wt(a)&&mr(a)==wr}function xa(a,u,h,S,O){return a===u?!0:a==null||u==null||!Wt(a)&&!Wt(u)?a!==a&&u!==u:Sf(a,u,h,S,xa,O)}function Sf(a,u,h,S,O,N){var L=$e(a),B=$e(u),z=L?Tr:xr(a),X=B?Tr:xr(u);z=z==Yt?te:z,X=X==Yt?te:X;var ee=z==te,ne=X==te,ce=z==X;if(ce&&po(a)){if(!po(u))return!1;L=!0,ee=!1}if(ce&&!ee)return N||(N=new mn),L||hu(a)?xE(a,u,h,S,O,N):$M(a,u,z,h,S,O,N);if(!(h&b)){var be=ee&&pt.call(a,"__wrapped__"),Ee=ne&&pt.call(u,"__wrapped__");if(be||Ee){var De=be?a.value():a,xe=Ee?u.value():u;return N||(N=new mn),O(De,xe,h,S,N)}}return ce?(N||(N=new mn),NM(a,u,h,S,O,N)):!1}function ao(a){return Wt(a)&&xr(a)==At}function lo(a,u,h,S){var O=h.length,N=O,L=!S;if(a==null)return!N;for(a=Xe(a);O--;){var B=h[O];if(L&&B[2]?B[1]!==a[B[0]]:!(B[0]in a))return!1}for(;++O<N;){B=h[O];var z=B[0],X=a[z],ee=B[1];if(L&&B[2]){if(X===t&&!(z in a))return!1}else{var ne=new mn;if(S)var ce=S(X,ee,z,a,u,ne);if(!(ce===t?xa(ee,X,b|q,S,ne):ce))return!1}}return!0}function Ye(a){if(!Ht(a)||VM(a))return!1;var u=Ss(a)?Eb:Up;return u.test(Ea(a))}function f(a){return Wt(a)&&mr(a)==ge}function g(a){return Wt(a)&&xr(a)==we}function w(a){return Wt(a)&&Yh(a.length)&&!!Pt[mr(a)]}function C(a){return typeof a=="function"?a:a==null?tn:typeof a=="object"?$e(a)?ze(a[0],a[1]):Ie(a):gq(a)}function T(a){if(!Rf(a))return gh(a);var u=[];for(var h in Xe(a))pt.call(a,h)&&h!="constructor"&&u.push(h);return u}function H(a){if(!Ht(a))return GM(a);var u=Rf(a),h=[];for(var S in a)S=="constructor"&&(u||!pt.call(a,S))||h.push(S);return h}function K(a,u){return a<u}function de(a,u){var h=-1,S=Xr(a)?Y(a.length):[];return Ui(a,function(O,N,L){S[++h]=u(O,N,L)}),S}function Ie(a){var u=_S(a);return u.length==1&&u[0][2]?OE(u[0][0],u[0][1]):function(h){return h===a||lo(h,a,u)}}function ze(a,u){return xS(a)&&IE(u)?OE(oi(a),u):function(h){var S=NS(h,a);return S===t&&S===u?MS(h,a):xa(u,S,b|q)}}function tr(a,u,h,S,O){a!==u&&vf(u,function(N,L){if(O||(O=new mn),Ht(N))ii(a,u,L,h,tr,S,O);else{var B=S?S(ES(a,L),N,L+"",a,u,O):t;B===t&&(B=N),mf(a,L,B)}},en)}function ii(a,u,h,S,O,N,L){var B=ES(a,h),z=ES(u,h),X=L.get(z);if(X){mf(a,h,X);return}var ee=N?N(B,z,h+"",a,u,L):t,ne=ee===t;if(ne){var ce=$e(z),be=!ce&&po(z),Ee=!ce&&!be&&hu(z);ee=z,ce||be||Ee?$e(B)?ee=B:Qt(B)?ee=Zr(B):be?(ne=!1,ee=lE(z,!0)):Ee?(ne=!1,ee=uE(z,!0)):ee=[]:Cf(z)||qa(z)?(ee=B,qa(B)?ee=sq(B):(!Ht(B)||Ss(B))&&(ee=qE(z))):ne=!1}ne&&(L.set(z,ee),O(ee,z,S,N,L),L.delete(z)),mf(a,h,ee)}function si(a,u){var h=a.length;if(h)return u+=u<0?h:0,bs(u,h)?a[u]:t}function ZC(a,u,h){u.length?u=qt(u,function(N){return $e(N)?function(L){return gs(L,N.length===1?N[0]:N)}:N}):u=[tn];var S=-1;u=qt(u,Fr(Ce()));var O=de(a,function(N,L,B){var z=qt(u,function(X){return X(N)});return{criteria:z,index:++S,value:N}});return lb(O,function(N,L){return EM(N,L,h)})}function hM(a,u){return XC(a,u,function(h,S){return MS(a,S)})}function XC(a,u,h){for(var S=-1,O=u.length,N={};++S<O;){var L=u[S],B=gs(a,L);h(B,L)&&wf(N,co(L,a),B)}return N}function mM(a){return function(u){return gs(u,a)}}function lS(a,u,h,S){var O=S?ab:fs,N=-1,L=u.length,B=a;for(a===u&&(u=Zr(u)),h&&(B=qt(a,Fr(h)));++N<L;)for(var z=0,X=u[N],ee=h?h(X):X;(z=O(B,ee,z,S))>-1;)B!==a&&Xl.call(B,z,1),Xl.call(a,z,1);return a}function eE(a,u){for(var h=a?u.length:0,S=h-1;h--;){var O=u[h];if(h==S||O!==N){var N=O;bs(O)?Xl.call(a,O,1):dS(a,O)}}return a}function uS(a,u){return a+ya(vh()*(u-a+1))}function gM(a,u,h,S){for(var O=-1,N=Tt(ga((u-a)/(h||1)),0),L=Y(N);N--;)L[S?N:++O]=a,a+=h;return L}function cS(a,u){var h="";if(!a||u<1||u>Be)return h;do u%2&&(h+=a),u=ya(u/2),u&&(a+=a);while(u);return h}function Ue(a,u){return qS(PE(a,u,tn),a+"")}function yM(a){return Eh(mu(a))}function vM(a,u){var h=mu(a);return Bh(h,Li(u,0,h.length))}function wf(a,u,h,S){if(!Ht(a))return a;u=co(u,a);for(var O=-1,N=u.length,L=N-1,B=a;B!=null&&++O<N;){var z=oi(u[O]),X=h;if(z==="__proto__"||z==="constructor"||z==="prototype")return a;if(O!=L){var ee=B[z];X=S?S(ee,z,B):t,X===t&&(X=Ht(ee)?ee:bs(u[O+1])?[]:{})}Lr(B,z,X),B=B[z]}return a}var tE=iu?function(a,u){return iu.set(a,u),a}:tn,bM=eu?function(a,u){return eu(a,"toString",{configurable:!0,enumerable:!1,value:DS(u),writable:!0})}:tn;function SM(a){return Bh(mu(a))}function Dn(a,u,h){var S=-1,O=a.length;u<0&&(u=-u>O?0:O+u),h=h>O?O:h,h<0&&(h+=O),O=u>h?0:h-u>>>0,u>>>=0;for(var N=Y(O);++S<O;)N[S]=a[S+u];return N}function wM(a,u){var h;return Ui(a,function(S,O,N){return h=u(S,O,N),!h}),!!h}function $h(a,u,h){var S=0,O=a==null?S:a.length;if(typeof u=="number"&&u===u&&O<=Nt){for(;S<O;){var N=S+O>>>1,L=a[N];L!==null&&!bn(L)&&(h?L<=u:L<u)?S=N+1:O=N}return O}return fS(a,u,tn,h)}function fS(a,u,h,S){var O=0,N=a==null?0:a.length;if(N===0)return 0;u=h(u);for(var L=u!==u,B=u===null,z=bn(u),X=u===t;O<N;){var ee=ya((O+N)/2),ne=h(a[ee]),ce=ne!==t,be=ne===null,Ee=ne===ne,De=bn(ne);if(L)var xe=S||Ee;else X?xe=Ee&&(S||ce):B?xe=Ee&&ce&&(S||!be):z?xe=Ee&&ce&&!be&&(S||!De):be||De?xe=!1:xe=S?ne<=u:ne<u;xe?O=ee+1:N=ee}return ar(N,mt)}function rE(a,u){for(var h=-1,S=a.length,O=0,N=[];++h<S;){var L=a[h],B=u?u(L):L;if(!h||!ai(B,z)){var z=B;N[O++]=L===0?0:L}}return N}function nE(a){return typeof a=="number"?a:bn(a)?ye:+a}function vn(a){if(typeof a=="string")return a;if($e(a))return qt(a,vn)+"";if(bn(a))return bh?bh.call(a):"";var u=a+"";return u=="0"&&1/a==-fe?"-0":u}function uo(a,u,h){var S=-1,O=Ul,N=a.length,L=!0,B=[],z=B;if(h)L=!1,O=Xs;else if(N>=r){var X=u?null:AM(a);if(X)return zl(X);L=!1,O=yt,z=new ms}else z=u?[]:B;e:for(;++S<N;){var ee=a[S],ne=u?u(ee):ee;if(ee=h||ee!==0?ee:0,L&&ne===ne){for(var ce=z.length;ce--;)if(z[ce]===ne)continue e;u&&z.push(ne),B.push(ee)}else O(z,ne,h)||(z!==B&&z.push(ne),B.push(ee))}return B}function dS(a,u){u=co(u,a);var h=-1,S=u.length;if(!S)return!0;for(;++h<S;){var O=oi(u[h]);if(O==="__proto__"&&!pt.call(a,"__proto__")||(O==="constructor"||O==="prototype")&&h<S-1)return!1}var N=kE(a,u);return N==null||delete N[oi(jn(u))]}function iE(a,u,h,S){return wf(a,u,h(gs(a,u)),S)}function Nh(a,u,h,S){for(var O=a.length,N=S?O:-1;(S?N--:++N<O)&&u(a[N],N,a););return h?Dn(a,S?0:N,S?N+1:O):Dn(a,S?N+1:0,S?O:N)}function sE(a,u){var h=a;return h instanceof We&&(h=h.value()),sf(u,function(S,O){return O.func.apply(O.thisArg,Ni([S],O.args))},h)}function pS(a,u,h){var S=a.length;if(S<2)return S?uo(a[0]):[];for(var O=-1,N=Y(S);++O<S;)for(var L=a[O],B=-1;++B<S;)B!=O&&(N[O]=_a(N[O]||L,a[B],u,h));return uo(lr(N,1),u,h)}function oE(a,u,h){for(var S=-1,O=a.length,N=u.length,L={};++S<O;){var B=S<N?u[S]:t;h(L,a[S],B)}return L}function hS(a){return Qt(a)?a:[]}function mS(a){return typeof a=="function"?a:tn}function co(a,u){return $e(a)?a:xS(a,u)?[a]:NE(wt(a))}var _M=Ue;function fo(a,u,h){var S=a.length;return h=h===t?S:h,!u&&h>=S?a:Dn(a,u,h)}var aE=qb||function(a){return er.clearTimeout(a)};function lE(a,u){if(u)return a.slice();var h=a.length,S=ph?ph(h):new a.constructor(h);return a.copy(S),S}function gS(a){var u=new a.constructor(a.byteLength);return new Ql(u).set(new Ql(a)),u}function RM(a,u){var h=u?gS(a.buffer):a.buffer;return new a.constructor(h,a.byteOffset,a.byteLength)}function xM(a){var u=new a.constructor(a.source,Lp.exec(a));return u.lastIndex=a.lastIndex,u}function CM(a){return wa?Xe(wa.call(a)):{}}function uE(a,u){var h=u?gS(a.buffer):a.buffer;return new a.constructor(h,a.byteOffset,a.length)}function cE(a,u){if(a!==u){var h=a!==t,S=a===null,O=a===a,N=bn(a),L=u!==t,B=u===null,z=u===u,X=bn(u);if(!B&&!X&&!N&&a>u||N&&L&&z&&!B&&!X||S&&L&&z||!h&&z||!O)return 1;if(!S&&!N&&!X&&a<u||X&&h&&O&&!S&&!N||B&&h&&O||!L&&O||!z)return-1}return 0}function EM(a,u,h){for(var S=-1,O=a.criteria,N=u.criteria,L=O.length,B=h.length;++S<L;){var z=cE(O[S],N[S]);if(z){if(S>=B)return z;var X=h[S];return z*(X=="desc"?-1:1)}}return a.index-u.index}function fE(a,u,h,S){for(var O=-1,N=a.length,L=h.length,B=-1,z=u.length,X=Tt(N-L,0),ee=Y(z+X),ne=!S;++B<z;)ee[B]=u[B];for(;++O<L;)(ne||O<N)&&(ee[h[O]]=a[O]);for(;X--;)ee[B++]=a[O++];return ee}function dE(a,u,h,S){for(var O=-1,N=a.length,L=-1,B=h.length,z=-1,X=u.length,ee=Tt(N-B,0),ne=Y(ee+X),ce=!S;++O<ee;)ne[O]=a[O];for(var be=O;++z<X;)ne[be+z]=u[z];for(;++L<B;)(ce||O<N)&&(ne[be+h[L]]=a[O++]);return ne}function Zr(a,u){var h=-1,S=a.length;for(u||(u=Y(S));++h<S;)u[h]=a[h];return u}function Hi(a,u,h,S){var O=!h;h||(h={});for(var N=-1,L=u.length;++N<L;){var B=u[N],z=S?S(h[B],a[B],B,h,a):t;z===t&&(z=a[B]),O?gn(h,B,z):Lr(h,B,z)}return h}function qM(a,u){return Hi(a,RS(a),u)}function IM(a,u){return Hi(a,CE(a),u)}function Mh(a,u){return function(h,S){var O=$e(h)?ei:qh,N=u?u():{};return O(h,a,Ce(S,2),N)}}function fu(a){return Ue(function(u,h){var S=-1,O=h.length,N=O>1?h[O-1]:t,L=O>2?h[2]:t;for(N=a.length>3&&typeof N=="function"?(O--,N):t,L&&Ur(h[0],h[1],L)&&(N=O<3?t:N,O=1),u=Xe(u);++S<O;){var B=h[S];B&&a(u,B,S,N)}return u})}function pE(a,u){return function(h,S){if(h==null)return h;if(!Xr(h))return a(h,S);for(var O=h.length,N=u?O:-1,L=Xe(h);(u?N--:++N<O)&&S(L[N],N,L)!==!1;);return h}}function hE(a){return function(u,h,S){for(var O=-1,N=Xe(u),L=S(u),B=L.length;B--;){var z=L[a?B:++O];if(h(N[z],z,N)===!1)break}return u}}function OM(a,u,h){var S=u&x,O=_f(a);function N(){var L=this&&this!==er&&this instanceof N?O:a;return L.apply(S?h:this,arguments)}return N}function mE(a){return function(u){u=wt(u);var h=eo(u)?Dr(u):t,S=h?h[0]:u.charAt(0),O=h?fo(h,1).join(""):u.slice(1);return S[a]()+O}}function du(a){return function(u){return sf(hq(pq(u).replace(Jv,"")),a,"")}}function _f(a){return function(){var u=arguments;switch(u.length){case 0:return new a;case 1:return new a(u[0]);case 2:return new a(u[0],u[1]);case 3:return new a(u[0],u[1],u[2]);case 4:return new a(u[0],u[1],u[2],u[3]);case 5:return new a(u[0],u[1],u[2],u[3],u[4]);case 6:return new a(u[0],u[1],u[2],u[3],u[4],u[5]);case 7:return new a(u[0],u[1],u[2],u[3],u[4],u[5],u[6])}var h=so(a.prototype),S=a.apply(h,u);return Ht(S)?S:h}}function PM(a,u,h){var S=_f(a);function O(){for(var N=arguments.length,L=Y(N),B=N,z=pu(O);B--;)L[B]=arguments[B];var X=N<3&&L[0]!==z&&L[N-1]!==z?[]:$n(L,z);if(N-=X.length,N<h)return SE(a,u,Fh,O.placeholder,t,L,X,t,t,h-N);var ee=this&&this!==er&&this instanceof O?S:a;return Nr(ee,this,L)}return O}function gE(a){return function(u,h,S){var O=Xe(u);if(!Xr(u)){var N=Ce(h,3);u=pr(u),h=function(B){return N(O[B],B,O)}}var L=a(u,h,S);return L>-1?O[N?u[L]:L]:t}}function yE(a){return vs(function(u){var h=u.length,S=h,O=_r.prototype.thru;for(a&&u.reverse();S--;){var N=u[S];if(typeof N!="function")throw new jr(i);if(O&&!L&&Uh(N)=="wrapper")var L=new _r([],!0)}for(S=L?S:h;++S<h;){N=u[S];var B=Uh(N),z=B=="wrapper"?wS(N):t;z&&CS(z[0])&&z[1]==(j|E|P|I)&&!z[4].length&&z[9]==1?L=L[Uh(z[0])].apply(L,z[3]):L=N.length==1&&CS(N)?L[B]():L.thru(N)}return function(){var X=arguments,ee=X[0];if(L&&X.length==1&&$e(ee))return L.plant(ee).value();for(var ne=0,ce=h?u[ne].apply(this,X):ee;++ne<h;)ce=u[ne].call(this,ce);return ce}})}function Fh(a,u,h,S,O,N,L,B,z,X){var ee=u&j,ne=u&x,ce=u&v,be=u&(E|k),Ee=u&_,De=ce?t:_f(a);function xe(){for(var Ke=arguments.length,et=Y(Ke),Sn=Ke;Sn--;)et[Sn]=arguments[Sn];if(be)var Hr=pu(xe),wn=uh(et,Hr);if(S&&(et=fE(et,S,O,be)),N&&(et=dE(et,N,L,be)),Ke-=wn,be&&Ke<X){var Zt=$n(et,Hr);return SE(a,u,Fh,xe.placeholder,h,et,Zt,B,z,X-Ke)}var li=ne?h:this,_s=ce?li[a]:a;return Ke=et.length,B?et=KM(et,B):Ee&&Ke>1&&et.reverse(),ee&&z<Ke&&(et.length=z),this&&this!==er&&this instanceof xe&&(_s=De||_f(_s)),_s.apply(li,et)}return xe}function vE(a,u){return function(h,S){return oo(h,a,u(S),{})}}function Dh(a,u){return function(h,S){var O;if(h===t&&S===t)return u;if(h!==t&&(O=h),S!==t){if(O===t)return S;typeof h=="string"||typeof S=="string"?(h=vn(h),S=vn(S)):(h=nE(h),S=nE(S)),O=a(h,S)}return O}}function yS(a){return vs(function(u){return u=qt(u,Fr(Ce())),Ue(function(h){var S=this;return a(u,function(O){return Nr(O,S,h)})})})}function jh(a,u){u=u===t?" ":vn(u);var h=u.length;if(h<2)return h?cS(u,a):u;var S=cS(u,ga(a/Mi(u)));return eo(u)?fo(Dr(S),0,a).join(""):S.slice(0,a)}function kM(a,u,h,S){var O=u&x,N=_f(a);function L(){for(var B=-1,z=arguments.length,X=-1,ee=S.length,ne=Y(ee+z),ce=this&&this!==er&&this instanceof L?N:a;++X<ee;)ne[X]=S[X];for(;z--;)ne[X++]=arguments[++B];return Nr(ce,O?h:this,ne)}return L}function bE(a){return function(u,h,S){return S&&typeof S!="number"&&Ur(u,h,S)&&(h=S=t),u=ws(u),h===t?(h=u,u=0):h=ws(h),S=S===t?u<h?1:-1:ws(S),gM(u,h,S,a)}}function Lh(a){return function(u,h){return typeof u=="string"&&typeof h=="string"||(u=Ln(u),h=Ln(h)),a(u,h)}}function SE(a,u,h,S,O,N,L,B,z,X){var ee=u&E,ne=ee?L:t,ce=ee?t:L,be=ee?N:t,Ee=ee?t:N;u|=ee?P:M,u&=~(ee?M:P),u&R||(u&=~(x|v));var De=[a,u,O,be,ne,Ee,ce,B,z,X],xe=h.apply(t,De);return CS(a)&&AE(xe,De),xe.placeholder=S,TE(xe,a,u)}function vS(a){var u=vt[a];return function(h,S){if(h=Ln(h),S=S==null?0:ar(Me(S),292),S&&hs(h)){var O=(wt(h)+"e").split("e"),N=u(O[0]+"e"+(+O[1]+S));return O=(wt(N)+"e").split("e"),+(O[0]+"e"+(+O[1]-S))}return u(h)}}var AM=no&&1/zl(new no([,-0]))[1]==fe?function(a){return new no(a)}:US;function wE(a){return function(u){var h=xr(u);return h==At?to(u):h==we?ch(u):ub(u,a(u))}}function ys(a,u,h,S,O,N,L,B){var z=u&v;if(!z&&typeof a!="function")throw new jr(i);var X=S?S.length:0;if(X||(u&=~(P|M),S=O=t),L=L===t?L:Tt(Me(L),0),B=B===t?B:Me(B),X-=O?O.length:0,u&M){var ee=S,ne=O;S=O=t}var ce=z?t:wS(a),be=[a,u,h,S,O,ee,ne,N,L,B];if(ce&&JM(be,ce),a=be[0],u=be[1],h=be[2],S=be[3],O=be[4],B=be[9]=be[9]===t?z?0:a.length:Tt(be[9]-X,0),!B&&u&(E|k)&&(u&=~(E|k)),!u||u==x)var Ee=OM(a,u,h);else u==E||u==k?Ee=PM(a,u,B):(u==P||u==(x|P))&&!O.length?Ee=kM(a,u,h,S):Ee=Fh.apply(t,be);var De=ce?tE:AE;return TE(De(Ee,be),a,u)}function _E(a,u,h,S){return a===t||ai(a,ro[h])&&!pt.call(S,h)?u:a}function RE(a,u,h,S,O,N){return Ht(a)&&Ht(u)&&(N.set(u,a),tr(a,u,t,RE,N),N.delete(u)),a}function TM(a){return Cf(a)?t:a}function xE(a,u,h,S,O,N){var L=h&b,B=a.length,z=u.length;if(B!=z&&!(L&&z>B))return!1;var X=N.get(a),ee=N.get(u);if(X&&ee)return X==u&&ee==a;var ne=-1,ce=!0,be=h&q?new ms:t;for(N.set(a,u),N.set(u,a);++ne<B;){var Ee=a[ne],De=u[ne];if(S)var xe=L?S(De,Ee,ne,u,a,N):S(Ee,De,ne,a,u,N);if(xe!==t){if(xe)continue;ce=!1;break}if(be){if(!Hl(u,function(Ke,et){if(!yt(be,et)&&(Ee===Ke||O(Ee,Ke,h,S,N)))return be.push(et)})){ce=!1;break}}else if(!(Ee===De||O(Ee,De,h,S,N))){ce=!1;break}}return N.delete(a),N.delete(u),ce}function $M(a,u,h,S,O,N,L){switch(h){case gt:if(a.byteLength!=u.byteLength||a.byteOffset!=u.byteOffset)return!1;a=a.buffer,u=u.buffer;case Lt:return!(a.byteLength!=u.byteLength||!N(new Ql(a),new Ql(u)));case $r:case wr:case Ai:return ai(+a,+u);case St:return a.name==u.name&&a.message==u.message;case ge:case Ze:return a==u+"";case At:var B=to;case we:var z=S&b;if(B||(B=zl),a.size!=u.size&&!z)return!1;var X=L.get(a);if(X)return X==u;S|=q,L.set(a,u);var ee=xE(B(a),B(u),S,O,N,L);return L.delete(a),ee;case Ct:if(wa)return wa.call(a)==wa.call(u)}return!1}function NM(a,u,h,S,O,N){var L=h&b,B=bS(a),z=B.length,X=bS(u),ee=X.length;if(z!=ee&&!L)return!1;for(var ne=z;ne--;){var ce=B[ne];if(!(L?ce in u:pt.call(u,ce)))return!1}var be=N.get(a),Ee=N.get(u);if(be&&Ee)return be==u&&Ee==a;var De=!0;N.set(a,u),N.set(u,a);for(var xe=L;++ne<z;){ce=B[ne];var Ke=a[ce],et=u[ce];if(S)var Sn=L?S(et,Ke,ce,u,a,N):S(Ke,et,ce,a,u,N);if(!(Sn===t?Ke===et||O(Ke,et,h,S,N):Sn)){De=!1;break}xe||(xe=ce=="constructor")}if(De&&!xe){var Hr=a.constructor,wn=u.constructor;Hr!=wn&&"constructor"in a&&"constructor"in u&&!(typeof Hr=="function"&&Hr instanceof Hr&&typeof wn=="function"&&wn instanceof wn)&&(De=!1)}return N.delete(a),N.delete(u),De}function vs(a){return qS(PE(a,t,jE),a+"")}function bS(a){return Ah(a,pr,RS)}function SS(a){return Ah(a,en,CE)}var wS=iu?function(a){return iu.get(a)}:US;function Uh(a){for(var u=a.name+"",h=io[u],S=pt.call(io,u)?h.length:0;S--;){var O=h[S],N=O.func;if(N==null||N==a)return O.name}return u}function pu(a){var u=pt.call($,"placeholder")?$:a;return u.placeholder}function Ce(){var a=$.iteratee||jS;return a=a===jS?C:a,arguments.length?a(arguments[0],arguments[1]):a}function Hh(a,u){var h=a.__data__;return BM(u)?h[typeof u=="string"?"string":"hash"]:h.map}function _S(a){for(var u=pr(a),h=u.length;h--;){var S=u[h],O=a[S];u[h]=[S,O,IE(O)]}return u}function Ca(a,u){var h=ca(a,u);return Ye(h)?h:t}function MM(a){var u=pt.call(a,ps),h=a[ps];try{a[ps]=t;var S=!0}catch{}var O=Yl.call(a);return S&&(u?a[ps]=h:delete a[ps]),O}var RS=tu?function(a){return a==null?[]:(a=Xe(a),$i(tu(a),function(u){return ha.call(a,u)}))}:HS,CE=tu?function(a){for(var u=[];a;)Ni(u,RS(a)),a=Zl(a);return u}:HS,xr=mr;(ff&&xr(new ff(new ArrayBuffer(1)))!=gt||va&&xr(new va)!=At||df&&xr(df.resolve())!=re||no&&xr(new no)!=we||ba&&xr(new ba)!=oe)&&(xr=function(a){var u=mr(a),h=u==te?a.constructor:t,S=h?Ea(h):"";if(S)switch(S){case Ab:return gt;case Tb:return At;case $b:return re;case Nb:return we;case Mb:return oe}return u});function FM(a,u,h){for(var S=-1,O=h.length;++S<O;){var N=h[S],L=N.size;switch(N.type){case"drop":a+=L;break;case"dropRight":u-=L;break;case"take":u=ar(u,a+L);break;case"takeRight":a=Tt(a,u-L);break}}return{start:a,end:u}}function DM(a){var u=a.match(Qn);return u?u[1].split(An):[]}function EE(a,u,h){u=co(u,a);for(var S=-1,O=u.length,N=!1;++S<O;){var L=oi(u[S]);if(!(N=a!=null&&h(a,L)))break;a=a[L]}return N||++S!=O?N:(O=a==null?0:a.length,!!O&&Yh(O)&&bs(L,O)&&($e(a)||qa(a)))}function jM(a){var u=a.length,h=new a.constructor(u);return u&&typeof a[0]=="string"&&pt.call(a,"index")&&(h.index=a.index,h.input=a.input),h}function qE(a){return typeof a.constructor=="function"&&!Rf(a)?so(Zl(a)):{}}function LM(a,u,h){var S=a.constructor;switch(u){case Lt:return gS(a);case $r:case wr:return new S(+a);case gt:return RM(a,h);case qe:case Pn:case Ol:case zs:case ea:case Js:case Ti:case Gs:case Bc:return uE(a,h);case At:return new S;case Ai:case Ze:return new S(a);case ge:return xM(a);case we:return new S;case Ct:return CM(a)}}function UM(a,u){var h=u.length;if(!h)return a;var S=h-1;return u[S]=(h>1?"& ":"")+u[S],u=u.join(h>2?", ":" "),a.replace(dr,`{
|
|
2
2
|
/* [wrapped with `+u+`] */
|
|
3
|
-
`)}function HM(a){return $e(a)||qa(a)||!!(mh&&a&&a[mh])}function bs(a,u){var h=typeof a;return u=u??Be,!!u&&(h=="number"||h!="symbol"&&Ys.test(a))&&a>-1&&a%1==0&&a<u}function Ur(a,u,h){if(!Ht(h))return!1;var S=typeof u;return(S=="number"?Xr(h)&&bs(u,h.length):S=="string"&&u in h)?ai(h[u],a):!1}function xS(a,u){if($e(a))return!1;var h=typeof a;return h=="number"||h=="symbol"||h=="boolean"||a==null||bn(a)?!0:Ve.test(a)||!Yr.test(a)||u!=null&&a in Xe(u)}function BM(a){var u=typeof a;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?a!=="__proto__":a===null}function CS(a){var u=Uh(a),h=$[u];if(typeof h!="function"||!(u in We.prototype))return!1;if(a===h)return!0;var S=wS(h);return!!S&&a===S[0]}function VM(a){return!!dh&&dh in a}var WM=pa?Ss:BS;function Rf(a){var u=a&&a.constructor,h=typeof u=="function"&&u.prototype||ro;return a===h}function IE(a){return a===a&&!Ht(a)}function OE(a,u){return function(h){return h==null?!1:h[a]===u&&(u!==t||a in Xe(h))}}function zM(a){var u=Jh(a,function(S){return h.size===c&&h.clear(),S}),h=u.cache;return u}function JM(a,u){var h=a[1],S=u[1],O=h|S,N=O<(x|v|j),L=S==j&&h==E||S==j&&h==I&&a[7].length<=u[8]||S==(j|I)&&u[7].length<=u[8]&&h==E;if(!(N||L))return a;S&x&&(a[2]=u[2],O|=h&x?0:_);var B=u[3];if(B){var z=a[3];a[3]=z?fE(z,B,u[4]):B,a[4]=z?$n(a[3],d):u[4]}return B=u[5],B&&(z=a[5],a[5]=z?dE(z,B,u[6]):B,a[6]=z?$n(a[5],d):u[6]),B=u[7],B&&(a[7]=B),S&j&&(a[8]=a[8]==null?u[8]:ar(a[8],u[8])),a[9]==null&&(a[9]=u[9]),a[0]=u[0],a[1]=O,a}function GM(a){var u=[];if(a!=null)for(var h in Xe(a))u.push(h);return u}function YM(a){return Yl.call(a)}function PE(a,u,h){return u=Tt(u===t?a.length-1:u,0),function(){for(var S=arguments,O=-1,N=Tt(S.length-u,0),L=Y(N);++O<N;)L[O]=S[u+O];O=-1;for(var B=Y(u+1);++O<u;)B[O]=S[O];return B[u]=h(L),Nr(a,this,B)}}function kE(a,u){return u.length<2?a:gs(a,Dn(u,0,-1))}function KM(a,u){for(var h=a.length,S=ar(u.length,h),O=Zr(a);S--;){var N=u[S];a[S]=bs(N,h)?O[N]:t}return a}function ES(a,u){if(!(u==="constructor"&&typeof a[u]=="function")&&u!="__proto__")return a[u]}var AE=$E(tE),xf=Ob||function(a,u){return er.setTimeout(a,u)},qS=$E(bM);function TE(a,u,h){var S=u+"";return qS(a,UM(S,QM(DM(S),h)))}function $E(a){var u=0,h=0;return function(){var S=yh(),O=D-(S-h);if(h=S,O>0){if(++u>=U)return arguments[0]}else u=0;return a.apply(t,arguments)}}function Bh(a,u){var h=-1,S=a.length,O=S-1;for(u=u===t?S:u;++h<u;){var N=uS(h,O),L=a[N];a[N]=a[h],a[h]=L}return a.length=u,a}var NE=zM(function(a){var u=[];return a.charCodeAt(0)===46&&u.push(""),a.replace(Vc,function(h,S,O,N){u.push(O?N.replace(Zn,"$1"):S||h)}),u});function oi(a){if(typeof a=="string"||bn(a))return a;var u=a+"";return u=="0"&&1/a==-fe?"-0":u}function Ea(a){if(a!=null){try{return Gl.call(a)}catch{}try{return a+""}catch{}}return""}function QM(a,u){return Mr(he,function(h){var S="_."+h[0];u&h[1]&&!Ul(a,S)&&a.push(S)}),a.sort()}function ME(a){if(a instanceof We)return a.clone();var u=new _r(a.__wrapped__,a.__chain__);return u.__actions__=Zr(a.__actions__),u.__index__=a.__index__,u.__values__=a.__values__,u}function ZM(a,u,h){(h?Ur(a,u,h):u===t)?u=1:u=Tt(Me(u),0);var S=a==null?0:a.length;if(!S||u<1)return[];for(var O=0,N=0,L=Y(ga(S/u));O<S;)L[N++]=Dn(a,O,O+=u);return L}function XM(a){for(var u=-1,h=a==null?0:a.length,S=0,O=[];++u<h;){var N=a[u];N&&(O[S++]=N)}return O}function eF(){var a=arguments.length;if(!a)return[];for(var u=Y(a-1),h=arguments[0],S=a;S--;)u[S-1]=arguments[S];return Ni($e(h)?Zr(h):[h],lr(u,1))}var tF=Ue(function(a,u){return Qt(a)?_a(a,lr(u,1,Qt,!0)):[]}),rF=Ue(function(a,u){var h=jn(u);return Qt(h)&&(h=t),Qt(a)?_a(a,lr(u,1,Qt,!0),Ce(h,2)):[]}),nF=Ue(function(a,u){var h=jn(u);return Qt(h)&&(h=t),Qt(a)?_a(a,lr(u,1,Qt,!0),t,h):[]});function iF(a,u,h){var S=a==null?0:a.length;return S?(u=h||u===t?1:Me(u),Dn(a,u<0?0:u,S)):[]}function sF(a,u,h){var S=a==null?0:a.length;return S?(u=h||u===t?1:Me(u),u=S-u,Dn(a,0,u<0?0:u)):[]}function oF(a,u){return a&&a.length?Nh(a,Ce(u,3),!0,!0):[]}function aF(a,u){return a&&a.length?Nh(a,Ce(u,3),!0):[]}function lF(a,u,h,S){var O=a==null?0:a.length;return O?(h&&typeof h!="number"&&Ur(a,u,h)&&(h=0,S=O),rS(a,u,h,S)):[]}function FE(a,u,h){var S=a==null?0:a.length;if(!S)return-1;var O=h==null?0:Me(h);return O<0&&(O=Tt(S+O,0)),Bl(a,Ce(u,3),O)}function DE(a,u,h){var S=a==null?0:a.length;if(!S)return-1;var O=S-1;return h!==t&&(O=Me(h),O=h<0?Tt(S+O,0):ar(O,S-1)),Bl(a,Ce(u,3),O,!0)}function jE(a){var u=a==null?0:a.length;return u?lr(a,1):[]}function uF(a){var u=a==null?0:a.length;return u?lr(a,fe):[]}function cF(a,u){var h=a==null?0:a.length;return h?(u=u===t?1:Me(u),lr(a,u)):[]}function fF(a){for(var u=-1,h=a==null?0:a.length,S={};++u<h;){var O=a[u];gn(S,O[0],O[1])}return S}function LE(a){return a&&a.length?a[0]:t}function dF(a,u,h){var S=a==null?0:a.length;if(!S)return-1;var O=h==null?0:Me(h);return O<0&&(O=Tt(S+O,0)),fs(a,u,O)}function pF(a){var u=a==null?0:a.length;return u?Dn(a,0,-1):[]}var hF=Ue(function(a){var u=qt(a,hS);return u.length&&u[0]===a[0]?yn(u):[]}),mF=Ue(function(a){var u=jn(a),h=qt(a,hS);return u===jn(h)?u=t:h.pop(),h.length&&h[0]===a[0]?yn(h,Ce(u,2)):[]}),gF=Ue(function(a){var u=jn(a),h=qt(a,hS);return u=typeof u=="function"?u:t,u&&h.pop(),h.length&&h[0]===a[0]?yn(h,t,u):[]});function yF(a,u){return a==null?"":nu.call(a,u)}function jn(a){var u=a==null?0:a.length;return u?a[u-1]:t}function vF(a,u,h){var S=a==null?0:a.length;if(!S)return-1;var O=S;return h!==t&&(O=Me(h),O=O<0?Tt(S+O,0):ar(O,S-1)),u===u?cf(a,u,O):Bl(a,ds,O,!0)}function bF(a,u){return a&&a.length?si(a,Me(u)):t}var SF=Ue(UE);function UE(a,u){return a&&a.length&&u&&u.length?lS(a,u):a}function wF(a,u,h){return a&&a.length&&u&&u.length?lS(a,u,Ce(h,2)):a}function _F(a,u,h){return a&&a.length&&u&&u.length?lS(a,u,t,h):a}var RF=vs(function(a,u){var h=a==null?0:a.length,S=gf(a,u);return eE(a,qt(u,function(O){return bs(O,h)?+O:O}).sort(cE)),S});function xF(a,u){var h=[];if(!(a&&a.length))return h;var S=-1,O=[],N=a.length;for(u=Ce(u,3);++S<N;){var L=a[S];u(L,S,a)&&(h.push(L),O.push(S))}return eE(a,O),h}function IS(a){return a==null?a:kb.call(a)}function CF(a,u,h){var S=a==null?0:a.length;return S?(h&&typeof h!="number"&&Ur(a,u,h)?(u=0,h=S):(u=u==null?0:Me(u),h=h===t?S:Me(h)),Dn(a,u,h)):[]}function EF(a,u){return $h(a,u)}function qF(a,u,h){return fS(a,u,Ce(h,2))}function IF(a,u){var h=a==null?0:a.length;if(h){var S=$h(a,u);if(S<h&&ai(a[S],u))return S}return-1}function OF(a,u){return $h(a,u,!0)}function PF(a,u,h){return fS(a,u,Ce(h,2),!0)}function kF(a,u){var h=a==null?0:a.length;if(h){var S=$h(a,u,!0)-1;if(ai(a[S],u))return S}return-1}function AF(a){return a&&a.length?rE(a):[]}function TF(a,u){return a&&a.length?rE(a,Ce(u,2)):[]}function $F(a){var u=a==null?0:a.length;return u?Dn(a,1,u):[]}function NF(a,u,h){return a&&a.length?(u=h||u===t?1:Me(u),Dn(a,0,u<0?0:u)):[]}function MF(a,u,h){var S=a==null?0:a.length;return S?(u=h||u===t?1:Me(u),u=S-u,Dn(a,u<0?0:u,S)):[]}function FF(a,u){return a&&a.length?Nh(a,Ce(u,3),!1,!0):[]}function DF(a,u){return a&&a.length?Nh(a,Ce(u,3)):[]}var jF=Ue(function(a){return uo(lr(a,1,Qt,!0))}),LF=Ue(function(a){var u=jn(a);return Qt(u)&&(u=t),uo(lr(a,1,Qt,!0),Ce(u,2))}),UF=Ue(function(a){var u=jn(a);return u=typeof u=="function"?u:t,uo(lr(a,1,Qt,!0),t,u)});function HF(a){return a&&a.length?uo(a):[]}function BF(a,u){return a&&a.length?uo(a,Ce(u,2)):[]}function VF(a,u){return u=typeof u=="function"?u:t,a&&a.length?uo(a,t,u):[]}function OS(a){if(!(a&&a.length))return[];var u=0;return a=$i(a,function(h){if(Qt(h))return u=Tt(h.length,u),!0}),lf(u,function(h){return qt(a,ua(h))})}function HE(a,u){if(!(a&&a.length))return[];var h=OS(a);return u==null?h:qt(h,function(S){return Nr(u,t,S)})}var WF=Ue(function(a,u){return Qt(a)?_a(a,u):[]}),zF=Ue(function(a){return pS($i(a,Qt))}),JF=Ue(function(a){var u=jn(a);return Qt(u)&&(u=t),pS($i(a,Qt),Ce(u,2))}),GF=Ue(function(a){var u=jn(a);return u=typeof u=="function"?u:t,pS($i(a,Qt),t,u)}),YF=Ue(OS);function KF(a,u){return oE(a||[],u||[],Lr)}function QF(a,u){return oE(a||[],u||[],wf)}var ZF=Ue(function(a){var u=a.length,h=u>1?a[u-1]:t;return h=typeof h=="function"?(a.pop(),h):t,HE(a,h)});function BE(a){var u=$(a);return u.__chain__=!0,u}function XF(a,u){return u(a),a}function Vh(a,u){return u(a)}var eD=vs(function(a){var u=a.length,h=u?a[0]:0,S=this.__wrapped__,O=function(N){return gf(N,a)};return u>1||this.__actions__.length||!(S instanceof We)||!bs(h)?this.thru(O):(S=S.slice(h,+h+(u?1:0)),S.__actions__.push({func:Vh,args:[O],thisArg:t}),new _r(S,this.__chain__).thru(function(N){return u&&!N.length&&N.push(t),N}))});function tD(){return BE(this)}function rD(){return new _r(this.value(),this.__chain__)}function nD(){this.__values__===t&&(this.__values__=nq(this.value()));var a=this.__index__>=this.__values__.length,u=a?t:this.__values__[this.__index__++];return{done:a,value:u}}function iD(){return this}function sD(a){for(var u,h=this;h instanceof ou;){var S=ME(h);S.__index__=0,S.__values__=t,u?O.__wrapped__=S:u=S;var O=S;h=h.__wrapped__}return O.__wrapped__=a,u}function oD(){var a=this.__wrapped__;if(a instanceof We){var u=a;return this.__actions__.length&&(u=new We(this)),u=u.reverse(),u.__actions__.push({func:Vh,args:[IS],thisArg:t}),new _r(u,this.__chain__)}return this.thru(IS)}function aD(){return sE(this.__wrapped__,this.__actions__)}var lD=Mh(function(a,u,h){pt.call(a,h)?++a[h]:gn(a,h,1)});function uD(a,u,h){var S=$e(a)?ih:tS;return h&&Ur(a,u,h)&&(u=t),S(a,Ce(u,3))}function cD(a,u){var h=$e(a)?$i:Ph;return h(a,Ce(u,3))}var fD=gE(FE),dD=gE(DE);function pD(a,u){return lr(Wh(a,u),1)}function hD(a,u){return lr(Wh(a,u),fe)}function mD(a,u,h){return h=h===t?1:Me(h),lr(Wh(a,u),h)}function VE(a,u){var h=$e(a)?Mr:Ui;return h(a,Ce(u,3))}function WE(a,u){var h=$e(a)?nf:Oh;return h(a,Ce(u,3))}var gD=Mh(function(a,u,h){pt.call(a,h)?a[h].push(u):gn(a,h,[u])});function yD(a,u,h,S){a=Xr(a)?a:mu(a),h=h&&!S?Me(h):0;var O=a.length;return h<0&&(h=Tt(O+h,0)),Kh(a)?h<=O&&a.indexOf(u,h)>-1:!!O&&fs(a,u,h)>-1}var vD=Ue(function(a,u,h){var S=-1,O=typeof u=="function",N=Xr(a)?Y(a.length):[];return Ui(a,function(L){N[++S]=O?Nr(u,L,h):Ra(L,u,h)}),N}),bD=Mh(function(a,u,h){gn(a,h,u)});function Wh(a,u){var h=$e(a)?qt:de;return h(a,Ce(u,3))}function SD(a,u,h,S){return a==null?[]:($e(u)||(u=u==null?[]:[u]),h=S?t:h,$e(h)||(h=h==null?[]:[h]),ZC(a,u,h))}var wD=Mh(function(a,u,h){a[h?0:1].push(u)},function(){return[[],[]]});function _D(a,u,h){var S=$e(a)?sf:Vl,O=arguments.length<3;return S(a,Ce(u,4),h,O,Ui)}function RD(a,u,h){var S=$e(a)?nb:Vl,O=arguments.length<3;return S(a,Ce(u,4),h,O,Oh)}function xD(a,u){var h=$e(a)?$i:Ph;return h(a,Gh(Ce(u,3)))}function CD(a){var u=$e(a)?Eh:yM;return u(a)}function ED(a,u,h){(h?Ur(a,u,h):u===t)?u=1:u=Me(u);var S=$e(a)?Qb:vM;return S(a,u)}function qD(a){var u=$e(a)?Zb:SM;return u(a)}function ID(a){if(a==null)return 0;if(Xr(a))return Kh(a)?Mi(a):a.length;var u=xr(a);return u==At||u==we?a.size:T(a).length}function OD(a,u,h){var S=$e(a)?Hl:wM;return h&&Ur(a,u,h)&&(u=t),S(a,Ce(u,3))}var PD=Ue(function(a,u){if(a==null)return[];var h=u.length;return h>1&&Ur(a,u[0],u[1])?u=[]:h>2&&Ur(u[0],u[1],u[2])&&(u=[u[0]]),ZC(a,lr(u,1),[])}),zh=Ib||function(){return er.Date.now()};function kD(a,u){if(typeof u!="function")throw new jr(i);return a=Me(a),function(){if(--a<1)return u.apply(this,arguments)}}function zE(a,u,h){return u=h?t:u,u=a&&u==null?a.length:u,ys(a,j,t,t,t,t,u)}function JE(a,u){var h;if(typeof u!="function")throw new jr(i);return a=Me(a),function(){return--a>0&&(h=u.apply(this,arguments)),a<=1&&(u=t),h}}var PS=Ue(function(a,u,h){var S=x;if(h.length){var O=$n(h,pu(PS));S|=P}return ys(a,S,u,h,O)}),GE=Ue(function(a,u,h){var S=x|v;if(h.length){var O=$n(h,pu(GE));S|=P}return ys(u,S,a,h,O)});function YE(a,u,h){u=h?t:u;var S=ys(a,E,t,t,t,t,t,u);return S.placeholder=YE.placeholder,S}function KE(a,u,h){u=h?t:u;var S=ys(a,k,t,t,t,t,t,u);return S.placeholder=KE.placeholder,S}function QE(a,u,h){var S,O,N,L,B,z,X=0,ee=!1,ne=!1,ce=!0;if(typeof a!="function")throw new jr(i);u=Ln(u)||0,Ht(h)&&(ee=!!h.leading,ne="maxWait"in h,N=ne?Tt(Ln(h.maxWait)||0,u):N,ce="trailing"in h?!!h.trailing:ce);function be(Zt){var li=S,_s=O;return S=O=t,X=Zt,L=a.apply(_s,li),L}function Ee(Zt){return X=Zt,B=xf(Ke,u),ee?be(Zt):L}function De(Zt){var li=Zt-z,_s=Zt-X,yq=u-li;return ne?ar(yq,N-_s):yq}function xe(Zt){var li=Zt-z,_s=Zt-X;return z===t||li>=u||li<0||ne&&_s>=N}function Ke(){var Zt=zh();if(xe(Zt))return et(Zt);B=xf(Ke,De(Zt))}function et(Zt){return B=t,ce&&S?be(Zt):(S=O=t,L)}function Sn(){B!==t&&aE(B),X=0,S=z=O=B=t}function Hr(){return B===t?L:et(zh())}function wn(){var Zt=zh(),li=xe(Zt);if(S=arguments,O=this,z=Zt,li){if(B===t)return Ee(z);if(ne)return aE(B),B=xf(Ke,u),be(z)}return B===t&&(B=xf(Ke,u)),L}return wn.cancel=Sn,wn.flush=Hr,wn}var AD=Ue(function(a,u){return yf(a,1,u)}),TD=Ue(function(a,u,h){return yf(a,Ln(u)||0,h)});function $D(a){return ys(a,R)}function Jh(a,u){if(typeof a!="function"||u!=null&&typeof u!="function")throw new jr(i);var h=function(){var S=arguments,O=u?u.apply(this,S):S[0],N=h.cache;if(N.has(O))return N.get(O);var L=a.apply(this,S);return h.cache=N.set(O,L)||N,L};return h.cache=new(Jh.Cache||ri),h}Jh.Cache=ri;function Gh(a){if(typeof a!="function")throw new jr(i);return function(){var u=arguments;switch(u.length){case 0:return!a.call(this);case 1:return!a.call(this,u[0]);case 2:return!a.call(this,u[0],u[1]);case 3:return!a.call(this,u[0],u[1],u[2])}return!a.apply(this,u)}}function ND(a){return JE(2,a)}var MD=_M(function(a,u){u=u.length==1&&$e(u[0])?qt(u[0],Fr(Ce())):qt(lr(u,1),Fr(Ce()));var h=u.length;return Ue(function(S){for(var O=-1,N=ar(S.length,h);++O<N;)S[O]=u[O].call(this,S[O]);return Nr(a,this,S)})}),kS=Ue(function(a,u){var h=$n(u,pu(kS));return ys(a,P,t,u,h)}),ZE=Ue(function(a,u){var h=$n(u,pu(ZE));return ys(a,M,t,u,h)}),FD=vs(function(a,u){return ys(a,I,t,t,t,u)});function DD(a,u){if(typeof a!="function")throw new jr(i);return u=u===t?u:Me(u),Ue(a,u)}function jD(a,u){if(typeof a!="function")throw new jr(i);return u=u==null?0:Tt(Me(u),0),Ue(function(h){var S=h[u],O=fo(h,0,u);return S&&Ni(O,S),Nr(a,this,O)})}function LD(a,u,h){var S=!0,O=!0;if(typeof a!="function")throw new jr(i);return Ht(h)&&(S="leading"in h?!!h.leading:S,O="trailing"in h?!!h.trailing:O),QE(a,u,{leading:S,maxWait:u,trailing:O})}function UD(a){return zE(a,1)}function HD(a,u){return kS(mS(u),a)}function BD(){if(!arguments.length)return[];var a=arguments[0];return $e(a)?a:[a]}function VD(a){return Rr(a,y)}function WD(a,u){return u=typeof u=="function"?u:t,Rr(a,y,u)}function zD(a){return Rr(a,p|y)}function JD(a,u){return u=typeof u=="function"?u:t,Rr(a,p|y,u)}function GD(a,u){return u==null||Mn(a,u,pr(u))}function ai(a,u){return a===u||a!==a&&u!==u}var YD=Lh(bf),KD=Lh(function(a,u){return a>=u}),qa=Th((function(){return arguments})())?Th:function(a){return Wt(a)&&pt.call(a,"callee")&&!ha.call(a,"callee")},$e=Y.isArray,QD=rf?Fr(rf):oS;function Xr(a){return a!=null&&Yh(a.length)&&!Ss(a)}function Qt(a){return Wt(a)&&Xr(a)}function ZD(a){return a===!0||a===!1||Wt(a)&&mr(a)==$r}var po=ru||BS,XD=rh?Fr(rh):aS;function ej(a){return Wt(a)&&a.nodeType===1&&!Cf(a)}function tj(a){if(a==null)return!0;if(Xr(a)&&($e(a)||typeof a=="string"||typeof a.splice=="function"||po(a)||hu(a)||qa(a)))return!a.length;var u=xr(a);if(u==At||u==we)return!a.size;if(Rf(a))return!T(a).length;for(var h in a)if(pt.call(a,h))return!1;return!0}function rj(a,u){return xa(a,u)}function nj(a,u,h){h=typeof h=="function"?h:t;var S=h?h(a,u):t;return S===t?xa(a,u,t,h):!!S}function AS(a){if(!Wt(a))return!1;var u=mr(a);return u==St||u==xt||typeof a.message=="string"&&typeof a.name=="string"&&!Cf(a)}function ij(a){return typeof a=="number"&&hs(a)}function Ss(a){if(!Ht(a))return!1;var u=mr(a);return u==Gr||u==Ws||u==lt||u==Te}function XE(a){return typeof a=="number"&&a==Me(a)}function Yh(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=Be}function Ht(a){var u=typeof a;return a!=null&&(u=="object"||u=="function")}function Wt(a){return a!=null&&typeof a=="object"}var eq=nh?Fr(nh):ao;function sj(a,u){return a===u||lo(a,u,_S(u))}function oj(a,u,h){return h=typeof h=="function"?h:t,lo(a,u,_S(u),h)}function aj(a){return tq(a)&&a!=+a}function lj(a){if(WM(a))throw new Oe(n);return Ye(a)}function uj(a){return a===null}function cj(a){return a==null}function tq(a){return typeof a=="number"||Wt(a)&&mr(a)==Ai}function Cf(a){if(!Wt(a)||mr(a)!=te)return!1;var u=Zl(a);if(u===null)return!0;var h=pt.call(u,"constructor")&&u.constructor;return typeof h=="function"&&h instanceof h&&Gl.call(h)==xb}var TS=la?Fr(la):f;function fj(a){return XE(a)&&a>=-Be&&a<=Be}var rq=Xn?Fr(Xn):g;function Kh(a){return typeof a=="string"||!$e(a)&&Wt(a)&&mr(a)==Ze}function bn(a){return typeof a=="symbol"||Wt(a)&&mr(a)==Ct}var hu=Ll?Fr(Ll):w;function dj(a){return a===t}function pj(a){return Wt(a)&&xr(a)==oe}function hj(a){return Wt(a)&&mr(a)==fr}var mj=Lh(K),gj=Lh(function(a,u){return a<=u});function nq(a){if(!a)return[];if(Xr(a))return Kh(a)?Dr(a):Zr(a);if(ma&&a[ma])return hb(a[ma]());var u=xr(a),h=u==At?to:u==we?zl:mu;return h(a)}function ws(a){if(!a)return a===0?a:0;if(a=Ln(a),a===fe||a===-fe){var u=a<0?-1:1;return u*Re}return a===a?a:0}function Me(a){var u=ws(a),h=u%1;return u===u?h?u-h:u:0}function iq(a){return a?Li(Me(a),0,ke):0}function Ln(a){if(typeof a=="number")return a;if(bn(a))return ye;if(Ht(a)){var u=typeof a.valueOf=="function"?a.valueOf():a;a=Ht(u)?u+"":u}if(typeof a!="string")return a===0?a:+a;a=uf(a);var h=na.test(a);return h||Tv.test(a)?tb(a.slice(2),h?2:8):Av.test(a)?ye:+a}function sq(a){return Hi(a,en(a))}function yj(a){return a?Li(Me(a),-Be,Be):a===0?a:0}function wt(a){return a==null?"":vn(a)}var vj=fu(function(a,u){if(Rf(u)||Xr(u)){Hi(u,pr(u),a);return}for(var h in u)pt.call(u,h)&&Lr(a,h,u[h])}),oq=fu(function(a,u){Hi(u,en(u),a)}),aq=fu(function(a,u,h,S){Hi(u,en(u),a,S)}),$S=fu(function(a,u,h,S){Hi(u,pr(u),a,S)}),bj=vs(gf);function Sj(a,u){var h=so(a);return u==null?h:Ih(h,u)}var wj=Ue(function(a,u){a=Xe(a);var h=-1,S=u.length,O=S>2?u[2]:t;for(O&&Ur(u[0],u[1],O)&&(S=1);++h<S;)for(var N=u[h],L=en(N),B=-1,z=L.length;++B<z;){var X=L[B],ee=a[X];(ee===t||ai(ee,ro[X])&&!pt.call(a,X))&&(a[X]=N[X])}return a}),_j=Ue(function(a){return a.push(t,RE),Nr(lq,t,a)});function Rj(a,u){return sh(a,Ce(u,3),Fn)}function xj(a,u){return sh(a,Ce(u,3),ni)}function Cj(a,u){return a==null?a:vf(a,Ce(u,3),en)}function Ej(a,u){return a==null?a:kh(a,Ce(u,3),en)}function qj(a,u){return a&&Fn(a,Ce(u,3))}function Ij(a,u){return a&&ni(a,Ce(u,3))}function Oj(a){return a==null?[]:cu(a,pr(a))}function Pj(a){return a==null?[]:cu(a,en(a))}function NS(a,u,h){var S=a==null?t:gs(a,u);return S===t?h:S}function kj(a,u){return a!=null&&EE(a,u,nS)}function MS(a,u){return a!=null&&EE(a,u,iS)}var Aj=vE(function(a,u,h){u!=null&&typeof u.toString!="function"&&(u=Yl.call(u)),a[u]=h},DS(tn)),Tj=vE(function(a,u,h){u!=null&&typeof u.toString!="function"&&(u=Yl.call(u)),pt.call(a,u)?a[u].push(h):a[u]=[h]},Ce),$j=Ue(Ra);function pr(a){return Xr(a)?Ch(a):T(a)}function en(a){return Xr(a)?Ch(a,!0):H(a)}function Nj(a,u){var h={};return u=Ce(u,3),Fn(a,function(S,O,N){gn(h,u(S,O,N),S)}),h}function Mj(a,u){var h={};return u=Ce(u,3),Fn(a,function(S,O,N){gn(h,O,u(S,O,N))}),h}var Fj=fu(function(a,u,h){tr(a,u,h)}),lq=fu(function(a,u,h,S){tr(a,u,h,S)}),Dj=vs(function(a,u){var h={};if(a==null)return h;var S=!1;u=qt(u,function(N){return N=co(N,a),S||(S=N.length>1),N}),Hi(a,SS(a),h),S&&(h=Rr(h,p|m|y,TM));for(var O=u.length;O--;)dS(h,u[O]);return h});function jj(a,u){return uq(a,Gh(Ce(u)))}var Lj=vs(function(a,u){return a==null?{}:hM(a,u)});function uq(a,u){if(a==null)return{};var h=qt(SS(a),function(S){return[S]});return u=Ce(u),XC(a,h,function(S,O){return u(S,O[0])})}function Uj(a,u,h){u=co(u,a);var S=-1,O=u.length;for(O||(O=1,a=t);++S<O;){var N=a==null?t:a[oi(u[S])];N===t&&(S=O,N=h),a=Ss(N)?N.call(a):N}return a}function Hj(a,u,h){return a==null?a:wf(a,u,h)}function Bj(a,u,h,S){return S=typeof S=="function"?S:t,a==null?a:wf(a,u,h,S)}var cq=wE(pr),fq=wE(en);function Vj(a,u,h){var S=$e(a),O=S||po(a)||hu(a);if(u=Ce(u,4),h==null){var N=a&&a.constructor;O?h=S?new N:[]:Ht(a)?h=Ss(N)?so(Zl(a)):{}:h={}}return(O?Mr:Fn)(a,function(L,B,z){return u(h,L,B,z)}),h}function Wj(a,u){return a==null?!0:dS(a,u)}function zj(a,u,h){return a==null?a:iE(a,u,mS(h))}function Jj(a,u,h,S){return S=typeof S=="function"?S:t,a==null?a:iE(a,u,mS(h),S)}function mu(a){return a==null?[]:Wl(a,pr(a))}function Gj(a){return a==null?[]:Wl(a,en(a))}function Yj(a,u,h){return h===t&&(h=u,u=t),h!==t&&(h=Ln(h),h=h===h?h:0),u!==t&&(u=Ln(u),u=u===u?u:0),Li(Ln(a),u,h)}function Kj(a,u,h){return u=ws(u),h===t?(h=u,u=0):h=ws(h),a=Ln(a),sS(a,u,h)}function Qj(a,u,h){if(h&&typeof h!="boolean"&&Ur(a,u,h)&&(u=h=t),h===t&&(typeof u=="boolean"?(h=u,u=t):typeof a=="boolean"&&(h=a,a=t)),a===t&&u===t?(a=0,u=1):(a=ws(a),u===t?(u=a,a=0):u=ws(u)),a>u){var S=a;a=u,u=S}if(h||a%1||u%1){var O=vh();return ar(a+O*(u-a+eh("1e-"+((O+"").length-1))),u)}return uS(a,u)}var Zj=du(function(a,u,h){return u=u.toLowerCase(),a+(h?dq(u):u)});function dq(a){return FS(wt(a).toLowerCase())}function pq(a){return a=wt(a),a&&a.replace(ia,cb).replace(Gv,"")}function Xj(a,u,h){a=wt(a),u=vn(u);var S=a.length;h=h===t?S:Li(Me(h),0,S);var O=h;return h-=u.length,h>=0&&a.slice(h,O)==u}function eL(a){return a=wt(a),a&&me.test(a)?a.replace(kl,fb):a}function tL(a){return a=wt(a),a&&ra.test(a)?a.replace(ft,"\\$&"):a}var rL=du(function(a,u,h){return a+(h?"-":"")+u.toLowerCase()}),nL=du(function(a,u,h){return a+(h?" ":"")+u.toLowerCase()}),iL=mE("toLowerCase");function sL(a,u,h){a=wt(a),u=Me(u);var S=u?Mi(a):0;if(!u||S>=u)return a;var O=(u-S)/2;return jh(ya(O),h)+a+jh(ga(O),h)}function oL(a,u,h){a=wt(a),u=Me(u);var S=u?Mi(a):0;return u&&S<u?a+jh(u-S,h):a}function aL(a,u,h){a=wt(a),u=Me(u);var S=u?Mi(a):0;return u&&S<u?jh(u-S,h)+a:a}function lL(a,u,h){return h||u==null?u=0:u&&(u=+u),Pb(wt(a).replace(Wc,""),u||0)}function uL(a,u,h){return(h?Ur(a,u,h):u===t)?u=1:u=Me(u),cS(wt(a),u)}function cL(){var a=arguments,u=wt(a[0]);return a.length<3?u:u.replace(a[1],a[2])}var fL=du(function(a,u,h){return a+(h?"_":"")+u.toLowerCase()});function dL(a,u,h){return h&&typeof h!="number"&&Ur(a,u,h)&&(u=h=t),h=h===t?ke:h>>>0,h?(a=wt(a),a&&(typeof u=="string"||u!=null&&!TS(u))&&(u=vn(u),!u&&eo(a))?fo(Dr(a),0,h):a.split(u,h)):[]}var pL=du(function(a,u,h){return a+(h?" ":"")+FS(u)});function hL(a,u,h){return a=wt(a),h=h==null?0:Li(Me(h),0,a.length),u=vn(u),a.slice(h,h+u.length)==u}function mL(a,u,h){var S=$.templateSettings;h&&Ur(a,u,h)&&(u=t),a=wt(a),u=$S({},u,S,_E);var O=$S({},u.imports,S.imports,_E),N=pr(O),L=Wl(O,N);Mr(N,function(xe){if(Kr.test(xe))throw new Oe(o)});var B,z,X=0,ee=u.interpolate||sa,ne="__p += '",ce=Jl((u.escape||sa).source+"|"+ee.source+"|"+(ee===kn?us:sa).source+"|"+(u.evaluate||sa).source+"|$","g"),be="//# sourceURL="+(pt.call(u,"sourceURL")?(u.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Xv+"]")+`
|
|
3
|
+
`)}function HM(a){return $e(a)||qa(a)||!!(mh&&a&&a[mh])}function bs(a,u){var h=typeof a;return u=u??Be,!!u&&(h=="number"||h!="symbol"&&Ys.test(a))&&a>-1&&a%1==0&&a<u}function Ur(a,u,h){if(!Ht(h))return!1;var S=typeof u;return(S=="number"?Xr(h)&&bs(u,h.length):S=="string"&&u in h)?ai(h[u],a):!1}function xS(a,u){if($e(a))return!1;var h=typeof a;return h=="number"||h=="symbol"||h=="boolean"||a==null||bn(a)?!0:Ve.test(a)||!Yr.test(a)||u!=null&&a in Xe(u)}function BM(a){var u=typeof a;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?a!=="__proto__":a===null}function CS(a){var u=Uh(a),h=$[u];if(typeof h!="function"||!(u in We.prototype))return!1;if(a===h)return!0;var S=wS(h);return!!S&&a===S[0]}function VM(a){return!!dh&&dh in a}var WM=pa?Ss:BS;function Rf(a){var u=a&&a.constructor,h=typeof u=="function"&&u.prototype||ro;return a===h}function IE(a){return a===a&&!Ht(a)}function OE(a,u){return function(h){return h==null?!1:h[a]===u&&(u!==t||a in Xe(h))}}function zM(a){var u=Jh(a,function(S){return h.size===c&&h.clear(),S}),h=u.cache;return u}function JM(a,u){var h=a[1],S=u[1],O=h|S,N=O<(x|v|j),L=S==j&&h==E||S==j&&h==I&&a[7].length<=u[8]||S==(j|I)&&u[7].length<=u[8]&&h==E;if(!(N||L))return a;S&x&&(a[2]=u[2],O|=h&x?0:R);var B=u[3];if(B){var z=a[3];a[3]=z?fE(z,B,u[4]):B,a[4]=z?$n(a[3],d):u[4]}return B=u[5],B&&(z=a[5],a[5]=z?dE(z,B,u[6]):B,a[6]=z?$n(a[5],d):u[6]),B=u[7],B&&(a[7]=B),S&j&&(a[8]=a[8]==null?u[8]:ar(a[8],u[8])),a[9]==null&&(a[9]=u[9]),a[0]=u[0],a[1]=O,a}function GM(a){var u=[];if(a!=null)for(var h in Xe(a))u.push(h);return u}function YM(a){return Yl.call(a)}function PE(a,u,h){return u=Tt(u===t?a.length-1:u,0),function(){for(var S=arguments,O=-1,N=Tt(S.length-u,0),L=Y(N);++O<N;)L[O]=S[u+O];O=-1;for(var B=Y(u+1);++O<u;)B[O]=S[O];return B[u]=h(L),Nr(a,this,B)}}function kE(a,u){return u.length<2?a:gs(a,Dn(u,0,-1))}function KM(a,u){for(var h=a.length,S=ar(u.length,h),O=Zr(a);S--;){var N=u[S];a[S]=bs(N,h)?O[N]:t}return a}function ES(a,u){if(!(u==="constructor"&&typeof a[u]=="function")&&u!="__proto__")return a[u]}var AE=$E(tE),xf=Ob||function(a,u){return er.setTimeout(a,u)},qS=$E(bM);function TE(a,u,h){var S=u+"";return qS(a,UM(S,QM(DM(S),h)))}function $E(a){var u=0,h=0;return function(){var S=yh(),O=D-(S-h);if(h=S,O>0){if(++u>=U)return arguments[0]}else u=0;return a.apply(t,arguments)}}function Bh(a,u){var h=-1,S=a.length,O=S-1;for(u=u===t?S:u;++h<u;){var N=uS(h,O),L=a[N];a[N]=a[h],a[h]=L}return a.length=u,a}var NE=zM(function(a){var u=[];return a.charCodeAt(0)===46&&u.push(""),a.replace(Vc,function(h,S,O,N){u.push(O?N.replace(Zn,"$1"):S||h)}),u});function oi(a){if(typeof a=="string"||bn(a))return a;var u=a+"";return u=="0"&&1/a==-fe?"-0":u}function Ea(a){if(a!=null){try{return Gl.call(a)}catch{}try{return a+""}catch{}}return""}function QM(a,u){return Mr(he,function(h){var S="_."+h[0];u&h[1]&&!Ul(a,S)&&a.push(S)}),a.sort()}function ME(a){if(a instanceof We)return a.clone();var u=new _r(a.__wrapped__,a.__chain__);return u.__actions__=Zr(a.__actions__),u.__index__=a.__index__,u.__values__=a.__values__,u}function ZM(a,u,h){(h?Ur(a,u,h):u===t)?u=1:u=Tt(Me(u),0);var S=a==null?0:a.length;if(!S||u<1)return[];for(var O=0,N=0,L=Y(ga(S/u));O<S;)L[N++]=Dn(a,O,O+=u);return L}function XM(a){for(var u=-1,h=a==null?0:a.length,S=0,O=[];++u<h;){var N=a[u];N&&(O[S++]=N)}return O}function eF(){var a=arguments.length;if(!a)return[];for(var u=Y(a-1),h=arguments[0],S=a;S--;)u[S-1]=arguments[S];return Ni($e(h)?Zr(h):[h],lr(u,1))}var tF=Ue(function(a,u){return Qt(a)?_a(a,lr(u,1,Qt,!0)):[]}),rF=Ue(function(a,u){var h=jn(u);return Qt(h)&&(h=t),Qt(a)?_a(a,lr(u,1,Qt,!0),Ce(h,2)):[]}),nF=Ue(function(a,u){var h=jn(u);return Qt(h)&&(h=t),Qt(a)?_a(a,lr(u,1,Qt,!0),t,h):[]});function iF(a,u,h){var S=a==null?0:a.length;return S?(u=h||u===t?1:Me(u),Dn(a,u<0?0:u,S)):[]}function sF(a,u,h){var S=a==null?0:a.length;return S?(u=h||u===t?1:Me(u),u=S-u,Dn(a,0,u<0?0:u)):[]}function oF(a,u){return a&&a.length?Nh(a,Ce(u,3),!0,!0):[]}function aF(a,u){return a&&a.length?Nh(a,Ce(u,3),!0):[]}function lF(a,u,h,S){var O=a==null?0:a.length;return O?(h&&typeof h!="number"&&Ur(a,u,h)&&(h=0,S=O),rS(a,u,h,S)):[]}function FE(a,u,h){var S=a==null?0:a.length;if(!S)return-1;var O=h==null?0:Me(h);return O<0&&(O=Tt(S+O,0)),Bl(a,Ce(u,3),O)}function DE(a,u,h){var S=a==null?0:a.length;if(!S)return-1;var O=S-1;return h!==t&&(O=Me(h),O=h<0?Tt(S+O,0):ar(O,S-1)),Bl(a,Ce(u,3),O,!0)}function jE(a){var u=a==null?0:a.length;return u?lr(a,1):[]}function uF(a){var u=a==null?0:a.length;return u?lr(a,fe):[]}function cF(a,u){var h=a==null?0:a.length;return h?(u=u===t?1:Me(u),lr(a,u)):[]}function fF(a){for(var u=-1,h=a==null?0:a.length,S={};++u<h;){var O=a[u];gn(S,O[0],O[1])}return S}function LE(a){return a&&a.length?a[0]:t}function dF(a,u,h){var S=a==null?0:a.length;if(!S)return-1;var O=h==null?0:Me(h);return O<0&&(O=Tt(S+O,0)),fs(a,u,O)}function pF(a){var u=a==null?0:a.length;return u?Dn(a,0,-1):[]}var hF=Ue(function(a){var u=qt(a,hS);return u.length&&u[0]===a[0]?yn(u):[]}),mF=Ue(function(a){var u=jn(a),h=qt(a,hS);return u===jn(h)?u=t:h.pop(),h.length&&h[0]===a[0]?yn(h,Ce(u,2)):[]}),gF=Ue(function(a){var u=jn(a),h=qt(a,hS);return u=typeof u=="function"?u:t,u&&h.pop(),h.length&&h[0]===a[0]?yn(h,t,u):[]});function yF(a,u){return a==null?"":nu.call(a,u)}function jn(a){var u=a==null?0:a.length;return u?a[u-1]:t}function vF(a,u,h){var S=a==null?0:a.length;if(!S)return-1;var O=S;return h!==t&&(O=Me(h),O=O<0?Tt(S+O,0):ar(O,S-1)),u===u?cf(a,u,O):Bl(a,ds,O,!0)}function bF(a,u){return a&&a.length?si(a,Me(u)):t}var SF=Ue(UE);function UE(a,u){return a&&a.length&&u&&u.length?lS(a,u):a}function wF(a,u,h){return a&&a.length&&u&&u.length?lS(a,u,Ce(h,2)):a}function _F(a,u,h){return a&&a.length&&u&&u.length?lS(a,u,t,h):a}var RF=vs(function(a,u){var h=a==null?0:a.length,S=gf(a,u);return eE(a,qt(u,function(O){return bs(O,h)?+O:O}).sort(cE)),S});function xF(a,u){var h=[];if(!(a&&a.length))return h;var S=-1,O=[],N=a.length;for(u=Ce(u,3);++S<N;){var L=a[S];u(L,S,a)&&(h.push(L),O.push(S))}return eE(a,O),h}function IS(a){return a==null?a:kb.call(a)}function CF(a,u,h){var S=a==null?0:a.length;return S?(h&&typeof h!="number"&&Ur(a,u,h)?(u=0,h=S):(u=u==null?0:Me(u),h=h===t?S:Me(h)),Dn(a,u,h)):[]}function EF(a,u){return $h(a,u)}function qF(a,u,h){return fS(a,u,Ce(h,2))}function IF(a,u){var h=a==null?0:a.length;if(h){var S=$h(a,u);if(S<h&&ai(a[S],u))return S}return-1}function OF(a,u){return $h(a,u,!0)}function PF(a,u,h){return fS(a,u,Ce(h,2),!0)}function kF(a,u){var h=a==null?0:a.length;if(h){var S=$h(a,u,!0)-1;if(ai(a[S],u))return S}return-1}function AF(a){return a&&a.length?rE(a):[]}function TF(a,u){return a&&a.length?rE(a,Ce(u,2)):[]}function $F(a){var u=a==null?0:a.length;return u?Dn(a,1,u):[]}function NF(a,u,h){return a&&a.length?(u=h||u===t?1:Me(u),Dn(a,0,u<0?0:u)):[]}function MF(a,u,h){var S=a==null?0:a.length;return S?(u=h||u===t?1:Me(u),u=S-u,Dn(a,u<0?0:u,S)):[]}function FF(a,u){return a&&a.length?Nh(a,Ce(u,3),!1,!0):[]}function DF(a,u){return a&&a.length?Nh(a,Ce(u,3)):[]}var jF=Ue(function(a){return uo(lr(a,1,Qt,!0))}),LF=Ue(function(a){var u=jn(a);return Qt(u)&&(u=t),uo(lr(a,1,Qt,!0),Ce(u,2))}),UF=Ue(function(a){var u=jn(a);return u=typeof u=="function"?u:t,uo(lr(a,1,Qt,!0),t,u)});function HF(a){return a&&a.length?uo(a):[]}function BF(a,u){return a&&a.length?uo(a,Ce(u,2)):[]}function VF(a,u){return u=typeof u=="function"?u:t,a&&a.length?uo(a,t,u):[]}function OS(a){if(!(a&&a.length))return[];var u=0;return a=$i(a,function(h){if(Qt(h))return u=Tt(h.length,u),!0}),lf(u,function(h){return qt(a,ua(h))})}function HE(a,u){if(!(a&&a.length))return[];var h=OS(a);return u==null?h:qt(h,function(S){return Nr(u,t,S)})}var WF=Ue(function(a,u){return Qt(a)?_a(a,u):[]}),zF=Ue(function(a){return pS($i(a,Qt))}),JF=Ue(function(a){var u=jn(a);return Qt(u)&&(u=t),pS($i(a,Qt),Ce(u,2))}),GF=Ue(function(a){var u=jn(a);return u=typeof u=="function"?u:t,pS($i(a,Qt),t,u)}),YF=Ue(OS);function KF(a,u){return oE(a||[],u||[],Lr)}function QF(a,u){return oE(a||[],u||[],wf)}var ZF=Ue(function(a){var u=a.length,h=u>1?a[u-1]:t;return h=typeof h=="function"?(a.pop(),h):t,HE(a,h)});function BE(a){var u=$(a);return u.__chain__=!0,u}function XF(a,u){return u(a),a}function Vh(a,u){return u(a)}var eD=vs(function(a){var u=a.length,h=u?a[0]:0,S=this.__wrapped__,O=function(N){return gf(N,a)};return u>1||this.__actions__.length||!(S instanceof We)||!bs(h)?this.thru(O):(S=S.slice(h,+h+(u?1:0)),S.__actions__.push({func:Vh,args:[O],thisArg:t}),new _r(S,this.__chain__).thru(function(N){return u&&!N.length&&N.push(t),N}))});function tD(){return BE(this)}function rD(){return new _r(this.value(),this.__chain__)}function nD(){this.__values__===t&&(this.__values__=nq(this.value()));var a=this.__index__>=this.__values__.length,u=a?t:this.__values__[this.__index__++];return{done:a,value:u}}function iD(){return this}function sD(a){for(var u,h=this;h instanceof ou;){var S=ME(h);S.__index__=0,S.__values__=t,u?O.__wrapped__=S:u=S;var O=S;h=h.__wrapped__}return O.__wrapped__=a,u}function oD(){var a=this.__wrapped__;if(a instanceof We){var u=a;return this.__actions__.length&&(u=new We(this)),u=u.reverse(),u.__actions__.push({func:Vh,args:[IS],thisArg:t}),new _r(u,this.__chain__)}return this.thru(IS)}function aD(){return sE(this.__wrapped__,this.__actions__)}var lD=Mh(function(a,u,h){pt.call(a,h)?++a[h]:gn(a,h,1)});function uD(a,u,h){var S=$e(a)?ih:tS;return h&&Ur(a,u,h)&&(u=t),S(a,Ce(u,3))}function cD(a,u){var h=$e(a)?$i:Ph;return h(a,Ce(u,3))}var fD=gE(FE),dD=gE(DE);function pD(a,u){return lr(Wh(a,u),1)}function hD(a,u){return lr(Wh(a,u),fe)}function mD(a,u,h){return h=h===t?1:Me(h),lr(Wh(a,u),h)}function VE(a,u){var h=$e(a)?Mr:Ui;return h(a,Ce(u,3))}function WE(a,u){var h=$e(a)?nf:Oh;return h(a,Ce(u,3))}var gD=Mh(function(a,u,h){pt.call(a,h)?a[h].push(u):gn(a,h,[u])});function yD(a,u,h,S){a=Xr(a)?a:mu(a),h=h&&!S?Me(h):0;var O=a.length;return h<0&&(h=Tt(O+h,0)),Kh(a)?h<=O&&a.indexOf(u,h)>-1:!!O&&fs(a,u,h)>-1}var vD=Ue(function(a,u,h){var S=-1,O=typeof u=="function",N=Xr(a)?Y(a.length):[];return Ui(a,function(L){N[++S]=O?Nr(u,L,h):Ra(L,u,h)}),N}),bD=Mh(function(a,u,h){gn(a,h,u)});function Wh(a,u){var h=$e(a)?qt:de;return h(a,Ce(u,3))}function SD(a,u,h,S){return a==null?[]:($e(u)||(u=u==null?[]:[u]),h=S?t:h,$e(h)||(h=h==null?[]:[h]),ZC(a,u,h))}var wD=Mh(function(a,u,h){a[h?0:1].push(u)},function(){return[[],[]]});function _D(a,u,h){var S=$e(a)?sf:Vl,O=arguments.length<3;return S(a,Ce(u,4),h,O,Ui)}function RD(a,u,h){var S=$e(a)?nb:Vl,O=arguments.length<3;return S(a,Ce(u,4),h,O,Oh)}function xD(a,u){var h=$e(a)?$i:Ph;return h(a,Gh(Ce(u,3)))}function CD(a){var u=$e(a)?Eh:yM;return u(a)}function ED(a,u,h){(h?Ur(a,u,h):u===t)?u=1:u=Me(u);var S=$e(a)?Qb:vM;return S(a,u)}function qD(a){var u=$e(a)?Zb:SM;return u(a)}function ID(a){if(a==null)return 0;if(Xr(a))return Kh(a)?Mi(a):a.length;var u=xr(a);return u==At||u==we?a.size:T(a).length}function OD(a,u,h){var S=$e(a)?Hl:wM;return h&&Ur(a,u,h)&&(u=t),S(a,Ce(u,3))}var PD=Ue(function(a,u){if(a==null)return[];var h=u.length;return h>1&&Ur(a,u[0],u[1])?u=[]:h>2&&Ur(u[0],u[1],u[2])&&(u=[u[0]]),ZC(a,lr(u,1),[])}),zh=Ib||function(){return er.Date.now()};function kD(a,u){if(typeof u!="function")throw new jr(i);return a=Me(a),function(){if(--a<1)return u.apply(this,arguments)}}function zE(a,u,h){return u=h?t:u,u=a&&u==null?a.length:u,ys(a,j,t,t,t,t,u)}function JE(a,u){var h;if(typeof u!="function")throw new jr(i);return a=Me(a),function(){return--a>0&&(h=u.apply(this,arguments)),a<=1&&(u=t),h}}var PS=Ue(function(a,u,h){var S=x;if(h.length){var O=$n(h,pu(PS));S|=P}return ys(a,S,u,h,O)}),GE=Ue(function(a,u,h){var S=x|v;if(h.length){var O=$n(h,pu(GE));S|=P}return ys(u,S,a,h,O)});function YE(a,u,h){u=h?t:u;var S=ys(a,E,t,t,t,t,t,u);return S.placeholder=YE.placeholder,S}function KE(a,u,h){u=h?t:u;var S=ys(a,k,t,t,t,t,t,u);return S.placeholder=KE.placeholder,S}function QE(a,u,h){var S,O,N,L,B,z,X=0,ee=!1,ne=!1,ce=!0;if(typeof a!="function")throw new jr(i);u=Ln(u)||0,Ht(h)&&(ee=!!h.leading,ne="maxWait"in h,N=ne?Tt(Ln(h.maxWait)||0,u):N,ce="trailing"in h?!!h.trailing:ce);function be(Zt){var li=S,_s=O;return S=O=t,X=Zt,L=a.apply(_s,li),L}function Ee(Zt){return X=Zt,B=xf(Ke,u),ee?be(Zt):L}function De(Zt){var li=Zt-z,_s=Zt-X,yq=u-li;return ne?ar(yq,N-_s):yq}function xe(Zt){var li=Zt-z,_s=Zt-X;return z===t||li>=u||li<0||ne&&_s>=N}function Ke(){var Zt=zh();if(xe(Zt))return et(Zt);B=xf(Ke,De(Zt))}function et(Zt){return B=t,ce&&S?be(Zt):(S=O=t,L)}function Sn(){B!==t&&aE(B),X=0,S=z=O=B=t}function Hr(){return B===t?L:et(zh())}function wn(){var Zt=zh(),li=xe(Zt);if(S=arguments,O=this,z=Zt,li){if(B===t)return Ee(z);if(ne)return aE(B),B=xf(Ke,u),be(z)}return B===t&&(B=xf(Ke,u)),L}return wn.cancel=Sn,wn.flush=Hr,wn}var AD=Ue(function(a,u){return yf(a,1,u)}),TD=Ue(function(a,u,h){return yf(a,Ln(u)||0,h)});function $D(a){return ys(a,_)}function Jh(a,u){if(typeof a!="function"||u!=null&&typeof u!="function")throw new jr(i);var h=function(){var S=arguments,O=u?u.apply(this,S):S[0],N=h.cache;if(N.has(O))return N.get(O);var L=a.apply(this,S);return h.cache=N.set(O,L)||N,L};return h.cache=new(Jh.Cache||ri),h}Jh.Cache=ri;function Gh(a){if(typeof a!="function")throw new jr(i);return function(){var u=arguments;switch(u.length){case 0:return!a.call(this);case 1:return!a.call(this,u[0]);case 2:return!a.call(this,u[0],u[1]);case 3:return!a.call(this,u[0],u[1],u[2])}return!a.apply(this,u)}}function ND(a){return JE(2,a)}var MD=_M(function(a,u){u=u.length==1&&$e(u[0])?qt(u[0],Fr(Ce())):qt(lr(u,1),Fr(Ce()));var h=u.length;return Ue(function(S){for(var O=-1,N=ar(S.length,h);++O<N;)S[O]=u[O].call(this,S[O]);return Nr(a,this,S)})}),kS=Ue(function(a,u){var h=$n(u,pu(kS));return ys(a,P,t,u,h)}),ZE=Ue(function(a,u){var h=$n(u,pu(ZE));return ys(a,M,t,u,h)}),FD=vs(function(a,u){return ys(a,I,t,t,t,u)});function DD(a,u){if(typeof a!="function")throw new jr(i);return u=u===t?u:Me(u),Ue(a,u)}function jD(a,u){if(typeof a!="function")throw new jr(i);return u=u==null?0:Tt(Me(u),0),Ue(function(h){var S=h[u],O=fo(h,0,u);return S&&Ni(O,S),Nr(a,this,O)})}function LD(a,u,h){var S=!0,O=!0;if(typeof a!="function")throw new jr(i);return Ht(h)&&(S="leading"in h?!!h.leading:S,O="trailing"in h?!!h.trailing:O),QE(a,u,{leading:S,maxWait:u,trailing:O})}function UD(a){return zE(a,1)}function HD(a,u){return kS(mS(u),a)}function BD(){if(!arguments.length)return[];var a=arguments[0];return $e(a)?a:[a]}function VD(a){return Rr(a,y)}function WD(a,u){return u=typeof u=="function"?u:t,Rr(a,y,u)}function zD(a){return Rr(a,p|y)}function JD(a,u){return u=typeof u=="function"?u:t,Rr(a,p|y,u)}function GD(a,u){return u==null||Mn(a,u,pr(u))}function ai(a,u){return a===u||a!==a&&u!==u}var YD=Lh(bf),KD=Lh(function(a,u){return a>=u}),qa=Th((function(){return arguments})())?Th:function(a){return Wt(a)&&pt.call(a,"callee")&&!ha.call(a,"callee")},$e=Y.isArray,QD=rf?Fr(rf):oS;function Xr(a){return a!=null&&Yh(a.length)&&!Ss(a)}function Qt(a){return Wt(a)&&Xr(a)}function ZD(a){return a===!0||a===!1||Wt(a)&&mr(a)==$r}var po=ru||BS,XD=rh?Fr(rh):aS;function ej(a){return Wt(a)&&a.nodeType===1&&!Cf(a)}function tj(a){if(a==null)return!0;if(Xr(a)&&($e(a)||typeof a=="string"||typeof a.splice=="function"||po(a)||hu(a)||qa(a)))return!a.length;var u=xr(a);if(u==At||u==we)return!a.size;if(Rf(a))return!T(a).length;for(var h in a)if(pt.call(a,h))return!1;return!0}function rj(a,u){return xa(a,u)}function nj(a,u,h){h=typeof h=="function"?h:t;var S=h?h(a,u):t;return S===t?xa(a,u,t,h):!!S}function AS(a){if(!Wt(a))return!1;var u=mr(a);return u==St||u==xt||typeof a.message=="string"&&typeof a.name=="string"&&!Cf(a)}function ij(a){return typeof a=="number"&&hs(a)}function Ss(a){if(!Ht(a))return!1;var u=mr(a);return u==Gr||u==Ws||u==lt||u==Te}function XE(a){return typeof a=="number"&&a==Me(a)}function Yh(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=Be}function Ht(a){var u=typeof a;return a!=null&&(u=="object"||u=="function")}function Wt(a){return a!=null&&typeof a=="object"}var eq=nh?Fr(nh):ao;function sj(a,u){return a===u||lo(a,u,_S(u))}function oj(a,u,h){return h=typeof h=="function"?h:t,lo(a,u,_S(u),h)}function aj(a){return tq(a)&&a!=+a}function lj(a){if(WM(a))throw new Oe(n);return Ye(a)}function uj(a){return a===null}function cj(a){return a==null}function tq(a){return typeof a=="number"||Wt(a)&&mr(a)==Ai}function Cf(a){if(!Wt(a)||mr(a)!=te)return!1;var u=Zl(a);if(u===null)return!0;var h=pt.call(u,"constructor")&&u.constructor;return typeof h=="function"&&h instanceof h&&Gl.call(h)==xb}var TS=la?Fr(la):f;function fj(a){return XE(a)&&a>=-Be&&a<=Be}var rq=Xn?Fr(Xn):g;function Kh(a){return typeof a=="string"||!$e(a)&&Wt(a)&&mr(a)==Ze}function bn(a){return typeof a=="symbol"||Wt(a)&&mr(a)==Ct}var hu=Ll?Fr(Ll):w;function dj(a){return a===t}function pj(a){return Wt(a)&&xr(a)==oe}function hj(a){return Wt(a)&&mr(a)==fr}var mj=Lh(K),gj=Lh(function(a,u){return a<=u});function nq(a){if(!a)return[];if(Xr(a))return Kh(a)?Dr(a):Zr(a);if(ma&&a[ma])return hb(a[ma]());var u=xr(a),h=u==At?to:u==we?zl:mu;return h(a)}function ws(a){if(!a)return a===0?a:0;if(a=Ln(a),a===fe||a===-fe){var u=a<0?-1:1;return u*Re}return a===a?a:0}function Me(a){var u=ws(a),h=u%1;return u===u?h?u-h:u:0}function iq(a){return a?Li(Me(a),0,ke):0}function Ln(a){if(typeof a=="number")return a;if(bn(a))return ye;if(Ht(a)){var u=typeof a.valueOf=="function"?a.valueOf():a;a=Ht(u)?u+"":u}if(typeof a!="string")return a===0?a:+a;a=uf(a);var h=na.test(a);return h||Tv.test(a)?tb(a.slice(2),h?2:8):Av.test(a)?ye:+a}function sq(a){return Hi(a,en(a))}function yj(a){return a?Li(Me(a),-Be,Be):a===0?a:0}function wt(a){return a==null?"":vn(a)}var vj=fu(function(a,u){if(Rf(u)||Xr(u)){Hi(u,pr(u),a);return}for(var h in u)pt.call(u,h)&&Lr(a,h,u[h])}),oq=fu(function(a,u){Hi(u,en(u),a)}),aq=fu(function(a,u,h,S){Hi(u,en(u),a,S)}),$S=fu(function(a,u,h,S){Hi(u,pr(u),a,S)}),bj=vs(gf);function Sj(a,u){var h=so(a);return u==null?h:Ih(h,u)}var wj=Ue(function(a,u){a=Xe(a);var h=-1,S=u.length,O=S>2?u[2]:t;for(O&&Ur(u[0],u[1],O)&&(S=1);++h<S;)for(var N=u[h],L=en(N),B=-1,z=L.length;++B<z;){var X=L[B],ee=a[X];(ee===t||ai(ee,ro[X])&&!pt.call(a,X))&&(a[X]=N[X])}return a}),_j=Ue(function(a){return a.push(t,RE),Nr(lq,t,a)});function Rj(a,u){return sh(a,Ce(u,3),Fn)}function xj(a,u){return sh(a,Ce(u,3),ni)}function Cj(a,u){return a==null?a:vf(a,Ce(u,3),en)}function Ej(a,u){return a==null?a:kh(a,Ce(u,3),en)}function qj(a,u){return a&&Fn(a,Ce(u,3))}function Ij(a,u){return a&&ni(a,Ce(u,3))}function Oj(a){return a==null?[]:cu(a,pr(a))}function Pj(a){return a==null?[]:cu(a,en(a))}function NS(a,u,h){var S=a==null?t:gs(a,u);return S===t?h:S}function kj(a,u){return a!=null&&EE(a,u,nS)}function MS(a,u){return a!=null&&EE(a,u,iS)}var Aj=vE(function(a,u,h){u!=null&&typeof u.toString!="function"&&(u=Yl.call(u)),a[u]=h},DS(tn)),Tj=vE(function(a,u,h){u!=null&&typeof u.toString!="function"&&(u=Yl.call(u)),pt.call(a,u)?a[u].push(h):a[u]=[h]},Ce),$j=Ue(Ra);function pr(a){return Xr(a)?Ch(a):T(a)}function en(a){return Xr(a)?Ch(a,!0):H(a)}function Nj(a,u){var h={};return u=Ce(u,3),Fn(a,function(S,O,N){gn(h,u(S,O,N),S)}),h}function Mj(a,u){var h={};return u=Ce(u,3),Fn(a,function(S,O,N){gn(h,O,u(S,O,N))}),h}var Fj=fu(function(a,u,h){tr(a,u,h)}),lq=fu(function(a,u,h,S){tr(a,u,h,S)}),Dj=vs(function(a,u){var h={};if(a==null)return h;var S=!1;u=qt(u,function(N){return N=co(N,a),S||(S=N.length>1),N}),Hi(a,SS(a),h),S&&(h=Rr(h,p|m|y,TM));for(var O=u.length;O--;)dS(h,u[O]);return h});function jj(a,u){return uq(a,Gh(Ce(u)))}var Lj=vs(function(a,u){return a==null?{}:hM(a,u)});function uq(a,u){if(a==null)return{};var h=qt(SS(a),function(S){return[S]});return u=Ce(u),XC(a,h,function(S,O){return u(S,O[0])})}function Uj(a,u,h){u=co(u,a);var S=-1,O=u.length;for(O||(O=1,a=t);++S<O;){var N=a==null?t:a[oi(u[S])];N===t&&(S=O,N=h),a=Ss(N)?N.call(a):N}return a}function Hj(a,u,h){return a==null?a:wf(a,u,h)}function Bj(a,u,h,S){return S=typeof S=="function"?S:t,a==null?a:wf(a,u,h,S)}var cq=wE(pr),fq=wE(en);function Vj(a,u,h){var S=$e(a),O=S||po(a)||hu(a);if(u=Ce(u,4),h==null){var N=a&&a.constructor;O?h=S?new N:[]:Ht(a)?h=Ss(N)?so(Zl(a)):{}:h={}}return(O?Mr:Fn)(a,function(L,B,z){return u(h,L,B,z)}),h}function Wj(a,u){return a==null?!0:dS(a,u)}function zj(a,u,h){return a==null?a:iE(a,u,mS(h))}function Jj(a,u,h,S){return S=typeof S=="function"?S:t,a==null?a:iE(a,u,mS(h),S)}function mu(a){return a==null?[]:Wl(a,pr(a))}function Gj(a){return a==null?[]:Wl(a,en(a))}function Yj(a,u,h){return h===t&&(h=u,u=t),h!==t&&(h=Ln(h),h=h===h?h:0),u!==t&&(u=Ln(u),u=u===u?u:0),Li(Ln(a),u,h)}function Kj(a,u,h){return u=ws(u),h===t?(h=u,u=0):h=ws(h),a=Ln(a),sS(a,u,h)}function Qj(a,u,h){if(h&&typeof h!="boolean"&&Ur(a,u,h)&&(u=h=t),h===t&&(typeof u=="boolean"?(h=u,u=t):typeof a=="boolean"&&(h=a,a=t)),a===t&&u===t?(a=0,u=1):(a=ws(a),u===t?(u=a,a=0):u=ws(u)),a>u){var S=a;a=u,u=S}if(h||a%1||u%1){var O=vh();return ar(a+O*(u-a+eh("1e-"+((O+"").length-1))),u)}return uS(a,u)}var Zj=du(function(a,u,h){return u=u.toLowerCase(),a+(h?dq(u):u)});function dq(a){return FS(wt(a).toLowerCase())}function pq(a){return a=wt(a),a&&a.replace(ia,cb).replace(Gv,"")}function Xj(a,u,h){a=wt(a),u=vn(u);var S=a.length;h=h===t?S:Li(Me(h),0,S);var O=h;return h-=u.length,h>=0&&a.slice(h,O)==u}function eL(a){return a=wt(a),a&&me.test(a)?a.replace(kl,fb):a}function tL(a){return a=wt(a),a&&ra.test(a)?a.replace(ft,"\\$&"):a}var rL=du(function(a,u,h){return a+(h?"-":"")+u.toLowerCase()}),nL=du(function(a,u,h){return a+(h?" ":"")+u.toLowerCase()}),iL=mE("toLowerCase");function sL(a,u,h){a=wt(a),u=Me(u);var S=u?Mi(a):0;if(!u||S>=u)return a;var O=(u-S)/2;return jh(ya(O),h)+a+jh(ga(O),h)}function oL(a,u,h){a=wt(a),u=Me(u);var S=u?Mi(a):0;return u&&S<u?a+jh(u-S,h):a}function aL(a,u,h){a=wt(a),u=Me(u);var S=u?Mi(a):0;return u&&S<u?jh(u-S,h)+a:a}function lL(a,u,h){return h||u==null?u=0:u&&(u=+u),Pb(wt(a).replace(Wc,""),u||0)}function uL(a,u,h){return(h?Ur(a,u,h):u===t)?u=1:u=Me(u),cS(wt(a),u)}function cL(){var a=arguments,u=wt(a[0]);return a.length<3?u:u.replace(a[1],a[2])}var fL=du(function(a,u,h){return a+(h?"_":"")+u.toLowerCase()});function dL(a,u,h){return h&&typeof h!="number"&&Ur(a,u,h)&&(u=h=t),h=h===t?ke:h>>>0,h?(a=wt(a),a&&(typeof u=="string"||u!=null&&!TS(u))&&(u=vn(u),!u&&eo(a))?fo(Dr(a),0,h):a.split(u,h)):[]}var pL=du(function(a,u,h){return a+(h?" ":"")+FS(u)});function hL(a,u,h){return a=wt(a),h=h==null?0:Li(Me(h),0,a.length),u=vn(u),a.slice(h,h+u.length)==u}function mL(a,u,h){var S=$.templateSettings;h&&Ur(a,u,h)&&(u=t),a=wt(a),u=$S({},u,S,_E);var O=$S({},u.imports,S.imports,_E),N=pr(O),L=Wl(O,N);Mr(N,function(xe){if(Kr.test(xe))throw new Oe(o)});var B,z,X=0,ee=u.interpolate||sa,ne="__p += '",ce=Jl((u.escape||sa).source+"|"+ee.source+"|"+(ee===kn?us:sa).source+"|"+(u.evaluate||sa).source+"|$","g"),be="//# sourceURL="+(pt.call(u,"sourceURL")?(u.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Xv+"]")+`
|
|
4
4
|
`;a.replace(ce,function(xe,Ke,et,Sn,Hr,wn){return et||(et=Sn),ne+=a.slice(X,wn).replace($v,db),Ke&&(B=!0,ne+=`' +
|
|
5
5
|
__e(`+Ke+`) +
|
|
6
6
|
'`),Hr&&(z=!0,ne+=`';
|
|
@@ -17,17 +17,17 @@ __p += '`),et&&(ne+=`' +
|
|
|
17
17
|
function print() { __p += __j.call(arguments, '') }
|
|
18
18
|
`:`;
|
|
19
19
|
`)+ne+`return __p
|
|
20
|
-
}`;var De=mq(function(){return ut(N,be+"return "+ne).apply(t,L)});if(De.source=ne,AS(De))throw De;return De}function gL(a){return wt(a).toLowerCase()}function yL(a){return wt(a).toUpperCase()}function vL(a,u,h){if(a=wt(a),a&&(h||u===t))return uf(a);if(!a||!(u=vn(u)))return a;var S=Dr(a),O=Dr(u),N=ah(S,O),L=lh(S,O)+1;return fo(S,N,L).join("")}function bL(a,u,h){if(a=wt(a),a&&(h||u===t))return a.slice(0,fh(a)+1);if(!a||!(u=vn(u)))return a;var S=Dr(a),O=lh(S,Dr(u))+1;return fo(S,0,O).join("")}function SL(a,u,h){if(a=wt(a),a&&(h||u===t))return a.replace(Wc,"");if(!a||!(u=vn(u)))return a;var S=Dr(a),O=ah(S,Dr(u));return fo(S,O).join("")}function wL(a,u){var h=A,S=F;if(Ht(u)){var O="separator"in u?u.separator:O;h="length"in u?Me(u.length):h,S="omission"in u?vn(u.omission):S}a=wt(a);var N=a.length;if(eo(a)){var L=Dr(a);N=L.length}if(h>=N)return a;var B=h-Mi(S);if(B<1)return S;var z=L?fo(L,0,B).join(""):a.slice(0,B);if(O===t)return z+S;if(L&&(B+=z.length-B),TS(O)){if(a.slice(B).search(O)){var X,ee=z;for(O.global||(O=Jl(O.source,wt(Lp.exec(O))+"g")),O.lastIndex=0;X=O.exec(ee);)var ne=X.index;z=z.slice(0,ne===t?B:ne)}}else if(a.indexOf(vn(O),B)!=B){var ce=z.lastIndexOf(O);ce>-1&&(z=z.slice(0,ce))}return z+S}function _L(a){return a=wt(a),a&&Al.test(a)?a.replace(ls,gb):a}var RL=du(function(a,u,h){return a+(h?" ":"")+u.toUpperCase()}),FS=mE("toUpperCase");function hq(a,u,h){return a=wt(a),u=h?t:u,u===t?pb(a)?bb(a):ob(a):a.match(u)||[]}var mq=Ue(function(a,u){try{return Nr(a,t,u)}catch(h){return AS(h)?h:new Oe(h)}}),xL=vs(function(a,u){return Mr(u,function(h){h=oi(h),gn(a,h,PS(a[h],a))}),a});function CL(a){var u=a==null?0:a.length,h=Ce();return a=u?qt(a,function(S){if(typeof S[1]!="function")throw new jr(i);return[h(S[0]),S[1]]}):[],Ue(function(S){for(var O=-1;++O<u;){var N=a[O];if(Nr(N[0],this,S))return Nr(N[1],this,S)}})}function EL(a){return eS(Rr(a,p))}function DS(a){return function(){return a}}function qL(a,u){return a==null||a!==a?u:a}var IL=yE(),OL=yE(!0);function tn(a){return a}function jS(a){return C(typeof a=="function"?a:Rr(a,p))}function PL(a){return Ie(Rr(a,p))}function kL(a,u){return ze(a,Rr(u,p))}var AL=Ue(function(a,u){return function(h){return Ra(h,a,u)}}),TL=Ue(function(a,u){return function(h){return Ra(a,h,u)}});function LS(a,u,h){var S=pr(u),O=cu(u,S);h==null&&!(Ht(u)&&(O.length||!S.length))&&(h=u,u=a,a=this,O=cu(u,pr(u)));var N=!(Ht(h)&&"chain"in h)||!!h.chain,L=Ss(a);return Mr(O,function(B){var z=u[B];a[B]=z,L&&(a.prototype[B]=function(){var X=this.__chain__;if(N||X){var ee=a(this.__wrapped__),ne=ee.__actions__=Zr(this.__actions__);return ne.push({func:z,args:arguments,thisArg:a}),ee.__chain__=X,ee}return z.apply(a,Ni([this.value()],arguments))})}),a}function $L(){return er._===this&&(er._=Cb),this}function US(){}function NL(a){return a=Me(a),Ue(function(u){return si(u,a)})}var ML=yS(qt),FL=yS(ih),DL=yS(Hl);function gq(a){return xS(a)?ua(oi(a)):mM(a)}function jL(a){return function(u){return a==null?t:gs(a,u)}}var LL=bE(),UL=bE(!0);function HS(){return[]}function BS(){return!1}function HL(){return{}}function BL(){return""}function VL(){return!0}function WL(a,u){if(a=Me(a),a<1||a>Be)return[];var h=ke,S=ar(a,ke);u=Ce(u),a-=ke;for(var O=lf(S,u);++h<a;)u(h);return O}function zL(a){return $e(a)?qt(a,oi):bn(a)?[a]:Zr(NE(wt(a)))}function JL(a){var u=++Rb;return wt(a)+u}var GL=Dh(function(a,u){return a+u},0),YL=vS("ceil"),KL=Dh(function(a,u){return a/u},1),QL=vS("floor");function ZL(a){return a&&a.length?uu(a,tn,bf):t}function XL(a,u){return a&&a.length?uu(a,Ce(u,2),bf):t}function e2(a){return oh(a,tn)}function t2(a,u){return oh(a,Ce(u,2))}function r2(a){return a&&a.length?uu(a,tn,K):t}function n2(a,u){return a&&a.length?uu(a,Ce(u,2),K):t}var i2=Dh(function(a,u){return a*u},1),s2=vS("round"),o2=Dh(function(a,u){return a-u},0);function a2(a){return a&&a.length?af(a,tn):0}function l2(a,u){return a&&a.length?af(a,Ce(u,2)):0}return $.after=kD,$.ary=zE,$.assign=vj,$.assignIn=oq,$.assignInWith=aq,$.assignWith=$S,$.at=bj,$.before=JE,$.bind=PS,$.bindAll=xL,$.bindKey=GE,$.castArray=BD,$.chain=BE,$.chunk=ZM,$.compact=XM,$.concat=eF,$.cond=CL,$.conforms=EL,$.constant=DS,$.countBy=lD,$.create=Sj,$.curry=YE,$.curryRight=KE,$.debounce=QE,$.defaults=wj,$.defaultsDeep=_j,$.defer=AD,$.delay=TD,$.difference=tF,$.differenceBy=rF,$.differenceWith=nF,$.drop=iF,$.dropRight=sF,$.dropRightWhile=oF,$.dropWhile=aF,$.fill=lF,$.filter=cD,$.flatMap=pD,$.flatMapDeep=hD,$.flatMapDepth=mD,$.flatten=jE,$.flattenDeep=uF,$.flattenDepth=cF,$.flip=$D,$.flow=IL,$.flowRight=OL,$.fromPairs=fF,$.functions=Oj,$.functionsIn=Pj,$.groupBy=gD,$.initial=pF,$.intersection=hF,$.intersectionBy=mF,$.intersectionWith=gF,$.invert=Aj,$.invertBy=Tj,$.invokeMap=vD,$.iteratee=jS,$.keyBy=bD,$.keys=pr,$.keysIn=en,$.map=Wh,$.mapKeys=Nj,$.mapValues=Mj,$.matches=PL,$.matchesProperty=kL,$.memoize=Jh,$.merge=Fj,$.mergeWith=lq,$.method=AL,$.methodOf=TL,$.mixin=LS,$.negate=Gh,$.nthArg=NL,$.omit=Dj,$.omitBy=jj,$.once=ND,$.orderBy=SD,$.over=ML,$.overArgs=MD,$.overEvery=FL,$.overSome=DL,$.partial=kS,$.partialRight=ZE,$.partition=wD,$.pick=Lj,$.pickBy=uq,$.property=gq,$.propertyOf=jL,$.pull=SF,$.pullAll=UE,$.pullAllBy=wF,$.pullAllWith=_F,$.pullAt=RF,$.range=LL,$.rangeRight=UL,$.rearg=FD,$.reject=xD,$.remove=xF,$.rest=DD,$.reverse=IS,$.sampleSize=ED,$.set=Hj,$.setWith=Bj,$.shuffle=qD,$.slice=CF,$.sortBy=PD,$.sortedUniq=AF,$.sortedUniqBy=TF,$.split=dL,$.spread=jD,$.tail=$F,$.take=NF,$.takeRight=MF,$.takeRightWhile=FF,$.takeWhile=DF,$.tap=XF,$.throttle=LD,$.thru=Vh,$.toArray=nq,$.toPairs=cq,$.toPairsIn=fq,$.toPath=zL,$.toPlainObject=sq,$.transform=Vj,$.unary=UD,$.union=jF,$.unionBy=LF,$.unionWith=UF,$.uniq=HF,$.uniqBy=BF,$.uniqWith=VF,$.unset=Wj,$.unzip=OS,$.unzipWith=HE,$.update=zj,$.updateWith=Jj,$.values=mu,$.valuesIn=Gj,$.without=WF,$.words=hq,$.wrap=HD,$.xor=zF,$.xorBy=JF,$.xorWith=GF,$.zip=YF,$.zipObject=KF,$.zipObjectDeep=QF,$.zipWith=ZF,$.entries=cq,$.entriesIn=fq,$.extend=oq,$.extendWith=aq,LS($,$),$.add=GL,$.attempt=mq,$.camelCase=Zj,$.capitalize=dq,$.ceil=YL,$.clamp=Yj,$.clone=VD,$.cloneDeep=zD,$.cloneDeepWith=JD,$.cloneWith=WD,$.conformsTo=GD,$.deburr=pq,$.defaultTo=qL,$.divide=KL,$.endsWith=Xj,$.eq=ai,$.escape=eL,$.escapeRegExp=tL,$.every=uD,$.find=fD,$.findIndex=FE,$.findKey=Rj,$.findLast=dD,$.findLastIndex=DE,$.findLastKey=xj,$.floor=QL,$.forEach=VE,$.forEachRight=WE,$.forIn=Cj,$.forInRight=Ej,$.forOwn=qj,$.forOwnRight=Ij,$.get=NS,$.gt=YD,$.gte=KD,$.has=kj,$.hasIn=MS,$.head=LE,$.identity=tn,$.includes=yD,$.indexOf=dF,$.inRange=Kj,$.invoke=$j,$.isArguments=qa,$.isArray=$e,$.isArrayBuffer=QD,$.isArrayLike=Xr,$.isArrayLikeObject=Qt,$.isBoolean=ZD,$.isBuffer=po,$.isDate=XD,$.isElement=ej,$.isEmpty=tj,$.isEqual=rj,$.isEqualWith=nj,$.isError=AS,$.isFinite=ij,$.isFunction=Ss,$.isInteger=XE,$.isLength=Yh,$.isMap=eq,$.isMatch=sj,$.isMatchWith=oj,$.isNaN=aj,$.isNative=lj,$.isNil=cj,$.isNull=uj,$.isNumber=tq,$.isObject=Ht,$.isObjectLike=Wt,$.isPlainObject=Cf,$.isRegExp=TS,$.isSafeInteger=fj,$.isSet=rq,$.isString=Kh,$.isSymbol=bn,$.isTypedArray=hu,$.isUndefined=dj,$.isWeakMap=pj,$.isWeakSet=hj,$.join=yF,$.kebabCase=rL,$.last=jn,$.lastIndexOf=vF,$.lowerCase=nL,$.lowerFirst=iL,$.lt=mj,$.lte=gj,$.max=ZL,$.maxBy=XL,$.mean=e2,$.meanBy=t2,$.min=r2,$.minBy=n2,$.stubArray=HS,$.stubFalse=BS,$.stubObject=HL,$.stubString=BL,$.stubTrue=VL,$.multiply=i2,$.nth=bF,$.noConflict=$L,$.noop=US,$.now=zh,$.pad=sL,$.padEnd=oL,$.padStart=aL,$.parseInt=lL,$.random=Qj,$.reduce=_D,$.reduceRight=RD,$.repeat=uL,$.replace=cL,$.result=Uj,$.round=s2,$.runInContext=W,$.sample=CD,$.size=ID,$.snakeCase=fL,$.some=OD,$.sortedIndex=EF,$.sortedIndexBy=qF,$.sortedIndexOf=IF,$.sortedLastIndex=OF,$.sortedLastIndexBy=PF,$.sortedLastIndexOf=kF,$.startCase=pL,$.startsWith=hL,$.subtract=o2,$.sum=a2,$.sumBy=l2,$.template=mL,$.times=WL,$.toFinite=ws,$.toInteger=Me,$.toLength=iq,$.toLower=gL,$.toNumber=Ln,$.toSafeInteger=yj,$.toString=wt,$.toUpper=yL,$.trim=vL,$.trimEnd=bL,$.trimStart=SL,$.truncate=wL,$.unescape=_L,$.uniqueId=JL,$.upperCase=RL,$.upperFirst=FS,$.each=VE,$.eachRight=WE,$.first=LE,LS($,(function(){var a={};return Fn($,function(u,h){pt.call($.prototype,h)||(a[h]=u)}),a})(),{chain:!1}),$.VERSION=e,Mr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){$[a].placeholder=$}),Mr(["drop","take"],function(a,u){We.prototype[a]=function(h){h=h===t?1:Tt(Me(h),0);var S=this.__filtered__&&!u?new We(this):this.clone();return S.__filtered__?S.__takeCount__=ar(h,S.__takeCount__):S.__views__.push({size:ar(h,ke),type:a+(S.__dir__<0?"Right":"")}),S},We.prototype[a+"Right"]=function(h){return this.reverse()[a](h).reverse()}}),Mr(["filter","map","takeWhile"],function(a,u){var h=u+1,S=h==J||h==se;We.prototype[a]=function(O){var N=this.clone();return N.__iteratees__.push({iteratee:Ce(O,3),type:h}),N.__filtered__=N.__filtered__||S,N}}),Mr(["head","last"],function(a,u){var h="take"+(u?"Right":"");We.prototype[a]=function(){return this[h](1).value()[0]}}),Mr(["initial","tail"],function(a,u){var h="drop"+(u?"":"Right");We.prototype[a]=function(){return this.__filtered__?new We(this):this[h](1)}}),We.prototype.compact=function(){return this.filter(tn)},We.prototype.find=function(a){return this.filter(a).head()},We.prototype.findLast=function(a){return this.reverse().find(a)},We.prototype.invokeMap=Ue(function(a,u){return typeof a=="function"?new We(this):this.map(function(h){return Ra(h,a,u)})}),We.prototype.reject=function(a){return this.filter(Gh(Ce(a)))},We.prototype.slice=function(a,u){a=Me(a);var h=this;return h.__filtered__&&(a>0||u<0)?new We(h):(a<0?h=h.takeRight(-a):a&&(h=h.drop(a)),u!==t&&(u=Me(u),h=u<0?h.dropRight(-u):h.take(u-a)),h)},We.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},We.prototype.toArray=function(){return this.take(ke)},Fn(We.prototype,function(a,u){var h=/^(?:filter|find|map|reject)|While$/.test(u),S=/^(?:head|last)$/.test(u),O=$[S?"take"+(u=="last"?"Right":""):u],N=S||/^find/.test(u);O&&($.prototype[u]=function(){var L=this.__wrapped__,B=S?[1]:arguments,z=L instanceof We,X=B[0],ee=z||$e(L),ne=function(Ke){var et=O.apply($,Ni([Ke],B));return S&&ce?et[0]:et};ee&&h&&typeof X=="function"&&X.length!=1&&(z=ee=!1);var ce=this.__chain__,be=!!this.__actions__.length,Ee=N&&!ce,De=z&&!be;if(!N&&ee){L=De?L:new We(this);var xe=a.apply(L,B);return xe.__actions__.push({func:Vh,args:[ne],thisArg:t}),new _r(xe,ce)}return Ee&&De?a.apply(this,B):(xe=this.thru(ne),Ee?S?xe.value()[0]:xe.value():xe)})}),Mr(["pop","push","shift","sort","splice","unshift"],function(a){var u=da[a],h=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",S=/^(?:pop|shift)$/.test(a);$.prototype[a]=function(){var O=arguments;if(S&&!this.__chain__){var N=this.value();return u.apply($e(N)?N:[],O)}return this[h](function(L){return u.apply($e(L)?L:[],O)})}}),Fn(We.prototype,function(a,u){var h=$[u];if(h){var S=h.name+"";pt.call(io,S)||(io[S]=[]),io[S].push({name:u,func:h})}}),io[Fh(t,v).name]=[{name:"wrapper",func:t}],We.prototype.clone=Fb,We.prototype.reverse=Db,We.prototype.value=pf,$.prototype.at=eD,$.prototype.chain=tD,$.prototype.commit=rD,$.prototype.next=nD,$.prototype.plant=sD,$.prototype.reverse=oD,$.prototype.toJSON=$.prototype.valueOf=$.prototype.value=aD,$.prototype.first=$.prototype.head,ma&&($.prototype[ma]=iD),$}),Fi=Sb();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(er._=Fi,define(function(){return Fi})):dt?((dt.exports=Fi)._=Fi,jl._=Fi):er._=Fi}).call(Eu)});var Nq=V((rw,qu)=>{(function(t,e){typeof rw=="object"&&typeof qu<"u"?qu.exports=e():typeof define=="function"&&define.amd?define(e):t.moment=e()})(rw,(function(){"use strict";var t;function e(){return t.apply(null,arguments)}function r(f){t=f}function n(f){return f instanceof Array||Object.prototype.toString.call(f)==="[object Array]"}function i(f){return f!=null&&Object.prototype.toString.call(f)==="[object Object]"}function s(f,g){return Object.prototype.hasOwnProperty.call(f,g)}function o(f){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(f).length===0;var g;for(g in f)if(s(f,g))return!1;return!0}function l(f){return f===void 0}function c(f){return typeof f=="number"||Object.prototype.toString.call(f)==="[object Number]"}function d(f){return f instanceof Date||Object.prototype.toString.call(f)==="[object Date]"}function p(f,g){var w=[],C,T=f.length;for(C=0;C<T;++C)w.push(g(f[C],C));return w}function m(f,g){for(var w in g)s(g,w)&&(f[w]=g[w]);return s(g,"toString")&&(f.toString=g.toString),s(g,"valueOf")&&(f.valueOf=g.valueOf),f}function y(f,g,w,C){return Wl(f,g,w,C,!0).utc()}function b(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function q(f){return f._pf==null&&(f._pf=b()),f._pf}var x;Array.prototype.some?x=Array.prototype.some:x=function(f){var g=Object(this),w=g.length>>>0,C;for(C=0;C<w;C++)if(C in g&&f.call(this,g[C],C,g))return!0;return!1};function v(f){var g=null,w=!1,C=f._d&&!isNaN(f._d.getTime());if(C&&(g=q(f),w=x.call(g.parsedDateParts,function(T){return T!=null}),C=g.overflow<0&&!g.empty&&!g.invalidEra&&!g.invalidMonth&&!g.invalidWeekday&&!g.weekdayMismatch&&!g.nullInput&&!g.invalidFormat&&!g.userInvalidated&&(!g.meridiem||g.meridiem&&w),f._strict&&(C=C&&g.charsLeftOver===0&&g.unusedTokens.length===0&&g.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(f))f._isValid=C;else return C;return f._isValid}function _(f){var g=y(NaN);return f!=null?m(q(g),f):q(g).userInvalidated=!0,g}var E=e.momentProperties=[],k=!1;function P(f,g){var w,C,T,H=E.length;if(l(g._isAMomentObject)||(f._isAMomentObject=g._isAMomentObject),l(g._i)||(f._i=g._i),l(g._f)||(f._f=g._f),l(g._l)||(f._l=g._l),l(g._strict)||(f._strict=g._strict),l(g._tzm)||(f._tzm=g._tzm),l(g._isUTC)||(f._isUTC=g._isUTC),l(g._offset)||(f._offset=g._offset),l(g._pf)||(f._pf=q(g)),l(g._locale)||(f._locale=g._locale),H>0)for(w=0;w<H;w++)C=E[w],T=g[C],l(T)||(f[C]=T);return f}function M(f){P(this,f),this._d=new Date(f._d!=null?f._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),k===!1&&(k=!0,e.updateOffset(this),k=!1)}function j(f){return f instanceof M||f!=null&&f._isAMomentObject!=null}function I(f){e.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+f)}function R(f,g){var w=!0;return m(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,f),w){var C=[],T,H,K,de=arguments.length;for(H=0;H<de;H++){if(T="",typeof arguments[H]=="object"){T+=`
|
|
20
|
+
}`;var De=mq(function(){return ut(N,be+"return "+ne).apply(t,L)});if(De.source=ne,AS(De))throw De;return De}function gL(a){return wt(a).toLowerCase()}function yL(a){return wt(a).toUpperCase()}function vL(a,u,h){if(a=wt(a),a&&(h||u===t))return uf(a);if(!a||!(u=vn(u)))return a;var S=Dr(a),O=Dr(u),N=ah(S,O),L=lh(S,O)+1;return fo(S,N,L).join("")}function bL(a,u,h){if(a=wt(a),a&&(h||u===t))return a.slice(0,fh(a)+1);if(!a||!(u=vn(u)))return a;var S=Dr(a),O=lh(S,Dr(u))+1;return fo(S,0,O).join("")}function SL(a,u,h){if(a=wt(a),a&&(h||u===t))return a.replace(Wc,"");if(!a||!(u=vn(u)))return a;var S=Dr(a),O=ah(S,Dr(u));return fo(S,O).join("")}function wL(a,u){var h=A,S=F;if(Ht(u)){var O="separator"in u?u.separator:O;h="length"in u?Me(u.length):h,S="omission"in u?vn(u.omission):S}a=wt(a);var N=a.length;if(eo(a)){var L=Dr(a);N=L.length}if(h>=N)return a;var B=h-Mi(S);if(B<1)return S;var z=L?fo(L,0,B).join(""):a.slice(0,B);if(O===t)return z+S;if(L&&(B+=z.length-B),TS(O)){if(a.slice(B).search(O)){var X,ee=z;for(O.global||(O=Jl(O.source,wt(Lp.exec(O))+"g")),O.lastIndex=0;X=O.exec(ee);)var ne=X.index;z=z.slice(0,ne===t?B:ne)}}else if(a.indexOf(vn(O),B)!=B){var ce=z.lastIndexOf(O);ce>-1&&(z=z.slice(0,ce))}return z+S}function _L(a){return a=wt(a),a&&Al.test(a)?a.replace(ls,gb):a}var RL=du(function(a,u,h){return a+(h?" ":"")+u.toUpperCase()}),FS=mE("toUpperCase");function hq(a,u,h){return a=wt(a),u=h?t:u,u===t?pb(a)?bb(a):ob(a):a.match(u)||[]}var mq=Ue(function(a,u){try{return Nr(a,t,u)}catch(h){return AS(h)?h:new Oe(h)}}),xL=vs(function(a,u){return Mr(u,function(h){h=oi(h),gn(a,h,PS(a[h],a))}),a});function CL(a){var u=a==null?0:a.length,h=Ce();return a=u?qt(a,function(S){if(typeof S[1]!="function")throw new jr(i);return[h(S[0]),S[1]]}):[],Ue(function(S){for(var O=-1;++O<u;){var N=a[O];if(Nr(N[0],this,S))return Nr(N[1],this,S)}})}function EL(a){return eS(Rr(a,p))}function DS(a){return function(){return a}}function qL(a,u){return a==null||a!==a?u:a}var IL=yE(),OL=yE(!0);function tn(a){return a}function jS(a){return C(typeof a=="function"?a:Rr(a,p))}function PL(a){return Ie(Rr(a,p))}function kL(a,u){return ze(a,Rr(u,p))}var AL=Ue(function(a,u){return function(h){return Ra(h,a,u)}}),TL=Ue(function(a,u){return function(h){return Ra(a,h,u)}});function LS(a,u,h){var S=pr(u),O=cu(u,S);h==null&&!(Ht(u)&&(O.length||!S.length))&&(h=u,u=a,a=this,O=cu(u,pr(u)));var N=!(Ht(h)&&"chain"in h)||!!h.chain,L=Ss(a);return Mr(O,function(B){var z=u[B];a[B]=z,L&&(a.prototype[B]=function(){var X=this.__chain__;if(N||X){var ee=a(this.__wrapped__),ne=ee.__actions__=Zr(this.__actions__);return ne.push({func:z,args:arguments,thisArg:a}),ee.__chain__=X,ee}return z.apply(a,Ni([this.value()],arguments))})}),a}function $L(){return er._===this&&(er._=Cb),this}function US(){}function NL(a){return a=Me(a),Ue(function(u){return si(u,a)})}var ML=yS(qt),FL=yS(ih),DL=yS(Hl);function gq(a){return xS(a)?ua(oi(a)):mM(a)}function jL(a){return function(u){return a==null?t:gs(a,u)}}var LL=bE(),UL=bE(!0);function HS(){return[]}function BS(){return!1}function HL(){return{}}function BL(){return""}function VL(){return!0}function WL(a,u){if(a=Me(a),a<1||a>Be)return[];var h=ke,S=ar(a,ke);u=Ce(u),a-=ke;for(var O=lf(S,u);++h<a;)u(h);return O}function zL(a){return $e(a)?qt(a,oi):bn(a)?[a]:Zr(NE(wt(a)))}function JL(a){var u=++Rb;return wt(a)+u}var GL=Dh(function(a,u){return a+u},0),YL=vS("ceil"),KL=Dh(function(a,u){return a/u},1),QL=vS("floor");function ZL(a){return a&&a.length?uu(a,tn,bf):t}function XL(a,u){return a&&a.length?uu(a,Ce(u,2),bf):t}function e2(a){return oh(a,tn)}function t2(a,u){return oh(a,Ce(u,2))}function r2(a){return a&&a.length?uu(a,tn,K):t}function n2(a,u){return a&&a.length?uu(a,Ce(u,2),K):t}var i2=Dh(function(a,u){return a*u},1),s2=vS("round"),o2=Dh(function(a,u){return a-u},0);function a2(a){return a&&a.length?af(a,tn):0}function l2(a,u){return a&&a.length?af(a,Ce(u,2)):0}return $.after=kD,$.ary=zE,$.assign=vj,$.assignIn=oq,$.assignInWith=aq,$.assignWith=$S,$.at=bj,$.before=JE,$.bind=PS,$.bindAll=xL,$.bindKey=GE,$.castArray=BD,$.chain=BE,$.chunk=ZM,$.compact=XM,$.concat=eF,$.cond=CL,$.conforms=EL,$.constant=DS,$.countBy=lD,$.create=Sj,$.curry=YE,$.curryRight=KE,$.debounce=QE,$.defaults=wj,$.defaultsDeep=_j,$.defer=AD,$.delay=TD,$.difference=tF,$.differenceBy=rF,$.differenceWith=nF,$.drop=iF,$.dropRight=sF,$.dropRightWhile=oF,$.dropWhile=aF,$.fill=lF,$.filter=cD,$.flatMap=pD,$.flatMapDeep=hD,$.flatMapDepth=mD,$.flatten=jE,$.flattenDeep=uF,$.flattenDepth=cF,$.flip=$D,$.flow=IL,$.flowRight=OL,$.fromPairs=fF,$.functions=Oj,$.functionsIn=Pj,$.groupBy=gD,$.initial=pF,$.intersection=hF,$.intersectionBy=mF,$.intersectionWith=gF,$.invert=Aj,$.invertBy=Tj,$.invokeMap=vD,$.iteratee=jS,$.keyBy=bD,$.keys=pr,$.keysIn=en,$.map=Wh,$.mapKeys=Nj,$.mapValues=Mj,$.matches=PL,$.matchesProperty=kL,$.memoize=Jh,$.merge=Fj,$.mergeWith=lq,$.method=AL,$.methodOf=TL,$.mixin=LS,$.negate=Gh,$.nthArg=NL,$.omit=Dj,$.omitBy=jj,$.once=ND,$.orderBy=SD,$.over=ML,$.overArgs=MD,$.overEvery=FL,$.overSome=DL,$.partial=kS,$.partialRight=ZE,$.partition=wD,$.pick=Lj,$.pickBy=uq,$.property=gq,$.propertyOf=jL,$.pull=SF,$.pullAll=UE,$.pullAllBy=wF,$.pullAllWith=_F,$.pullAt=RF,$.range=LL,$.rangeRight=UL,$.rearg=FD,$.reject=xD,$.remove=xF,$.rest=DD,$.reverse=IS,$.sampleSize=ED,$.set=Hj,$.setWith=Bj,$.shuffle=qD,$.slice=CF,$.sortBy=PD,$.sortedUniq=AF,$.sortedUniqBy=TF,$.split=dL,$.spread=jD,$.tail=$F,$.take=NF,$.takeRight=MF,$.takeRightWhile=FF,$.takeWhile=DF,$.tap=XF,$.throttle=LD,$.thru=Vh,$.toArray=nq,$.toPairs=cq,$.toPairsIn=fq,$.toPath=zL,$.toPlainObject=sq,$.transform=Vj,$.unary=UD,$.union=jF,$.unionBy=LF,$.unionWith=UF,$.uniq=HF,$.uniqBy=BF,$.uniqWith=VF,$.unset=Wj,$.unzip=OS,$.unzipWith=HE,$.update=zj,$.updateWith=Jj,$.values=mu,$.valuesIn=Gj,$.without=WF,$.words=hq,$.wrap=HD,$.xor=zF,$.xorBy=JF,$.xorWith=GF,$.zip=YF,$.zipObject=KF,$.zipObjectDeep=QF,$.zipWith=ZF,$.entries=cq,$.entriesIn=fq,$.extend=oq,$.extendWith=aq,LS($,$),$.add=GL,$.attempt=mq,$.camelCase=Zj,$.capitalize=dq,$.ceil=YL,$.clamp=Yj,$.clone=VD,$.cloneDeep=zD,$.cloneDeepWith=JD,$.cloneWith=WD,$.conformsTo=GD,$.deburr=pq,$.defaultTo=qL,$.divide=KL,$.endsWith=Xj,$.eq=ai,$.escape=eL,$.escapeRegExp=tL,$.every=uD,$.find=fD,$.findIndex=FE,$.findKey=Rj,$.findLast=dD,$.findLastIndex=DE,$.findLastKey=xj,$.floor=QL,$.forEach=VE,$.forEachRight=WE,$.forIn=Cj,$.forInRight=Ej,$.forOwn=qj,$.forOwnRight=Ij,$.get=NS,$.gt=YD,$.gte=KD,$.has=kj,$.hasIn=MS,$.head=LE,$.identity=tn,$.includes=yD,$.indexOf=dF,$.inRange=Kj,$.invoke=$j,$.isArguments=qa,$.isArray=$e,$.isArrayBuffer=QD,$.isArrayLike=Xr,$.isArrayLikeObject=Qt,$.isBoolean=ZD,$.isBuffer=po,$.isDate=XD,$.isElement=ej,$.isEmpty=tj,$.isEqual=rj,$.isEqualWith=nj,$.isError=AS,$.isFinite=ij,$.isFunction=Ss,$.isInteger=XE,$.isLength=Yh,$.isMap=eq,$.isMatch=sj,$.isMatchWith=oj,$.isNaN=aj,$.isNative=lj,$.isNil=cj,$.isNull=uj,$.isNumber=tq,$.isObject=Ht,$.isObjectLike=Wt,$.isPlainObject=Cf,$.isRegExp=TS,$.isSafeInteger=fj,$.isSet=rq,$.isString=Kh,$.isSymbol=bn,$.isTypedArray=hu,$.isUndefined=dj,$.isWeakMap=pj,$.isWeakSet=hj,$.join=yF,$.kebabCase=rL,$.last=jn,$.lastIndexOf=vF,$.lowerCase=nL,$.lowerFirst=iL,$.lt=mj,$.lte=gj,$.max=ZL,$.maxBy=XL,$.mean=e2,$.meanBy=t2,$.min=r2,$.minBy=n2,$.stubArray=HS,$.stubFalse=BS,$.stubObject=HL,$.stubString=BL,$.stubTrue=VL,$.multiply=i2,$.nth=bF,$.noConflict=$L,$.noop=US,$.now=zh,$.pad=sL,$.padEnd=oL,$.padStart=aL,$.parseInt=lL,$.random=Qj,$.reduce=_D,$.reduceRight=RD,$.repeat=uL,$.replace=cL,$.result=Uj,$.round=s2,$.runInContext=W,$.sample=CD,$.size=ID,$.snakeCase=fL,$.some=OD,$.sortedIndex=EF,$.sortedIndexBy=qF,$.sortedIndexOf=IF,$.sortedLastIndex=OF,$.sortedLastIndexBy=PF,$.sortedLastIndexOf=kF,$.startCase=pL,$.startsWith=hL,$.subtract=o2,$.sum=a2,$.sumBy=l2,$.template=mL,$.times=WL,$.toFinite=ws,$.toInteger=Me,$.toLength=iq,$.toLower=gL,$.toNumber=Ln,$.toSafeInteger=yj,$.toString=wt,$.toUpper=yL,$.trim=vL,$.trimEnd=bL,$.trimStart=SL,$.truncate=wL,$.unescape=_L,$.uniqueId=JL,$.upperCase=RL,$.upperFirst=FS,$.each=VE,$.eachRight=WE,$.first=LE,LS($,(function(){var a={};return Fn($,function(u,h){pt.call($.prototype,h)||(a[h]=u)}),a})(),{chain:!1}),$.VERSION=e,Mr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){$[a].placeholder=$}),Mr(["drop","take"],function(a,u){We.prototype[a]=function(h){h=h===t?1:Tt(Me(h),0);var S=this.__filtered__&&!u?new We(this):this.clone();return S.__filtered__?S.__takeCount__=ar(h,S.__takeCount__):S.__views__.push({size:ar(h,ke),type:a+(S.__dir__<0?"Right":"")}),S},We.prototype[a+"Right"]=function(h){return this.reverse()[a](h).reverse()}}),Mr(["filter","map","takeWhile"],function(a,u){var h=u+1,S=h==J||h==se;We.prototype[a]=function(O){var N=this.clone();return N.__iteratees__.push({iteratee:Ce(O,3),type:h}),N.__filtered__=N.__filtered__||S,N}}),Mr(["head","last"],function(a,u){var h="take"+(u?"Right":"");We.prototype[a]=function(){return this[h](1).value()[0]}}),Mr(["initial","tail"],function(a,u){var h="drop"+(u?"":"Right");We.prototype[a]=function(){return this.__filtered__?new We(this):this[h](1)}}),We.prototype.compact=function(){return this.filter(tn)},We.prototype.find=function(a){return this.filter(a).head()},We.prototype.findLast=function(a){return this.reverse().find(a)},We.prototype.invokeMap=Ue(function(a,u){return typeof a=="function"?new We(this):this.map(function(h){return Ra(h,a,u)})}),We.prototype.reject=function(a){return this.filter(Gh(Ce(a)))},We.prototype.slice=function(a,u){a=Me(a);var h=this;return h.__filtered__&&(a>0||u<0)?new We(h):(a<0?h=h.takeRight(-a):a&&(h=h.drop(a)),u!==t&&(u=Me(u),h=u<0?h.dropRight(-u):h.take(u-a)),h)},We.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},We.prototype.toArray=function(){return this.take(ke)},Fn(We.prototype,function(a,u){var h=/^(?:filter|find|map|reject)|While$/.test(u),S=/^(?:head|last)$/.test(u),O=$[S?"take"+(u=="last"?"Right":""):u],N=S||/^find/.test(u);O&&($.prototype[u]=function(){var L=this.__wrapped__,B=S?[1]:arguments,z=L instanceof We,X=B[0],ee=z||$e(L),ne=function(Ke){var et=O.apply($,Ni([Ke],B));return S&&ce?et[0]:et};ee&&h&&typeof X=="function"&&X.length!=1&&(z=ee=!1);var ce=this.__chain__,be=!!this.__actions__.length,Ee=N&&!ce,De=z&&!be;if(!N&&ee){L=De?L:new We(this);var xe=a.apply(L,B);return xe.__actions__.push({func:Vh,args:[ne],thisArg:t}),new _r(xe,ce)}return Ee&&De?a.apply(this,B):(xe=this.thru(ne),Ee?S?xe.value()[0]:xe.value():xe)})}),Mr(["pop","push","shift","sort","splice","unshift"],function(a){var u=da[a],h=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",S=/^(?:pop|shift)$/.test(a);$.prototype[a]=function(){var O=arguments;if(S&&!this.__chain__){var N=this.value();return u.apply($e(N)?N:[],O)}return this[h](function(L){return u.apply($e(L)?L:[],O)})}}),Fn(We.prototype,function(a,u){var h=$[u];if(h){var S=h.name+"";pt.call(io,S)||(io[S]=[]),io[S].push({name:u,func:h})}}),io[Fh(t,v).name]=[{name:"wrapper",func:t}],We.prototype.clone=Fb,We.prototype.reverse=Db,We.prototype.value=pf,$.prototype.at=eD,$.prototype.chain=tD,$.prototype.commit=rD,$.prototype.next=nD,$.prototype.plant=sD,$.prototype.reverse=oD,$.prototype.toJSON=$.prototype.valueOf=$.prototype.value=aD,$.prototype.first=$.prototype.head,ma&&($.prototype[ma]=iD),$}),Fi=Sb();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(er._=Fi,define(function(){return Fi})):dt?((dt.exports=Fi)._=Fi,jl._=Fi):er._=Fi}).call(Eu)});var Nq=V((rw,qu)=>{(function(t,e){typeof rw=="object"&&typeof qu<"u"?qu.exports=e():typeof define=="function"&&define.amd?define(e):t.moment=e()})(rw,(function(){"use strict";var t;function e(){return t.apply(null,arguments)}function r(f){t=f}function n(f){return f instanceof Array||Object.prototype.toString.call(f)==="[object Array]"}function i(f){return f!=null&&Object.prototype.toString.call(f)==="[object Object]"}function s(f,g){return Object.prototype.hasOwnProperty.call(f,g)}function o(f){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(f).length===0;var g;for(g in f)if(s(f,g))return!1;return!0}function l(f){return f===void 0}function c(f){return typeof f=="number"||Object.prototype.toString.call(f)==="[object Number]"}function d(f){return f instanceof Date||Object.prototype.toString.call(f)==="[object Date]"}function p(f,g){var w=[],C,T=f.length;for(C=0;C<T;++C)w.push(g(f[C],C));return w}function m(f,g){for(var w in g)s(g,w)&&(f[w]=g[w]);return s(g,"toString")&&(f.toString=g.toString),s(g,"valueOf")&&(f.valueOf=g.valueOf),f}function y(f,g,w,C){return Wl(f,g,w,C,!0).utc()}function b(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function q(f){return f._pf==null&&(f._pf=b()),f._pf}var x;Array.prototype.some?x=Array.prototype.some:x=function(f){var g=Object(this),w=g.length>>>0,C;for(C=0;C<w;C++)if(C in g&&f.call(this,g[C],C,g))return!0;return!1};function v(f){var g=null,w=!1,C=f._d&&!isNaN(f._d.getTime());if(C&&(g=q(f),w=x.call(g.parsedDateParts,function(T){return T!=null}),C=g.overflow<0&&!g.empty&&!g.invalidEra&&!g.invalidMonth&&!g.invalidWeekday&&!g.weekdayMismatch&&!g.nullInput&&!g.invalidFormat&&!g.userInvalidated&&(!g.meridiem||g.meridiem&&w),f._strict&&(C=C&&g.charsLeftOver===0&&g.unusedTokens.length===0&&g.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(f))f._isValid=C;else return C;return f._isValid}function R(f){var g=y(NaN);return f!=null?m(q(g),f):q(g).userInvalidated=!0,g}var E=e.momentProperties=[],k=!1;function P(f,g){var w,C,T,H=E.length;if(l(g._isAMomentObject)||(f._isAMomentObject=g._isAMomentObject),l(g._i)||(f._i=g._i),l(g._f)||(f._f=g._f),l(g._l)||(f._l=g._l),l(g._strict)||(f._strict=g._strict),l(g._tzm)||(f._tzm=g._tzm),l(g._isUTC)||(f._isUTC=g._isUTC),l(g._offset)||(f._offset=g._offset),l(g._pf)||(f._pf=q(g)),l(g._locale)||(f._locale=g._locale),H>0)for(w=0;w<H;w++)C=E[w],T=g[C],l(T)||(f[C]=T);return f}function M(f){P(this,f),this._d=new Date(f._d!=null?f._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),k===!1&&(k=!0,e.updateOffset(this),k=!1)}function j(f){return f instanceof M||f!=null&&f._isAMomentObject!=null}function I(f){e.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+f)}function _(f,g){var w=!0;return m(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,f),w){var C=[],T,H,K,de=arguments.length;for(H=0;H<de;H++){if(T="",typeof arguments[H]=="object"){T+=`
|
|
21
21
|
[`+H+"] ";for(K in arguments[0])s(arguments[0],K)&&(T+=K+": "+arguments[0][K]+", ");T=T.slice(0,-2)}else T=arguments[H];C.push(T)}I(f+`
|
|
22
22
|
Arguments: `+Array.prototype.slice.call(C).join("")+`
|
|
23
|
-
`+new Error().stack),w=!1}return g.apply(this,arguments)},g)}var A={};function F(f,g){e.deprecationHandler!=null&&e.deprecationHandler(f,g),A[f]||(I(g),A[f]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function U(f){return typeof Function<"u"&&f instanceof Function||Object.prototype.toString.call(f)==="[object Function]"}function D(f){var g,w;for(w in f)s(f,w)&&(g=f[w],U(g)?this[w]=g:this["_"+w]=g);this._config=f,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function J(f,g){var w=m({},f),C;for(C in g)s(g,C)&&(i(f[C])&&i(g[C])?(w[C]={},m(w[C],f[C]),m(w[C],g[C])):g[C]!=null?w[C]=g[C]:delete w[C]);for(C in f)s(f,C)&&!s(g,C)&&i(f[C])&&(w[C]=m({},w[C]));return w}function Q(f){f!=null&&this.set(f)}var se;Object.keys?se=Object.keys:se=function(f){var g,w=[];for(g in f)s(f,g)&&w.push(g);return w};var fe={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function Be(f,g,w){var C=this._calendar[f]||this._calendar.sameElse;return U(C)?C.call(g,w):C}function Re(f,g,w){var C=""+Math.abs(f),T=g-C.length,H=f>=0;return(H?w?"+":"":"-")+Math.pow(10,Math.max(0,T)).toString().substr(1)+C}var ye=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ke=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,mt={},Nt={};function he(f,g,w,C){var T=C;typeof C=="string"&&(T=function(){return this[C]()}),f&&(Nt[f]=T),g&&(Nt[g[0]]=function(){return Re(T.apply(this,arguments),g[1],g[2])}),w&&(Nt[w]=function(){return this.localeData().ordinal(T.apply(this,arguments),f)})}function Yt(f){return f.match(/\[[\s\S]/)?f.replace(/^\[|\]$/g,""):f.replace(/\\/g,"")}function Tr(f){var g=f.match(ye),w,C;for(w=0,C=g.length;w<C;w++)Nt[g[w]]?g[w]=Nt[g[w]]:g[w]=Yt(g[w]);return function(T){var H="",K;for(K=0;K<C;K++)H+=U(g[K])?g[K].call(T,f):g[K];return H}}function lt(f,g){return f.isValid()?(g=$r(g,f.localeData()),mt[g]=mt[g]||Tr(g),mt[g](f)):f.localeData().invalidDate()}function $r(f,g){var w=5;function C(T){return g.longDateFormat(T)||T}for(ke.lastIndex=0;w>=0&&ke.test(f);)f=f.replace(ke,C),ke.lastIndex=0,w-=1;return f}var wr={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function xt(f){var g=this._longDateFormat[f],w=this._longDateFormat[f.toUpperCase()];return g||!w?g:(this._longDateFormat[f]=w.match(ye).map(function(C){return C==="MMMM"||C==="MM"||C==="DD"||C==="dddd"?C.slice(1):C}).join(""),this._longDateFormat[f])}var St="Invalid date";function Gr(){return this._invalidDate}var Ws="%d",At=/\d{1,2}/;function Ai(f){return this._ordinal.replace("%d",f)}var On={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function te(f,g,w,C){var T=this._relativeTime[w];return U(T)?T(f,g,w,C):T.replace(/%d/i,f)}function re(f,g){var w=this._relativeTime[f>0?"future":"past"];return U(w)?w(g):w.replace(/%s/i,g)}var Te={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function ge(f){return typeof f=="string"?Te[f]||Te[f.toLowerCase()]:void 0}function we(f){var g={},w,C;for(C in f)s(f,C)&&(w=ge(C),w&&(g[w]=f[C]));return g}var Ze={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function Ct(f){var g=[],w;for(w in f)s(f,w)&&g.push({unit:w,priority:Ze[w]});return g.sort(function(C,T){return C.priority-T.priority}),g}var or=/\d/,oe=/\d\d/,fr=/\d{3}/,Lt=/\d{4}/,gt=/[+-]?\d{6}/,qe=/\d\d?/,Pn=/\d\d\d\d?/,Ol=/\d\d\d\d\d\d?/,zs=/\d{1,3}/,ea=/\d{1,4}/,Js=/[+-]?\d{1,6}/,Ti=/\d+/,Gs=/[+-]?\d+/,Bc=/Z|[+-]\d\d:?\d\d/gi,Pl=/Z|[+-]\d\d(?::?\d\d)?/gi,Ov=/[+-]?\d+(\.\d{1,3})?/,ta=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ls=/^[1-9]\d?/,kl=/^([1-9]\d|\d)/,Al;Al={};function me(f,g,w){Al[f]=U(g)?g:function(C,T){return C&&w?w:g}}function Pv(f,g){return s(Al,f)?Al[f](g._strict,g._locale):new RegExp(kv(f))}function kv(f){return kn(f.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(g,w,C,T,H){return w||C||T||H}))}function kn(f){return f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Yr(f){return f<0?Math.ceil(f)||0:Math.floor(f)}function Ve(f){var g=+f,w=0;return g!==0&&isFinite(g)&&(w=Yr(g)),w}var Vc={};function ft(f,g){var w,C=g,T;for(typeof f=="string"&&(f=[f]),c(g)&&(C=function(H,K){K[g]=Ve(H)}),T=f.length,w=0;w<T;w++)Vc[f[w]]=C}function ra(f,g){ft(f,function(w,C,T,H){T._w=T._w||{},g(w,T._w,T,H)})}function Wc(f,g,w){g!=null&&s(Vc,f)&&Vc[f](g,w._a,w,f)}function Tl(f){return f%4===0&&f%100!==0||f%400===0}var dr=0,Qn=1,An=2,Kt=3,Kr=4,Zn=5,us=6,Lp=7,Av=8;he("Y",0,0,function(){var f=this.year();return f<=9999?Re(f,4):"+"+f}),he(0,["YY",2],0,function(){return this.year()%100}),he(0,["YYYY",4],0,"year"),he(0,["YYYYY",5],0,"year"),he(0,["YYYYYY",6,!0],0,"year"),me("Y",Gs),me("YY",qe,oe),me("YYYY",ea,Lt),me("YYYYY",Js,gt),me("YYYYYY",Js,gt),ft(["YYYYY","YYYYYY"],dr),ft("YYYY",function(f,g){g[dr]=f.length===2?e.parseTwoDigitYear(f):Ve(f)}),ft("YY",function(f,g){g[dr]=e.parseTwoDigitYear(f)}),ft("Y",function(f,g){g[dr]=parseInt(f,10)});function na(f){return Tl(f)?366:365}e.parseTwoDigitYear=function(f){return Ve(f)+(Ve(f)>68?1900:2e3)};var Up=Ys("FullYear",!0);function Tv(){return Tl(this.year())}function Ys(f,g){return function(w){return w!=null?(sa(this,f,w),e.updateOffset(this,g),this):ia(this,f)}}function ia(f,g){if(!f.isValid())return NaN;var w=f._d,C=f._isUTC;switch(g){case"Milliseconds":return C?w.getUTCMilliseconds():w.getMilliseconds();case"Seconds":return C?w.getUTCSeconds():w.getSeconds();case"Minutes":return C?w.getUTCMinutes():w.getMinutes();case"Hours":return C?w.getUTCHours():w.getHours();case"Date":return C?w.getUTCDate():w.getDate();case"Day":return C?w.getUTCDay():w.getDay();case"Month":return C?w.getUTCMonth():w.getMonth();case"FullYear":return C?w.getUTCFullYear():w.getFullYear();default:return NaN}}function sa(f,g,w){var C,T,H,K,de;if(!(!f.isValid()||isNaN(w))){switch(C=f._d,T=f._isUTC,g){case"Milliseconds":return void(T?C.setUTCMilliseconds(w):C.setMilliseconds(w));case"Seconds":return void(T?C.setUTCSeconds(w):C.setSeconds(w));case"Minutes":return void(T?C.setUTCMinutes(w):C.setMinutes(w));case"Hours":return void(T?C.setUTCHours(w):C.setHours(w));case"Date":return void(T?C.setUTCDate(w):C.setDate(w));case"FullYear":break;default:return}H=w,K=f.month(),de=f.date(),de=de===29&&K===1&&!Tl(H)?28:de,T?C.setUTCFullYear(H,K,de):C.setFullYear(H,K,de)}}function $v(f){return f=ge(f),U(this[f])?this[f]():this}function $l(f,g){if(typeof f=="object"){f=we(f);var w=Ct(f),C,T=w.length;for(C=0;C<T;C++)this[w[C].unit](f[w[C].unit])}else if(f=ge(f),U(this[f]))return this[f](g);return this}function Nv(f,g){return(f%g+g)%g}var Ut;Array.prototype.indexOf?Ut=Array.prototype.indexOf:Ut=function(f){var g;for(g=0;g<this.length;++g)if(this[g]===f)return g;return-1};function zc(f,g){if(isNaN(f)||isNaN(g))return NaN;var w=Nv(g,12);return f+=(g-w)/12,w===1?Tl(f)?29:28:31-w%7%2}he("M",["MM",2],"Mo",function(){return this.month()+1}),he("MMM",0,0,function(f){return this.localeData().monthsShort(this,f)}),he("MMMM",0,0,function(f){return this.localeData().months(this,f)}),me("M",qe,ls),me("MM",qe,oe),me("MMM",function(f,g){return g.monthsShortRegex(f)}),me("MMMM",function(f,g){return g.monthsRegex(f)}),ft(["M","MM"],function(f,g){g[Qn]=Ve(f)-1}),ft(["MMM","MMMM"],function(f,g,w,C){var T=w._locale.monthsParse(f,C,w._strict);T!=null?g[Qn]=T:q(w).invalidMonth=f});var Hp="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Jc="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Gc=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Mv=ta,Fv=ta;function Dv(f,g){return f?n(this._months)?this._months[f.month()]:this._months[(this._months.isFormat||Gc).test(g)?"format":"standalone"][f.month()]:n(this._months)?this._months:this._months.standalone}function jv(f,g){return f?n(this._monthsShort)?this._monthsShort[f.month()]:this._monthsShort[Gc.test(g)?"format":"standalone"][f.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Bp(f,g,w){var C,T,H,K=f.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],C=0;C<12;++C)H=y([2e3,C]),this._shortMonthsParse[C]=this.monthsShort(H,"").toLocaleLowerCase(),this._longMonthsParse[C]=this.months(H,"").toLocaleLowerCase();return w?g==="MMM"?(T=Ut.call(this._shortMonthsParse,K),T!==-1?T:null):(T=Ut.call(this._longMonthsParse,K),T!==-1?T:null):g==="MMM"?(T=Ut.call(this._shortMonthsParse,K),T!==-1?T:(T=Ut.call(this._longMonthsParse,K),T!==-1?T:null)):(T=Ut.call(this._longMonthsParse,K),T!==-1?T:(T=Ut.call(this._shortMonthsParse,K),T!==-1?T:null))}function Vp(f,g,w){var C,T,H;if(this._monthsParseExact)return Bp.call(this,f,g,w);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),C=0;C<12;C++){if(T=y([2e3,C]),w&&!this._longMonthsParse[C]&&(this._longMonthsParse[C]=new RegExp("^"+this.months(T,"").replace(".","")+"$","i"),this._shortMonthsParse[C]=new RegExp("^"+this.monthsShort(T,"").replace(".","")+"$","i")),!w&&!this._monthsParse[C]&&(H="^"+this.months(T,"")+"|^"+this.monthsShort(T,""),this._monthsParse[C]=new RegExp(H.replace(".",""),"i")),w&&g==="MMMM"&&this._longMonthsParse[C].test(f))return C;if(w&&g==="MMM"&&this._shortMonthsParse[C].test(f))return C;if(!w&&this._monthsParse[C].test(f))return C}}function Yc(f,g){if(!f.isValid())return f;if(typeof g=="string"){if(/^\d+$/.test(g))g=Ve(g);else if(g=f.localeData().monthsParse(g),!c(g))return f}var w=g,C=f.date();return C=C<29?C:Math.min(C,zc(f.year(),w)),f._isUTC?f._d.setUTCMonth(w,C):f._d.setMonth(w,C),f}function Nl(f){return f!=null?(Yc(this,f),e.updateOffset(this,!0),this):ia(this,"Month")}function Lv(){return zc(this.year(),this.month())}function Wp(f){return this._monthsParseExact?(s(this,"_monthsRegex")||Kc.call(this),f?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=Mv),this._monthsShortStrictRegex&&f?this._monthsShortStrictRegex:this._monthsShortRegex)}function Ml(f){return this._monthsParseExact?(s(this,"_monthsRegex")||Kc.call(this),f?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=Fv),this._monthsStrictRegex&&f?this._monthsStrictRegex:this._monthsRegex)}function Kc(){function f(Ie,ze){return ze.length-Ie.length}var g=[],w=[],C=[],T,H,K,de;for(T=0;T<12;T++)H=y([2e3,T]),K=kn(this.monthsShort(H,"")),de=kn(this.months(H,"")),g.push(K),w.push(de),C.push(de),C.push(K);g.sort(f),w.sort(f),C.sort(f),this._monthsRegex=new RegExp("^("+C.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+w.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+g.join("|")+")","i")}function Uv(f,g,w,C,T,H,K){var de;return f<100&&f>=0?(de=new Date(f+400,g,w,C,T,H,K),isFinite(de.getFullYear())&&de.setFullYear(f)):de=new Date(f,g,w,C,T,H,K),de}function Ks(f){var g,w;return f<100&&f>=0?(w=Array.prototype.slice.call(arguments),w[0]=f+400,g=new Date(Date.UTC.apply(null,w)),isFinite(g.getUTCFullYear())&&g.setUTCFullYear(f)):g=new Date(Date.UTC.apply(null,arguments)),g}function oa(f,g,w){var C=7+g-w,T=(7+Ks(f,0,C).getUTCDay()-g)%7;return-T+C-1}function Fl(f,g,w,C,T){var H=(7+w-C)%7,K=oa(f,C,T),de=1+7*(g-1)+H+K,Ie,ze;return de<=0?(Ie=f-1,ze=na(Ie)+de):de>na(f)?(Ie=f+1,ze=de-na(f)):(Ie=f,ze=de),{year:Ie,dayOfYear:ze}}function aa(f,g,w){var C=oa(f.year(),g,w),T=Math.floor((f.dayOfYear()-C-1)/7)+1,H,K;return T<1?(K=f.year()-1,H=T+Tn(K,g,w)):T>Tn(f.year(),g,w)?(H=T-Tn(f.year(),g,w),K=f.year()+1):(K=f.year(),H=T),{week:H,year:K}}function Tn(f,g,w){var C=oa(f,g,w),T=oa(f+1,g,w);return(na(f)-C+T)/7}he("w",["ww",2],"wo","week"),he("W",["WW",2],"Wo","isoWeek"),me("w",qe,ls),me("ww",qe,oe),me("W",qe,ls),me("WW",qe,oe),ra(["w","ww","W","WW"],function(f,g,w,C){g[C.substr(0,1)]=Ve(f)});function Qc(f){return aa(f,this._week.dow,this._week.doy).week}var Zc={dow:0,doy:6};function Qs(){return this._week.dow}function zp(){return this._week.doy}function Jp(f){var g=this.localeData().week(this);return f==null?g:this.add((f-g)*7,"d")}function Hv(f){var g=aa(this,1,4).week;return f==null?g:this.add((f-g)*7,"d")}he("d",0,"do","day"),he("dd",0,0,function(f){return this.localeData().weekdaysMin(this,f)}),he("ddd",0,0,function(f){return this.localeData().weekdaysShort(this,f)}),he("dddd",0,0,function(f){return this.localeData().weekdays(this,f)}),he("e",0,0,"weekday"),he("E",0,0,"isoWeekday"),me("d",qe),me("e",qe),me("E",qe),me("dd",function(f,g){return g.weekdaysMinRegex(f)}),me("ddd",function(f,g){return g.weekdaysShortRegex(f)}),me("dddd",function(f,g){return g.weekdaysRegex(f)}),ra(["dd","ddd","dddd"],function(f,g,w,C){var T=w._locale.weekdaysParse(f,C,w._strict);T!=null?g.d=T:q(w).invalidWeekday=f}),ra(["d","e","E"],function(f,g,w,C){g[C]=Ve(f)});function Gp(f,g){return typeof f!="string"?f:isNaN(f)?(f=g.weekdaysParse(f),typeof f=="number"?f:null):parseInt(f,10)}function Yp(f,g){return typeof f=="string"?g.weekdaysParse(f)%7||7:isNaN(f)?null:f}function Dl(f,g){return f.slice(g,7).concat(f.slice(0,g))}var Kp="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Qp="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Bv="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Vv=ta,Zp=ta,Wv=ta;function zv(f,g){var w=n(this._weekdays)?this._weekdays:this._weekdays[f&&f!==!0&&this._weekdays.isFormat.test(g)?"format":"standalone"];return f===!0?Dl(w,this._week.dow):f?w[f.day()]:w}function Jv(f){return f===!0?Dl(this._weekdaysShort,this._week.dow):f?this._weekdaysShort[f.day()]:this._weekdaysShort}function Gv(f){return f===!0?Dl(this._weekdaysMin,this._week.dow):f?this._weekdaysMin[f.day()]:this._weekdaysMin}function Xc(f,g,w){var C,T,H,K=f.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],C=0;C<7;++C)H=y([2e3,1]).day(C),this._minWeekdaysParse[C]=this.weekdaysMin(H,"").toLocaleLowerCase(),this._shortWeekdaysParse[C]=this.weekdaysShort(H,"").toLocaleLowerCase(),this._weekdaysParse[C]=this.weekdays(H,"").toLocaleLowerCase();return w?g==="dddd"?(T=Ut.call(this._weekdaysParse,K),T!==-1?T:null):g==="ddd"?(T=Ut.call(this._shortWeekdaysParse,K),T!==-1?T:null):(T=Ut.call(this._minWeekdaysParse,K),T!==-1?T:null):g==="dddd"?(T=Ut.call(this._weekdaysParse,K),T!==-1||(T=Ut.call(this._shortWeekdaysParse,K),T!==-1)?T:(T=Ut.call(this._minWeekdaysParse,K),T!==-1?T:null)):g==="ddd"?(T=Ut.call(this._shortWeekdaysParse,K),T!==-1||(T=Ut.call(this._weekdaysParse,K),T!==-1)?T:(T=Ut.call(this._minWeekdaysParse,K),T!==-1?T:null)):(T=Ut.call(this._minWeekdaysParse,K),T!==-1||(T=Ut.call(this._weekdaysParse,K),T!==-1)?T:(T=Ut.call(this._shortWeekdaysParse,K),T!==-1?T:null))}function Yv(f,g,w){var C,T,H;if(this._weekdaysParseExact)return Xc.call(this,f,g,w);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),C=0;C<7;C++){if(T=y([2e3,1]).day(C),w&&!this._fullWeekdaysParse[C]&&(this._fullWeekdaysParse[C]=new RegExp("^"+this.weekdays(T,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[C]=new RegExp("^"+this.weekdaysShort(T,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[C]=new RegExp("^"+this.weekdaysMin(T,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[C]||(H="^"+this.weekdays(T,"")+"|^"+this.weekdaysShort(T,"")+"|^"+this.weekdaysMin(T,""),this._weekdaysParse[C]=new RegExp(H.replace(".",""),"i")),w&&g==="dddd"&&this._fullWeekdaysParse[C].test(f))return C;if(w&&g==="ddd"&&this._shortWeekdaysParse[C].test(f))return C;if(w&&g==="dd"&&this._minWeekdaysParse[C].test(f))return C;if(!w&&this._weekdaysParse[C].test(f))return C}}function Kv(f){if(!this.isValid())return f!=null?this:NaN;var g=ia(this,"Day");return f!=null?(f=Gp(f,this.localeData()),this.add(f-g,"d")):g}function Qv(f){if(!this.isValid())return f!=null?this:NaN;var g=(this.day()+7-this.localeData()._week.dow)%7;return f==null?g:this.add(f-g,"d")}function Zv(f){if(!this.isValid())return f!=null?this:NaN;if(f!=null){var g=Yp(f,this.localeData());return this.day(this.day()%7?g:g-7)}else return this.day()||7}function Xv(f){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||ef.call(this),f?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=Vv),this._weekdaysStrictRegex&&f?this._weekdaysStrictRegex:this._weekdaysRegex)}function Pt(f){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||ef.call(this),f?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Zp),this._weekdaysShortStrictRegex&&f?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Et(f){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||ef.call(this),f?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Wv),this._weekdaysMinStrictRegex&&f?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function ef(){function f(tr,ii){return ii.length-tr.length}var g=[],w=[],C=[],T=[],H,K,de,Ie,ze;for(H=0;H<7;H++)K=y([2e3,1]).day(H),de=kn(this.weekdaysMin(K,"")),Ie=kn(this.weekdaysShort(K,"")),ze=kn(this.weekdays(K,"")),g.push(de),w.push(Ie),C.push(ze),T.push(de),T.push(Ie),T.push(ze);g.sort(f),w.sort(f),C.sort(f),T.sort(f),this._weekdaysRegex=new RegExp("^("+T.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+C.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+w.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+g.join("|")+")","i")}function tf(){return this.hours()%12||12}function eb(){return this.hours()||24}he("H",["HH",2],0,"hour"),he("h",["hh",2],0,tf),he("k",["kk",2],0,eb),he("hmm",0,0,function(){return""+tf.apply(this)+Re(this.minutes(),2)}),he("hmmss",0,0,function(){return""+tf.apply(this)+Re(this.minutes(),2)+Re(this.seconds(),2)}),he("Hmm",0,0,function(){return""+this.hours()+Re(this.minutes(),2)}),he("Hmmss",0,0,function(){return""+this.hours()+Re(this.minutes(),2)+Re(this.seconds(),2)});function Xp(f,g){he(f,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),g)})}Xp("a",!0),Xp("A",!1);function eh(f,g){return g._meridiemParse}me("a",eh),me("A",eh),me("H",qe,kl),me("h",qe,ls),me("k",qe,ls),me("HH",qe,oe),me("hh",qe,oe),me("kk",qe,oe),me("hmm",Pn),me("hmmss",Ol),me("Hmm",Pn),me("Hmmss",Ol),ft(["H","HH"],Kt),ft(["k","kk"],function(f,g,w){var C=Ve(f);g[Kt]=C===24?0:C}),ft(["a","A"],function(f,g,w){w._isPm=w._locale.isPM(f),w._meridiem=f}),ft(["h","hh"],function(f,g,w){g[Kt]=Ve(f),q(w).bigHour=!0}),ft("hmm",function(f,g,w){var C=f.length-2;g[Kt]=Ve(f.substr(0,C)),g[Kr]=Ve(f.substr(C)),q(w).bigHour=!0}),ft("hmmss",function(f,g,w){var C=f.length-4,T=f.length-2;g[Kt]=Ve(f.substr(0,C)),g[Kr]=Ve(f.substr(C,2)),g[Zn]=Ve(f.substr(T)),q(w).bigHour=!0}),ft("Hmm",function(f,g,w){var C=f.length-2;g[Kt]=Ve(f.substr(0,C)),g[Kr]=Ve(f.substr(C))}),ft("Hmmss",function(f,g,w){var C=f.length-4,T=f.length-2;g[Kt]=Ve(f.substr(0,C)),g[Kr]=Ve(f.substr(C,2)),g[Zn]=Ve(f.substr(T))});function tb(f){return(f+"").toLowerCase().charAt(0)==="p"}var th=/[ap]\.?m?\.?/i,rb=Ys("Hours",!0);function er(f,g,w){return f>11?w?"pm":"PM":w?"am":"AM"}var jl={calendar:fe,longDateFormat:wr,invalidDate:St,ordinal:Ws,dayOfMonthOrdinalParse:At,relativeTime:On,months:Hp,monthsShort:Jc,week:Zc,weekdays:Kp,weekdaysMin:Bv,weekdaysShort:Qp,meridiemParse:th},dt={},Zs={},cs;function Qr(f,g){var w,C=Math.min(f.length,g.length);for(w=0;w<C;w+=1)if(f[w]!==g[w])return w;return C}function rf(f){return f&&f.toLowerCase().replace("_","-")}function rh(f){for(var g=0,w,C,T,H;g<f.length;){for(H=rf(f[g]).split("-"),w=H.length,C=rf(f[g+1]),C=C?C.split("-"):null;w>0;){if(T=la(H.slice(0,w).join("-")),T)return T;if(C&&C.length>=w&&Qr(H,C)>=w-1)break;w--}g++}return cs}function nh(f){return!!(f&&f.match("^[^/\\\\]*$"))}function la(f){var g=null,w;if(dt[f]===void 0&&typeof qu<"u"&&qu&&qu.exports&&nh(f))try{g=cs._abbr,w=require,w("./locale/"+f),Xn(g)}catch{dt[f]=null}return dt[f]}function Xn(f,g){var w;return f&&(l(g)?w=ei(f):w=Ll(f,g),w?cs=w:typeof console<"u"&&console.warn&&console.warn("Locale "+f+" not found. Did you forget to load it?")),cs._abbr}function Ll(f,g){if(g!==null){var w,C=jl;if(g.abbr=f,dt[f]!=null)F("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),C=dt[f]._config;else if(g.parentLocale!=null)if(dt[g.parentLocale]!=null)C=dt[g.parentLocale]._config;else if(w=la(g.parentLocale),w!=null)C=w._config;else return Zs[g.parentLocale]||(Zs[g.parentLocale]=[]),Zs[g.parentLocale].push({name:f,config:g}),null;return dt[f]=new Q(J(C,g)),Zs[f]&&Zs[f].forEach(function(T){Ll(T.name,T.config)}),Xn(f),dt[f]}else return delete dt[f],null}function Nr(f,g){if(g!=null){var w,C,T=jl;dt[f]!=null&&dt[f].parentLocale!=null?dt[f].set(J(dt[f]._config,g)):(C=la(f),C!=null&&(T=C._config),g=J(T,g),C==null&&(g.abbr=f),w=new Q(g),w.parentLocale=dt[f],dt[f]=w),Xn(f)}else dt[f]!=null&&(dt[f].parentLocale!=null?(dt[f]=dt[f].parentLocale,f===Xn()&&Xn(f)):dt[f]!=null&&delete dt[f]);return dt[f]}function ei(f){var g;if(f&&f._locale&&f._locale._abbr&&(f=f._locale._abbr),!f)return cs;if(!n(f)){if(g=la(f),g)return g;f=[f]}return rh(f)}function Mr(){return se(dt)}function nf(f){var g,w=f._a;return w&&q(f).overflow===-2&&(g=w[Qn]<0||w[Qn]>11?Qn:w[An]<1||w[An]>zc(w[dr],w[Qn])?An:w[Kt]<0||w[Kt]>24||w[Kt]===24&&(w[Kr]!==0||w[Zn]!==0||w[us]!==0)?Kt:w[Kr]<0||w[Kr]>59?Kr:w[Zn]<0||w[Zn]>59?Zn:w[us]<0||w[us]>999?us:-1,q(f)._overflowDayOfYear&&(g<dr||g>An)&&(g=An),q(f)._overflowWeeks&&g===-1&&(g=Lp),q(f)._overflowWeekday&&g===-1&&(g=Av),q(f).overflow=g),f}var ih=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,$i=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ul=/Z|[+-]\d\d(?::?\d\d)?/,Xs=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],qt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Ni=/^\/?Date\((-?\d+)/i,sf=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,nb={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Hl(f){var g,w,C=f._i,T=ih.exec(C)||$i.exec(C),H,K,de,Ie,ze=Xs.length,tr=qt.length;if(T){for(q(f).iso=!0,g=0,w=ze;g<w;g++)if(Xs[g][1].exec(T[1])){K=Xs[g][0],H=Xs[g][2]!==!1;break}if(K==null){f._isValid=!1;return}if(T[3]){for(g=0,w=tr;g<w;g++)if(qt[g][1].exec(T[3])){de=(T[2]||" ")+qt[g][0];break}if(de==null){f._isValid=!1;return}}if(!H&&de!=null){f._isValid=!1;return}if(T[4])if(Ul.exec(T[4]))Ie="Z";else{f._isValid=!1;return}f._f=K+(de||"")+(Ie||""),Vl(f)}else f._isValid=!1}function ib(f,g,w,C,T,H){var K=[sb(f),Jc.indexOf(g),parseInt(w,10),parseInt(C,10),parseInt(T,10)];return H&&K.push(parseInt(H,10)),K}function sb(f){var g=parseInt(f,10);return g<=49?2e3+g:g<=999?1900+g:g}function ob(f){return f.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function sh(f,g,w){if(f){var C=Qp.indexOf(f),T=new Date(g[0],g[1],g[2]).getDay();if(C!==T)return q(w).weekdayMismatch=!0,w._isValid=!1,!1}return!0}function Bl(f,g,w){if(f)return nb[f];if(g)return 0;var C=parseInt(w,10),T=C%100,H=(C-T)/100;return H*60+T}function fs(f){var g=sf.exec(ob(f._i)),w;if(g){if(w=ib(g[4],g[3],g[2],g[5],g[6],g[7]),!sh(g[1],w,f))return;f._a=w,f._tzm=Bl(g[8],g[9],g[10]),f._d=Ks.apply(null,f._a),f._d.setUTCMinutes(f._d.getUTCMinutes()-f._tzm),q(f).rfc2822=!0}else f._isValid=!1}function ab(f){var g=Ni.exec(f._i);if(g!==null){f._d=new Date(+g[1]);return}if(Hl(f),f._isValid===!1)delete f._isValid;else return;if(fs(f),f._isValid===!1)delete f._isValid;else return;f._strict?f._isValid=!1:e.createFromInputFallback(f)}e.createFromInputFallback=R("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(f){f._d=new Date(f._i+(f._useUTC?" UTC":""))});function ds(f,g,w){return f??g??w}function oh(f){var g=new Date(e.now());return f._useUTC?[g.getUTCFullYear(),g.getUTCMonth(),g.getUTCDate()]:[g.getFullYear(),g.getMonth(),g.getDate()]}function ua(f){var g,w,C=[],T,H,K;if(!f._d){for(T=oh(f),f._w&&f._a[An]==null&&f._a[Qn]==null&&of(f),f._dayOfYear!=null&&(K=ds(f._a[dr],T[dr]),(f._dayOfYear>na(K)||f._dayOfYear===0)&&(q(f)._overflowDayOfYear=!0),w=Ks(K,0,f._dayOfYear),f._a[Qn]=w.getUTCMonth(),f._a[An]=w.getUTCDate()),g=0;g<3&&f._a[g]==null;++g)f._a[g]=C[g]=T[g];for(;g<7;g++)f._a[g]=C[g]=f._a[g]==null?g===2?1:0:f._a[g];f._a[Kt]===24&&f._a[Kr]===0&&f._a[Zn]===0&&f._a[us]===0&&(f._nextDay=!0,f._a[Kt]=0),f._d=(f._useUTC?Ks:Uv).apply(null,C),H=f._useUTC?f._d.getUTCDay():f._d.getDay(),f._tzm!=null&&f._d.setUTCMinutes(f._d.getUTCMinutes()-f._tzm),f._nextDay&&(f._a[Kt]=24),f._w&&typeof f._w.d<"u"&&f._w.d!==H&&(q(f).weekdayMismatch=!0)}}function of(f){var g,w,C,T,H,K,de,Ie,ze;g=f._w,g.GG!=null||g.W!=null||g.E!=null?(H=1,K=4,w=ds(g.GG,f._a[dr],aa(yt(),1,4).year),C=ds(g.W,1),T=ds(g.E,1),(T<1||T>7)&&(Ie=!0)):(H=f._locale._week.dow,K=f._locale._week.doy,ze=aa(yt(),H,K),w=ds(g.gg,f._a[dr],ze.year),C=ds(g.w,ze.week),g.d!=null?(T=g.d,(T<0||T>6)&&(Ie=!0)):g.e!=null?(T=g.e+H,(g.e<0||g.e>6)&&(Ie=!0)):T=H),C<1||C>Tn(w,H,K)?q(f)._overflowWeeks=!0:Ie!=null?q(f)._overflowWeekday=!0:(de=Fl(w,C,T,H,K),f._a[dr]=de.year,f._dayOfYear=de.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function Vl(f){if(f._f===e.ISO_8601){Hl(f);return}if(f._f===e.RFC_2822){fs(f);return}f._a=[],q(f).empty=!0;var g=""+f._i,w,C,T,H,K,de=g.length,Ie=0,ze,tr;for(T=$r(f._f,f._locale).match(ye)||[],tr=T.length,w=0;w<tr;w++)H=T[w],C=(g.match(Pv(H,f))||[])[0],C&&(K=g.substr(0,g.indexOf(C)),K.length>0&&q(f).unusedInput.push(K),g=g.slice(g.indexOf(C)+C.length),Ie+=C.length),Nt[H]?(C?q(f).empty=!1:q(f).unusedTokens.push(H),Wc(H,C,f)):f._strict&&!C&&q(f).unusedTokens.push(H);q(f).charsLeftOver=de-Ie,g.length>0&&q(f).unusedInput.push(g),f._a[Kt]<=12&&q(f).bigHour===!0&&f._a[Kt]>0&&(q(f).bigHour=void 0),q(f).parsedDateParts=f._a.slice(0),q(f).meridiem=f._meridiem,f._a[Kt]=lb(f._locale,f._a[Kt],f._meridiem),ze=q(f).era,ze!==null&&(f._a[dr]=f._locale.erasConvertYear(ze,f._a[dr])),ua(f),nf(f)}function lb(f,g,w){var C;return w==null?g:f.meridiemHour!=null?f.meridiemHour(g,w):(f.isPM!=null&&(C=f.isPM(w),C&&g<12&&(g+=12),!C&&g===12&&(g=0)),g)}function af(f){var g,w,C,T,H,K,de=!1,Ie=f._f.length;if(Ie===0){q(f).invalidFormat=!0,f._d=new Date(NaN);return}for(T=0;T<Ie;T++)H=0,K=!1,g=P({},f),f._useUTC!=null&&(g._useUTC=f._useUTC),g._f=f._f[T],Vl(g),v(g)&&(K=!0),H+=q(g).charsLeftOver,H+=q(g).unusedTokens.length*10,q(g).score=H,de?H<C&&(C=H,w=g):(C==null||H<C||K)&&(C=H,w=g,K&&(de=!0));m(f,w||g)}function lf(f){if(!f._d){var g=we(f._i),w=g.day===void 0?g.date:g.day;f._a=p([g.year,g.month,w,g.hour,g.minute,g.second,g.millisecond],function(C){return C&&parseInt(C,10)}),ua(f)}}function ub(f){var g=new M(nf(uf(f)));return g._nextDay&&(g.add(1,"d"),g._nextDay=void 0),g}function uf(f){var g=f._i,w=f._f;return f._locale=f._locale||ei(f._l),g===null||w===void 0&&g===""?_({nullInput:!0}):(typeof g=="string"&&(f._i=g=f._locale.preparse(g)),j(g)?new M(nf(g)):(d(g)?f._d=g:n(w)?af(f):w?Vl(f):Fr(f),v(f)||(f._d=null),f))}function Fr(f){var g=f._i;l(g)?f._d=new Date(e.now()):d(g)?f._d=new Date(g.valueOf()):typeof g=="string"?ab(f):n(g)?(f._a=p(g.slice(0),function(w){return parseInt(w,10)}),ua(f)):i(g)?lf(f):c(g)?f._d=new Date(g):e.createFromInputFallback(f)}function Wl(f,g,w,C,T){var H={};return(g===!0||g===!1)&&(C=g,g=void 0),(w===!0||w===!1)&&(C=w,w=void 0),(i(f)&&o(f)||n(f)&&f.length===0)&&(f=void 0),H._isAMomentObject=!0,H._useUTC=H._isUTC=T,H._l=w,H._i=f,H._f=g,H._strict=C,ub(H)}function yt(f,g,w,C){return Wl(f,g,w,C,!1)}var ah=R("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var f=yt.apply(null,arguments);return this.isValid()&&f.isValid()?f<this?this:f:_()}),lh=R("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var f=yt.apply(null,arguments);return this.isValid()&&f.isValid()?f>this?this:f:_()});function uh(f,g){var w,C;if(g.length===1&&n(g[0])&&(g=g[0]),!g.length)return yt();for(w=g[0],C=1;C<g.length;++C)(!g[C].isValid()||g[C][f](w))&&(w=g[C]);return w}function cb(){var f=[].slice.call(arguments,0);return uh("isBefore",f)}function fb(){var f=[].slice.call(arguments,0);return uh("isAfter",f)}var db=function(){return Date.now?Date.now():+new Date},ca=["year","quarter","month","week","day","hour","minute","second","millisecond"];function eo(f){var g,w=!1,C,T=ca.length;for(g in f)if(s(f,g)&&!(Ut.call(ca,g)!==-1&&(f[g]==null||!isNaN(f[g]))))return!1;for(C=0;C<T;++C)if(f[ca[C]]){if(w)return!1;parseFloat(f[ca[C]])!==Ve(f[ca[C]])&&(w=!0)}return!0}function pb(){return this._isValid}function hb(){return vt(NaN)}function to(f){var g=we(f),w=g.year||0,C=g.quarter||0,T=g.month||0,H=g.week||g.isoWeek||0,K=g.day||0,de=g.hour||0,Ie=g.minute||0,ze=g.second||0,tr=g.millisecond||0;this._isValid=eo(g),this._milliseconds=+tr+ze*1e3+Ie*6e4+de*1e3*60*60,this._days=+K+H*7,this._months=+T+C*3+w*12,this._data={},this._locale=ei(),this._bubble()}function fa(f){return f instanceof to}function $n(f){return f<0?Math.round(-1*f)*-1:Math.round(f)}function zl(f,g,w){var C=Math.min(f.length,g.length),T=Math.abs(f.length-g.length),H=0,K;for(K=0;K<C;K++)(w&&f[K]!==g[K]||!w&&Ve(f[K])!==Ve(g[K]))&&H++;return H+T}function ch(f,g){he(f,0,0,function(){var w=this.utcOffset(),C="+";return w<0&&(w=-w,C="-"),C+Re(~~(w/60),2)+g+Re(~~w%60,2)})}ch("Z",":"),ch("ZZ",""),me("Z",Pl),me("ZZ",Pl),ft(["Z","ZZ"],function(f,g,w){w._useUTC=!0,w._tzm=cf(Pl,f)});var mb=/([\+\-]|\d\d)/gi;function cf(f,g){var w=(g||"").match(f),C,T,H;return w===null?null:(C=w[w.length-1]||[],T=(C+"").match(mb)||["-",0,0],H=+(T[1]*60)+Ve(T[2]),H===0?0:T[0]==="+"?H:-H)}function Mi(f,g){var w,C;return g._isUTC?(w=g.clone(),C=(j(f)||d(f)?f.valueOf():yt(f).valueOf())-w.valueOf(),w._d.setTime(w._d.valueOf()+C),e.updateOffset(w,!1),w):yt(f).local()}function Dr(f){return-Math.round(f._d.getTimezoneOffset())}e.updateOffset=function(){};function fh(f,g,w){var C=this._offset||0,T;if(!this.isValid())return f!=null?this:NaN;if(f!=null){if(typeof f=="string"){if(f=cf(Pl,f),f===null)return this}else Math.abs(f)<16&&!w&&(f=f*60);return!this._isUTC&&g&&(T=Dr(this)),this._offset=f,this._isUTC=!0,T!=null&&this.add(T,"m"),C!==f&&(!g||this._changeInProgress?da(this,vt(f-C,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?C:Dr(this)}function gb(f,g){return f!=null?(typeof f!="string"&&(f=-f),this.utcOffset(f,g),this):-this.utcOffset()}function yb(f){return this.utcOffset(0,f)}function vb(f){return this._isUTC&&(this.utcOffset(0,f),this._isUTC=!1,f&&this.subtract(Dr(this),"m")),this}function bb(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var f=cf(Bc,this._i);f!=null?this.utcOffset(f):this.utcOffset(0,!0)}return this}function Sb(f){return this.isValid()?(f=f?yt(f).utcOffset():0,(this.utcOffset()-f)%60===0):!1}function Fi(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function W(){if(!l(this._isDSTShifted))return this._isDSTShifted;var f={},g;return P(f,this),f=uf(f),f._a?(g=f._isUTC?y(f._a):yt(f._a),this._isDSTShifted=this.isValid()&&zl(f._a,g.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Z(){return this.isValid()?!this._isUTC:!1}function Y(){return this.isValid()?this._isUTC:!1}function pe(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Oe=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,ut=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function vt(f,g){var w=f,C=null,T,H,K;return fa(f)?w={ms:f._milliseconds,d:f._days,M:f._months}:c(f)||!isNaN(+f)?(w={},g?w[g]=+f:w.milliseconds=+f):(C=Oe.exec(f))?(T=C[1]==="-"?-1:1,w={y:0,d:Ve(C[An])*T,h:Ve(C[Kt])*T,m:Ve(C[Kr])*T,s:Ve(C[Zn])*T,ms:Ve($n(C[us]*1e3))*T}):(C=ut.exec(f))?(T=C[1]==="-"?-1:1,w={y:Xe(C[2],T),M:Xe(C[3],T),w:Xe(C[4],T),d:Xe(C[5],T),h:Xe(C[6],T),m:Xe(C[7],T),s:Xe(C[8],T)}):w==null?w={}:typeof w=="object"&&("from"in w||"to"in w)&&(K=wb(yt(w.from),yt(w.to)),w={},w.ms=K.milliseconds,w.M=K.months),H=new to(w),fa(f)&&s(f,"_locale")&&(H._locale=f._locale),fa(f)&&s(f,"_isValid")&&(H._isValid=f._isValid),H}vt.fn=to.prototype,vt.invalid=hb;function Xe(f,g){var w=f&&parseFloat(f.replace(",","."));return(isNaN(w)?0:w)*g}function Jl(f,g){var w={};return w.months=g.month()-f.month()+(g.year()-f.year())*12,f.clone().add(w.months,"M").isAfter(g)&&--w.months,w.milliseconds=+g-+f.clone().add(w.months,"M"),w}function wb(f,g){var w;return f.isValid()&&g.isValid()?(g=Mi(g,f),f.isBefore(g)?w=Jl(f,g):(w=Jl(g,f),w.milliseconds=-w.milliseconds,w.months=-w.months),w):{milliseconds:0,months:0}}function jr(f,g){return function(w,C){var T,H;return C!==null&&!isNaN(+C)&&(F(g,"moment()."+g+"(period, number) is deprecated. Please use moment()."+g+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),H=w,w=C,C=H),T=vt(w,C),da(this,T,f),this}}function da(f,g,w,C){var T=g._milliseconds,H=$n(g._days),K=$n(g._months);f.isValid()&&(C=C??!0,K&&Yc(f,ia(f,"Month")+K*w),H&&sa(f,"Date",ia(f,"Date")+H*w),T&&f._d.setTime(f._d.valueOf()+T*w),C&&e.updateOffset(f,H||K))}var _b=jr(1,"add"),ro=jr(-1,"subtract");function pa(f){return typeof f=="string"||f instanceof String}function Gl(f){return j(f)||d(f)||pa(f)||c(f)||Rb(f)||pt(f)||f===null||f===void 0}function pt(f){var g=i(f)&&!o(f),w=!1,C=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],T,H,K=C.length;for(T=0;T<K;T+=1)H=C[T],w=w||s(f,H);return g&&w}function Rb(f){var g=n(f),w=!1;return g&&(w=f.filter(function(C){return!c(C)&&pa(f)}).length===0),g&&w}function dh(f){var g=i(f)&&!o(f),w=!1,C=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],T,H;for(T=0;T<C.length;T+=1)H=C[T],w=w||s(f,H);return g&&w}function Yl(f,g){var w=f.diff(g,"days",!0);return w<-6?"sameElse":w<-1?"lastWeek":w<0?"lastDay":w<1?"sameDay":w<2?"nextDay":w<7?"nextWeek":"sameElse"}function xb(f,g){arguments.length===1&&(arguments[0]?Gl(arguments[0])?(f=arguments[0],g=void 0):dh(arguments[0])&&(g=arguments[0],f=void 0):(f=void 0,g=void 0));var w=f||yt(),C=Mi(w,this).startOf("day"),T=e.calendarFormat(this,C)||"sameElse",H=g&&(U(g[T])?g[T].call(this,w):g[T]);return this.format(H||this.localeData().calendar(T,this,yt(w)))}function Cb(){return new M(this)}function Eb(f,g){var w=j(f)?f:yt(f);return this.isValid()&&w.isValid()?(g=ge(g)||"millisecond",g==="millisecond"?this.valueOf()>w.valueOf():w.valueOf()<this.clone().startOf(g).valueOf()):!1}function Kl(f,g){var w=j(f)?f:yt(f);return this.isValid()&&w.isValid()?(g=ge(g)||"millisecond",g==="millisecond"?this.valueOf()<w.valueOf():this.clone().endOf(g).valueOf()<w.valueOf()):!1}function Di(f,g,w,C){var T=j(f)?f:yt(f),H=j(g)?g:yt(g);return this.isValid()&&T.isValid()&&H.isValid()?(C=C||"()",(C[0]==="("?this.isAfter(T,w):!this.isBefore(T,w))&&(C[1]===")"?this.isBefore(H,w):!this.isAfter(H,w))):!1}function Ql(f,g){var w=j(f)?f:yt(f),C;return this.isValid()&&w.isValid()?(g=ge(g)||"millisecond",g==="millisecond"?this.valueOf()===w.valueOf():(C=w.valueOf(),this.clone().startOf(g).valueOf()<=C&&C<=this.clone().endOf(g).valueOf())):!1}function ph(f,g){return this.isSame(f,g)||this.isAfter(f,g)}function Zl(f,g){return this.isSame(f,g)||this.isBefore(f,g)}function hh(f,g,w){var C,T,H;if(!this.isValid())return NaN;if(C=Mi(f,this),!C.isValid())return NaN;switch(T=(C.utcOffset()-this.utcOffset())*6e4,g=ge(g),g){case"year":H=ha(this,C)/12;break;case"month":H=ha(this,C);break;case"quarter":H=ha(this,C)/3;break;case"second":H=(this-C)/1e3;break;case"minute":H=(this-C)/6e4;break;case"hour":H=(this-C)/36e5;break;case"day":H=(this-C-T)/864e5;break;case"week":H=(this-C-T)/6048e5;break;default:H=this-C}return w?H:Yr(H)}function ha(f,g){if(f.date()<g.date())return-ha(g,f);var w=(g.year()-f.year())*12+(g.month()-f.month()),C=f.clone().add(w,"months"),T,H;return g-C<0?(T=f.clone().add(w-1,"months"),H=(g-C)/(C-T)):(T=f.clone().add(w+1,"months"),H=(g-C)/(T-C)),-(w+H)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Xl(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function mh(f){if(!this.isValid())return null;var g=f!==!0,w=g?this.clone().utc():this;return w.year()<0||w.year()>9999?lt(w,g?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):U(Date.prototype.toISOString)?g?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",lt(w,"Z")):lt(w,g?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function ma(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var f="moment",g="",w,C,T,H;return this.isLocal()||(f=this.utcOffset()===0?"moment.utc":"moment.parseZone",g="Z"),w="["+f+'("]',C=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",T="-MM-DD[T]HH:mm:ss.SSS",H=g+'[")]',this.format(w+C+T+H)}function ps(f){f||(f=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var g=lt(this,f);return this.localeData().postformat(g)}function eu(f,g){return this.isValid()&&(j(f)&&f.isValid()||yt(f).isValid())?vt({to:this,from:f}).locale(this.locale()).humanize(!g):this.localeData().invalidDate()}function qb(f){return this.from(yt(),f)}function Ib(f,g){return this.isValid()&&(j(f)&&f.isValid()||yt(f).isValid())?vt({from:this,to:f}).locale(this.locale()).humanize(!g):this.localeData().invalidDate()}function Ob(f){return this.to(yt(),f)}function ga(f){var g;return f===void 0?this._locale._abbr:(g=ei(f),g!=null&&(this._locale=g),this)}var ya=R("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(f){return f===void 0?this.localeData():this.locale(f)});function tu(){return this._locale}var ru=1e3,hs=60*ru,nu=60*hs,gh=(365*400+97)*24*nu;function Tt(f,g){return(f%g+g)%g}function ar(f,g,w){return f<100&&f>=0?new Date(f+400,g,w)-gh:new Date(f,g,w).valueOf()}function yh(f,g,w){return f<100&&f>=0?Date.UTC(f+400,g,w)-gh:Date.UTC(f,g,w)}function Pb(f){var g,w;if(f=ge(f),f===void 0||f==="millisecond"||!this.isValid())return this;switch(w=this._isUTC?yh:ar,f){case"year":g=w(this.year(),0,1);break;case"quarter":g=w(this.year(),this.month()-this.month()%3,1);break;case"month":g=w(this.year(),this.month(),1);break;case"week":g=w(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":g=w(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":g=w(this.year(),this.month(),this.date());break;case"hour":g=this._d.valueOf(),g-=Tt(g+(this._isUTC?0:this.utcOffset()*hs),nu);break;case"minute":g=this._d.valueOf(),g-=Tt(g,hs);break;case"second":g=this._d.valueOf(),g-=Tt(g,ru);break}return this._d.setTime(g),e.updateOffset(this,!0),this}function vh(f){var g,w;if(f=ge(f),f===void 0||f==="millisecond"||!this.isValid())return this;switch(w=this._isUTC?yh:ar,f){case"year":g=w(this.year()+1,0,1)-1;break;case"quarter":g=w(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":g=w(this.year(),this.month()+1,1)-1;break;case"week":g=w(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":g=w(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":g=w(this.year(),this.month(),this.date()+1)-1;break;case"hour":g=this._d.valueOf(),g+=nu-Tt(g+(this._isUTC?0:this.utcOffset()*hs),nu)-1;break;case"minute":g=this._d.valueOf(),g+=hs-Tt(g,hs)-1;break;case"second":g=this._d.valueOf(),g+=ru-Tt(g,ru)-1;break}return this._d.setTime(g),e.updateOffset(this,!0),this}function kb(){return this._d.valueOf()-(this._offset||0)*6e4}function ff(){return Math.floor(this.valueOf()/1e3)}function va(){return new Date(this.valueOf())}function df(){var f=this;return[f.year(),f.month(),f.date(),f.hour(),f.minute(),f.second(),f.millisecond()]}function no(){var f=this;return{years:f.year(),months:f.month(),date:f.date(),hours:f.hours(),minutes:f.minutes(),seconds:f.seconds(),milliseconds:f.milliseconds()}}function ba(){return this.isValid()?this.toISOString():null}function Sa(){return v(this)}function iu(){return m({},q(this))}function io(){return q(this).overflow}function Ab(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}he("N",0,0,"eraAbbr"),he("NN",0,0,"eraAbbr"),he("NNN",0,0,"eraAbbr"),he("NNNN",0,0,"eraName"),he("NNNNN",0,0,"eraNarrow"),he("y",["y",1],"yo","eraYear"),he("y",["yy",2],0,"eraYear"),he("y",["yyy",3],0,"eraYear"),he("y",["yyyy",4],0,"eraYear"),me("N",_r),me("NN",_r),me("NNN",_r),me("NNNN",We),me("NNNNN",Fb),ft(["N","NN","NNN","NNNN","NNNNN"],function(f,g,w,C){var T=w._locale.erasParse(f,C,w._strict);T?q(w).era=T:q(w).invalidEra=f}),me("y",Ti),me("yy",Ti),me("yyy",Ti),me("yyyy",Ti),me("yo",Db),ft(["y","yy","yyy","yyyy"],dr),ft(["yo"],function(f,g,w,C){var T;w._locale._eraYearOrdinalRegex&&(T=f.match(w._locale._eraYearOrdinalRegex)),w._locale.eraYearOrdinalParse?g[dr]=w._locale.eraYearOrdinalParse(f,T):g[dr]=parseInt(f,10)});function Tb(f,g){var w,C,T,H=this._eras||ei("en")._eras;for(w=0,C=H.length;w<C;++w)switch(typeof H[w].since==="string"&&(T=e(H[w].since).startOf("day"),H[w].since=T.valueOf()),typeof H[w].until){case"undefined":H[w].until=1/0;break;case"string":T=e(H[w].until).startOf("day").valueOf(),H[w].until=T.valueOf();break}return H}function $b(f,g,w){var C,T,H=this.eras(),K,de,Ie;for(f=f.toUpperCase(),C=0,T=H.length;C<T;++C)if(K=H[C].name.toUpperCase(),de=H[C].abbr.toUpperCase(),Ie=H[C].narrow.toUpperCase(),w)switch(g){case"N":case"NN":case"NNN":if(de===f)return H[C];break;case"NNNN":if(K===f)return H[C];break;case"NNNNN":if(Ie===f)return H[C];break}else if([K,de,Ie].indexOf(f)>=0)return H[C]}function Nb(f,g){var w=f.since<=f.until?1:-1;return g===void 0?e(f.since).year():e(f.since).year()+(g-f.offset)*w}function Mb(){var f,g,w,C=this.localeData().eras();for(f=0,g=C.length;f<g;++f)if(w=this.clone().startOf("day").valueOf(),C[f].since<=w&&w<=C[f].until||C[f].until<=w&&w<=C[f].since)return C[f].name;return""}function su(){var f,g,w,C=this.localeData().eras();for(f=0,g=C.length;f<g;++f)if(w=this.clone().startOf("day").valueOf(),C[f].since<=w&&w<=C[f].until||C[f].until<=w&&w<=C[f].since)return C[f].narrow;return""}function wa(){var f,g,w,C=this.localeData().eras();for(f=0,g=C.length;f<g;++f)if(w=this.clone().startOf("day").valueOf(),C[f].since<=w&&w<=C[f].until||C[f].until<=w&&w<=C[f].since)return C[f].abbr;return""}function bh(){var f,g,w,C,T=this.localeData().eras();for(f=0,g=T.length;f<g;++f)if(w=T[f].since<=T[f].until?1:-1,C=this.clone().startOf("day").valueOf(),T[f].since<=C&&C<=T[f].until||T[f].until<=C&&C<=T[f].since)return(this.year()-e(T[f].since).year())*w+T[f].offset;return this.year()}function $(f){return s(this,"_erasNameRegex")||pf.call(this),f?this._erasNameRegex:this._erasRegex}function so(f){return s(this,"_erasAbbrRegex")||pf.call(this),f?this._erasAbbrRegex:this._erasRegex}function ou(f){return s(this,"_erasNarrowRegex")||pf.call(this),f?this._erasNarrowRegex:this._erasRegex}function _r(f,g){return g.erasAbbrRegex(f)}function We(f,g){return g.erasNameRegex(f)}function Fb(f,g){return g.erasNarrowRegex(f)}function Db(f,g){return g._eraYearOrdinalRegex||Ti}function pf(){var f=[],g=[],w=[],C=[],T,H,K,de,Ie,ze=this.eras();for(T=0,H=ze.length;T<H;++T)K=kn(ze[T].name),de=kn(ze[T].abbr),Ie=kn(ze[T].narrow),g.push(K),f.push(de),w.push(Ie),C.push(K),C.push(de),C.push(Ie);this._erasRegex=new RegExp("^("+C.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+g.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+f.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+w.join("|")+")","i")}he(0,["gg",2],0,function(){return this.weekYear()%100}),he(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Nn(f,g){he(0,[f,f.length],0,g)}Nn("gggg","weekYear"),Nn("ggggg","weekYear"),Nn("GGGG","isoWeekYear"),Nn("GGGGG","isoWeekYear"),me("G",Gs),me("g",Gs),me("GG",qe,oe),me("gg",qe,oe),me("GGGG",ea,Lt),me("gggg",ea,Lt),me("GGGGG",Js,gt),me("ggggg",Js,gt),ra(["gggg","ggggg","GGGG","GGGGG"],function(f,g,w,C){g[C.substr(0,2)]=Ve(f)}),ra(["gg","GG"],function(f,g,w,C){g[C]=e.parseTwoDigitYear(f)});function jb(f){return Sh.call(this,f,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Lb(f){return Sh.call(this,f,this.isoWeek(),this.isoWeekday(),1,4)}function Ub(){return Tn(this.year(),1,4)}function Hb(){return Tn(this.isoWeekYear(),1,4)}function Bb(){var f=this.localeData()._week;return Tn(this.year(),f.dow,f.doy)}function ti(){var f=this.localeData()._week;return Tn(this.weekYear(),f.dow,f.doy)}function Sh(f,g,w,C,T){var H;return f==null?aa(this,C,T).year:(H=Tn(f,C,T),g>H&&(g=H),Vb.call(this,f,g,w,C,T))}function Vb(f,g,w,C,T){var H=Fl(f,g,w,C,T),K=Ks(H.year,0,H.dayOfYear);return this.year(K.getUTCFullYear()),this.month(K.getUTCMonth()),this.date(K.getUTCDate()),this}he("Q",0,"Qo","quarter"),me("Q",or),ft("Q",function(f,g){g[Qn]=(Ve(f)-1)*3});function Wb(f){return f==null?Math.ceil((this.month()+1)/3):this.month((f-1)*3+this.month()%3)}he("D",["DD",2],"Do","date"),me("D",qe,ls),me("DD",qe,oe),me("Do",function(f,g){return f?g._dayOfMonthOrdinalParse||g._ordinalParse:g._dayOfMonthOrdinalParseLenient}),ft(["D","DD"],An),ft("Do",function(f,g){g[An]=Ve(f.match(qe)[0])});var wh=Ys("Date",!0);he("DDD",["DDDD",3],"DDDo","dayOfYear"),me("DDD",zs),me("DDDD",fr),ft(["DDD","DDDD"],function(f,g,w){w._dayOfYear=Ve(f)});function zb(f){var g=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return f==null?g:this.add(f-g,"d")}he("m",["mm",2],0,"minute"),me("m",qe,kl),me("mm",qe,oe),ft(["m","mm"],Kr);var ri=Ys("Minutes",!1);he("s",["ss",2],0,"second"),me("s",qe,kl),me("ss",qe,oe),ft(["s","ss"],Zn);var Jb=Ys("Seconds",!1);he("S",0,0,function(){return~~(this.millisecond()/100)}),he(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),he(0,["SSS",3],0,"millisecond"),he(0,["SSSS",4],0,function(){return this.millisecond()*10}),he(0,["SSSSS",5],0,function(){return this.millisecond()*100}),he(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),he(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),he(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),he(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),me("S",zs,or),me("SS",zs,oe),me("SSS",zs,fr);var ji,_h;for(ji="SSSS";ji.length<=9;ji+="S")me(ji,Ti);function Gb(f,g){g[us]=Ve(("0."+f)*1e3)}for(ji="S";ji.length<=9;ji+="S")ft(ji,Gb);_h=Ys("Milliseconds",!1),he("z",0,0,"zoneAbbr"),he("zz",0,0,"zoneName");function Yb(){return this._isUTC?"UTC":""}function ms(){return this._isUTC?"Coordinated Universal Time":""}var ie=M.prototype;ie.add=_b,ie.calendar=xb,ie.clone=Cb,ie.diff=hh,ie.endOf=vh,ie.format=ps,ie.from=eu,ie.fromNow=qb,ie.to=Ib,ie.toNow=Ob,ie.get=$v,ie.invalidAt=io,ie.isAfter=Eb,ie.isBefore=Kl,ie.isBetween=Di,ie.isSame=Ql,ie.isSameOrAfter=ph,ie.isSameOrBefore=Zl,ie.isValid=Sa,ie.lang=ya,ie.locale=ga,ie.localeData=tu,ie.max=lh,ie.min=ah,ie.parsingFlags=iu,ie.set=$l,ie.startOf=Pb,ie.subtract=ro,ie.toArray=df,ie.toObject=no,ie.toDate=va,ie.toISOString=mh,ie.inspect=ma,typeof Symbol<"u"&&Symbol.for!=null&&(ie[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),ie.toJSON=ba,ie.toString=Xl,ie.unix=ff,ie.valueOf=kb,ie.creationData=Ab,ie.eraName=Mb,ie.eraNarrow=su,ie.eraAbbr=wa,ie.eraYear=bh,ie.year=Up,ie.isLeapYear=Tv,ie.weekYear=jb,ie.isoWeekYear=Lb,ie.quarter=ie.quarters=Wb,ie.month=Nl,ie.daysInMonth=Lv,ie.week=ie.weeks=Jp,ie.isoWeek=ie.isoWeeks=Hv,ie.weeksInYear=Bb,ie.weeksInWeekYear=ti,ie.isoWeeksInYear=Ub,ie.isoWeeksInISOWeekYear=Hb,ie.date=wh,ie.day=ie.days=Kv,ie.weekday=Qv,ie.isoWeekday=Zv,ie.dayOfYear=zb,ie.hour=ie.hours=rb,ie.minute=ie.minutes=ri,ie.second=ie.seconds=Jb,ie.millisecond=ie.milliseconds=_h,ie.utcOffset=fh,ie.utc=yb,ie.local=vb,ie.parseZone=bb,ie.hasAlignedHourOffset=Sb,ie.isDST=Fi,ie.isLocal=Z,ie.isUtcOffset=Y,ie.isUtc=pe,ie.isUTC=pe,ie.zoneAbbr=Yb,ie.zoneName=ms,ie.dates=R("dates accessor is deprecated. Use date instead.",wh),ie.months=R("months accessor is deprecated. Use month instead",Nl),ie.years=R("years accessor is deprecated. Use year instead",Up),ie.zone=R("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",gb),ie.isDSTShifted=R("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",W);function Kb(f){return yt(f*1e3)}function mn(){return yt.apply(null,arguments).parseZone()}function Rh(f){return f}var nt=Q.prototype;nt.calendar=Be,nt.longDateFormat=xt,nt.invalidDate=Gr,nt.ordinal=Ai,nt.preparse=Rh,nt.postformat=Rh,nt.relativeTime=te,nt.pastFuture=re,nt.set=D,nt.eras=Tb,nt.erasParse=$b,nt.erasConvertYear=Nb,nt.erasAbbrRegex=so,nt.erasNameRegex=$,nt.erasNarrowRegex=ou,nt.months=Dv,nt.monthsShort=jv,nt.monthsParse=Vp,nt.monthsRegex=Ml,nt.monthsShortRegex=Wp,nt.week=Qc,nt.firstDayOfYear=zp,nt.firstDayOfWeek=Qs,nt.weekdays=zv,nt.weekdaysMin=Gv,nt.weekdaysShort=Jv,nt.weekdaysParse=Yv,nt.weekdaysRegex=Xv,nt.weekdaysShortRegex=Pt,nt.weekdaysMinRegex=Et,nt.isPM=tb,nt.meridiem=er;function au(f,g,w,C){var T=ei(),H=y().set(C,g);return T[w](H,f)}function xh(f,g,w){if(c(f)&&(g=f,f=void 0),f=f||"",g!=null)return au(f,g,w,"month");var C,T=[];for(C=0;C<12;C++)T[C]=au(f,C,w,"month");return T}function hf(f,g,w,C){typeof f=="boolean"?(c(g)&&(w=g,g=void 0),g=g||""):(g=f,w=g,f=!1,c(g)&&(w=g,g=void 0),g=g||"");var T=ei(),H=f?T._week.dow:0,K,de=[];if(w!=null)return au(g,(w+H)%7,C,"day");for(K=0;K<7;K++)de[K]=au(g,(K+H)%7,C,"day");return de}function Ch(f,g){return xh(f,g,"months")}function Eh(f,g){return xh(f,g,"monthsShort")}function Qb(f,g,w){return hf(f,g,w,"weekdays")}function Zb(f,g,w){return hf(f,g,w,"weekdaysShort")}function mf(f,g,w){return hf(f,g,w,"weekdaysMin")}Xn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(f){var g=f%10,w=Ve(f%100/10)===1?"th":g===1?"st":g===2?"nd":g===3?"rd":"th";return f+w}}),e.lang=R("moment.lang is deprecated. Use moment.locale instead.",Xn),e.langData=R("moment.langData is deprecated. Use moment.localeData instead.",ei);var Lr=Math.abs;function lu(){var f=this._data;return this._milliseconds=Lr(this._milliseconds),this._days=Lr(this._days),this._months=Lr(this._months),f.milliseconds=Lr(f.milliseconds),f.seconds=Lr(f.seconds),f.minutes=Lr(f.minutes),f.hours=Lr(f.hours),f.months=Lr(f.months),f.years=Lr(f.years),this}function qh(f,g,w,C){var T=vt(g,w);return f._milliseconds+=C*T._milliseconds,f._days+=C*T._days,f._months+=C*T._months,f._bubble()}function Ih(f,g){return qh(this,f,g,1)}function Xb(f,g){return qh(this,f,g,-1)}function gn(f){return f<0?Math.floor(f):Math.ceil(f)}function gf(){var f=this._milliseconds,g=this._days,w=this._months,C=this._data,T,H,K,de,Ie;return f>=0&&g>=0&&w>=0||f<=0&&g<=0&&w<=0||(f+=gn(Rr(w)+g)*864e5,g=0,w=0),C.milliseconds=f%1e3,T=Yr(f/1e3),C.seconds=T%60,H=Yr(T/60),C.minutes=H%60,K=Yr(H/60),C.hours=K%24,g+=Yr(K/24),Ie=Yr(Li(g)),w+=Ie,g-=gn(Rr(Ie)),de=Yr(w/12),w%=12,C.days=g,C.months=w,C.years=de,this}function Li(f){return f*4800/146097}function Rr(f){return f*146097/4800}function eS(f){if(!this.isValid())return NaN;var g,w,C=this._milliseconds;if(f=ge(f),f==="month"||f==="quarter"||f==="year")switch(g=this._days+C/864e5,w=this._months+Li(g),f){case"month":return w;case"quarter":return w/3;case"year":return w/12}else switch(g=this._days+Math.round(Rr(this._months)),f){case"week":return g/7+C/6048e5;case"day":return g+C/864e5;case"hour":return g*24+C/36e5;case"minute":return g*1440+C/6e4;case"second":return g*86400+C/1e3;case"millisecond":return Math.floor(g*864e5)+C;default:throw new Error("Unknown unit "+f)}}function Mn(f){return function(){return this.as(f)}}var yf=Mn("ms"),_a=Mn("s"),Ui=Mn("m"),Oh=Mn("h"),tS=Mn("d"),uu=Mn("w"),rS=Mn("M"),Ph=Mn("Q"),lr=Mn("y"),vf=yf;function kh(){return vt(this)}function Fn(f){return f=ge(f),this.isValid()?this[f+"s"]():NaN}function ni(f){return function(){return this.isValid()?this._data[f]:NaN}}var cu=ni("milliseconds"),gs=ni("seconds"),Ah=ni("minutes"),mr=ni("hours"),bf=ni("days"),nS=ni("months"),iS=ni("years");function sS(){return Yr(this.days()/7)}var yn=Math.round,oo={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Ra(f,g,w,C,T){return T.relativeTime(g||1,!!w,f,C)}function Th(f,g,w,C){var T=vt(f).abs(),H=yn(T.as("s")),K=yn(T.as("m")),de=yn(T.as("h")),Ie=yn(T.as("d")),ze=yn(T.as("M")),tr=yn(T.as("w")),ii=yn(T.as("y")),si=H<=w.ss&&["s",H]||H<w.s&&["ss",H]||K<=1&&["m"]||K<w.m&&["mm",K]||de<=1&&["h"]||de<w.h&&["hh",de]||Ie<=1&&["d"]||Ie<w.d&&["dd",Ie];return w.w!=null&&(si=si||tr<=1&&["w"]||tr<w.w&&["ww",tr]),si=si||ze<=1&&["M"]||ze<w.M&&["MM",ze]||ii<=1&&["y"]||["yy",ii],si[2]=g,si[3]=+f>0,si[4]=C,Ra.apply(null,si)}function oS(f){return f===void 0?yn:typeof f=="function"?(yn=f,!0):!1}function aS(f,g){return oo[f]===void 0?!1:g===void 0?oo[f]:(oo[f]=g,f==="s"&&(oo.ss=g-1),!0)}function xa(f,g){if(!this.isValid())return this.localeData().invalidDate();var w=!1,C=oo,T,H;return typeof f=="object"&&(g=f,f=!1),typeof f=="boolean"&&(w=f),typeof g=="object"&&(C=Object.assign({},oo,g),g.s!=null&&g.ss==null&&(C.ss=g.s-1)),T=this.localeData(),H=Th(this,!w,C,T),w&&(H=T.pastFuture(+this,H)),T.postformat(H)}var Sf=Math.abs;function ao(f){return(f>0)-(f<0)||+f}function lo(){if(!this.isValid())return this.localeData().invalidDate();var f=Sf(this._milliseconds)/1e3,g=Sf(this._days),w=Sf(this._months),C,T,H,K,de=this.asSeconds(),Ie,ze,tr,ii;return de?(C=Yr(f/60),T=Yr(C/60),f%=60,C%=60,H=Yr(w/12),w%=12,K=f?f.toFixed(3).replace(/\.?0+$/,""):"",Ie=de<0?"-":"",ze=ao(this._months)!==ao(de)?"-":"",tr=ao(this._days)!==ao(de)?"-":"",ii=ao(this._milliseconds)!==ao(de)?"-":"",Ie+"P"+(H?ze+H+"Y":"")+(w?ze+w+"M":"")+(g?tr+g+"D":"")+(T||C||f?"T":"")+(T?ii+T+"H":"")+(C?ii+C+"M":"")+(f?ii+K+"S":"")):"P0D"}var Ye=to.prototype;Ye.isValid=pb,Ye.abs=lu,Ye.add=Ih,Ye.subtract=Xb,Ye.as=eS,Ye.asMilliseconds=yf,Ye.asSeconds=_a,Ye.asMinutes=Ui,Ye.asHours=Oh,Ye.asDays=tS,Ye.asWeeks=uu,Ye.asMonths=rS,Ye.asQuarters=Ph,Ye.asYears=lr,Ye.valueOf=vf,Ye._bubble=gf,Ye.clone=kh,Ye.get=Fn,Ye.milliseconds=cu,Ye.seconds=gs,Ye.minutes=Ah,Ye.hours=mr,Ye.days=bf,Ye.weeks=sS,Ye.months=nS,Ye.years=iS,Ye.humanize=xa,Ye.toISOString=lo,Ye.toString=lo,Ye.toJSON=lo,Ye.locale=ga,Ye.localeData=tu,Ye.toIsoString=R("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",lo),Ye.lang=ya,he("X",0,0,"unix"),he("x",0,0,"valueOf"),me("x",Gs),me("X",Ov),ft("X",function(f,g,w){w._d=new Date(parseFloat(f)*1e3)}),ft("x",function(f,g,w){w._d=new Date(Ve(f))});return e.version="2.30.1",r(yt),e.fn=ie,e.min=cb,e.max=fb,e.now=db,e.utc=y,e.unix=Kb,e.months=Ch,e.isDate=d,e.locale=Xn,e.invalid=_,e.duration=vt,e.isMoment=j,e.weekdays=Qb,e.parseZone=mn,e.localeData=ei,e.isDuration=fa,e.monthsShort=Eh,e.weekdaysMin=mf,e.defineLocale=Ll,e.updateLocale=Nr,e.locales=Mr,e.weekdaysShort=Zb,e.normalizeUnits=ge,e.relativeTimeRounding=oS,e.relativeTimeThreshold=aS,e.calendarFormat=Yl,e.prototype=ie,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e}))});var Fq=V((Mq,pm)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof pm<"u"&&pm.exports?pm.exports=e():t.tv4=e()})(Mq,function(){Object.keys||(Object.keys=(function(){var I=Object.prototype.hasOwnProperty,R=!{toString:null}.propertyIsEnumerable("toString"),A=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],F=A.length;return function(U){if(typeof U!="object"&&typeof U!="function"||U===null)throw new TypeError("Object.keys called on non-object");var D=[];for(var J in U)I.call(U,J)&&D.push(J);if(R)for(var Q=0;Q<F;Q++)I.call(U,A[Q])&&D.push(A[Q]);return D}})()),Object.create||(Object.create=(function(){function I(){}return function(R){if(arguments.length!==1)throw new Error("Object.create implementation only accepts one parameter.");return I.prototype=R,new I}})()),Array.isArray||(Array.isArray=function(I){return Object.prototype.toString.call(I)==="[object Array]"}),Array.prototype.indexOf||(Array.prototype.indexOf=function(I){if(this===null)throw new TypeError;var R=Object(this),A=R.length>>>0;if(A===0)return-1;var F=0;if(arguments.length>1&&(F=Number(arguments[1]),F!==F?F=0:F!==0&&F!==1/0&&F!==-1/0&&(F=(F>0||-1)*Math.floor(Math.abs(F)))),F>=A)return-1;for(var U=F>=0?F:Math.max(A-Math.abs(F),0);U<A;U++)if(U in R&&R[U]===I)return U;return-1}),Object.isFrozen||(Object.isFrozen=function(I){for(var R="tv4_test_frozen_key";I.hasOwnProperty(R);)R+=Math.random();try{return I[R]=!0,delete I[R],!1}catch{return!0}});var t={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},e={"*":!0};function r(I){return encodeURI(I).replace(/%25[0-9][0-9]/g,function(R){return"%"+R.substring(3)})}function n(I){var R="";t[I.charAt(0)]&&(R=I.charAt(0),I=I.substring(1));var A="",F="",U=!0,D=!1,J=!1;R==="+"?U=!1:R==="."?(F=".",A="."):R==="/"?(F="/",A="/"):R==="#"?(F="#",U=!1):R===";"?(F=";",A=";",D=!0,J=!0):R==="?"?(F="?",A="&",D=!0):R==="&"&&(F="&",A="&",D=!0);for(var Q=[],se=I.split(","),fe=[],Be={},Re=0;Re<se.length;Re++){var ye=se[Re],ke=null;if(ye.indexOf(":")!==-1){var mt=ye.split(":");ye=mt[0],ke=parseInt(mt[1],10)}for(var Nt={};e[ye.charAt(ye.length-1)];)Nt[ye.charAt(ye.length-1)]=!0,ye=ye.substring(0,ye.length-1);var he={truncate:ke,name:ye,suffices:Nt};fe.push(he),Be[ye]=he,Q.push(ye)}var Yt=function(Tr){for(var lt="",$r=0,wr=0;wr<fe.length;wr++){var xt=fe[wr],St=Tr(xt.name);if(St==null||Array.isArray(St)&&St.length===0||typeof St=="object"&&Object.keys(St).length===0){$r++;continue}if(wr===$r?lt+=F:lt+=A||",",Array.isArray(St)){D&&(lt+=xt.name+"=");for(var Gr=0;Gr<St.length;Gr++)Gr>0&&(lt+=xt.suffices["*"]&&A||",",xt.suffices["*"]&&D&&(lt+=xt.name+"=")),lt+=U?encodeURIComponent(St[Gr]).replace(/!/g,"%21"):r(St[Gr])}else if(typeof St=="object"){D&&!xt.suffices["*"]&&(lt+=xt.name+"=");var Ws=!0;for(var At in St)Ws||(lt+=xt.suffices["*"]&&A||","),Ws=!1,lt+=U?encodeURIComponent(At).replace(/!/g,"%21"):r(At),lt+=xt.suffices["*"]?"=":",",lt+=U?encodeURIComponent(St[At]).replace(/!/g,"%21"):r(St[At])}else D&&(lt+=xt.name,(!J||St!=="")&&(lt+="=")),xt.truncate!=null&&(St=St.substring(0,xt.truncate)),lt+=U?encodeURIComponent(St).replace(/!/g,"%21"):r(St)}return lt};return Yt.varNames=Q,{prefix:F,substitution:Yt}}function i(I){if(!(this instanceof i))return new i(I);for(var R=I.split("{"),A=[R.shift()],F=[],U=[],D=[];R.length>0;){var J=R.shift(),Q=J.split("}")[0],se=J.substring(Q.length+1),fe=n(Q);U.push(fe.substitution),F.push(fe.prefix),A.push(se),D=D.concat(fe.substitution.varNames)}this.fill=function(Be){for(var Re=A[0],ye=0;ye<U.length;ye++){var ke=U[ye];Re+=ke(Be),Re+=A[ye+1]}return Re},this.varNames=D,this.template=I}i.prototype={toString:function(){return this.template},fillFromObject:function(I){return this.fill(function(R){return I[R]})}};var s=function(R,A,F,U,D){if(this.missing=[],this.missingMap={},this.formatValidators=R?Object.create(R.formatValidators):{},this.schemas=R?Object.create(R.schemas):{},this.collectMultiple=A,this.errors=[],this.handleError=A?this.collectError:this.returnError,U&&(this.checkRecursive=!0,this.scanned=[],this.scannedFrozen=[],this.scannedFrozenSchemas=[],this.scannedFrozenValidationErrors=[],this.validatedSchemasKey="tv4_validation_id",this.validationErrorsKey="tv4_validation_errors_id"),D&&(this.trackUnknownProperties=!0,this.knownPropertyPaths={},this.unknownPropertyPaths={}),this.errorReporter=F||b("en"),typeof this.errorReporter=="string")throw new Error("debug");if(this.definedKeywords={},R)for(var J in R.definedKeywords)this.definedKeywords[J]=R.definedKeywords[J].slice(0)};s.prototype.defineKeyword=function(I,R){this.definedKeywords[I]=this.definedKeywords[I]||[],this.definedKeywords[I].push(R)},s.prototype.createError=function(I,R,A,F,U,D,J){var Q=new E(I,R,A,F,U);return Q.message=this.errorReporter(Q,D,J),Q},s.prototype.returnError=function(I){return I},s.prototype.collectError=function(I){return I&&this.errors.push(I),null},s.prototype.prefixErrors=function(I,R,A){for(var F=I;F<this.errors.length;F++)this.errors[F]=this.errors[F].prefixWith(R,A);return this},s.prototype.banUnknownProperties=function(I,R){for(var A in this.unknownPropertyPaths){var F=this.createError(q.UNKNOWN_PROPERTY,{path:A},A,"",null,I,R),U=this.handleError(F);if(U)return U}return null},s.prototype.addFormat=function(I,R){if(typeof I=="object"){for(var A in I)this.addFormat(A,I[A]);return this}this.formatValidators[I]=R},s.prototype.resolveRefs=function(I,R){if(I.$ref!==void 0){if(R=R||{},R[I.$ref])return this.createError(q.CIRCULAR_REFERENCE,{urls:Object.keys(R).join(", ")},"","",null,void 0,I);R[I.$ref]=!0,I=this.getSchema(I.$ref,R)}return I},s.prototype.getSchema=function(I,R){var A;if(this.schemas[I]!==void 0)return A=this.schemas[I],this.resolveRefs(A,R);var F=I,U="";if(I.indexOf("#")!==-1&&(U=I.substring(I.indexOf("#")+1),F=I.substring(0,I.indexOf("#"))),typeof this.schemas[F]=="object"){A=this.schemas[F];var D=decodeURIComponent(U);if(D==="")return this.resolveRefs(A,R);if(D.charAt(0)!=="/")return;for(var J=D.split("/").slice(1),Q=0;Q<J.length;Q++){var se=J[Q].replace(/~1/g,"/").replace(/~0/g,"~");if(A[se]===void 0){A=void 0;break}A=A[se]}if(A!==void 0)return this.resolveRefs(A,R)}this.missing[F]===void 0&&(this.missing.push(F),this.missing[F]=F,this.missingMap[F]=F)},s.prototype.searchSchemas=function(I,R){if(Array.isArray(I))for(var A=0;A<I.length;A++)this.searchSchemas(I[A],R);else if(I&&typeof I=="object"){typeof I.id=="string"&&k(R,I.id)&&this.schemas[I.id]===void 0&&(this.schemas[I.id]=I);for(var F in I)if(F!=="enum"){if(typeof I[F]=="object")this.searchSchemas(I[F],R);else if(F==="$ref"){var U=m(I[F]);U&&this.schemas[U]===void 0&&this.missingMap[U]===void 0&&(this.missingMap[U]=U)}}}},s.prototype.addSchema=function(I,R){if(typeof I!="string"||typeof R>"u")if(typeof I=="object"&&typeof I.id=="string")R=I,I=R.id;else return;I===m(I)+"#"&&(I=m(I)),this.schemas[I]=R,delete this.missingMap[I],y(R,I),this.searchSchemas(R,I)},s.prototype.getSchemaMap=function(){var I={};for(var R in this.schemas)I[R]=this.schemas[R];return I},s.prototype.getSchemaUris=function(I){var R=[];for(var A in this.schemas)(!I||I.test(A))&&R.push(A);return R},s.prototype.getMissingUris=function(I){var R=[];for(var A in this.missingMap)(!I||I.test(A))&&R.push(A);return R},s.prototype.dropSchemas=function(){this.schemas={},this.reset()},s.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},s.prototype.validateAll=function(I,R,A,F,U){var D;if(R=this.resolveRefs(R),R){if(R instanceof E)return this.errors.push(R),R}else return null;var J=this.errors.length,Q,se=null,fe=null;if(this.checkRecursive&&I&&typeof I=="object"){if(D=!this.scanned.length,I[this.validatedSchemasKey]){var Be=I[this.validatedSchemasKey].indexOf(R);if(Be!==-1)return this.errors=this.errors.concat(I[this.validationErrorsKey][Be]),null}if(Object.isFrozen(I)&&(Q=this.scannedFrozen.indexOf(I),Q!==-1)){var Re=this.scannedFrozenSchemas[Q].indexOf(R);if(Re!==-1)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[Q][Re]),null}if(this.scanned.push(I),Object.isFrozen(I))Q===-1&&(Q=this.scannedFrozen.length,this.scannedFrozen.push(I),this.scannedFrozenSchemas.push([])),se=this.scannedFrozenSchemas[Q].length,this.scannedFrozenSchemas[Q][se]=R,this.scannedFrozenValidationErrors[Q][se]=[];else{if(!I[this.validatedSchemasKey])try{Object.defineProperty(I,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(I,this.validationErrorsKey,{value:[],configurable:!0})}catch{I[this.validatedSchemasKey]=[],I[this.validationErrorsKey]=[]}fe=I[this.validatedSchemasKey].length,I[this.validatedSchemasKey][fe]=R,I[this.validationErrorsKey][fe]=[]}}var ye=this.errors.length,ke=this.validateBasic(I,R,U)||this.validateNumeric(I,R,U)||this.validateString(I,R,U)||this.validateArray(I,R,U)||this.validateObject(I,R,U)||this.validateCombinations(I,R,U)||this.validateHypermedia(I,R,U)||this.validateFormat(I,R,U)||this.validateDefinedKeywords(I,R,U)||null;if(D){for(;this.scanned.length;){var mt=this.scanned.pop();delete mt[this.validatedSchemasKey]}this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(ke||ye!==this.errors.length)for(;A&&A.length||F&&F.length;){var Nt=A&&A.length?""+A.pop():null,he=F&&F.length?""+F.pop():null;ke&&(ke=ke.prefixWith(Nt,he)),this.prefixErrors(ye,Nt,he)}return se!==null?this.scannedFrozenValidationErrors[Q][se]=this.errors.slice(J):fe!==null&&(I[this.validationErrorsKey][fe]=this.errors.slice(J)),this.handleError(ke)},s.prototype.validateFormat=function(I,R){if(typeof R.format!="string"||!this.formatValidators[R.format])return null;var A=this.formatValidators[R.format].call(null,I,R);return typeof A=="string"||typeof A=="number"?this.createError(q.FORMAT_CUSTOM,{message:A},"","/format",null,I,R):A&&typeof A=="object"?this.createError(q.FORMAT_CUSTOM,{message:A.message||"?"},A.dataPath||"",A.schemaPath||"/format",null,I,R):null},s.prototype.validateDefinedKeywords=function(I,R,A){for(var F in this.definedKeywords)if(!(typeof R[F]>"u"))for(var U=this.definedKeywords[F],D=0;D<U.length;D++){var J=U[D],Q=J(I,R[F],R,A);if(typeof Q=="string"||typeof Q=="number")return this.createError(q.KEYWORD_CUSTOM,{key:F,message:Q},"","",null,I,R).prefixWith(null,F);if(Q&&typeof Q=="object"){var se=Q.code;if(typeof se=="string"){if(!q[se])throw new Error("Undefined error code (use defineError): "+se);se=q[se]}else typeof se!="number"&&(se=q.KEYWORD_CUSTOM);var fe=typeof Q.message=="object"?Q.message:{key:F,message:Q.message||"?"},Be=Q.schemaPath||"/"+F.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(se,fe,Q.dataPath||null,Be,null,I,R)}}return null};function o(I,R){if(I===R)return!0;if(I&&R&&typeof I=="object"&&typeof R=="object"){if(Array.isArray(I)!==Array.isArray(R))return!1;if(Array.isArray(I)){if(I.length!==R.length)return!1;for(var A=0;A<I.length;A++)if(!o(I[A],R[A]))return!1}else{var F;for(F in I)if(R[F]===void 0&&I[F]!==void 0)return!1;for(F in R)if(I[F]===void 0&&R[F]!==void 0)return!1;for(F in I)if(!o(I[F],R[F]))return!1}return!0}return!1}s.prototype.validateBasic=function(R,A,F){var U;return(U=this.validateType(R,A,F))||(U=this.validateEnum(R,A,F))?U.prefixWith(null,"type"):null},s.prototype.validateType=function(R,A){if(A.type===void 0)return null;var F=typeof R;R===null?F="null":Array.isArray(R)&&(F="array");var U=A.type;Array.isArray(U)||(U=[U]);for(var D=0;D<U.length;D++){var J=U[D];if(J===F||J==="integer"&&F==="number"&&R%1===0)return null}return this.createError(q.INVALID_TYPE,{type:F,expected:U.join("/")},"","",null,R,A)},s.prototype.validateEnum=function(R,A){if(A.enum===void 0)return null;for(var F=0;F<A.enum.length;F++){var U=A.enum[F];if(o(R,U))return null}return this.createError(q.ENUM_MISMATCH,{value:typeof JSON<"u"?JSON.stringify(R):R},"","",null,R,A)},s.prototype.validateNumeric=function(R,A,F){return this.validateMultipleOf(R,A,F)||this.validateMinMax(R,A,F)||this.validateNaN(R,A,F)||null};var l=Math.pow(2,-51),c=1-l;s.prototype.validateMultipleOf=function(R,A){var F=A.multipleOf||A.divisibleBy;if(F===void 0)return null;if(typeof R=="number"){var U=R/F%1;if(U>=l&&U<c)return this.createError(q.NUMBER_MULTIPLE_OF,{value:R,multipleOf:F},"","",null,R,A)}return null},s.prototype.validateMinMax=function(R,A){if(typeof R!="number")return null;if(A.minimum!==void 0){if(R<A.minimum)return this.createError(q.NUMBER_MINIMUM,{value:R,minimum:A.minimum},"","/minimum",null,R,A);if(A.exclusiveMinimum&&R===A.minimum)return this.createError(q.NUMBER_MINIMUM_EXCLUSIVE,{value:R,minimum:A.minimum},"","/exclusiveMinimum",null,R,A)}if(A.maximum!==void 0){if(R>A.maximum)return this.createError(q.NUMBER_MAXIMUM,{value:R,maximum:A.maximum},"","/maximum",null,R,A);if(A.exclusiveMaximum&&R===A.maximum)return this.createError(q.NUMBER_MAXIMUM_EXCLUSIVE,{value:R,maximum:A.maximum},"","/exclusiveMaximum",null,R,A)}return null},s.prototype.validateNaN=function(R,A){return typeof R!="number"?null:isNaN(R)===!0||R===1/0||R===-1/0?this.createError(q.NUMBER_NOT_A_NUMBER,{value:R},"","/type",null,R,A):null},s.prototype.validateString=function(R,A,F){return this.validateStringLength(R,A,F)||this.validateStringPattern(R,A,F)||null},s.prototype.validateStringLength=function(R,A){return typeof R!="string"?null:A.minLength!==void 0&&R.length<A.minLength?this.createError(q.STRING_LENGTH_SHORT,{length:R.length,minimum:A.minLength},"","/minLength",null,R,A):A.maxLength!==void 0&&R.length>A.maxLength?this.createError(q.STRING_LENGTH_LONG,{length:R.length,maximum:A.maxLength},"","/maxLength",null,R,A):null},s.prototype.validateStringPattern=function(R,A){if(typeof R!="string"||typeof A.pattern!="string"&&!(A.pattern instanceof RegExp))return null;var F;if(A.pattern instanceof RegExp)F=A.pattern;else{var U,D="",J=A.pattern.match(/^\/(.+)\/([img]*)$/);J?(U=J[1],D=J[2]):U=A.pattern,F=new RegExp(U,D)}return F.test(R)?null:this.createError(q.STRING_PATTERN,{pattern:A.pattern},"","/pattern",null,R,A)},s.prototype.validateArray=function(R,A,F){return Array.isArray(R)&&(this.validateArrayLength(R,A,F)||this.validateArrayUniqueItems(R,A,F)||this.validateArrayItems(R,A,F))||null},s.prototype.validateArrayLength=function(R,A){var F;return A.minItems!==void 0&&R.length<A.minItems&&(F=this.createError(q.ARRAY_LENGTH_SHORT,{length:R.length,minimum:A.minItems},"","/minItems",null,R,A),this.handleError(F))||A.maxItems!==void 0&&R.length>A.maxItems&&(F=this.createError(q.ARRAY_LENGTH_LONG,{length:R.length,maximum:A.maxItems},"","/maxItems",null,R,A),this.handleError(F))?F:null},s.prototype.validateArrayUniqueItems=function(R,A){if(A.uniqueItems){for(var F=0;F<R.length;F++)for(var U=F+1;U<R.length;U++)if(o(R[F],R[U])){var D=this.createError(q.ARRAY_UNIQUE,{match1:F,match2:U},"","/uniqueItems",null,R,A);if(this.handleError(D))return D}}return null},s.prototype.validateArrayItems=function(R,A,F){if(A.items===void 0)return null;var U,D;if(Array.isArray(A.items)){for(D=0;D<R.length;D++)if(D<A.items.length){if(U=this.validateAll(R[D],A.items[D],[D],["items",D],F+"/"+D))return U}else if(A.additionalItems!==void 0){if(typeof A.additionalItems=="boolean"){if(!A.additionalItems&&(U=this.createError(q.ARRAY_ADDITIONAL_ITEMS,{},"/"+D,"/additionalItems",null,R,A),this.handleError(U)))return U}else if(U=this.validateAll(R[D],A.additionalItems,[D],["additionalItems"],F+"/"+D))return U}}else for(D=0;D<R.length;D++)if(U=this.validateAll(R[D],A.items,[D],["items"],F+"/"+D))return U;return null},s.prototype.validateObject=function(R,A,F){return typeof R!="object"||R===null||Array.isArray(R)?null:this.validateObjectMinMaxProperties(R,A,F)||this.validateObjectRequiredProperties(R,A,F)||this.validateObjectProperties(R,A,F)||this.validateObjectDependencies(R,A,F)||null},s.prototype.validateObjectMinMaxProperties=function(R,A){var F=Object.keys(R),U;return A.minProperties!==void 0&&F.length<A.minProperties&&(U=this.createError(q.OBJECT_PROPERTIES_MINIMUM,{propertyCount:F.length,minimum:A.minProperties},"","/minProperties",null,R,A),this.handleError(U))||A.maxProperties!==void 0&&F.length>A.maxProperties&&(U=this.createError(q.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:F.length,maximum:A.maxProperties},"","/maxProperties",null,R,A),this.handleError(U))?U:null},s.prototype.validateObjectRequiredProperties=function(R,A){if(A.required!==void 0)for(var F=0;F<A.required.length;F++){var U=A.required[F];if(R[U]===void 0){var D=this.createError(q.OBJECT_REQUIRED,{key:U},"","/required/"+F,null,R,A);if(this.handleError(D))return D}}return null},s.prototype.validateObjectProperties=function(R,A,F){var U;for(var D in R){var J=F+"/"+D.replace(/~/g,"~0").replace(/\//g,"~1"),Q=!1;if(A.properties!==void 0&&A.properties[D]!==void 0&&(Q=!0,U=this.validateAll(R[D],A.properties[D],[D],["properties",D],J)))return U;if(A.patternProperties!==void 0)for(var se in A.patternProperties){var fe=new RegExp(se);if(fe.test(D)&&(Q=!0,U=this.validateAll(R[D],A.patternProperties[se],[D],["patternProperties",se],J)))return U}if(Q)this.trackUnknownProperties&&(this.knownPropertyPaths[J]=!0,delete this.unknownPropertyPaths[J]);else if(A.additionalProperties!==void 0){if(this.trackUnknownProperties&&(this.knownPropertyPaths[J]=!0,delete this.unknownPropertyPaths[J]),typeof A.additionalProperties=="boolean"){if(!A.additionalProperties&&(U=this.createError(q.OBJECT_ADDITIONAL_PROPERTIES,{key:D},"","/additionalProperties",null,R,A).prefixWith(D,null),this.handleError(U)))return U}else if(U=this.validateAll(R[D],A.additionalProperties,[D],["additionalProperties"],J))return U}else this.trackUnknownProperties&&!this.knownPropertyPaths[J]&&(this.unknownPropertyPaths[J]=!0)}return null},s.prototype.validateObjectDependencies=function(R,A,F){var U;if(A.dependencies!==void 0){for(var D in A.dependencies)if(R[D]!==void 0){var J=A.dependencies[D];if(typeof J=="string"){if(R[J]===void 0&&(U=this.createError(q.OBJECT_DEPENDENCY_KEY,{key:D,missing:J},"","",null,R,A).prefixWith(null,D).prefixWith(null,"dependencies"),this.handleError(U)))return U}else if(Array.isArray(J))for(var Q=0;Q<J.length;Q++){var se=J[Q];if(R[se]===void 0&&(U=this.createError(q.OBJECT_DEPENDENCY_KEY,{key:D,missing:se},"","/"+Q,null,R,A).prefixWith(null,D).prefixWith(null,"dependencies"),this.handleError(U)))return U}else if(U=this.validateAll(R,J,[],["dependencies",D],F))return U}}return null},s.prototype.validateCombinations=function(R,A,F){return this.validateAllOf(R,A,F)||this.validateAnyOf(R,A,F)||this.validateOneOf(R,A,F)||this.validateNot(R,A,F)||null},s.prototype.validateAllOf=function(R,A,F){if(A.allOf===void 0)return null;for(var U,D=0;D<A.allOf.length;D++){var J=A.allOf[D];if(U=this.validateAll(R,J,[],["allOf",D],F))return U}return null},s.prototype.validateAnyOf=function(R,A,F){if(A.anyOf===void 0)return null;var U=[],D=this.errors.length,J,Q;this.trackUnknownProperties&&(J=this.unknownPropertyPaths,Q=this.knownPropertyPaths);for(var se=!0,fe=0;fe<A.anyOf.length;fe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var Be=A.anyOf[fe],Re=this.errors.length,ye=this.validateAll(R,Be,[],["anyOf",fe],F);if(ye===null&&Re===this.errors.length){if(this.errors=this.errors.slice(0,D),this.trackUnknownProperties){for(var ke in this.knownPropertyPaths)Q[ke]=!0,delete J[ke];for(var mt in this.unknownPropertyPaths)Q[mt]||(J[mt]=!0);se=!1;continue}return null}ye&&U.push(ye.prefixWith(null,""+fe).prefixWith(null,"anyOf"))}if(this.trackUnknownProperties&&(this.unknownPropertyPaths=J,this.knownPropertyPaths=Q),se)return U=U.concat(this.errors.slice(D)),this.errors=this.errors.slice(0,D),this.createError(q.ANY_OF_MISSING,{},"","/anyOf",U,R,A)},s.prototype.validateOneOf=function(R,A,F){if(A.oneOf===void 0)return null;var U=null,D=[],J=this.errors.length,Q,se;this.trackUnknownProperties&&(Q=this.unknownPropertyPaths,se=this.knownPropertyPaths);for(var fe=0;fe<A.oneOf.length;fe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var Be=A.oneOf[fe],Re=this.errors.length,ye=this.validateAll(R,Be,[],["oneOf",fe],F);if(ye===null&&Re===this.errors.length){if(U===null)U=fe;else return this.errors=this.errors.slice(0,J),this.createError(q.ONE_OF_MULTIPLE,{index1:U,index2:fe},"","/oneOf",null,R,A);if(this.trackUnknownProperties){for(var ke in this.knownPropertyPaths)se[ke]=!0,delete Q[ke];for(var mt in this.unknownPropertyPaths)se[mt]||(Q[mt]=!0)}}else ye&&D.push(ye)}return this.trackUnknownProperties&&(this.unknownPropertyPaths=Q,this.knownPropertyPaths=se),U===null?(D=D.concat(this.errors.slice(J)),this.errors=this.errors.slice(0,J),this.createError(q.ONE_OF_MISSING,{},"","/oneOf",D,R,A)):(this.errors=this.errors.slice(0,J),null)},s.prototype.validateNot=function(R,A,F){if(A.not===void 0)return null;var U=this.errors.length,D,J;this.trackUnknownProperties&&(D=this.unknownPropertyPaths,J=this.knownPropertyPaths,this.unknownPropertyPaths={},this.knownPropertyPaths={});var Q=this.validateAll(R,A.not,null,null,F),se=this.errors.slice(U);return this.errors=this.errors.slice(0,U),this.trackUnknownProperties&&(this.unknownPropertyPaths=D,this.knownPropertyPaths=J),Q===null&&se.length===0?this.createError(q.NOT_PASSED,{},"","/not",null,R,A):null},s.prototype.validateHypermedia=function(R,A,F){if(!A.links)return null;for(var U,D=0;D<A.links.length;D++){var J=A.links[D];if(J.rel==="describedby"){for(var Q=new i(J.href),se=!0,fe=0;fe<Q.varNames.length;fe++)if(!(Q.varNames[fe]in R)){se=!1;break}if(se){var Be=Q.fillFromObject(R),Re={$ref:Be};if(U=this.validateAll(R,Re,[],["links",D],F))return U}}}};function d(I){var R=String(I).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return R?{href:R[0]||"",protocol:R[1]||"",authority:R[2]||"",host:R[3]||"",hostname:R[4]||"",port:R[5]||"",pathname:R[6]||"",search:R[7]||"",hash:R[8]||""}:null}function p(I,R){function A(F){var U=[];return F.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(D){D==="/.."?U.pop():U.push(D)}),U.join("").replace(/^\//,F.charAt(0)==="/"?"/":"")}return R=d(R||""),I=d(I||""),!R||!I?null:(R.protocol||I.protocol)+(R.protocol||R.authority?R.authority:I.authority)+A(R.protocol||R.authority||R.pathname.charAt(0)==="/"?R.pathname:R.pathname?(I.authority&&!I.pathname?"/":"")+I.pathname.slice(0,I.pathname.lastIndexOf("/")+1)+R.pathname:I.pathname)+(R.protocol||R.authority||R.pathname?R.search:R.search||I.search)+R.hash}function m(I){return I.split("#")[0]}function y(I,R){if(I&&typeof I=="object")if(R===void 0?R=I.id:typeof I.id=="string"&&(R=p(R,I.id),I.id=R),Array.isArray(I))for(var A=0;A<I.length;A++)y(I[A],R);else{typeof I.$ref=="string"&&(I.$ref=p(R,I.$ref));for(var F in I)F!=="enum"&&y(I[F],R)}}function b(I){I=I||"en";var R=P[I];return function(A){var F=R[A.code]||_[A.code];if(typeof F!="string")return"Unknown error code "+A.code+": "+JSON.stringify(A.messageParams);var U=A.params;return F.replace(/\{([^{}]*)\}/g,function(D,J){var Q=U[J];return typeof Q=="string"||typeof Q=="number"?Q:D})}}var q={INVALID_TYPE:0,ENUM_MISMATCH:1,ANY_OF_MISSING:10,ONE_OF_MISSING:11,ONE_OF_MULTIPLE:12,NOT_PASSED:13,NUMBER_MULTIPLE_OF:100,NUMBER_MINIMUM:101,NUMBER_MINIMUM_EXCLUSIVE:102,NUMBER_MAXIMUM:103,NUMBER_MAXIMUM_EXCLUSIVE:104,NUMBER_NOT_A_NUMBER:105,STRING_LENGTH_SHORT:200,STRING_LENGTH_LONG:201,STRING_PATTERN:202,OBJECT_PROPERTIES_MINIMUM:300,OBJECT_PROPERTIES_MAXIMUM:301,OBJECT_REQUIRED:302,OBJECT_ADDITIONAL_PROPERTIES:303,OBJECT_DEPENDENCY_KEY:304,ARRAY_LENGTH_SHORT:400,ARRAY_LENGTH_LONG:401,ARRAY_UNIQUE:402,ARRAY_ADDITIONAL_ITEMS:403,FORMAT_CUSTOM:500,KEYWORD_CUSTOM:501,CIRCULAR_REFERENCE:600,UNKNOWN_PROPERTY:1e3},x={};for(var v in q)x[q[v]]=v;var _={INVALID_TYPE:"Invalid type: {type} (expected {expected})",ENUM_MISMATCH:"No enum match for: {value}",ANY_OF_MISSING:'Data does not match any schemas from "anyOf"',ONE_OF_MISSING:'Data does not match any schemas from "oneOf"',ONE_OF_MULTIPLE:'Data is valid against more than one schema from "oneOf": indices {index1} and {index2}',NOT_PASSED:'Data matches schema from "not"',NUMBER_MULTIPLE_OF:"Value {value} is not a multiple of {multipleOf}",NUMBER_MINIMUM:"Value {value} is less than minimum {minimum}",NUMBER_MINIMUM_EXCLUSIVE:"Value {value} is equal to exclusive minimum {minimum}",NUMBER_MAXIMUM:"Value {value} is greater than maximum {maximum}",NUMBER_MAXIMUM_EXCLUSIVE:"Value {value} is equal to exclusive maximum {maximum}",NUMBER_NOT_A_NUMBER:"Value {value} is not a valid number",STRING_LENGTH_SHORT:"String is too short ({length} chars), minimum {minimum}",STRING_LENGTH_LONG:"String is too long ({length} chars), maximum {maximum}",STRING_PATTERN:"String does not match pattern: {pattern}",OBJECT_PROPERTIES_MINIMUM:"Too few properties defined ({propertyCount}), minimum {minimum}",OBJECT_PROPERTIES_MAXIMUM:"Too many properties defined ({propertyCount}), maximum {maximum}",OBJECT_REQUIRED:"Missing required property: {key}",OBJECT_ADDITIONAL_PROPERTIES:"Additional properties not allowed",OBJECT_DEPENDENCY_KEY:"Dependency failed - key must exist: {missing} (due to key: {key})",ARRAY_LENGTH_SHORT:"Array is too short ({length}), minimum {minimum}",ARRAY_LENGTH_LONG:"Array is too long ({length}), maximum {maximum}",ARRAY_UNIQUE:"Array items are not unique (indices {match1} and {match2})",ARRAY_ADDITIONAL_ITEMS:"Additional items not allowed",FORMAT_CUSTOM:"Format validation failed ({message})",KEYWORD_CUSTOM:"Keyword failed: {key} ({message})",CIRCULAR_REFERENCE:"Circular $refs: {urls}",UNKNOWN_PROPERTY:"Unknown property (not in schema)"};function E(I,R,A,F,U){if(Error.call(this),I===void 0)throw new Error("No error code supplied: "+F);this.message="",this.params=R,this.code=I,this.dataPath=A||"",this.schemaPath=F||"",this.subErrors=U||null;var D=new Error(this.message);if(this.stack=D.stack||D.stacktrace,!this.stack)try{throw D}catch(J){this.stack=J.stack||J.stacktrace}}E.prototype=Object.create(Error.prototype),E.prototype.constructor=E,E.prototype.name="ValidationError",E.prototype.prefixWith=function(I,R){if(I!==null&&(I=I.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+I+this.dataPath),R!==null&&(R=R.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+R+this.schemaPath),this.subErrors!==null)for(var A=0;A<this.subErrors.length;A++)this.subErrors[A].prefixWith(I,R);return this};function k(I,R){if(R.substring(0,I.length)===I){var A=R.substring(I.length);if(R.length>0&&R.charAt(I.length-1)==="/"||A.charAt(0)==="#"||A.charAt(0)==="?")return!0}return!1}var P={};function M(I){var R=new s,A,F,U={setErrorReporter:function(D){return typeof D=="string"?this.language(D):(F=D,!0)},addFormat:function(){R.addFormat.apply(R,arguments)},language:function(D){return D?(P[D]||(D=D.split("-")[0]),P[D]?(A=D,D):!1):A},addLanguage:function(D,J){var Q;for(Q in q)J[Q]&&!J[q[Q]]&&(J[q[Q]]=J[Q]);var se=D.split("-")[0];if(!P[se])P[D]=J,P[se]=J;else{P[D]=Object.create(P[se]);for(Q in J)typeof P[se][Q]>"u"&&(P[se][Q]=J[Q]),P[D][Q]=J[Q]}return this},freshApi:function(D){var J=M();return D&&J.language(D),J},validate:function(D,J,Q,se){var fe=b(A),Be=F?function(ke,mt,Nt){return F(ke,mt,Nt)||fe(ke,mt,Nt)}:fe,Re=new s(R,!1,Be,Q,se);typeof J=="string"&&(J={$ref:J}),Re.addSchema("",J);var ye=Re.validateAll(D,J,null,null,"");return!ye&&se&&(ye=Re.banUnknownProperties(D,J)),this.error=ye,this.missing=Re.missing,this.valid=ye===null,this.valid},validateResult:function(){var D={toString:function(){return this.valid?"valid":this.error.message}};return this.validate.apply(D,arguments),D},validateMultiple:function(D,J,Q,se){var fe=b(A),Be=F?function(ke,mt,Nt){return F(ke,mt,Nt)||fe(ke,mt,Nt)}:fe,Re=new s(R,!0,Be,Q,se);typeof J=="string"&&(J={$ref:J}),Re.addSchema("",J),Re.validateAll(D,J,null,null,""),se&&Re.banUnknownProperties(D,J);var ye={toString:function(){return this.valid?"valid":this.error.message}};return ye.errors=Re.errors,ye.missing=Re.missing,ye.valid=ye.errors.length===0,ye},addSchema:function(){return R.addSchema.apply(R,arguments)},getSchema:function(){return R.getSchema.apply(R,arguments)},getSchemaMap:function(){return R.getSchemaMap.apply(R,arguments)},getSchemaUris:function(){return R.getSchemaUris.apply(R,arguments)},getMissingUris:function(){return R.getMissingUris.apply(R,arguments)},dropSchemas:function(){R.dropSchemas.apply(R,arguments)},defineKeyword:function(){R.defineKeyword.apply(R,arguments)},defineError:function(D,J,Q){if(typeof D!="string"||!/^[A-Z]+(_[A-Z]+)*$/.test(D))throw new Error("Code name must be a string in UPPER_CASE_WITH_UNDERSCORES");if(typeof J!="number"||J%1!==0||J<1e4)throw new Error("Code number must be an integer > 10000");if(typeof q[D]<"u")throw new Error("Error already defined: "+D+" as "+q[D]);if(typeof x[J]<"u")throw new Error("Error code already used: "+x[J]+" as "+J);q[D]=J,x[J]=D,_[D]=_[J]=Q;for(var se in P){var fe=P[se];fe[D]&&(fe[J]=fe[J]||fe[D])}},reset:function(){R.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:y,resolveUrl:p,getDocumentUri:m,errorCodes:q};return U.language(I||"en"),U}var j=M();return j.addLanguage("en-gb",_),j.tv4=j,j})});var Df=V(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.regexpCode=ct.getEsmExportName=ct.getProperty=ct.safeStringify=ct.stringify=ct.strConcat=ct.addCodeArg=ct.str=ct._=ct.nil=ct._Code=ct.Name=ct.IDENTIFIER=ct._CodeOrName=void 0;var Mf=class{};ct._CodeOrName=Mf;ct.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Ta=class extends Mf{constructor(e){if(super(),!ct.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ct.Name=Ta;var Bn=class extends Mf{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Ta&&(r[n.str]=(r[n.str]||0)+1),r),{})}};ct._Code=Bn;ct.nil=new Bn("");function Dq(t,...e){let r=[t[0]],n=0;for(;n<e.length;)iw(r,e[n]),r.push(t[++n]);return new Bn(r)}ct._=Dq;var nw=new Bn("+");function jq(t,...e){let r=[Ff(t[0])],n=0;for(;n<e.length;)r.push(nw),iw(r,e[n]),r.push(nw,Ff(t[++n]));return W2(r),new Bn(r)}ct.str=jq;function iw(t,e){e instanceof Bn?t.push(...e._items):e instanceof Ta?t.push(e):t.push(G2(e))}ct.addCodeArg=iw;function W2(t){let e=1;for(;e<t.length-1;){if(t[e]===nw){let r=z2(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function z2(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Ta||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Ta))return`"${t}${e.slice(1)}`}function J2(t,e){return e.emptyStr()?t:t.emptyStr()?e:jq`${t}${e}`}ct.strConcat=J2;function G2(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Ff(Array.isArray(t)?t.join(","):t)}function Y2(t){return new Bn(Ff(t))}ct.stringify=Y2;function Ff(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ct.safeStringify=Ff;function K2(t){return typeof t=="string"&&ct.IDENTIFIER.test(t)?new Bn(`.${t}`):Dq`[${t}]`}ct.getProperty=K2;function Q2(t){if(typeof t=="string"&&ct.IDENTIFIER.test(t))return new Bn(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}ct.getEsmExportName=Q2;function Z2(t){return new Bn(t.toString())}ct.regexpCode=Z2});var aw=V(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.ValueScope=sn.ValueScopeName=sn.Scope=sn.varKinds=sn.UsedValueState=void 0;var nn=Df(),sw=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},hm;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(hm||(sn.UsedValueState=hm={}));sn.varKinds={const:new nn.Name("const"),let:new nn.Name("let"),var:new nn.Name("var")};var mm=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof nn.Name?e:this.name(e)}name(e){return new nn.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};sn.Scope=mm;var gm=class extends nn.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,nn._)`.${new nn.Name(r)}[${n}]`}};sn.ValueScopeName=gm;var X2=(0,nn._)`\n`,ow=class extends mm{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?X2:nn.nil}}get(){return this._scope}name(e){return new gm(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:s}=i,o=(n=r.key)!==null&&n!==void 0?n:r.ref,l=this._values[s];if(l){let p=l.get(o);if(p)return p}else l=this._values[s]=new Map;l.set(o,i);let c=this._scope[s]||(this._scope[s]=[]),d=c.length;return c[d]=r.ref,i.setValue(r,{property:s,itemIndex:d}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,nn._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let s=nn.nil;for(let o in e){let l=e[o];if(!l)continue;let c=n[o]=n[o]||new Map;l.forEach(d=>{if(c.has(d))return;c.set(d,hm.Started);let p=r(d);if(p){let m=this.opts.es5?sn.varKinds.var:sn.varKinds.const;s=(0,nn._)`${s}${m} ${d} = ${p};${this.opts._n}`}else if(p=i?.(d))s=(0,nn._)`${s}${p}${this.opts._n}`;else throw new sw(d);c.set(d,hm.Completed)})}return s}};sn.ValueScope=ow});var Je=V(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.or=He.and=He.not=He.CodeGen=He.operators=He.varKinds=He.ValueScopeName=He.ValueScope=He.Scope=He.Name=He.regexpCode=He.stringify=He.getProperty=He.nil=He.strConcat=He.str=He._=void 0;var tt=Df(),ci=aw(),bo=Df();Object.defineProperty(He,"_",{enumerable:!0,get:function(){return bo._}});Object.defineProperty(He,"str",{enumerable:!0,get:function(){return bo.str}});Object.defineProperty(He,"strConcat",{enumerable:!0,get:function(){return bo.strConcat}});Object.defineProperty(He,"nil",{enumerable:!0,get:function(){return bo.nil}});Object.defineProperty(He,"getProperty",{enumerable:!0,get:function(){return bo.getProperty}});Object.defineProperty(He,"stringify",{enumerable:!0,get:function(){return bo.stringify}});Object.defineProperty(He,"regexpCode",{enumerable:!0,get:function(){return bo.regexpCode}});Object.defineProperty(He,"Name",{enumerable:!0,get:function(){return bo.Name}});var Sm=aw();Object.defineProperty(He,"Scope",{enumerable:!0,get:function(){return Sm.Scope}});Object.defineProperty(He,"ValueScope",{enumerable:!0,get:function(){return Sm.ValueScope}});Object.defineProperty(He,"ValueScopeName",{enumerable:!0,get:function(){return Sm.ValueScopeName}});Object.defineProperty(He,"varKinds",{enumerable:!0,get:function(){return Sm.varKinds}});He.operators={GT:new tt._Code(">"),GTE:new tt._Code(">="),LT:new tt._Code("<"),LTE:new tt._Code("<="),EQ:new tt._Code("==="),NEQ:new tt._Code("!=="),NOT:new tt._Code("!"),OR:new tt._Code("||"),AND:new tt._Code("&&"),ADD:new tt._Code("+")};var Es=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},lw=class extends Es{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?ci.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Ou(this.rhs,e,r)),this}get names(){return this.rhs instanceof tt._CodeOrName?this.rhs.names:{}}},ym=class extends Es{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof tt.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Ou(this.rhs,e,r),this}get names(){let e=this.lhs instanceof tt.Name?{}:{...this.lhs.names};return bm(e,this.rhs)}},uw=class extends ym{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},cw=class extends Es{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},fw=class extends Es{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},dw=class extends Es{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},pw=class extends Es{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Ou(this.code,e,r),this}get names(){return this.code instanceof tt._CodeOrName?this.code.names:{}}},jf=class extends Es{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(e,r)||(eU(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Ma(e,r.names),{})}},qs=class extends jf{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},hw=class extends jf{},Iu=class extends qs{};Iu.kind="else";var $a=class t extends qs{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Iu(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(Lq(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Ou(this.condition,e,r),this}get names(){let e=super.names;return bm(e,this.condition),this.else&&Ma(e,this.else.names),e}};$a.kind="if";var Na=class extends qs{};Na.kind="for";var mw=class extends Na{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Ou(this.iteration,e,r),this}get names(){return Ma(super.names,this.iteration.names)}},gw=class extends Na{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?ci.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${r} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=bm(super.names,this.from);return bm(e,this.to)}},vm=class extends Na{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Ou(this.iterable,e,r),this}get names(){return Ma(super.names,this.iterable.names)}},Lf=class extends qs{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Lf.kind="func";var Uf=class extends jf{render(e){return"return "+super.render(e)}};Uf.kind="return";var yw=class extends qs{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Ma(e,this.catch.names),this.finally&&Ma(e,this.finally.names),e}},Hf=class extends qs{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Hf.kind="catch";var Bf=class extends qs{render(e){return"finally"+super.render(e)}};Bf.kind="finally";var vw=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
23
|
+
`+new Error().stack),w=!1}return g.apply(this,arguments)},g)}var A={};function F(f,g){e.deprecationHandler!=null&&e.deprecationHandler(f,g),A[f]||(I(g),A[f]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function U(f){return typeof Function<"u"&&f instanceof Function||Object.prototype.toString.call(f)==="[object Function]"}function D(f){var g,w;for(w in f)s(f,w)&&(g=f[w],U(g)?this[w]=g:this["_"+w]=g);this._config=f,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function J(f,g){var w=m({},f),C;for(C in g)s(g,C)&&(i(f[C])&&i(g[C])?(w[C]={},m(w[C],f[C]),m(w[C],g[C])):g[C]!=null?w[C]=g[C]:delete w[C]);for(C in f)s(f,C)&&!s(g,C)&&i(f[C])&&(w[C]=m({},w[C]));return w}function Q(f){f!=null&&this.set(f)}var se;Object.keys?se=Object.keys:se=function(f){var g,w=[];for(g in f)s(f,g)&&w.push(g);return w};var fe={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function Be(f,g,w){var C=this._calendar[f]||this._calendar.sameElse;return U(C)?C.call(g,w):C}function Re(f,g,w){var C=""+Math.abs(f),T=g-C.length,H=f>=0;return(H?w?"+":"":"-")+Math.pow(10,Math.max(0,T)).toString().substr(1)+C}var ye=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ke=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,mt={},Nt={};function he(f,g,w,C){var T=C;typeof C=="string"&&(T=function(){return this[C]()}),f&&(Nt[f]=T),g&&(Nt[g[0]]=function(){return Re(T.apply(this,arguments),g[1],g[2])}),w&&(Nt[w]=function(){return this.localeData().ordinal(T.apply(this,arguments),f)})}function Yt(f){return f.match(/\[[\s\S]/)?f.replace(/^\[|\]$/g,""):f.replace(/\\/g,"")}function Tr(f){var g=f.match(ye),w,C;for(w=0,C=g.length;w<C;w++)Nt[g[w]]?g[w]=Nt[g[w]]:g[w]=Yt(g[w]);return function(T){var H="",K;for(K=0;K<C;K++)H+=U(g[K])?g[K].call(T,f):g[K];return H}}function lt(f,g){return f.isValid()?(g=$r(g,f.localeData()),mt[g]=mt[g]||Tr(g),mt[g](f)):f.localeData().invalidDate()}function $r(f,g){var w=5;function C(T){return g.longDateFormat(T)||T}for(ke.lastIndex=0;w>=0&&ke.test(f);)f=f.replace(ke,C),ke.lastIndex=0,w-=1;return f}var wr={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function xt(f){var g=this._longDateFormat[f],w=this._longDateFormat[f.toUpperCase()];return g||!w?g:(this._longDateFormat[f]=w.match(ye).map(function(C){return C==="MMMM"||C==="MM"||C==="DD"||C==="dddd"?C.slice(1):C}).join(""),this._longDateFormat[f])}var St="Invalid date";function Gr(){return this._invalidDate}var Ws="%d",At=/\d{1,2}/;function Ai(f){return this._ordinal.replace("%d",f)}var On={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function te(f,g,w,C){var T=this._relativeTime[w];return U(T)?T(f,g,w,C):T.replace(/%d/i,f)}function re(f,g){var w=this._relativeTime[f>0?"future":"past"];return U(w)?w(g):w.replace(/%s/i,g)}var Te={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function ge(f){return typeof f=="string"?Te[f]||Te[f.toLowerCase()]:void 0}function we(f){var g={},w,C;for(C in f)s(f,C)&&(w=ge(C),w&&(g[w]=f[C]));return g}var Ze={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function Ct(f){var g=[],w;for(w in f)s(f,w)&&g.push({unit:w,priority:Ze[w]});return g.sort(function(C,T){return C.priority-T.priority}),g}var or=/\d/,oe=/\d\d/,fr=/\d{3}/,Lt=/\d{4}/,gt=/[+-]?\d{6}/,qe=/\d\d?/,Pn=/\d\d\d\d?/,Ol=/\d\d\d\d\d\d?/,zs=/\d{1,3}/,ea=/\d{1,4}/,Js=/[+-]?\d{1,6}/,Ti=/\d+/,Gs=/[+-]?\d+/,Bc=/Z|[+-]\d\d:?\d\d/gi,Pl=/Z|[+-]\d\d(?::?\d\d)?/gi,Ov=/[+-]?\d+(\.\d{1,3})?/,ta=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ls=/^[1-9]\d?/,kl=/^([1-9]\d|\d)/,Al;Al={};function me(f,g,w){Al[f]=U(g)?g:function(C,T){return C&&w?w:g}}function Pv(f,g){return s(Al,f)?Al[f](g._strict,g._locale):new RegExp(kv(f))}function kv(f){return kn(f.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(g,w,C,T,H){return w||C||T||H}))}function kn(f){return f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Yr(f){return f<0?Math.ceil(f)||0:Math.floor(f)}function Ve(f){var g=+f,w=0;return g!==0&&isFinite(g)&&(w=Yr(g)),w}var Vc={};function ft(f,g){var w,C=g,T;for(typeof f=="string"&&(f=[f]),c(g)&&(C=function(H,K){K[g]=Ve(H)}),T=f.length,w=0;w<T;w++)Vc[f[w]]=C}function ra(f,g){ft(f,function(w,C,T,H){T._w=T._w||{},g(w,T._w,T,H)})}function Wc(f,g,w){g!=null&&s(Vc,f)&&Vc[f](g,w._a,w,f)}function Tl(f){return f%4===0&&f%100!==0||f%400===0}var dr=0,Qn=1,An=2,Kt=3,Kr=4,Zn=5,us=6,Lp=7,Av=8;he("Y",0,0,function(){var f=this.year();return f<=9999?Re(f,4):"+"+f}),he(0,["YY",2],0,function(){return this.year()%100}),he(0,["YYYY",4],0,"year"),he(0,["YYYYY",5],0,"year"),he(0,["YYYYYY",6,!0],0,"year"),me("Y",Gs),me("YY",qe,oe),me("YYYY",ea,Lt),me("YYYYY",Js,gt),me("YYYYYY",Js,gt),ft(["YYYYY","YYYYYY"],dr),ft("YYYY",function(f,g){g[dr]=f.length===2?e.parseTwoDigitYear(f):Ve(f)}),ft("YY",function(f,g){g[dr]=e.parseTwoDigitYear(f)}),ft("Y",function(f,g){g[dr]=parseInt(f,10)});function na(f){return Tl(f)?366:365}e.parseTwoDigitYear=function(f){return Ve(f)+(Ve(f)>68?1900:2e3)};var Up=Ys("FullYear",!0);function Tv(){return Tl(this.year())}function Ys(f,g){return function(w){return w!=null?(sa(this,f,w),e.updateOffset(this,g),this):ia(this,f)}}function ia(f,g){if(!f.isValid())return NaN;var w=f._d,C=f._isUTC;switch(g){case"Milliseconds":return C?w.getUTCMilliseconds():w.getMilliseconds();case"Seconds":return C?w.getUTCSeconds():w.getSeconds();case"Minutes":return C?w.getUTCMinutes():w.getMinutes();case"Hours":return C?w.getUTCHours():w.getHours();case"Date":return C?w.getUTCDate():w.getDate();case"Day":return C?w.getUTCDay():w.getDay();case"Month":return C?w.getUTCMonth():w.getMonth();case"FullYear":return C?w.getUTCFullYear():w.getFullYear();default:return NaN}}function sa(f,g,w){var C,T,H,K,de;if(!(!f.isValid()||isNaN(w))){switch(C=f._d,T=f._isUTC,g){case"Milliseconds":return void(T?C.setUTCMilliseconds(w):C.setMilliseconds(w));case"Seconds":return void(T?C.setUTCSeconds(w):C.setSeconds(w));case"Minutes":return void(T?C.setUTCMinutes(w):C.setMinutes(w));case"Hours":return void(T?C.setUTCHours(w):C.setHours(w));case"Date":return void(T?C.setUTCDate(w):C.setDate(w));case"FullYear":break;default:return}H=w,K=f.month(),de=f.date(),de=de===29&&K===1&&!Tl(H)?28:de,T?C.setUTCFullYear(H,K,de):C.setFullYear(H,K,de)}}function $v(f){return f=ge(f),U(this[f])?this[f]():this}function $l(f,g){if(typeof f=="object"){f=we(f);var w=Ct(f),C,T=w.length;for(C=0;C<T;C++)this[w[C].unit](f[w[C].unit])}else if(f=ge(f),U(this[f]))return this[f](g);return this}function Nv(f,g){return(f%g+g)%g}var Ut;Array.prototype.indexOf?Ut=Array.prototype.indexOf:Ut=function(f){var g;for(g=0;g<this.length;++g)if(this[g]===f)return g;return-1};function zc(f,g){if(isNaN(f)||isNaN(g))return NaN;var w=Nv(g,12);return f+=(g-w)/12,w===1?Tl(f)?29:28:31-w%7%2}he("M",["MM",2],"Mo",function(){return this.month()+1}),he("MMM",0,0,function(f){return this.localeData().monthsShort(this,f)}),he("MMMM",0,0,function(f){return this.localeData().months(this,f)}),me("M",qe,ls),me("MM",qe,oe),me("MMM",function(f,g){return g.monthsShortRegex(f)}),me("MMMM",function(f,g){return g.monthsRegex(f)}),ft(["M","MM"],function(f,g){g[Qn]=Ve(f)-1}),ft(["MMM","MMMM"],function(f,g,w,C){var T=w._locale.monthsParse(f,C,w._strict);T!=null?g[Qn]=T:q(w).invalidMonth=f});var Hp="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Jc="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Gc=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Mv=ta,Fv=ta;function Dv(f,g){return f?n(this._months)?this._months[f.month()]:this._months[(this._months.isFormat||Gc).test(g)?"format":"standalone"][f.month()]:n(this._months)?this._months:this._months.standalone}function jv(f,g){return f?n(this._monthsShort)?this._monthsShort[f.month()]:this._monthsShort[Gc.test(g)?"format":"standalone"][f.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Bp(f,g,w){var C,T,H,K=f.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],C=0;C<12;++C)H=y([2e3,C]),this._shortMonthsParse[C]=this.monthsShort(H,"").toLocaleLowerCase(),this._longMonthsParse[C]=this.months(H,"").toLocaleLowerCase();return w?g==="MMM"?(T=Ut.call(this._shortMonthsParse,K),T!==-1?T:null):(T=Ut.call(this._longMonthsParse,K),T!==-1?T:null):g==="MMM"?(T=Ut.call(this._shortMonthsParse,K),T!==-1?T:(T=Ut.call(this._longMonthsParse,K),T!==-1?T:null)):(T=Ut.call(this._longMonthsParse,K),T!==-1?T:(T=Ut.call(this._shortMonthsParse,K),T!==-1?T:null))}function Vp(f,g,w){var C,T,H;if(this._monthsParseExact)return Bp.call(this,f,g,w);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),C=0;C<12;C++){if(T=y([2e3,C]),w&&!this._longMonthsParse[C]&&(this._longMonthsParse[C]=new RegExp("^"+this.months(T,"").replace(".","")+"$","i"),this._shortMonthsParse[C]=new RegExp("^"+this.monthsShort(T,"").replace(".","")+"$","i")),!w&&!this._monthsParse[C]&&(H="^"+this.months(T,"")+"|^"+this.monthsShort(T,""),this._monthsParse[C]=new RegExp(H.replace(".",""),"i")),w&&g==="MMMM"&&this._longMonthsParse[C].test(f))return C;if(w&&g==="MMM"&&this._shortMonthsParse[C].test(f))return C;if(!w&&this._monthsParse[C].test(f))return C}}function Yc(f,g){if(!f.isValid())return f;if(typeof g=="string"){if(/^\d+$/.test(g))g=Ve(g);else if(g=f.localeData().monthsParse(g),!c(g))return f}var w=g,C=f.date();return C=C<29?C:Math.min(C,zc(f.year(),w)),f._isUTC?f._d.setUTCMonth(w,C):f._d.setMonth(w,C),f}function Nl(f){return f!=null?(Yc(this,f),e.updateOffset(this,!0),this):ia(this,"Month")}function Lv(){return zc(this.year(),this.month())}function Wp(f){return this._monthsParseExact?(s(this,"_monthsRegex")||Kc.call(this),f?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=Mv),this._monthsShortStrictRegex&&f?this._monthsShortStrictRegex:this._monthsShortRegex)}function Ml(f){return this._monthsParseExact?(s(this,"_monthsRegex")||Kc.call(this),f?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=Fv),this._monthsStrictRegex&&f?this._monthsStrictRegex:this._monthsRegex)}function Kc(){function f(Ie,ze){return ze.length-Ie.length}var g=[],w=[],C=[],T,H,K,de;for(T=0;T<12;T++)H=y([2e3,T]),K=kn(this.monthsShort(H,"")),de=kn(this.months(H,"")),g.push(K),w.push(de),C.push(de),C.push(K);g.sort(f),w.sort(f),C.sort(f),this._monthsRegex=new RegExp("^("+C.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+w.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+g.join("|")+")","i")}function Uv(f,g,w,C,T,H,K){var de;return f<100&&f>=0?(de=new Date(f+400,g,w,C,T,H,K),isFinite(de.getFullYear())&&de.setFullYear(f)):de=new Date(f,g,w,C,T,H,K),de}function Ks(f){var g,w;return f<100&&f>=0?(w=Array.prototype.slice.call(arguments),w[0]=f+400,g=new Date(Date.UTC.apply(null,w)),isFinite(g.getUTCFullYear())&&g.setUTCFullYear(f)):g=new Date(Date.UTC.apply(null,arguments)),g}function oa(f,g,w){var C=7+g-w,T=(7+Ks(f,0,C).getUTCDay()-g)%7;return-T+C-1}function Fl(f,g,w,C,T){var H=(7+w-C)%7,K=oa(f,C,T),de=1+7*(g-1)+H+K,Ie,ze;return de<=0?(Ie=f-1,ze=na(Ie)+de):de>na(f)?(Ie=f+1,ze=de-na(f)):(Ie=f,ze=de),{year:Ie,dayOfYear:ze}}function aa(f,g,w){var C=oa(f.year(),g,w),T=Math.floor((f.dayOfYear()-C-1)/7)+1,H,K;return T<1?(K=f.year()-1,H=T+Tn(K,g,w)):T>Tn(f.year(),g,w)?(H=T-Tn(f.year(),g,w),K=f.year()+1):(K=f.year(),H=T),{week:H,year:K}}function Tn(f,g,w){var C=oa(f,g,w),T=oa(f+1,g,w);return(na(f)-C+T)/7}he("w",["ww",2],"wo","week"),he("W",["WW",2],"Wo","isoWeek"),me("w",qe,ls),me("ww",qe,oe),me("W",qe,ls),me("WW",qe,oe),ra(["w","ww","W","WW"],function(f,g,w,C){g[C.substr(0,1)]=Ve(f)});function Qc(f){return aa(f,this._week.dow,this._week.doy).week}var Zc={dow:0,doy:6};function Qs(){return this._week.dow}function zp(){return this._week.doy}function Jp(f){var g=this.localeData().week(this);return f==null?g:this.add((f-g)*7,"d")}function Hv(f){var g=aa(this,1,4).week;return f==null?g:this.add((f-g)*7,"d")}he("d",0,"do","day"),he("dd",0,0,function(f){return this.localeData().weekdaysMin(this,f)}),he("ddd",0,0,function(f){return this.localeData().weekdaysShort(this,f)}),he("dddd",0,0,function(f){return this.localeData().weekdays(this,f)}),he("e",0,0,"weekday"),he("E",0,0,"isoWeekday"),me("d",qe),me("e",qe),me("E",qe),me("dd",function(f,g){return g.weekdaysMinRegex(f)}),me("ddd",function(f,g){return g.weekdaysShortRegex(f)}),me("dddd",function(f,g){return g.weekdaysRegex(f)}),ra(["dd","ddd","dddd"],function(f,g,w,C){var T=w._locale.weekdaysParse(f,C,w._strict);T!=null?g.d=T:q(w).invalidWeekday=f}),ra(["d","e","E"],function(f,g,w,C){g[C]=Ve(f)});function Gp(f,g){return typeof f!="string"?f:isNaN(f)?(f=g.weekdaysParse(f),typeof f=="number"?f:null):parseInt(f,10)}function Yp(f,g){return typeof f=="string"?g.weekdaysParse(f)%7||7:isNaN(f)?null:f}function Dl(f,g){return f.slice(g,7).concat(f.slice(0,g))}var Kp="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Qp="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Bv="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Vv=ta,Zp=ta,Wv=ta;function zv(f,g){var w=n(this._weekdays)?this._weekdays:this._weekdays[f&&f!==!0&&this._weekdays.isFormat.test(g)?"format":"standalone"];return f===!0?Dl(w,this._week.dow):f?w[f.day()]:w}function Jv(f){return f===!0?Dl(this._weekdaysShort,this._week.dow):f?this._weekdaysShort[f.day()]:this._weekdaysShort}function Gv(f){return f===!0?Dl(this._weekdaysMin,this._week.dow):f?this._weekdaysMin[f.day()]:this._weekdaysMin}function Xc(f,g,w){var C,T,H,K=f.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],C=0;C<7;++C)H=y([2e3,1]).day(C),this._minWeekdaysParse[C]=this.weekdaysMin(H,"").toLocaleLowerCase(),this._shortWeekdaysParse[C]=this.weekdaysShort(H,"").toLocaleLowerCase(),this._weekdaysParse[C]=this.weekdays(H,"").toLocaleLowerCase();return w?g==="dddd"?(T=Ut.call(this._weekdaysParse,K),T!==-1?T:null):g==="ddd"?(T=Ut.call(this._shortWeekdaysParse,K),T!==-1?T:null):(T=Ut.call(this._minWeekdaysParse,K),T!==-1?T:null):g==="dddd"?(T=Ut.call(this._weekdaysParse,K),T!==-1||(T=Ut.call(this._shortWeekdaysParse,K),T!==-1)?T:(T=Ut.call(this._minWeekdaysParse,K),T!==-1?T:null)):g==="ddd"?(T=Ut.call(this._shortWeekdaysParse,K),T!==-1||(T=Ut.call(this._weekdaysParse,K),T!==-1)?T:(T=Ut.call(this._minWeekdaysParse,K),T!==-1?T:null)):(T=Ut.call(this._minWeekdaysParse,K),T!==-1||(T=Ut.call(this._weekdaysParse,K),T!==-1)?T:(T=Ut.call(this._shortWeekdaysParse,K),T!==-1?T:null))}function Yv(f,g,w){var C,T,H;if(this._weekdaysParseExact)return Xc.call(this,f,g,w);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),C=0;C<7;C++){if(T=y([2e3,1]).day(C),w&&!this._fullWeekdaysParse[C]&&(this._fullWeekdaysParse[C]=new RegExp("^"+this.weekdays(T,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[C]=new RegExp("^"+this.weekdaysShort(T,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[C]=new RegExp("^"+this.weekdaysMin(T,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[C]||(H="^"+this.weekdays(T,"")+"|^"+this.weekdaysShort(T,"")+"|^"+this.weekdaysMin(T,""),this._weekdaysParse[C]=new RegExp(H.replace(".",""),"i")),w&&g==="dddd"&&this._fullWeekdaysParse[C].test(f))return C;if(w&&g==="ddd"&&this._shortWeekdaysParse[C].test(f))return C;if(w&&g==="dd"&&this._minWeekdaysParse[C].test(f))return C;if(!w&&this._weekdaysParse[C].test(f))return C}}function Kv(f){if(!this.isValid())return f!=null?this:NaN;var g=ia(this,"Day");return f!=null?(f=Gp(f,this.localeData()),this.add(f-g,"d")):g}function Qv(f){if(!this.isValid())return f!=null?this:NaN;var g=(this.day()+7-this.localeData()._week.dow)%7;return f==null?g:this.add(f-g,"d")}function Zv(f){if(!this.isValid())return f!=null?this:NaN;if(f!=null){var g=Yp(f,this.localeData());return this.day(this.day()%7?g:g-7)}else return this.day()||7}function Xv(f){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||ef.call(this),f?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=Vv),this._weekdaysStrictRegex&&f?this._weekdaysStrictRegex:this._weekdaysRegex)}function Pt(f){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||ef.call(this),f?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Zp),this._weekdaysShortStrictRegex&&f?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Et(f){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||ef.call(this),f?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Wv),this._weekdaysMinStrictRegex&&f?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function ef(){function f(tr,ii){return ii.length-tr.length}var g=[],w=[],C=[],T=[],H,K,de,Ie,ze;for(H=0;H<7;H++)K=y([2e3,1]).day(H),de=kn(this.weekdaysMin(K,"")),Ie=kn(this.weekdaysShort(K,"")),ze=kn(this.weekdays(K,"")),g.push(de),w.push(Ie),C.push(ze),T.push(de),T.push(Ie),T.push(ze);g.sort(f),w.sort(f),C.sort(f),T.sort(f),this._weekdaysRegex=new RegExp("^("+T.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+C.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+w.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+g.join("|")+")","i")}function tf(){return this.hours()%12||12}function eb(){return this.hours()||24}he("H",["HH",2],0,"hour"),he("h",["hh",2],0,tf),he("k",["kk",2],0,eb),he("hmm",0,0,function(){return""+tf.apply(this)+Re(this.minutes(),2)}),he("hmmss",0,0,function(){return""+tf.apply(this)+Re(this.minutes(),2)+Re(this.seconds(),2)}),he("Hmm",0,0,function(){return""+this.hours()+Re(this.minutes(),2)}),he("Hmmss",0,0,function(){return""+this.hours()+Re(this.minutes(),2)+Re(this.seconds(),2)});function Xp(f,g){he(f,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),g)})}Xp("a",!0),Xp("A",!1);function eh(f,g){return g._meridiemParse}me("a",eh),me("A",eh),me("H",qe,kl),me("h",qe,ls),me("k",qe,ls),me("HH",qe,oe),me("hh",qe,oe),me("kk",qe,oe),me("hmm",Pn),me("hmmss",Ol),me("Hmm",Pn),me("Hmmss",Ol),ft(["H","HH"],Kt),ft(["k","kk"],function(f,g,w){var C=Ve(f);g[Kt]=C===24?0:C}),ft(["a","A"],function(f,g,w){w._isPm=w._locale.isPM(f),w._meridiem=f}),ft(["h","hh"],function(f,g,w){g[Kt]=Ve(f),q(w).bigHour=!0}),ft("hmm",function(f,g,w){var C=f.length-2;g[Kt]=Ve(f.substr(0,C)),g[Kr]=Ve(f.substr(C)),q(w).bigHour=!0}),ft("hmmss",function(f,g,w){var C=f.length-4,T=f.length-2;g[Kt]=Ve(f.substr(0,C)),g[Kr]=Ve(f.substr(C,2)),g[Zn]=Ve(f.substr(T)),q(w).bigHour=!0}),ft("Hmm",function(f,g,w){var C=f.length-2;g[Kt]=Ve(f.substr(0,C)),g[Kr]=Ve(f.substr(C))}),ft("Hmmss",function(f,g,w){var C=f.length-4,T=f.length-2;g[Kt]=Ve(f.substr(0,C)),g[Kr]=Ve(f.substr(C,2)),g[Zn]=Ve(f.substr(T))});function tb(f){return(f+"").toLowerCase().charAt(0)==="p"}var th=/[ap]\.?m?\.?/i,rb=Ys("Hours",!0);function er(f,g,w){return f>11?w?"pm":"PM":w?"am":"AM"}var jl={calendar:fe,longDateFormat:wr,invalidDate:St,ordinal:Ws,dayOfMonthOrdinalParse:At,relativeTime:On,months:Hp,monthsShort:Jc,week:Zc,weekdays:Kp,weekdaysMin:Bv,weekdaysShort:Qp,meridiemParse:th},dt={},Zs={},cs;function Qr(f,g){var w,C=Math.min(f.length,g.length);for(w=0;w<C;w+=1)if(f[w]!==g[w])return w;return C}function rf(f){return f&&f.toLowerCase().replace("_","-")}function rh(f){for(var g=0,w,C,T,H;g<f.length;){for(H=rf(f[g]).split("-"),w=H.length,C=rf(f[g+1]),C=C?C.split("-"):null;w>0;){if(T=la(H.slice(0,w).join("-")),T)return T;if(C&&C.length>=w&&Qr(H,C)>=w-1)break;w--}g++}return cs}function nh(f){return!!(f&&f.match("^[^/\\\\]*$"))}function la(f){var g=null,w;if(dt[f]===void 0&&typeof qu<"u"&&qu&&qu.exports&&nh(f))try{g=cs._abbr,w=require,w("./locale/"+f),Xn(g)}catch{dt[f]=null}return dt[f]}function Xn(f,g){var w;return f&&(l(g)?w=ei(f):w=Ll(f,g),w?cs=w:typeof console<"u"&&console.warn&&console.warn("Locale "+f+" not found. Did you forget to load it?")),cs._abbr}function Ll(f,g){if(g!==null){var w,C=jl;if(g.abbr=f,dt[f]!=null)F("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),C=dt[f]._config;else if(g.parentLocale!=null)if(dt[g.parentLocale]!=null)C=dt[g.parentLocale]._config;else if(w=la(g.parentLocale),w!=null)C=w._config;else return Zs[g.parentLocale]||(Zs[g.parentLocale]=[]),Zs[g.parentLocale].push({name:f,config:g}),null;return dt[f]=new Q(J(C,g)),Zs[f]&&Zs[f].forEach(function(T){Ll(T.name,T.config)}),Xn(f),dt[f]}else return delete dt[f],null}function Nr(f,g){if(g!=null){var w,C,T=jl;dt[f]!=null&&dt[f].parentLocale!=null?dt[f].set(J(dt[f]._config,g)):(C=la(f),C!=null&&(T=C._config),g=J(T,g),C==null&&(g.abbr=f),w=new Q(g),w.parentLocale=dt[f],dt[f]=w),Xn(f)}else dt[f]!=null&&(dt[f].parentLocale!=null?(dt[f]=dt[f].parentLocale,f===Xn()&&Xn(f)):dt[f]!=null&&delete dt[f]);return dt[f]}function ei(f){var g;if(f&&f._locale&&f._locale._abbr&&(f=f._locale._abbr),!f)return cs;if(!n(f)){if(g=la(f),g)return g;f=[f]}return rh(f)}function Mr(){return se(dt)}function nf(f){var g,w=f._a;return w&&q(f).overflow===-2&&(g=w[Qn]<0||w[Qn]>11?Qn:w[An]<1||w[An]>zc(w[dr],w[Qn])?An:w[Kt]<0||w[Kt]>24||w[Kt]===24&&(w[Kr]!==0||w[Zn]!==0||w[us]!==0)?Kt:w[Kr]<0||w[Kr]>59?Kr:w[Zn]<0||w[Zn]>59?Zn:w[us]<0||w[us]>999?us:-1,q(f)._overflowDayOfYear&&(g<dr||g>An)&&(g=An),q(f)._overflowWeeks&&g===-1&&(g=Lp),q(f)._overflowWeekday&&g===-1&&(g=Av),q(f).overflow=g),f}var ih=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,$i=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ul=/Z|[+-]\d\d(?::?\d\d)?/,Xs=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],qt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Ni=/^\/?Date\((-?\d+)/i,sf=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,nb={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Hl(f){var g,w,C=f._i,T=ih.exec(C)||$i.exec(C),H,K,de,Ie,ze=Xs.length,tr=qt.length;if(T){for(q(f).iso=!0,g=0,w=ze;g<w;g++)if(Xs[g][1].exec(T[1])){K=Xs[g][0],H=Xs[g][2]!==!1;break}if(K==null){f._isValid=!1;return}if(T[3]){for(g=0,w=tr;g<w;g++)if(qt[g][1].exec(T[3])){de=(T[2]||" ")+qt[g][0];break}if(de==null){f._isValid=!1;return}}if(!H&&de!=null){f._isValid=!1;return}if(T[4])if(Ul.exec(T[4]))Ie="Z";else{f._isValid=!1;return}f._f=K+(de||"")+(Ie||""),Vl(f)}else f._isValid=!1}function ib(f,g,w,C,T,H){var K=[sb(f),Jc.indexOf(g),parseInt(w,10),parseInt(C,10),parseInt(T,10)];return H&&K.push(parseInt(H,10)),K}function sb(f){var g=parseInt(f,10);return g<=49?2e3+g:g<=999?1900+g:g}function ob(f){return f.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function sh(f,g,w){if(f){var C=Qp.indexOf(f),T=new Date(g[0],g[1],g[2]).getDay();if(C!==T)return q(w).weekdayMismatch=!0,w._isValid=!1,!1}return!0}function Bl(f,g,w){if(f)return nb[f];if(g)return 0;var C=parseInt(w,10),T=C%100,H=(C-T)/100;return H*60+T}function fs(f){var g=sf.exec(ob(f._i)),w;if(g){if(w=ib(g[4],g[3],g[2],g[5],g[6],g[7]),!sh(g[1],w,f))return;f._a=w,f._tzm=Bl(g[8],g[9],g[10]),f._d=Ks.apply(null,f._a),f._d.setUTCMinutes(f._d.getUTCMinutes()-f._tzm),q(f).rfc2822=!0}else f._isValid=!1}function ab(f){var g=Ni.exec(f._i);if(g!==null){f._d=new Date(+g[1]);return}if(Hl(f),f._isValid===!1)delete f._isValid;else return;if(fs(f),f._isValid===!1)delete f._isValid;else return;f._strict?f._isValid=!1:e.createFromInputFallback(f)}e.createFromInputFallback=_("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(f){f._d=new Date(f._i+(f._useUTC?" UTC":""))});function ds(f,g,w){return f??g??w}function oh(f){var g=new Date(e.now());return f._useUTC?[g.getUTCFullYear(),g.getUTCMonth(),g.getUTCDate()]:[g.getFullYear(),g.getMonth(),g.getDate()]}function ua(f){var g,w,C=[],T,H,K;if(!f._d){for(T=oh(f),f._w&&f._a[An]==null&&f._a[Qn]==null&&of(f),f._dayOfYear!=null&&(K=ds(f._a[dr],T[dr]),(f._dayOfYear>na(K)||f._dayOfYear===0)&&(q(f)._overflowDayOfYear=!0),w=Ks(K,0,f._dayOfYear),f._a[Qn]=w.getUTCMonth(),f._a[An]=w.getUTCDate()),g=0;g<3&&f._a[g]==null;++g)f._a[g]=C[g]=T[g];for(;g<7;g++)f._a[g]=C[g]=f._a[g]==null?g===2?1:0:f._a[g];f._a[Kt]===24&&f._a[Kr]===0&&f._a[Zn]===0&&f._a[us]===0&&(f._nextDay=!0,f._a[Kt]=0),f._d=(f._useUTC?Ks:Uv).apply(null,C),H=f._useUTC?f._d.getUTCDay():f._d.getDay(),f._tzm!=null&&f._d.setUTCMinutes(f._d.getUTCMinutes()-f._tzm),f._nextDay&&(f._a[Kt]=24),f._w&&typeof f._w.d<"u"&&f._w.d!==H&&(q(f).weekdayMismatch=!0)}}function of(f){var g,w,C,T,H,K,de,Ie,ze;g=f._w,g.GG!=null||g.W!=null||g.E!=null?(H=1,K=4,w=ds(g.GG,f._a[dr],aa(yt(),1,4).year),C=ds(g.W,1),T=ds(g.E,1),(T<1||T>7)&&(Ie=!0)):(H=f._locale._week.dow,K=f._locale._week.doy,ze=aa(yt(),H,K),w=ds(g.gg,f._a[dr],ze.year),C=ds(g.w,ze.week),g.d!=null?(T=g.d,(T<0||T>6)&&(Ie=!0)):g.e!=null?(T=g.e+H,(g.e<0||g.e>6)&&(Ie=!0)):T=H),C<1||C>Tn(w,H,K)?q(f)._overflowWeeks=!0:Ie!=null?q(f)._overflowWeekday=!0:(de=Fl(w,C,T,H,K),f._a[dr]=de.year,f._dayOfYear=de.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function Vl(f){if(f._f===e.ISO_8601){Hl(f);return}if(f._f===e.RFC_2822){fs(f);return}f._a=[],q(f).empty=!0;var g=""+f._i,w,C,T,H,K,de=g.length,Ie=0,ze,tr;for(T=$r(f._f,f._locale).match(ye)||[],tr=T.length,w=0;w<tr;w++)H=T[w],C=(g.match(Pv(H,f))||[])[0],C&&(K=g.substr(0,g.indexOf(C)),K.length>0&&q(f).unusedInput.push(K),g=g.slice(g.indexOf(C)+C.length),Ie+=C.length),Nt[H]?(C?q(f).empty=!1:q(f).unusedTokens.push(H),Wc(H,C,f)):f._strict&&!C&&q(f).unusedTokens.push(H);q(f).charsLeftOver=de-Ie,g.length>0&&q(f).unusedInput.push(g),f._a[Kt]<=12&&q(f).bigHour===!0&&f._a[Kt]>0&&(q(f).bigHour=void 0),q(f).parsedDateParts=f._a.slice(0),q(f).meridiem=f._meridiem,f._a[Kt]=lb(f._locale,f._a[Kt],f._meridiem),ze=q(f).era,ze!==null&&(f._a[dr]=f._locale.erasConvertYear(ze,f._a[dr])),ua(f),nf(f)}function lb(f,g,w){var C;return w==null?g:f.meridiemHour!=null?f.meridiemHour(g,w):(f.isPM!=null&&(C=f.isPM(w),C&&g<12&&(g+=12),!C&&g===12&&(g=0)),g)}function af(f){var g,w,C,T,H,K,de=!1,Ie=f._f.length;if(Ie===0){q(f).invalidFormat=!0,f._d=new Date(NaN);return}for(T=0;T<Ie;T++)H=0,K=!1,g=P({},f),f._useUTC!=null&&(g._useUTC=f._useUTC),g._f=f._f[T],Vl(g),v(g)&&(K=!0),H+=q(g).charsLeftOver,H+=q(g).unusedTokens.length*10,q(g).score=H,de?H<C&&(C=H,w=g):(C==null||H<C||K)&&(C=H,w=g,K&&(de=!0));m(f,w||g)}function lf(f){if(!f._d){var g=we(f._i),w=g.day===void 0?g.date:g.day;f._a=p([g.year,g.month,w,g.hour,g.minute,g.second,g.millisecond],function(C){return C&&parseInt(C,10)}),ua(f)}}function ub(f){var g=new M(nf(uf(f)));return g._nextDay&&(g.add(1,"d"),g._nextDay=void 0),g}function uf(f){var g=f._i,w=f._f;return f._locale=f._locale||ei(f._l),g===null||w===void 0&&g===""?R({nullInput:!0}):(typeof g=="string"&&(f._i=g=f._locale.preparse(g)),j(g)?new M(nf(g)):(d(g)?f._d=g:n(w)?af(f):w?Vl(f):Fr(f),v(f)||(f._d=null),f))}function Fr(f){var g=f._i;l(g)?f._d=new Date(e.now()):d(g)?f._d=new Date(g.valueOf()):typeof g=="string"?ab(f):n(g)?(f._a=p(g.slice(0),function(w){return parseInt(w,10)}),ua(f)):i(g)?lf(f):c(g)?f._d=new Date(g):e.createFromInputFallback(f)}function Wl(f,g,w,C,T){var H={};return(g===!0||g===!1)&&(C=g,g=void 0),(w===!0||w===!1)&&(C=w,w=void 0),(i(f)&&o(f)||n(f)&&f.length===0)&&(f=void 0),H._isAMomentObject=!0,H._useUTC=H._isUTC=T,H._l=w,H._i=f,H._f=g,H._strict=C,ub(H)}function yt(f,g,w,C){return Wl(f,g,w,C,!1)}var ah=_("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var f=yt.apply(null,arguments);return this.isValid()&&f.isValid()?f<this?this:f:R()}),lh=_("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var f=yt.apply(null,arguments);return this.isValid()&&f.isValid()?f>this?this:f:R()});function uh(f,g){var w,C;if(g.length===1&&n(g[0])&&(g=g[0]),!g.length)return yt();for(w=g[0],C=1;C<g.length;++C)(!g[C].isValid()||g[C][f](w))&&(w=g[C]);return w}function cb(){var f=[].slice.call(arguments,0);return uh("isBefore",f)}function fb(){var f=[].slice.call(arguments,0);return uh("isAfter",f)}var db=function(){return Date.now?Date.now():+new Date},ca=["year","quarter","month","week","day","hour","minute","second","millisecond"];function eo(f){var g,w=!1,C,T=ca.length;for(g in f)if(s(f,g)&&!(Ut.call(ca,g)!==-1&&(f[g]==null||!isNaN(f[g]))))return!1;for(C=0;C<T;++C)if(f[ca[C]]){if(w)return!1;parseFloat(f[ca[C]])!==Ve(f[ca[C]])&&(w=!0)}return!0}function pb(){return this._isValid}function hb(){return vt(NaN)}function to(f){var g=we(f),w=g.year||0,C=g.quarter||0,T=g.month||0,H=g.week||g.isoWeek||0,K=g.day||0,de=g.hour||0,Ie=g.minute||0,ze=g.second||0,tr=g.millisecond||0;this._isValid=eo(g),this._milliseconds=+tr+ze*1e3+Ie*6e4+de*1e3*60*60,this._days=+K+H*7,this._months=+T+C*3+w*12,this._data={},this._locale=ei(),this._bubble()}function fa(f){return f instanceof to}function $n(f){return f<0?Math.round(-1*f)*-1:Math.round(f)}function zl(f,g,w){var C=Math.min(f.length,g.length),T=Math.abs(f.length-g.length),H=0,K;for(K=0;K<C;K++)(w&&f[K]!==g[K]||!w&&Ve(f[K])!==Ve(g[K]))&&H++;return H+T}function ch(f,g){he(f,0,0,function(){var w=this.utcOffset(),C="+";return w<0&&(w=-w,C="-"),C+Re(~~(w/60),2)+g+Re(~~w%60,2)})}ch("Z",":"),ch("ZZ",""),me("Z",Pl),me("ZZ",Pl),ft(["Z","ZZ"],function(f,g,w){w._useUTC=!0,w._tzm=cf(Pl,f)});var mb=/([\+\-]|\d\d)/gi;function cf(f,g){var w=(g||"").match(f),C,T,H;return w===null?null:(C=w[w.length-1]||[],T=(C+"").match(mb)||["-",0,0],H=+(T[1]*60)+Ve(T[2]),H===0?0:T[0]==="+"?H:-H)}function Mi(f,g){var w,C;return g._isUTC?(w=g.clone(),C=(j(f)||d(f)?f.valueOf():yt(f).valueOf())-w.valueOf(),w._d.setTime(w._d.valueOf()+C),e.updateOffset(w,!1),w):yt(f).local()}function Dr(f){return-Math.round(f._d.getTimezoneOffset())}e.updateOffset=function(){};function fh(f,g,w){var C=this._offset||0,T;if(!this.isValid())return f!=null?this:NaN;if(f!=null){if(typeof f=="string"){if(f=cf(Pl,f),f===null)return this}else Math.abs(f)<16&&!w&&(f=f*60);return!this._isUTC&&g&&(T=Dr(this)),this._offset=f,this._isUTC=!0,T!=null&&this.add(T,"m"),C!==f&&(!g||this._changeInProgress?da(this,vt(f-C,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?C:Dr(this)}function gb(f,g){return f!=null?(typeof f!="string"&&(f=-f),this.utcOffset(f,g),this):-this.utcOffset()}function yb(f){return this.utcOffset(0,f)}function vb(f){return this._isUTC&&(this.utcOffset(0,f),this._isUTC=!1,f&&this.subtract(Dr(this),"m")),this}function bb(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var f=cf(Bc,this._i);f!=null?this.utcOffset(f):this.utcOffset(0,!0)}return this}function Sb(f){return this.isValid()?(f=f?yt(f).utcOffset():0,(this.utcOffset()-f)%60===0):!1}function Fi(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function W(){if(!l(this._isDSTShifted))return this._isDSTShifted;var f={},g;return P(f,this),f=uf(f),f._a?(g=f._isUTC?y(f._a):yt(f._a),this._isDSTShifted=this.isValid()&&zl(f._a,g.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Z(){return this.isValid()?!this._isUTC:!1}function Y(){return this.isValid()?this._isUTC:!1}function pe(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Oe=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,ut=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function vt(f,g){var w=f,C=null,T,H,K;return fa(f)?w={ms:f._milliseconds,d:f._days,M:f._months}:c(f)||!isNaN(+f)?(w={},g?w[g]=+f:w.milliseconds=+f):(C=Oe.exec(f))?(T=C[1]==="-"?-1:1,w={y:0,d:Ve(C[An])*T,h:Ve(C[Kt])*T,m:Ve(C[Kr])*T,s:Ve(C[Zn])*T,ms:Ve($n(C[us]*1e3))*T}):(C=ut.exec(f))?(T=C[1]==="-"?-1:1,w={y:Xe(C[2],T),M:Xe(C[3],T),w:Xe(C[4],T),d:Xe(C[5],T),h:Xe(C[6],T),m:Xe(C[7],T),s:Xe(C[8],T)}):w==null?w={}:typeof w=="object"&&("from"in w||"to"in w)&&(K=wb(yt(w.from),yt(w.to)),w={},w.ms=K.milliseconds,w.M=K.months),H=new to(w),fa(f)&&s(f,"_locale")&&(H._locale=f._locale),fa(f)&&s(f,"_isValid")&&(H._isValid=f._isValid),H}vt.fn=to.prototype,vt.invalid=hb;function Xe(f,g){var w=f&&parseFloat(f.replace(",","."));return(isNaN(w)?0:w)*g}function Jl(f,g){var w={};return w.months=g.month()-f.month()+(g.year()-f.year())*12,f.clone().add(w.months,"M").isAfter(g)&&--w.months,w.milliseconds=+g-+f.clone().add(w.months,"M"),w}function wb(f,g){var w;return f.isValid()&&g.isValid()?(g=Mi(g,f),f.isBefore(g)?w=Jl(f,g):(w=Jl(g,f),w.milliseconds=-w.milliseconds,w.months=-w.months),w):{milliseconds:0,months:0}}function jr(f,g){return function(w,C){var T,H;return C!==null&&!isNaN(+C)&&(F(g,"moment()."+g+"(period, number) is deprecated. Please use moment()."+g+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),H=w,w=C,C=H),T=vt(w,C),da(this,T,f),this}}function da(f,g,w,C){var T=g._milliseconds,H=$n(g._days),K=$n(g._months);f.isValid()&&(C=C??!0,K&&Yc(f,ia(f,"Month")+K*w),H&&sa(f,"Date",ia(f,"Date")+H*w),T&&f._d.setTime(f._d.valueOf()+T*w),C&&e.updateOffset(f,H||K))}var _b=jr(1,"add"),ro=jr(-1,"subtract");function pa(f){return typeof f=="string"||f instanceof String}function Gl(f){return j(f)||d(f)||pa(f)||c(f)||Rb(f)||pt(f)||f===null||f===void 0}function pt(f){var g=i(f)&&!o(f),w=!1,C=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],T,H,K=C.length;for(T=0;T<K;T+=1)H=C[T],w=w||s(f,H);return g&&w}function Rb(f){var g=n(f),w=!1;return g&&(w=f.filter(function(C){return!c(C)&&pa(f)}).length===0),g&&w}function dh(f){var g=i(f)&&!o(f),w=!1,C=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],T,H;for(T=0;T<C.length;T+=1)H=C[T],w=w||s(f,H);return g&&w}function Yl(f,g){var w=f.diff(g,"days",!0);return w<-6?"sameElse":w<-1?"lastWeek":w<0?"lastDay":w<1?"sameDay":w<2?"nextDay":w<7?"nextWeek":"sameElse"}function xb(f,g){arguments.length===1&&(arguments[0]?Gl(arguments[0])?(f=arguments[0],g=void 0):dh(arguments[0])&&(g=arguments[0],f=void 0):(f=void 0,g=void 0));var w=f||yt(),C=Mi(w,this).startOf("day"),T=e.calendarFormat(this,C)||"sameElse",H=g&&(U(g[T])?g[T].call(this,w):g[T]);return this.format(H||this.localeData().calendar(T,this,yt(w)))}function Cb(){return new M(this)}function Eb(f,g){var w=j(f)?f:yt(f);return this.isValid()&&w.isValid()?(g=ge(g)||"millisecond",g==="millisecond"?this.valueOf()>w.valueOf():w.valueOf()<this.clone().startOf(g).valueOf()):!1}function Kl(f,g){var w=j(f)?f:yt(f);return this.isValid()&&w.isValid()?(g=ge(g)||"millisecond",g==="millisecond"?this.valueOf()<w.valueOf():this.clone().endOf(g).valueOf()<w.valueOf()):!1}function Di(f,g,w,C){var T=j(f)?f:yt(f),H=j(g)?g:yt(g);return this.isValid()&&T.isValid()&&H.isValid()?(C=C||"()",(C[0]==="("?this.isAfter(T,w):!this.isBefore(T,w))&&(C[1]===")"?this.isBefore(H,w):!this.isAfter(H,w))):!1}function Ql(f,g){var w=j(f)?f:yt(f),C;return this.isValid()&&w.isValid()?(g=ge(g)||"millisecond",g==="millisecond"?this.valueOf()===w.valueOf():(C=w.valueOf(),this.clone().startOf(g).valueOf()<=C&&C<=this.clone().endOf(g).valueOf())):!1}function ph(f,g){return this.isSame(f,g)||this.isAfter(f,g)}function Zl(f,g){return this.isSame(f,g)||this.isBefore(f,g)}function hh(f,g,w){var C,T,H;if(!this.isValid())return NaN;if(C=Mi(f,this),!C.isValid())return NaN;switch(T=(C.utcOffset()-this.utcOffset())*6e4,g=ge(g),g){case"year":H=ha(this,C)/12;break;case"month":H=ha(this,C);break;case"quarter":H=ha(this,C)/3;break;case"second":H=(this-C)/1e3;break;case"minute":H=(this-C)/6e4;break;case"hour":H=(this-C)/36e5;break;case"day":H=(this-C-T)/864e5;break;case"week":H=(this-C-T)/6048e5;break;default:H=this-C}return w?H:Yr(H)}function ha(f,g){if(f.date()<g.date())return-ha(g,f);var w=(g.year()-f.year())*12+(g.month()-f.month()),C=f.clone().add(w,"months"),T,H;return g-C<0?(T=f.clone().add(w-1,"months"),H=(g-C)/(C-T)):(T=f.clone().add(w+1,"months"),H=(g-C)/(T-C)),-(w+H)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Xl(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function mh(f){if(!this.isValid())return null;var g=f!==!0,w=g?this.clone().utc():this;return w.year()<0||w.year()>9999?lt(w,g?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):U(Date.prototype.toISOString)?g?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",lt(w,"Z")):lt(w,g?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function ma(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var f="moment",g="",w,C,T,H;return this.isLocal()||(f=this.utcOffset()===0?"moment.utc":"moment.parseZone",g="Z"),w="["+f+'("]',C=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",T="-MM-DD[T]HH:mm:ss.SSS",H=g+'[")]',this.format(w+C+T+H)}function ps(f){f||(f=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var g=lt(this,f);return this.localeData().postformat(g)}function eu(f,g){return this.isValid()&&(j(f)&&f.isValid()||yt(f).isValid())?vt({to:this,from:f}).locale(this.locale()).humanize(!g):this.localeData().invalidDate()}function qb(f){return this.from(yt(),f)}function Ib(f,g){return this.isValid()&&(j(f)&&f.isValid()||yt(f).isValid())?vt({from:this,to:f}).locale(this.locale()).humanize(!g):this.localeData().invalidDate()}function Ob(f){return this.to(yt(),f)}function ga(f){var g;return f===void 0?this._locale._abbr:(g=ei(f),g!=null&&(this._locale=g),this)}var ya=_("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(f){return f===void 0?this.localeData():this.locale(f)});function tu(){return this._locale}var ru=1e3,hs=60*ru,nu=60*hs,gh=(365*400+97)*24*nu;function Tt(f,g){return(f%g+g)%g}function ar(f,g,w){return f<100&&f>=0?new Date(f+400,g,w)-gh:new Date(f,g,w).valueOf()}function yh(f,g,w){return f<100&&f>=0?Date.UTC(f+400,g,w)-gh:Date.UTC(f,g,w)}function Pb(f){var g,w;if(f=ge(f),f===void 0||f==="millisecond"||!this.isValid())return this;switch(w=this._isUTC?yh:ar,f){case"year":g=w(this.year(),0,1);break;case"quarter":g=w(this.year(),this.month()-this.month()%3,1);break;case"month":g=w(this.year(),this.month(),1);break;case"week":g=w(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":g=w(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":g=w(this.year(),this.month(),this.date());break;case"hour":g=this._d.valueOf(),g-=Tt(g+(this._isUTC?0:this.utcOffset()*hs),nu);break;case"minute":g=this._d.valueOf(),g-=Tt(g,hs);break;case"second":g=this._d.valueOf(),g-=Tt(g,ru);break}return this._d.setTime(g),e.updateOffset(this,!0),this}function vh(f){var g,w;if(f=ge(f),f===void 0||f==="millisecond"||!this.isValid())return this;switch(w=this._isUTC?yh:ar,f){case"year":g=w(this.year()+1,0,1)-1;break;case"quarter":g=w(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":g=w(this.year(),this.month()+1,1)-1;break;case"week":g=w(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":g=w(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":g=w(this.year(),this.month(),this.date()+1)-1;break;case"hour":g=this._d.valueOf(),g+=nu-Tt(g+(this._isUTC?0:this.utcOffset()*hs),nu)-1;break;case"minute":g=this._d.valueOf(),g+=hs-Tt(g,hs)-1;break;case"second":g=this._d.valueOf(),g+=ru-Tt(g,ru)-1;break}return this._d.setTime(g),e.updateOffset(this,!0),this}function kb(){return this._d.valueOf()-(this._offset||0)*6e4}function ff(){return Math.floor(this.valueOf()/1e3)}function va(){return new Date(this.valueOf())}function df(){var f=this;return[f.year(),f.month(),f.date(),f.hour(),f.minute(),f.second(),f.millisecond()]}function no(){var f=this;return{years:f.year(),months:f.month(),date:f.date(),hours:f.hours(),minutes:f.minutes(),seconds:f.seconds(),milliseconds:f.milliseconds()}}function ba(){return this.isValid()?this.toISOString():null}function Sa(){return v(this)}function iu(){return m({},q(this))}function io(){return q(this).overflow}function Ab(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}he("N",0,0,"eraAbbr"),he("NN",0,0,"eraAbbr"),he("NNN",0,0,"eraAbbr"),he("NNNN",0,0,"eraName"),he("NNNNN",0,0,"eraNarrow"),he("y",["y",1],"yo","eraYear"),he("y",["yy",2],0,"eraYear"),he("y",["yyy",3],0,"eraYear"),he("y",["yyyy",4],0,"eraYear"),me("N",_r),me("NN",_r),me("NNN",_r),me("NNNN",We),me("NNNNN",Fb),ft(["N","NN","NNN","NNNN","NNNNN"],function(f,g,w,C){var T=w._locale.erasParse(f,C,w._strict);T?q(w).era=T:q(w).invalidEra=f}),me("y",Ti),me("yy",Ti),me("yyy",Ti),me("yyyy",Ti),me("yo",Db),ft(["y","yy","yyy","yyyy"],dr),ft(["yo"],function(f,g,w,C){var T;w._locale._eraYearOrdinalRegex&&(T=f.match(w._locale._eraYearOrdinalRegex)),w._locale.eraYearOrdinalParse?g[dr]=w._locale.eraYearOrdinalParse(f,T):g[dr]=parseInt(f,10)});function Tb(f,g){var w,C,T,H=this._eras||ei("en")._eras;for(w=0,C=H.length;w<C;++w)switch(typeof H[w].since==="string"&&(T=e(H[w].since).startOf("day"),H[w].since=T.valueOf()),typeof H[w].until){case"undefined":H[w].until=1/0;break;case"string":T=e(H[w].until).startOf("day").valueOf(),H[w].until=T.valueOf();break}return H}function $b(f,g,w){var C,T,H=this.eras(),K,de,Ie;for(f=f.toUpperCase(),C=0,T=H.length;C<T;++C)if(K=H[C].name.toUpperCase(),de=H[C].abbr.toUpperCase(),Ie=H[C].narrow.toUpperCase(),w)switch(g){case"N":case"NN":case"NNN":if(de===f)return H[C];break;case"NNNN":if(K===f)return H[C];break;case"NNNNN":if(Ie===f)return H[C];break}else if([K,de,Ie].indexOf(f)>=0)return H[C]}function Nb(f,g){var w=f.since<=f.until?1:-1;return g===void 0?e(f.since).year():e(f.since).year()+(g-f.offset)*w}function Mb(){var f,g,w,C=this.localeData().eras();for(f=0,g=C.length;f<g;++f)if(w=this.clone().startOf("day").valueOf(),C[f].since<=w&&w<=C[f].until||C[f].until<=w&&w<=C[f].since)return C[f].name;return""}function su(){var f,g,w,C=this.localeData().eras();for(f=0,g=C.length;f<g;++f)if(w=this.clone().startOf("day").valueOf(),C[f].since<=w&&w<=C[f].until||C[f].until<=w&&w<=C[f].since)return C[f].narrow;return""}function wa(){var f,g,w,C=this.localeData().eras();for(f=0,g=C.length;f<g;++f)if(w=this.clone().startOf("day").valueOf(),C[f].since<=w&&w<=C[f].until||C[f].until<=w&&w<=C[f].since)return C[f].abbr;return""}function bh(){var f,g,w,C,T=this.localeData().eras();for(f=0,g=T.length;f<g;++f)if(w=T[f].since<=T[f].until?1:-1,C=this.clone().startOf("day").valueOf(),T[f].since<=C&&C<=T[f].until||T[f].until<=C&&C<=T[f].since)return(this.year()-e(T[f].since).year())*w+T[f].offset;return this.year()}function $(f){return s(this,"_erasNameRegex")||pf.call(this),f?this._erasNameRegex:this._erasRegex}function so(f){return s(this,"_erasAbbrRegex")||pf.call(this),f?this._erasAbbrRegex:this._erasRegex}function ou(f){return s(this,"_erasNarrowRegex")||pf.call(this),f?this._erasNarrowRegex:this._erasRegex}function _r(f,g){return g.erasAbbrRegex(f)}function We(f,g){return g.erasNameRegex(f)}function Fb(f,g){return g.erasNarrowRegex(f)}function Db(f,g){return g._eraYearOrdinalRegex||Ti}function pf(){var f=[],g=[],w=[],C=[],T,H,K,de,Ie,ze=this.eras();for(T=0,H=ze.length;T<H;++T)K=kn(ze[T].name),de=kn(ze[T].abbr),Ie=kn(ze[T].narrow),g.push(K),f.push(de),w.push(Ie),C.push(K),C.push(de),C.push(Ie);this._erasRegex=new RegExp("^("+C.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+g.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+f.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+w.join("|")+")","i")}he(0,["gg",2],0,function(){return this.weekYear()%100}),he(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Nn(f,g){he(0,[f,f.length],0,g)}Nn("gggg","weekYear"),Nn("ggggg","weekYear"),Nn("GGGG","isoWeekYear"),Nn("GGGGG","isoWeekYear"),me("G",Gs),me("g",Gs),me("GG",qe,oe),me("gg",qe,oe),me("GGGG",ea,Lt),me("gggg",ea,Lt),me("GGGGG",Js,gt),me("ggggg",Js,gt),ra(["gggg","ggggg","GGGG","GGGGG"],function(f,g,w,C){g[C.substr(0,2)]=Ve(f)}),ra(["gg","GG"],function(f,g,w,C){g[C]=e.parseTwoDigitYear(f)});function jb(f){return Sh.call(this,f,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Lb(f){return Sh.call(this,f,this.isoWeek(),this.isoWeekday(),1,4)}function Ub(){return Tn(this.year(),1,4)}function Hb(){return Tn(this.isoWeekYear(),1,4)}function Bb(){var f=this.localeData()._week;return Tn(this.year(),f.dow,f.doy)}function ti(){var f=this.localeData()._week;return Tn(this.weekYear(),f.dow,f.doy)}function Sh(f,g,w,C,T){var H;return f==null?aa(this,C,T).year:(H=Tn(f,C,T),g>H&&(g=H),Vb.call(this,f,g,w,C,T))}function Vb(f,g,w,C,T){var H=Fl(f,g,w,C,T),K=Ks(H.year,0,H.dayOfYear);return this.year(K.getUTCFullYear()),this.month(K.getUTCMonth()),this.date(K.getUTCDate()),this}he("Q",0,"Qo","quarter"),me("Q",or),ft("Q",function(f,g){g[Qn]=(Ve(f)-1)*3});function Wb(f){return f==null?Math.ceil((this.month()+1)/3):this.month((f-1)*3+this.month()%3)}he("D",["DD",2],"Do","date"),me("D",qe,ls),me("DD",qe,oe),me("Do",function(f,g){return f?g._dayOfMonthOrdinalParse||g._ordinalParse:g._dayOfMonthOrdinalParseLenient}),ft(["D","DD"],An),ft("Do",function(f,g){g[An]=Ve(f.match(qe)[0])});var wh=Ys("Date",!0);he("DDD",["DDDD",3],"DDDo","dayOfYear"),me("DDD",zs),me("DDDD",fr),ft(["DDD","DDDD"],function(f,g,w){w._dayOfYear=Ve(f)});function zb(f){var g=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return f==null?g:this.add(f-g,"d")}he("m",["mm",2],0,"minute"),me("m",qe,kl),me("mm",qe,oe),ft(["m","mm"],Kr);var ri=Ys("Minutes",!1);he("s",["ss",2],0,"second"),me("s",qe,kl),me("ss",qe,oe),ft(["s","ss"],Zn);var Jb=Ys("Seconds",!1);he("S",0,0,function(){return~~(this.millisecond()/100)}),he(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),he(0,["SSS",3],0,"millisecond"),he(0,["SSSS",4],0,function(){return this.millisecond()*10}),he(0,["SSSSS",5],0,function(){return this.millisecond()*100}),he(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),he(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),he(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),he(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),me("S",zs,or),me("SS",zs,oe),me("SSS",zs,fr);var ji,_h;for(ji="SSSS";ji.length<=9;ji+="S")me(ji,Ti);function Gb(f,g){g[us]=Ve(("0."+f)*1e3)}for(ji="S";ji.length<=9;ji+="S")ft(ji,Gb);_h=Ys("Milliseconds",!1),he("z",0,0,"zoneAbbr"),he("zz",0,0,"zoneName");function Yb(){return this._isUTC?"UTC":""}function ms(){return this._isUTC?"Coordinated Universal Time":""}var ie=M.prototype;ie.add=_b,ie.calendar=xb,ie.clone=Cb,ie.diff=hh,ie.endOf=vh,ie.format=ps,ie.from=eu,ie.fromNow=qb,ie.to=Ib,ie.toNow=Ob,ie.get=$v,ie.invalidAt=io,ie.isAfter=Eb,ie.isBefore=Kl,ie.isBetween=Di,ie.isSame=Ql,ie.isSameOrAfter=ph,ie.isSameOrBefore=Zl,ie.isValid=Sa,ie.lang=ya,ie.locale=ga,ie.localeData=tu,ie.max=lh,ie.min=ah,ie.parsingFlags=iu,ie.set=$l,ie.startOf=Pb,ie.subtract=ro,ie.toArray=df,ie.toObject=no,ie.toDate=va,ie.toISOString=mh,ie.inspect=ma,typeof Symbol<"u"&&Symbol.for!=null&&(ie[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),ie.toJSON=ba,ie.toString=Xl,ie.unix=ff,ie.valueOf=kb,ie.creationData=Ab,ie.eraName=Mb,ie.eraNarrow=su,ie.eraAbbr=wa,ie.eraYear=bh,ie.year=Up,ie.isLeapYear=Tv,ie.weekYear=jb,ie.isoWeekYear=Lb,ie.quarter=ie.quarters=Wb,ie.month=Nl,ie.daysInMonth=Lv,ie.week=ie.weeks=Jp,ie.isoWeek=ie.isoWeeks=Hv,ie.weeksInYear=Bb,ie.weeksInWeekYear=ti,ie.isoWeeksInYear=Ub,ie.isoWeeksInISOWeekYear=Hb,ie.date=wh,ie.day=ie.days=Kv,ie.weekday=Qv,ie.isoWeekday=Zv,ie.dayOfYear=zb,ie.hour=ie.hours=rb,ie.minute=ie.minutes=ri,ie.second=ie.seconds=Jb,ie.millisecond=ie.milliseconds=_h,ie.utcOffset=fh,ie.utc=yb,ie.local=vb,ie.parseZone=bb,ie.hasAlignedHourOffset=Sb,ie.isDST=Fi,ie.isLocal=Z,ie.isUtcOffset=Y,ie.isUtc=pe,ie.isUTC=pe,ie.zoneAbbr=Yb,ie.zoneName=ms,ie.dates=_("dates accessor is deprecated. Use date instead.",wh),ie.months=_("months accessor is deprecated. Use month instead",Nl),ie.years=_("years accessor is deprecated. Use year instead",Up),ie.zone=_("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",gb),ie.isDSTShifted=_("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",W);function Kb(f){return yt(f*1e3)}function mn(){return yt.apply(null,arguments).parseZone()}function Rh(f){return f}var nt=Q.prototype;nt.calendar=Be,nt.longDateFormat=xt,nt.invalidDate=Gr,nt.ordinal=Ai,nt.preparse=Rh,nt.postformat=Rh,nt.relativeTime=te,nt.pastFuture=re,nt.set=D,nt.eras=Tb,nt.erasParse=$b,nt.erasConvertYear=Nb,nt.erasAbbrRegex=so,nt.erasNameRegex=$,nt.erasNarrowRegex=ou,nt.months=Dv,nt.monthsShort=jv,nt.monthsParse=Vp,nt.monthsRegex=Ml,nt.monthsShortRegex=Wp,nt.week=Qc,nt.firstDayOfYear=zp,nt.firstDayOfWeek=Qs,nt.weekdays=zv,nt.weekdaysMin=Gv,nt.weekdaysShort=Jv,nt.weekdaysParse=Yv,nt.weekdaysRegex=Xv,nt.weekdaysShortRegex=Pt,nt.weekdaysMinRegex=Et,nt.isPM=tb,nt.meridiem=er;function au(f,g,w,C){var T=ei(),H=y().set(C,g);return T[w](H,f)}function xh(f,g,w){if(c(f)&&(g=f,f=void 0),f=f||"",g!=null)return au(f,g,w,"month");var C,T=[];for(C=0;C<12;C++)T[C]=au(f,C,w,"month");return T}function hf(f,g,w,C){typeof f=="boolean"?(c(g)&&(w=g,g=void 0),g=g||""):(g=f,w=g,f=!1,c(g)&&(w=g,g=void 0),g=g||"");var T=ei(),H=f?T._week.dow:0,K,de=[];if(w!=null)return au(g,(w+H)%7,C,"day");for(K=0;K<7;K++)de[K]=au(g,(K+H)%7,C,"day");return de}function Ch(f,g){return xh(f,g,"months")}function Eh(f,g){return xh(f,g,"monthsShort")}function Qb(f,g,w){return hf(f,g,w,"weekdays")}function Zb(f,g,w){return hf(f,g,w,"weekdaysShort")}function mf(f,g,w){return hf(f,g,w,"weekdaysMin")}Xn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(f){var g=f%10,w=Ve(f%100/10)===1?"th":g===1?"st":g===2?"nd":g===3?"rd":"th";return f+w}}),e.lang=_("moment.lang is deprecated. Use moment.locale instead.",Xn),e.langData=_("moment.langData is deprecated. Use moment.localeData instead.",ei);var Lr=Math.abs;function lu(){var f=this._data;return this._milliseconds=Lr(this._milliseconds),this._days=Lr(this._days),this._months=Lr(this._months),f.milliseconds=Lr(f.milliseconds),f.seconds=Lr(f.seconds),f.minutes=Lr(f.minutes),f.hours=Lr(f.hours),f.months=Lr(f.months),f.years=Lr(f.years),this}function qh(f,g,w,C){var T=vt(g,w);return f._milliseconds+=C*T._milliseconds,f._days+=C*T._days,f._months+=C*T._months,f._bubble()}function Ih(f,g){return qh(this,f,g,1)}function Xb(f,g){return qh(this,f,g,-1)}function gn(f){return f<0?Math.floor(f):Math.ceil(f)}function gf(){var f=this._milliseconds,g=this._days,w=this._months,C=this._data,T,H,K,de,Ie;return f>=0&&g>=0&&w>=0||f<=0&&g<=0&&w<=0||(f+=gn(Rr(w)+g)*864e5,g=0,w=0),C.milliseconds=f%1e3,T=Yr(f/1e3),C.seconds=T%60,H=Yr(T/60),C.minutes=H%60,K=Yr(H/60),C.hours=K%24,g+=Yr(K/24),Ie=Yr(Li(g)),w+=Ie,g-=gn(Rr(Ie)),de=Yr(w/12),w%=12,C.days=g,C.months=w,C.years=de,this}function Li(f){return f*4800/146097}function Rr(f){return f*146097/4800}function eS(f){if(!this.isValid())return NaN;var g,w,C=this._milliseconds;if(f=ge(f),f==="month"||f==="quarter"||f==="year")switch(g=this._days+C/864e5,w=this._months+Li(g),f){case"month":return w;case"quarter":return w/3;case"year":return w/12}else switch(g=this._days+Math.round(Rr(this._months)),f){case"week":return g/7+C/6048e5;case"day":return g+C/864e5;case"hour":return g*24+C/36e5;case"minute":return g*1440+C/6e4;case"second":return g*86400+C/1e3;case"millisecond":return Math.floor(g*864e5)+C;default:throw new Error("Unknown unit "+f)}}function Mn(f){return function(){return this.as(f)}}var yf=Mn("ms"),_a=Mn("s"),Ui=Mn("m"),Oh=Mn("h"),tS=Mn("d"),uu=Mn("w"),rS=Mn("M"),Ph=Mn("Q"),lr=Mn("y"),vf=yf;function kh(){return vt(this)}function Fn(f){return f=ge(f),this.isValid()?this[f+"s"]():NaN}function ni(f){return function(){return this.isValid()?this._data[f]:NaN}}var cu=ni("milliseconds"),gs=ni("seconds"),Ah=ni("minutes"),mr=ni("hours"),bf=ni("days"),nS=ni("months"),iS=ni("years");function sS(){return Yr(this.days()/7)}var yn=Math.round,oo={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Ra(f,g,w,C,T){return T.relativeTime(g||1,!!w,f,C)}function Th(f,g,w,C){var T=vt(f).abs(),H=yn(T.as("s")),K=yn(T.as("m")),de=yn(T.as("h")),Ie=yn(T.as("d")),ze=yn(T.as("M")),tr=yn(T.as("w")),ii=yn(T.as("y")),si=H<=w.ss&&["s",H]||H<w.s&&["ss",H]||K<=1&&["m"]||K<w.m&&["mm",K]||de<=1&&["h"]||de<w.h&&["hh",de]||Ie<=1&&["d"]||Ie<w.d&&["dd",Ie];return w.w!=null&&(si=si||tr<=1&&["w"]||tr<w.w&&["ww",tr]),si=si||ze<=1&&["M"]||ze<w.M&&["MM",ze]||ii<=1&&["y"]||["yy",ii],si[2]=g,si[3]=+f>0,si[4]=C,Ra.apply(null,si)}function oS(f){return f===void 0?yn:typeof f=="function"?(yn=f,!0):!1}function aS(f,g){return oo[f]===void 0?!1:g===void 0?oo[f]:(oo[f]=g,f==="s"&&(oo.ss=g-1),!0)}function xa(f,g){if(!this.isValid())return this.localeData().invalidDate();var w=!1,C=oo,T,H;return typeof f=="object"&&(g=f,f=!1),typeof f=="boolean"&&(w=f),typeof g=="object"&&(C=Object.assign({},oo,g),g.s!=null&&g.ss==null&&(C.ss=g.s-1)),T=this.localeData(),H=Th(this,!w,C,T),w&&(H=T.pastFuture(+this,H)),T.postformat(H)}var Sf=Math.abs;function ao(f){return(f>0)-(f<0)||+f}function lo(){if(!this.isValid())return this.localeData().invalidDate();var f=Sf(this._milliseconds)/1e3,g=Sf(this._days),w=Sf(this._months),C,T,H,K,de=this.asSeconds(),Ie,ze,tr,ii;return de?(C=Yr(f/60),T=Yr(C/60),f%=60,C%=60,H=Yr(w/12),w%=12,K=f?f.toFixed(3).replace(/\.?0+$/,""):"",Ie=de<0?"-":"",ze=ao(this._months)!==ao(de)?"-":"",tr=ao(this._days)!==ao(de)?"-":"",ii=ao(this._milliseconds)!==ao(de)?"-":"",Ie+"P"+(H?ze+H+"Y":"")+(w?ze+w+"M":"")+(g?tr+g+"D":"")+(T||C||f?"T":"")+(T?ii+T+"H":"")+(C?ii+C+"M":"")+(f?ii+K+"S":"")):"P0D"}var Ye=to.prototype;Ye.isValid=pb,Ye.abs=lu,Ye.add=Ih,Ye.subtract=Xb,Ye.as=eS,Ye.asMilliseconds=yf,Ye.asSeconds=_a,Ye.asMinutes=Ui,Ye.asHours=Oh,Ye.asDays=tS,Ye.asWeeks=uu,Ye.asMonths=rS,Ye.asQuarters=Ph,Ye.asYears=lr,Ye.valueOf=vf,Ye._bubble=gf,Ye.clone=kh,Ye.get=Fn,Ye.milliseconds=cu,Ye.seconds=gs,Ye.minutes=Ah,Ye.hours=mr,Ye.days=bf,Ye.weeks=sS,Ye.months=nS,Ye.years=iS,Ye.humanize=xa,Ye.toISOString=lo,Ye.toString=lo,Ye.toJSON=lo,Ye.locale=ga,Ye.localeData=tu,Ye.toIsoString=_("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",lo),Ye.lang=ya,he("X",0,0,"unix"),he("x",0,0,"valueOf"),me("x",Gs),me("X",Ov),ft("X",function(f,g,w){w._d=new Date(parseFloat(f)*1e3)}),ft("x",function(f,g,w){w._d=new Date(Ve(f))});return e.version="2.30.1",r(yt),e.fn=ie,e.min=cb,e.max=fb,e.now=db,e.utc=y,e.unix=Kb,e.months=Ch,e.isDate=d,e.locale=Xn,e.invalid=R,e.duration=vt,e.isMoment=j,e.weekdays=Qb,e.parseZone=mn,e.localeData=ei,e.isDuration=fa,e.monthsShort=Eh,e.weekdaysMin=mf,e.defineLocale=Ll,e.updateLocale=Nr,e.locales=Mr,e.weekdaysShort=Zb,e.normalizeUnits=ge,e.relativeTimeRounding=oS,e.relativeTimeThreshold=aS,e.calendarFormat=Yl,e.prototype=ie,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e}))});var Fq=V((Mq,pm)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof pm<"u"&&pm.exports?pm.exports=e():t.tv4=e()})(Mq,function(){Object.keys||(Object.keys=(function(){var I=Object.prototype.hasOwnProperty,_=!{toString:null}.propertyIsEnumerable("toString"),A=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],F=A.length;return function(U){if(typeof U!="object"&&typeof U!="function"||U===null)throw new TypeError("Object.keys called on non-object");var D=[];for(var J in U)I.call(U,J)&&D.push(J);if(_)for(var Q=0;Q<F;Q++)I.call(U,A[Q])&&D.push(A[Q]);return D}})()),Object.create||(Object.create=(function(){function I(){}return function(_){if(arguments.length!==1)throw new Error("Object.create implementation only accepts one parameter.");return I.prototype=_,new I}})()),Array.isArray||(Array.isArray=function(I){return Object.prototype.toString.call(I)==="[object Array]"}),Array.prototype.indexOf||(Array.prototype.indexOf=function(I){if(this===null)throw new TypeError;var _=Object(this),A=_.length>>>0;if(A===0)return-1;var F=0;if(arguments.length>1&&(F=Number(arguments[1]),F!==F?F=0:F!==0&&F!==1/0&&F!==-1/0&&(F=(F>0||-1)*Math.floor(Math.abs(F)))),F>=A)return-1;for(var U=F>=0?F:Math.max(A-Math.abs(F),0);U<A;U++)if(U in _&&_[U]===I)return U;return-1}),Object.isFrozen||(Object.isFrozen=function(I){for(var _="tv4_test_frozen_key";I.hasOwnProperty(_);)_+=Math.random();try{return I[_]=!0,delete I[_],!1}catch{return!0}});var t={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},e={"*":!0};function r(I){return encodeURI(I).replace(/%25[0-9][0-9]/g,function(_){return"%"+_.substring(3)})}function n(I){var _="";t[I.charAt(0)]&&(_=I.charAt(0),I=I.substring(1));var A="",F="",U=!0,D=!1,J=!1;_==="+"?U=!1:_==="."?(F=".",A="."):_==="/"?(F="/",A="/"):_==="#"?(F="#",U=!1):_===";"?(F=";",A=";",D=!0,J=!0):_==="?"?(F="?",A="&",D=!0):_==="&"&&(F="&",A="&",D=!0);for(var Q=[],se=I.split(","),fe=[],Be={},Re=0;Re<se.length;Re++){var ye=se[Re],ke=null;if(ye.indexOf(":")!==-1){var mt=ye.split(":");ye=mt[0],ke=parseInt(mt[1],10)}for(var Nt={};e[ye.charAt(ye.length-1)];)Nt[ye.charAt(ye.length-1)]=!0,ye=ye.substring(0,ye.length-1);var he={truncate:ke,name:ye,suffices:Nt};fe.push(he),Be[ye]=he,Q.push(ye)}var Yt=function(Tr){for(var lt="",$r=0,wr=0;wr<fe.length;wr++){var xt=fe[wr],St=Tr(xt.name);if(St==null||Array.isArray(St)&&St.length===0||typeof St=="object"&&Object.keys(St).length===0){$r++;continue}if(wr===$r?lt+=F:lt+=A||",",Array.isArray(St)){D&&(lt+=xt.name+"=");for(var Gr=0;Gr<St.length;Gr++)Gr>0&&(lt+=xt.suffices["*"]&&A||",",xt.suffices["*"]&&D&&(lt+=xt.name+"=")),lt+=U?encodeURIComponent(St[Gr]).replace(/!/g,"%21"):r(St[Gr])}else if(typeof St=="object"){D&&!xt.suffices["*"]&&(lt+=xt.name+"=");var Ws=!0;for(var At in St)Ws||(lt+=xt.suffices["*"]&&A||","),Ws=!1,lt+=U?encodeURIComponent(At).replace(/!/g,"%21"):r(At),lt+=xt.suffices["*"]?"=":",",lt+=U?encodeURIComponent(St[At]).replace(/!/g,"%21"):r(St[At])}else D&&(lt+=xt.name,(!J||St!=="")&&(lt+="=")),xt.truncate!=null&&(St=St.substring(0,xt.truncate)),lt+=U?encodeURIComponent(St).replace(/!/g,"%21"):r(St)}return lt};return Yt.varNames=Q,{prefix:F,substitution:Yt}}function i(I){if(!(this instanceof i))return new i(I);for(var _=I.split("{"),A=[_.shift()],F=[],U=[],D=[];_.length>0;){var J=_.shift(),Q=J.split("}")[0],se=J.substring(Q.length+1),fe=n(Q);U.push(fe.substitution),F.push(fe.prefix),A.push(se),D=D.concat(fe.substitution.varNames)}this.fill=function(Be){for(var Re=A[0],ye=0;ye<U.length;ye++){var ke=U[ye];Re+=ke(Be),Re+=A[ye+1]}return Re},this.varNames=D,this.template=I}i.prototype={toString:function(){return this.template},fillFromObject:function(I){return this.fill(function(_){return I[_]})}};var s=function(_,A,F,U,D){if(this.missing=[],this.missingMap={},this.formatValidators=_?Object.create(_.formatValidators):{},this.schemas=_?Object.create(_.schemas):{},this.collectMultiple=A,this.errors=[],this.handleError=A?this.collectError:this.returnError,U&&(this.checkRecursive=!0,this.scanned=[],this.scannedFrozen=[],this.scannedFrozenSchemas=[],this.scannedFrozenValidationErrors=[],this.validatedSchemasKey="tv4_validation_id",this.validationErrorsKey="tv4_validation_errors_id"),D&&(this.trackUnknownProperties=!0,this.knownPropertyPaths={},this.unknownPropertyPaths={}),this.errorReporter=F||b("en"),typeof this.errorReporter=="string")throw new Error("debug");if(this.definedKeywords={},_)for(var J in _.definedKeywords)this.definedKeywords[J]=_.definedKeywords[J].slice(0)};s.prototype.defineKeyword=function(I,_){this.definedKeywords[I]=this.definedKeywords[I]||[],this.definedKeywords[I].push(_)},s.prototype.createError=function(I,_,A,F,U,D,J){var Q=new E(I,_,A,F,U);return Q.message=this.errorReporter(Q,D,J),Q},s.prototype.returnError=function(I){return I},s.prototype.collectError=function(I){return I&&this.errors.push(I),null},s.prototype.prefixErrors=function(I,_,A){for(var F=I;F<this.errors.length;F++)this.errors[F]=this.errors[F].prefixWith(_,A);return this},s.prototype.banUnknownProperties=function(I,_){for(var A in this.unknownPropertyPaths){var F=this.createError(q.UNKNOWN_PROPERTY,{path:A},A,"",null,I,_),U=this.handleError(F);if(U)return U}return null},s.prototype.addFormat=function(I,_){if(typeof I=="object"){for(var A in I)this.addFormat(A,I[A]);return this}this.formatValidators[I]=_},s.prototype.resolveRefs=function(I,_){if(I.$ref!==void 0){if(_=_||{},_[I.$ref])return this.createError(q.CIRCULAR_REFERENCE,{urls:Object.keys(_).join(", ")},"","",null,void 0,I);_[I.$ref]=!0,I=this.getSchema(I.$ref,_)}return I},s.prototype.getSchema=function(I,_){var A;if(this.schemas[I]!==void 0)return A=this.schemas[I],this.resolveRefs(A,_);var F=I,U="";if(I.indexOf("#")!==-1&&(U=I.substring(I.indexOf("#")+1),F=I.substring(0,I.indexOf("#"))),typeof this.schemas[F]=="object"){A=this.schemas[F];var D=decodeURIComponent(U);if(D==="")return this.resolveRefs(A,_);if(D.charAt(0)!=="/")return;for(var J=D.split("/").slice(1),Q=0;Q<J.length;Q++){var se=J[Q].replace(/~1/g,"/").replace(/~0/g,"~");if(A[se]===void 0){A=void 0;break}A=A[se]}if(A!==void 0)return this.resolveRefs(A,_)}this.missing[F]===void 0&&(this.missing.push(F),this.missing[F]=F,this.missingMap[F]=F)},s.prototype.searchSchemas=function(I,_){if(Array.isArray(I))for(var A=0;A<I.length;A++)this.searchSchemas(I[A],_);else if(I&&typeof I=="object"){typeof I.id=="string"&&k(_,I.id)&&this.schemas[I.id]===void 0&&(this.schemas[I.id]=I);for(var F in I)if(F!=="enum"){if(typeof I[F]=="object")this.searchSchemas(I[F],_);else if(F==="$ref"){var U=m(I[F]);U&&this.schemas[U]===void 0&&this.missingMap[U]===void 0&&(this.missingMap[U]=U)}}}},s.prototype.addSchema=function(I,_){if(typeof I!="string"||typeof _>"u")if(typeof I=="object"&&typeof I.id=="string")_=I,I=_.id;else return;I===m(I)+"#"&&(I=m(I)),this.schemas[I]=_,delete this.missingMap[I],y(_,I),this.searchSchemas(_,I)},s.prototype.getSchemaMap=function(){var I={};for(var _ in this.schemas)I[_]=this.schemas[_];return I},s.prototype.getSchemaUris=function(I){var _=[];for(var A in this.schemas)(!I||I.test(A))&&_.push(A);return _},s.prototype.getMissingUris=function(I){var _=[];for(var A in this.missingMap)(!I||I.test(A))&&_.push(A);return _},s.prototype.dropSchemas=function(){this.schemas={},this.reset()},s.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},s.prototype.validateAll=function(I,_,A,F,U){var D;if(_=this.resolveRefs(_),_){if(_ instanceof E)return this.errors.push(_),_}else return null;var J=this.errors.length,Q,se=null,fe=null;if(this.checkRecursive&&I&&typeof I=="object"){if(D=!this.scanned.length,I[this.validatedSchemasKey]){var Be=I[this.validatedSchemasKey].indexOf(_);if(Be!==-1)return this.errors=this.errors.concat(I[this.validationErrorsKey][Be]),null}if(Object.isFrozen(I)&&(Q=this.scannedFrozen.indexOf(I),Q!==-1)){var Re=this.scannedFrozenSchemas[Q].indexOf(_);if(Re!==-1)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[Q][Re]),null}if(this.scanned.push(I),Object.isFrozen(I))Q===-1&&(Q=this.scannedFrozen.length,this.scannedFrozen.push(I),this.scannedFrozenSchemas.push([])),se=this.scannedFrozenSchemas[Q].length,this.scannedFrozenSchemas[Q][se]=_,this.scannedFrozenValidationErrors[Q][se]=[];else{if(!I[this.validatedSchemasKey])try{Object.defineProperty(I,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(I,this.validationErrorsKey,{value:[],configurable:!0})}catch{I[this.validatedSchemasKey]=[],I[this.validationErrorsKey]=[]}fe=I[this.validatedSchemasKey].length,I[this.validatedSchemasKey][fe]=_,I[this.validationErrorsKey][fe]=[]}}var ye=this.errors.length,ke=this.validateBasic(I,_,U)||this.validateNumeric(I,_,U)||this.validateString(I,_,U)||this.validateArray(I,_,U)||this.validateObject(I,_,U)||this.validateCombinations(I,_,U)||this.validateHypermedia(I,_,U)||this.validateFormat(I,_,U)||this.validateDefinedKeywords(I,_,U)||null;if(D){for(;this.scanned.length;){var mt=this.scanned.pop();delete mt[this.validatedSchemasKey]}this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(ke||ye!==this.errors.length)for(;A&&A.length||F&&F.length;){var Nt=A&&A.length?""+A.pop():null,he=F&&F.length?""+F.pop():null;ke&&(ke=ke.prefixWith(Nt,he)),this.prefixErrors(ye,Nt,he)}return se!==null?this.scannedFrozenValidationErrors[Q][se]=this.errors.slice(J):fe!==null&&(I[this.validationErrorsKey][fe]=this.errors.slice(J)),this.handleError(ke)},s.prototype.validateFormat=function(I,_){if(typeof _.format!="string"||!this.formatValidators[_.format])return null;var A=this.formatValidators[_.format].call(null,I,_);return typeof A=="string"||typeof A=="number"?this.createError(q.FORMAT_CUSTOM,{message:A},"","/format",null,I,_):A&&typeof A=="object"?this.createError(q.FORMAT_CUSTOM,{message:A.message||"?"},A.dataPath||"",A.schemaPath||"/format",null,I,_):null},s.prototype.validateDefinedKeywords=function(I,_,A){for(var F in this.definedKeywords)if(!(typeof _[F]>"u"))for(var U=this.definedKeywords[F],D=0;D<U.length;D++){var J=U[D],Q=J(I,_[F],_,A);if(typeof Q=="string"||typeof Q=="number")return this.createError(q.KEYWORD_CUSTOM,{key:F,message:Q},"","",null,I,_).prefixWith(null,F);if(Q&&typeof Q=="object"){var se=Q.code;if(typeof se=="string"){if(!q[se])throw new Error("Undefined error code (use defineError): "+se);se=q[se]}else typeof se!="number"&&(se=q.KEYWORD_CUSTOM);var fe=typeof Q.message=="object"?Q.message:{key:F,message:Q.message||"?"},Be=Q.schemaPath||"/"+F.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(se,fe,Q.dataPath||null,Be,null,I,_)}}return null};function o(I,_){if(I===_)return!0;if(I&&_&&typeof I=="object"&&typeof _=="object"){if(Array.isArray(I)!==Array.isArray(_))return!1;if(Array.isArray(I)){if(I.length!==_.length)return!1;for(var A=0;A<I.length;A++)if(!o(I[A],_[A]))return!1}else{var F;for(F in I)if(_[F]===void 0&&I[F]!==void 0)return!1;for(F in _)if(I[F]===void 0&&_[F]!==void 0)return!1;for(F in I)if(!o(I[F],_[F]))return!1}return!0}return!1}s.prototype.validateBasic=function(_,A,F){var U;return(U=this.validateType(_,A,F))||(U=this.validateEnum(_,A,F))?U.prefixWith(null,"type"):null},s.prototype.validateType=function(_,A){if(A.type===void 0)return null;var F=typeof _;_===null?F="null":Array.isArray(_)&&(F="array");var U=A.type;Array.isArray(U)||(U=[U]);for(var D=0;D<U.length;D++){var J=U[D];if(J===F||J==="integer"&&F==="number"&&_%1===0)return null}return this.createError(q.INVALID_TYPE,{type:F,expected:U.join("/")},"","",null,_,A)},s.prototype.validateEnum=function(_,A){if(A.enum===void 0)return null;for(var F=0;F<A.enum.length;F++){var U=A.enum[F];if(o(_,U))return null}return this.createError(q.ENUM_MISMATCH,{value:typeof JSON<"u"?JSON.stringify(_):_},"","",null,_,A)},s.prototype.validateNumeric=function(_,A,F){return this.validateMultipleOf(_,A,F)||this.validateMinMax(_,A,F)||this.validateNaN(_,A,F)||null};var l=Math.pow(2,-51),c=1-l;s.prototype.validateMultipleOf=function(_,A){var F=A.multipleOf||A.divisibleBy;if(F===void 0)return null;if(typeof _=="number"){var U=_/F%1;if(U>=l&&U<c)return this.createError(q.NUMBER_MULTIPLE_OF,{value:_,multipleOf:F},"","",null,_,A)}return null},s.prototype.validateMinMax=function(_,A){if(typeof _!="number")return null;if(A.minimum!==void 0){if(_<A.minimum)return this.createError(q.NUMBER_MINIMUM,{value:_,minimum:A.minimum},"","/minimum",null,_,A);if(A.exclusiveMinimum&&_===A.minimum)return this.createError(q.NUMBER_MINIMUM_EXCLUSIVE,{value:_,minimum:A.minimum},"","/exclusiveMinimum",null,_,A)}if(A.maximum!==void 0){if(_>A.maximum)return this.createError(q.NUMBER_MAXIMUM,{value:_,maximum:A.maximum},"","/maximum",null,_,A);if(A.exclusiveMaximum&&_===A.maximum)return this.createError(q.NUMBER_MAXIMUM_EXCLUSIVE,{value:_,maximum:A.maximum},"","/exclusiveMaximum",null,_,A)}return null},s.prototype.validateNaN=function(_,A){return typeof _!="number"?null:isNaN(_)===!0||_===1/0||_===-1/0?this.createError(q.NUMBER_NOT_A_NUMBER,{value:_},"","/type",null,_,A):null},s.prototype.validateString=function(_,A,F){return this.validateStringLength(_,A,F)||this.validateStringPattern(_,A,F)||null},s.prototype.validateStringLength=function(_,A){return typeof _!="string"?null:A.minLength!==void 0&&_.length<A.minLength?this.createError(q.STRING_LENGTH_SHORT,{length:_.length,minimum:A.minLength},"","/minLength",null,_,A):A.maxLength!==void 0&&_.length>A.maxLength?this.createError(q.STRING_LENGTH_LONG,{length:_.length,maximum:A.maxLength},"","/maxLength",null,_,A):null},s.prototype.validateStringPattern=function(_,A){if(typeof _!="string"||typeof A.pattern!="string"&&!(A.pattern instanceof RegExp))return null;var F;if(A.pattern instanceof RegExp)F=A.pattern;else{var U,D="",J=A.pattern.match(/^\/(.+)\/([img]*)$/);J?(U=J[1],D=J[2]):U=A.pattern,F=new RegExp(U,D)}return F.test(_)?null:this.createError(q.STRING_PATTERN,{pattern:A.pattern},"","/pattern",null,_,A)},s.prototype.validateArray=function(_,A,F){return Array.isArray(_)&&(this.validateArrayLength(_,A,F)||this.validateArrayUniqueItems(_,A,F)||this.validateArrayItems(_,A,F))||null},s.prototype.validateArrayLength=function(_,A){var F;return A.minItems!==void 0&&_.length<A.minItems&&(F=this.createError(q.ARRAY_LENGTH_SHORT,{length:_.length,minimum:A.minItems},"","/minItems",null,_,A),this.handleError(F))||A.maxItems!==void 0&&_.length>A.maxItems&&(F=this.createError(q.ARRAY_LENGTH_LONG,{length:_.length,maximum:A.maxItems},"","/maxItems",null,_,A),this.handleError(F))?F:null},s.prototype.validateArrayUniqueItems=function(_,A){if(A.uniqueItems){for(var F=0;F<_.length;F++)for(var U=F+1;U<_.length;U++)if(o(_[F],_[U])){var D=this.createError(q.ARRAY_UNIQUE,{match1:F,match2:U},"","/uniqueItems",null,_,A);if(this.handleError(D))return D}}return null},s.prototype.validateArrayItems=function(_,A,F){if(A.items===void 0)return null;var U,D;if(Array.isArray(A.items)){for(D=0;D<_.length;D++)if(D<A.items.length){if(U=this.validateAll(_[D],A.items[D],[D],["items",D],F+"/"+D))return U}else if(A.additionalItems!==void 0){if(typeof A.additionalItems=="boolean"){if(!A.additionalItems&&(U=this.createError(q.ARRAY_ADDITIONAL_ITEMS,{},"/"+D,"/additionalItems",null,_,A),this.handleError(U)))return U}else if(U=this.validateAll(_[D],A.additionalItems,[D],["additionalItems"],F+"/"+D))return U}}else for(D=0;D<_.length;D++)if(U=this.validateAll(_[D],A.items,[D],["items"],F+"/"+D))return U;return null},s.prototype.validateObject=function(_,A,F){return typeof _!="object"||_===null||Array.isArray(_)?null:this.validateObjectMinMaxProperties(_,A,F)||this.validateObjectRequiredProperties(_,A,F)||this.validateObjectProperties(_,A,F)||this.validateObjectDependencies(_,A,F)||null},s.prototype.validateObjectMinMaxProperties=function(_,A){var F=Object.keys(_),U;return A.minProperties!==void 0&&F.length<A.minProperties&&(U=this.createError(q.OBJECT_PROPERTIES_MINIMUM,{propertyCount:F.length,minimum:A.minProperties},"","/minProperties",null,_,A),this.handleError(U))||A.maxProperties!==void 0&&F.length>A.maxProperties&&(U=this.createError(q.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:F.length,maximum:A.maxProperties},"","/maxProperties",null,_,A),this.handleError(U))?U:null},s.prototype.validateObjectRequiredProperties=function(_,A){if(A.required!==void 0)for(var F=0;F<A.required.length;F++){var U=A.required[F];if(_[U]===void 0){var D=this.createError(q.OBJECT_REQUIRED,{key:U},"","/required/"+F,null,_,A);if(this.handleError(D))return D}}return null},s.prototype.validateObjectProperties=function(_,A,F){var U;for(var D in _){var J=F+"/"+D.replace(/~/g,"~0").replace(/\//g,"~1"),Q=!1;if(A.properties!==void 0&&A.properties[D]!==void 0&&(Q=!0,U=this.validateAll(_[D],A.properties[D],[D],["properties",D],J)))return U;if(A.patternProperties!==void 0)for(var se in A.patternProperties){var fe=new RegExp(se);if(fe.test(D)&&(Q=!0,U=this.validateAll(_[D],A.patternProperties[se],[D],["patternProperties",se],J)))return U}if(Q)this.trackUnknownProperties&&(this.knownPropertyPaths[J]=!0,delete this.unknownPropertyPaths[J]);else if(A.additionalProperties!==void 0){if(this.trackUnknownProperties&&(this.knownPropertyPaths[J]=!0,delete this.unknownPropertyPaths[J]),typeof A.additionalProperties=="boolean"){if(!A.additionalProperties&&(U=this.createError(q.OBJECT_ADDITIONAL_PROPERTIES,{key:D},"","/additionalProperties",null,_,A).prefixWith(D,null),this.handleError(U)))return U}else if(U=this.validateAll(_[D],A.additionalProperties,[D],["additionalProperties"],J))return U}else this.trackUnknownProperties&&!this.knownPropertyPaths[J]&&(this.unknownPropertyPaths[J]=!0)}return null},s.prototype.validateObjectDependencies=function(_,A,F){var U;if(A.dependencies!==void 0){for(var D in A.dependencies)if(_[D]!==void 0){var J=A.dependencies[D];if(typeof J=="string"){if(_[J]===void 0&&(U=this.createError(q.OBJECT_DEPENDENCY_KEY,{key:D,missing:J},"","",null,_,A).prefixWith(null,D).prefixWith(null,"dependencies"),this.handleError(U)))return U}else if(Array.isArray(J))for(var Q=0;Q<J.length;Q++){var se=J[Q];if(_[se]===void 0&&(U=this.createError(q.OBJECT_DEPENDENCY_KEY,{key:D,missing:se},"","/"+Q,null,_,A).prefixWith(null,D).prefixWith(null,"dependencies"),this.handleError(U)))return U}else if(U=this.validateAll(_,J,[],["dependencies",D],F))return U}}return null},s.prototype.validateCombinations=function(_,A,F){return this.validateAllOf(_,A,F)||this.validateAnyOf(_,A,F)||this.validateOneOf(_,A,F)||this.validateNot(_,A,F)||null},s.prototype.validateAllOf=function(_,A,F){if(A.allOf===void 0)return null;for(var U,D=0;D<A.allOf.length;D++){var J=A.allOf[D];if(U=this.validateAll(_,J,[],["allOf",D],F))return U}return null},s.prototype.validateAnyOf=function(_,A,F){if(A.anyOf===void 0)return null;var U=[],D=this.errors.length,J,Q;this.trackUnknownProperties&&(J=this.unknownPropertyPaths,Q=this.knownPropertyPaths);for(var se=!0,fe=0;fe<A.anyOf.length;fe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var Be=A.anyOf[fe],Re=this.errors.length,ye=this.validateAll(_,Be,[],["anyOf",fe],F);if(ye===null&&Re===this.errors.length){if(this.errors=this.errors.slice(0,D),this.trackUnknownProperties){for(var ke in this.knownPropertyPaths)Q[ke]=!0,delete J[ke];for(var mt in this.unknownPropertyPaths)Q[mt]||(J[mt]=!0);se=!1;continue}return null}ye&&U.push(ye.prefixWith(null,""+fe).prefixWith(null,"anyOf"))}if(this.trackUnknownProperties&&(this.unknownPropertyPaths=J,this.knownPropertyPaths=Q),se)return U=U.concat(this.errors.slice(D)),this.errors=this.errors.slice(0,D),this.createError(q.ANY_OF_MISSING,{},"","/anyOf",U,_,A)},s.prototype.validateOneOf=function(_,A,F){if(A.oneOf===void 0)return null;var U=null,D=[],J=this.errors.length,Q,se;this.trackUnknownProperties&&(Q=this.unknownPropertyPaths,se=this.knownPropertyPaths);for(var fe=0;fe<A.oneOf.length;fe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var Be=A.oneOf[fe],Re=this.errors.length,ye=this.validateAll(_,Be,[],["oneOf",fe],F);if(ye===null&&Re===this.errors.length){if(U===null)U=fe;else return this.errors=this.errors.slice(0,J),this.createError(q.ONE_OF_MULTIPLE,{index1:U,index2:fe},"","/oneOf",null,_,A);if(this.trackUnknownProperties){for(var ke in this.knownPropertyPaths)se[ke]=!0,delete Q[ke];for(var mt in this.unknownPropertyPaths)se[mt]||(Q[mt]=!0)}}else ye&&D.push(ye)}return this.trackUnknownProperties&&(this.unknownPropertyPaths=Q,this.knownPropertyPaths=se),U===null?(D=D.concat(this.errors.slice(J)),this.errors=this.errors.slice(0,J),this.createError(q.ONE_OF_MISSING,{},"","/oneOf",D,_,A)):(this.errors=this.errors.slice(0,J),null)},s.prototype.validateNot=function(_,A,F){if(A.not===void 0)return null;var U=this.errors.length,D,J;this.trackUnknownProperties&&(D=this.unknownPropertyPaths,J=this.knownPropertyPaths,this.unknownPropertyPaths={},this.knownPropertyPaths={});var Q=this.validateAll(_,A.not,null,null,F),se=this.errors.slice(U);return this.errors=this.errors.slice(0,U),this.trackUnknownProperties&&(this.unknownPropertyPaths=D,this.knownPropertyPaths=J),Q===null&&se.length===0?this.createError(q.NOT_PASSED,{},"","/not",null,_,A):null},s.prototype.validateHypermedia=function(_,A,F){if(!A.links)return null;for(var U,D=0;D<A.links.length;D++){var J=A.links[D];if(J.rel==="describedby"){for(var Q=new i(J.href),se=!0,fe=0;fe<Q.varNames.length;fe++)if(!(Q.varNames[fe]in _)){se=!1;break}if(se){var Be=Q.fillFromObject(_),Re={$ref:Be};if(U=this.validateAll(_,Re,[],["links",D],F))return U}}}};function d(I){var _=String(I).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return _?{href:_[0]||"",protocol:_[1]||"",authority:_[2]||"",host:_[3]||"",hostname:_[4]||"",port:_[5]||"",pathname:_[6]||"",search:_[7]||"",hash:_[8]||""}:null}function p(I,_){function A(F){var U=[];return F.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(D){D==="/.."?U.pop():U.push(D)}),U.join("").replace(/^\//,F.charAt(0)==="/"?"/":"")}return _=d(_||""),I=d(I||""),!_||!I?null:(_.protocol||I.protocol)+(_.protocol||_.authority?_.authority:I.authority)+A(_.protocol||_.authority||_.pathname.charAt(0)==="/"?_.pathname:_.pathname?(I.authority&&!I.pathname?"/":"")+I.pathname.slice(0,I.pathname.lastIndexOf("/")+1)+_.pathname:I.pathname)+(_.protocol||_.authority||_.pathname?_.search:_.search||I.search)+_.hash}function m(I){return I.split("#")[0]}function y(I,_){if(I&&typeof I=="object")if(_===void 0?_=I.id:typeof I.id=="string"&&(_=p(_,I.id),I.id=_),Array.isArray(I))for(var A=0;A<I.length;A++)y(I[A],_);else{typeof I.$ref=="string"&&(I.$ref=p(_,I.$ref));for(var F in I)F!=="enum"&&y(I[F],_)}}function b(I){I=I||"en";var _=P[I];return function(A){var F=_[A.code]||R[A.code];if(typeof F!="string")return"Unknown error code "+A.code+": "+JSON.stringify(A.messageParams);var U=A.params;return F.replace(/\{([^{}]*)\}/g,function(D,J){var Q=U[J];return typeof Q=="string"||typeof Q=="number"?Q:D})}}var q={INVALID_TYPE:0,ENUM_MISMATCH:1,ANY_OF_MISSING:10,ONE_OF_MISSING:11,ONE_OF_MULTIPLE:12,NOT_PASSED:13,NUMBER_MULTIPLE_OF:100,NUMBER_MINIMUM:101,NUMBER_MINIMUM_EXCLUSIVE:102,NUMBER_MAXIMUM:103,NUMBER_MAXIMUM_EXCLUSIVE:104,NUMBER_NOT_A_NUMBER:105,STRING_LENGTH_SHORT:200,STRING_LENGTH_LONG:201,STRING_PATTERN:202,OBJECT_PROPERTIES_MINIMUM:300,OBJECT_PROPERTIES_MAXIMUM:301,OBJECT_REQUIRED:302,OBJECT_ADDITIONAL_PROPERTIES:303,OBJECT_DEPENDENCY_KEY:304,ARRAY_LENGTH_SHORT:400,ARRAY_LENGTH_LONG:401,ARRAY_UNIQUE:402,ARRAY_ADDITIONAL_ITEMS:403,FORMAT_CUSTOM:500,KEYWORD_CUSTOM:501,CIRCULAR_REFERENCE:600,UNKNOWN_PROPERTY:1e3},x={};for(var v in q)x[q[v]]=v;var R={INVALID_TYPE:"Invalid type: {type} (expected {expected})",ENUM_MISMATCH:"No enum match for: {value}",ANY_OF_MISSING:'Data does not match any schemas from "anyOf"',ONE_OF_MISSING:'Data does not match any schemas from "oneOf"',ONE_OF_MULTIPLE:'Data is valid against more than one schema from "oneOf": indices {index1} and {index2}',NOT_PASSED:'Data matches schema from "not"',NUMBER_MULTIPLE_OF:"Value {value} is not a multiple of {multipleOf}",NUMBER_MINIMUM:"Value {value} is less than minimum {minimum}",NUMBER_MINIMUM_EXCLUSIVE:"Value {value} is equal to exclusive minimum {minimum}",NUMBER_MAXIMUM:"Value {value} is greater than maximum {maximum}",NUMBER_MAXIMUM_EXCLUSIVE:"Value {value} is equal to exclusive maximum {maximum}",NUMBER_NOT_A_NUMBER:"Value {value} is not a valid number",STRING_LENGTH_SHORT:"String is too short ({length} chars), minimum {minimum}",STRING_LENGTH_LONG:"String is too long ({length} chars), maximum {maximum}",STRING_PATTERN:"String does not match pattern: {pattern}",OBJECT_PROPERTIES_MINIMUM:"Too few properties defined ({propertyCount}), minimum {minimum}",OBJECT_PROPERTIES_MAXIMUM:"Too many properties defined ({propertyCount}), maximum {maximum}",OBJECT_REQUIRED:"Missing required property: {key}",OBJECT_ADDITIONAL_PROPERTIES:"Additional properties not allowed",OBJECT_DEPENDENCY_KEY:"Dependency failed - key must exist: {missing} (due to key: {key})",ARRAY_LENGTH_SHORT:"Array is too short ({length}), minimum {minimum}",ARRAY_LENGTH_LONG:"Array is too long ({length}), maximum {maximum}",ARRAY_UNIQUE:"Array items are not unique (indices {match1} and {match2})",ARRAY_ADDITIONAL_ITEMS:"Additional items not allowed",FORMAT_CUSTOM:"Format validation failed ({message})",KEYWORD_CUSTOM:"Keyword failed: {key} ({message})",CIRCULAR_REFERENCE:"Circular $refs: {urls}",UNKNOWN_PROPERTY:"Unknown property (not in schema)"};function E(I,_,A,F,U){if(Error.call(this),I===void 0)throw new Error("No error code supplied: "+F);this.message="",this.params=_,this.code=I,this.dataPath=A||"",this.schemaPath=F||"",this.subErrors=U||null;var D=new Error(this.message);if(this.stack=D.stack||D.stacktrace,!this.stack)try{throw D}catch(J){this.stack=J.stack||J.stacktrace}}E.prototype=Object.create(Error.prototype),E.prototype.constructor=E,E.prototype.name="ValidationError",E.prototype.prefixWith=function(I,_){if(I!==null&&(I=I.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+I+this.dataPath),_!==null&&(_=_.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+_+this.schemaPath),this.subErrors!==null)for(var A=0;A<this.subErrors.length;A++)this.subErrors[A].prefixWith(I,_);return this};function k(I,_){if(_.substring(0,I.length)===I){var A=_.substring(I.length);if(_.length>0&&_.charAt(I.length-1)==="/"||A.charAt(0)==="#"||A.charAt(0)==="?")return!0}return!1}var P={};function M(I){var _=new s,A,F,U={setErrorReporter:function(D){return typeof D=="string"?this.language(D):(F=D,!0)},addFormat:function(){_.addFormat.apply(_,arguments)},language:function(D){return D?(P[D]||(D=D.split("-")[0]),P[D]?(A=D,D):!1):A},addLanguage:function(D,J){var Q;for(Q in q)J[Q]&&!J[q[Q]]&&(J[q[Q]]=J[Q]);var se=D.split("-")[0];if(!P[se])P[D]=J,P[se]=J;else{P[D]=Object.create(P[se]);for(Q in J)typeof P[se][Q]>"u"&&(P[se][Q]=J[Q]),P[D][Q]=J[Q]}return this},freshApi:function(D){var J=M();return D&&J.language(D),J},validate:function(D,J,Q,se){var fe=b(A),Be=F?function(ke,mt,Nt){return F(ke,mt,Nt)||fe(ke,mt,Nt)}:fe,Re=new s(_,!1,Be,Q,se);typeof J=="string"&&(J={$ref:J}),Re.addSchema("",J);var ye=Re.validateAll(D,J,null,null,"");return!ye&&se&&(ye=Re.banUnknownProperties(D,J)),this.error=ye,this.missing=Re.missing,this.valid=ye===null,this.valid},validateResult:function(){var D={toString:function(){return this.valid?"valid":this.error.message}};return this.validate.apply(D,arguments),D},validateMultiple:function(D,J,Q,se){var fe=b(A),Be=F?function(ke,mt,Nt){return F(ke,mt,Nt)||fe(ke,mt,Nt)}:fe,Re=new s(_,!0,Be,Q,se);typeof J=="string"&&(J={$ref:J}),Re.addSchema("",J),Re.validateAll(D,J,null,null,""),se&&Re.banUnknownProperties(D,J);var ye={toString:function(){return this.valid?"valid":this.error.message}};return ye.errors=Re.errors,ye.missing=Re.missing,ye.valid=ye.errors.length===0,ye},addSchema:function(){return _.addSchema.apply(_,arguments)},getSchema:function(){return _.getSchema.apply(_,arguments)},getSchemaMap:function(){return _.getSchemaMap.apply(_,arguments)},getSchemaUris:function(){return _.getSchemaUris.apply(_,arguments)},getMissingUris:function(){return _.getMissingUris.apply(_,arguments)},dropSchemas:function(){_.dropSchemas.apply(_,arguments)},defineKeyword:function(){_.defineKeyword.apply(_,arguments)},defineError:function(D,J,Q){if(typeof D!="string"||!/^[A-Z]+(_[A-Z]+)*$/.test(D))throw new Error("Code name must be a string in UPPER_CASE_WITH_UNDERSCORES");if(typeof J!="number"||J%1!==0||J<1e4)throw new Error("Code number must be an integer > 10000");if(typeof q[D]<"u")throw new Error("Error already defined: "+D+" as "+q[D]);if(typeof x[J]<"u")throw new Error("Error code already used: "+x[J]+" as "+J);q[D]=J,x[J]=D,R[D]=R[J]=Q;for(var se in P){var fe=P[se];fe[D]&&(fe[J]=fe[J]||fe[D])}},reset:function(){_.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:y,resolveUrl:p,getDocumentUri:m,errorCodes:q};return U.language(I||"en"),U}var j=M();return j.addLanguage("en-gb",R),j.tv4=j,j})});var Df=V(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.regexpCode=ct.getEsmExportName=ct.getProperty=ct.safeStringify=ct.stringify=ct.strConcat=ct.addCodeArg=ct.str=ct._=ct.nil=ct._Code=ct.Name=ct.IDENTIFIER=ct._CodeOrName=void 0;var Mf=class{};ct._CodeOrName=Mf;ct.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Ta=class extends Mf{constructor(e){if(super(),!ct.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ct.Name=Ta;var Bn=class extends Mf{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Ta&&(r[n.str]=(r[n.str]||0)+1),r),{})}};ct._Code=Bn;ct.nil=new Bn("");function Dq(t,...e){let r=[t[0]],n=0;for(;n<e.length;)iw(r,e[n]),r.push(t[++n]);return new Bn(r)}ct._=Dq;var nw=new Bn("+");function jq(t,...e){let r=[Ff(t[0])],n=0;for(;n<e.length;)r.push(nw),iw(r,e[n]),r.push(nw,Ff(t[++n]));return W2(r),new Bn(r)}ct.str=jq;function iw(t,e){e instanceof Bn?t.push(...e._items):e instanceof Ta?t.push(e):t.push(G2(e))}ct.addCodeArg=iw;function W2(t){let e=1;for(;e<t.length-1;){if(t[e]===nw){let r=z2(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function z2(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Ta||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Ta))return`"${t}${e.slice(1)}`}function J2(t,e){return e.emptyStr()?t:t.emptyStr()?e:jq`${t}${e}`}ct.strConcat=J2;function G2(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Ff(Array.isArray(t)?t.join(","):t)}function Y2(t){return new Bn(Ff(t))}ct.stringify=Y2;function Ff(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ct.safeStringify=Ff;function K2(t){return typeof t=="string"&&ct.IDENTIFIER.test(t)?new Bn(`.${t}`):Dq`[${t}]`}ct.getProperty=K2;function Q2(t){if(typeof t=="string"&&ct.IDENTIFIER.test(t))return new Bn(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}ct.getEsmExportName=Q2;function Z2(t){return new Bn(t.toString())}ct.regexpCode=Z2});var aw=V(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.ValueScope=sn.ValueScopeName=sn.Scope=sn.varKinds=sn.UsedValueState=void 0;var nn=Df(),sw=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},hm;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(hm||(sn.UsedValueState=hm={}));sn.varKinds={const:new nn.Name("const"),let:new nn.Name("let"),var:new nn.Name("var")};var mm=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof nn.Name?e:this.name(e)}name(e){return new nn.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};sn.Scope=mm;var gm=class extends nn.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,nn._)`.${new nn.Name(r)}[${n}]`}};sn.ValueScopeName=gm;var X2=(0,nn._)`\n`,ow=class extends mm{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?X2:nn.nil}}get(){return this._scope}name(e){return new gm(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:s}=i,o=(n=r.key)!==null&&n!==void 0?n:r.ref,l=this._values[s];if(l){let p=l.get(o);if(p)return p}else l=this._values[s]=new Map;l.set(o,i);let c=this._scope[s]||(this._scope[s]=[]),d=c.length;return c[d]=r.ref,i.setValue(r,{property:s,itemIndex:d}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,nn._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let s=nn.nil;for(let o in e){let l=e[o];if(!l)continue;let c=n[o]=n[o]||new Map;l.forEach(d=>{if(c.has(d))return;c.set(d,hm.Started);let p=r(d);if(p){let m=this.opts.es5?sn.varKinds.var:sn.varKinds.const;s=(0,nn._)`${s}${m} ${d} = ${p};${this.opts._n}`}else if(p=i?.(d))s=(0,nn._)`${s}${p}${this.opts._n}`;else throw new sw(d);c.set(d,hm.Completed)})}return s}};sn.ValueScope=ow});var Je=V(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.or=He.and=He.not=He.CodeGen=He.operators=He.varKinds=He.ValueScopeName=He.ValueScope=He.Scope=He.Name=He.regexpCode=He.stringify=He.getProperty=He.nil=He.strConcat=He.str=He._=void 0;var tt=Df(),ci=aw(),bo=Df();Object.defineProperty(He,"_",{enumerable:!0,get:function(){return bo._}});Object.defineProperty(He,"str",{enumerable:!0,get:function(){return bo.str}});Object.defineProperty(He,"strConcat",{enumerable:!0,get:function(){return bo.strConcat}});Object.defineProperty(He,"nil",{enumerable:!0,get:function(){return bo.nil}});Object.defineProperty(He,"getProperty",{enumerable:!0,get:function(){return bo.getProperty}});Object.defineProperty(He,"stringify",{enumerable:!0,get:function(){return bo.stringify}});Object.defineProperty(He,"regexpCode",{enumerable:!0,get:function(){return bo.regexpCode}});Object.defineProperty(He,"Name",{enumerable:!0,get:function(){return bo.Name}});var Sm=aw();Object.defineProperty(He,"Scope",{enumerable:!0,get:function(){return Sm.Scope}});Object.defineProperty(He,"ValueScope",{enumerable:!0,get:function(){return Sm.ValueScope}});Object.defineProperty(He,"ValueScopeName",{enumerable:!0,get:function(){return Sm.ValueScopeName}});Object.defineProperty(He,"varKinds",{enumerable:!0,get:function(){return Sm.varKinds}});He.operators={GT:new tt._Code(">"),GTE:new tt._Code(">="),LT:new tt._Code("<"),LTE:new tt._Code("<="),EQ:new tt._Code("==="),NEQ:new tt._Code("!=="),NOT:new tt._Code("!"),OR:new tt._Code("||"),AND:new tt._Code("&&"),ADD:new tt._Code("+")};var Es=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},lw=class extends Es{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?ci.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Ou(this.rhs,e,r)),this}get names(){return this.rhs instanceof tt._CodeOrName?this.rhs.names:{}}},ym=class extends Es{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof tt.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Ou(this.rhs,e,r),this}get names(){let e=this.lhs instanceof tt.Name?{}:{...this.lhs.names};return bm(e,this.rhs)}},uw=class extends ym{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},cw=class extends Es{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},fw=class extends Es{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},dw=class extends Es{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},pw=class extends Es{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Ou(this.code,e,r),this}get names(){return this.code instanceof tt._CodeOrName?this.code.names:{}}},jf=class extends Es{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(e,r)||(eU(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Ma(e,r.names),{})}},qs=class extends jf{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},hw=class extends jf{},Iu=class extends qs{};Iu.kind="else";var $a=class t extends qs{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Iu(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(Lq(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Ou(this.condition,e,r),this}get names(){let e=super.names;return bm(e,this.condition),this.else&&Ma(e,this.else.names),e}};$a.kind="if";var Na=class extends qs{};Na.kind="for";var mw=class extends Na{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Ou(this.iteration,e,r),this}get names(){return Ma(super.names,this.iteration.names)}},gw=class extends Na{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?ci.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${r} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=bm(super.names,this.from);return bm(e,this.to)}},vm=class extends Na{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Ou(this.iterable,e,r),this}get names(){return Ma(super.names,this.iterable.names)}},Lf=class extends qs{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Lf.kind="func";var Uf=class extends jf{render(e){return"return "+super.render(e)}};Uf.kind="return";var yw=class extends qs{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Ma(e,this.catch.names),this.finally&&Ma(e,this.finally.names),e}},Hf=class extends qs{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Hf.kind="catch";var Bf=class extends qs{render(e){return"finally"+super.render(e)}};Bf.kind="finally";var vw=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
24
24
|
`:""},this._extScope=e,this._scope=new ci.Scope({parent:e}),this._nodes=[new hw]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,i){let s=this._scope.toName(r);return n!==void 0&&i&&(this._constants[s.str]=n),this._leafNode(new lw(e,s,n)),s}const(e,r,n){return this._def(ci.varKinds.const,e,r,n)}let(e,r,n){return this._def(ci.varKinds.let,e,r,n)}var(e,r,n){return this._def(ci.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new ym(e,r,n))}add(e,r){return this._leafNode(new uw(e,He.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==tt.nil&&this._leafNode(new pw(e)),this}object(...e){let r=["{"];for(let[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,tt.addCodeArg)(r,i));return r.push("}"),new tt._Code(r)}if(e,r,n){if(this._blockNode(new $a(e)),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(e){return this._elseNode(new $a(e))}else(){return this._elseNode(new Iu)}endIf(){return this._endBlockNode($a,Iu)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new mw(e),r)}forRange(e,r,n,i,s=this.opts.es5?ci.varKinds.var:ci.varKinds.let){let o=this._scope.toName(e);return this._for(new gw(s,o,r,n),()=>i(o))}forOf(e,r,n,i=ci.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=r instanceof tt.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,tt._)`${o}.length`,l=>{this.var(s,(0,tt._)`${o}[${l}]`),n(s)})}return this._for(new vm("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?ci.varKinds.var:ci.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,tt._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new vm("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(Na)}label(e){return this._leafNode(new cw(e))}break(e){return this._leafNode(new fw(e))}return(e){let r=new Uf;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Uf)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new yw;if(this._blockNode(i),this.code(e),r){let s=this.name("e");this._currNode=i.catch=new Hf(s),r(s)}return n&&(this._currNode=i.finally=new Bf,this.code(n)),this._endBlockNode(Hf,Bf)}throw(e){return this._leafNode(new dw(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){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||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=tt.nil,n,i){return this._blockNode(new Lf(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Lf)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof $a))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};He.CodeGen=vw;function Ma(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function bm(t,e){return e instanceof tt._CodeOrName?Ma(t,e.names):t}function Ou(t,e,r){if(t instanceof tt.Name)return n(t);if(!i(t))return t;return new tt._Code(t._items.reduce((s,o)=>(o instanceof tt.Name&&(o=n(o)),o instanceof tt._Code?s.push(...o._items):s.push(o),s),[]));function n(s){let o=r[s.str];return o===void 0||e[s.str]!==1?s:(delete e[s.str],o)}function i(s){return s instanceof tt._Code&&s._items.some(o=>o instanceof tt.Name&&e[o.str]===1&&r[o.str]!==void 0)}}function eU(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function Lq(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,tt._)`!${bw(t)}`}He.not=Lq;var tU=Uq(He.operators.AND);function rU(...t){return t.reduce(tU)}He.and=rU;var nU=Uq(He.operators.OR);function iU(...t){return t.reduce(nU)}He.or=iU;function Uq(t){return(e,r)=>e===tt.nil?r:r===tt.nil?e:(0,tt._)`${bw(e)} ${t} ${bw(r)}`}function bw(t){return t instanceof tt.Name?t:(0,tt._)`(${t})`}});var it=V(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.checkStrictMode=Ge.getErrorPath=Ge.Type=Ge.useFunc=Ge.setEvaluated=Ge.evaluatedPropsToName=Ge.mergeEvaluated=Ge.eachItem=Ge.unescapeJsonPointer=Ge.escapeJsonPointer=Ge.escapeFragment=Ge.unescapeFragment=Ge.schemaRefOrVal=Ge.schemaHasRulesButRef=Ge.schemaHasRules=Ge.checkUnknownRules=Ge.alwaysValidSchema=Ge.toHash=void 0;var kt=Je(),sU=Df();function oU(t){let e={};for(let r of t)e[r]=!0;return e}Ge.toHash=oU;function aU(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(Vq(t,e),!Wq(e,t.self.RULES.all))}Ge.alwaysValidSchema=aU;function Vq(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let i=n.RULES.keywords;for(let s in e)i[s]||Gq(t,`unknown keyword: "${s}"`)}Ge.checkUnknownRules=Vq;function Wq(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}Ge.schemaHasRules=Wq;function lU(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}Ge.schemaHasRulesButRef=lU;function uU({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,kt._)`${r}`}return(0,kt._)`${t}${e}${(0,kt.getProperty)(n)}`}Ge.schemaRefOrVal=uU;function cU(t){return zq(decodeURIComponent(t))}Ge.unescapeFragment=cU;function fU(t){return encodeURIComponent(ww(t))}Ge.escapeFragment=fU;function ww(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}Ge.escapeJsonPointer=ww;function zq(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}Ge.unescapeJsonPointer=zq;function dU(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}Ge.eachItem=dU;function Hq({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,s,o,l)=>{let c=o===void 0?s:o instanceof kt.Name?(s instanceof kt.Name?t(i,s,o):e(i,s,o),o):s instanceof kt.Name?(e(i,o,s),s):r(s,o);return l===kt.Name&&!(c instanceof kt.Name)?n(i,c):c}}Ge.mergeEvaluated={props:Hq({mergeNames:(t,e,r)=>t.if((0,kt._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,kt._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,kt._)`${r} || {}`).code((0,kt._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,kt._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,kt._)`${r} || {}`),_w(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:Jq}),items:Hq({mergeNames:(t,e,r)=>t.if((0,kt._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,kt._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,kt._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,kt._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function Jq(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,kt._)`{}`);return e!==void 0&&_w(t,r,e),r}Ge.evaluatedPropsToName=Jq;function _w(t,e,r){Object.keys(r).forEach(n=>t.assign((0,kt._)`${e}${(0,kt.getProperty)(n)}`,!0))}Ge.setEvaluated=_w;var Bq={};function pU(t,e){return t.scopeValue("func",{ref:e,code:Bq[e.code]||(Bq[e.code]=new sU._Code(e.code))})}Ge.useFunc=pU;var Sw;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Sw||(Ge.Type=Sw={}));function hU(t,e,r){if(t instanceof kt.Name){let n=e===Sw.Num;return r?n?(0,kt._)`"[" + ${t} + "]"`:(0,kt._)`"['" + ${t} + "']"`:n?(0,kt._)`"/" + ${t}`:(0,kt._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,kt.getProperty)(t).toString():"/"+ww(t)}Ge.getErrorPath=hU;function Gq(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}Ge.checkStrictMode=Gq});var Is=V(Rw=>{"use strict";Object.defineProperty(Rw,"__esModule",{value:!0});var Er=Je(),mU={data:new Er.Name("data"),valCxt:new Er.Name("valCxt"),instancePath:new Er.Name("instancePath"),parentData:new Er.Name("parentData"),parentDataProperty:new Er.Name("parentDataProperty"),rootData:new Er.Name("rootData"),dynamicAnchors:new Er.Name("dynamicAnchors"),vErrors:new Er.Name("vErrors"),errors:new Er.Name("errors"),this:new Er.Name("this"),self:new Er.Name("self"),scope:new Er.Name("scope"),json:new Er.Name("json"),jsonPos:new Er.Name("jsonPos"),jsonLen:new Er.Name("jsonLen"),jsonPart:new Er.Name("jsonPart")};Rw.default=mU});var Vf=V(qr=>{"use strict";Object.defineProperty(qr,"__esModule",{value:!0});qr.extendErrors=qr.resetErrorsCount=qr.reportExtraError=qr.reportError=qr.keyword$DataError=qr.keywordError=void 0;var st=Je(),wm=it(),Br=Is();qr.keywordError={message:({keyword:t})=>(0,st.str)`must pass "${t}" keyword validation`};qr.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,st.str)`"${t}" keyword must be ${e} ($data)`:(0,st.str)`"${t}" keyword is invalid ($data)`};function gU(t,e=qr.keywordError,r,n){let{it:i}=t,{gen:s,compositeRule:o,allErrors:l}=i,c=Qq(t,e,r);n??(o||l)?Yq(s,c):Kq(i,(0,st._)`[${c}]`)}qr.reportError=gU;function yU(t,e=qr.keywordError,r){let{it:n}=t,{gen:i,compositeRule:s,allErrors:o}=n,l=Qq(t,e,r);Yq(i,l),s||o||Kq(n,Br.default.vErrors)}qr.reportExtraError=yU;function vU(t,e){t.assign(Br.default.errors,e),t.if((0,st._)`${Br.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,st._)`${Br.default.vErrors}.length`,e),()=>t.assign(Br.default.vErrors,null)))}qr.resetErrorsCount=vU;function bU({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let o=t.name("err");t.forRange("i",i,Br.default.errors,l=>{t.const(o,(0,st._)`${Br.default.vErrors}[${l}]`),t.if((0,st._)`${o}.instancePath === undefined`,()=>t.assign((0,st._)`${o}.instancePath`,(0,st.strConcat)(Br.default.instancePath,s.errorPath))),t.assign((0,st._)`${o}.schemaPath`,(0,st.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,st._)`${o}.schema`,r),t.assign((0,st._)`${o}.data`,n))})}qr.extendErrors=bU;function Yq(t,e){let r=t.const("err",e);t.if((0,st._)`${Br.default.vErrors} === null`,()=>t.assign(Br.default.vErrors,(0,st._)`[${r}]`),(0,st._)`${Br.default.vErrors}.push(${r})`),t.code((0,st._)`${Br.default.errors}++`)}function Kq(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,st._)`new ${t.ValidationError}(${e})`):(r.assign((0,st._)`${n}.errors`,e),r.return(!1))}var Fa={keyword:new st.Name("keyword"),schemaPath:new st.Name("schemaPath"),params:new st.Name("params"),propertyName:new st.Name("propertyName"),message:new st.Name("message"),schema:new st.Name("schema"),parentSchema:new st.Name("parentSchema")};function Qq(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,st._)`{}`:SU(t,e,r)}function SU(t,e,r={}){let{gen:n,it:i}=t,s=[wU(i,r),_U(t,r)];return RU(t,e,s),n.object(...s)}function wU({errorPath:t},{instancePath:e}){let r=e?(0,st.str)`${t}${(0,wm.getErrorPath)(e,wm.Type.Str)}`:t;return[Br.default.instancePath,(0,st.strConcat)(Br.default.instancePath,r)]}function _U({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,st.str)`${e}/${t}`;return r&&(i=(0,st.str)`${i}${(0,wm.getErrorPath)(r,wm.Type.Str)}`),[Fa.schemaPath,i]}function RU(t,{params:e,message:r},n){let{keyword:i,data:s,schemaValue:o,it:l}=t,{opts:c,propertyName:d,topSchemaRef:p,schemaPath:m}=l;n.push([Fa.keyword,i],[Fa.params,typeof e=="function"?e(t):e||(0,st._)`{}`]),c.messages&&n.push([Fa.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([Fa.schema,o],[Fa.parentSchema,(0,st._)`${p}${m}`],[Br.default.data,s]),d&&n.push([Fa.propertyName,d])}});var Xq=V(Pu=>{"use strict";Object.defineProperty(Pu,"__esModule",{value:!0});Pu.boolOrEmptySchema=Pu.topBoolOrEmptySchema=void 0;var xU=Vf(),CU=Je(),EU=Is(),qU={message:"boolean schema is false"};function IU(t){let{gen:e,schema:r,validateName:n}=t;r===!1?Zq(t,!1):typeof r=="object"&&r.$async===!0?e.return(EU.default.data):(e.assign((0,CU._)`${n}.errors`,null),e.return(!0))}Pu.topBoolOrEmptySchema=IU;function OU(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),Zq(t)):r.var(e,!0)}Pu.boolOrEmptySchema=OU;function Zq(t,e){let{gen:r,data:n}=t,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,xU.reportError)(i,qU,void 0,e)}});var xw=V(ku=>{"use strict";Object.defineProperty(ku,"__esModule",{value:!0});ku.getRules=ku.isJSONType=void 0;var PU=["string","number","integer","boolean","null","object","array"],kU=new Set(PU);function AU(t){return typeof t=="string"&&kU.has(t)}ku.isJSONType=AU;function TU(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}ku.getRules=TU});var Cw=V(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.shouldUseRule=So.shouldUseGroup=So.schemaHasRulesForType=void 0;function $U({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&eI(t,n)}So.schemaHasRulesForType=$U;function eI(t,e){return e.rules.some(r=>tI(t,r))}So.shouldUseGroup=eI;function tI(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}So.shouldUseRule=tI});var Wf=V(Ir=>{"use strict";Object.defineProperty(Ir,"__esModule",{value:!0});Ir.reportTypeError=Ir.checkDataTypes=Ir.checkDataType=Ir.coerceAndCheckDataType=Ir.getJSONTypes=Ir.getSchemaTypes=Ir.DataType=void 0;var NU=xw(),MU=Cw(),FU=Vf(),Fe=Je(),rI=it(),Au;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Au||(Ir.DataType=Au={}));function DU(t){let e=nI(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}Ir.getSchemaTypes=DU;function nI(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(NU.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}Ir.getJSONTypes=nI;function jU(t,e){let{gen:r,data:n,opts:i}=t,s=LU(e,i.coerceTypes),o=e.length>0&&!(s.length===0&&e.length===1&&(0,MU.schemaHasRulesForType)(t,e[0]));if(o){let l=qw(e,n,i.strictNumbers,Au.Wrong);r.if(l,()=>{s.length?UU(t,e,s):Iw(t)})}return o}Ir.coerceAndCheckDataType=jU;var iI=new Set(["string","number","integer","boolean","null"]);function LU(t,e){return e?t.filter(r=>iI.has(r)||e==="array"&&r==="array"):[]}function UU(t,e,r){let{gen:n,data:i,opts:s}=t,o=n.let("dataType",(0,Fe._)`typeof ${i}`),l=n.let("coerced",(0,Fe._)`undefined`);s.coerceTypes==="array"&&n.if((0,Fe._)`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,Fe._)`${i}[0]`).assign(o,(0,Fe._)`typeof ${i}`).if(qw(e,i,s.strictNumbers),()=>n.assign(l,i))),n.if((0,Fe._)`${l} !== undefined`);for(let d of r)(iI.has(d)||d==="array"&&s.coerceTypes==="array")&&c(d);n.else(),Iw(t),n.endIf(),n.if((0,Fe._)`${l} !== undefined`,()=>{n.assign(i,l),HU(t,l)});function c(d){switch(d){case"string":n.elseIf((0,Fe._)`${o} == "number" || ${o} == "boolean"`).assign(l,(0,Fe._)`"" + ${i}`).elseIf((0,Fe._)`${i} === null`).assign(l,(0,Fe._)`""`);return;case"number":n.elseIf((0,Fe._)`${o} == "boolean" || ${i} === null
|
|
25
25
|
|| (${o} == "string" && ${i} && ${i} == +${i})`).assign(l,(0,Fe._)`+${i}`);return;case"integer":n.elseIf((0,Fe._)`${o} === "boolean" || ${i} === null
|
|
26
26
|
|| (${o} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(l,(0,Fe._)`+${i}`);return;case"boolean":n.elseIf((0,Fe._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(l,!1).elseIf((0,Fe._)`${i} === "true" || ${i} === 1`).assign(l,!0);return;case"null":n.elseIf((0,Fe._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(l,null);return;case"array":n.elseIf((0,Fe._)`${o} === "string" || ${o} === "number"
|
|
27
|
-
|| ${o} === "boolean" || ${i} === null`).assign(l,(0,Fe._)`[${i}]`)}}}function HU({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Fe._)`${e} !== undefined`,()=>t.assign((0,Fe._)`${e}[${r}]`,n))}function Ew(t,e,r,n=Au.Correct){let i=n===Au.Correct?Fe.operators.EQ:Fe.operators.NEQ,s;switch(t){case"null":return(0,Fe._)`${e} ${i} null`;case"array":s=(0,Fe._)`Array.isArray(${e})`;break;case"object":s=(0,Fe._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=o((0,Fe._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=o();break;default:return(0,Fe._)`typeof ${e} ${i} ${t}`}return n===Au.Correct?s:(0,Fe.not)(s);function o(l=Fe.nil){return(0,Fe.and)((0,Fe._)`typeof ${e} == "number"`,l,r?(0,Fe._)`isFinite(${e})`:Fe.nil)}}Ir.checkDataType=Ew;function qw(t,e,r,n){if(t.length===1)return Ew(t[0],e,r,n);let i,s=(0,rI.toHash)(t);if(s.array&&s.object){let o=(0,Fe._)`typeof ${e} != "object"`;i=s.null?o:(0,Fe._)`!${e} || ${o}`,delete s.null,delete s.array,delete s.object}else i=Fe.nil;s.number&&delete s.integer;for(let o in s)i=(0,Fe.and)(i,Ew(o,e,r,n));return i}Ir.checkDataTypes=qw;var BU={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Fe._)`{type: ${t}}`:(0,Fe._)`{type: ${e}}`};function Iw(t){let e=VU(t);(0,FU.reportError)(e,BU)}Ir.reportTypeError=Iw;function VU(t){let{gen:e,data:r,schema:n}=t,i=(0,rI.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var oI=V(_m=>{"use strict";Object.defineProperty(_m,"__esModule",{value:!0});_m.assignDefaults=void 0;var Tu=Je(),WU=it();function zU(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)sI(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>sI(t,s,i.default))}_m.assignDefaults=zU;function sI(t,e,r){let{gen:n,compositeRule:i,data:s,opts:o}=t;if(r===void 0)return;let l=(0,Tu._)`${s}${(0,Tu.getProperty)(e)}`;if(i){(0,WU.checkStrictMode)(t,`default is ignored for: ${l}`);return}let c=(0,Tu._)`${l} === undefined`;o.useDefaults==="empty"&&(c=(0,Tu._)`${c} || ${l} === null || ${l} === ""`),n.if(c,(0,Tu._)`${l} = ${(0,Tu.stringify)(r)}`)}});var Vn=V(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.validateUnion=Ot.validateArray=Ot.usePattern=Ot.callValidateCode=Ot.schemaProperties=Ot.allSchemaProperties=Ot.noPropertyInData=Ot.propertyInData=Ot.isOwnProperty=Ot.hasPropFunc=Ot.reportMissingProp=Ot.checkMissingProp=Ot.checkReportMissingProp=void 0;var Mt=Je(),Ow=it(),wo=Is(),JU=it();function GU(t,e){let{gen:r,data:n,it:i}=t;r.if(kw(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Mt._)`${e}`},!0),t.error()})}Ot.checkReportMissingProp=GU;function YU({gen:t,data:e,it:{opts:r}},n,i){return(0,Mt.or)(...n.map(s=>(0,Mt.and)(kw(t,e,s,r.ownProperties),(0,Mt._)`${i} = ${s}`)))}Ot.checkMissingProp=YU;function KU(t,e){t.setParams({missingProperty:e},!0),t.error()}Ot.reportMissingProp=KU;function aI(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Mt._)`Object.prototype.hasOwnProperty`})}Ot.hasPropFunc=aI;function Pw(t,e,r){return(0,Mt._)`${aI(t)}.call(${e}, ${r})`}Ot.isOwnProperty=Pw;function QU(t,e,r,n){let i=(0,Mt._)`${e}${(0,Mt.getProperty)(r)} !== undefined`;return n?(0,Mt._)`${i} && ${Pw(t,e,r)}`:i}Ot.propertyInData=QU;function kw(t,e,r,n){let i=(0,Mt._)`${e}${(0,Mt.getProperty)(r)} === undefined`;return n?(0,Mt.or)(i,(0,Mt.not)(Pw(t,e,r))):i}Ot.noPropertyInData=kw;function lI(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}Ot.allSchemaProperties=lI;function ZU(t,e){return lI(e).filter(r=>!(0,Ow.alwaysValidSchema)(t,e[r]))}Ot.schemaProperties=ZU;function XU({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:o},l,c,d){let p=d?(0,Mt._)`${t}, ${e}, ${n}${i}`:e,m=[[wo.default.instancePath,(0,Mt.strConcat)(wo.default.instancePath,s)],[wo.default.parentData,o.parentData],[wo.default.parentDataProperty,o.parentDataProperty],[wo.default.rootData,wo.default.rootData]];o.opts.dynamicRef&&m.push([wo.default.dynamicAnchors,wo.default.dynamicAnchors]);let y=(0,Mt._)`${p}, ${r.object(...m)}`;return c!==Mt.nil?(0,Mt._)`${l}.call(${c}, ${y})`:(0,Mt._)`${l}(${y})`}Ot.callValidateCode=XU;var eH=(0,Mt._)`new RegExp`;function tH({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,s=i(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,Mt._)`${i.code==="new RegExp"?eH:(0,JU.useFunc)(t,i)}(${r}, ${n})`})}Ot.usePattern=tH;function rH(t){let{gen:e,data:r,keyword:n,it:i}=t,s=e.name("valid");if(i.allErrors){let l=e.let("valid",!0);return o(()=>e.assign(l,!1)),l}return e.var(s,!0),o(()=>e.break()),s;function o(l){let c=e.const("len",(0,Mt._)`${r}.length`);e.forRange("i",0,c,d=>{t.subschema({keyword:n,dataProp:d,dataPropType:Ow.Type.Num},s),e.if((0,Mt.not)(s),l)})}}Ot.validateArray=rH;function nH(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,Ow.alwaysValidSchema)(i,c))&&!i.opts.unevaluated)return;let o=e.let("valid",!1),l=e.name("_valid");e.block(()=>r.forEach((c,d)=>{let p=t.subschema({keyword:n,schemaProp:d,compositeRule:!0},l);e.assign(o,(0,Mt._)`${o} || ${l}`),t.mergeValidEvaluated(p,l)||e.if((0,Mt.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}Ot.validateUnion=nH});var fI=V(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.validateKeywordUsage=Ji.validSchemaType=Ji.funcKeywordCode=Ji.macroKeywordCode=void 0;var Vr=Je(),Da=Is(),iH=Vn(),sH=Vf();function oH(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:o}=t,l=e.macro.call(o.self,i,s,o),c=cI(r,n,l);o.opts.validateSchema!==!1&&o.self.validateSchema(l,!0);let d=r.name("valid");t.subschema({schema:l,schemaPath:Vr.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},d),t.pass(d,()=>t.error(!0))}Ji.macroKeywordCode=oH;function aH(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:o,$data:l,it:c}=t;uH(c,e);let d=!l&&e.compile?e.compile.call(c.self,s,o,c):e.validate,p=cI(n,i,d),m=n.let("valid");t.block$data(m,y),t.ok((r=e.valid)!==null&&r!==void 0?r:m);function y(){if(e.errors===!1)x(),e.modifying&&uI(t),v(()=>t.error());else{let _=e.async?b():q();e.modifying&&uI(t),v(()=>lH(t,_))}}function b(){let _=n.let("ruleErrs",null);return n.try(()=>x((0,Vr._)`await `),E=>n.assign(m,!1).if((0,Vr._)`${E} instanceof ${c.ValidationError}`,()=>n.assign(_,(0,Vr._)`${E}.errors`),()=>n.throw(E))),_}function q(){let _=(0,Vr._)`${p}.errors`;return n.assign(_,null),x(Vr.nil),_}function x(_=e.async?(0,Vr._)`await `:Vr.nil){let E=c.opts.passContext?Da.default.this:Da.default.self,k=!("compile"in e&&!l||e.schema===!1);n.assign(m,(0,Vr._)`${_}${(0,iH.callValidateCode)(t,p,E,k)}`,e.modifying)}function v(_){var E;n.if((0,Vr.not)((E=e.valid)!==null&&E!==void 0?E:m),_)}}Ji.funcKeywordCode=aH;function uI(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Vr._)`${n.parentData}[${n.parentDataProperty}]`))}function lH(t,e){let{gen:r}=t;r.if((0,Vr._)`Array.isArray(${e})`,()=>{r.assign(Da.default.vErrors,(0,Vr._)`${Da.default.vErrors} === null ? ${e} : ${Da.default.vErrors}.concat(${e})`).assign(Da.default.errors,(0,Vr._)`${Da.default.vErrors}.length`),(0,sH.extendErrors)(t)},()=>t.error())}function uH({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function cI(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Vr.stringify)(r)})}function cH(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}Ji.validSchemaType=cH;function fH({schema:t,opts:e,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let o=i.dependencies;if(o?.some(l=>!Object.prototype.hasOwnProperty.call(t,l)))throw new Error(`parent schema must have dependencies of ${s}: ${o.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[s])){let c=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Ji.validateKeywordUsage=fH});var pI=V(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0});_o.extendSubschemaMode=_o.extendSubschemaData=_o.getSubschema=void 0;var Gi=Je(),dI=it();function dH(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:o}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let l=t.schema[e];return r===void 0?{schema:l,schemaPath:(0,Gi._)`${t.schemaPath}${(0,Gi.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,Gi._)`${t.schemaPath}${(0,Gi.getProperty)(e)}${(0,Gi.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,dI.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:o,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}_o.getSubschema=dH;function pH(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:o}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:l}=e;if(r!==void 0){let{errorPath:d,dataPathArr:p,opts:m}=e,y=l.let("data",(0,Gi._)`${e.data}${(0,Gi.getProperty)(r)}`,!0);c(y),t.errorPath=(0,Gi.str)`${d}${(0,dI.getErrorPath)(r,n,m.jsPropertySyntax)}`,t.parentDataProperty=(0,Gi._)`${r}`,t.dataPathArr=[...p,t.parentDataProperty]}if(i!==void 0){let d=i instanceof Gi.Name?i:l.let("data",i,!0);c(d),o!==void 0&&(t.propertyName=o)}s&&(t.dataTypes=s);function c(d){t.data=d,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,d]}}_o.extendSubschemaData=pH;function hH(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}_o.extendSubschemaMode=hH});var Aw=V((kQ,hI)=>{"use strict";hI.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var o=s[i];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}});var gI=V((AQ,mI)=>{"use strict";var Ro=mI.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};Rm(e,n,i,t,"",t)};Ro.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Ro.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Ro.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Ro.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 Rm(t,e,r,n,i,s,o,l,c,d){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,o,l,c,d);for(var p in n){var m=n[p];if(Array.isArray(m)){if(p in Ro.arrayKeywords)for(var y=0;y<m.length;y++)Rm(t,e,r,m[y],i+"/"+p+"/"+y,s,i,p,n,y)}else if(p in Ro.propsKeywords){if(m&&typeof m=="object")for(var b in m)Rm(t,e,r,m[b],i+"/"+p+"/"+mH(b),s,i,p,n,b)}else(p in Ro.keywords||t.allKeys&&!(p in Ro.skipKeywords))&&Rm(t,e,r,m,i+"/"+p,s,i,p,n)}r(n,i,s,o,l,c,d)}}function mH(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var zf=V(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.getSchemaRefs=on.resolveUrl=on.normalizeId=on._getFullPath=on.getFullPath=on.inlineRef=void 0;var gH=it(),yH=Aw(),vH=gI(),bH=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function SH(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Tw(t):e?yI(t)<=e:!1}on.inlineRef=SH;var wH=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Tw(t){for(let e in t){if(wH.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Tw)||typeof r=="object"&&Tw(r))return!0}return!1}function yI(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!bH.has(r)&&(typeof t[r]=="object"&&(0,gH.eachItem)(t[r],n=>e+=yI(n)),e===1/0))return 1/0}return e}function vI(t,e="",r){r!==!1&&(e=$u(e));let n=t.parse(e);return bI(t,n)}on.getFullPath=vI;function bI(t,e){return t.serialize(e).split("#")[0]+"#"}on._getFullPath=bI;var _H=/#\/?$/;function $u(t){return t?t.replace(_H,""):""}on.normalizeId=$u;function RH(t,e,r){return r=$u(r),t.resolve(e,r)}on.resolveUrl=RH;var xH=/^[a-z_][-a-z0-9._]*$/i;function CH(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=$u(t[r]||e),s={"":i},o=vI(n,i,!1),l={},c=new Set;return vH(t,{allKeys:!0},(m,y,b,q)=>{if(q===void 0)return;let x=o+y,v=s[q];typeof m[r]=="string"&&(v=_.call(this,m[r])),E.call(this,m.$anchor),E.call(this,m.$dynamicAnchor),s[y]=v;function _(k){let P=this.opts.uriResolver.resolve;if(k=$u(v?P(v,k):k),c.has(k))throw p(k);c.add(k);let M=this.refs[k];return typeof M=="string"&&(M=this.refs[M]),typeof M=="object"?d(m,M.schema,k):k!==$u(x)&&(k[0]==="#"?(d(m,l[k],k),l[k]=m):this.refs[k]=x),k}function E(k){if(typeof k=="string"){if(!xH.test(k))throw new Error(`invalid anchor "${k}"`);_.call(this,`#${k}`)}}}),l;function d(m,y,b){if(y!==void 0&&!yH(m,y))throw p(b)}function p(m){return new Error(`reference "${m}" resolves to more than one schema`)}}on.getSchemaRefs=CH});var Yf=V(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.getData=xo.KeywordCxt=xo.validateFunctionCode=void 0;var xI=Xq(),SI=Wf(),Nw=Cw(),xm=Wf(),EH=oI(),Gf=fI(),$w=pI(),_e=Je(),Pe=Is(),qH=zf(),Os=it(),Jf=Vf();function IH(t){if(qI(t)&&(II(t),EI(t))){kH(t);return}CI(t,()=>(0,xI.topBoolOrEmptySchema)(t))}xo.validateFunctionCode=IH;function CI({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,_e._)`${Pe.default.data}, ${Pe.default.valCxt}`,n.$async,()=>{t.code((0,_e._)`"use strict"; ${wI(r,i)}`),PH(t,i),t.code(s)}):t.func(e,(0,_e._)`${Pe.default.data}, ${OH(i)}`,n.$async,()=>t.code(wI(r,i)).code(s))}function OH(t){return(0,_e._)`{${Pe.default.instancePath}="", ${Pe.default.parentData}, ${Pe.default.parentDataProperty}, ${Pe.default.rootData}=${Pe.default.data}${t.dynamicRef?(0,_e._)`, ${Pe.default.dynamicAnchors}={}`:_e.nil}}={}`}function PH(t,e){t.if(Pe.default.valCxt,()=>{t.var(Pe.default.instancePath,(0,_e._)`${Pe.default.valCxt}.${Pe.default.instancePath}`),t.var(Pe.default.parentData,(0,_e._)`${Pe.default.valCxt}.${Pe.default.parentData}`),t.var(Pe.default.parentDataProperty,(0,_e._)`${Pe.default.valCxt}.${Pe.default.parentDataProperty}`),t.var(Pe.default.rootData,(0,_e._)`${Pe.default.valCxt}.${Pe.default.rootData}`),e.dynamicRef&&t.var(Pe.default.dynamicAnchors,(0,_e._)`${Pe.default.valCxt}.${Pe.default.dynamicAnchors}`)},()=>{t.var(Pe.default.instancePath,(0,_e._)`""`),t.var(Pe.default.parentData,(0,_e._)`undefined`),t.var(Pe.default.parentDataProperty,(0,_e._)`undefined`),t.var(Pe.default.rootData,Pe.default.data),e.dynamicRef&&t.var(Pe.default.dynamicAnchors,(0,_e._)`{}`)})}function kH(t){let{schema:e,opts:r,gen:n}=t;CI(t,()=>{r.$comment&&e.$comment&&PI(t),MH(t),n.let(Pe.default.vErrors,null),n.let(Pe.default.errors,0),r.unevaluated&&AH(t),OI(t),jH(t)})}function AH(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,_e._)`${r}.evaluated`),e.if((0,_e._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,_e._)`${t.evaluated}.props`,(0,_e._)`undefined`)),e.if((0,_e._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,_e._)`${t.evaluated}.items`,(0,_e._)`undefined`))}function wI(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,_e._)`/*# sourceURL=${r} */`:_e.nil}function TH(t,e){if(qI(t)&&(II(t),EI(t))){$H(t,e);return}(0,xI.boolOrEmptySchema)(t,e)}function EI({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function qI(t){return typeof t.schema!="boolean"}function $H(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&PI(t),FH(t),DH(t);let s=n.const("_errs",Pe.default.errors);OI(t,s),n.var(e,(0,_e._)`${s} === ${Pe.default.errors}`)}function II(t){(0,Os.checkUnknownRules)(t),NH(t)}function OI(t,e){if(t.opts.jtd)return _I(t,[],!1,e);let r=(0,SI.getSchemaTypes)(t.schema),n=(0,SI.coerceAndCheckDataType)(t,r);_I(t,r,!n,e)}function NH(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Os.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function MH(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Os.checkStrictMode)(t,"default is ignored in the schema root")}function FH(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,qH.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function DH(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function PI({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,_e._)`${Pe.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let o=(0,_e.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,_e._)`${Pe.default.self}.opts.$comment(${s}, ${o}, ${l}.schema)`)}}function jH(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,_e._)`${Pe.default.errors} === 0`,()=>e.return(Pe.default.data),()=>e.throw((0,_e._)`new ${i}(${Pe.default.vErrors})`)):(e.assign((0,_e._)`${n}.errors`,Pe.default.vErrors),s.unevaluated&&LH(t),e.return((0,_e._)`${Pe.default.errors} === 0`))}function LH({gen:t,evaluated:e,props:r,items:n}){r instanceof _e.Name&&t.assign((0,_e._)`${e}.props`,r),n instanceof _e.Name&&t.assign((0,_e._)`${e}.items`,n)}function _I(t,e,r,n){let{gen:i,schema:s,data:o,allErrors:l,opts:c,self:d}=t,{RULES:p}=d;if(s.$ref&&(c.ignoreKeywordsWithRef||!(0,Os.schemaHasRulesButRef)(s,p))){i.block(()=>AI(t,"$ref",p.all.$ref.definition));return}c.jtd||UH(t,e),i.block(()=>{for(let y of p.rules)m(y);m(p.post)});function m(y){(0,Nw.shouldUseGroup)(s,y)&&(y.type?(i.if((0,xm.checkDataType)(y.type,o,c.strictNumbers)),RI(t,y),e.length===1&&e[0]===y.type&&r&&(i.else(),(0,xm.reportTypeError)(t)),i.endIf()):RI(t,y),l||i.if((0,_e._)`${Pe.default.errors} === ${n||0}`))}}function RI(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,EH.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,Nw.shouldUseRule)(n,s)&&AI(t,s.keyword,s.definition,e.type)})}function UH(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(HH(t,e),t.opts.allowUnionTypes||BH(t,e),VH(t,t.dataTypes))}function HH(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{kI(t.dataTypes,r)||Mw(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),zH(t,e)}}function BH(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Mw(t,"use allowUnionTypes to allow union type keyword")}function VH(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,Nw.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(o=>WH(e,o))&&Mw(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function WH(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function kI(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function zH(t,e){let r=[];for(let n of t.dataTypes)kI(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function Mw(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Os.checkStrictMode)(t,e,t.opts.strictTypes)}var Cm=class{constructor(e,r,n){if((0,Gf.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Os.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",TI(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Gf.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=e.gen.const("_errs",Pe.default.errors))}result(e,r,n){this.failResult((0,_e.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,_e.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,_e._)`${r} !== undefined && (${(0,_e.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?Jf.reportExtraError:Jf.reportError)(this,this.def.error,r)}$dataError(){(0,Jf.reportError)(this,this.def.$dataError||Jf.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Jf.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=_e.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=_e.nil,r=_e.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:o}=this;n.if((0,_e.or)((0,_e._)`${i} === undefined`,r)),e!==_e.nil&&n.assign(e,!0),(s.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==_e.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,_e.or)(o(),l());function o(){if(n.length){if(!(r instanceof _e.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,_e._)`${(0,xm.checkDataTypes)(c,r,s.opts.strictNumbers,xm.DataType.Wrong)}`}return _e.nil}function l(){if(i.validateSchema){let c=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,_e._)`!${c}(${r})`}return _e.nil}}subschema(e,r){let n=(0,$w.getSubschema)(this.it,e);(0,$w.extendSubschemaData)(n,this.it,e),(0,$w.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return TH(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Os.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Os.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,_e.Name)),!0}};xo.KeywordCxt=Cm;function AI(t,e,r,n){let i=new Cm(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Gf.funcKeywordCode)(i,r):"macro"in r?(0,Gf.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Gf.funcKeywordCode)(i,r)}var JH=/^\/(?:[^~]|~0|~1)*$/,GH=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function TI(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return Pe.default.rootData;if(t[0]==="/"){if(!JH.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=Pe.default.rootData}else{let d=GH.exec(t);if(!d)throw new Error(`Invalid JSON-pointer: ${t}`);let p=+d[1];if(i=d[2],i==="#"){if(p>=e)throw new Error(c("property/index",p));return n[e-p]}if(p>e)throw new Error(c("data",p));if(s=r[e-p],!i)return s}let o=s,l=i.split("/");for(let d of l)d&&(s=(0,_e._)`${s}${(0,_e.getProperty)((0,Os.unescapeJsonPointer)(d))}`,o=(0,_e._)`${o} && ${s}`);return o;function c(d,p){return`Cannot access ${d} ${p} levels up, current level is ${e}`}}xo.getData=TI});var Em=V(Dw=>{"use strict";Object.defineProperty(Dw,"__esModule",{value:!0});var Fw=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Dw.default=Fw});var Kf=V(Uw=>{"use strict";Object.defineProperty(Uw,"__esModule",{value:!0});var jw=zf(),Lw=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,jw.resolveUrl)(e,r,n),this.missingSchema=(0,jw.normalizeId)((0,jw.getFullPath)(e,this.missingRef))}};Uw.default=Lw});var Im=V(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.resolveSchema=Wn.getCompilingSchema=Wn.resolveRef=Wn.compileSchema=Wn.SchemaEnv=void 0;var fi=Je(),YH=Em(),ja=Is(),di=zf(),$I=it(),KH=Yf(),Nu=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,di.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Wn.SchemaEnv=Nu;function Bw(t){let e=NI.call(this,t);if(e)return e;let r=(0,di.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,o=new fi.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),l;t.$async&&(l=o.scopeValue("Error",{ref:YH.default,code:(0,fi._)`require("ajv/dist/runtime/validation_error").default`}));let c=o.scopeName("validate");t.validateName=c;let d={gen:o,allErrors:this.opts.allErrors,data:ja.default.data,parentData:ja.default.parentData,parentDataProperty:ja.default.parentDataProperty,dataNames:[ja.default.data],dataPathArr:[fi.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,fi.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:fi.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,fi._)`""`,opts:this.opts,self:this},p;try{this._compilations.add(t),(0,KH.validateFunctionCode)(d),o.optimize(this.opts.code.optimize);let m=o.toString();p=`${o.scopeRefs(ja.default.scope)}return ${m}`,this.opts.code.process&&(p=this.opts.code.process(p,t));let b=new Function(`${ja.default.self}`,`${ja.default.scope}`,p)(this,this.scope.get());if(this.scope.value(c,{ref:b}),b.errors=null,b.schema=t.schema,b.schemaEnv=t,t.$async&&(b.$async=!0),this.opts.code.source===!0&&(b.source={validateName:c,validateCode:m,scopeValues:o._values}),this.opts.unevaluated){let{props:q,items:x}=d;b.evaluated={props:q instanceof fi.Name?void 0:q,items:x instanceof fi.Name?void 0:x,dynamicProps:q instanceof fi.Name,dynamicItems:x instanceof fi.Name},b.source&&(b.source.evaluated=(0,fi.stringify)(b.evaluated))}return t.validate=b,t}catch(m){throw delete t.validate,delete t.validateName,p&&this.logger.error("Error compiling schema, function code:",p),m}finally{this._compilations.delete(t)}}Wn.compileSchema=Bw;function QH(t,e,r){var n;r=(0,di.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=eB.call(this,t,r);if(s===void 0){let o=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:l}=this.opts;o&&(s=new Nu({schema:o,schemaId:l,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=ZH.call(this,s)}Wn.resolveRef=QH;function ZH(t){return(0,di.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Bw.call(this,t)}function NI(t){for(let e of this._compilations)if(XH(e,t))return e}Wn.getCompilingSchema=NI;function XH(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function eB(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||qm.call(this,t,e)}function qm(t,e){let r=this.opts.uriResolver.parse(e),n=(0,di._getFullPath)(this.opts.uriResolver,r),i=(0,di.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return Hw.call(this,r,t);let s=(0,di.normalizeId)(n),o=this.refs[s]||this.schemas[s];if(typeof o=="string"){let l=qm.call(this,t,o);return typeof l?.schema!="object"?void 0:Hw.call(this,r,l)}if(typeof o?.schema=="object"){if(o.validate||Bw.call(this,o),s===(0,di.normalizeId)(e)){let{schema:l}=o,{schemaId:c}=this.opts,d=l[c];return d&&(i=(0,di.resolveUrl)(this.opts.uriResolver,i,d)),new Nu({schema:l,schemaId:c,root:t,baseId:i})}return Hw.call(this,r,o)}}Wn.resolveSchema=qm;var tB=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Hw(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let l of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,$I.unescapeFragment)(l)];if(c===void 0)return;r=c;let d=typeof r=="object"&&r[this.opts.schemaId];!tB.has(l)&&d&&(e=(0,di.resolveUrl)(this.opts.uriResolver,e,d))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,$I.schemaHasRulesButRef)(r,this.RULES)){let l=(0,di.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=qm.call(this,n,l)}let{schemaId:o}=this.opts;if(s=s||new Nu({schema:r,schemaId:o,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var MI=V((DQ,rB)=>{rB.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 zw=V((jQ,HI)=>{"use strict";var nB=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),DI=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),Vw=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),jI=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),iB=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Ww(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var sB=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function FI(t){return t.length=0,!0}function oB(t,e,r){if(t.length){let n=Ww(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function aB(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,o=!1,l=oB;for(let c=0;c<t.length;c++){let d=t[c];if(!(d==="["||d==="]"))if(d===":"){if(s===!0&&(o=!0),!l(i,n,r))break;if(++e>7){r.error=!0;break}c>0&&t[c-1]===":"&&(s=!0),n.push(":");continue}else if(d==="%"){if(!l(i,n,r))break;l=FI}else{i.push(d);continue}}return i.length&&(l===FI?r.zone=i.join(""):o?n.push(i.join("")):n.push(Ww(i))),r.address=n.join(""),r}function LI(t){if(lB(t,":")<2)return{host:t,isIPV6:!1};let e=aB(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function lB(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function uB(t){let e=t,r=[],n=-1,i=0;for(;i=e.length;){if(i===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(i===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(i===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}var cB={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},fB=/[@/?#:]/g,dB=/[@/?#]/g;function UI(t,e){let r=e?dB:fB;return r.lastIndex=0,t.replace(r,n=>cB[n])}function pB(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let i=t.slice(n+1,n+3);if(Vw(i)){let s=i.toUpperCase(),o=String.fromCharCode(parseInt(s,16));e&&jI(o)?r+=o:r+="%"+s,n+=2;continue}}r+=t[n]}return r}function hB(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(Vw(n)){let i=n.toUpperCase(),s=String.fromCharCode(parseInt(i,16));s!=="."&&jI(s)?e+=s:e+="%"+i,r+=2;continue}}iB(t[r])?e+=t[r]:e+=escape(t[r])}return e}function mB(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(Vw(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function gB(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!DI(r)){let n=LI(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=UI(r,!1)}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}HI.exports={nonSimpleDomain:sB,recomposeAuthority:gB,reescapeHostDelimiters:UI,normalizePercentEncoding:pB,normalizePathEncoding:hB,escapePreservingEscapes:mB,removeDotSegments:uB,isIPv4:DI,isUUID:nB,normalizeIPv6:LI,stringArrayToHexStripped:Ww}});var JI=V((LQ,zI)=>{"use strict";var{isUUID:yB}=zw(),vB=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,bB=["http","https","ws","wss","urn","urn:uuid"];function SB(t){return bB.indexOf(t)!==-1}function Jw(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function BI(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function VI(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function wB(t){return t.secure=Jw(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function _B(t){if((t.port===(Jw(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function RB(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(vB);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let i=`${n}:${e.nid||t.nid}`,s=Gw(i);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function xB(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),i=`${r}:${e.nid||n}`,s=Gw(i);s&&(t=s.serialize(t,e));let o=t,l=t.nss;return o.path=`${n||e.nid}:${l}`,e.skipEscape=!0,o}function CB(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!yB(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function EB(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var WI={scheme:"http",domainHost:!0,parse:BI,serialize:VI},qB={scheme:"https",domainHost:WI.domainHost,parse:BI,serialize:VI},Om={scheme:"ws",domainHost:!0,parse:wB,serialize:_B},IB={scheme:"wss",domainHost:Om.domainHost,parse:Om.parse,serialize:Om.serialize},OB={scheme:"urn",parse:RB,serialize:xB,skipNormalize:!0},PB={scheme:"urn:uuid",parse:CB,serialize:EB,skipNormalize:!0},Pm={http:WI,https:qB,ws:Om,wss:IB,urn:OB,"urn:uuid":PB};Object.setPrototypeOf(Pm,null);function Gw(t){return t&&(Pm[t]||Pm[t.toLowerCase()])||void 0}zI.exports={wsIsSecure:Jw,SCHEMES:Pm,isValidSchemeName:SB,getSchemeHandler:Gw}});var XI=V((UQ,km)=>{"use strict";var{normalizeIPv6:kB,removeDotSegments:Qf,recomposeAuthority:AB,normalizePercentEncoding:TB,normalizePathEncoding:$B,escapePreservingEscapes:NB,reescapeHostDelimiters:MB,isIPv4:FB,nonSimpleDomain:DB}=zw(),{SCHEMES:jB,getSchemeHandler:YI}=JI();function LB(t,e){return typeof t=="string"?t=WB(t,e):typeof t=="object"&&(t=Mu(La(t,e),e)),t}function UB(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=KI(Mu(t,n),Mu(e,n),n,!0);return n.skipEscape=!0,La(i,n)}function KI(t,e,r,n){let i={};return n||(t=Mu(La(t,r),r),e=Mu(La(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=Qf(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=Qf(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=Qf(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?i.path="/"+e.path:t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=Qf(i.path)),i.query=e.query):(i.path=t.path,e.query!==void 0?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function HB(t,e,r){let n=GI(t,r),i=GI(e,r);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()}function La(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),i=[],s=YI(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=TB(r.path):(r.path=NB(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let o=AB(r);if(o!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(o),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let l=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(l=Qf(l)),o===void 0&&l[0]==="/"&&l[1]==="/"&&(l="/%2F"+l.slice(2)),i.push(l)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var BB=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function VB(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function QI(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1,s=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let o=t.match(BB);if(o){n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5]);let l=VB(n,o);if(l!==void 0&&(n.error=n.error||l,i=!0),n.host)if(FB(n.host)===!1){let p=kB(n.host);n.host=p.host.toLowerCase(),s=p.isIPV6}else s=!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 c=YI(r.scheme||n.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(r.domainHost||c&&c.domainHost)&&s===!1&&DB(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(d){n.error=n.error||"Host's domain name can not be converted to ASCII: "+d}if((!c||c&&!c.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=MB(unescape(n.host),s))),n.path&&(n.path=$B(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}c&&c.parse&&c.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:i}}function Mu(t,e){return QI(t,e).parsed}function WB(t,e){return ZI(t,e).normalized}function ZI(t,e){let{parsed:r,malformedAuthorityOrPort:n}=QI(t,e);return{normalized:n?t:La(r,e),malformedAuthorityOrPort:n}}function GI(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=ZI(t,e);return n?void 0:r}if(typeof t=="object")return La(t,e)}var Yw={SCHEMES:jB,normalize:LB,resolve:UB,resolveComponent:KI,equal:HB,serialize:La,parse:Mu};km.exports=Yw;km.exports.default=Yw;km.exports.fastUri=Yw});var tO=V(Kw=>{"use strict";Object.defineProperty(Kw,"__esModule",{value:!0});var eO=XI();eO.code='require("ajv/dist/runtime/uri").default';Kw.default=eO});var uO=V(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.CodeGen=yr.Name=yr.nil=yr.stringify=yr.str=yr._=yr.KeywordCxt=void 0;var zB=Yf();Object.defineProperty(yr,"KeywordCxt",{enumerable:!0,get:function(){return zB.KeywordCxt}});var Fu=Je();Object.defineProperty(yr,"_",{enumerable:!0,get:function(){return Fu._}});Object.defineProperty(yr,"str",{enumerable:!0,get:function(){return Fu.str}});Object.defineProperty(yr,"stringify",{enumerable:!0,get:function(){return Fu.stringify}});Object.defineProperty(yr,"nil",{enumerable:!0,get:function(){return Fu.nil}});Object.defineProperty(yr,"Name",{enumerable:!0,get:function(){return Fu.Name}});Object.defineProperty(yr,"CodeGen",{enumerable:!0,get:function(){return Fu.CodeGen}});var JB=Em(),oO=Kf(),GB=xw(),Zf=Im(),YB=Je(),Xf=zf(),Am=Wf(),Zw=it(),rO=MI(),KB=tO(),aO=(t,e)=>new RegExp(t,e);aO.code="new RegExp";var QB=["removeAdditional","useDefaults","coerceTypes"],ZB=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),XB={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."},eV={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},nO=200;function tV(t){var e,r,n,i,s,o,l,c,d,p,m,y,b,q,x,v,_,E,k,P,M,j,I,R,A;let F=t.strict,U=(e=t.code)===null||e===void 0?void 0:e.optimize,D=U===!0||U===void 0?1:U||0,J=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:aO,Q=(i=t.uriResolver)!==null&&i!==void 0?i:KB.default;return{strictSchema:(o=(s=t.strictSchema)!==null&&s!==void 0?s:F)!==null&&o!==void 0?o:!0,strictNumbers:(c=(l=t.strictNumbers)!==null&&l!==void 0?l:F)!==null&&c!==void 0?c:!0,strictTypes:(p=(d=t.strictTypes)!==null&&d!==void 0?d:F)!==null&&p!==void 0?p:"log",strictTuples:(y=(m=t.strictTuples)!==null&&m!==void 0?m:F)!==null&&y!==void 0?y:"log",strictRequired:(q=(b=t.strictRequired)!==null&&b!==void 0?b:F)!==null&&q!==void 0?q:!1,code:t.code?{...t.code,optimize:D,regExp:J}:{optimize:D,regExp:J},loopRequired:(x=t.loopRequired)!==null&&x!==void 0?x:nO,loopEnum:(v=t.loopEnum)!==null&&v!==void 0?v:nO,meta:(_=t.meta)!==null&&_!==void 0?_:!0,messages:(E=t.messages)!==null&&E!==void 0?E:!0,inlineRefs:(k=t.inlineRefs)!==null&&k!==void 0?k:!0,schemaId:(P=t.schemaId)!==null&&P!==void 0?P:"$id",addUsedSchema:(M=t.addUsedSchema)!==null&&M!==void 0?M:!0,validateSchema:(j=t.validateSchema)!==null&&j!==void 0?j:!0,validateFormats:(I=t.validateFormats)!==null&&I!==void 0?I:!0,unicodeRegExp:(R=t.unicodeRegExp)!==null&&R!==void 0?R:!0,int32range:(A=t.int32range)!==null&&A!==void 0?A:!0,uriResolver:Q}}var ed=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...tV(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new YB.ValueScope({scope:{},prefixes:ZB,es5:r,lines:n}),this.logger=aV(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,GB.getRules)(),iO.call(this,XB,e,"NOT SUPPORTED"),iO.call(this,eV,e,"DEPRECATED","warn"),this._metaOpts=sV.call(this),e.formats&&nV.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&iV.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),rV.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=rO;n==="id"&&(i={...rO},i.id=i.$id,delete i.$id),r&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,e,r);async function i(p,m){await s.call(this,p.$schema);let y=this._addSchema(p,m);return y.validate||o.call(this,y)}async function s(p){p&&!this.getSchema(p)&&await i.call(this,{$ref:p},!0)}async function o(p){try{return this._compileSchemaEnv(p)}catch(m){if(!(m instanceof oO.default))throw m;return l.call(this,m),await c.call(this,m.missingSchema),o.call(this,p)}}function l({missingSchema:p,missingRef:m}){if(this.refs[p])throw new Error(`AnySchema ${p} is loaded but ${m} cannot be resolved`)}async function c(p){let m=await d.call(this,p);this.refs[p]||await s.call(this,m.$schema),this.refs[p]||this.addSchema(m,p,r)}async function d(p){let m=this._loading[p];if(m)return m;try{return await(this._loading[p]=n(p))}finally{delete this._loading[p]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,n,i);return this}let s;if(typeof e=="object"){let{schemaId:o}=this.opts;if(s=e[o],s!==void 0&&typeof s!="string")throw new Error(`schema ${o} must be string`)}return r=(0,Xf.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,i,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$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 i=this.validate(n,e);if(!i&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(e){let r;for(;typeof(r=sO.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Zf.SchemaEnv({schema:{},schemaId:n});if(r=Zf.resolveSchema.call(this,i,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=sO.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,Xf.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,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(uV.call(this,n,r),!r)return(0,Zw.eachItem)(n,s=>Qw.call(this,s)),this;fV.call(this,r);let i={...r,type:(0,Am.getJSONTypes)(r.type),schemaType:(0,Am.getJSONTypes)(r.schemaType)};return(0,Zw.eachItem)(n,i.type.length===0?s=>Qw.call(this,s,i):s=>i.type.forEach(o=>Qw.call(this,s,i,o))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of r){let s=i.split("/").slice(1),o=e;for(let l of s)o=o[l];for(let l in n){let c=n[l];if(typeof c!="object")continue;let{$data:d}=c.definition,p=o[l];d&&p&&(o[l]=lO(p))}}return e}_removeAllSchemas(e,r){for(let n in e){let i=e[n];(!r||r.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let o,{schemaId:l}=this.opts;if(typeof e=="object")o=e[l];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;n=(0,Xf.normalizeId)(o||n);let d=Xf.getSchemaRefs.call(this,e,n);return c=new Zf.SchemaEnv({schema:e,schemaId:l,meta:r,baseId:n,localRefs:d}),this._cache.set(c.schema,c),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),i&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):Zf.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{Zf.compileSchema.call(this,e)}finally{this.opts=r}}};ed.ValidationError=JB.default;ed.MissingRefError=oO.default;yr.default=ed;function iO(t,e,r,n="error"){for(let i in t){let s=i;s in e&&this.logger[n](`${r}: option ${i}. ${t[s]}`)}}function sO(t){return t=(0,Xf.normalizeId)(t),this.schemas[t]||this.refs[t]}function rV(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function nV(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function iV(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function sV(){let t={...this.opts};for(let e of QB)delete t[e];return t}var oV={log(){},warn(){},error(){}};function aV(t){if(t===!1)return oV;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var lV=/^[a-z_$][a-z0-9_$:-]*$/i;function uV(t,e){let{RULES:r}=this;if((0,Zw.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!lV.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function Qw(t,e,r){var n;let i=e?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,o=i?s.post:s.rules.find(({type:c})=>c===r);if(o||(o={type:r,rules:[]},s.rules.push(o)),s.keywords[t]=!0,!e)return;let l={keyword:t,definition:{...e,type:(0,Am.getJSONTypes)(e.type),schemaType:(0,Am.getJSONTypes)(e.schemaType)}};e.before?cV.call(this,o,l,e.before):o.rules.push(l),s.all[t]=l,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function cV(t,e,r){let n=t.rules.findIndex(i=>i.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function fV(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=lO(e)),t.validateSchema=this.compile(e,!0))}var dV={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function lO(t){return{anyOf:[t,dV]}}});var cO=V(Xw=>{"use strict";Object.defineProperty(Xw,"__esModule",{value:!0});var pV={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Xw.default=pV});var hO=V(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.callRef=Ua.getValidate=void 0;var hV=Kf(),fO=Vn(),an=Je(),Du=Is(),dO=Im(),Tm=it(),mV={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:s,validateName:o,opts:l,self:c}=n,{root:d}=s;if((r==="#"||r==="#/")&&i===d.baseId)return m();let p=dO.resolveRef.call(c,d,i,r);if(p===void 0)throw new hV.default(n.opts.uriResolver,i,r);if(p instanceof dO.SchemaEnv)return y(p);return b(p);function m(){if(s===d)return $m(t,o,s,s.$async);let q=e.scopeValue("root",{ref:d});return $m(t,(0,an._)`${q}.validate`,d,d.$async)}function y(q){let x=pO(t,q);$m(t,x,q,q.$async)}function b(q){let x=e.scopeValue("schema",l.code.source===!0?{ref:q,code:(0,an.stringify)(q)}:{ref:q}),v=e.name("valid"),_=t.subschema({schema:q,dataTypes:[],schemaPath:an.nil,topSchemaRef:x,errSchemaPath:r},v);t.mergeEvaluated(_),t.ok(v)}}};function pO(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,an._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Ua.getValidate=pO;function $m(t,e,r,n){let{gen:i,it:s}=t,{allErrors:o,schemaEnv:l,opts:c}=s,d=c.passContext?Du.default.this:an.nil;n?p():m();function p(){if(!l.$async)throw new Error("async schema referenced by sync schema");let q=i.let("valid");i.try(()=>{i.code((0,an._)`await ${(0,fO.callValidateCode)(t,e,d)}`),b(e),o||i.assign(q,!0)},x=>{i.if((0,an._)`!(${x} instanceof ${s.ValidationError})`,()=>i.throw(x)),y(x),o||i.assign(q,!1)}),t.ok(q)}function m(){t.result((0,fO.callValidateCode)(t,e,d),()=>b(e),()=>y(e))}function y(q){let x=(0,an._)`${q}.errors`;i.assign(Du.default.vErrors,(0,an._)`${Du.default.vErrors} === null ? ${x} : ${Du.default.vErrors}.concat(${x})`),i.assign(Du.default.errors,(0,an._)`${Du.default.vErrors}.length`)}function b(q){var x;if(!s.opts.unevaluated)return;let v=(x=r?.validate)===null||x===void 0?void 0:x.evaluated;if(s.props!==!0)if(v&&!v.dynamicProps)v.props!==void 0&&(s.props=Tm.mergeEvaluated.props(i,v.props,s.props));else{let _=i.var("props",(0,an._)`${q}.evaluated.props`);s.props=Tm.mergeEvaluated.props(i,_,s.props,an.Name)}if(s.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(s.items=Tm.mergeEvaluated.items(i,v.items,s.items));else{let _=i.var("items",(0,an._)`${q}.evaluated.items`);s.items=Tm.mergeEvaluated.items(i,_,s.items,an.Name)}}}Ua.callRef=$m;Ua.default=mV});var mO=V(e0=>{"use strict";Object.defineProperty(e0,"__esModule",{value:!0});var gV=cO(),yV=hO(),vV=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",gV.default,yV.default];e0.default=vV});var gO=V(t0=>{"use strict";Object.defineProperty(t0,"__esModule",{value:!0});var Nm=Je(),Co=Nm.operators,Mm={maximum:{okStr:"<=",ok:Co.LTE,fail:Co.GT},minimum:{okStr:">=",ok:Co.GTE,fail:Co.LT},exclusiveMaximum:{okStr:"<",ok:Co.LT,fail:Co.GTE},exclusiveMinimum:{okStr:">",ok:Co.GT,fail:Co.LTE}},bV={message:({keyword:t,schemaCode:e})=>(0,Nm.str)`must be ${Mm[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Nm._)`{comparison: ${Mm[t].okStr}, limit: ${e}}`},SV={keyword:Object.keys(Mm),type:"number",schemaType:"number",$data:!0,error:bV,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,Nm._)`${r} ${Mm[e].fail} ${n} || isNaN(${r})`)}};t0.default=SV});var yO=V(r0=>{"use strict";Object.defineProperty(r0,"__esModule",{value:!0});var td=Je(),wV={message:({schemaCode:t})=>(0,td.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,td._)`{multipleOf: ${t}}`},_V={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:wV,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,o=e.let("res"),l=s?(0,td._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:(0,td._)`${o} !== parseInt(${o})`;t.fail$data((0,td._)`(${n} === 0 || (${o} = ${r}/${n}, ${l}))`)}};r0.default=_V});var bO=V(n0=>{"use strict";Object.defineProperty(n0,"__esModule",{value:!0});function vO(t){let e=t.length,r=0,n=0,i;for(;n<e;)r++,i=t.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=t.charCodeAt(n),(i&64512)===56320&&n++);return r}n0.default=vO;vO.code='require("ajv/dist/runtime/ucs2length").default'});var SO=V(i0=>{"use strict";Object.defineProperty(i0,"__esModule",{value:!0});var Ha=Je(),RV=it(),xV=bO(),CV={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Ha.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Ha._)`{limit: ${t}}`},EV={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:CV,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?Ha.operators.GT:Ha.operators.LT,o=i.opts.unicode===!1?(0,Ha._)`${r}.length`:(0,Ha._)`${(0,RV.useFunc)(t.gen,xV.default)}(${r})`;t.fail$data((0,Ha._)`${o} ${s} ${n}`)}};i0.default=EV});var wO=V(s0=>{"use strict";Object.defineProperty(s0,"__esModule",{value:!0});var qV=Vn(),IV=it(),ju=Je(),OV={message:({schemaCode:t})=>(0,ju.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,ju._)`{pattern: ${t}}`},PV={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:OV,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:o}=t,l=o.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=o.opts.code,d=c.code==="new RegExp"?(0,ju._)`new RegExp`:(0,IV.useFunc)(e,c),p=e.let("valid");e.try(()=>e.assign(p,(0,ju._)`${d}(${s}, ${l}).test(${r})`),()=>e.assign(p,!1)),t.fail$data((0,ju._)`!${p}`)}else{let c=(0,qV.usePattern)(t,i);t.fail$data((0,ju._)`!${c}.test(${r})`)}}};s0.default=PV});var _O=V(o0=>{"use strict";Object.defineProperty(o0,"__esModule",{value:!0});var rd=Je(),kV={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,rd.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,rd._)`{limit: ${t}}`},AV={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:kV,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?rd.operators.GT:rd.operators.LT;t.fail$data((0,rd._)`Object.keys(${r}).length ${i} ${n}`)}};o0.default=AV});var RO=V(a0=>{"use strict";Object.defineProperty(a0,"__esModule",{value:!0});var nd=Vn(),id=Je(),TV=it(),$V={message:({params:{missingProperty:t}})=>(0,id.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,id._)`{missingProperty: ${t}}`},NV={keyword:"required",type:"object",schemaType:"array",$data:!0,error:$V,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:s,it:o}=t,{opts:l}=o;if(!s&&r.length===0)return;let c=r.length>=l.loopRequired;if(o.allErrors?d():p(),l.strictRequired){let b=t.parentSchema.properties,{definedProperties:q}=t.it;for(let x of r)if(b?.[x]===void 0&&!q.has(x)){let v=o.schemaEnv.baseId+o.errSchemaPath,_=`required property "${x}" is not defined at "${v}" (strictRequired)`;(0,TV.checkStrictMode)(o,_,o.opts.strictRequired)}}function d(){if(c||s)t.block$data(id.nil,m);else for(let b of r)(0,nd.checkReportMissingProp)(t,b)}function p(){let b=e.let("missing");if(c||s){let q=e.let("valid",!0);t.block$data(q,()=>y(b,q)),t.ok(q)}else e.if((0,nd.checkMissingProp)(t,r,b)),(0,nd.reportMissingProp)(t,b),e.else()}function m(){e.forOf("prop",n,b=>{t.setParams({missingProperty:b}),e.if((0,nd.noPropertyInData)(e,i,b,l.ownProperties),()=>t.error())})}function y(b,q){t.setParams({missingProperty:b}),e.forOf(b,n,()=>{e.assign(q,(0,nd.propertyInData)(e,i,b,l.ownProperties)),e.if((0,id.not)(q),()=>{t.error(),e.break()})},id.nil)}}};a0.default=NV});var xO=V(l0=>{"use strict";Object.defineProperty(l0,"__esModule",{value:!0});var sd=Je(),MV={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,sd.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,sd._)`{limit: ${t}}`},FV={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:MV,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?sd.operators.GT:sd.operators.LT;t.fail$data((0,sd._)`${r}.length ${i} ${n}`)}};l0.default=FV});var Fm=V(u0=>{"use strict";Object.defineProperty(u0,"__esModule",{value:!0});var CO=Aw();CO.code='require("ajv/dist/runtime/equal").default';u0.default=CO});var EO=V(f0=>{"use strict";Object.defineProperty(f0,"__esModule",{value:!0});var c0=Wf(),vr=Je(),DV=it(),jV=Fm(),LV={message:({params:{i:t,j:e}})=>(0,vr.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,vr._)`{i: ${t}, j: ${e}}`},UV={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:LV,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:s,schemaCode:o,it:l}=t;if(!n&&!i)return;let c=e.let("valid"),d=s.items?(0,c0.getSchemaTypes)(s.items):[];t.block$data(c,p,(0,vr._)`${o} === false`),t.ok(c);function p(){let q=e.let("i",(0,vr._)`${r}.length`),x=e.let("j");t.setParams({i:q,j:x}),e.assign(c,!0),e.if((0,vr._)`${q} > 1`,()=>(m()?y:b)(q,x))}function m(){return d.length>0&&!d.some(q=>q==="object"||q==="array")}function y(q,x){let v=e.name("item"),_=(0,c0.checkDataTypes)(d,v,l.opts.strictNumbers,c0.DataType.Wrong),E=e.const("indices",(0,vr._)`{}`);e.for((0,vr._)`;${q}--;`,()=>{e.let(v,(0,vr._)`${r}[${q}]`),e.if(_,(0,vr._)`continue`),d.length>1&&e.if((0,vr._)`typeof ${v} == "string"`,(0,vr._)`${v} += "_"`),e.if((0,vr._)`typeof ${E}[${v}] == "number"`,()=>{e.assign(x,(0,vr._)`${E}[${v}]`),t.error(),e.assign(c,!1).break()}).code((0,vr._)`${E}[${v}] = ${q}`)})}function b(q,x){let v=(0,DV.useFunc)(e,jV.default),_=e.name("outer");e.label(_).for((0,vr._)`;${q}--;`,()=>e.for((0,vr._)`${x} = ${q}; ${x}--;`,()=>e.if((0,vr._)`${v}(${r}[${q}], ${r}[${x}])`,()=>{t.error(),e.assign(c,!1).break(_)})))}}};f0.default=UV});var qO=V(p0=>{"use strict";Object.defineProperty(p0,"__esModule",{value:!0});var d0=Je(),HV=it(),BV=Fm(),VV={message:"must be equal to constant",params:({schemaCode:t})=>(0,d0._)`{allowedValue: ${t}}`},WV={keyword:"const",$data:!0,error:VV,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,d0._)`!${(0,HV.useFunc)(e,BV.default)}(${r}, ${i})`):t.fail((0,d0._)`${s} !== ${r}`)}};p0.default=WV});var IO=V(h0=>{"use strict";Object.defineProperty(h0,"__esModule",{value:!0});var od=Je(),zV=it(),JV=Fm(),GV={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,od._)`{allowedValues: ${t}}`},YV={keyword:"enum",schemaType:"array",$data:!0,error:GV,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:o}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let l=i.length>=o.opts.loopEnum,c,d=()=>c??(c=(0,zV.useFunc)(e,JV.default)),p;if(l||n)p=e.let("valid"),t.block$data(p,m);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let b=e.const("vSchema",s);p=(0,od.or)(...i.map((q,x)=>y(b,x)))}t.pass(p);function m(){e.assign(p,!1),e.forOf("v",s,b=>e.if((0,od._)`${d()}(${r}, ${b})`,()=>e.assign(p,!0).break()))}function y(b,q){let x=i[q];return typeof x=="object"&&x!==null?(0,od._)`${d()}(${r}, ${b}[${q}])`:(0,od._)`${r} === ${x}`}}};h0.default=YV});var OO=V(m0=>{"use strict";Object.defineProperty(m0,"__esModule",{value:!0});var KV=gO(),QV=yO(),ZV=SO(),XV=wO(),eW=_O(),tW=RO(),rW=xO(),nW=EO(),iW=qO(),sW=IO(),oW=[KV.default,QV.default,ZV.default,XV.default,eW.default,tW.default,rW.default,nW.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},iW.default,sW.default];m0.default=oW});var y0=V(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});ad.validateAdditionalItems=void 0;var Ba=Je(),g0=it(),aW={message:({params:{len:t}})=>(0,Ba.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Ba._)`{limit: ${t}}`},lW={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:aW,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,g0.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}PO(t,n)}};function PO(t,e){let{gen:r,schema:n,data:i,keyword:s,it:o}=t;o.items=!0;let l=r.const("len",(0,Ba._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Ba._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,g0.alwaysValidSchema)(o,n)){let d=r.var("valid",(0,Ba._)`${l} <= ${e.length}`);r.if((0,Ba.not)(d),()=>c(d)),t.ok(d)}function c(d){r.forRange("i",e.length,l,p=>{t.subschema({keyword:s,dataProp:p,dataPropType:g0.Type.Num},d),o.allErrors||r.if((0,Ba.not)(d),()=>r.break())})}}ad.validateAdditionalItems=PO;ad.default=lW});var v0=V(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});ld.validateTuple=void 0;var kO=Je(),Dm=it(),uW=Vn(),cW={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return AO(t,"additionalItems",e);r.items=!0,!(0,Dm.alwaysValidSchema)(r,e)&&t.ok((0,uW.validateArray)(t))}};function AO(t,e,r=t.schema){let{gen:n,parentSchema:i,data:s,keyword:o,it:l}=t;p(i),l.opts.unevaluated&&r.length&&l.items!==!0&&(l.items=Dm.mergeEvaluated.items(n,r.length,l.items));let c=n.name("valid"),d=n.const("len",(0,kO._)`${s}.length`);r.forEach((m,y)=>{(0,Dm.alwaysValidSchema)(l,m)||(n.if((0,kO._)`${d} > ${y}`,()=>t.subschema({keyword:o,schemaProp:y,dataProp:y},c)),t.ok(c))});function p(m){let{opts:y,errSchemaPath:b}=l,q=r.length,x=q===m.minItems&&(q===m.maxItems||m[e]===!1);if(y.strictTuples&&!x){let v=`"${o}" is ${q}-tuple, but minItems or maxItems/${e} are not specified or different at path "${b}"`;(0,Dm.checkStrictMode)(l,v,y.strictTuples)}}}ld.validateTuple=AO;ld.default=cW});var TO=V(b0=>{"use strict";Object.defineProperty(b0,"__esModule",{value:!0});var fW=v0(),dW={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,fW.validateTuple)(t,"items")};b0.default=dW});var NO=V(S0=>{"use strict";Object.defineProperty(S0,"__esModule",{value:!0});var $O=Je(),pW=it(),hW=Vn(),mW=y0(),gW={message:({params:{len:t}})=>(0,$O.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,$O._)`{limit: ${t}}`},yW={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:gW,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,pW.alwaysValidSchema)(n,e)&&(i?(0,mW.validateAdditionalItems)(t,i):t.ok((0,hW.validateArray)(t)))}};S0.default=yW});var MO=V(w0=>{"use strict";Object.defineProperty(w0,"__esModule",{value:!0});var zn=Je(),jm=it(),vW={message:({params:{min:t,max:e}})=>e===void 0?(0,zn.str)`must contain at least ${t} valid item(s)`:(0,zn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,zn._)`{minContains: ${t}}`:(0,zn._)`{minContains: ${t}, maxContains: ${e}}`},bW={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:vW,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t,o,l,{minContains:c,maxContains:d}=n;s.opts.next?(o=c===void 0?1:c,l=d):o=1;let p=e.const("len",(0,zn._)`${i}.length`);if(t.setParams({min:o,max:l}),l===void 0&&o===0){(0,jm.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&o>l){(0,jm.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,jm.alwaysValidSchema)(s,r)){let x=(0,zn._)`${p} >= ${o}`;l!==void 0&&(x=(0,zn._)`${x} && ${p} <= ${l}`),t.pass(x);return}s.items=!0;let m=e.name("valid");l===void 0&&o===1?b(m,()=>e.if(m,()=>e.break())):o===0?(e.let(m,!0),l!==void 0&&e.if((0,zn._)`${i}.length > 0`,y)):(e.let(m,!1),y()),t.result(m,()=>t.reset());function y(){let x=e.name("_valid"),v=e.let("count",0);b(x,()=>e.if(x,()=>q(v)))}function b(x,v){e.forRange("i",0,p,_=>{t.subschema({keyword:"contains",dataProp:_,dataPropType:jm.Type.Num,compositeRule:!0},x),v()})}function q(x){e.code((0,zn._)`${x}++`),l===void 0?e.if((0,zn._)`${x} >= ${o}`,()=>e.assign(m,!0).break()):(e.if((0,zn._)`${x} > ${l}`,()=>e.assign(m,!1).break()),o===1?e.assign(m,!0):e.if((0,zn._)`${x} >= ${o}`,()=>e.assign(m,!0)))}}};w0.default=bW});var jO=V(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.validateSchemaDeps=Yi.validatePropertyDeps=Yi.error=void 0;var _0=Je(),SW=it(),ud=Vn();Yi.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,_0.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,_0._)`{property: ${t},
|
|
27
|
+
|| ${o} === "boolean" || ${i} === null`).assign(l,(0,Fe._)`[${i}]`)}}}function HU({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Fe._)`${e} !== undefined`,()=>t.assign((0,Fe._)`${e}[${r}]`,n))}function Ew(t,e,r,n=Au.Correct){let i=n===Au.Correct?Fe.operators.EQ:Fe.operators.NEQ,s;switch(t){case"null":return(0,Fe._)`${e} ${i} null`;case"array":s=(0,Fe._)`Array.isArray(${e})`;break;case"object":s=(0,Fe._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=o((0,Fe._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=o();break;default:return(0,Fe._)`typeof ${e} ${i} ${t}`}return n===Au.Correct?s:(0,Fe.not)(s);function o(l=Fe.nil){return(0,Fe.and)((0,Fe._)`typeof ${e} == "number"`,l,r?(0,Fe._)`isFinite(${e})`:Fe.nil)}}Ir.checkDataType=Ew;function qw(t,e,r,n){if(t.length===1)return Ew(t[0],e,r,n);let i,s=(0,rI.toHash)(t);if(s.array&&s.object){let o=(0,Fe._)`typeof ${e} != "object"`;i=s.null?o:(0,Fe._)`!${e} || ${o}`,delete s.null,delete s.array,delete s.object}else i=Fe.nil;s.number&&delete s.integer;for(let o in s)i=(0,Fe.and)(i,Ew(o,e,r,n));return i}Ir.checkDataTypes=qw;var BU={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Fe._)`{type: ${t}}`:(0,Fe._)`{type: ${e}}`};function Iw(t){let e=VU(t);(0,FU.reportError)(e,BU)}Ir.reportTypeError=Iw;function VU(t){let{gen:e,data:r,schema:n}=t,i=(0,rI.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var oI=V(_m=>{"use strict";Object.defineProperty(_m,"__esModule",{value:!0});_m.assignDefaults=void 0;var Tu=Je(),WU=it();function zU(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)sI(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>sI(t,s,i.default))}_m.assignDefaults=zU;function sI(t,e,r){let{gen:n,compositeRule:i,data:s,opts:o}=t;if(r===void 0)return;let l=(0,Tu._)`${s}${(0,Tu.getProperty)(e)}`;if(i){(0,WU.checkStrictMode)(t,`default is ignored for: ${l}`);return}let c=(0,Tu._)`${l} === undefined`;o.useDefaults==="empty"&&(c=(0,Tu._)`${c} || ${l} === null || ${l} === ""`),n.if(c,(0,Tu._)`${l} = ${(0,Tu.stringify)(r)}`)}});var Vn=V(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.validateUnion=Ot.validateArray=Ot.usePattern=Ot.callValidateCode=Ot.schemaProperties=Ot.allSchemaProperties=Ot.noPropertyInData=Ot.propertyInData=Ot.isOwnProperty=Ot.hasPropFunc=Ot.reportMissingProp=Ot.checkMissingProp=Ot.checkReportMissingProp=void 0;var Mt=Je(),Ow=it(),wo=Is(),JU=it();function GU(t,e){let{gen:r,data:n,it:i}=t;r.if(kw(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Mt._)`${e}`},!0),t.error()})}Ot.checkReportMissingProp=GU;function YU({gen:t,data:e,it:{opts:r}},n,i){return(0,Mt.or)(...n.map(s=>(0,Mt.and)(kw(t,e,s,r.ownProperties),(0,Mt._)`${i} = ${s}`)))}Ot.checkMissingProp=YU;function KU(t,e){t.setParams({missingProperty:e},!0),t.error()}Ot.reportMissingProp=KU;function aI(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Mt._)`Object.prototype.hasOwnProperty`})}Ot.hasPropFunc=aI;function Pw(t,e,r){return(0,Mt._)`${aI(t)}.call(${e}, ${r})`}Ot.isOwnProperty=Pw;function QU(t,e,r,n){let i=(0,Mt._)`${e}${(0,Mt.getProperty)(r)} !== undefined`;return n?(0,Mt._)`${i} && ${Pw(t,e,r)}`:i}Ot.propertyInData=QU;function kw(t,e,r,n){let i=(0,Mt._)`${e}${(0,Mt.getProperty)(r)} === undefined`;return n?(0,Mt.or)(i,(0,Mt.not)(Pw(t,e,r))):i}Ot.noPropertyInData=kw;function lI(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}Ot.allSchemaProperties=lI;function ZU(t,e){return lI(e).filter(r=>!(0,Ow.alwaysValidSchema)(t,e[r]))}Ot.schemaProperties=ZU;function XU({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:o},l,c,d){let p=d?(0,Mt._)`${t}, ${e}, ${n}${i}`:e,m=[[wo.default.instancePath,(0,Mt.strConcat)(wo.default.instancePath,s)],[wo.default.parentData,o.parentData],[wo.default.parentDataProperty,o.parentDataProperty],[wo.default.rootData,wo.default.rootData]];o.opts.dynamicRef&&m.push([wo.default.dynamicAnchors,wo.default.dynamicAnchors]);let y=(0,Mt._)`${p}, ${r.object(...m)}`;return c!==Mt.nil?(0,Mt._)`${l}.call(${c}, ${y})`:(0,Mt._)`${l}(${y})`}Ot.callValidateCode=XU;var eH=(0,Mt._)`new RegExp`;function tH({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,s=i(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,Mt._)`${i.code==="new RegExp"?eH:(0,JU.useFunc)(t,i)}(${r}, ${n})`})}Ot.usePattern=tH;function rH(t){let{gen:e,data:r,keyword:n,it:i}=t,s=e.name("valid");if(i.allErrors){let l=e.let("valid",!0);return o(()=>e.assign(l,!1)),l}return e.var(s,!0),o(()=>e.break()),s;function o(l){let c=e.const("len",(0,Mt._)`${r}.length`);e.forRange("i",0,c,d=>{t.subschema({keyword:n,dataProp:d,dataPropType:Ow.Type.Num},s),e.if((0,Mt.not)(s),l)})}}Ot.validateArray=rH;function nH(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,Ow.alwaysValidSchema)(i,c))&&!i.opts.unevaluated)return;let o=e.let("valid",!1),l=e.name("_valid");e.block(()=>r.forEach((c,d)=>{let p=t.subschema({keyword:n,schemaProp:d,compositeRule:!0},l);e.assign(o,(0,Mt._)`${o} || ${l}`),t.mergeValidEvaluated(p,l)||e.if((0,Mt.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}Ot.validateUnion=nH});var fI=V(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.validateKeywordUsage=Ji.validSchemaType=Ji.funcKeywordCode=Ji.macroKeywordCode=void 0;var Vr=Je(),Da=Is(),iH=Vn(),sH=Vf();function oH(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:o}=t,l=e.macro.call(o.self,i,s,o),c=cI(r,n,l);o.opts.validateSchema!==!1&&o.self.validateSchema(l,!0);let d=r.name("valid");t.subschema({schema:l,schemaPath:Vr.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},d),t.pass(d,()=>t.error(!0))}Ji.macroKeywordCode=oH;function aH(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:o,$data:l,it:c}=t;uH(c,e);let d=!l&&e.compile?e.compile.call(c.self,s,o,c):e.validate,p=cI(n,i,d),m=n.let("valid");t.block$data(m,y),t.ok((r=e.valid)!==null&&r!==void 0?r:m);function y(){if(e.errors===!1)x(),e.modifying&&uI(t),v(()=>t.error());else{let R=e.async?b():q();e.modifying&&uI(t),v(()=>lH(t,R))}}function b(){let R=n.let("ruleErrs",null);return n.try(()=>x((0,Vr._)`await `),E=>n.assign(m,!1).if((0,Vr._)`${E} instanceof ${c.ValidationError}`,()=>n.assign(R,(0,Vr._)`${E}.errors`),()=>n.throw(E))),R}function q(){let R=(0,Vr._)`${p}.errors`;return n.assign(R,null),x(Vr.nil),R}function x(R=e.async?(0,Vr._)`await `:Vr.nil){let E=c.opts.passContext?Da.default.this:Da.default.self,k=!("compile"in e&&!l||e.schema===!1);n.assign(m,(0,Vr._)`${R}${(0,iH.callValidateCode)(t,p,E,k)}`,e.modifying)}function v(R){var E;n.if((0,Vr.not)((E=e.valid)!==null&&E!==void 0?E:m),R)}}Ji.funcKeywordCode=aH;function uI(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Vr._)`${n.parentData}[${n.parentDataProperty}]`))}function lH(t,e){let{gen:r}=t;r.if((0,Vr._)`Array.isArray(${e})`,()=>{r.assign(Da.default.vErrors,(0,Vr._)`${Da.default.vErrors} === null ? ${e} : ${Da.default.vErrors}.concat(${e})`).assign(Da.default.errors,(0,Vr._)`${Da.default.vErrors}.length`),(0,sH.extendErrors)(t)},()=>t.error())}function uH({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function cI(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Vr.stringify)(r)})}function cH(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}Ji.validSchemaType=cH;function fH({schema:t,opts:e,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let o=i.dependencies;if(o?.some(l=>!Object.prototype.hasOwnProperty.call(t,l)))throw new Error(`parent schema must have dependencies of ${s}: ${o.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[s])){let c=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Ji.validateKeywordUsage=fH});var pI=V(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0});_o.extendSubschemaMode=_o.extendSubschemaData=_o.getSubschema=void 0;var Gi=Je(),dI=it();function dH(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:o}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let l=t.schema[e];return r===void 0?{schema:l,schemaPath:(0,Gi._)`${t.schemaPath}${(0,Gi.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,Gi._)`${t.schemaPath}${(0,Gi.getProperty)(e)}${(0,Gi.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,dI.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:o,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}_o.getSubschema=dH;function pH(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:o}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:l}=e;if(r!==void 0){let{errorPath:d,dataPathArr:p,opts:m}=e,y=l.let("data",(0,Gi._)`${e.data}${(0,Gi.getProperty)(r)}`,!0);c(y),t.errorPath=(0,Gi.str)`${d}${(0,dI.getErrorPath)(r,n,m.jsPropertySyntax)}`,t.parentDataProperty=(0,Gi._)`${r}`,t.dataPathArr=[...p,t.parentDataProperty]}if(i!==void 0){let d=i instanceof Gi.Name?i:l.let("data",i,!0);c(d),o!==void 0&&(t.propertyName=o)}s&&(t.dataTypes=s);function c(d){t.data=d,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,d]}}_o.extendSubschemaData=pH;function hH(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}_o.extendSubschemaMode=hH});var Aw=V((kQ,hI)=>{"use strict";hI.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var o=s[i];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}});var gI=V((AQ,mI)=>{"use strict";var Ro=mI.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};Rm(e,n,i,t,"",t)};Ro.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Ro.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Ro.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Ro.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 Rm(t,e,r,n,i,s,o,l,c,d){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,o,l,c,d);for(var p in n){var m=n[p];if(Array.isArray(m)){if(p in Ro.arrayKeywords)for(var y=0;y<m.length;y++)Rm(t,e,r,m[y],i+"/"+p+"/"+y,s,i,p,n,y)}else if(p in Ro.propsKeywords){if(m&&typeof m=="object")for(var b in m)Rm(t,e,r,m[b],i+"/"+p+"/"+mH(b),s,i,p,n,b)}else(p in Ro.keywords||t.allKeys&&!(p in Ro.skipKeywords))&&Rm(t,e,r,m,i+"/"+p,s,i,p,n)}r(n,i,s,o,l,c,d)}}function mH(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var zf=V(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.getSchemaRefs=on.resolveUrl=on.normalizeId=on._getFullPath=on.getFullPath=on.inlineRef=void 0;var gH=it(),yH=Aw(),vH=gI(),bH=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function SH(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Tw(t):e?yI(t)<=e:!1}on.inlineRef=SH;var wH=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Tw(t){for(let e in t){if(wH.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Tw)||typeof r=="object"&&Tw(r))return!0}return!1}function yI(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!bH.has(r)&&(typeof t[r]=="object"&&(0,gH.eachItem)(t[r],n=>e+=yI(n)),e===1/0))return 1/0}return e}function vI(t,e="",r){r!==!1&&(e=$u(e));let n=t.parse(e);return bI(t,n)}on.getFullPath=vI;function bI(t,e){return t.serialize(e).split("#")[0]+"#"}on._getFullPath=bI;var _H=/#\/?$/;function $u(t){return t?t.replace(_H,""):""}on.normalizeId=$u;function RH(t,e,r){return r=$u(r),t.resolve(e,r)}on.resolveUrl=RH;var xH=/^[a-z_][-a-z0-9._]*$/i;function CH(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=$u(t[r]||e),s={"":i},o=vI(n,i,!1),l={},c=new Set;return vH(t,{allKeys:!0},(m,y,b,q)=>{if(q===void 0)return;let x=o+y,v=s[q];typeof m[r]=="string"&&(v=R.call(this,m[r])),E.call(this,m.$anchor),E.call(this,m.$dynamicAnchor),s[y]=v;function R(k){let P=this.opts.uriResolver.resolve;if(k=$u(v?P(v,k):k),c.has(k))throw p(k);c.add(k);let M=this.refs[k];return typeof M=="string"&&(M=this.refs[M]),typeof M=="object"?d(m,M.schema,k):k!==$u(x)&&(k[0]==="#"?(d(m,l[k],k),l[k]=m):this.refs[k]=x),k}function E(k){if(typeof k=="string"){if(!xH.test(k))throw new Error(`invalid anchor "${k}"`);R.call(this,`#${k}`)}}}),l;function d(m,y,b){if(y!==void 0&&!yH(m,y))throw p(b)}function p(m){return new Error(`reference "${m}" resolves to more than one schema`)}}on.getSchemaRefs=CH});var Yf=V(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.getData=xo.KeywordCxt=xo.validateFunctionCode=void 0;var xI=Xq(),SI=Wf(),Nw=Cw(),xm=Wf(),EH=oI(),Gf=fI(),$w=pI(),_e=Je(),Pe=Is(),qH=zf(),Os=it(),Jf=Vf();function IH(t){if(qI(t)&&(II(t),EI(t))){kH(t);return}CI(t,()=>(0,xI.topBoolOrEmptySchema)(t))}xo.validateFunctionCode=IH;function CI({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,_e._)`${Pe.default.data}, ${Pe.default.valCxt}`,n.$async,()=>{t.code((0,_e._)`"use strict"; ${wI(r,i)}`),PH(t,i),t.code(s)}):t.func(e,(0,_e._)`${Pe.default.data}, ${OH(i)}`,n.$async,()=>t.code(wI(r,i)).code(s))}function OH(t){return(0,_e._)`{${Pe.default.instancePath}="", ${Pe.default.parentData}, ${Pe.default.parentDataProperty}, ${Pe.default.rootData}=${Pe.default.data}${t.dynamicRef?(0,_e._)`, ${Pe.default.dynamicAnchors}={}`:_e.nil}}={}`}function PH(t,e){t.if(Pe.default.valCxt,()=>{t.var(Pe.default.instancePath,(0,_e._)`${Pe.default.valCxt}.${Pe.default.instancePath}`),t.var(Pe.default.parentData,(0,_e._)`${Pe.default.valCxt}.${Pe.default.parentData}`),t.var(Pe.default.parentDataProperty,(0,_e._)`${Pe.default.valCxt}.${Pe.default.parentDataProperty}`),t.var(Pe.default.rootData,(0,_e._)`${Pe.default.valCxt}.${Pe.default.rootData}`),e.dynamicRef&&t.var(Pe.default.dynamicAnchors,(0,_e._)`${Pe.default.valCxt}.${Pe.default.dynamicAnchors}`)},()=>{t.var(Pe.default.instancePath,(0,_e._)`""`),t.var(Pe.default.parentData,(0,_e._)`undefined`),t.var(Pe.default.parentDataProperty,(0,_e._)`undefined`),t.var(Pe.default.rootData,Pe.default.data),e.dynamicRef&&t.var(Pe.default.dynamicAnchors,(0,_e._)`{}`)})}function kH(t){let{schema:e,opts:r,gen:n}=t;CI(t,()=>{r.$comment&&e.$comment&&PI(t),MH(t),n.let(Pe.default.vErrors,null),n.let(Pe.default.errors,0),r.unevaluated&&AH(t),OI(t),jH(t)})}function AH(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,_e._)`${r}.evaluated`),e.if((0,_e._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,_e._)`${t.evaluated}.props`,(0,_e._)`undefined`)),e.if((0,_e._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,_e._)`${t.evaluated}.items`,(0,_e._)`undefined`))}function wI(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,_e._)`/*# sourceURL=${r} */`:_e.nil}function TH(t,e){if(qI(t)&&(II(t),EI(t))){$H(t,e);return}(0,xI.boolOrEmptySchema)(t,e)}function EI({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function qI(t){return typeof t.schema!="boolean"}function $H(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&PI(t),FH(t),DH(t);let s=n.const("_errs",Pe.default.errors);OI(t,s),n.var(e,(0,_e._)`${s} === ${Pe.default.errors}`)}function II(t){(0,Os.checkUnknownRules)(t),NH(t)}function OI(t,e){if(t.opts.jtd)return _I(t,[],!1,e);let r=(0,SI.getSchemaTypes)(t.schema),n=(0,SI.coerceAndCheckDataType)(t,r);_I(t,r,!n,e)}function NH(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Os.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function MH(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Os.checkStrictMode)(t,"default is ignored in the schema root")}function FH(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,qH.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function DH(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function PI({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,_e._)`${Pe.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let o=(0,_e.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,_e._)`${Pe.default.self}.opts.$comment(${s}, ${o}, ${l}.schema)`)}}function jH(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,_e._)`${Pe.default.errors} === 0`,()=>e.return(Pe.default.data),()=>e.throw((0,_e._)`new ${i}(${Pe.default.vErrors})`)):(e.assign((0,_e._)`${n}.errors`,Pe.default.vErrors),s.unevaluated&&LH(t),e.return((0,_e._)`${Pe.default.errors} === 0`))}function LH({gen:t,evaluated:e,props:r,items:n}){r instanceof _e.Name&&t.assign((0,_e._)`${e}.props`,r),n instanceof _e.Name&&t.assign((0,_e._)`${e}.items`,n)}function _I(t,e,r,n){let{gen:i,schema:s,data:o,allErrors:l,opts:c,self:d}=t,{RULES:p}=d;if(s.$ref&&(c.ignoreKeywordsWithRef||!(0,Os.schemaHasRulesButRef)(s,p))){i.block(()=>AI(t,"$ref",p.all.$ref.definition));return}c.jtd||UH(t,e),i.block(()=>{for(let y of p.rules)m(y);m(p.post)});function m(y){(0,Nw.shouldUseGroup)(s,y)&&(y.type?(i.if((0,xm.checkDataType)(y.type,o,c.strictNumbers)),RI(t,y),e.length===1&&e[0]===y.type&&r&&(i.else(),(0,xm.reportTypeError)(t)),i.endIf()):RI(t,y),l||i.if((0,_e._)`${Pe.default.errors} === ${n||0}`))}}function RI(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,EH.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,Nw.shouldUseRule)(n,s)&&AI(t,s.keyword,s.definition,e.type)})}function UH(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(HH(t,e),t.opts.allowUnionTypes||BH(t,e),VH(t,t.dataTypes))}function HH(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{kI(t.dataTypes,r)||Mw(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),zH(t,e)}}function BH(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Mw(t,"use allowUnionTypes to allow union type keyword")}function VH(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,Nw.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(o=>WH(e,o))&&Mw(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function WH(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function kI(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function zH(t,e){let r=[];for(let n of t.dataTypes)kI(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function Mw(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Os.checkStrictMode)(t,e,t.opts.strictTypes)}var Cm=class{constructor(e,r,n){if((0,Gf.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Os.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",TI(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Gf.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=e.gen.const("_errs",Pe.default.errors))}result(e,r,n){this.failResult((0,_e.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,_e.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,_e._)`${r} !== undefined && (${(0,_e.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?Jf.reportExtraError:Jf.reportError)(this,this.def.error,r)}$dataError(){(0,Jf.reportError)(this,this.def.$dataError||Jf.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Jf.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=_e.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=_e.nil,r=_e.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:o}=this;n.if((0,_e.or)((0,_e._)`${i} === undefined`,r)),e!==_e.nil&&n.assign(e,!0),(s.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==_e.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,_e.or)(o(),l());function o(){if(n.length){if(!(r instanceof _e.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,_e._)`${(0,xm.checkDataTypes)(c,r,s.opts.strictNumbers,xm.DataType.Wrong)}`}return _e.nil}function l(){if(i.validateSchema){let c=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,_e._)`!${c}(${r})`}return _e.nil}}subschema(e,r){let n=(0,$w.getSubschema)(this.it,e);(0,$w.extendSubschemaData)(n,this.it,e),(0,$w.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return TH(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Os.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Os.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,_e.Name)),!0}};xo.KeywordCxt=Cm;function AI(t,e,r,n){let i=new Cm(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Gf.funcKeywordCode)(i,r):"macro"in r?(0,Gf.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Gf.funcKeywordCode)(i,r)}var JH=/^\/(?:[^~]|~0|~1)*$/,GH=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function TI(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return Pe.default.rootData;if(t[0]==="/"){if(!JH.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=Pe.default.rootData}else{let d=GH.exec(t);if(!d)throw new Error(`Invalid JSON-pointer: ${t}`);let p=+d[1];if(i=d[2],i==="#"){if(p>=e)throw new Error(c("property/index",p));return n[e-p]}if(p>e)throw new Error(c("data",p));if(s=r[e-p],!i)return s}let o=s,l=i.split("/");for(let d of l)d&&(s=(0,_e._)`${s}${(0,_e.getProperty)((0,Os.unescapeJsonPointer)(d))}`,o=(0,_e._)`${o} && ${s}`);return o;function c(d,p){return`Cannot access ${d} ${p} levels up, current level is ${e}`}}xo.getData=TI});var Em=V(Dw=>{"use strict";Object.defineProperty(Dw,"__esModule",{value:!0});var Fw=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Dw.default=Fw});var Kf=V(Uw=>{"use strict";Object.defineProperty(Uw,"__esModule",{value:!0});var jw=zf(),Lw=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,jw.resolveUrl)(e,r,n),this.missingSchema=(0,jw.normalizeId)((0,jw.getFullPath)(e,this.missingRef))}};Uw.default=Lw});var Im=V(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.resolveSchema=Wn.getCompilingSchema=Wn.resolveRef=Wn.compileSchema=Wn.SchemaEnv=void 0;var fi=Je(),YH=Em(),ja=Is(),di=zf(),$I=it(),KH=Yf(),Nu=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,di.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Wn.SchemaEnv=Nu;function Bw(t){let e=NI.call(this,t);if(e)return e;let r=(0,di.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,o=new fi.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),l;t.$async&&(l=o.scopeValue("Error",{ref:YH.default,code:(0,fi._)`require("ajv/dist/runtime/validation_error").default`}));let c=o.scopeName("validate");t.validateName=c;let d={gen:o,allErrors:this.opts.allErrors,data:ja.default.data,parentData:ja.default.parentData,parentDataProperty:ja.default.parentDataProperty,dataNames:[ja.default.data],dataPathArr:[fi.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,fi.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:fi.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,fi._)`""`,opts:this.opts,self:this},p;try{this._compilations.add(t),(0,KH.validateFunctionCode)(d),o.optimize(this.opts.code.optimize);let m=o.toString();p=`${o.scopeRefs(ja.default.scope)}return ${m}`,this.opts.code.process&&(p=this.opts.code.process(p,t));let b=new Function(`${ja.default.self}`,`${ja.default.scope}`,p)(this,this.scope.get());if(this.scope.value(c,{ref:b}),b.errors=null,b.schema=t.schema,b.schemaEnv=t,t.$async&&(b.$async=!0),this.opts.code.source===!0&&(b.source={validateName:c,validateCode:m,scopeValues:o._values}),this.opts.unevaluated){let{props:q,items:x}=d;b.evaluated={props:q instanceof fi.Name?void 0:q,items:x instanceof fi.Name?void 0:x,dynamicProps:q instanceof fi.Name,dynamicItems:x instanceof fi.Name},b.source&&(b.source.evaluated=(0,fi.stringify)(b.evaluated))}return t.validate=b,t}catch(m){throw delete t.validate,delete t.validateName,p&&this.logger.error("Error compiling schema, function code:",p),m}finally{this._compilations.delete(t)}}Wn.compileSchema=Bw;function QH(t,e,r){var n;r=(0,di.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=eB.call(this,t,r);if(s===void 0){let o=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:l}=this.opts;o&&(s=new Nu({schema:o,schemaId:l,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=ZH.call(this,s)}Wn.resolveRef=QH;function ZH(t){return(0,di.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Bw.call(this,t)}function NI(t){for(let e of this._compilations)if(XH(e,t))return e}Wn.getCompilingSchema=NI;function XH(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function eB(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||qm.call(this,t,e)}function qm(t,e){let r=this.opts.uriResolver.parse(e),n=(0,di._getFullPath)(this.opts.uriResolver,r),i=(0,di.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return Hw.call(this,r,t);let s=(0,di.normalizeId)(n),o=this.refs[s]||this.schemas[s];if(typeof o=="string"){let l=qm.call(this,t,o);return typeof l?.schema!="object"?void 0:Hw.call(this,r,l)}if(typeof o?.schema=="object"){if(o.validate||Bw.call(this,o),s===(0,di.normalizeId)(e)){let{schema:l}=o,{schemaId:c}=this.opts,d=l[c];return d&&(i=(0,di.resolveUrl)(this.opts.uriResolver,i,d)),new Nu({schema:l,schemaId:c,root:t,baseId:i})}return Hw.call(this,r,o)}}Wn.resolveSchema=qm;var tB=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Hw(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let l of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,$I.unescapeFragment)(l)];if(c===void 0)return;r=c;let d=typeof r=="object"&&r[this.opts.schemaId];!tB.has(l)&&d&&(e=(0,di.resolveUrl)(this.opts.uriResolver,e,d))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,$I.schemaHasRulesButRef)(r,this.RULES)){let l=(0,di.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=qm.call(this,n,l)}let{schemaId:o}=this.opts;if(s=s||new Nu({schema:r,schemaId:o,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var MI=V((DQ,rB)=>{rB.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 zw=V((jQ,HI)=>{"use strict";var nB=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),DI=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),Vw=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),jI=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),iB=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Ww(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var sB=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function FI(t){return t.length=0,!0}function oB(t,e,r){if(t.length){let n=Ww(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function aB(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,o=!1,l=oB;for(let c=0;c<t.length;c++){let d=t[c];if(!(d==="["||d==="]"))if(d===":"){if(s===!0&&(o=!0),!l(i,n,r))break;if(++e>7){r.error=!0;break}c>0&&t[c-1]===":"&&(s=!0),n.push(":");continue}else if(d==="%"){if(!l(i,n,r))break;l=FI}else{i.push(d);continue}}return i.length&&(l===FI?r.zone=i.join(""):o?n.push(i.join("")):n.push(Ww(i))),r.address=n.join(""),r}function LI(t){if(lB(t,":")<2)return{host:t,isIPV6:!1};let e=aB(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function lB(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function uB(t){let e=t,r=[],n=-1,i=0;for(;i=e.length;){if(i===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(i===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(i===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}var cB={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},fB=/[@/?#:]/g,dB=/[@/?#]/g;function UI(t,e){let r=e?dB:fB;return r.lastIndex=0,t.replace(r,n=>cB[n])}function pB(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let i=t.slice(n+1,n+3);if(Vw(i)){let s=i.toUpperCase(),o=String.fromCharCode(parseInt(s,16));e&&jI(o)?r+=o:r+="%"+s,n+=2;continue}}r+=t[n]}return r}function hB(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(Vw(n)){let i=n.toUpperCase(),s=String.fromCharCode(parseInt(i,16));s!=="."&&jI(s)?e+=s:e+="%"+i,r+=2;continue}}iB(t[r])?e+=t[r]:e+=escape(t[r])}return e}function mB(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(Vw(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function gB(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!DI(r)){let n=LI(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=UI(r,!1)}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}HI.exports={nonSimpleDomain:sB,recomposeAuthority:gB,reescapeHostDelimiters:UI,normalizePercentEncoding:pB,normalizePathEncoding:hB,escapePreservingEscapes:mB,removeDotSegments:uB,isIPv4:DI,isUUID:nB,normalizeIPv6:LI,stringArrayToHexStripped:Ww}});var JI=V((LQ,zI)=>{"use strict";var{isUUID:yB}=zw(),vB=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,bB=["http","https","ws","wss","urn","urn:uuid"];function SB(t){return bB.indexOf(t)!==-1}function Jw(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function BI(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function VI(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function wB(t){return t.secure=Jw(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function _B(t){if((t.port===(Jw(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function RB(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(vB);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let i=`${n}:${e.nid||t.nid}`,s=Gw(i);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function xB(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),i=`${r}:${e.nid||n}`,s=Gw(i);s&&(t=s.serialize(t,e));let o=t,l=t.nss;return o.path=`${n||e.nid}:${l}`,e.skipEscape=!0,o}function CB(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!yB(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function EB(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var WI={scheme:"http",domainHost:!0,parse:BI,serialize:VI},qB={scheme:"https",domainHost:WI.domainHost,parse:BI,serialize:VI},Om={scheme:"ws",domainHost:!0,parse:wB,serialize:_B},IB={scheme:"wss",domainHost:Om.domainHost,parse:Om.parse,serialize:Om.serialize},OB={scheme:"urn",parse:RB,serialize:xB,skipNormalize:!0},PB={scheme:"urn:uuid",parse:CB,serialize:EB,skipNormalize:!0},Pm={http:WI,https:qB,ws:Om,wss:IB,urn:OB,"urn:uuid":PB};Object.setPrototypeOf(Pm,null);function Gw(t){return t&&(Pm[t]||Pm[t.toLowerCase()])||void 0}zI.exports={wsIsSecure:Jw,SCHEMES:Pm,isValidSchemeName:SB,getSchemeHandler:Gw}});var XI=V((UQ,km)=>{"use strict";var{normalizeIPv6:kB,removeDotSegments:Qf,recomposeAuthority:AB,normalizePercentEncoding:TB,normalizePathEncoding:$B,escapePreservingEscapes:NB,reescapeHostDelimiters:MB,isIPv4:FB,nonSimpleDomain:DB}=zw(),{SCHEMES:jB,getSchemeHandler:YI}=JI();function LB(t,e){return typeof t=="string"?t=WB(t,e):typeof t=="object"&&(t=Mu(La(t,e),e)),t}function UB(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=KI(Mu(t,n),Mu(e,n),n,!0);return n.skipEscape=!0,La(i,n)}function KI(t,e,r,n){let i={};return n||(t=Mu(La(t,r),r),e=Mu(La(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=Qf(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=Qf(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=Qf(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?i.path="/"+e.path:t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=Qf(i.path)),i.query=e.query):(i.path=t.path,e.query!==void 0?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function HB(t,e,r){let n=GI(t,r),i=GI(e,r);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()}function La(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),i=[],s=YI(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=TB(r.path):(r.path=NB(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let o=AB(r);if(o!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(o),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let l=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(l=Qf(l)),o===void 0&&l[0]==="/"&&l[1]==="/"&&(l="/%2F"+l.slice(2)),i.push(l)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var BB=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function VB(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function QI(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1,s=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let o=t.match(BB);if(o){n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5]);let l=VB(n,o);if(l!==void 0&&(n.error=n.error||l,i=!0),n.host)if(FB(n.host)===!1){let p=kB(n.host);n.host=p.host.toLowerCase(),s=p.isIPV6}else s=!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 c=YI(r.scheme||n.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(r.domainHost||c&&c.domainHost)&&s===!1&&DB(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(d){n.error=n.error||"Host's domain name can not be converted to ASCII: "+d}if((!c||c&&!c.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=MB(unescape(n.host),s))),n.path&&(n.path=$B(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}c&&c.parse&&c.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:i}}function Mu(t,e){return QI(t,e).parsed}function WB(t,e){return ZI(t,e).normalized}function ZI(t,e){let{parsed:r,malformedAuthorityOrPort:n}=QI(t,e);return{normalized:n?t:La(r,e),malformedAuthorityOrPort:n}}function GI(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=ZI(t,e);return n?void 0:r}if(typeof t=="object")return La(t,e)}var Yw={SCHEMES:jB,normalize:LB,resolve:UB,resolveComponent:KI,equal:HB,serialize:La,parse:Mu};km.exports=Yw;km.exports.default=Yw;km.exports.fastUri=Yw});var tO=V(Kw=>{"use strict";Object.defineProperty(Kw,"__esModule",{value:!0});var eO=XI();eO.code='require("ajv/dist/runtime/uri").default';Kw.default=eO});var uO=V(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.CodeGen=yr.Name=yr.nil=yr.stringify=yr.str=yr._=yr.KeywordCxt=void 0;var zB=Yf();Object.defineProperty(yr,"KeywordCxt",{enumerable:!0,get:function(){return zB.KeywordCxt}});var Fu=Je();Object.defineProperty(yr,"_",{enumerable:!0,get:function(){return Fu._}});Object.defineProperty(yr,"str",{enumerable:!0,get:function(){return Fu.str}});Object.defineProperty(yr,"stringify",{enumerable:!0,get:function(){return Fu.stringify}});Object.defineProperty(yr,"nil",{enumerable:!0,get:function(){return Fu.nil}});Object.defineProperty(yr,"Name",{enumerable:!0,get:function(){return Fu.Name}});Object.defineProperty(yr,"CodeGen",{enumerable:!0,get:function(){return Fu.CodeGen}});var JB=Em(),oO=Kf(),GB=xw(),Zf=Im(),YB=Je(),Xf=zf(),Am=Wf(),Zw=it(),rO=MI(),KB=tO(),aO=(t,e)=>new RegExp(t,e);aO.code="new RegExp";var QB=["removeAdditional","useDefaults","coerceTypes"],ZB=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),XB={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."},eV={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},nO=200;function tV(t){var e,r,n,i,s,o,l,c,d,p,m,y,b,q,x,v,R,E,k,P,M,j,I,_,A;let F=t.strict,U=(e=t.code)===null||e===void 0?void 0:e.optimize,D=U===!0||U===void 0?1:U||0,J=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:aO,Q=(i=t.uriResolver)!==null&&i!==void 0?i:KB.default;return{strictSchema:(o=(s=t.strictSchema)!==null&&s!==void 0?s:F)!==null&&o!==void 0?o:!0,strictNumbers:(c=(l=t.strictNumbers)!==null&&l!==void 0?l:F)!==null&&c!==void 0?c:!0,strictTypes:(p=(d=t.strictTypes)!==null&&d!==void 0?d:F)!==null&&p!==void 0?p:"log",strictTuples:(y=(m=t.strictTuples)!==null&&m!==void 0?m:F)!==null&&y!==void 0?y:"log",strictRequired:(q=(b=t.strictRequired)!==null&&b!==void 0?b:F)!==null&&q!==void 0?q:!1,code:t.code?{...t.code,optimize:D,regExp:J}:{optimize:D,regExp:J},loopRequired:(x=t.loopRequired)!==null&&x!==void 0?x:nO,loopEnum:(v=t.loopEnum)!==null&&v!==void 0?v:nO,meta:(R=t.meta)!==null&&R!==void 0?R:!0,messages:(E=t.messages)!==null&&E!==void 0?E:!0,inlineRefs:(k=t.inlineRefs)!==null&&k!==void 0?k:!0,schemaId:(P=t.schemaId)!==null&&P!==void 0?P:"$id",addUsedSchema:(M=t.addUsedSchema)!==null&&M!==void 0?M:!0,validateSchema:(j=t.validateSchema)!==null&&j!==void 0?j:!0,validateFormats:(I=t.validateFormats)!==null&&I!==void 0?I:!0,unicodeRegExp:(_=t.unicodeRegExp)!==null&&_!==void 0?_:!0,int32range:(A=t.int32range)!==null&&A!==void 0?A:!0,uriResolver:Q}}var ed=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...tV(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new YB.ValueScope({scope:{},prefixes:ZB,es5:r,lines:n}),this.logger=aV(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,GB.getRules)(),iO.call(this,XB,e,"NOT SUPPORTED"),iO.call(this,eV,e,"DEPRECATED","warn"),this._metaOpts=sV.call(this),e.formats&&nV.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&iV.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),rV.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=rO;n==="id"&&(i={...rO},i.id=i.$id,delete i.$id),r&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,e,r);async function i(p,m){await s.call(this,p.$schema);let y=this._addSchema(p,m);return y.validate||o.call(this,y)}async function s(p){p&&!this.getSchema(p)&&await i.call(this,{$ref:p},!0)}async function o(p){try{return this._compileSchemaEnv(p)}catch(m){if(!(m instanceof oO.default))throw m;return l.call(this,m),await c.call(this,m.missingSchema),o.call(this,p)}}function l({missingSchema:p,missingRef:m}){if(this.refs[p])throw new Error(`AnySchema ${p} is loaded but ${m} cannot be resolved`)}async function c(p){let m=await d.call(this,p);this.refs[p]||await s.call(this,m.$schema),this.refs[p]||this.addSchema(m,p,r)}async function d(p){let m=this._loading[p];if(m)return m;try{return await(this._loading[p]=n(p))}finally{delete this._loading[p]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,n,i);return this}let s;if(typeof e=="object"){let{schemaId:o}=this.opts;if(s=e[o],s!==void 0&&typeof s!="string")throw new Error(`schema ${o} must be string`)}return r=(0,Xf.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,i,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$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 i=this.validate(n,e);if(!i&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(e){let r;for(;typeof(r=sO.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Zf.SchemaEnv({schema:{},schemaId:n});if(r=Zf.resolveSchema.call(this,i,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=sO.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,Xf.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,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(uV.call(this,n,r),!r)return(0,Zw.eachItem)(n,s=>Qw.call(this,s)),this;fV.call(this,r);let i={...r,type:(0,Am.getJSONTypes)(r.type),schemaType:(0,Am.getJSONTypes)(r.schemaType)};return(0,Zw.eachItem)(n,i.type.length===0?s=>Qw.call(this,s,i):s=>i.type.forEach(o=>Qw.call(this,s,i,o))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of r){let s=i.split("/").slice(1),o=e;for(let l of s)o=o[l];for(let l in n){let c=n[l];if(typeof c!="object")continue;let{$data:d}=c.definition,p=o[l];d&&p&&(o[l]=lO(p))}}return e}_removeAllSchemas(e,r){for(let n in e){let i=e[n];(!r||r.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let o,{schemaId:l}=this.opts;if(typeof e=="object")o=e[l];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;n=(0,Xf.normalizeId)(o||n);let d=Xf.getSchemaRefs.call(this,e,n);return c=new Zf.SchemaEnv({schema:e,schemaId:l,meta:r,baseId:n,localRefs:d}),this._cache.set(c.schema,c),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),i&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):Zf.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{Zf.compileSchema.call(this,e)}finally{this.opts=r}}};ed.ValidationError=JB.default;ed.MissingRefError=oO.default;yr.default=ed;function iO(t,e,r,n="error"){for(let i in t){let s=i;s in e&&this.logger[n](`${r}: option ${i}. ${t[s]}`)}}function sO(t){return t=(0,Xf.normalizeId)(t),this.schemas[t]||this.refs[t]}function rV(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function nV(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function iV(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function sV(){let t={...this.opts};for(let e of QB)delete t[e];return t}var oV={log(){},warn(){},error(){}};function aV(t){if(t===!1)return oV;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var lV=/^[a-z_$][a-z0-9_$:-]*$/i;function uV(t,e){let{RULES:r}=this;if((0,Zw.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!lV.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function Qw(t,e,r){var n;let i=e?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,o=i?s.post:s.rules.find(({type:c})=>c===r);if(o||(o={type:r,rules:[]},s.rules.push(o)),s.keywords[t]=!0,!e)return;let l={keyword:t,definition:{...e,type:(0,Am.getJSONTypes)(e.type),schemaType:(0,Am.getJSONTypes)(e.schemaType)}};e.before?cV.call(this,o,l,e.before):o.rules.push(l),s.all[t]=l,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function cV(t,e,r){let n=t.rules.findIndex(i=>i.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function fV(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=lO(e)),t.validateSchema=this.compile(e,!0))}var dV={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function lO(t){return{anyOf:[t,dV]}}});var cO=V(Xw=>{"use strict";Object.defineProperty(Xw,"__esModule",{value:!0});var pV={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Xw.default=pV});var hO=V(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.callRef=Ua.getValidate=void 0;var hV=Kf(),fO=Vn(),an=Je(),Du=Is(),dO=Im(),Tm=it(),mV={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:s,validateName:o,opts:l,self:c}=n,{root:d}=s;if((r==="#"||r==="#/")&&i===d.baseId)return m();let p=dO.resolveRef.call(c,d,i,r);if(p===void 0)throw new hV.default(n.opts.uriResolver,i,r);if(p instanceof dO.SchemaEnv)return y(p);return b(p);function m(){if(s===d)return $m(t,o,s,s.$async);let q=e.scopeValue("root",{ref:d});return $m(t,(0,an._)`${q}.validate`,d,d.$async)}function y(q){let x=pO(t,q);$m(t,x,q,q.$async)}function b(q){let x=e.scopeValue("schema",l.code.source===!0?{ref:q,code:(0,an.stringify)(q)}:{ref:q}),v=e.name("valid"),R=t.subschema({schema:q,dataTypes:[],schemaPath:an.nil,topSchemaRef:x,errSchemaPath:r},v);t.mergeEvaluated(R),t.ok(v)}}};function pO(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,an._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Ua.getValidate=pO;function $m(t,e,r,n){let{gen:i,it:s}=t,{allErrors:o,schemaEnv:l,opts:c}=s,d=c.passContext?Du.default.this:an.nil;n?p():m();function p(){if(!l.$async)throw new Error("async schema referenced by sync schema");let q=i.let("valid");i.try(()=>{i.code((0,an._)`await ${(0,fO.callValidateCode)(t,e,d)}`),b(e),o||i.assign(q,!0)},x=>{i.if((0,an._)`!(${x} instanceof ${s.ValidationError})`,()=>i.throw(x)),y(x),o||i.assign(q,!1)}),t.ok(q)}function m(){t.result((0,fO.callValidateCode)(t,e,d),()=>b(e),()=>y(e))}function y(q){let x=(0,an._)`${q}.errors`;i.assign(Du.default.vErrors,(0,an._)`${Du.default.vErrors} === null ? ${x} : ${Du.default.vErrors}.concat(${x})`),i.assign(Du.default.errors,(0,an._)`${Du.default.vErrors}.length`)}function b(q){var x;if(!s.opts.unevaluated)return;let v=(x=r?.validate)===null||x===void 0?void 0:x.evaluated;if(s.props!==!0)if(v&&!v.dynamicProps)v.props!==void 0&&(s.props=Tm.mergeEvaluated.props(i,v.props,s.props));else{let R=i.var("props",(0,an._)`${q}.evaluated.props`);s.props=Tm.mergeEvaluated.props(i,R,s.props,an.Name)}if(s.items!==!0)if(v&&!v.dynamicItems)v.items!==void 0&&(s.items=Tm.mergeEvaluated.items(i,v.items,s.items));else{let R=i.var("items",(0,an._)`${q}.evaluated.items`);s.items=Tm.mergeEvaluated.items(i,R,s.items,an.Name)}}}Ua.callRef=$m;Ua.default=mV});var mO=V(e0=>{"use strict";Object.defineProperty(e0,"__esModule",{value:!0});var gV=cO(),yV=hO(),vV=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",gV.default,yV.default];e0.default=vV});var gO=V(t0=>{"use strict";Object.defineProperty(t0,"__esModule",{value:!0});var Nm=Je(),Co=Nm.operators,Mm={maximum:{okStr:"<=",ok:Co.LTE,fail:Co.GT},minimum:{okStr:">=",ok:Co.GTE,fail:Co.LT},exclusiveMaximum:{okStr:"<",ok:Co.LT,fail:Co.GTE},exclusiveMinimum:{okStr:">",ok:Co.GT,fail:Co.LTE}},bV={message:({keyword:t,schemaCode:e})=>(0,Nm.str)`must be ${Mm[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Nm._)`{comparison: ${Mm[t].okStr}, limit: ${e}}`},SV={keyword:Object.keys(Mm),type:"number",schemaType:"number",$data:!0,error:bV,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,Nm._)`${r} ${Mm[e].fail} ${n} || isNaN(${r})`)}};t0.default=SV});var yO=V(r0=>{"use strict";Object.defineProperty(r0,"__esModule",{value:!0});var td=Je(),wV={message:({schemaCode:t})=>(0,td.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,td._)`{multipleOf: ${t}}`},_V={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:wV,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,o=e.let("res"),l=s?(0,td._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:(0,td._)`${o} !== parseInt(${o})`;t.fail$data((0,td._)`(${n} === 0 || (${o} = ${r}/${n}, ${l}))`)}};r0.default=_V});var bO=V(n0=>{"use strict";Object.defineProperty(n0,"__esModule",{value:!0});function vO(t){let e=t.length,r=0,n=0,i;for(;n<e;)r++,i=t.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=t.charCodeAt(n),(i&64512)===56320&&n++);return r}n0.default=vO;vO.code='require("ajv/dist/runtime/ucs2length").default'});var SO=V(i0=>{"use strict";Object.defineProperty(i0,"__esModule",{value:!0});var Ha=Je(),RV=it(),xV=bO(),CV={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Ha.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Ha._)`{limit: ${t}}`},EV={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:CV,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?Ha.operators.GT:Ha.operators.LT,o=i.opts.unicode===!1?(0,Ha._)`${r}.length`:(0,Ha._)`${(0,RV.useFunc)(t.gen,xV.default)}(${r})`;t.fail$data((0,Ha._)`${o} ${s} ${n}`)}};i0.default=EV});var wO=V(s0=>{"use strict";Object.defineProperty(s0,"__esModule",{value:!0});var qV=Vn(),IV=it(),ju=Je(),OV={message:({schemaCode:t})=>(0,ju.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,ju._)`{pattern: ${t}}`},PV={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:OV,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:o}=t,l=o.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=o.opts.code,d=c.code==="new RegExp"?(0,ju._)`new RegExp`:(0,IV.useFunc)(e,c),p=e.let("valid");e.try(()=>e.assign(p,(0,ju._)`${d}(${s}, ${l}).test(${r})`),()=>e.assign(p,!1)),t.fail$data((0,ju._)`!${p}`)}else{let c=(0,qV.usePattern)(t,i);t.fail$data((0,ju._)`!${c}.test(${r})`)}}};s0.default=PV});var _O=V(o0=>{"use strict";Object.defineProperty(o0,"__esModule",{value:!0});var rd=Je(),kV={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,rd.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,rd._)`{limit: ${t}}`},AV={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:kV,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?rd.operators.GT:rd.operators.LT;t.fail$data((0,rd._)`Object.keys(${r}).length ${i} ${n}`)}};o0.default=AV});var RO=V(a0=>{"use strict";Object.defineProperty(a0,"__esModule",{value:!0});var nd=Vn(),id=Je(),TV=it(),$V={message:({params:{missingProperty:t}})=>(0,id.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,id._)`{missingProperty: ${t}}`},NV={keyword:"required",type:"object",schemaType:"array",$data:!0,error:$V,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:s,it:o}=t,{opts:l}=o;if(!s&&r.length===0)return;let c=r.length>=l.loopRequired;if(o.allErrors?d():p(),l.strictRequired){let b=t.parentSchema.properties,{definedProperties:q}=t.it;for(let x of r)if(b?.[x]===void 0&&!q.has(x)){let v=o.schemaEnv.baseId+o.errSchemaPath,R=`required property "${x}" is not defined at "${v}" (strictRequired)`;(0,TV.checkStrictMode)(o,R,o.opts.strictRequired)}}function d(){if(c||s)t.block$data(id.nil,m);else for(let b of r)(0,nd.checkReportMissingProp)(t,b)}function p(){let b=e.let("missing");if(c||s){let q=e.let("valid",!0);t.block$data(q,()=>y(b,q)),t.ok(q)}else e.if((0,nd.checkMissingProp)(t,r,b)),(0,nd.reportMissingProp)(t,b),e.else()}function m(){e.forOf("prop",n,b=>{t.setParams({missingProperty:b}),e.if((0,nd.noPropertyInData)(e,i,b,l.ownProperties),()=>t.error())})}function y(b,q){t.setParams({missingProperty:b}),e.forOf(b,n,()=>{e.assign(q,(0,nd.propertyInData)(e,i,b,l.ownProperties)),e.if((0,id.not)(q),()=>{t.error(),e.break()})},id.nil)}}};a0.default=NV});var xO=V(l0=>{"use strict";Object.defineProperty(l0,"__esModule",{value:!0});var sd=Je(),MV={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,sd.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,sd._)`{limit: ${t}}`},FV={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:MV,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?sd.operators.GT:sd.operators.LT;t.fail$data((0,sd._)`${r}.length ${i} ${n}`)}};l0.default=FV});var Fm=V(u0=>{"use strict";Object.defineProperty(u0,"__esModule",{value:!0});var CO=Aw();CO.code='require("ajv/dist/runtime/equal").default';u0.default=CO});var EO=V(f0=>{"use strict";Object.defineProperty(f0,"__esModule",{value:!0});var c0=Wf(),vr=Je(),DV=it(),jV=Fm(),LV={message:({params:{i:t,j:e}})=>(0,vr.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,vr._)`{i: ${t}, j: ${e}}`},UV={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:LV,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:s,schemaCode:o,it:l}=t;if(!n&&!i)return;let c=e.let("valid"),d=s.items?(0,c0.getSchemaTypes)(s.items):[];t.block$data(c,p,(0,vr._)`${o} === false`),t.ok(c);function p(){let q=e.let("i",(0,vr._)`${r}.length`),x=e.let("j");t.setParams({i:q,j:x}),e.assign(c,!0),e.if((0,vr._)`${q} > 1`,()=>(m()?y:b)(q,x))}function m(){return d.length>0&&!d.some(q=>q==="object"||q==="array")}function y(q,x){let v=e.name("item"),R=(0,c0.checkDataTypes)(d,v,l.opts.strictNumbers,c0.DataType.Wrong),E=e.const("indices",(0,vr._)`{}`);e.for((0,vr._)`;${q}--;`,()=>{e.let(v,(0,vr._)`${r}[${q}]`),e.if(R,(0,vr._)`continue`),d.length>1&&e.if((0,vr._)`typeof ${v} == "string"`,(0,vr._)`${v} += "_"`),e.if((0,vr._)`typeof ${E}[${v}] == "number"`,()=>{e.assign(x,(0,vr._)`${E}[${v}]`),t.error(),e.assign(c,!1).break()}).code((0,vr._)`${E}[${v}] = ${q}`)})}function b(q,x){let v=(0,DV.useFunc)(e,jV.default),R=e.name("outer");e.label(R).for((0,vr._)`;${q}--;`,()=>e.for((0,vr._)`${x} = ${q}; ${x}--;`,()=>e.if((0,vr._)`${v}(${r}[${q}], ${r}[${x}])`,()=>{t.error(),e.assign(c,!1).break(R)})))}}};f0.default=UV});var qO=V(p0=>{"use strict";Object.defineProperty(p0,"__esModule",{value:!0});var d0=Je(),HV=it(),BV=Fm(),VV={message:"must be equal to constant",params:({schemaCode:t})=>(0,d0._)`{allowedValue: ${t}}`},WV={keyword:"const",$data:!0,error:VV,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,d0._)`!${(0,HV.useFunc)(e,BV.default)}(${r}, ${i})`):t.fail((0,d0._)`${s} !== ${r}`)}};p0.default=WV});var IO=V(h0=>{"use strict";Object.defineProperty(h0,"__esModule",{value:!0});var od=Je(),zV=it(),JV=Fm(),GV={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,od._)`{allowedValues: ${t}}`},YV={keyword:"enum",schemaType:"array",$data:!0,error:GV,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:o}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let l=i.length>=o.opts.loopEnum,c,d=()=>c??(c=(0,zV.useFunc)(e,JV.default)),p;if(l||n)p=e.let("valid"),t.block$data(p,m);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let b=e.const("vSchema",s);p=(0,od.or)(...i.map((q,x)=>y(b,x)))}t.pass(p);function m(){e.assign(p,!1),e.forOf("v",s,b=>e.if((0,od._)`${d()}(${r}, ${b})`,()=>e.assign(p,!0).break()))}function y(b,q){let x=i[q];return typeof x=="object"&&x!==null?(0,od._)`${d()}(${r}, ${b}[${q}])`:(0,od._)`${r} === ${x}`}}};h0.default=YV});var OO=V(m0=>{"use strict";Object.defineProperty(m0,"__esModule",{value:!0});var KV=gO(),QV=yO(),ZV=SO(),XV=wO(),eW=_O(),tW=RO(),rW=xO(),nW=EO(),iW=qO(),sW=IO(),oW=[KV.default,QV.default,ZV.default,XV.default,eW.default,tW.default,rW.default,nW.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},iW.default,sW.default];m0.default=oW});var y0=V(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});ad.validateAdditionalItems=void 0;var Ba=Je(),g0=it(),aW={message:({params:{len:t}})=>(0,Ba.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Ba._)`{limit: ${t}}`},lW={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:aW,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,g0.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}PO(t,n)}};function PO(t,e){let{gen:r,schema:n,data:i,keyword:s,it:o}=t;o.items=!0;let l=r.const("len",(0,Ba._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Ba._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,g0.alwaysValidSchema)(o,n)){let d=r.var("valid",(0,Ba._)`${l} <= ${e.length}`);r.if((0,Ba.not)(d),()=>c(d)),t.ok(d)}function c(d){r.forRange("i",e.length,l,p=>{t.subschema({keyword:s,dataProp:p,dataPropType:g0.Type.Num},d),o.allErrors||r.if((0,Ba.not)(d),()=>r.break())})}}ad.validateAdditionalItems=PO;ad.default=lW});var v0=V(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});ld.validateTuple=void 0;var kO=Je(),Dm=it(),uW=Vn(),cW={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return AO(t,"additionalItems",e);r.items=!0,!(0,Dm.alwaysValidSchema)(r,e)&&t.ok((0,uW.validateArray)(t))}};function AO(t,e,r=t.schema){let{gen:n,parentSchema:i,data:s,keyword:o,it:l}=t;p(i),l.opts.unevaluated&&r.length&&l.items!==!0&&(l.items=Dm.mergeEvaluated.items(n,r.length,l.items));let c=n.name("valid"),d=n.const("len",(0,kO._)`${s}.length`);r.forEach((m,y)=>{(0,Dm.alwaysValidSchema)(l,m)||(n.if((0,kO._)`${d} > ${y}`,()=>t.subschema({keyword:o,schemaProp:y,dataProp:y},c)),t.ok(c))});function p(m){let{opts:y,errSchemaPath:b}=l,q=r.length,x=q===m.minItems&&(q===m.maxItems||m[e]===!1);if(y.strictTuples&&!x){let v=`"${o}" is ${q}-tuple, but minItems or maxItems/${e} are not specified or different at path "${b}"`;(0,Dm.checkStrictMode)(l,v,y.strictTuples)}}}ld.validateTuple=AO;ld.default=cW});var TO=V(b0=>{"use strict";Object.defineProperty(b0,"__esModule",{value:!0});var fW=v0(),dW={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,fW.validateTuple)(t,"items")};b0.default=dW});var NO=V(S0=>{"use strict";Object.defineProperty(S0,"__esModule",{value:!0});var $O=Je(),pW=it(),hW=Vn(),mW=y0(),gW={message:({params:{len:t}})=>(0,$O.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,$O._)`{limit: ${t}}`},yW={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:gW,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,pW.alwaysValidSchema)(n,e)&&(i?(0,mW.validateAdditionalItems)(t,i):t.ok((0,hW.validateArray)(t)))}};S0.default=yW});var MO=V(w0=>{"use strict";Object.defineProperty(w0,"__esModule",{value:!0});var zn=Je(),jm=it(),vW={message:({params:{min:t,max:e}})=>e===void 0?(0,zn.str)`must contain at least ${t} valid item(s)`:(0,zn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,zn._)`{minContains: ${t}}`:(0,zn._)`{minContains: ${t}, maxContains: ${e}}`},bW={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:vW,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t,o,l,{minContains:c,maxContains:d}=n;s.opts.next?(o=c===void 0?1:c,l=d):o=1;let p=e.const("len",(0,zn._)`${i}.length`);if(t.setParams({min:o,max:l}),l===void 0&&o===0){(0,jm.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&o>l){(0,jm.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,jm.alwaysValidSchema)(s,r)){let x=(0,zn._)`${p} >= ${o}`;l!==void 0&&(x=(0,zn._)`${x} && ${p} <= ${l}`),t.pass(x);return}s.items=!0;let m=e.name("valid");l===void 0&&o===1?b(m,()=>e.if(m,()=>e.break())):o===0?(e.let(m,!0),l!==void 0&&e.if((0,zn._)`${i}.length > 0`,y)):(e.let(m,!1),y()),t.result(m,()=>t.reset());function y(){let x=e.name("_valid"),v=e.let("count",0);b(x,()=>e.if(x,()=>q(v)))}function b(x,v){e.forRange("i",0,p,R=>{t.subschema({keyword:"contains",dataProp:R,dataPropType:jm.Type.Num,compositeRule:!0},x),v()})}function q(x){e.code((0,zn._)`${x}++`),l===void 0?e.if((0,zn._)`${x} >= ${o}`,()=>e.assign(m,!0).break()):(e.if((0,zn._)`${x} > ${l}`,()=>e.assign(m,!1).break()),o===1?e.assign(m,!0):e.if((0,zn._)`${x} >= ${o}`,()=>e.assign(m,!0)))}}};w0.default=bW});var jO=V(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.validateSchemaDeps=Yi.validatePropertyDeps=Yi.error=void 0;var _0=Je(),SW=it(),ud=Vn();Yi.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,_0.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,_0._)`{property: ${t},
|
|
28
28
|
missingProperty: ${n},
|
|
29
29
|
depsCount: ${e},
|
|
30
|
-
deps: ${r}}`};var wW={keyword:"dependencies",type:"object",schemaType:"object",error:Yi.error,code(t){let[e,r]=_W(t);FO(t,e),DO(t,r)}};function _W({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let i=Array.isArray(t[n])?e:r;i[n]=t[n]}return[e,r]}function FO(t,e=t.schema){let{gen:r,data:n,it:i}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let o in e){let l=e[o];if(l.length===0)continue;let c=(0,ud.propertyInData)(r,n,o,i.opts.ownProperties);t.setParams({property:o,depsCount:l.length,deps:l.join(", ")}),i.allErrors?r.if(c,()=>{for(let d of l)(0,ud.checkReportMissingProp)(t,d)}):(r.if((0,_0._)`${c} && (${(0,ud.checkMissingProp)(t,l,s)})`),(0,ud.reportMissingProp)(t,s),r.else())}}Yi.validatePropertyDeps=FO;function DO(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,o=r.name("valid");for(let l in e)(0,SW.alwaysValidSchema)(s,e[l])||(r.if((0,ud.propertyInData)(r,n,l,s.opts.ownProperties),()=>{let c=t.subschema({keyword:i,schemaProp:l},o);t.mergeValidEvaluated(c,o)},()=>r.var(o,!0)),t.ok(o))}Yi.validateSchemaDeps=DO;Yi.default=wW});var UO=V(R0=>{"use strict";Object.defineProperty(R0,"__esModule",{value:!0});var LO=Je(),RW=it(),xW={message:"property name must be valid",params:({params:t})=>(0,LO._)`{propertyName: ${t.propertyName}}`},CW={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:xW,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,RW.alwaysValidSchema)(i,r))return;let s=e.name("valid");e.forIn("key",n,o=>{t.setParams({propertyName:o}),t.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},s),e.if((0,LO.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};R0.default=CW});var C0=V(x0=>{"use strict";Object.defineProperty(x0,"__esModule",{value:!0});var Lm=Vn(),pi=Je(),EW=Is(),Um=it(),qW={message:"must NOT have additional properties",params:({params:t})=>(0,pi._)`{additionalProperty: ${t.additionalProperty}}`},IW={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:qW,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:s,it:o}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:l,opts:c}=o;if(o.props=!0,c.removeAdditional!=="all"&&(0,Um.alwaysValidSchema)(o,r))return;let d=(0,Lm.allSchemaProperties)(n.properties),p=(0,Lm.allSchemaProperties)(n.patternProperties);m(),t.ok((0,pi._)`${s} === ${EW.default.errors}`);function m(){e.forIn("key",i,v=>{!d.length&&!p.length?q(v):e.if(y(v),()=>q(v))})}function y(v){let _;if(d.length>8){let E=(0,Um.schemaRefOrVal)(o,n.properties,"properties");_=(0,Lm.isOwnProperty)(e,E,v)}else d.length?_=(0,pi.or)(...d.map(E=>(0,pi._)`${v} === ${E}`)):_=pi.nil;return p.length&&(_=(0,pi.or)(_,...p.map(E=>(0,pi._)`${(0,Lm.usePattern)(t,E)}.test(${v})`))),(0,pi.not)(_)}function b(v){e.code((0,pi._)`delete ${i}[${v}]`)}function q(v){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){b(v);return}if(r===!1){t.setParams({additionalProperty:v}),t.error(),l||e.break();return}if(typeof r=="object"&&!(0,Um.alwaysValidSchema)(o,r)){let _=e.name("valid");c.removeAdditional==="failing"?(x(v,_,!1),e.if((0,pi.not)(_),()=>{t.reset(),b(v)})):(x(v,_),l||e.if((0,pi.not)(_),()=>e.break()))}}function x(v,_,E){let k={keyword:"additionalProperties",dataProp:v,dataPropType:Um.Type.Str};E===!1&&Object.assign(k,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(k,_)}}};x0.default=IW});var VO=V(q0=>{"use strict";Object.defineProperty(q0,"__esModule",{value:!0});var OW=Yf(),HO=Vn(),E0=it(),BO=C0(),PW={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&BO.default.code(new OW.KeywordCxt(s,BO.default,"additionalProperties"));let o=(0,HO.allSchemaProperties)(r);for(let m of o)s.definedProperties.add(m);s.opts.unevaluated&&o.length&&s.props!==!0&&(s.props=E0.mergeEvaluated.props(e,(0,E0.toHash)(o),s.props));let l=o.filter(m=>!(0,E0.alwaysValidSchema)(s,r[m]));if(l.length===0)return;let c=e.name("valid");for(let m of l)d(m)?p(m):(e.if((0,HO.propertyInData)(e,i,m,s.opts.ownProperties)),p(m),s.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(m),t.ok(c);function d(m){return s.opts.useDefaults&&!s.compositeRule&&r[m].default!==void 0}function p(m){t.subschema({keyword:"properties",schemaProp:m,dataProp:m},c)}}};q0.default=PW});var GO=V(I0=>{"use strict";Object.defineProperty(I0,"__esModule",{value:!0});var WO=Vn(),Hm=Je(),zO=it(),JO=it(),kW={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:s}=t,{opts:o}=s,l=(0,WO.allSchemaProperties)(r),c=l.filter(x=>(0,zO.alwaysValidSchema)(s,r[x]));if(l.length===0||c.length===l.length&&(!s.opts.unevaluated||s.props===!0))return;let d=o.strictSchema&&!o.allowMatchingProperties&&i.properties,p=e.name("valid");s.props!==!0&&!(s.props instanceof Hm.Name)&&(s.props=(0,JO.evaluatedPropsToName)(e,s.props));let{props:m}=s;y();function y(){for(let x of l)d&&b(x),s.allErrors?q(x):(e.var(p,!0),q(x),e.if(p))}function b(x){for(let v in d)new RegExp(x).test(v)&&(0,zO.checkStrictMode)(s,`property ${v} matches pattern ${x} (use allowMatchingProperties)`)}function q(x){e.forIn("key",n,v=>{e.if((0,Hm._)`${(0,WO.usePattern)(t,x)}.test(${v})`,()=>{let _=c.includes(x);_||t.subschema({keyword:"patternProperties",schemaProp:x,dataProp:v,dataPropType:JO.Type.Str},p),s.opts.unevaluated&&m!==!0?e.assign((0,Hm._)`${m}[${v}]`,!0):!_&&!s.allErrors&&e.if((0,Hm.not)(p),()=>e.break())})})}}};I0.default=kW});var YO=V(O0=>{"use strict";Object.defineProperty(O0,"__esModule",{value:!0});var AW=it(),TW={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,AW.alwaysValidSchema)(n,r)){t.fail();return}let i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};O0.default=TW});var KO=V(P0=>{"use strict";Object.defineProperty(P0,"__esModule",{value:!0});var $W=Vn(),NW={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:$W.validateUnion,error:{message:"must match a schema in anyOf"}};P0.default=NW});var QO=V(k0=>{"use strict";Object.defineProperty(k0,"__esModule",{value:!0});var Bm=Je(),MW=it(),FW={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Bm._)`{passingSchemas: ${t.passing}}`},DW={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:FW,code(t){let{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,o=e.let("valid",!1),l=e.let("passing",null),c=e.name("_valid");t.setParams({passing:l}),e.block(d),t.result(o,()=>t.reset(),()=>t.error(!0));function d(){s.forEach((p,m)=>{let y;(0,MW.alwaysValidSchema)(i,p)?e.var(c,!0):y=t.subschema({keyword:"oneOf",schemaProp:m,compositeRule:!0},c),m>0&&e.if((0,Bm._)`${c} && ${o}`).assign(o,!1).assign(l,(0,Bm._)`[${l}, ${m}]`).else(),e.if(c,()=>{e.assign(o,!0),e.assign(l,m),y&&t.mergeEvaluated(y,Bm.Name)})})}}};k0.default=DW});var ZO=V(A0=>{"use strict";Object.defineProperty(A0,"__esModule",{value:!0});var jW=it(),LW={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=e.name("valid");r.forEach((s,o)=>{if((0,jW.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:o},i);t.ok(i),t.mergeEvaluated(l)})}};A0.default=LW});var tP=V(T0=>{"use strict";Object.defineProperty(T0,"__esModule",{value:!0});var Vm=Je(),eP=it(),UW={message:({params:t})=>(0,Vm.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Vm._)`{failingKeyword: ${t.ifClause}}`},HW={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:UW,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,eP.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=XO(n,"then"),s=XO(n,"else");if(!i&&!s)return;let o=e.let("valid",!0),l=e.name("_valid");if(c(),t.reset(),i&&s){let p=e.let("ifClause");t.setParams({ifClause:p}),e.if(l,d("then",p),d("else",p))}else i?e.if(l,d("then")):e.if((0,Vm.not)(l),d("else"));t.pass(o,()=>t.error(!0));function c(){let p=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);t.mergeEvaluated(p)}function d(p,m){return()=>{let y=t.subschema({keyword:p},l);e.assign(o,l),t.mergeValidEvaluated(y,o),m?e.assign(m,(0,Vm._)`${p}`):t.setParams({ifClause:p})}}}};function XO(t,e){let r=t.schema[e];return r!==void 0&&!(0,eP.alwaysValidSchema)(t,r)}T0.default=HW});var rP=V($0=>{"use strict";Object.defineProperty($0,"__esModule",{value:!0});var BW=it(),VW={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,BW.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};$0.default=VW});var nP=V(N0=>{"use strict";Object.defineProperty(N0,"__esModule",{value:!0});var WW=y0(),zW=TO(),JW=v0(),GW=NO(),YW=MO(),KW=jO(),QW=UO(),ZW=C0(),XW=VO(),ez=GO(),tz=YO(),rz=KO(),nz=QO(),iz=ZO(),sz=tP(),oz=rP();function az(t=!1){let e=[tz.default,rz.default,nz.default,iz.default,sz.default,oz.default,QW.default,ZW.default,KW.default,XW.default,ez.default];return t?e.push(zW.default,GW.default):e.push(WW.default,JW.default),e.push(YW.default),e}N0.default=az});var iP=V(M0=>{"use strict";Object.defineProperty(M0,"__esModule",{value:!0});var Xt=Je(),lz={message:({schemaCode:t})=>(0,Xt.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Xt._)`{format: ${t}}`},uz={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:lz,code(t,e){let{gen:r,data:n,$data:i,schema:s,schemaCode:o,it:l}=t,{opts:c,errSchemaPath:d,schemaEnv:p,self:m}=l;if(!c.validateFormats)return;i?y():b();function y(){let q=r.scopeValue("formats",{ref:m.formats,code:c.code.formats}),x=r.const("fDef",(0,Xt._)`${q}[${o}]`),v=r.let("fType"),_=r.let("format");r.if((0,Xt._)`typeof ${x} == "object" && !(${x} instanceof RegExp)`,()=>r.assign(v,(0,Xt._)`${x}.type || "string"`).assign(_,(0,Xt._)`${x}.validate`),()=>r.assign(v,(0,Xt._)`"string"`).assign(_,x)),t.fail$data((0,Xt.or)(E(),k()));function E(){return c.strictSchema===!1?Xt.nil:(0,Xt._)`${o} && !${_}`}function k(){let P=p.$async?(0,Xt._)`(${x}.async ? await ${_}(${n}) : ${_}(${n}))`:(0,Xt._)`${_}(${n})`,M=(0,Xt._)`(typeof ${_} == "function" ? ${P} : ${_}.test(${n}))`;return(0,Xt._)`${_} && ${_} !== true && ${v} === ${e} && !${M}`}}function b(){let q=m.formats[s];if(!q){E();return}if(q===!0)return;let[x,v,_]=k(q);x===e&&t.pass(P());function E(){if(c.strictSchema===!1){m.logger.warn(M());return}throw new Error(M());function M(){return`unknown format "${s}" ignored in schema at path "${d}"`}}function k(M){let j=M instanceof RegExp?(0,Xt.regexpCode)(M):c.code.formats?(0,Xt._)`${c.code.formats}${(0,Xt.getProperty)(s)}`:void 0,I=r.scopeValue("formats",{key:s,ref:M,code:j});return typeof M=="object"&&!(M instanceof RegExp)?[M.type||"string",M.validate,(0,Xt._)`${I}.validate`]:["string",M,I]}function P(){if(typeof q=="object"&&!(q instanceof RegExp)&&q.async){if(!p.$async)throw new Error("async format in sync schema");return(0,Xt._)`await ${_}(${n})`}return typeof v=="function"?(0,Xt._)`${_}(${n})`:(0,Xt._)`${_}.test(${n})`}}}};M0.default=uz});var sP=V(F0=>{"use strict";Object.defineProperty(F0,"__esModule",{value:!0});var cz=iP(),fz=[cz.default];F0.default=fz});var oP=V(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.contentVocabulary=Lu.metadataVocabulary=void 0;Lu.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Lu.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var lP=V(D0=>{"use strict";Object.defineProperty(D0,"__esModule",{value:!0});var dz=mO(),pz=OO(),hz=nP(),mz=sP(),aP=oP(),gz=[dz.default,pz.default,(0,hz.default)(),mz.default,aP.metadataVocabulary,aP.contentVocabulary];D0.default=gz});var cP=V(Wm=>{"use strict";Object.defineProperty(Wm,"__esModule",{value:!0});Wm.DiscrError=void 0;var uP;(function(t){t.Tag="tag",t.Mapping="mapping"})(uP||(Wm.DiscrError=uP={}))});var dP=V(L0=>{"use strict";Object.defineProperty(L0,"__esModule",{value:!0});var Uu=Je(),j0=cP(),fP=Im(),yz=Kf(),vz=it(),bz={message:({params:{discrError:t,tagName:e}})=>t===j0.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Uu._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},Sz={keyword:"discriminator",type:"object",schemaType:"object",error:bz,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:s}=t,{oneOf:o}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let l=n.propertyName;if(typeof l!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),d=e.const("tag",(0,Uu._)`${r}${(0,Uu.getProperty)(l)}`);e.if((0,Uu._)`typeof ${d} == "string"`,()=>p(),()=>t.error(!1,{discrError:j0.DiscrError.Tag,tag:d,tagName:l})),t.ok(c);function p(){let b=y();e.if(!1);for(let q in b)e.elseIf((0,Uu._)`${d} === ${q}`),e.assign(c,m(b[q]));e.else(),t.error(!1,{discrError:j0.DiscrError.Mapping,tag:d,tagName:l}),e.endIf()}function m(b){let q=e.name("valid"),x=t.subschema({keyword:"oneOf",schemaProp:b},q);return t.mergeEvaluated(x,Uu.Name),q}function y(){var b;let q={},x=_(i),v=!0;for(let P=0;P<o.length;P++){let M=o[P];if(M?.$ref&&!(0,vz.schemaHasRulesButRef)(M,s.self.RULES)){let I=M.$ref;if(M=fP.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,I),M instanceof fP.SchemaEnv&&(M=M.schema),M===void 0)throw new yz.default(s.opts.uriResolver,s.baseId,I)}let j=(b=M?.properties)===null||b===void 0?void 0:b[l];if(typeof j!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);v=v&&(x||_(M)),E(j,P)}if(!v)throw new Error(`discriminator: "${l}" must be required`);return q;function _({required:P}){return Array.isArray(P)&&P.includes(l)}function E(P,M){if(P.const)k(P.const,M);else if(P.enum)for(let j of P.enum)k(j,M);else throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`)}function k(P,M){if(typeof P!="string"||P in q)throw new Error(`discriminator: "${l}" values must be unique strings`);q[P]=M}}}};L0.default=Sz});var pP=V((OZ,wz)=>{wz.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 mP=V((Ft,U0)=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.MissingRefError=Ft.ValidationError=Ft.CodeGen=Ft.Name=Ft.nil=Ft.stringify=Ft.str=Ft._=Ft.KeywordCxt=Ft.Ajv=void 0;var _z=uO(),Rz=lP(),xz=dP(),hP=pP(),Cz=["/properties"],zm="http://json-schema.org/draft-07/schema",Hu=class extends _z.default{_addVocabularies(){super._addVocabularies(),Rz.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(xz.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(hP,Cz):hP;this.addMetaSchema(e,zm,!1),this.refs["http://json-schema.org/schema"]=zm}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(zm)?zm:void 0)}};Ft.Ajv=Hu;U0.exports=Ft=Hu;U0.exports.Ajv=Hu;Object.defineProperty(Ft,"__esModule",{value:!0});Ft.default=Hu;var Ez=Yf();Object.defineProperty(Ft,"KeywordCxt",{enumerable:!0,get:function(){return Ez.KeywordCxt}});var Bu=Je();Object.defineProperty(Ft,"_",{enumerable:!0,get:function(){return Bu._}});Object.defineProperty(Ft,"str",{enumerable:!0,get:function(){return Bu.str}});Object.defineProperty(Ft,"stringify",{enumerable:!0,get:function(){return Bu.stringify}});Object.defineProperty(Ft,"nil",{enumerable:!0,get:function(){return Bu.nil}});Object.defineProperty(Ft,"Name",{enumerable:!0,get:function(){return Bu.Name}});Object.defineProperty(Ft,"CodeGen",{enumerable:!0,get:function(){return Bu.CodeGen}});var qz=Em();Object.defineProperty(Ft,"ValidationError",{enumerable:!0,get:function(){return qz.default}});var Iz=Kf();Object.defineProperty(Ft,"MissingRefError",{enumerable:!0,get:function(){return Iz.default}})});function fd(){return{format:(t,e)=>{let r=t?new Date(t):new Date;return e==="YYYY-MM-DD"?r.toISOString().split("T")[0]:r.toISOString()},unix:()=>Math.floor(Date.now()/1e3),utc:()=>{let t=new Date;return{format:()=>t.toISOString(),toISOString:()=>t.toISOString()}},__isShim:!0,__warning:"This is a lightweight shim. For full features, install moment.js via modules/package.json"}}function H0(){return{get:(t,e,r)=>{let n=e.split("."),i=t;for(let s of n)if(i=i?.[s],i===void 0)return r;return i},set:(t,e,r)=>{let n=e.split("."),i=t;for(let s=0;s<n.length-1;s++)i[n[s]]||(i[n[s]]={}),i=i[n[s]];return i[n[n.length-1]]=r,t},cloneDeep:t=>JSON.parse(JSON.stringify(t)),keys:t=>Object.keys(t??{}),values:t=>Object.values(t??{}),entries:t=>Object.entries(t??{}),each(t,e){Array.isArray(t)?t.forEach((r,n)=>e(r,n,t)):t&&typeof t=="object"&&Object.entries(t).forEach(([r,n])=>e(n,r,t))},forEach(t,e){Array.isArray(t)?t.forEach((r,n)=>e(r,n,t)):t&&typeof t=="object"&&Object.entries(t).forEach(([r,n])=>e(n,r,t))},map:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).map(r=>e(r)),filter:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).filter(r=>e(r)),find:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).find(r=>e(r)),reduce:(t,e,r)=>(Array.isArray(t)?t:Object.values(t??{})).reduce((n,i)=>e(n,i),r),includes:(t,e)=>Array.isArray(t)?t.includes(e):Object.values(t??{}).includes(e),isObject:t=>t!==null&&typeof t=="object"&&!Array.isArray(t),isArray:t=>Array.isArray(t),isString:t=>typeof t=="string",isNumber:t=>typeof t=="number",isFunction:t=>typeof t=="function",isNil:t=>t==null,isEmpty:t=>t==null?!0:Array.isArray(t)||typeof t=="string"?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1,assign:(t,...e)=>Object.assign(t,...e),merge:(t,...e)=>{let r={...t};for(let n of e)for(let[i,s]of Object.entries(n??{}))r[i]=s&&typeof s=="object"&&!Array.isArray(s)?{...r[i]??{},...s}:s;return r},omit:(t,e)=>{let r={...t};for(let n of e)delete r[n];return r},pick:(t,e)=>{let r={};for(let n of e)n in(t??{})&&(r[n]=t[n]);return r}}}function Jm(t,e){return new cd(t,e)}var Oz,Va,gP,hi,cd,B0=le(()=>{"use strict";Oz=ve(require("crypto")),Va=ve(require("fs")),gP=require("module"),hi=ve(require("path"));ew();cd=class{availableModules=new Set;customModulesRequire;globalSetupExports;options;modulesPath=null;moduleCache=new Map;resolveStack=new Set;builtinModules={uuid:()=>({v4:Ru}),crypto:()=>Oz,path:()=>hi,querystring:()=>require("querystring"),lodash:()=>this.loadOptionalModule("lodash",()=>$q(),H0),moment:()=>this.loadOptionalModule("moment",()=>Nq(),fd),tv4:()=>this.loadOptionalModule("tv4",()=>Fq()),ajv:()=>this.loadOptionalModule("ajv",()=>mP()),"crypto-js":()=>this.loadOptionalModule("crypto-js",()=>require("crypto-js"),()=>{throw new Error('crypto-js npm module is not installed. The built-in CryptoJS global is already available in scripts with AES/DES/TripleDES/hash/HMAC/PBKDF2 support. If you need the exact npm package, add "crypto-js" to your modules/package.json and run npm install.')})};constructor(e=[],r={}){this.options={allowCustomModules:!0,maxResolveDepth:10,...r,outputChannel:r.outputChannel||{appendLine:n=>{console.log(`[ModuleLoader] ${n}`)}}};for(let n of e){let i=hi.resolve(n);if(this.initializeModules(i)){this.modulesPath=i;break}}}loadOptionalModule(e,r,n){try{return r()}catch{if(this.customModulesRequire)try{return console.debug(`[ModuleLoader] ${e} not in core, trying user modules`),this.customModulesRequire(e)}catch{this.logModuleWarning(e,"user")}else this.logModuleWarning(e,"core");if(n)return console.warn(`[ModuleLoader] Using shim for ${e}. Some features may be limited.`),n();throw new Error(this.getModuleInstallInstructions(e))}}logModuleWarning(e,r){let i={moment:"Date/time manipulation",lodash:"Utility functions",tv4:"JSON Schema validation (v4)",ajv:"JSON Schema validation"}[e]||e;console.warn(`[ModuleLoader] ${i} functionality (${e}) is not available.
|
|
30
|
+
deps: ${r}}`};var wW={keyword:"dependencies",type:"object",schemaType:"object",error:Yi.error,code(t){let[e,r]=_W(t);FO(t,e),DO(t,r)}};function _W({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let i=Array.isArray(t[n])?e:r;i[n]=t[n]}return[e,r]}function FO(t,e=t.schema){let{gen:r,data:n,it:i}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let o in e){let l=e[o];if(l.length===0)continue;let c=(0,ud.propertyInData)(r,n,o,i.opts.ownProperties);t.setParams({property:o,depsCount:l.length,deps:l.join(", ")}),i.allErrors?r.if(c,()=>{for(let d of l)(0,ud.checkReportMissingProp)(t,d)}):(r.if((0,_0._)`${c} && (${(0,ud.checkMissingProp)(t,l,s)})`),(0,ud.reportMissingProp)(t,s),r.else())}}Yi.validatePropertyDeps=FO;function DO(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,o=r.name("valid");for(let l in e)(0,SW.alwaysValidSchema)(s,e[l])||(r.if((0,ud.propertyInData)(r,n,l,s.opts.ownProperties),()=>{let c=t.subschema({keyword:i,schemaProp:l},o);t.mergeValidEvaluated(c,o)},()=>r.var(o,!0)),t.ok(o))}Yi.validateSchemaDeps=DO;Yi.default=wW});var UO=V(R0=>{"use strict";Object.defineProperty(R0,"__esModule",{value:!0});var LO=Je(),RW=it(),xW={message:"property name must be valid",params:({params:t})=>(0,LO._)`{propertyName: ${t.propertyName}}`},CW={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:xW,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,RW.alwaysValidSchema)(i,r))return;let s=e.name("valid");e.forIn("key",n,o=>{t.setParams({propertyName:o}),t.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},s),e.if((0,LO.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};R0.default=CW});var C0=V(x0=>{"use strict";Object.defineProperty(x0,"__esModule",{value:!0});var Lm=Vn(),pi=Je(),EW=Is(),Um=it(),qW={message:"must NOT have additional properties",params:({params:t})=>(0,pi._)`{additionalProperty: ${t.additionalProperty}}`},IW={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:qW,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:s,it:o}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:l,opts:c}=o;if(o.props=!0,c.removeAdditional!=="all"&&(0,Um.alwaysValidSchema)(o,r))return;let d=(0,Lm.allSchemaProperties)(n.properties),p=(0,Lm.allSchemaProperties)(n.patternProperties);m(),t.ok((0,pi._)`${s} === ${EW.default.errors}`);function m(){e.forIn("key",i,v=>{!d.length&&!p.length?q(v):e.if(y(v),()=>q(v))})}function y(v){let R;if(d.length>8){let E=(0,Um.schemaRefOrVal)(o,n.properties,"properties");R=(0,Lm.isOwnProperty)(e,E,v)}else d.length?R=(0,pi.or)(...d.map(E=>(0,pi._)`${v} === ${E}`)):R=pi.nil;return p.length&&(R=(0,pi.or)(R,...p.map(E=>(0,pi._)`${(0,Lm.usePattern)(t,E)}.test(${v})`))),(0,pi.not)(R)}function b(v){e.code((0,pi._)`delete ${i}[${v}]`)}function q(v){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){b(v);return}if(r===!1){t.setParams({additionalProperty:v}),t.error(),l||e.break();return}if(typeof r=="object"&&!(0,Um.alwaysValidSchema)(o,r)){let R=e.name("valid");c.removeAdditional==="failing"?(x(v,R,!1),e.if((0,pi.not)(R),()=>{t.reset(),b(v)})):(x(v,R),l||e.if((0,pi.not)(R),()=>e.break()))}}function x(v,R,E){let k={keyword:"additionalProperties",dataProp:v,dataPropType:Um.Type.Str};E===!1&&Object.assign(k,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(k,R)}}};x0.default=IW});var VO=V(q0=>{"use strict";Object.defineProperty(q0,"__esModule",{value:!0});var OW=Yf(),HO=Vn(),E0=it(),BO=C0(),PW={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&BO.default.code(new OW.KeywordCxt(s,BO.default,"additionalProperties"));let o=(0,HO.allSchemaProperties)(r);for(let m of o)s.definedProperties.add(m);s.opts.unevaluated&&o.length&&s.props!==!0&&(s.props=E0.mergeEvaluated.props(e,(0,E0.toHash)(o),s.props));let l=o.filter(m=>!(0,E0.alwaysValidSchema)(s,r[m]));if(l.length===0)return;let c=e.name("valid");for(let m of l)d(m)?p(m):(e.if((0,HO.propertyInData)(e,i,m,s.opts.ownProperties)),p(m),s.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(m),t.ok(c);function d(m){return s.opts.useDefaults&&!s.compositeRule&&r[m].default!==void 0}function p(m){t.subschema({keyword:"properties",schemaProp:m,dataProp:m},c)}}};q0.default=PW});var GO=V(I0=>{"use strict";Object.defineProperty(I0,"__esModule",{value:!0});var WO=Vn(),Hm=Je(),zO=it(),JO=it(),kW={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:s}=t,{opts:o}=s,l=(0,WO.allSchemaProperties)(r),c=l.filter(x=>(0,zO.alwaysValidSchema)(s,r[x]));if(l.length===0||c.length===l.length&&(!s.opts.unevaluated||s.props===!0))return;let d=o.strictSchema&&!o.allowMatchingProperties&&i.properties,p=e.name("valid");s.props!==!0&&!(s.props instanceof Hm.Name)&&(s.props=(0,JO.evaluatedPropsToName)(e,s.props));let{props:m}=s;y();function y(){for(let x of l)d&&b(x),s.allErrors?q(x):(e.var(p,!0),q(x),e.if(p))}function b(x){for(let v in d)new RegExp(x).test(v)&&(0,zO.checkStrictMode)(s,`property ${v} matches pattern ${x} (use allowMatchingProperties)`)}function q(x){e.forIn("key",n,v=>{e.if((0,Hm._)`${(0,WO.usePattern)(t,x)}.test(${v})`,()=>{let R=c.includes(x);R||t.subschema({keyword:"patternProperties",schemaProp:x,dataProp:v,dataPropType:JO.Type.Str},p),s.opts.unevaluated&&m!==!0?e.assign((0,Hm._)`${m}[${v}]`,!0):!R&&!s.allErrors&&e.if((0,Hm.not)(p),()=>e.break())})})}}};I0.default=kW});var YO=V(O0=>{"use strict";Object.defineProperty(O0,"__esModule",{value:!0});var AW=it(),TW={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,AW.alwaysValidSchema)(n,r)){t.fail();return}let i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};O0.default=TW});var KO=V(P0=>{"use strict";Object.defineProperty(P0,"__esModule",{value:!0});var $W=Vn(),NW={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:$W.validateUnion,error:{message:"must match a schema in anyOf"}};P0.default=NW});var QO=V(k0=>{"use strict";Object.defineProperty(k0,"__esModule",{value:!0});var Bm=Je(),MW=it(),FW={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Bm._)`{passingSchemas: ${t.passing}}`},DW={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:FW,code(t){let{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,o=e.let("valid",!1),l=e.let("passing",null),c=e.name("_valid");t.setParams({passing:l}),e.block(d),t.result(o,()=>t.reset(),()=>t.error(!0));function d(){s.forEach((p,m)=>{let y;(0,MW.alwaysValidSchema)(i,p)?e.var(c,!0):y=t.subschema({keyword:"oneOf",schemaProp:m,compositeRule:!0},c),m>0&&e.if((0,Bm._)`${c} && ${o}`).assign(o,!1).assign(l,(0,Bm._)`[${l}, ${m}]`).else(),e.if(c,()=>{e.assign(o,!0),e.assign(l,m),y&&t.mergeEvaluated(y,Bm.Name)})})}}};k0.default=DW});var ZO=V(A0=>{"use strict";Object.defineProperty(A0,"__esModule",{value:!0});var jW=it(),LW={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=e.name("valid");r.forEach((s,o)=>{if((0,jW.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:o},i);t.ok(i),t.mergeEvaluated(l)})}};A0.default=LW});var tP=V(T0=>{"use strict";Object.defineProperty(T0,"__esModule",{value:!0});var Vm=Je(),eP=it(),UW={message:({params:t})=>(0,Vm.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Vm._)`{failingKeyword: ${t.ifClause}}`},HW={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:UW,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,eP.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=XO(n,"then"),s=XO(n,"else");if(!i&&!s)return;let o=e.let("valid",!0),l=e.name("_valid");if(c(),t.reset(),i&&s){let p=e.let("ifClause");t.setParams({ifClause:p}),e.if(l,d("then",p),d("else",p))}else i?e.if(l,d("then")):e.if((0,Vm.not)(l),d("else"));t.pass(o,()=>t.error(!0));function c(){let p=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);t.mergeEvaluated(p)}function d(p,m){return()=>{let y=t.subschema({keyword:p},l);e.assign(o,l),t.mergeValidEvaluated(y,o),m?e.assign(m,(0,Vm._)`${p}`):t.setParams({ifClause:p})}}}};function XO(t,e){let r=t.schema[e];return r!==void 0&&!(0,eP.alwaysValidSchema)(t,r)}T0.default=HW});var rP=V($0=>{"use strict";Object.defineProperty($0,"__esModule",{value:!0});var BW=it(),VW={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,BW.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};$0.default=VW});var nP=V(N0=>{"use strict";Object.defineProperty(N0,"__esModule",{value:!0});var WW=y0(),zW=TO(),JW=v0(),GW=NO(),YW=MO(),KW=jO(),QW=UO(),ZW=C0(),XW=VO(),ez=GO(),tz=YO(),rz=KO(),nz=QO(),iz=ZO(),sz=tP(),oz=rP();function az(t=!1){let e=[tz.default,rz.default,nz.default,iz.default,sz.default,oz.default,QW.default,ZW.default,KW.default,XW.default,ez.default];return t?e.push(zW.default,GW.default):e.push(WW.default,JW.default),e.push(YW.default),e}N0.default=az});var iP=V(M0=>{"use strict";Object.defineProperty(M0,"__esModule",{value:!0});var Xt=Je(),lz={message:({schemaCode:t})=>(0,Xt.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Xt._)`{format: ${t}}`},uz={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:lz,code(t,e){let{gen:r,data:n,$data:i,schema:s,schemaCode:o,it:l}=t,{opts:c,errSchemaPath:d,schemaEnv:p,self:m}=l;if(!c.validateFormats)return;i?y():b();function y(){let q=r.scopeValue("formats",{ref:m.formats,code:c.code.formats}),x=r.const("fDef",(0,Xt._)`${q}[${o}]`),v=r.let("fType"),R=r.let("format");r.if((0,Xt._)`typeof ${x} == "object" && !(${x} instanceof RegExp)`,()=>r.assign(v,(0,Xt._)`${x}.type || "string"`).assign(R,(0,Xt._)`${x}.validate`),()=>r.assign(v,(0,Xt._)`"string"`).assign(R,x)),t.fail$data((0,Xt.or)(E(),k()));function E(){return c.strictSchema===!1?Xt.nil:(0,Xt._)`${o} && !${R}`}function k(){let P=p.$async?(0,Xt._)`(${x}.async ? await ${R}(${n}) : ${R}(${n}))`:(0,Xt._)`${R}(${n})`,M=(0,Xt._)`(typeof ${R} == "function" ? ${P} : ${R}.test(${n}))`;return(0,Xt._)`${R} && ${R} !== true && ${v} === ${e} && !${M}`}}function b(){let q=m.formats[s];if(!q){E();return}if(q===!0)return;let[x,v,R]=k(q);x===e&&t.pass(P());function E(){if(c.strictSchema===!1){m.logger.warn(M());return}throw new Error(M());function M(){return`unknown format "${s}" ignored in schema at path "${d}"`}}function k(M){let j=M instanceof RegExp?(0,Xt.regexpCode)(M):c.code.formats?(0,Xt._)`${c.code.formats}${(0,Xt.getProperty)(s)}`:void 0,I=r.scopeValue("formats",{key:s,ref:M,code:j});return typeof M=="object"&&!(M instanceof RegExp)?[M.type||"string",M.validate,(0,Xt._)`${I}.validate`]:["string",M,I]}function P(){if(typeof q=="object"&&!(q instanceof RegExp)&&q.async){if(!p.$async)throw new Error("async format in sync schema");return(0,Xt._)`await ${R}(${n})`}return typeof v=="function"?(0,Xt._)`${R}(${n})`:(0,Xt._)`${R}.test(${n})`}}}};M0.default=uz});var sP=V(F0=>{"use strict";Object.defineProperty(F0,"__esModule",{value:!0});var cz=iP(),fz=[cz.default];F0.default=fz});var oP=V(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.contentVocabulary=Lu.metadataVocabulary=void 0;Lu.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Lu.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var lP=V(D0=>{"use strict";Object.defineProperty(D0,"__esModule",{value:!0});var dz=mO(),pz=OO(),hz=nP(),mz=sP(),aP=oP(),gz=[dz.default,pz.default,(0,hz.default)(),mz.default,aP.metadataVocabulary,aP.contentVocabulary];D0.default=gz});var cP=V(Wm=>{"use strict";Object.defineProperty(Wm,"__esModule",{value:!0});Wm.DiscrError=void 0;var uP;(function(t){t.Tag="tag",t.Mapping="mapping"})(uP||(Wm.DiscrError=uP={}))});var dP=V(L0=>{"use strict";Object.defineProperty(L0,"__esModule",{value:!0});var Uu=Je(),j0=cP(),fP=Im(),yz=Kf(),vz=it(),bz={message:({params:{discrError:t,tagName:e}})=>t===j0.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Uu._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},Sz={keyword:"discriminator",type:"object",schemaType:"object",error:bz,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:s}=t,{oneOf:o}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let l=n.propertyName;if(typeof l!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),d=e.const("tag",(0,Uu._)`${r}${(0,Uu.getProperty)(l)}`);e.if((0,Uu._)`typeof ${d} == "string"`,()=>p(),()=>t.error(!1,{discrError:j0.DiscrError.Tag,tag:d,tagName:l})),t.ok(c);function p(){let b=y();e.if(!1);for(let q in b)e.elseIf((0,Uu._)`${d} === ${q}`),e.assign(c,m(b[q]));e.else(),t.error(!1,{discrError:j0.DiscrError.Mapping,tag:d,tagName:l}),e.endIf()}function m(b){let q=e.name("valid"),x=t.subschema({keyword:"oneOf",schemaProp:b},q);return t.mergeEvaluated(x,Uu.Name),q}function y(){var b;let q={},x=R(i),v=!0;for(let P=0;P<o.length;P++){let M=o[P];if(M?.$ref&&!(0,vz.schemaHasRulesButRef)(M,s.self.RULES)){let I=M.$ref;if(M=fP.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,I),M instanceof fP.SchemaEnv&&(M=M.schema),M===void 0)throw new yz.default(s.opts.uriResolver,s.baseId,I)}let j=(b=M?.properties)===null||b===void 0?void 0:b[l];if(typeof j!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);v=v&&(x||R(M)),E(j,P)}if(!v)throw new Error(`discriminator: "${l}" must be required`);return q;function R({required:P}){return Array.isArray(P)&&P.includes(l)}function E(P,M){if(P.const)k(P.const,M);else if(P.enum)for(let j of P.enum)k(j,M);else throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`)}function k(P,M){if(typeof P!="string"||P in q)throw new Error(`discriminator: "${l}" values must be unique strings`);q[P]=M}}}};L0.default=Sz});var pP=V((OZ,wz)=>{wz.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 mP=V((Ft,U0)=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.MissingRefError=Ft.ValidationError=Ft.CodeGen=Ft.Name=Ft.nil=Ft.stringify=Ft.str=Ft._=Ft.KeywordCxt=Ft.Ajv=void 0;var _z=uO(),Rz=lP(),xz=dP(),hP=pP(),Cz=["/properties"],zm="http://json-schema.org/draft-07/schema",Hu=class extends _z.default{_addVocabularies(){super._addVocabularies(),Rz.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(xz.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(hP,Cz):hP;this.addMetaSchema(e,zm,!1),this.refs["http://json-schema.org/schema"]=zm}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(zm)?zm:void 0)}};Ft.Ajv=Hu;U0.exports=Ft=Hu;U0.exports.Ajv=Hu;Object.defineProperty(Ft,"__esModule",{value:!0});Ft.default=Hu;var Ez=Yf();Object.defineProperty(Ft,"KeywordCxt",{enumerable:!0,get:function(){return Ez.KeywordCxt}});var Bu=Je();Object.defineProperty(Ft,"_",{enumerable:!0,get:function(){return Bu._}});Object.defineProperty(Ft,"str",{enumerable:!0,get:function(){return Bu.str}});Object.defineProperty(Ft,"stringify",{enumerable:!0,get:function(){return Bu.stringify}});Object.defineProperty(Ft,"nil",{enumerable:!0,get:function(){return Bu.nil}});Object.defineProperty(Ft,"Name",{enumerable:!0,get:function(){return Bu.Name}});Object.defineProperty(Ft,"CodeGen",{enumerable:!0,get:function(){return Bu.CodeGen}});var qz=Em();Object.defineProperty(Ft,"ValidationError",{enumerable:!0,get:function(){return qz.default}});var Iz=Kf();Object.defineProperty(Ft,"MissingRefError",{enumerable:!0,get:function(){return Iz.default}})});function fd(){return{format:(t,e)=>{let r=t?new Date(t):new Date;return e==="YYYY-MM-DD"?r.toISOString().split("T")[0]:r.toISOString()},unix:()=>Math.floor(Date.now()/1e3),utc:()=>{let t=new Date;return{format:()=>t.toISOString(),toISOString:()=>t.toISOString()}},__isShim:!0,__warning:"This is a lightweight shim. For full features, install moment.js via modules/package.json"}}function H0(){return{get:(t,e,r)=>{let n=e.split("."),i=t;for(let s of n)if(i=i?.[s],i===void 0)return r;return i},set:(t,e,r)=>{let n=e.split("."),i=t;for(let s=0;s<n.length-1;s++)i[n[s]]||(i[n[s]]={}),i=i[n[s]];return i[n[n.length-1]]=r,t},cloneDeep:t=>JSON.parse(JSON.stringify(t)),keys:t=>Object.keys(t??{}),values:t=>Object.values(t??{}),entries:t=>Object.entries(t??{}),each(t,e){Array.isArray(t)?t.forEach((r,n)=>e(r,n,t)):t&&typeof t=="object"&&Object.entries(t).forEach(([r,n])=>e(n,r,t))},forEach(t,e){Array.isArray(t)?t.forEach((r,n)=>e(r,n,t)):t&&typeof t=="object"&&Object.entries(t).forEach(([r,n])=>e(n,r,t))},map:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).map(r=>e(r)),filter:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).filter(r=>e(r)),find:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).find(r=>e(r)),reduce:(t,e,r)=>(Array.isArray(t)?t:Object.values(t??{})).reduce((n,i)=>e(n,i),r),includes:(t,e)=>Array.isArray(t)?t.includes(e):Object.values(t??{}).includes(e),isObject:t=>t!==null&&typeof t=="object"&&!Array.isArray(t),isArray:t=>Array.isArray(t),isString:t=>typeof t=="string",isNumber:t=>typeof t=="number",isFunction:t=>typeof t=="function",isNil:t=>t==null,isEmpty:t=>t==null?!0:Array.isArray(t)||typeof t=="string"?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1,assign:(t,...e)=>Object.assign(t,...e),merge:(t,...e)=>{let r={...t};for(let n of e)for(let[i,s]of Object.entries(n??{}))r[i]=s&&typeof s=="object"&&!Array.isArray(s)?{...r[i]??{},...s}:s;return r},omit:(t,e)=>{let r={...t};for(let n of e)delete r[n];return r},pick:(t,e)=>{let r={};for(let n of e)n in(t??{})&&(r[n]=t[n]);return r}}}function Jm(t,e){return new cd(t,e)}var Oz,Va,gP,hi,cd,B0=le(()=>{"use strict";Oz=ve(require("crypto")),Va=ve(require("fs")),gP=require("module"),hi=ve(require("path"));ew();cd=class{availableModules=new Set;customModulesRequire;globalSetupExports;options;modulesPath=null;moduleCache=new Map;resolveStack=new Set;builtinModules={uuid:()=>({v4:Ru}),crypto:()=>Oz,path:()=>hi,querystring:()=>require("querystring"),lodash:()=>this.loadOptionalModule("lodash",()=>$q(),H0),moment:()=>this.loadOptionalModule("moment",()=>Nq(),fd),tv4:()=>this.loadOptionalModule("tv4",()=>Fq()),ajv:()=>this.loadOptionalModule("ajv",()=>mP()),"crypto-js":()=>this.loadOptionalModule("crypto-js",()=>require("crypto-js"),()=>{throw new Error('crypto-js npm module is not installed. The built-in CryptoJS global is already available in scripts with AES/DES/TripleDES/hash/HMAC/PBKDF2 support. If you need the exact npm package, add "crypto-js" to your modules/package.json and run npm install.')})};constructor(e=[],r={}){this.options={allowCustomModules:!0,maxResolveDepth:10,...r,outputChannel:r.outputChannel||{appendLine:n=>{console.log(`[ModuleLoader] ${n}`)}}};for(let n of e){let i=hi.resolve(n);if(this.initializeModules(i)){this.modulesPath=i;break}}}loadOptionalModule(e,r,n){try{return r()}catch{if(this.customModulesRequire)try{return console.debug(`[ModuleLoader] ${e} not in core, trying user modules`),this.customModulesRequire(e)}catch{this.logModuleWarning(e,"user")}else this.logModuleWarning(e,"core");if(n)return console.warn(`[ModuleLoader] Using shim for ${e}. Some features may be limited.`),n();throw new Error(this.getModuleInstallInstructions(e))}}logModuleWarning(e,r){let i={moment:"Date/time manipulation",lodash:"Utility functions",tv4:"JSON Schema validation (v4)",ajv:"JSON Schema validation"}[e]||e;console.warn(`[ModuleLoader] ${i} functionality (${e}) is not available.
|
|
31
31
|
${this.getModuleInstallInstructions(e)}`)}getModuleInstallInstructions(e){let n={moment:"^2.30.1",lodash:"^4.17.21",tv4:"^1.3.0",ajv:"^8.17.1"}[e]||"latest";return`To use ${e}, add it to http-forge/modules/package.json:
|
|
32
32
|
{
|
|
33
33
|
"dependencies": {
|
|
@@ -49,10 +49,10 @@ ${i}
|
|
|
49
49
|
|
|
50
50
|
// --- Next Script ---
|
|
51
51
|
|
|
52
|
-
`)}function Vu(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function Ja(t){return t.map(e=>{let r=e.args.map(n=>{if(typeof n=="object")try{return JSON.stringify(n,null,2)}catch{return String(n)}return String(n)}).join(" ");return`[${e.level}] ${r}`})}function SP(t){return{log:(...e)=>t.push({level:"log",args:e}),info:(...e)=>t.push({level:"info",args:e}),warn:(...e)=>t.push({level:"warn",args:e}),error:(...e)=>t.push({level:"error",args:e})}}function Km(t){let e=[],r=(n,i)=>{try{let s=i();if(s&&typeof s.then=="function"){let o=s.then(()=>{t.push({name:n,passed:!0})},l=>{t.push({name:n,passed:!1,message:l.message||String(l)})});e.push(o)}else t.push({name:n,passed:!0})}catch(s){t.push({name:n,passed:!1,message:s.message})}};return r.skip=(n,i)=>{t.push({name:n,passed:!0,skipped:!0})},r.fail=n=>{t.push({name:n||"Failed test",passed:!1,message:n||"pm.test.fail()"})},r.index=()=>t.length,r._pendingTests=e,r}function Qm(t){let e={};for(let[r,n]of Object.entries(t))e[r]=Array.isArray(n)?n.join(", "):n;return e}function Zm(t,e,r){let n;if(r)try{n=new URL(r).hostname}catch{n=void 0}let i=_t.parseCookieHeaders(t||{},n);return i.length>0?i:Array.isArray(e)&&e.length>0?e.filter(s=>s&&s.name).map(s=>({name:s.name,value:s.value,domain:s.domain??n,path:s.path,expires:s.expires,maxAge:s.maxAge,httpOnly:s.httpOnly,secure:s.secure,sameSite:s.sameSite})):[]}var hd=le(()=>{"use strict";ka()});function $z(t){let e=null;try{e=new URL(t)}catch{}return{toString(){return t},valueOf(){return t},[Symbol.toPrimitive](n){return n==="number"?NaN:t},getHost(){return e?e.hostname:""},getPath(){return e?e.pathname:t},getPathWithQuery(){return e?e.pathname+e.search:t},getQueryString(){return e?e.search.startsWith("?")?e.search.slice(1):e.search:""},getRemote(){if(!e)return"";let n=e.port||(e.protocol==="https:"?"443":"80");return`${e.hostname}:${n}`},getOAuth1BaseUrl(){return e?`${e.protocol}//${e.host}${e.pathname}`:t},get protocol(){return e?.protocol?.replace(":","")||""},get host(){return e?e.hostname.split("."):[]},get port(){return e?.port||""},get path(){return e?e.pathname.split("/").filter(Boolean):[]},get hash(){return e?.hash?.replace("#","")||""},query:{toObject(){if(!e)return{};let n={};return e.searchParams.forEach((i,s)=>{n[s]=i}),n},has(n){return e?e.searchParams.has(n):!1},get(n){return e?e.searchParams.get(n):void 0},each(n){e&&e.searchParams.forEach((i,s)=>n({key:s,value:i}))}}}}var V0,Wu,W0=le(()=>{"use strict";V0=ve(require("vm"));vP();Ym();hd();Wu=class{constructor(e,r){this.deps=e;this.initialContext=r;this.timerRegistry=yP(n=>{let i=n instanceof Error?n.message:String(n);this.consoleMessages.push({level:"error",args:[`Uncaught error in async callback: ${i}`]})}),this.initializeSession()}deps;initialContext;vmContext=null;ctx=null;modifiedRequest=null;assertions=[];consoleMessages=[];_variables={};_collectionVariables={};_globals={};_environmentVariables={};_liveEnvironmentScope=null;_liveGlobalsScope=null;_liveCollectionScope=null;_nextRequest=void 0;_skipRequest=!1;_visualizerData=void 0;timerRegistry;initializeSession(){this.modifiedRequest={url:this.initialContext.request.url,method:this.initialContext.request.method,headers:{...this.initialContext.request.headers},body:this.initialContext.request.body?{...this.initialContext.request.body}:null,params:this.initialContext.request.params?{...this.initialContext.request.params}:{},query:this.initialContext.request.query?{...this.initialContext.request.query}:{}},this.assertions=[],this.ctx=this.createSharedContext(),this.consoleMessages=[];let e=this,r={log:(...n)=>{e.consoleMessages.push({level:"log",args:n})},info:(...n)=>{e.consoleMessages.push({level:"info",args:n})},warn:(...n)=>{e.consoleMessages.push({level:"warn",args:n})},error:(...n)=>{e.consoleMessages.push({level:"error",args:n})}};this.vmContext=this.deps.createVM(this.ctx,r,this.timerRegistry.timers)}createSharedContext(){let e=this.initialContext,r=this.modifiedRequest,n=this.deps.createCommonContext(e,"prerequest");this._variables={...e.variables},this._collectionVariables={...e.collectionVariables||{}},this._globals={...e.globals||{}},this._environmentVariables={...e.environmentVariables||{}},this._liveEnvironmentScope=n.environment,this._liveGlobalsScope=n.globals,this._liveCollectionScope=n.collectionVariables;let i;try{i=new URL(e.request.url).hostname}catch{}let s={get:l=>e.cookieJar?e.cookieJar.get(l,i)?.value:void 0,set:(l,c)=>{e.cookieJar&&e.cookieJar.set({name:l,value:c,domain:i})},has:l=>e.cookieJar?e.cookieJar.has(l,i):!1,list:()=>e.cookieJar?e.cookieJar.getAll(i).map(l=>({name:l.name,value:l.value})):[],toObject:()=>{if(!e.cookieJar)return{};let l=e.cookieJar.getAll(i),c={};for(let d of l)c[d.name]=d.value;return c},jar:()=>{let l=e.cookieJar,c=d=>{if(d==null)return;let p=typeof d=="string"?d:typeof d=="object"||typeof d=="number"||typeof d=="boolean"?String(d):void 0;if(!p)return;let m=p.trim();if(m)try{return new URL(m).hostname}catch{return m}};return{getAll(d,p){try{if(!l){p(null,[]);return}let m=c(d),y=l.getAll(m).map(b=>({name:b.name,value:b.value,domain:b.domain,path:b.path,httpOnly:b.httpOnly,secure:b.secure}));p(null,y)}catch(m){p(m,[])}},get(d,p,m){try{if(!l){m(null,void 0);return}let y=c(d),b=l.get(p,y);m(null,b?{name:b.name,value:b.value,domain:b.domain}:void 0)}catch(y){m(y,void 0)}},set(d,p,m,y){try{if(!l){(y||m)?.(null);return}let b=c(d);typeof p=="string"&&typeof m=="string"?(l.set({name:p,value:m,domain:b}),y?.(null)):typeof p=="object"&&(l.set({...p,domain:b}),m?.(null))}catch(b){(y||m)?.(b)}},unset(d,p,m){try{if(!l){m?.(null);return}let y=c(d);l.delete(p,y),m?.(null)}catch(y){m?.(y)}},clear(d,p){try{let m=typeof d=="function"?d:p;if(!l){m?.(null);return}let y=typeof d=="function"?void 0:c(d);y&&typeof l.clearDomain=="function"?l.clearDomain(y):l.clear(),m?.(null)}catch(m){(typeof d=="function"?d:p)?.(m)}}}},remove:l=>{e.cookieJar&&e.cookieJar.delete(l,i)},unset:l=>{e.cookieJar&&e.cookieJar.delete(l,i)},clear:()=>{e.cookieJar&&e.cookieJar.clear()}},o=this;return{request:this.createRequestObject(r,e),response:null,test:Km(this.assertions),expect:za,cookies:s,execution:{setNextRequest(l){o._nextRequest=l},skipRequest(){o._skipRequest=!0},runRequest(l,c){let p=(async()=>{if(typeof n.sendRequest!="function")throw new Error("pm.execution.runRequest is not available \u2014 HTTP service not configured.");let m=typeof l=="string"?{url:l,method:"GET"}:l,y=await n.sendRequest(m),b=Array.isArray(y?.cookies)?y.cookies.filter(v=>v?.name):[],q=y?.body,x=0;if(typeof q=="string")x=Buffer.byteLength(q,"utf8");else if(Buffer.isBuffer(q))x=q.length;else if(q!=null)try{x=Buffer.byteLength(JSON.stringify(q),"utf8")}catch{}return dd({executedRequest:null,status:y?.status??0,statusText:y?.statusText??"",headers:y?.headers??{},body:q,cookies:b,responseTime:y?.time,responseSize:x})})();if(typeof c=="function"){p.then(m=>c(null,m),m=>c(m));return}return p},location:{current:n.info?.requestName||"",currentRequestName:n.info?.requestName||"",eventName:"prerequest",toString(){return n.info?.requestName||""}}},setNextRequest(l){o._nextRequest=l},visualizer:{set(l,c){o._visualizerData={template:l,data:c}},clear(){o._visualizerData=void 0}},...n,info:{...n.info||{},eventName:"prerequest",requestName:n.info?.requestName||void 0,requestId:n.info?.requestId||void 0,iteration:e.iteration||0,iterationCount:e.iterationCount||1}}}createRequestObject(e,r){let n=l=>{if(!l)return"none";switch(l){case"raw":return"raw";case"form-data":return"formdata";case"x-www-form-urlencoded":return"urlencoded";case"binary":return"file";case"graphql":return"graphql";case"none":return"none";default:return"raw"}},i=l=>{if(!l)return"none";switch(l){case"raw":return"raw";case"formdata":return"form-data";case"urlencoded":return"x-www-form-urlencoded";case"file":return"binary";case"graphql":return"graphql";case"none":return"none";default:return"raw"}},s={...e.headers,add:l=>{l&&l.key&&(e.headers[l.key]=l.value||"")},get:l=>{for(let[c,d]of Object.entries(e.headers))if(c.toLowerCase()===l.toLowerCase())return d},has:l=>{for(let c of Object.keys(e.headers))if(c.toLowerCase()===l.toLowerCase())return!0;return!1},remove:l=>{for(let c of Object.keys(e.headers))if(c.toLowerCase()===l.toLowerCase()){delete e.headers[c];break}},update:l=>{if(l&&l.key){for(let c of Object.keys(e.headers))if(c.toLowerCase()===l.key.toLowerCase()){e.headers[c]=l.value||"";return}}},upsert:l=>{if(l&&l.key){for(let c of Object.keys(e.headers))if(c.toLowerCase()===l.key.toLowerCase()){e.headers[c]=l.value||"";return}e.headers[l.key]=l.value||""}},toObject:()=>{let l={};for(let[c,d]of Object.entries(e.headers))typeof d=="string"&&(l[c]=d);return l},each:l=>{for(let[c,d]of Object.entries(e.headers))typeof d=="string"&&l({key:c,value:d})}},o={get mode(){return n(e.body?.type)},set mode(l){let c=i(l);e.body?e.body.type=c:e.body={type:c,content:null}},get raw(){let l=e.body?.content;return typeof l=="string"?l:l&&typeof l=="object"?JSON.stringify(l):""},set raw(l){e.body?(e.body.type="raw",e.body.content=l):e.body={type:"raw",content:l}},get formdata(){return e.body?.type==="form-data"&&Array.isArray(e.body.content)?e.body.content:[]},get urlencoded(){return e.body?.type==="x-www-form-urlencoded"&&Array.isArray(e.body.content)?e.body.content:[]},get graphql(){return e.body?.type==="graphql"?e.body.content:null},get file(){return e.body?.type==="binary"?e.body.content:null}};return{get url(){return $z(e.url)},set url(l){e.url=typeof l=="string"?l:String(l)},get method(){return e.method},set method(l){e.method=l},headers:s,get body(){return o},set body(l){if(l==null)e.body=null;else if(typeof l=="string")e.body={type:"raw",content:l};else if(typeof l=="object")if(l.type||l.mode||l.content!==void 0){let c=l.mode?i(l.mode):l.type||"raw";e.body={type:c,format:l.format,content:l.content}}else e.body={type:"raw",content:l}},get params(){return e.params||{}},set params(l){e.params=l||{}},get query(){return e.query||{}},set query(l){e.query=l||{}},get auth(){return r.request?.auth||null},set auth(l){r.request&&(r.request.auth=l)},get certificate(){return r.request?.certificate||null},set certificate(l){r.request&&(r.request.certificate=l)},get description(){return r.request?.description||null},set description(l){r.request&&(r.request.description=l)},get name(){return r.request?.name||null},set name(l){r.request&&(r.request.name=l)},get id(){return r.request?.id||null},get disabled(){return r.request?.disabled||!1},set disabled(l){r.request&&(r.request.disabled=l)},get messages(){return r.request?.messages||[]},get methodPath(){return r.request?.methodPath||null},get metadata(){return r.request?.metadata||[]},getHeaders(l){let c={};for(let[d,p]of Object.entries(e.headers))typeof p=="string"&&(c[d]=p);return c},addQueryParams(l){if(typeof l=="string"){let c=new URLSearchParams(l);for(let[d,p]of c)e.query||(e.query={}),e.query[d]=p}else Array.isArray(l)&&(e.query||(e.query={}),l.forEach(c=>{c.key&&(e.query[c.key]=c.value||"")}))},removeQueryParams(l){e.query&&(typeof l=="string"?delete e.query[l]:Array.isArray(l)&&l.forEach(c=>{let d=typeof c=="string"?c:c.key;d&&delete e.query[d]}))},authorizeUsing(l,c){r.request&&(typeof l=="string"?(r.request.auth||(r.request.auth={}),r.request.auth.type=l,c&&(r.request.auth.parameters=c)):typeof l=="object"&&(r.request.auth=l))},clone(){return{url:e.url,method:e.method,headers:{...e.headers},body:e.body?{...e.body}:null,params:e.params?{...e.params}:{},query:e.query?{...e.query}:{},auth:r.request?.auth,certificate:r.request?.certificate,description:r.request?.description,name:r.request?.name,id:r.request?.id,disabled:r.request?.disabled,metadata:r.request?.metadata,messages:r.request?.messages,methodPath:r.request?.methodPath}},describe(l,c){r.request&&(r.request.description={content:l,type:c||"text/plain"})},setHeader(l,c){e.headers[l]=c},addHeader(l,c){typeof l=="object"&&l!==null?e.headers[l.key]=l.value:e.headers[l]=c},removeHeader(l){delete e.headers[l]},setBody(l,c,d){e.body={type:c||e.body?.type||"raw",format:d||e.body?.format,content:l}}}}injectLegacyGlobals(e,r){let n=this.vmContext;if(!n)return;let i=this.initialContext,s=e==="test"&&r?.executedRequest?r.executedRequest:this.modifiedRequest,o={};for(let[b,q]of Object.entries(s?.headers||{}))typeof q=="string"&&(o[b]=q);let l=s?.body,c=l==null?null:typeof l=="object"&&"content"in l?l.content:l,d=i.request;if(n.request={id:d?.id??"",name:d?.name??"",description:d?.description??"",url:typeof s?.url=="string"?s.url:String(s?.url??""),method:s?.method??"GET",headers:o,data:c},n.environment=this._liveEnvironmentScope?.toObject?.()??{...this._environmentVariables},n.globals=this._liveGlobalsScope?.toObject?.()??{...this._globals},n.data={...i.iterationData||{}},typeof n.iteration!="number"&&(n.iteration=0),e!=="test"||!r)return;let p=r.body;n.responseBody=p==null?"":typeof p=="string"?p:JSON.stringify(p);let m=r.statusText||"";n.responseCode={code:r.status,name:m,detail:m},n.responseHeaders={...r.headers||{}},n.responseTime=r.responseTime??0,n.responseCookies=(r.cookies||[]).map(b=>({...b}));let y=this;n.tests=new Proxy({},{set(b,q,x){return y.assertions.push({name:String(q),passed:!!x,message:x?void 0:`"${String(q)}" was false`}),!0}})}async executePreRequest(e){let r=pd(e,this.deps.isolateScripts);if(!r||!r.trim())return{success:!0};try{this.consoleMessages.length=0,this.injectLegacyGlobals("prerequest");let n=this.ctx.variables.replaceIn(r),i=this.deps.scriptTimeoutMs??5e3,s=V0.runInContext(n,this.vmContext,{timeout:i});this.deps.isolateScripts&&s&&typeof s.then=="function"&&await s,(await this.timerRegistry.drain(i)).timedOut&&this.consoleMessages.push({level:"warn",args:[`Script timed out after ${i}ms; pending async work was cancelled.`]});let l=Ja(this.consoleMessages),c=this.initialContext.request.body,d=!this.bodiesEqual(this.modifiedRequest.body,c);return{success:!0,modifiedRequest:{url:this.modifiedRequest.url!==this.initialContext.request.url?this.modifiedRequest.url:void 0,headers:Vu(this.modifiedRequest.headers,this.initialContext.request.headers)?this.modifiedRequest.headers:void 0,body:d?this.modifiedRequest.body:void 0,params:Vu(this.modifiedRequest.params,this.initialContext.request.params||{})?this.modifiedRequest.params:void 0,query:Vu(this.modifiedRequest.query,this.initialContext.request.query||{})?this.modifiedRequest.query:void 0},modifiedVariables:this.ctx.variables.toObject(),localVariables:this.ctx.variables.toLocalObject?.()??{},modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,consoleOutput:l.length>0?l:void 0,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}catch(n){let i=[...Ja(this.consoleMessages),`[error] Script execution failed: ${n.message}`];return{success:!1,error:n.message||"Pre-request script execution failed",consoleOutput:i,modifiedVariables:this.ctx?.variables?.toObject(),localVariables:this.ctx?.variables?.toLocalObject?.()??{},modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}}async executePostResponse(e,r){let n=pd(e,this.deps.isolateScripts);if(!n||!n.trim())return{testResults:[],consoleOutput:[]};try{this.consoleMessages.length=0,this.assertions.length=0,this.ctx.info.eventName="test",this.ctx.response=dd(r),this.ctx.request=this.createRequestObject(r.executedRequest,this.initialContext),this.injectLegacyGlobals("test",r);let i=this.ctx.variables.replaceIn(n),s=this.deps.scriptTimeoutMs??5e3,o=V0.runInContext(i,this.vmContext,{timeout:s});this.deps.isolateScripts&&o&&typeof o.then=="function"&&await o,this.ctx.test._pendingTests?.length>0&&(await Promise.all(this.ctx.test._pendingTests),this.ctx.test._pendingTests.length=0),(await this.timerRegistry.drain(s)).timedOut&&this.consoleMessages.push({level:"warn",args:[`Script timed out after ${s}ms; pending async work was cancelled.`]});let c=Ja(this.consoleMessages);return{testResults:[...this.assertions],consoleOutput:c.length>0?c:void 0,modifiedVariables:this.ctx?.variables?.toObject?.(),localVariables:this.ctx?.variables?.toLocalObject?.()??{},modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}catch(i){this.assertions.push({name:"Script Execution",passed:!1,message:i.message||"Script execution failed"});let s=[...Ja(this.consoleMessages),`[error] Script execution failed: ${i.message}`];return{testResults:[...this.assertions],consoleOutput:s,modifiedVariables:this.ctx?.variables?.toObject?.(),localVariables:this.ctx?.variables?.toLocalObject?.()??{},modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}}bodiesEqual(e,r){return e===r||!e&&!r?!0:!e||!r?!1:e.type===r.type&&e.format===r.format&&JSON.stringify(e.content)===JSON.stringify(r.content)}dispose(){this.timerRegistry.clearAll(),this.vmContext=null,this.ctx=null,this.assertions=[]}}});function RP(t,e){if(t)return t.split(",").map(r=>{let n=r.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);let i=Number(n);if(!isNaN(i)&&n!=="")return i;if(e&&n in e){let s=e[n],o=Number(s);return!isNaN(o)&&s!==""?o:s}return n})}function xP(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function Mz(t,e){if(t==="@")return"";if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);let r=t.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(r){let n=RP(r[2],e),i=Vi(r[1],n);return i!==null?i:void 0}if(e[t]!==void 0)return xP(e[t]);if(go(t)){let n=mo(t,e),i=ui(t,n);if(i!==void 0)return i}}function wP(t,e,r,n){let i=Buffer.concat([Buffer.from(t,"utf8"),n||Buffer.alloc(0)]),s=[],o=Buffer.alloc(0);for(;Buffer.concat(s).length<e+r;)o=br.createHash("md5").update(Buffer.concat([o,i])).digest(),s.push(o);let l=Buffer.concat(s);return{key:l.subarray(0,e),iv:l.subarray(e,e+r)}}function z0(t,e,r){let n=i=>t==="aes"?`aes-${i*8}-cbc`:t==="des"?"des-cbc":t==="des-ede3"?"des-ede3-cbc":t;return{encrypt(i,s,o){let l=i instanceof Qe?i.toBuffer():Buffer.from(String(i),"utf8");if(typeof s=="string"){let c=br.randomBytes(8),{key:d,iv:p}=wP(s,e,r,c),m=br.createCipheriv(n(e),d,p),y=Buffer.concat([m.update(l),m.final()]),b=Buffer.concat([Buffer.from("Salted__"),c,y]);return{ciphertext:new Qe(y),salt:new Qe(c),toString:q=>q?q.stringify(new Qe(b)):b.toString("base64")}}else{let c=s.toBuffer(),d=o?.iv&&o.iv instanceof Qe?o.iv.toBuffer():Buffer.alloc(r),p=br.createCipheriv(n(c.length),c,d);o?.padding===!1&&p.setAutoPadding(!1);let m=Buffer.concat([p.update(l),p.final()]);return{ciphertext:new Qe(m),toString:y=>y?y.stringify(new Qe(m)):m.toString("base64")}}},decrypt(i,s,o){if(typeof s=="string"){let l=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext.toBuffer(),c,d;l.subarray(0,8).toString()==="Salted__"?(d=l.subarray(8,16),c=l.subarray(16)):(d=Buffer.alloc(0),c=l);let{key:p,iv:m}=wP(s,e,r,d),y=br.createDecipheriv(n(e),p,m);return new Qe(Buffer.concat([y.update(c),y.final()]))}else{let l=s.toBuffer(),c=o?.iv&&o.iv instanceof Qe?o.iv.toBuffer():Buffer.alloc(r),d=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext?i.ciphertext.toBuffer():Buffer.from(i),p=br.createDecipheriv(n(l.length),l,c);return o?.padding===!1&&p.setAutoPadding(!1),new Qe(Buffer.concat([p.update(d),p.final()]))}}}}function Fz(){let t=r=>n=>{let i=n instanceof Qe?n.toBuffer():Buffer.from(String(n),"utf8");return new Qe(br.createHash(r).update(i).digest())},e=r=>(n,i)=>{let s=n instanceof Qe?n.toBuffer():Buffer.from(String(n),"utf8"),o=i instanceof Qe?i.toBuffer():Buffer.from(String(i),"utf8");return new Qe(br.createHmac(r,o).update(s).digest())};return{MD5:t("md5"),SHA1:t("sha1"),SHA224:t("sha224"),SHA256:t("sha256"),SHA384:t("sha384"),SHA512:t("sha512"),SHA3:t("sha3-256"),RIPEMD160:t("ripemd160"),HmacMD5:e("md5"),HmacSHA1:e("sha1"),HmacSHA256:e("sha256"),HmacSHA512:e("sha512"),AES:z0("aes",32,16),DES:z0("des",8,8),TripleDES:z0("des-ede3",24,8),PBKDF2(r,n,i){let s=r instanceof Qe?r.toBuffer():Buffer.from(String(r),"utf8"),o=n instanceof Qe?n.toBuffer():Buffer.from(String(n),"utf8"),l=(i?.keySize||4)*4,c=i?.iterations||1;return new Qe(br.pbkdf2Sync(s,o,c,l,"sha1"))},enc:{Base64:{stringify:r=>(r instanceof Qe?r.toBuffer():Buffer.from(String(r))).toString("base64"),parse:r=>Qe.fromBase64(r)},Utf8:{stringify:r=>(r instanceof Qe?r.toBuffer():Buffer.from(String(r))).toString("utf8"),parse:r=>Qe.fromUtf8(r)},Hex:{stringify:r=>(r instanceof Qe?r.toBuffer():Buffer.from(String(r))).toString("hex"),parse:r=>Qe.fromHex(r)},Latin1:{stringify:r=>(r instanceof Qe?r.toBuffer():Buffer.from(String(r))).toString("latin1"),parse:r=>new Qe(Buffer.from(r,"latin1"))},Utf16:{stringify:r=>(r instanceof Qe?r.toBuffer():Buffer.from(String(r))).toString("utf16le"),parse:r=>new Qe(Buffer.from(r,"utf16le"))},Utf16BE:{stringify:r=>(r instanceof Qe?r.toBuffer():Buffer.from(String(r))).swap16().toString("utf16le"),parse:r=>new Qe(Buffer.from(r,"utf16le").swap16())}},lib:{WordArray:{create:r=>r?typeof r=="string"?new Qe(Buffer.from(r,"utf8")):Buffer.isBuffer(r)?new Qe(r):new Qe(Buffer.from(String(r))):new Qe(Buffer.alloc(0)),random:r=>new Qe(br.randomBytes(r))}},pad:{Pkcs7:{_name:"pkcs7"},NoPadding:{_name:"nopadding"},ZeroPadding:{_name:"zeropadding"}},mode:{CBC:{_name:"cbc"},ECB:{_name:"ecb"}}}}var br,Nz,_P,Qe,Ki,md=le(()=>{"use strict";br=ve(require("crypto")),Nz=ve(require("querystring")),_P=ve(require("vm"));om();Pf();um();B0();W0();Ym();Qe=class t{_buffer;constructor(e){this._buffer=typeof e=="string"?Buffer.from(e,"utf8"):e}toString(e){return e?e.stringify(this):this._buffer.toString("hex")}toBuffer(){return this._buffer}static fromHex(e){return new t(Buffer.from(e,"hex"))}static fromBase64(e){return new t(Buffer.from(e,"base64"))}static fromUtf8(e){return new t(Buffer.from(e,"utf8"))}};Ki=class t{constructor(e,r=[],n,i="shared",s=5e3){this.httpService=e;this.secretRegistry=n;this.scopeMode=i;this.scriptTimeoutMs=s;this.moduleLoader=Jm(r)}httpService;secretRegistry;scopeMode;scriptTimeoutMs;moduleLoader;createRequestSession(e){return new Wu({createVM:this.createVM.bind(this),createCommonContext:this.createCommonContext.bind(this),isolateScripts:this.scopeMode==="isolated",scriptTimeoutMs:this.scriptTimeoutMs},e)}createVM(e,r,n){let i=this.moduleLoader.getGlobalSetupExports(),s=this.moduleLoader.createRequireFunction();e.require=s,e.vault=this.createVault();let o={ctx:e,hf:e,pm:e,console:r,...i||{},global:i,setTimeout:n?.setTimeout??setTimeout,setInterval:n?.setInterval??setInterval,clearTimeout:n?.clearTimeout??clearTimeout,clearInterval:n?.clearInterval??clearInterval,URL,URLSearchParams,Buffer,atob:l=>Buffer.from(l,"base64").toString("binary"),btoa:l=>Buffer.from(l,"binary").toString("base64"),TextEncoder,TextDecoder,crypto:br,_:s("lodash"),require:s,moment:fd(),querystring:Nz,CryptoJS:Fz(),tv4:(()=>{try{return s("tv4")}catch{return}})(),postman:{setNextRequest:l=>e.setNextRequest?.(l),setGlobalVariable:(l,c)=>e.globals?.set(l,c),getGlobalVariable:l=>e.globals?.get(l),clearGlobalVariable:l=>e.globals?.unset(l),setEnvironmentVariable:(l,c)=>e.environment?.set(l,c),getEnvironmentVariable:l=>e.environment?.get(l),clearEnvironmentVariable:l=>e.environment?.unset(l),getResponseHeader:l=>{let c=e.response?.headers?.get?.(l);return c===void 0?null:c},getResponseCookie:l=>{let c=e.response?.cookies;if(c&&typeof c[Symbol.iterator]=="function"){for(let d of c)if(d?.name&&d.name.toLowerCase()===l.toLowerCase())return{...d}}return null}},jsonStringify:(l,c,d)=>JSON.stringify(l,c,d),jsonParse:l=>JSON.parse(l),xml2Json:l=>{try{let c=this.moduleLoader.createRequireFunction()("xml2js"),d;return c.parseString(l,{explicitArray:!1},(p,m)=>{if(p)throw p;d=m}),d}catch{throw new Error("xml2Json() requires the xml2js module. Add it to your modules/package.json and run npm install.")}}};return _P.createContext(o)}createCommonContext(e,r){let n={...e.variables},i={...e.collectionVariables||{}},s={...e.globals||{}},o={...e.environmentVariables||{}},l=e.iterationData||{},c=this.createMergedVariableScope(n,o,i,s,l),d=this.createGlobalsScope(s,e.onGlobalsChange),p=this.createVariableScope(i),m=this.createEnvironmentScope(o,e.environmentName,e.onEnvironmentChange,!0),y={...m,set:(x,v)=>{let _=this.serializeValue(v);m.set(x,_),n[x]=_},unset(x){m.unset(x),delete n[x]},clear(){let x=Object.keys(o);m.clear();for(let v of x)delete n[v]}},b={...d,set:(x,v)=>{let _=this.serializeValue(v);d.set(x,_),n[x]=_},unset(x){d.unset(x),delete n[x]},clear(){let x=Object.keys(s);d.clear();for(let v of x)delete n[v]}};return b.replaceIn=c.replaceIn,p.replaceIn=c.replaceIn,y.replaceIn=c.replaceIn,{globals:b,collectionVariables:p,variables:c,environment:y,iterationData:{get:x=>l[x],has:x=>x in l,toObject:()=>({...l}),toJSON:()=>JSON.stringify(l)},sendRequest:this.createSendRequest(),expect:za,info:e.info||{eventName:r,requestName:void 0,requestId:void 0}}}static JSON_TYPE_MARKER="";serializeValue(e){return typeof e=="string"?e:e===void 0?t.JSON_TYPE_MARKER+"undefined":t.JSON_TYPE_MARKER+JSON.stringify(e)}deserializeValue(e){if(e!==void 0){if(typeof e=="string"&&e.charCodeAt(0)===30){let r=e.slice(1);if(r==="undefined")return;try{return JSON.parse(r)}catch{}}return e}}createVariableScope(e){return{get:r=>this.deserializeValue(e[r]),set:(r,n)=>{e[r]=this.serializeValue(n)},has(r){return r in e},unset(r){delete e[r]},clear(){Object.keys(e).forEach(r=>delete e[r])},toObject(){return{...e}}}}createGlobalsScope(e,r){let n=(i,s,o)=>{r&&r(i,s,o)};return{get:i=>this.deserializeValue(e[i]),set:(i,s)=>{let o=this.serializeValue(s);e[i]=o,n("set",i,o)},has(i){return i in e},unset(i){delete e[i],n("unset",i)},clear(){Object.keys(e).forEach(i=>delete e[i]),n("clear")},toObject(){return{...e}}}}createMergedVariableScope(e,r,n,i,s={}){let o={get:l=>l in e?this.deserializeValue(e[l]):l in s?s[l]:l in r?this.deserializeValue(r[l]):l in n?this.deserializeValue(n[l]):this.deserializeValue(i[l]),set:(l,c)=>{e[l]=this.serializeValue(c)},has(l){return l in e||l in s||l in r||l in r||l in n||l in i},unset(l){delete e[l]},clear(){Object.keys(e).forEach(l=>delete e[l])},toObject(){return{...i,...n,...r,...s,...e}},toLocalObject(){return{...n,...r,...s,...e}},replaceIn(l){if(!l||typeof l!="string")return l;let c=o.toObject(),d=20,p=y=>y.replace(/\{\{([^}]+)\}\}/g,(b,q)=>{let x=q.trim(),v=x.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(v)try{let E=RP(v[2],c),k=Vi(v[1],E);return k!==null?String(k):b}catch{return b}let _=xu(x);if(_){let E=Mz(_.input,c);if(E!==void 0){let k=Cu(E,_.filters,c);return k!==void 0?String(k):b}return b}if(o.has(x)){let E=o.get(x);return E===void 0?"":String(E)}if(go(x)){let E={};for(let[M,j]of Object.entries(c))E[M]=xP(j);let k=mo(x,E),P=ui(x,k);if(P!==void 0)return String(P)}return b}),m=l;for(let y=0;y<d;y++){let b=p(m);if(b===m)break;m=b}return m}};return o}createEnvironmentScope(e,r,n,i){let s=(o,l,c)=>{n&&(i?n(o,l,c):n(l||"",o==="set"?c:void 0))};return{name:r||"",get:o=>this.deserializeValue(e[o]),set:(o,l)=>{let c=this.serializeValue(l);e[o]=c,s("set",o,c)},has(o){return o in e},unset(o){delete e[o],s("unset",o)},clear(){Object.keys(e).forEach(o=>delete e[o]),s("clear")},toObject(){return{...e}}}}createVault(){let e=this.secretRegistry,r=()=>{throw new Error("pm.vault is read-only in HTTP Forge. Use environment variables or {{secret:provider/path}} tokens to manage secrets.")};return{async get(n){if(!e)throw new Error('pm.vault is not available \u2014 no secret providers are configured. Configure a provider under "secrets.providers" to use pm.vault.get().');let i=`secret:${n}`;return(await e.resolveSecretTokens(`{{${i}}}`))[i]},set:r,unset:r}}createSendRequest(){return this.httpService?(e,r)=>{let n=typeof e=="string"?{url:e,method:"GET"}:e,i=this.httpService.execute({url:n.url,method:n.method||"GET",headers:n.headers||{},body:n.body,...n});if(r){i.then(s=>r(null,s)).catch(s=>r(s,null));return}return i}:(e,r)=>{let n=new Error("sendRequest not available - HTTP service not configured");if(r){r(n,null);return}return Promise.reject(n)}}}});var CP,jz,G0,Xm,J0,eg,ln,Eo,gd=le(()=>{"use strict";CP=ve(require("fs")),jz=ve(require("http")),G0=ve(require("https")),Xm=ve(require("path")),J0=require("url"),eg=ve(require("zlib")),ln={timeout:3e4,followRedirects:!0,followOriginalMethod:!1,followAuthHeader:!1,maxRedirects:10,strictSSL:!0,decompress:!0,includeCookies:!1,tls:{},certificates:[]},Eo=class{settings;version;basePath;constructor(e,r=process.cwd()){this.settings={...ln,...e},this.basePath=r;try{this.version=require("../../package.json").version||"0.0.0"}catch{this.version="0.0.0"}this.settings.strictSSL===!1&&console.log("[NodeHttpClient] SSL verification disabled (strictSSL: false)")}async send(e){let r=this.mergeSettings(e.settings);return await this.executeInternal(e,r,0)}mergeSettings(e){return{timeout:e?.timeout??this.settings.timeout,followRedirects:e?.followRedirects??this.settings.followRedirects,followOriginalMethod:e?.followOriginalMethod??this.settings.followOriginalMethod,followAuthHeader:e?.followAuthHeader??this.settings.followAuthHeader,maxRedirects:e?.maxRedirects??this.settings.maxRedirects,strictSSL:e?.strictSSL??this.settings.strictSSL,decompress:e?.decompress??this.settings.decompress,includeCookies:e?.includeCookies??this.settings.includeCookies,tls:e?.tls??this.settings.tls??{},certificates:e?.certificates??this.settings.certificates??[]}}async executeInternal(e,r,n,i){let s=Date.now(),o=new J0.URL(e.url),l=o.protocol==="https:",c=this.sanitizeHeaders(e.headers||{});Object.keys(c).some(m=>m.toLowerCase()==="user-agent")||(c["User-Agent"]=`HttpForge/${this.version}`);let p={hostname:o.hostname,port:o.port||(l?443:80),path:o.pathname+o.search,method:e.method,headers:{...c},timeout:r.timeout||void 0};if(r.decompress&&!c["accept-encoding"]&&!c["Accept-Encoding"]&&(p.headers["Accept-Encoding"]="gzip, deflate"),l){let m=this.resolveTlsSettings(o,r),y=p;y.rejectUnauthorized=r.strictSSL;let b={rejectUnauthorized:r.strictSSL},q=this.readOptionalFile(m.caPath,"CA certificate");q&&(b.ca=q);let x=this.readOptionalFile(m.certPath,"client certificate");x&&(b.cert=x);let v=this.readOptionalFile(m.keyPath,"client private key");v&&(b.key=v);let _=this.readOptionalFile(m.pfxPath,"client pfx");_&&(b.pfx=_),m.passphrase&&(b.passphrase=m.passphrase),m.servername&&(y.servername=m.servername),y.agent=new G0.Agent(b)}return new Promise((m,y)=>{if(i?.aborted){let x=new Error("Request cancelled");x.name="AbortError",y(x);return}let q=(l?G0:jz).request(p,async x=>{let v=x.statusCode||0;if(r.followRedirects&&[301,302,303,307,308].includes(v)){if(n>=r.maxRedirects){y(new Error(`Maximum redirects (${r.maxRedirects}) exceeded`));return}let E=x.headers.location;if(!E){y(new Error("Redirect response missing Location header"));return}let k=new J0.URL(E,e.url).toString(),P=e.method;!r.followOriginalMethod&&[301,302,303].includes(v)&&(P="GET");let M={...e.headers};r.followAuthHeader||(delete M.authorization,delete M.Authorization);try{let j=await this.executeInternal({...e,url:k,method:P,headers:M,body:P==="GET"?void 0:e.body},r,n+1,i),I=Date.now();j.time=I-s,m(j)}catch(j){y(j)}return}let _=[];x.on("data",E=>_.push(E)),x.on("end",()=>{let E=Date.now(),k=Buffer.concat(_),P=x.headers["content-encoding"];if(r.decompress&&P)try{P==="gzip"?k=eg.gunzipSync(k):P==="deflate"&&(k=eg.inflateSync(k))}catch(R){console.warn("[NodeHttpClient] Decompression failed:",R)}let M=k.toString("utf-8"),j={};for(let[R,A]of Object.entries(x.headers))(typeof A=="string"||Array.isArray(A))&&(j[R]=A);let I=this.parseCookies(x.headers["set-cookie"],o.hostname);m({status:x.statusCode||0,statusText:x.statusMessage||"",headers:j,cookies:I,body:M,time:E-s,size:k.length})})});if(i&&i.addEventListener("abort",()=>{q.destroy();let x=new Error("Request cancelled");x.name="AbortError",y(x)}),q.on("error",x=>{y(x)}),q.on("timeout",()=>{q.destroy(),y(new Error("Request timeout"))}),e.body!==void 0&&e.body!==null){let x=typeof e.body=="string"?e.body:JSON.stringify(e.body);q.write(x)}q.end()})}resolveTlsSettings(e,r){let n=r.tls||{};if(!!(n.caPath||n.certPath||n.keyPath||n.pfxPath||n.servername||n.passphrase))return n;let s=this.findCertificateMapping(e,r.certificates||[]);return s?{caPath:s.caPath,certPath:s.certPath,keyPath:s.keyPath,pfxPath:s.pfxPath,passphrase:s.passphrase,servername:s.servername}:n}findCertificateMapping(e,r){if(!Array.isArray(r)||r.length===0)return;let n=e.hostname,i=e.port?Number(e.port):443,s=r.find(o=>this.mappingMatchesHost(o,n,i,!0));return s||r.find(o=>this.mappingMatchesHost(o,n,i,!1))}mappingMatchesHost(e,r,n,i){if(!e||e.enabled===!1)return!1;let s=String(e.host||"").trim().toLowerCase();if(!s||e.port!=null&&Number(e.port)!==n)return!1;let o=r.toLowerCase();if(i)return s!=="*"&&!s.startsWith("*.")&&o===s;if(s==="*")return!0;if(s.startsWith("*.")){let l=s.slice(2);return o===l||o.endsWith(`.${l}`)}return o===s}readOptionalFile(e,r){if(!e)return;let n=Xm.isAbsolute(e)?e:Xm.resolve(this.basePath,e);try{return CP.readFileSync(n)}catch(i){throw new Error(`[NodeHttpClient] Failed to read ${r} file at ${n}: ${i?.message||"Unknown error"}`)}}sanitizeHeaderValue(e){return e?String(e).replace(/[\u201C\u201D\u201E\u201F\u2033\u2036]/g,'"').replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/g,"'").replace(/[\x00-\x08\x0A-\x1F\x7F]/g,""):""}sanitizeHeaders(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeHeaderValue(String(i));return r}parseCookies(e,r){return e?e.map(n=>{let i=n.split(";").map(p=>p.trim()),[s,...o]=i,[l,c]=s.split("="),d={name:l.trim(),value:c?.trim()||"",domain:r};for(let p of o){let[m,y]=p.split("=");switch(m.toLowerCase().trim()){case"domain":d.domain=y?.trim();break;case"path":d.path=y?.trim();break;case"expires":d.expires=y?.trim();break;case"httponly":d.httpOnly=!0;break;case"secure":d.secure=!0;break}}return d}):[]}}});var Y0,qo,tg=le(()=>{"use strict";Y0={json:"application/json",xml:"application/xml",html:"text/html",text:"text/plain",javascript:"application/javascript",css:"text/css","x-www-form-urlencoded":"application/x-www-form-urlencoded","form-data":"multipart/form-data",graphql:"application/json"},qo=class{sanitizeHeaderValue(e){return e?String(e).replace(/[\u201C\u201D\u201E\u201F\u2033\u2036]/g,'"').replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/g,"'").replace(/[\x00-\x08\x0A-\x1F\x7F]/g,""):""}sanitizeHeaders(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeHeaderValue(String(i));return r}encodeBody(e){if(!e||e.type==="none")return null;let{type:r,content:n}=e;switch(r){case"x-www-form-urlencoded":return this.encodeUrlEncodedBody(n);case"form-data":return n;case"graphql":return this.encodeGraphQLBody(n);case"raw":return n;default:return n}}encodeUrlEncodedBody(e){if(Array.isArray(e)){let r=new URLSearchParams;for(let n of e)n.enabled!==!1&&n.key&&r.append(n.key,n.value||"");return r.toString()}return typeof e=="string"?e:String(e)}encodeGraphQLBody(e){if(typeof e=="string")try{e=JSON.parse(e)}catch{return e}if(typeof e=="object"&&e!==null&&e.query){let r=e.variables;if(typeof r=="string")try{r=r.trim()?JSON.parse(r):void 0}catch{r=void 0}return JSON.stringify({query:e.query,...r!=null?{variables:r}:{},...e.operationName?{operationName:e.operationName}:{}})}return JSON.stringify(e)}setContentTypeHeader(e,r,n){if(Object.keys(e).some(o=>o.toLowerCase()==="content-type"))return;if(n){e["Content-Type"]=n;return}if(!r||r.type==="none")return;let s;switch(r.type){case"x-www-form-urlencoded":s=Y0["x-www-form-urlencoded"];break;case"raw":s=r.format?Y0[r.format]:"text/plain",s||(s="text/plain");break;case"graphql":s=Y0.graphql;break;case"binary":s="application/octet-stream";break}s&&(e["Content-Type"]=s)}}});var Oo,rg=le(()=>{"use strict";Oo=class{parse(e,r){return r.toLowerCase().endsWith(".json")?this.parseJson(e):this.parseCsv(e)}parseJson(e){try{let r=JSON.parse(e);return Array.isArray(r)?r:[r]}catch{throw new Error("Failed to parse JSON data file: Invalid JSON format")}}parseCsv(e){let r=e.split(/\r?\n/).filter(s=>s.trim());if(r.length<2)return[{}];let n=this.parseCsvLine(r[0]),i=[];for(let s=1;s<r.length;s++){let o=this.parseCsvLine(r[s]),l={};n.forEach((c,d)=>{l[c]=o[d]||""}),i.push(l)}return i}parseCsvLine(e){let r=[],n="",i=!1;for(let s=0;s<e.length;s++){let o=e[s],l=e[s+1];o==='"'?i&&l==='"'?(n+='"',s++):i=!i:o===","&&!i?(r.push(n.trim()),n=""):n+=o}return r.push(n.trim()),r}}});var Ku,Lz,Qu,K0=le(()=>{"use strict";Ku=ve(require("crypto")),Lz=3e4,Qu=class{constructor(e,r,n,i,s="henry-huang.http-forge/oauth2/callback"){this.secretStore=e;this.browserService=r;this.envConfigService=n;this.httpService=i;this.callbackPath=s}secretStore;browserService;envConfigService;httpService;callbackPath;tokenCache=new Map;pendingAuthCallback=null;pendingImplicitCallback=null;async getToken(e,r){if(e.accessToken)return{accessToken:this.resolve(e.accessToken,r),tokenType:e.tokenPrefix||"Bearer",raw:{}};let n=this.buildCacheKeyString(e),i=this.tokenCache.get(n);if(i&&!this.isExpired(i))return i;if(i?.refreshToken)try{return await this.refreshToken(e,i.refreshToken,r)}catch{this.tokenCache.delete(n)}if(!i){let o=await this.secretStore.get(`oauth2_refresh_${n}`);if(o)try{return await this.refreshToken(e,o,r)}catch{await this.secretStore.delete(`oauth2_refresh_${n}`)}}let s;switch(e.grantType){case"client_credentials":s=await this.fetchToken(e,r,"client_credentials");break;case"password":s=await this.fetchToken(e,r,"password");break;case"authorization_code":s=await this.authorizationCodeFlow(e,r);break;case"implicit":s=await this.implicitFlow(e,r);break;default:throw new Error(`Unknown OAuth2 grant type: ${e.grantType}`)}return this.tokenCache.set(n,s),s.refreshToken&&await this.storeRefreshToken(n,s.refreshToken),s}async refreshToken(e,r,n){let i=this.resolve(e.tokenUrl||"",n);if(!i)throw new Error("OAuth2 tokenUrl is required for token refresh");let s=this.resolve(e.clientId||"",n),o=this.resolve(e.clientSecret||"",n),l=new URLSearchParams;l.append("grant_type","refresh_token"),l.append("refresh_token",r);let c={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,c,l,s,o,n);let d=await this.httpService.execute({method:"POST",url:i,headers:c,body:l.toString()}),p=this.parseTokenResponse(d.body,e);p.refreshToken||(p.refreshToken=r);let m=this.buildCacheKeyString(e);return this.tokenCache.set(m,p),p.refreshToken&&await this.storeRefreshToken(m,p.refreshToken),p}async authorizationCodeFlow(e,r){let n=this.resolve(e.authUrl||"",r),i=this.resolve(e.tokenUrl||"",r),s=this.resolve(e.clientId||"",r),o=this.resolve(e.clientSecret||"",r),l=e.scope?this.resolve(e.scope,r):void 0;if(!n)throw new Error("OAuth2 authUrl is required for authorization code flow");if(!i)throw new Error("OAuth2 tokenUrl is required for authorization code flow");if(!s)throw new Error("OAuth2 clientId is required for authorization code flow");let c=e.usePkce!==!1,d,p,m;if(c){d=this.generateCodeVerifier();let j=e.pkceMethod||"S256";p=j==="S256"?this.generateCodeChallengeS256(d):d,m=j}let y=e.state||Ku.randomBytes(16).toString("hex"),b=await this.getCallbackUri(),q=new URL(n);if(q.searchParams.set("response_type","code"),q.searchParams.set("client_id",s),q.searchParams.set("redirect_uri",b),l&&q.searchParams.set("scope",l),q.searchParams.set("state",y),p&&(q.searchParams.set("code_challenge",p),q.searchParams.set("code_challenge_method",m)),e.audience&&q.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&q.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[j,I]of Object.entries(e.extraParams))q.searchParams.set(j,this.resolve(I,r));this.pendingAuthCallback&&(this.pendingAuthCallback.reject(new Error("OAuth2 authorization superseded by a new request")),this.pendingAuthCallback=null);let x=new Promise((j,I)=>{this.pendingAuthCallback={resolve:j,reject:I,state:y}});await this.browserService.openExternal(q.toString());let v;try{v=await Promise.race([x,new Promise((j,I)=>setTimeout(()=>{this.pendingAuthCallback=null,I(new Error("OAuth2 authorization timed out after 2 minutes"))},12e4))])}finally{this.pendingAuthCallback=null}if(v.state&&v.state!==y)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let _=new URLSearchParams;_.append("grant_type","authorization_code"),_.append("code",v.code),_.append("redirect_uri",b),d&&_.append("code_verifier",d);let E={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,E,_,s,o,r);let k=await this.httpService.execute({method:"POST",url:i,headers:E,body:_.toString()}),P=this.parseTokenResponse(k.body,e),M=this.buildCacheKeyString(e);return this.tokenCache.set(M,P),P.refreshToken&&await this.storeRefreshToken(M,P.refreshToken),P}async implicitFlow(e,r){let n=this.resolve(e.authUrl||"",r),i=this.resolve(e.clientId||"",r),s=e.scope?this.resolve(e.scope,r):void 0;if(!n)throw new Error("OAuth2 authUrl is required for implicit flow");if(!i)throw new Error("OAuth2 clientId is required for implicit flow");let o=e.state||Ku.randomBytes(16).toString("hex"),l=await this.getCallbackUri(),c=new URL(n);if(c.searchParams.set("response_type","token"),c.searchParams.set("client_id",i),c.searchParams.set("redirect_uri",l),s&&c.searchParams.set("scope",s),c.searchParams.set("state",o),e.audience&&c.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&c.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[b,q]of Object.entries(e.extraParams))c.searchParams.set(b,this.resolve(q,r));this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow superseded by a new request")),this.pendingImplicitCallback=null);let d=new Promise((b,q)=>{this.pendingImplicitCallback={resolve:b,reject:q,state:o}});await this.browserService.openExternal(c.toString());let p;try{p=await Promise.race([d,new Promise((b,q)=>setTimeout(()=>{this.pendingImplicitCallback=null,q(new Error("OAuth2 implicit flow timed out after 2 minutes"))},12e4))])}finally{this.pendingImplicitCallback=null}if(p.state&&p.state!==o)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let m={accessToken:p.accessToken,tokenType:p.tokenType||e.tokenPrefix||"Bearer",expiresAt:p.expiresIn?Date.now()+p.expiresIn*1e3:void 0,raw:{access_token:p.accessToken,token_type:p.tokenType,expires_in:p.expiresIn}},y=this.buildCacheKeyString(e);return this.tokenCache.set(y,m),m}handleAuthorizationCallback(e,r,n){if(n){let i=new Error(`OAuth2 authorization error: ${n}`);this.pendingAuthCallback?.reject(i),this.pendingImplicitCallback?.reject(i),this.pendingAuthCallback=null,this.pendingImplicitCallback=null;return}if(e&&this.pendingAuthCallback){this.pendingAuthCallback.resolve({code:e,state:r}),this.pendingAuthCallback=null;return}!e&&!this.pendingAuthCallback&&this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow did not receive access_token")),this.pendingImplicitCallback=null)}handleImplicitCallback(e,r,n,i){this.pendingImplicitCallback&&(this.pendingImplicitCallback.resolve({accessToken:e,tokenType:r,expiresIn:n,state:i}),this.pendingImplicitCallback=null)}clearToken(e){let r=`${e.tokenUrl}|${e.clientId}|${e.scope||""}|${e.grantType}`;this.tokenCache.delete(r),this.secretStore.delete(`oauth2_refresh_${r}`)}clearAllTokens(){for(let e of this.tokenCache.keys())this.secretStore.delete(`oauth2_refresh_${e}`);this.tokenCache.clear()}async fetchToken(e,r,n){let i=this.resolve(e.tokenUrl||"",r);if(!i)throw new Error("OAuth2 tokenUrl is required");let s=this.resolve(e.clientId||"",r),o=this.resolve(e.clientSecret||"",r),l=e.scope?this.resolve(e.scope,r):void 0,c=new URLSearchParams;if(c.append("grant_type",n),l&&c.append("scope",l),n==="password"){let m=this.resolve(e.username||"",r),y=this.resolve(e.password||"",r);if(!m)throw new Error("OAuth2 password grant requires username");c.append("username",m),c.append("password",y)}if(e.audience&&c.append("audience",this.resolve(e.audience,r)),e.resource&&c.append("resource",this.resolve(e.resource,r)),e.extraParams)for(let[m,y]of Object.entries(e.extraParams))c.append(m,this.resolve(y,r));let d={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,d,c,s,o,r);let p=await this.httpService.execute({method:"POST",url:i,headers:d,body:c.toString()});return this.parseTokenResponse(p.body,e)}applyClientAuth(e,r,n,i,s,o){if(e.clientAuthentication==="header"){let l=Buffer.from(`${i}:${s}`).toString("base64");r.Authorization=`Basic ${l}`}else i&&n.set("client_id",i),s&&n.set("client_secret",s)}parseTokenResponse(e,r){let n=e;if(typeof n=="string")try{n=JSON.parse(n)}catch{throw new Error("OAuth2 token response is not valid JSON")}if(!n||typeof n!="object")throw new Error("OAuth2 token response is not a valid JSON object");let i=n,s=r.tokenField||"access_token",o=i[s];if(!o)throw new Error(`OAuth2 token fetch failed: '${s}' not present in response`);let l=typeof i.expires_in=="number"?i.expires_in:void 0;return{accessToken:o,tokenType:i.token_type||r.tokenPrefix||"Bearer",expiresAt:l?Date.now()+l*1e3:void 0,refreshToken:i.refresh_token,scope:i.scope,raw:i}}isExpired(e){return e.expiresAt?Date.now()>=e.expiresAt-Lz:!1}buildCacheKeyString(e){return`${e.tokenUrl||""}|${e.clientId||""}|${e.scope||""}|${e.grantType}`}async getCallbackUri(){let e=`${this.browserService.uriScheme}://${this.callbackPath}`;return this.browserService.asExternalUri(e)}resolve(e,r){return this.envConfigService.resolveVariables(e,r)}generateCodeVerifier(){return Ku.randomBytes(32).toString("base64url")}generateCodeChallengeS256(e){return Ku.createHash("sha256").update(e).digest("base64url")}async storeRefreshToken(e,r){try{await this.secretStore.store(`oauth2_refresh_${e}`,r)}catch{}}}});function Ka(t,e={}){let r=[];Object.entries(e).forEach(([n,i])=>{r.push(`${n}=${i}`)}),r.length&&Ya.writeFileSync(t,r.join(`
|
|
52
|
+
`)}function Vu(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function Ja(t){return t.map(e=>{let r=e.args.map(n=>{if(typeof n=="object")try{return JSON.stringify(n,null,2)}catch{return String(n)}return String(n)}).join(" ");return`[${e.level}] ${r}`})}function SP(t){return{log:(...e)=>t.push({level:"log",args:e}),info:(...e)=>t.push({level:"info",args:e}),warn:(...e)=>t.push({level:"warn",args:e}),error:(...e)=>t.push({level:"error",args:e})}}function Km(t){let e=[],r=(n,i)=>{try{let s=i();if(s&&typeof s.then=="function"){let o=s.then(()=>{t.push({name:n,passed:!0})},l=>{t.push({name:n,passed:!1,message:l.message||String(l)})});e.push(o)}else t.push({name:n,passed:!0})}catch(s){t.push({name:n,passed:!1,message:s.message})}};return r.skip=(n,i)=>{t.push({name:n,passed:!0,skipped:!0})},r.fail=n=>{t.push({name:n||"Failed test",passed:!1,message:n||"pm.test.fail()"})},r.index=()=>t.length,r._pendingTests=e,r}function Qm(t){let e={};for(let[r,n]of Object.entries(t))e[r]=Array.isArray(n)?n.join(", "):n;return e}function Zm(t,e,r){let n;if(r)try{n=new URL(r).hostname}catch{n=void 0}let i=_t.parseCookieHeaders(t||{},n);return i.length>0?i:Array.isArray(e)&&e.length>0?e.filter(s=>s&&s.name).map(s=>({name:s.name,value:s.value,domain:s.domain??n,path:s.path,expires:s.expires,maxAge:s.maxAge,httpOnly:s.httpOnly,secure:s.secure,sameSite:s.sameSite})):[]}var hd=le(()=>{"use strict";ka()});function $z(t){let e=null;try{e=new URL(t)}catch{}return{toString(){return t},valueOf(){return t},[Symbol.toPrimitive](n){return n==="number"?NaN:t},getHost(){return e?e.hostname:""},getPath(){return e?e.pathname:t},getPathWithQuery(){return e?e.pathname+e.search:t},getQueryString(){return e?e.search.startsWith("?")?e.search.slice(1):e.search:""},getRemote(){if(!e)return"";let n=e.port||(e.protocol==="https:"?"443":"80");return`${e.hostname}:${n}`},getOAuth1BaseUrl(){return e?`${e.protocol}//${e.host}${e.pathname}`:t},get protocol(){return e?.protocol?.replace(":","")||""},get host(){return e?e.hostname.split("."):[]},get port(){return e?.port||""},get path(){return e?e.pathname.split("/").filter(Boolean):[]},get hash(){return e?.hash?.replace("#","")||""},query:{toObject(){if(!e)return{};let n={};return e.searchParams.forEach((i,s)=>{n[s]=i}),n},has(n){return e?e.searchParams.has(n):!1},get(n){return e?e.searchParams.get(n):void 0},each(n){e&&e.searchParams.forEach((i,s)=>n({key:s,value:i}))}}}}var V0,Wu,W0=le(()=>{"use strict";V0=ve(require("vm"));vP();Ym();hd();Wu=class{constructor(e,r){this.deps=e;this.initialContext=r;this.timerRegistry=yP(n=>{let i=n instanceof Error?n.message:String(n);this.consoleMessages.push({level:"error",args:[`Uncaught error in async callback: ${i}`]})}),this.initializeSession()}deps;initialContext;vmContext=null;ctx=null;modifiedRequest=null;assertions=[];consoleMessages=[];_variables={};_collectionVariables={};_globals={};_environmentVariables={};_liveEnvironmentScope=null;_liveGlobalsScope=null;_liveCollectionScope=null;_nextRequest=void 0;_skipRequest=!1;_visualizerData=void 0;timerRegistry;initializeSession(){this.modifiedRequest={url:this.initialContext.request.url,method:this.initialContext.request.method,headers:{...this.initialContext.request.headers},body:this.initialContext.request.body?{...this.initialContext.request.body}:null,params:this.initialContext.request.params?{...this.initialContext.request.params}:{},query:this.initialContext.request.query?{...this.initialContext.request.query}:{}},this.assertions=[],this.ctx=this.createSharedContext(),this.consoleMessages=[];let e=this,r={log:(...n)=>{e.consoleMessages.push({level:"log",args:n})},info:(...n)=>{e.consoleMessages.push({level:"info",args:n})},warn:(...n)=>{e.consoleMessages.push({level:"warn",args:n})},error:(...n)=>{e.consoleMessages.push({level:"error",args:n})}};this.vmContext=this.deps.createVM(this.ctx,r,this.timerRegistry.timers)}createSharedContext(){let e=this.initialContext,r=this.modifiedRequest,n=this.deps.createCommonContext(e,"prerequest");this._variables={...e.variables},this._collectionVariables={...e.collectionVariables||{}},this._globals={...e.globals||{}},this._environmentVariables={...e.environmentVariables||{}},this._liveEnvironmentScope=n.environment,this._liveGlobalsScope=n.globals,this._liveCollectionScope=n.collectionVariables;let i;try{i=new URL(e.request.url).hostname}catch{}let s={get:l=>e.cookieJar?e.cookieJar.get(l,i)?.value:void 0,set:(l,c)=>{e.cookieJar&&e.cookieJar.set({name:l,value:c,domain:i})},has:l=>e.cookieJar?e.cookieJar.has(l,i):!1,list:()=>e.cookieJar?e.cookieJar.getAll(i).map(l=>({name:l.name,value:l.value})):[],toObject:()=>{if(!e.cookieJar)return{};let l=e.cookieJar.getAll(i),c={};for(let d of l)c[d.name]=d.value;return c},jar:()=>{let l=e.cookieJar,c=d=>{if(d==null)return;let p=typeof d=="string"?d:typeof d=="object"||typeof d=="number"||typeof d=="boolean"?String(d):void 0;if(!p)return;let m=p.trim();if(m)try{return new URL(m).hostname}catch{return m}};return{getAll(d,p){try{if(!l){p(null,[]);return}let m=c(d),y=l.getAll(m).map(b=>({name:b.name,value:b.value,domain:b.domain,path:b.path,httpOnly:b.httpOnly,secure:b.secure}));p(null,y)}catch(m){p(m,[])}},get(d,p,m){try{if(!l){m(null,void 0);return}let y=c(d),b=l.get(p,y);m(null,b?{name:b.name,value:b.value,domain:b.domain}:void 0)}catch(y){m(y,void 0)}},set(d,p,m,y){try{if(!l){(y||m)?.(null);return}let b=c(d);typeof p=="string"&&typeof m=="string"?(l.set({name:p,value:m,domain:b}),y?.(null)):typeof p=="object"&&(l.set({...p,domain:b}),m?.(null))}catch(b){(y||m)?.(b)}},unset(d,p,m){try{if(!l){m?.(null);return}let y=c(d);l.delete(p,y),m?.(null)}catch(y){m?.(y)}},clear(d,p){try{let m=typeof d=="function"?d:p;if(!l){m?.(null);return}let y=typeof d=="function"?void 0:c(d);y&&typeof l.clearDomain=="function"?l.clearDomain(y):l.clear(),m?.(null)}catch(m){(typeof d=="function"?d:p)?.(m)}}}},remove:l=>{e.cookieJar&&e.cookieJar.delete(l,i)},unset:l=>{e.cookieJar&&e.cookieJar.delete(l,i)},clear:()=>{e.cookieJar&&e.cookieJar.clear()}},o=this;return{request:this.createRequestObject(r,e),response:null,test:Km(this.assertions),expect:za,cookies:s,execution:{setNextRequest(l){o._nextRequest=l},skipRequest(){o._skipRequest=!0},runRequest(l,c){let p=(async()=>{if(typeof n.sendRequest!="function")throw new Error("pm.execution.runRequest is not available \u2014 HTTP service not configured.");let m=typeof l=="string"?{url:l,method:"GET"}:l,y=await n.sendRequest(m),b=Array.isArray(y?.cookies)?y.cookies.filter(v=>v?.name):[],q=y?.body,x=0;if(typeof q=="string")x=Buffer.byteLength(q,"utf8");else if(Buffer.isBuffer(q))x=q.length;else if(q!=null)try{x=Buffer.byteLength(JSON.stringify(q),"utf8")}catch{}return dd({executedRequest:null,status:y?.status??0,statusText:y?.statusText??"",headers:y?.headers??{},body:q,cookies:b,responseTime:y?.time,responseSize:x})})();if(typeof c=="function"){p.then(m=>c(null,m),m=>c(m));return}return p},location:{current:n.info?.requestName||"",currentRequestName:n.info?.requestName||"",eventName:"prerequest",toString(){return n.info?.requestName||""}}},setNextRequest(l){o._nextRequest=l},visualizer:{set(l,c){o._visualizerData={template:l,data:c}},clear(){o._visualizerData=void 0}},...n,info:{...n.info||{},eventName:"prerequest",requestName:n.info?.requestName||void 0,requestId:n.info?.requestId||void 0,iteration:e.iteration||0,iterationCount:e.iterationCount||1}}}createRequestObject(e,r){let n=l=>{if(!l)return"none";switch(l){case"raw":return"raw";case"form-data":return"formdata";case"x-www-form-urlencoded":return"urlencoded";case"binary":return"file";case"graphql":return"graphql";case"none":return"none";default:return"raw"}},i=l=>{if(!l)return"none";switch(l){case"raw":return"raw";case"formdata":return"form-data";case"urlencoded":return"x-www-form-urlencoded";case"file":return"binary";case"graphql":return"graphql";case"none":return"none";default:return"raw"}},s={...e.headers,add:l=>{l&&l.key&&(e.headers[l.key]=l.value||"")},get:l=>{for(let[c,d]of Object.entries(e.headers))if(c.toLowerCase()===l.toLowerCase())return d},has:l=>{for(let c of Object.keys(e.headers))if(c.toLowerCase()===l.toLowerCase())return!0;return!1},remove:l=>{for(let c of Object.keys(e.headers))if(c.toLowerCase()===l.toLowerCase()){delete e.headers[c];break}},update:l=>{if(l&&l.key){for(let c of Object.keys(e.headers))if(c.toLowerCase()===l.key.toLowerCase()){e.headers[c]=l.value||"";return}}},upsert:l=>{if(l&&l.key){for(let c of Object.keys(e.headers))if(c.toLowerCase()===l.key.toLowerCase()){e.headers[c]=l.value||"";return}e.headers[l.key]=l.value||""}},toObject:()=>{let l={};for(let[c,d]of Object.entries(e.headers))typeof d=="string"&&(l[c]=d);return l},each:l=>{for(let[c,d]of Object.entries(e.headers))typeof d=="string"&&l({key:c,value:d})}},o={get mode(){return n(e.body?.type)},set mode(l){let c=i(l);e.body?e.body.type=c:e.body={type:c,content:null}},get raw(){let l=e.body?.content;return typeof l=="string"?l:l&&typeof l=="object"?JSON.stringify(l):""},set raw(l){e.body?(e.body.type="raw",e.body.content=l):e.body={type:"raw",content:l}},get formdata(){return e.body?.type==="form-data"&&Array.isArray(e.body.content)?e.body.content:[]},get urlencoded(){return e.body?.type==="x-www-form-urlencoded"&&Array.isArray(e.body.content)?e.body.content:[]},get graphql(){return e.body?.type==="graphql"?e.body.content:null},get file(){return e.body?.type==="binary"?e.body.content:null}};return{get url(){return $z(e.url)},set url(l){e.url=typeof l=="string"?l:String(l)},get method(){return e.method},set method(l){e.method=l},headers:s,get body(){return o},set body(l){if(l==null)e.body=null;else if(typeof l=="string")e.body={type:"raw",content:l};else if(typeof l=="object")if(l.type||l.mode||l.content!==void 0){let c=l.mode?i(l.mode):l.type||"raw";e.body={type:c,format:l.format,content:l.content}}else e.body={type:"raw",content:l}},get params(){return e.params||{}},set params(l){e.params=l||{}},get query(){return e.query||{}},set query(l){e.query=l||{}},get auth(){return r.request?.auth||null},set auth(l){r.request&&(r.request.auth=l)},get certificate(){return r.request?.certificate||null},set certificate(l){r.request&&(r.request.certificate=l)},get description(){return r.request?.description||null},set description(l){r.request&&(r.request.description=l)},get name(){return r.request?.name||null},set name(l){r.request&&(r.request.name=l)},get id(){return r.request?.id||null},get disabled(){return r.request?.disabled||!1},set disabled(l){r.request&&(r.request.disabled=l)},get messages(){return r.request?.messages||[]},get methodPath(){return r.request?.methodPath||null},get metadata(){return r.request?.metadata||[]},getHeaders(l){let c={};for(let[d,p]of Object.entries(e.headers))typeof p=="string"&&(c[d]=p);return c},addQueryParams(l){if(typeof l=="string"){let c=new URLSearchParams(l);for(let[d,p]of c)e.query||(e.query={}),e.query[d]=p}else Array.isArray(l)&&(e.query||(e.query={}),l.forEach(c=>{c.key&&(e.query[c.key]=c.value||"")}))},removeQueryParams(l){e.query&&(typeof l=="string"?delete e.query[l]:Array.isArray(l)&&l.forEach(c=>{let d=typeof c=="string"?c:c.key;d&&delete e.query[d]}))},authorizeUsing(l,c){r.request&&(typeof l=="string"?(r.request.auth||(r.request.auth={}),r.request.auth.type=l,c&&(r.request.auth.parameters=c)):typeof l=="object"&&(r.request.auth=l))},clone(){return{url:e.url,method:e.method,headers:{...e.headers},body:e.body?{...e.body}:null,params:e.params?{...e.params}:{},query:e.query?{...e.query}:{},auth:r.request?.auth,certificate:r.request?.certificate,description:r.request?.description,name:r.request?.name,id:r.request?.id,disabled:r.request?.disabled,metadata:r.request?.metadata,messages:r.request?.messages,methodPath:r.request?.methodPath}},describe(l,c){r.request&&(r.request.description={content:l,type:c||"text/plain"})},setHeader(l,c){e.headers[l]=c},addHeader(l,c){typeof l=="object"&&l!==null?e.headers[l.key]=l.value:e.headers[l]=c},removeHeader(l){delete e.headers[l]},setBody(l,c,d){e.body={type:c||e.body?.type||"raw",format:d||e.body?.format,content:l}}}}injectLegacyGlobals(e,r){let n=this.vmContext;if(!n)return;let i=this.initialContext,s=e==="test"&&r?.executedRequest?r.executedRequest:this.modifiedRequest,o={};for(let[b,q]of Object.entries(s?.headers||{}))typeof q=="string"&&(o[b]=q);let l=s?.body,c=l==null?null:typeof l=="object"&&"content"in l?l.content:l,d=i.request;if(n.request={id:d?.id??"",name:d?.name??"",description:d?.description??"",url:typeof s?.url=="string"?s.url:String(s?.url??""),method:s?.method??"GET",headers:o,data:c},n.environment=this._liveEnvironmentScope?.toObject?.()??{...this._environmentVariables},n.globals=this._liveGlobalsScope?.toObject?.()??{...this._globals},n.data={...i.iterationData||{}},typeof n.iteration!="number"&&(n.iteration=0),e!=="test"||!r)return;let p=r.body;n.responseBody=p==null?"":typeof p=="string"?p:JSON.stringify(p);let m=r.statusText||"";n.responseCode={code:r.status,name:m,detail:m},n.responseHeaders={...r.headers||{}},n.responseTime=r.responseTime??0,n.responseCookies=(r.cookies||[]).map(b=>({...b}));let y=this;n.tests=new Proxy({},{set(b,q,x){return y.assertions.push({name:String(q),passed:!!x,message:x?void 0:`"${String(q)}" was false`}),!0}})}async executePreRequest(e){let r=pd(e,this.deps.isolateScripts);if(!r||!r.trim())return{success:!0};try{this.consoleMessages.length=0,this.injectLegacyGlobals("prerequest");let n=this.ctx.variables.replaceIn(r),i=this.deps.scriptTimeoutMs??5e3,s=V0.runInContext(n,this.vmContext,{timeout:i});this.deps.isolateScripts&&s&&typeof s.then=="function"&&await s,(await this.timerRegistry.drain(i)).timedOut&&this.consoleMessages.push({level:"warn",args:[`Script timed out after ${i}ms; pending async work was cancelled.`]});let l=Ja(this.consoleMessages),c=this.initialContext.request.body,d=!this.bodiesEqual(this.modifiedRequest.body,c);return{success:!0,modifiedRequest:{url:this.modifiedRequest.url!==this.initialContext.request.url?this.modifiedRequest.url:void 0,headers:Vu(this.modifiedRequest.headers,this.initialContext.request.headers)?this.modifiedRequest.headers:void 0,body:d?this.modifiedRequest.body:void 0,params:Vu(this.modifiedRequest.params,this.initialContext.request.params||{})?this.modifiedRequest.params:void 0,query:Vu(this.modifiedRequest.query,this.initialContext.request.query||{})?this.modifiedRequest.query:void 0},modifiedVariables:this.ctx.variables.toObject(),localVariables:this.ctx.variables.toLocalObject?.()??{},modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,consoleOutput:l.length>0?l:void 0,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}catch(n){let i=[...Ja(this.consoleMessages),`[error] Script execution failed: ${n.message}`];return{success:!1,error:n.message||"Pre-request script execution failed",consoleOutput:i,modifiedVariables:this.ctx?.variables?.toObject(),localVariables:this.ctx?.variables?.toLocalObject?.()??{},modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}}async executePostResponse(e,r){let n=pd(e,this.deps.isolateScripts);if(!n||!n.trim())return{testResults:[],consoleOutput:[]};try{this.consoleMessages.length=0,this.assertions.length=0,this.ctx.info.eventName="test",this.ctx.response=dd(r),this.ctx.request=this.createRequestObject(r.executedRequest,this.initialContext),this.injectLegacyGlobals("test",r);let i=this.ctx.variables.replaceIn(n),s=this.deps.scriptTimeoutMs??5e3,o=V0.runInContext(i,this.vmContext,{timeout:s});this.deps.isolateScripts&&o&&typeof o.then=="function"&&await o,this.ctx.test._pendingTests?.length>0&&(await Promise.all(this.ctx.test._pendingTests),this.ctx.test._pendingTests.length=0),(await this.timerRegistry.drain(s)).timedOut&&this.consoleMessages.push({level:"warn",args:[`Script timed out after ${s}ms; pending async work was cancelled.`]});let c=Ja(this.consoleMessages);return{testResults:[...this.assertions],consoleOutput:c.length>0?c:void 0,modifiedVariables:this.ctx?.variables?.toObject?.(),localVariables:this.ctx?.variables?.toLocalObject?.()??{},modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}catch(i){this.assertions.push({name:"Script Execution",passed:!1,message:i.message||"Script execution failed"});let s=[...Ja(this.consoleMessages),`[error] Script execution failed: ${i.message}`];return{testResults:[...this.assertions],consoleOutput:s,modifiedVariables:this.ctx?.variables?.toObject?.(),localVariables:this.ctx?.variables?.toLocalObject?.()??{},modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}}bodiesEqual(e,r){return e===r||!e&&!r?!0:!e||!r?!1:e.type===r.type&&e.format===r.format&&JSON.stringify(e.content)===JSON.stringify(r.content)}dispose(){this.timerRegistry.clearAll(),this.vmContext=null,this.ctx=null,this.assertions=[]}}});function RP(t,e){if(t)return t.split(",").map(r=>{let n=r.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);let i=Number(n);if(!isNaN(i)&&n!=="")return i;if(e&&n in e){let s=e[n],o=Number(s);return!isNaN(o)&&s!==""?o:s}return n})}function xP(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function Mz(t,e){if(t==="@")return"";if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);let r=t.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(r){let n=RP(r[2],e),i=Vi(r[1],n);return i!==null?i:void 0}if(e[t]!==void 0)return xP(e[t]);if(go(t)){let n=mo(t,e),i=ui(t,n);if(i!==void 0)return i}}function wP(t,e,r,n){let i=Buffer.concat([Buffer.from(t,"utf8"),n||Buffer.alloc(0)]),s=[],o=Buffer.alloc(0);for(;Buffer.concat(s).length<e+r;)o=br.createHash("md5").update(Buffer.concat([o,i])).digest(),s.push(o);let l=Buffer.concat(s);return{key:l.subarray(0,e),iv:l.subarray(e,e+r)}}function z0(t,e,r){let n=i=>t==="aes"?`aes-${i*8}-cbc`:t==="des"?"des-cbc":t==="des-ede3"?"des-ede3-cbc":t;return{encrypt(i,s,o){let l=i instanceof Qe?i.toBuffer():Buffer.from(String(i),"utf8");if(typeof s=="string"){let c=br.randomBytes(8),{key:d,iv:p}=wP(s,e,r,c),m=br.createCipheriv(n(e),d,p),y=Buffer.concat([m.update(l),m.final()]),b=Buffer.concat([Buffer.from("Salted__"),c,y]);return{ciphertext:new Qe(y),salt:new Qe(c),toString:q=>q?q.stringify(new Qe(b)):b.toString("base64")}}else{let c=s.toBuffer(),d=o?.iv&&o.iv instanceof Qe?o.iv.toBuffer():Buffer.alloc(r),p=br.createCipheriv(n(c.length),c,d);o?.padding===!1&&p.setAutoPadding(!1);let m=Buffer.concat([p.update(l),p.final()]);return{ciphertext:new Qe(m),toString:y=>y?y.stringify(new Qe(m)):m.toString("base64")}}},decrypt(i,s,o){if(typeof s=="string"){let l=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext.toBuffer(),c,d;l.subarray(0,8).toString()==="Salted__"?(d=l.subarray(8,16),c=l.subarray(16)):(d=Buffer.alloc(0),c=l);let{key:p,iv:m}=wP(s,e,r,d),y=br.createDecipheriv(n(e),p,m);return new Qe(Buffer.concat([y.update(c),y.final()]))}else{let l=s.toBuffer(),c=o?.iv&&o.iv instanceof Qe?o.iv.toBuffer():Buffer.alloc(r),d=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext?i.ciphertext.toBuffer():Buffer.from(i),p=br.createDecipheriv(n(l.length),l,c);return o?.padding===!1&&p.setAutoPadding(!1),new Qe(Buffer.concat([p.update(d),p.final()]))}}}}function Fz(){let t=r=>n=>{let i=n instanceof Qe?n.toBuffer():Buffer.from(String(n),"utf8");return new Qe(br.createHash(r).update(i).digest())},e=r=>(n,i)=>{let s=n instanceof Qe?n.toBuffer():Buffer.from(String(n),"utf8"),o=i instanceof Qe?i.toBuffer():Buffer.from(String(i),"utf8");return new Qe(br.createHmac(r,o).update(s).digest())};return{MD5:t("md5"),SHA1:t("sha1"),SHA224:t("sha224"),SHA256:t("sha256"),SHA384:t("sha384"),SHA512:t("sha512"),SHA3:t("sha3-256"),RIPEMD160:t("ripemd160"),HmacMD5:e("md5"),HmacSHA1:e("sha1"),HmacSHA256:e("sha256"),HmacSHA512:e("sha512"),AES:z0("aes",32,16),DES:z0("des",8,8),TripleDES:z0("des-ede3",24,8),PBKDF2(r,n,i){let s=r instanceof Qe?r.toBuffer():Buffer.from(String(r),"utf8"),o=n instanceof Qe?n.toBuffer():Buffer.from(String(n),"utf8"),l=(i?.keySize||4)*4,c=i?.iterations||1;return new Qe(br.pbkdf2Sync(s,o,c,l,"sha1"))},enc:{Base64:{stringify:r=>(r instanceof Qe?r.toBuffer():Buffer.from(String(r))).toString("base64"),parse:r=>Qe.fromBase64(r)},Utf8:{stringify:r=>(r instanceof Qe?r.toBuffer():Buffer.from(String(r))).toString("utf8"),parse:r=>Qe.fromUtf8(r)},Hex:{stringify:r=>(r instanceof Qe?r.toBuffer():Buffer.from(String(r))).toString("hex"),parse:r=>Qe.fromHex(r)},Latin1:{stringify:r=>(r instanceof Qe?r.toBuffer():Buffer.from(String(r))).toString("latin1"),parse:r=>new Qe(Buffer.from(r,"latin1"))},Utf16:{stringify:r=>(r instanceof Qe?r.toBuffer():Buffer.from(String(r))).toString("utf16le"),parse:r=>new Qe(Buffer.from(r,"utf16le"))},Utf16BE:{stringify:r=>(r instanceof Qe?r.toBuffer():Buffer.from(String(r))).swap16().toString("utf16le"),parse:r=>new Qe(Buffer.from(r,"utf16le").swap16())}},lib:{WordArray:{create:r=>r?typeof r=="string"?new Qe(Buffer.from(r,"utf8")):Buffer.isBuffer(r)?new Qe(r):new Qe(Buffer.from(String(r))):new Qe(Buffer.alloc(0)),random:r=>new Qe(br.randomBytes(r))}},pad:{Pkcs7:{_name:"pkcs7"},NoPadding:{_name:"nopadding"},ZeroPadding:{_name:"zeropadding"}},mode:{CBC:{_name:"cbc"},ECB:{_name:"ecb"}}}}var br,Nz,_P,Qe,Ki,md=le(()=>{"use strict";br=ve(require("crypto")),Nz=ve(require("querystring")),_P=ve(require("vm"));om();Pf();um();B0();W0();Ym();Qe=class t{_buffer;constructor(e){this._buffer=typeof e=="string"?Buffer.from(e,"utf8"):e}toString(e){return e?e.stringify(this):this._buffer.toString("hex")}toBuffer(){return this._buffer}static fromHex(e){return new t(Buffer.from(e,"hex"))}static fromBase64(e){return new t(Buffer.from(e,"base64"))}static fromUtf8(e){return new t(Buffer.from(e,"utf8"))}};Ki=class t{constructor(e,r=[],n,i="shared",s=5e3){this.httpService=e;this.secretRegistry=n;this.scopeMode=i;this.scriptTimeoutMs=s;this.moduleLoader=Jm(r)}httpService;secretRegistry;scopeMode;scriptTimeoutMs;moduleLoader;createRequestSession(e){return new Wu({createVM:this.createVM.bind(this),createCommonContext:this.createCommonContext.bind(this),isolateScripts:this.scopeMode==="isolated",scriptTimeoutMs:this.scriptTimeoutMs},e)}createVM(e,r,n){let i=this.moduleLoader.getGlobalSetupExports(),s=this.moduleLoader.createRequireFunction();e.require=s,e.vault=this.createVault();let o={ctx:e,hf:e,pm:e,console:r,...i||{},global:i,setTimeout:n?.setTimeout??setTimeout,setInterval:n?.setInterval??setInterval,clearTimeout:n?.clearTimeout??clearTimeout,clearInterval:n?.clearInterval??clearInterval,URL,URLSearchParams,Buffer,atob:l=>Buffer.from(l,"base64").toString("binary"),btoa:l=>Buffer.from(l,"binary").toString("base64"),TextEncoder,TextDecoder,crypto:br,_:s("lodash"),require:s,moment:fd(),querystring:Nz,CryptoJS:Fz(),tv4:(()=>{try{return s("tv4")}catch{return}})(),postman:{setNextRequest:l=>e.setNextRequest?.(l),setGlobalVariable:(l,c)=>e.globals?.set(l,c),getGlobalVariable:l=>e.globals?.get(l),clearGlobalVariable:l=>e.globals?.unset(l),setEnvironmentVariable:(l,c)=>e.environment?.set(l,c),getEnvironmentVariable:l=>e.environment?.get(l),clearEnvironmentVariable:l=>e.environment?.unset(l),getResponseHeader:l=>{let c=e.response?.headers?.get?.(l);return c===void 0?null:c},getResponseCookie:l=>{let c=e.response?.cookies;if(c&&typeof c[Symbol.iterator]=="function"){for(let d of c)if(d?.name&&d.name.toLowerCase()===l.toLowerCase())return{...d}}return null}},jsonStringify:(l,c,d)=>JSON.stringify(l,c,d),jsonParse:l=>JSON.parse(l),xml2Json:l=>{try{let c=this.moduleLoader.createRequireFunction()("xml2js"),d;return c.parseString(l,{explicitArray:!1},(p,m)=>{if(p)throw p;d=m}),d}catch{throw new Error("xml2Json() requires the xml2js module. Add it to your modules/package.json and run npm install.")}}};return _P.createContext(o)}createCommonContext(e,r){let n={...e.variables},i={...e.collectionVariables||{}},s={...e.globals||{}},o={...e.environmentVariables||{}},l=e.iterationData||{},c=this.createMergedVariableScope(n,o,i,s,l),d=this.createGlobalsScope(s,e.onGlobalsChange),p=this.createVariableScope(i),m=this.createEnvironmentScope(o,e.environmentName,e.onEnvironmentChange,!0),y={...m,set:(x,v)=>{let R=this.serializeValue(v);m.set(x,R),n[x]=R},unset(x){m.unset(x),delete n[x]},clear(){let x=Object.keys(o);m.clear();for(let v of x)delete n[v]}},b={...d,set:(x,v)=>{let R=this.serializeValue(v);d.set(x,R),n[x]=R},unset(x){d.unset(x),delete n[x]},clear(){let x=Object.keys(s);d.clear();for(let v of x)delete n[v]}};return b.replaceIn=c.replaceIn,p.replaceIn=c.replaceIn,y.replaceIn=c.replaceIn,{globals:b,collectionVariables:p,variables:c,environment:y,iterationData:{get:x=>l[x],has:x=>x in l,toObject:()=>({...l}),toJSON:()=>JSON.stringify(l)},sendRequest:this.createSendRequest(),expect:za,info:e.info||{eventName:r,requestName:void 0,requestId:void 0}}}static JSON_TYPE_MARKER="";serializeValue(e){return typeof e=="string"?e:e===void 0?t.JSON_TYPE_MARKER+"undefined":t.JSON_TYPE_MARKER+JSON.stringify(e)}deserializeValue(e){if(e!==void 0){if(typeof e=="string"&&e.charCodeAt(0)===30){let r=e.slice(1);if(r==="undefined")return;try{return JSON.parse(r)}catch{}}return e}}createVariableScope(e){return{get:r=>this.deserializeValue(e[r]),set:(r,n)=>{e[r]=this.serializeValue(n)},has(r){return r in e},unset(r){delete e[r]},clear(){Object.keys(e).forEach(r=>delete e[r])},toObject(){return{...e}}}}createGlobalsScope(e,r){let n=(i,s,o)=>{r&&r(i,s,o)};return{get:i=>this.deserializeValue(e[i]),set:(i,s)=>{let o=this.serializeValue(s);e[i]=o,n("set",i,o)},has(i){return i in e},unset(i){delete e[i],n("unset",i)},clear(){Object.keys(e).forEach(i=>delete e[i]),n("clear")},toObject(){return{...e}}}}createMergedVariableScope(e,r,n,i,s={}){let o={get:l=>l in e?this.deserializeValue(e[l]):l in s?s[l]:l in r?this.deserializeValue(r[l]):l in n?this.deserializeValue(n[l]):this.deserializeValue(i[l]),set:(l,c)=>{e[l]=this.serializeValue(c)},has(l){return l in e||l in s||l in r||l in r||l in n||l in i},unset(l){delete e[l]},clear(){Object.keys(e).forEach(l=>delete e[l])},toObject(){return{...i,...n,...r,...s,...e}},toLocalObject(){return{...n,...r,...s,...e}},replaceIn(l){if(!l||typeof l!="string")return l;let c=o.toObject(),d=20,p=y=>y.replace(/\{\{([^}]+)\}\}/g,(b,q)=>{let x=q.trim(),v=x.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(v)try{let E=RP(v[2],c),k=Vi(v[1],E);return k!==null?String(k):b}catch{return b}let R=xu(x);if(R){let E=Mz(R.input,c);if(E!==void 0){let k=Cu(E,R.filters,c);return k!==void 0?String(k):b}return b}if(o.has(x)){let E=o.get(x);return E===void 0?"":String(E)}if(go(x)){let E={};for(let[M,j]of Object.entries(c))E[M]=xP(j);let k=mo(x,E),P=ui(x,k);if(P!==void 0)return String(P)}return b}),m=l;for(let y=0;y<d;y++){let b=p(m);if(b===m)break;m=b}return m}};return o}createEnvironmentScope(e,r,n,i){let s=(o,l,c)=>{n&&(i?n(o,l,c):n(l||"",o==="set"?c:void 0))};return{name:r||"",get:o=>this.deserializeValue(e[o]),set:(o,l)=>{let c=this.serializeValue(l);e[o]=c,s("set",o,c)},has(o){return o in e},unset(o){delete e[o],s("unset",o)},clear(){Object.keys(e).forEach(o=>delete e[o]),s("clear")},toObject(){return{...e}}}}createVault(){let e=this.secretRegistry,r=()=>{throw new Error("pm.vault is read-only in HTTP Forge. Use environment variables or {{secret:provider/path}} tokens to manage secrets.")};return{async get(n){if(!e)throw new Error('pm.vault is not available \u2014 no secret providers are configured. Configure a provider under "secrets.providers" to use pm.vault.get().');let i=`secret:${n}`;return(await e.resolveSecretTokens(`{{${i}}}`))[i]},set:r,unset:r}}createSendRequest(){return this.httpService?(e,r)=>{let n=typeof e=="string"?{url:e,method:"GET"}:e,i=this.httpService.execute({url:n.url,method:n.method||"GET",headers:n.headers||{},body:n.body,...n});if(r){i.then(s=>r(null,s)).catch(s=>r(s,null));return}return i}:(e,r)=>{let n=new Error("sendRequest not available - HTTP service not configured");if(r){r(n,null);return}return Promise.reject(n)}}}});var CP,jz,G0,Xm,J0,eg,ln,Eo,gd=le(()=>{"use strict";CP=ve(require("fs")),jz=ve(require("http")),G0=ve(require("https")),Xm=ve(require("path")),J0=require("url"),eg=ve(require("zlib")),ln={timeout:3e4,followRedirects:!0,followOriginalMethod:!1,followAuthHeader:!1,maxRedirects:10,strictSSL:!0,decompress:!0,includeCookies:!1,tls:{},certificates:[]},Eo=class{settings;version;basePath;constructor(e,r=process.cwd()){this.settings={...ln,...e},this.basePath=r;try{this.version=require("../../package.json").version||"0.0.0"}catch{this.version="0.0.0"}this.settings.strictSSL===!1&&console.log("[NodeHttpClient] SSL verification disabled (strictSSL: false)")}async send(e){let r=this.mergeSettings(e.settings);return await this.executeInternal(e,r,0)}mergeSettings(e){return{timeout:e?.timeout??this.settings.timeout,followRedirects:e?.followRedirects??this.settings.followRedirects,followOriginalMethod:e?.followOriginalMethod??this.settings.followOriginalMethod,followAuthHeader:e?.followAuthHeader??this.settings.followAuthHeader,maxRedirects:e?.maxRedirects??this.settings.maxRedirects,strictSSL:e?.strictSSL??this.settings.strictSSL,decompress:e?.decompress??this.settings.decompress,includeCookies:e?.includeCookies??this.settings.includeCookies,tls:e?.tls??this.settings.tls??{},certificates:e?.certificates??this.settings.certificates??[]}}async executeInternal(e,r,n,i){let s=Date.now(),o=new J0.URL(e.url),l=o.protocol==="https:",c=this.sanitizeHeaders(e.headers||{});Object.keys(c).some(m=>m.toLowerCase()==="user-agent")||(c["User-Agent"]=`HttpForge/${this.version}`);let p={hostname:o.hostname,port:o.port||(l?443:80),path:o.pathname+o.search,method:e.method,headers:{...c},timeout:r.timeout||void 0};if(r.decompress&&!c["accept-encoding"]&&!c["Accept-Encoding"]&&(p.headers["Accept-Encoding"]="gzip, deflate"),l){let m=this.resolveTlsSettings(o,r),y=p;y.rejectUnauthorized=r.strictSSL;let b={rejectUnauthorized:r.strictSSL},q=this.readOptionalFile(m.caPath,"CA certificate");q&&(b.ca=q);let x=this.readOptionalFile(m.certPath,"client certificate");x&&(b.cert=x);let v=this.readOptionalFile(m.keyPath,"client private key");v&&(b.key=v);let R=this.readOptionalFile(m.pfxPath,"client pfx");R&&(b.pfx=R),m.passphrase&&(b.passphrase=m.passphrase),m.servername&&(y.servername=m.servername),y.agent=new G0.Agent(b)}return new Promise((m,y)=>{if(i?.aborted){let x=new Error("Request cancelled");x.name="AbortError",y(x);return}let q=(l?G0:jz).request(p,async x=>{let v=x.statusCode||0;if(r.followRedirects&&[301,302,303,307,308].includes(v)){if(n>=r.maxRedirects){y(new Error(`Maximum redirects (${r.maxRedirects}) exceeded`));return}let E=x.headers.location;if(!E){y(new Error("Redirect response missing Location header"));return}let k=new J0.URL(E,e.url).toString(),P=e.method;!r.followOriginalMethod&&[301,302,303].includes(v)&&(P="GET");let M={...e.headers};r.followAuthHeader||(delete M.authorization,delete M.Authorization);try{let j=await this.executeInternal({...e,url:k,method:P,headers:M,body:P==="GET"?void 0:e.body},r,n+1,i),I=Date.now();j.time=I-s,m(j)}catch(j){y(j)}return}let R=[];x.on("data",E=>R.push(E)),x.on("end",()=>{let E=Date.now(),k=Buffer.concat(R),P=x.headers["content-encoding"];if(r.decompress&&P)try{P==="gzip"?k=eg.gunzipSync(k):P==="deflate"&&(k=eg.inflateSync(k))}catch(_){console.warn("[NodeHttpClient] Decompression failed:",_)}let M=k.toString("utf-8"),j={};for(let[_,A]of Object.entries(x.headers))(typeof A=="string"||Array.isArray(A))&&(j[_]=A);let I=this.parseCookies(x.headers["set-cookie"],o.hostname);m({status:x.statusCode||0,statusText:x.statusMessage||"",headers:j,cookies:I,body:M,time:E-s,size:k.length})})});if(i&&i.addEventListener("abort",()=>{q.destroy();let x=new Error("Request cancelled");x.name="AbortError",y(x)}),q.on("error",x=>{y(x)}),q.on("timeout",()=>{q.destroy(),y(new Error("Request timeout"))}),e.body!==void 0&&e.body!==null){let x=typeof e.body=="string"?e.body:JSON.stringify(e.body);q.write(x)}q.end()})}resolveTlsSettings(e,r){let n=r.tls||{};if(!!(n.caPath||n.certPath||n.keyPath||n.pfxPath||n.servername||n.passphrase))return n;let s=this.findCertificateMapping(e,r.certificates||[]);return s?{caPath:s.caPath,certPath:s.certPath,keyPath:s.keyPath,pfxPath:s.pfxPath,passphrase:s.passphrase,servername:s.servername}:n}findCertificateMapping(e,r){if(!Array.isArray(r)||r.length===0)return;let n=e.hostname,i=e.port?Number(e.port):443,s=r.find(o=>this.mappingMatchesHost(o,n,i,!0));return s||r.find(o=>this.mappingMatchesHost(o,n,i,!1))}mappingMatchesHost(e,r,n,i){if(!e||e.enabled===!1)return!1;let s=String(e.host||"").trim().toLowerCase();if(!s||e.port!=null&&Number(e.port)!==n)return!1;let o=r.toLowerCase();if(i)return s!=="*"&&!s.startsWith("*.")&&o===s;if(s==="*")return!0;if(s.startsWith("*.")){let l=s.slice(2);return o===l||o.endsWith(`.${l}`)}return o===s}readOptionalFile(e,r){if(!e)return;let n=Xm.isAbsolute(e)?e:Xm.resolve(this.basePath,e);try{return CP.readFileSync(n)}catch(i){throw new Error(`[NodeHttpClient] Failed to read ${r} file at ${n}: ${i?.message||"Unknown error"}`)}}sanitizeHeaderValue(e){return e?String(e).replace(/[\u201C\u201D\u201E\u201F\u2033\u2036]/g,'"').replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/g,"'").replace(/[\x00-\x08\x0A-\x1F\x7F]/g,""):""}sanitizeHeaders(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeHeaderValue(String(i));return r}parseCookies(e,r){return e?e.map(n=>{let i=n.split(";").map(p=>p.trim()),[s,...o]=i,[l,c]=s.split("="),d={name:l.trim(),value:c?.trim()||"",domain:r};for(let p of o){let[m,y]=p.split("=");switch(m.toLowerCase().trim()){case"domain":d.domain=y?.trim();break;case"path":d.path=y?.trim();break;case"expires":d.expires=y?.trim();break;case"httponly":d.httpOnly=!0;break;case"secure":d.secure=!0;break}}return d}):[]}}});var Y0,qo,tg=le(()=>{"use strict";Y0={json:"application/json",xml:"application/xml",html:"text/html",text:"text/plain",javascript:"application/javascript",css:"text/css","x-www-form-urlencoded":"application/x-www-form-urlencoded","form-data":"multipart/form-data",graphql:"application/json"},qo=class{sanitizeHeaderValue(e){return e?String(e).replace(/[\u201C\u201D\u201E\u201F\u2033\u2036]/g,'"').replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/g,"'").replace(/[\x00-\x08\x0A-\x1F\x7F]/g,""):""}sanitizeHeaders(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeHeaderValue(String(i));return r}encodeBody(e){if(!e||e.type==="none")return null;let{type:r,content:n}=e;switch(r){case"x-www-form-urlencoded":return this.encodeUrlEncodedBody(n);case"form-data":return n;case"graphql":return this.encodeGraphQLBody(n);case"raw":return n;default:return n}}encodeUrlEncodedBody(e){if(Array.isArray(e)){let r=new URLSearchParams;for(let n of e)n.enabled!==!1&&n.key&&r.append(n.key,n.value||"");return r.toString()}return typeof e=="string"?e:String(e)}encodeGraphQLBody(e){if(typeof e=="string")try{e=JSON.parse(e)}catch{return e}if(typeof e=="object"&&e!==null&&e.query){let r=e.variables;if(typeof r=="string")try{r=r.trim()?JSON.parse(r):void 0}catch{r=void 0}return JSON.stringify({query:e.query,...r!=null?{variables:r}:{},...e.operationName?{operationName:e.operationName}:{}})}return JSON.stringify(e)}setContentTypeHeader(e,r,n){if(Object.keys(e).some(o=>o.toLowerCase()==="content-type"))return;if(n){e["Content-Type"]=n;return}if(!r||r.type==="none")return;let s;switch(r.type){case"x-www-form-urlencoded":s=Y0["x-www-form-urlencoded"];break;case"raw":s=r.format?Y0[r.format]:"text/plain",s||(s="text/plain");break;case"graphql":s=Y0.graphql;break;case"binary":s="application/octet-stream";break}s&&(e["Content-Type"]=s)}}});var Oo,rg=le(()=>{"use strict";Oo=class{parse(e,r){return r.toLowerCase().endsWith(".json")?this.parseJson(e):this.parseCsv(e)}parseJson(e){try{let r=JSON.parse(e);return Array.isArray(r)?r:[r]}catch{throw new Error("Failed to parse JSON data file: Invalid JSON format")}}parseCsv(e){let r=e.split(/\r?\n/).filter(s=>s.trim());if(r.length<2)return[{}];let n=this.parseCsvLine(r[0]),i=[];for(let s=1;s<r.length;s++){let o=this.parseCsvLine(r[s]),l={};n.forEach((c,d)=>{l[c]=o[d]||""}),i.push(l)}return i}parseCsvLine(e){let r=[],n="",i=!1;for(let s=0;s<e.length;s++){let o=e[s],l=e[s+1];o==='"'?i&&l==='"'?(n+='"',s++):i=!i:o===","&&!i?(r.push(n.trim()),n=""):n+=o}return r.push(n.trim()),r}}});var Ku,Lz,Qu,K0=le(()=>{"use strict";Ku=ve(require("crypto")),Lz=3e4,Qu=class{constructor(e,r,n,i,s="henry-huang.http-forge/oauth2/callback"){this.secretStore=e;this.browserService=r;this.envConfigService=n;this.httpService=i;this.callbackPath=s}secretStore;browserService;envConfigService;httpService;callbackPath;tokenCache=new Map;pendingAuthCallback=null;pendingImplicitCallback=null;async getToken(e,r){if(e.accessToken)return{accessToken:this.resolve(e.accessToken,r),tokenType:e.tokenPrefix||"Bearer",raw:{}};let n=this.buildCacheKeyString(e),i=this.tokenCache.get(n);if(i&&!this.isExpired(i))return i;if(i?.refreshToken)try{return await this.refreshToken(e,i.refreshToken,r)}catch{this.tokenCache.delete(n)}if(!i){let o=await this.secretStore.get(`oauth2_refresh_${n}`);if(o)try{return await this.refreshToken(e,o,r)}catch{await this.secretStore.delete(`oauth2_refresh_${n}`)}}let s;switch(e.grantType){case"client_credentials":s=await this.fetchToken(e,r,"client_credentials");break;case"password":s=await this.fetchToken(e,r,"password");break;case"authorization_code":s=await this.authorizationCodeFlow(e,r);break;case"implicit":s=await this.implicitFlow(e,r);break;default:throw new Error(`Unknown OAuth2 grant type: ${e.grantType}`)}return this.tokenCache.set(n,s),s.refreshToken&&await this.storeRefreshToken(n,s.refreshToken),s}async refreshToken(e,r,n){let i=this.resolve(e.tokenUrl||"",n);if(!i)throw new Error("OAuth2 tokenUrl is required for token refresh");let s=this.resolve(e.clientId||"",n),o=this.resolve(e.clientSecret||"",n),l=new URLSearchParams;l.append("grant_type","refresh_token"),l.append("refresh_token",r);let c={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,c,l,s,o,n);let d=await this.httpService.execute({method:"POST",url:i,headers:c,body:l.toString()}),p=this.parseTokenResponse(d.body,e);p.refreshToken||(p.refreshToken=r);let m=this.buildCacheKeyString(e);return this.tokenCache.set(m,p),p.refreshToken&&await this.storeRefreshToken(m,p.refreshToken),p}async authorizationCodeFlow(e,r){let n=this.resolve(e.authUrl||"",r),i=this.resolve(e.tokenUrl||"",r),s=this.resolve(e.clientId||"",r),o=this.resolve(e.clientSecret||"",r),l=e.scope?this.resolve(e.scope,r):void 0;if(!n)throw new Error("OAuth2 authUrl is required for authorization code flow");if(!i)throw new Error("OAuth2 tokenUrl is required for authorization code flow");if(!s)throw new Error("OAuth2 clientId is required for authorization code flow");let c=e.usePkce!==!1,d,p,m;if(c){d=this.generateCodeVerifier();let j=e.pkceMethod||"S256";p=j==="S256"?this.generateCodeChallengeS256(d):d,m=j}let y=e.state||Ku.randomBytes(16).toString("hex"),b=await this.getCallbackUri(),q=new URL(n);if(q.searchParams.set("response_type","code"),q.searchParams.set("client_id",s),q.searchParams.set("redirect_uri",b),l&&q.searchParams.set("scope",l),q.searchParams.set("state",y),p&&(q.searchParams.set("code_challenge",p),q.searchParams.set("code_challenge_method",m)),e.audience&&q.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&q.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[j,I]of Object.entries(e.extraParams))q.searchParams.set(j,this.resolve(I,r));this.pendingAuthCallback&&(this.pendingAuthCallback.reject(new Error("OAuth2 authorization superseded by a new request")),this.pendingAuthCallback=null);let x=new Promise((j,I)=>{this.pendingAuthCallback={resolve:j,reject:I,state:y}});await this.browserService.openExternal(q.toString());let v;try{v=await Promise.race([x,new Promise((j,I)=>setTimeout(()=>{this.pendingAuthCallback=null,I(new Error("OAuth2 authorization timed out after 2 minutes"))},12e4))])}finally{this.pendingAuthCallback=null}if(v.state&&v.state!==y)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let R=new URLSearchParams;R.append("grant_type","authorization_code"),R.append("code",v.code),R.append("redirect_uri",b),d&&R.append("code_verifier",d);let E={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,E,R,s,o,r);let k=await this.httpService.execute({method:"POST",url:i,headers:E,body:R.toString()}),P=this.parseTokenResponse(k.body,e),M=this.buildCacheKeyString(e);return this.tokenCache.set(M,P),P.refreshToken&&await this.storeRefreshToken(M,P.refreshToken),P}async implicitFlow(e,r){let n=this.resolve(e.authUrl||"",r),i=this.resolve(e.clientId||"",r),s=e.scope?this.resolve(e.scope,r):void 0;if(!n)throw new Error("OAuth2 authUrl is required for implicit flow");if(!i)throw new Error("OAuth2 clientId is required for implicit flow");let o=e.state||Ku.randomBytes(16).toString("hex"),l=await this.getCallbackUri(),c=new URL(n);if(c.searchParams.set("response_type","token"),c.searchParams.set("client_id",i),c.searchParams.set("redirect_uri",l),s&&c.searchParams.set("scope",s),c.searchParams.set("state",o),e.audience&&c.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&c.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[b,q]of Object.entries(e.extraParams))c.searchParams.set(b,this.resolve(q,r));this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow superseded by a new request")),this.pendingImplicitCallback=null);let d=new Promise((b,q)=>{this.pendingImplicitCallback={resolve:b,reject:q,state:o}});await this.browserService.openExternal(c.toString());let p;try{p=await Promise.race([d,new Promise((b,q)=>setTimeout(()=>{this.pendingImplicitCallback=null,q(new Error("OAuth2 implicit flow timed out after 2 minutes"))},12e4))])}finally{this.pendingImplicitCallback=null}if(p.state&&p.state!==o)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let m={accessToken:p.accessToken,tokenType:p.tokenType||e.tokenPrefix||"Bearer",expiresAt:p.expiresIn?Date.now()+p.expiresIn*1e3:void 0,raw:{access_token:p.accessToken,token_type:p.tokenType,expires_in:p.expiresIn}},y=this.buildCacheKeyString(e);return this.tokenCache.set(y,m),m}handleAuthorizationCallback(e,r,n){if(n){let i=new Error(`OAuth2 authorization error: ${n}`);this.pendingAuthCallback?.reject(i),this.pendingImplicitCallback?.reject(i),this.pendingAuthCallback=null,this.pendingImplicitCallback=null;return}if(e&&this.pendingAuthCallback){this.pendingAuthCallback.resolve({code:e,state:r}),this.pendingAuthCallback=null;return}!e&&!this.pendingAuthCallback&&this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow did not receive access_token")),this.pendingImplicitCallback=null)}handleImplicitCallback(e,r,n,i){this.pendingImplicitCallback&&(this.pendingImplicitCallback.resolve({accessToken:e,tokenType:r,expiresIn:n,state:i}),this.pendingImplicitCallback=null)}clearToken(e){let r=`${e.tokenUrl}|${e.clientId}|${e.scope||""}|${e.grantType}`;this.tokenCache.delete(r),this.secretStore.delete(`oauth2_refresh_${r}`)}clearAllTokens(){for(let e of this.tokenCache.keys())this.secretStore.delete(`oauth2_refresh_${e}`);this.tokenCache.clear()}async fetchToken(e,r,n){let i=this.resolve(e.tokenUrl||"",r);if(!i)throw new Error("OAuth2 tokenUrl is required");let s=this.resolve(e.clientId||"",r),o=this.resolve(e.clientSecret||"",r),l=e.scope?this.resolve(e.scope,r):void 0,c=new URLSearchParams;if(c.append("grant_type",n),l&&c.append("scope",l),n==="password"){let m=this.resolve(e.username||"",r),y=this.resolve(e.password||"",r);if(!m)throw new Error("OAuth2 password grant requires username");c.append("username",m),c.append("password",y)}if(e.audience&&c.append("audience",this.resolve(e.audience,r)),e.resource&&c.append("resource",this.resolve(e.resource,r)),e.extraParams)for(let[m,y]of Object.entries(e.extraParams))c.append(m,this.resolve(y,r));let d={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,d,c,s,o,r);let p=await this.httpService.execute({method:"POST",url:i,headers:d,body:c.toString()});return this.parseTokenResponse(p.body,e)}applyClientAuth(e,r,n,i,s,o){if(e.clientAuthentication==="header"){let l=Buffer.from(`${i}:${s}`).toString("base64");r.Authorization=`Basic ${l}`}else i&&n.set("client_id",i),s&&n.set("client_secret",s)}parseTokenResponse(e,r){let n=e;if(typeof n=="string")try{n=JSON.parse(n)}catch{throw new Error("OAuth2 token response is not valid JSON")}if(!n||typeof n!="object")throw new Error("OAuth2 token response is not a valid JSON object");let i=n,s=r.tokenField||"access_token",o=i[s];if(!o)throw new Error(`OAuth2 token fetch failed: '${s}' not present in response`);let l=typeof i.expires_in=="number"?i.expires_in:void 0;return{accessToken:o,tokenType:i.token_type||r.tokenPrefix||"Bearer",expiresAt:l?Date.now()+l*1e3:void 0,refreshToken:i.refresh_token,scope:i.scope,raw:i}}isExpired(e){return e.expiresAt?Date.now()>=e.expiresAt-Lz:!1}buildCacheKeyString(e){return`${e.tokenUrl||""}|${e.clientId||""}|${e.scope||""}|${e.grantType}`}async getCallbackUri(){let e=`${this.browserService.uriScheme}://${this.callbackPath}`;return this.browserService.asExternalUri(e)}resolve(e,r){return this.envConfigService.resolveVariables(e,r)}generateCodeVerifier(){return Ku.randomBytes(32).toString("base64url")}generateCodeChallengeS256(e){return Ku.createHash("sha256").update(e).digest("base64url")}async storeRefreshToken(e,r){try{await this.secretStore.store(`oauth2_refresh_${e}`,r)}catch{}}}});function Ka(t,e={}){let r=[];Object.entries(e).forEach(([n,i])=>{r.push(`${n}=${i}`)}),r.length&&Ya.writeFileSync(t,r.join(`
|
|
53
53
|
`),"utf-8")}function Zu(t,e,r){r&&(r.preRequest&&r.preRequest.trim()&&Ya.writeFileSync(Po.join(t,`${e}.pre.js`),r.preRequest,"utf-8"),r.postResponse&&r.postResponse.trim()&&Ya.writeFileSync(Po.join(t,`${e}.post.js`),r.postResponse,"utf-8"))}function EP(t,e){let n=e&&e.trim()?e.trim():"collections-rest-client";return Po.isAbsolute(n)?n:Po.join(t,n)}async function qP(t,e,r,n,i){await t.exportCollectionAsRestClientFolder(r,n),e.exportEnvironmentsToFolder(n,i)}function yd(t,e,r){t.forEach(n=>{if(n.type==="folder"){let i=Po.join(e,Bt(n.name));Ya.mkdirSync(i,{recursive:!0}),Zu(i,Bt(n.name),n.scripts),yd(n.items||[],i,r)}else if(n.type==="request"){let i=n,s=Bt(i.name)+".http",o=Po.join(e,s),l=Uz(i,r);Ya.writeFileSync(o,l,"utf-8"),Zu(e,Bt(i.name),i.scripts)}})}function Uz(t,e){let r=[];r.push(`### ${e.name} / ${t.name}`),r.push(`# collection env: ${Bt(e.name)}.env`),r.push(`# request scripts: ${Bt(t.name)}.pre.js and .post.js`);let n=Hz(t);return r.push(`${t.method} ${n}`),(t.headers||[]).filter(i=>i.enabled!==!1).forEach(i=>{r.push(`${i.key}: ${i.value}`)}),t.body&&t.body.content&&r.push("",t.body.content),r.join(`
|
|
54
|
-
`)}function Hz(t){let e=t.url;if(t.query&&t.query.length){let r=t.query.filter(n=>n.enabled!==!1).map(n=>`${encodeURIComponent(n.key)}=${encodeURIComponent(n.value)}`).join("&");r&&(e+=(e.includes("?")?"&":"?")+r)}return e}var Ya,Po,ig=le(()=>{"use strict";Ya=ve(require("fs")),Po=ve(require("path"));Un()});var Or,Q0,Qa,Z0=le(()=>{"use strict";Or=ve(require("fs")),Q0=ve(require("path"));Un();Qa=class{collectionsDir;cache=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}ensureDirectory(){Or.existsSync(this.collectionsDir)||Or.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),!Or.existsSync(this.collectionsDir))return[];let e=Or.readdirSync(this.collectionsDir),r=[];for(let n of e)if(n.endsWith(".json"))try{let i=Q0.join(this.collectionsDir,n),s=Or.readFileSync(i,"utf-8"),o=JSON.parse(s);o.id&&o.name&&(this.cache.set(o.id,o),r.push(o))}catch(i){console.error(`[JsonCollectionLoader] Failed to load ${n}:`,i)}return r}load(e){if(this.cache.has(e))return this.cache.get(e);let r=this.getCollectionPath(e);if(Or.existsSync(r))try{let n=Or.readFileSync(r,"utf-8"),i=JSON.parse(n);return this.cache.set(e,i),i}catch(n){console.error(`[JsonCollectionLoader] Failed to load collection ${e}:`,n);return}}async save(e){if(this.ensureDirectory(),!e.name)throw new Error("Collection name is required");e.id||(e.id=It(e.name));let r=this.getCollectionPath(e.id),n=JSON.stringify(e,null,2);await Or.promises.writeFile(r,n,"utf-8"),this.cache.set(e.id,e)}async delete(e){let r=this.getCollectionPath(e);if(!Or.existsSync(r))return!1;try{return await Or.promises.unlink(r),this.cache.delete(e),!0}catch(n){return console.error(`[JsonCollectionLoader] Failed to delete collection ${e}:`,n),!1}}exists(e){return Or.existsSync(this.getCollectionPath(e))}getCollectionPath(e){return Q0.join(this.collectionsDir,`${e}.json`)}getItemPath(e,r){}async create(e,r){let n={id:r||It(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,r);s&&(s.scripts=n,await this.save(i))}loadScripts(e,r){let n=this.load(e);return n?this.findItemById(n.items,r)?.scripts:void 0}async updateCollectionMetadata(e,r){let n=this.load(e);if(!n)throw new Error(`Collection ${e} not found`);r.name!==void 0&&(n.name=r.name),r.description!==void 0&&(n.description=r.description),r.version!==void 0&&(n.version=r.version),r.variables!==void 0&&(n.variables=r.variables),r.auth!==void 0&&(n.auth=r.auth),await this.save(n)}async saveItem(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,r.id);if(s)Object.assign(s,r);else if(n){let o=this.findItemById(i.items,n);if(o&&o.type==="folder")o.items=o.items||[],o.items.push(r);else throw new Error(`Parent folder ${n} not found`)}else i.items.push(r);await this.save(i)}async deleteItem(e,r){let n=this.load(e);if(!n)return!1;let i=this.deleteItemById(n.items,r);return i&&await this.save(n),i}async updateItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,r);if(!s)return!1;let{id:o,type:l,...c}=n;return Object.assign(s,c),await this.save(i),!0}async moveItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,r);if(!s)return!1;let o={...s};if(!this.deleteItemById(i.items,r))return!1;if(n){let l=this.findItemById(i.items,n);if(l&&l.type==="folder")l.items=l.items||[],l.items.push(o);else return i.items.push(o),!1}else i.items.push(o);return await this.save(i),!0}async reorderItems(e,r,n){let i=this.load(e);if(!i)return!1;try{let s;if(r){let c=this.findItemById(i.items,r);if(!c||!c.items)return!1;s=c.items}else s=i.items;let o=new Map(s.map(c=>[c.id,c])),l=[];for(let c of n){let d=o.get(c);d&&(l.push(d),o.delete(c))}for(let c of o.values())l.push(c);if(r){let c=this.findItemById(i.items,r);c&&(c.items=l)}else i.items=l;return await this.save(i),!0}catch(s){return console.error("[JsonCollectionLoader] Failed to reorder items:",s),!1}}findItemById(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,r);if(i)return i}}}deleteItemById(e,r){for(let n=0;n<e.length;n++){if(e[n].id===r)return e.splice(n,1),!0;let i=e[n];if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,r))return!0}return!1}}});var Xu,X0=le(()=>{"use strict";nm();Z0();Xu=class{static create(e){let r=e.getStorageConfig(),n=e.getCollectionsPath();return r.format==="folder"?new xs(n):new Qa(n)}static createForFormat(e,r){return e==="folder"?new xs(r):new Qa(r)}}});function IP(t){if(typeof t!="string")return"text";let e=t.trim();try{let r=JSON.parse(e);if(typeof r=="object"&&r!==null)return"json"}catch{}return/^<\?xml/.test(e)||/^<([a-zA-Z_][\w\-\.]*)[\s>]/.test(e)?/^<\!DOCTYPE html>/i.test(e)||/^<html[\s>]/i.test(e)?"html":"xml":/^<\!DOCTYPE html>/i.test(e)||/^<html[\s>]/i.test(e)?"html":/^(function\s*\(|\(\)\s*=>|const |let |var |export |import )/.test(e)?"javascript":"text"}function Bz(t){return{info:{name:t.name,_postman_id:t.id,schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},item:t.items.map(e=>OP(e)),event:e_(t.scripts),variable:t.variables?Object.entries(t.variables).map(([e,r])=>({key:e,value:r})):[]}}function OP(t){if(t.type==="folder")return{name:t.name,item:t.items?t.items.map(OP):[],event:e_(t.scripts)};if(t.type==="request"){let e=t;return{name:e.name,request:{method:e.method,header:(e.headers||[]).map(Vz),url:Wz(e),body:zz(e),auth:Jz(e.auth),description:e.description},event:e_(e.scripts),protocolProfileBehavior:Gz(e.settings)}}}function Vz(t){return{key:t.key,value:t.value,disabled:t.enabled===!1,...t.description!==void 0?{description:t.description}:{},...t.type!==void 0?{type:t.type}:{},...t.required!==void 0?{required:t.required}:{},...t.format!==void 0?{format:t.format}:{},...t.enum!==void 0?{enum:t.enum}:{},...t.deprecated!==void 0?{deprecated:t.deprecated}:{},...t.pattern!==void 0?{pattern:t.pattern}:{},...t.minLength!==void 0?{minLength:t.minLength}:{},...t.maxLength!==void 0?{maxLength:t.maxLength}:{},...t.minimum!==void 0?{minimum:t.minimum}:{},...t.maximum!==void 0?{maximum:t.maximum}:{},...t.exclusiveMinimum!==void 0?{exclusiveMinimum:t.exclusiveMinimum}:{},...t.exclusiveMaximum!==void 0?{exclusiveMaximum:t.exclusiveMaximum}:{},...t.multipleOf!==void 0?{multipleOf:t.multipleOf}:{},...t.minItems!==void 0?{minItems:t.minItems}:{},...t.maxItems!==void 0?{maxItems:t.maxItems}:{},...t.uniqueItems!==void 0?{uniqueItems:t.uniqueItems}:{},...t.nullable!==void 0?{nullable:t.nullable}:{},...t.oneOf!==void 0?{oneOf:t.oneOf}:{}}}function Wz(t){let e=t.url,r=t.url.replace(/^[a-zA-Z]+:\/\//,""),n=[],i=r.match(/^([^\/\?]+)/);if(i){let d=i[1];/^{{.*}}$/.test(d)?n=[d]:n=d.split(".")}let s=[],o=r.match(/^[^\/\?]+(\/[^\?]*)?/);if(o&&o[1]!==void 0){let d=o[1].replace(/^\//,"");d.endsWith("/")?(s=d.slice(0,-1).split("/"),s.push("")):s=d.length>0?d.split("/"):[]}let l;if(Array.isArray(t.query)&&t.query.length>0)l=t.query.map(d=>{let p={key:d.key,value:d.value};return d.enabled===!1&&(p.disabled=!0),d.description!==void 0&&(p.description=d.description),d.type!==void 0&&(p.type=d.type),d.required!==void 0&&(p.required=d.required),d.format!==void 0&&(p.format=d.format),d.enum!==void 0&&(p.enum=d.enum),d.deprecated!==void 0&&(p.deprecated=d.deprecated),d.pattern!==void 0&&(p.pattern=d.pattern),d.minLength!==void 0&&(p.minLength=d.minLength),d.maxLength!==void 0&&(p.maxLength=d.maxLength),d.minimum!==void 0&&(p.minimum=d.minimum),d.maximum!==void 0&&(p.maximum=d.maximum),d.exclusiveMinimum!==void 0&&(p.exclusiveMinimum=d.exclusiveMinimum),d.exclusiveMaximum!==void 0&&(p.exclusiveMaximum=d.exclusiveMaximum),d.multipleOf!==void 0&&(p.multipleOf=d.multipleOf),d.minItems!==void 0&&(p.minItems=d.minItems),d.maxItems!==void 0&&(p.maxItems=d.maxItems),d.uniqueItems!==void 0&&(p.uniqueItems=d.uniqueItems),d.nullable!==void 0&&(p.nullable=d.nullable),d.oneOf!==void 0&&(p.oneOf=d.oneOf),p});else{let d=r.indexOf("?");d!==-1&&(l=r.substring(d+1).split("&").map(m=>{let[y,...b]=m.split("=");return{key:y,value:b.join("=")}}))}let c;return t.params&&typeof t.params=="object"&&(c=Object.entries(t.params).map(([d,p])=>({key:d,value:String(p)}))),{raw:e,host:n.length>0?n:void 0,path:s.length>0?s:void 0,query:l&&l.length>0?l:void 0,variable:c&&c.length>0?c:void 0}}function zz(t){if(!t.body)return;let e=t.body;if(typeof e=="string"){let s=IP(e);return{mode:"raw",raw:e,options:{raw:{language:s}}}}if(e.type==="raw"){let s=e.format||IP(e.content);return{mode:"raw",raw:e.content,options:{raw:{language:s}}}}let r=e.type==="form-data"&&Array.isArray(e.content)?e.content:e.type==="formdata"&&Array.isArray(e.fields)?e.fields:null;if(r)return{mode:"formdata",formdata:r.map(s=>({key:s.key,value:s.value,type:s.type||"text",disabled:s.enabled===!1}))};let n=e.type==="x-www-form-urlencoded"&&Array.isArray(e.content)?e.content:e.type==="urlencoded"&&Array.isArray(e.fields)?e.fields:null;if(n)return{mode:"urlencoded",urlencoded:n.map(s=>({key:s.key,value:s.value,disabled:s.enabled===!1}))};if(e.type==="file"&&e.fileName)return{mode:"file",file:{src:e.fileName}};if(e.type==="binary")return{mode:"binary",file:{}};let i=e.type==="graphql"?e.content??(e.query?e:null):null;if(i){let s=i.query??"",o=i.variables;return{mode:"graphql",graphql:{query:s,variables:o?typeof o=="string"?o:JSON.stringify(o):void 0}}}if(e.content)return{mode:"raw",raw:e.content}}function Jz(t){if(!(!t||!t.type||t.type==="none")){if(t.type==="bearer")return{type:"bearer",bearer:[{key:"token",value:t.bearerToken,type:"string"}]};if(t.type==="basic"&&t.basicAuth)return{type:"basic",basic:[{key:"username",value:t.basicAuth.username,type:"string"},{key:"password",value:t.basicAuth.password,type:"string"}]}}}function Gz(t){if(!t)return;let e={};return t.followRedirects===!1&&(e.followRedirects=!1),t.followOriginalMethod===!0&&(e.followOriginalHttpMethod=!0),t.followAuthHeader===!1&&(e.followAuthorizationHeader=!1),t.maxRedirects!==void 0&&(e.maxRedirects=t.maxRedirects),t.strictSSL===!1&&(e.disableUrlEncoding=!1),t.timeout!==void 0&&(e.requestTimeout=t.timeout),Object.keys(e).length>0?e:void 0}function e_(t){if(!t)return[];let e=[];return t.preRequest&&e.push({listen:"prerequest",script:{type:"text/javascript",exec:[t.preRequest]}}),t.postResponse&&e.push({listen:"test",script:{type:"text/javascript",exec:[t.postResponse]}}),e}var Dt,mi,ec,t_=le(()=>{"use strict";Un();ig();X0();Dt=ve(require("fs")),mi=ve(require("path"));ec=class{constructor(e,r,n){this.workspaceRoot=e;this.configService=r;this.fileWatcherFactory=n;this.collectionsDir=r.getCollectionsPath(),this.loader=Xu.create(r),this.ensureCollectionsDir(),this.loadCollections(),this.setupFileWatcher()}workspaceRoot;configService;fileWatcherFactory;collectionsDir;collections=new Map;fileWatcher;loader;debounceTimer=null;selfWritePending=!1;localCollectionValues=new Map;onCollectionsChanged;ensureCollectionsDir(){Dt.existsSync(this.collectionsDir)||Dt.mkdirSync(this.collectionsDir,{recursive:!0})}loadCollections(){this.collections.clear();let e=this.loader.loadAll();for(let r of e)this.collections.set(r.id,r)}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.collectionsDir,"**/*");let e=()=>{this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null;let r=this.selfWritePending;this.selfWritePending=!1,r||this.loadCollections(),this.onCollectionsChanged?.()},300)};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}getAllCollections(){return Array.from(this.collections.values())}getCollection(e){return this.collections.get(e)}getCollectionById(e){for(let r of this.collections.values())if(r.id===e)return r}getCollectionByName(e){let r=e.toLowerCase();for(let n of this.collections.values())if(n.name.toLowerCase()===r)return n}async saveCollection(e){if(this.ensureCollectionsDir(),!e.name)throw new Error("Collection name is required");e.id||(e.id=It(e.name)),this.selfWritePending=!0,await this.loader.save(e),this.collections.set(e.id,e)}getCollectionVariables(e){let r=this.collections.get(e);return r?.variables?{...r.variables}:{}}getCollectionVariableLocals(e){return{...this.localCollectionValues.get(e)||{}}}setCollectionVariable(e,r,n){this.localCollectionValues.has(e)||this.localCollectionValues.set(e,{}),this.localCollectionValues.get(e)[r]=String(n)}deleteCollectionVariable(e,r){let n=this.localCollectionValues.get(e);n&&delete n[r]}clearCollectionVariables(e){this.localCollectionValues.set(e,{})}async deleteCollection(e){if(!this.collections.get(e))return!1;this.selfWritePending=!0;let n=await this.loader.delete(e);return n&&this.collections.delete(e),n}findRequest(e,r){let n=this.collections.get(e);if(n)return this.findItemRecursive(n.items,r)}findRequestByPath(e,r){let n=this.collections.get(e);if(!n)return;let i=r.split("/").filter(s=>s.trim());return this.findItemByPath(n.items,i)}async updateRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;this.selfWritePending=!0;let s=await this.loader.updateItem(e,r,n);if(s){let o=this.findItemRecursive(i.items,r);if(o){let{id:l,type:c,...d}=n;Object.assign(o,d)}}return s}async addRequest(e,r,n){if(!this.collections.get(e))return!1;r.id||(r.id=It(r.name)),this.selfWritePending=!0;try{return await this.loader.saveItem(e,r,n),!0}catch(s){return console.error("[CollectionService] Failed to add request:",s),!1}}async deleteRequest(e,r){let n=this.collections.get(e);if(!n)return!1;this.selfWritePending=!0;let i=await this.loader.deleteItem(e,r);return i&&this.deleteItemRecursive(n.items,r),i}getAllRequests(e){let r=this.collections.get(e);if(!r)return[];let n=[];return this.collectRequestsRecursive(r.items,n),n}findItemRecursive(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemRecursive(n.items,r);if(i)return i}}}findItemByPath(e,r){if(r.length===0)return;let[n,...i]=r,s=e.find(o=>o.name===n);if(s){if(i.length===0)return s;if(s.type==="folder"&&s.items)return this.findItemByPath(s.items,i)}}updateItemRecursive(e,r,n){for(let i=0;i<e.length;i++){let s=e[i];if(s.id===r)return e[i]={...s,...n},!0;if(s.type==="folder"&&s.items&&this.updateItemRecursive(s.items,r,n))return!0}return!1}deleteItemRecursive(e,r){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===r)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemRecursive(i.items,r))return!0}return!1}collectRequestsRecursive(e,r){for(let n of e)n.type==="request"?r.push(n):n.type==="folder"&&n.items&&this.collectRequestsRecursive(n.items,r)}async createCollection(e){let r={id:It(e),name:e,items:[]};return await this.saveCollection(r),r}async renameCollection(e,r){let n=this.collections.get(e);return n?(n.name=r,await this.saveCollection(n),!0):!1}async duplicateCollection(e,r){if(!this.collections.get(e))throw new Error(`Collection not found: ${e}`);this.selfWritePending=!0;let i=It(r),s=this.loader.getCollectionPath(e),o=mi.join(this.collectionsDir,i);if(!Dt.existsSync(s))throw new Error(`Collection directory not found: ${s}`);this.copyDirRecursive(s,o);let l=mi.join(o,"collection.json");if(Dt.existsSync(l)){let d=JSON.parse(Dt.readFileSync(l,"utf-8"));d.id=i,d.name=r,Dt.writeFileSync(l,JSON.stringify(d,null,2))}else Dt.writeFileSync(l,JSON.stringify({id:i,name:r},null,2));this.loadCollections();let c=this.collections.get(i);if(!c)throw new Error("Failed to load duplicated collection");return c}async createFolder(e){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");this.selfWritePending=!0;let n={id:It(e.name),type:"folder",name:e.name,items:[]};await this.loader.saveItem(e.collectionId,n,e.parentId);let i=this.loader.load(e.collectionId);return i&&this.collections.set(e.collectionId,i),n}async deleteFolder(e,r){let n=this.collections.get(e);if(!n)return!1;this.selfWritePending=!0;let i=await this.loader.deleteItem(e,r);return i&&this.deleteItemById(n.items,r),i}async renameFolder(e,r,n){let i=this.collections.get(e);if(!i)return!1;this.selfWritePending=!0;let s=await this.loader.updateItem(e,r,{name:n});if(s){let o=this.findItemById(i.items,r);o&&(o.name=n)}return s}async duplicateFolder(e,r,n){if(!this.collections.get(e))throw new Error("Collection not found");let s=this.loader.getItemPath(e,r);if(!s||!Dt.existsSync(s))throw new Error(`Folder not found on disk: ${r}`);let o=mi.dirname(s),l=It(n),c=mi.join(o,l);this.selfWritePending=!0,this.copyDirRecursive(s,c);let d=mi.join(c,"folder.json");if(Dt.existsSync(d)){let y=JSON.parse(Dt.readFileSync(d,"utf-8"));y.id=l,y.name=n,Dt.writeFileSync(d,JSON.stringify(y,null,2))}else Dt.writeFileSync(d,JSON.stringify({id:l,name:n,type:"folder"},null,2));this.loadCollections();let p=this.collections.get(e),m=p?this.findItemById(p.items,l):void 0;return m||{id:l,type:"folder",name:n,items:[]}}async createRequest(e){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");this.selfWritePending=!0;let n={id:e.id||It(e.name),type:"request",name:e.name,method:e.method||"GET",url:e.url,params:e.params,query:e.query,headers:e.headers,body:e.body,auth:e.auth,settings:e.settings,scripts:e.scripts,deprecated:e.deprecated,description:e.description,doc:e.doc,responseSchema:e.responseSchema,bodySchema:e.bodySchema,operationId:e.operationId,summary:e.summary,tags:e.tags,examples:e.examples,responses:e.responses,security:e.security};await this.loader.saveItem(e.collectionId,n,e.parentId);let i=this.loader.load(e.collectionId);return i&&this.collections.set(e.collectionId,i),n}async renameRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;this.selfWritePending=!0;let s=await this.loader.updateItem(e,r,{name:n});if(s){let o=this.findItemById(i.items,r);o&&(o.name=n)}return s}async moveItem(e,r,n){if(!this.collections.get(e))return!1;this.selfWritePending=!0;let s=await this.loader.moveItem(e,r,n);return s&&this.loadCollections(),s}async reorderItems(e,r,n){if(!this.collections.get(e))return!1;this.selfWritePending=!0;let s=await this.loader.reorderItems(e,r,n);return s&&this.loadCollections(),s}getRequestScript(e,r,n){let i=this.collections.get(e);if(!i)return;let s=this.findItemById(i.items,r);if(!s||s.type!=="request")return;let o=s;return n==="pre-request"?o.scripts?.preRequest:o.scripts?.postResponse}async setRequestScript(e,r,n,i){let s=this.collections.get(e);if(!s)return!1;let o=this.findItemById(s.items,r);if(!o||o.type!=="request")return!1;let l=o,d={...l.scripts??{},...n==="pre-request"?{preRequest:i}:{postResponse:i}};l.scripts=d,this.selfWritePending=!0;try{return await this.loader.saveScripts(e,r,d),!0}catch{return!1}}findItemById(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,r);if(i)return i}}}copyDirRecursive(e,r){Dt.existsSync(r)||Dt.mkdirSync(r,{recursive:!0});for(let n of Dt.readdirSync(e,{withFileTypes:!0})){let i=mi.join(e,n.name),s=mi.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):Dt.copyFileSync(i,s)}}deleteItemById(e,r){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===r)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,r))return!0}return!1}async importCollection(e){let r=Dt.readFileSync(e,"utf-8"),n;try{n=JSON.parse(r)}catch{throw new Error("Invalid JSON file")}if(n.info&&n.info._postman_id)return this.importPostmanCollection(n);let i={id:n.id||It(n.name||"Imported Collection"),name:n.name||"Imported Collection",description:n.description,items:n.items||[]};return await this.saveCollection(i),i}async importPostmanCollection(e){let r=p=>{if(!p)return;switch(p.type?.toLowerCase()){case"bearer":return{type:"bearer",bearerToken:p.bearer?.find(E=>E.key==="token")?.value||""};case"basic":let b=p.basic?.find(E=>E.key==="username"),q=p.basic?.find(E=>E.key==="password");return{type:"basic",basicAuth:{username:b?.value||"",password:q?.value||""}};case"apikey":let x=p.apikey?.find(E=>E.key==="key"),v=p.apikey?.find(E=>E.key==="value"),_=p.apikey?.find(E=>E.key==="in");return{type:"apikey",apikey:{key:x?.value||"",value:v?.value||"",in:_?.value||"header"}};case"noauth":return{type:"none"};default:return}},n=p=>{if(!Array.isArray(p)||p.length===0)return;let m={};for(let y of p){let b=y.script?.exec;if(!b)continue;let q=Array.isArray(b)?b.join(`
|
|
55
|
-
`):b;y.listen==="prerequest"?m.preRequest=q:y.listen==="test"&&(m.postResponse=q)}return m.preRequest||m.postResponse?m:void 0},i=p=>{if(!p||typeof p!="object")return;let m={};return p.followRedirects===!1&&(m.followRedirects=!1),p.followOriginalHttpMethod===!0&&(m.followOriginalMethod=!0),p.followAuthorizationHeader===!1&&(m.followAuthHeader=!1),p.maxRedirects!==void 0&&(m.maxRedirects=p.maxRedirects),p.requestTimeout!==void 0&&(m.timeout=p.requestTimeout),Object.keys(m).length>0?m:void 0},s=p=>{if(!p||typeof p=="string")return;let m=p.query;if(!(!Array.isArray(m)||m.length===0))return m.map(y=>({key:y.key||"",value:y.value||"",enabled:y.disabled!==!0,...y.description!==void 0?{description:y.description}:{},...y.type!==void 0?{type:y.type}:{},...y.required!==void 0?{required:y.required}:{},...y.format!==void 0?{format:y.format}:{},...y.enum!==void 0?{enum:y.enum}:{},...y.deprecated!==void 0?{deprecated:y.deprecated}:{},...y.pattern!==void 0?{pattern:y.pattern}:{},...y.minLength!==void 0?{minLength:y.minLength}:{},...y.maxLength!==void 0?{maxLength:y.maxLength}:{},...y.minimum!==void 0?{minimum:y.minimum}:{},...y.maximum!==void 0?{maximum:y.maximum}:{},...y.exclusiveMinimum!==void 0?{exclusiveMinimum:y.exclusiveMinimum}:{},...y.exclusiveMaximum!==void 0?{exclusiveMaximum:y.exclusiveMaximum}:{},...y.multipleOf!==void 0?{multipleOf:y.multipleOf}:{},...y.minItems!==void 0?{minItems:y.minItems}:{},...y.maxItems!==void 0?{maxItems:y.maxItems}:{},...y.uniqueItems!==void 0?{uniqueItems:y.uniqueItems}:{},...y.nullable!==void 0?{nullable:y.nullable}:{},...y.oneOf!==void 0?{oneOf:y.oneOf}:{}}))},o=p=>{if(typeof p=="string")return p;if(!p)return"";let m=new Set;if(Array.isArray(p.variable))for(let b of p.variable)b.key&&m.add(b.key);if(m.size===0&&p.raw)return p.raw;let y="";if(p.protocol&&(y+=p.protocol+"://"),p.host&&(y+=Array.isArray(p.host)?p.host.join("."):p.host),p.port&&(y+=":"+p.port),p.path){let q=(Array.isArray(p.path)?p.path:[p.path]).map(x=>{let v=x.startsWith(":")?x.substring(1):x;return m.has(v)?":"+v:(x.startsWith(":"),x)});y+="/"+q.join("/")}return!y&&p.raw?p.raw:y},l=p=>{if(!Array.isArray(p)||p.length===0)return;let m={responses:{}};for(let y of p){let b=String(y.code||200),q,x={};if(Array.isArray(y.header))for(let P of y.header)!P.key||P.disabled||(P.key.toLowerCase()==="content-type"?q=P.value?.split(";")[0]?.trim():x[P.key]={description:String(P.value??""),schema:{type:"string"}});let v=y.body;if(typeof y.body=="string"&&y.body)try{v=JSON.parse(y.body)}catch{}let _=y.originalRequest,E;if(_){let P=typeof _.url=="string"?_.url:_.url?.raw??"";E=`${_.method||""} ${P}`.trim()||void 0}let k=y.name?y.name.replace(/[^a-zA-Z0-9_-]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"").toLowerCase()||`example_${b}`:`example_${b}`;if(m.responses[b]){let P=m.responses[b];P.examples=P.examples??{},P.examples[k]={summary:E,value:v}}else m.responses[b]={description:y.name,contentType:q,examples:{[k]:{summary:E,value:v}},...Object.keys(x).length>0?{headers:x}:{}}}return Object.keys(m.responses).length>0?m:void 0},c=p=>p.map(m=>{if(m.item)return{id:It(m.name),type:"folder",name:m.name,description:m.description,auth:r(m.auth),scripts:n(m.event),items:c(m.item)};{let y=m.request||{};return{id:It(m.name),type:"request",name:m.name,description:m.description||y.description,method:typeof y.method=="string"?y.method:"GET",url:o(y.url),query:s(y.url),headers:Array.isArray(y.header)?y.header.map(b=>({key:b.key||b.name||"",value:b.value||b.value||"",enabled:b.disabled!==!0,...b.description!==void 0?{description:b.description}:{},...b.type!==void 0?{type:b.type}:{},...b.required!==void 0?{required:b.required}:{},...b.format!==void 0?{format:b.format}:{},...b.enum!==void 0?{enum:b.enum}:{},...b.deprecated!==void 0?{deprecated:b.deprecated}:{},...b.pattern!==void 0?{pattern:b.pattern}:{},...b.minLength!==void 0?{minLength:b.minLength}:{},...b.maxLength!==void 0?{maxLength:b.maxLength}:{},...b.minimum!==void 0?{minimum:b.minimum}:{},...b.maximum!==void 0?{maximum:b.maximum}:{},...b.exclusiveMinimum!==void 0?{exclusiveMinimum:b.exclusiveMinimum}:{},...b.exclusiveMaximum!==void 0?{exclusiveMaximum:b.exclusiveMaximum}:{},...b.multipleOf!==void 0?{multipleOf:b.multipleOf}:{},...b.minItems!==void 0?{minItems:b.minItems}:{},...b.maxItems!==void 0?{maxItems:b.maxItems}:{},...b.uniqueItems!==void 0?{uniqueItems:b.uniqueItems}:{},...b.nullable!==void 0?{nullable:b.nullable}:{},...b.oneOf!==void 0?{oneOf:b.oneOf}:{}})):[],body:(()=>{let b=y.body;if(b){if(b.mode==="raw"&&b.raw){let q=b.options?.raw?.language;return{type:"raw",format:q==="xml"?"xml":q==="html"?"html":q==="javascript"?"javascript":q==="text"?"text":"json",content:b.raw}}if(b.mode==="urlencoded"&&Array.isArray(b.urlencoded))return{type:"x-www-form-urlencoded",content:b.urlencoded.map(q=>({key:q.key||"",value:q.value||"",enabled:q.disabled!==!0}))};if(b.mode==="formdata"&&Array.isArray(b.formdata))return{type:"form-data",content:b.formdata.map(q=>({key:q.key||"",value:q.value||"",type:q.type||"text",enabled:q.disabled!==!0}))};if(b.mode==="graphql"&&b.graphql){let q;if(b.graphql.variables)try{q=JSON.parse(b.graphql.variables)}catch{q=void 0}return{type:"graphql",content:{query:b.graphql.query||"",variables:q}}}if(b.mode==="binary")return{type:"binary",content:""}}})(),auth:r(y.auth),scripts:n(m.event),settings:i(m.protocolProfileBehavior),responseSchema:l(m.response)}}}),d={id:It(e.info?.name||"Imported Postman Collection"),name:e.info?.name||"Imported Postman Collection",description:e.info?.description,auth:r(e.auth),scripts:n(e.event),variables:Array.isArray(e.variable)?Object.fromEntries(e.variable.filter(p=>p&&p.key).map(p=>[p.key,String(p.value??"")])):typeof e.variable=="object"&&e.variable!==null?Object.fromEntries(Object.entries(e.variable).map(([p,m])=>[p,String(m??"")])):void 0,items:c(e.item||[])};return await this.saveCollection(d),d}async exportCollection(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=Bz(n),s=JSON.stringify(i,null,2);Dt.writeFileSync(r,s,"utf-8")}async exportCollectionAsRestClientFolder(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=mi.join(r,Bt(n.name));Dt.mkdirSync(i,{recursive:!0});let s=n.variables||{};Ka(mi.join(i,`${Bt(n.name)}.env`),s),Zu(i,Bt(n.name),n.scripts),yd(n.items,i,n)}dispose(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.fileWatcher?.dispose()}}});var rr,ko,Ps,r_=le(()=>{"use strict";rr={version:"1.0",storage:{format:"folder",root:"./.http-forge/assets",history:"./.http-forge/.cache/histories",results:"./.http-forge/.cache/results"},request:{timeout:3e4,followRedirects:!0,maxRedirects:10,strictSSL:!0,tls:{},certificates:[]},scripts:{modulePaths:["./.http-forge/assets/src","./.http-forge/assets/lib"],scope:"shared",timeout:5e3},runner:{resultsRetentionDays:7,indexPageSize:1e3,recentErrorsLimit:20},environments:{default:"dev"},restClientExport:{path:"collections-rest-client",mergeGlobals:!0},mcp:{port:3100,excludedCollections:[],excludedSuites:[],toolPrefix:"",maxRequestsPerCall:500,toolMode:"auto",drilldownThreshold:100,toolPageSize:200,cors:{allowedOrigins:["http://localhost","http://127.0.0.1"]}},proxy:null,secrets:{providers:{aws:{provider:"aws"},azure:{provider:"azure",vaultUrl:""},gcp:{provider:"gcp"},vault:{provider:"vault"},op:{provider:"1password"},doppler:{provider:"doppler"}}}},ko={preferred:".http-forge/http-forge.config.json",legacy:"http-forge.config.json"},Ps={collections:"collections",environments:"environments",flows:"flows",suites:"suites"}});var Vt,Jt,ks,sg=le(()=>{"use strict";Vt=ve(require("fs")),Jt=ve(require("path"));r_();ks=class{constructor(e,r,n){this.workspacePath=e;this.fileWatcherFactory=r;this.notifications=n;this.configPath=this.resolveConfigPath(),this.config=this.loadConfig(),this.setupFileWatcher()}workspacePath;fileWatcherFactory;notifications;config;configPath;fileWatchers=[];resolveConfigPath(){let e=Jt.join(this.workspacePath,ko.preferred);if(Vt.existsSync(e))return e;let r=Jt.join(this.workspacePath,ko.legacy);return Vt.existsSync(r)?r:e}loadConfig(){if(this.configPath=this.resolveConfigPath(),!Vt.existsSync(this.configPath))return{...rr};try{let e=Vt.readFileSync(this.configPath,"utf-8"),r=JSON.parse(e);return this.mergeWithDefaults(r)}catch(e){return console.error("[ConfigService] Failed to load config:",e),this.notifications?.showWarning(`Failed to parse ${Jt.relative(this.workspacePath,this.configPath)}. Using default configuration.`),{...rr}}}mergeWithDefaults(e){return{version:e.version??rr.version,storage:{...rr.storage,...e.storage},request:{...rr.request,...e.request},scripts:{...rr.scripts,...e.scripts},runner:{...rr.runner,...e.runner},environments:{...rr.environments,...e.environments},restClientExport:{...rr.restClientExport,...e.restClientExport},proxy:e.proxy!==void 0?e.proxy:rr.proxy,mcp:{...rr.mcp,...e.mcp,cors:{...rr.mcp.cors,...e.mcp?.cors}},secrets:{...rr.secrets,...e.secrets,providers:{...rr.secrets?.providers,...e.secrets?.providers}}}}setupFileWatcher(){if(!this.fileWatcherFactory)return;let e=()=>{this.reload()};for(let r of[ko.preferred,ko.legacy]){let n=this.fileWatcherFactory.createFileWatcher(this.workspacePath,r);n.onDidChange(e),n.onDidCreate(e),n.onDidDelete(e),this.fileWatchers.push(n)}}getConfig(){return this.config}getStorageConfig(){return this.config.storage}getRequestConfig(){return this.config.request}getScriptsConfig(){return this.config.scripts}getRunnerConfig(){return this.config.runner}getEnvironmentsConfig(){return this.config.environments}getRestClientExportPath(){let e=this.config.restClientExport?.path||"collections-rest-client";return Jt.isAbsolute(e)?e:this.resolvePath(e)}getRestClientMergeGlobals(){return this.config.restClientExport?.mergeGlobals??!0}getProxyConfig(){return this.config.proxy??null}getMcpConfig(){let e=this.config.mcp??rr.mcp,r=["flat","drilldown","auto"];return{...e,port:Math.min(65535,Math.max(1,Math.floor(e.port??3100))),toolMode:r.includes(e.toolMode)?e.toolMode:"auto",drilldownThreshold:Math.min(500,Math.max(10,e.drilldownThreshold??100)),toolPageSize:e.toolPageSize===0?0:Math.min(1e3,Math.max(10,e.toolPageSize??200)),maxRequestsPerCall:Math.min(1e4,Math.max(1,e.maxRequestsPerCall??500))}}resolvePath(e){let r=e.startsWith("./")?e.slice(2):e;return Jt.join(this.workspacePath,...r.split("/"))}hasFolderCollectionsAtRoot(e){let r=Jt.join(e,Ps.collections);if(!Vt.existsSync(r))return!1;let n;try{n=Vt.readdirSync(r,{withFileTypes:!0})}catch{return!1}return n.some(i=>{if(!i.isDirectory())return!1;let s=Jt.join(r,i.name,"collection.json");return Vt.existsSync(s)})}hasAnyEntries(e){if(!Vt.existsSync(e))return!1;try{return Vt.readdirSync(e).length>0}catch{return!1}}resolveStorageRootPath(){let e=this.resolvePath(this.config.storage.root);return this.configExists()||this.hasFolderCollectionsAtRoot(e)?e:[Jt.join(this.workspacePath,"http-forge-assets")].find(i=>this.hasFolderCollectionsAtRoot(i))||e}getRootPath(){return this.resolveStorageRootPath()}getCollectionsPath(){return Jt.join(this.getRootPath(),Ps.collections)}getEnvironmentsPath(){return Jt.join(this.getRootPath(),Ps.environments)}getFlowsPath(){return Jt.join(this.getRootPath(),Ps.flows)}getHistoryPath(){let e=this.resolvePath(this.config.storage.history);if(this.configExists()||this.hasAnyEntries(e))return e;let r=Jt.join(this.workspacePath,".http-forge-cache","histories");return this.hasAnyEntries(r)?r:e}getResultsPath(){let e=this.resolvePath(this.config.storage.results);if(this.configExists()||this.hasAnyEntries(e))return e;let r=Jt.join(this.workspacePath,".http-forge-cache","results");return this.hasAnyEntries(r)?r:e}getSuitesPath(){return Jt.join(this.getRootPath(),Ps.suites)}getModulePaths(){return this.config.scripts.modulePaths.map(e=>this.resolvePath(e))}getScriptScope(){return this.config.scripts.scope??"shared"}getScriptTimeout(){return this.config.scripts.timeout??5e3}getWorkspacePath(){return this.workspacePath}reload(){this.configPath=this.resolveConfigPath(),this.config=this.loadConfig()}configExists(){return Vt.existsSync(this.resolveConfigPath())}async createDefaultConfig(){await Vt.promises.mkdir(Jt.dirname(this.configPath),{recursive:!0});let e=JSON.stringify(rr,null,2);await Vt.promises.writeFile(this.configPath,e,"utf-8");let r=[this.getCollectionsPath(),this.getEnvironmentsPath(),this.getFlowsPath(),this.getSuitesPath()];for(let i of r)Vt.existsSync(i)||await Vt.promises.mkdir(i,{recursive:!0});let n=[this.getHistoryPath(),this.getResultsPath()];for(let i of n)Vt.existsSync(i)||await Vt.promises.mkdir(i,{recursive:!0});await this.createSampleEnvironments()}async createSampleEnvironments(){let e=this.getEnvironmentsPath(),r={id:"globals",name:"Global Variables",variables:{appName:"HTTP Forge"}};await Vt.promises.writeFile(Jt.join(e,"globals.json"),JSON.stringify(r,null,2),"utf-8");let n={id:"env_dev",name:"Development",variables:{baseUrl:"http://localhost:3000",apiVersion:"v1"}};await Vt.promises.writeFile(Jt.join(e,"dev.json"),JSON.stringify(n,null,2),"utf-8");let i={id:"default_headers",name:"Default Headers",headers:{"Content-Type":"application/json",Accept:"application/json"}};await Vt.promises.writeFile(Jt.join(e,"default-headers.json"),JSON.stringify(i,null,2),"utf-8")}dispose(){for(let e of this.fileWatchers)e.dispose();this.fileWatchers=[]}}});var Yz,tc,n_=le(()=>{"use strict";ka();Yz="httpForge.cookies",tc=class{constructor(e,r=Yz){this.store=e;this.storeKey=r;this.loadCookies()}store;storeKey;cookies=new Map;loadCookies(){try{let e=this.store.get(this.storeKey);e&&(this.cookies=new Map(Object.entries(e)),this.cleanExpiredCookies())}catch(e){console.error("[CookieService] Failed to load cookies:",e)}}async saveCookies(){try{let e={};this.cookies.forEach((r,n)=>{e[n]=r}),await this.store.update(this.storeKey,e)}catch(e){console.error("[CookieService] Failed to save cookies:",e)}}getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}get(e,r){if(r){let s=this.getCookieKey(e,r),o=this.cookies.get(s);if(o&&!this.isExpired(o))return o}let n=this.getCookieKey(e,"*"),i=this.cookies.get(n);if(i&&!this.isExpired(i))return i;for(let s of this.cookies.values())if(s.name===e&&!this.isExpired(s))if(r&&s.domain){if(this.domainMatches(r,s.domain))return s}else return s}async set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e),await this.saveCookies()}async setFromResponse(e){for(let r of e){let n=this.getCookieKey(r.name,r.domain,r.path);this.cookies.set(n,r)}await this.saveCookies()}has(e,r){return this.get(e,r)!==void 0}async delete(e,r,n){let i=this.getCookieKey(e,r,n),s=this.cookies.delete(i);return s&&await this.saveCookies(),s}getAll(e){let r=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&r.push(n):r.push(n));return r}getCookieHeader(e){let r=this.getAll(e);return _t.formatCookieHeader(r)}async clear(){this.cookies.clear(),await this.saveCookies()}async clearDomain(e){let r=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&r.push(n);for(let n of r)this.cookies.delete(n);await this.saveCookies()}parseCookieHeaders(e,r){return _t.parseCookieHeaders(e,r)}isExpired(e){return _t.isExpired(e)}cleanExpiredCookies(){let e=[];for(let[r,n]of this.cookies.entries())this.isExpired(n)&&e.push(r);for(let r of e)this.cookies.delete(r);e.length>0&&this.saveCookies()}domainMatches(e,r){return _t.domainMatches(e,r)}get count(){return this.cookies.size}}});var rc,i_=le(()=>{"use strict";ka();rc=class{constructor(e){this.cookieService=e;this.localCache=[...e.getAll()]}cookieService;localCache=[];pendingOperations=[];get(e,r){return r?this.localCache.find(n=>n.name===e&&(!n.domain||n.domain===r||r.endsWith(n.domain))):this.localCache.find(n=>n.name===e)}has(e,r){return this.get(e,r)!==void 0}set(e){let r=this.localCache.findIndex(n=>n.name===e.name&&(!e.domain||n.domain===e.domain));r>=0?this.localCache[r]=e:this.localCache.push(e),this.pendingOperations.push({type:"set",cookie:e})}delete(e,r,n){let i=this.localCache.findIndex(s=>s.name===e&&(!r||s.domain===r||s.domain&&r.endsWith(s.domain)));return i>=0&&this.localCache.splice(i,1),this.pendingOperations.push({type:"delete",name:e,domain:r,path:n}),!0}getAll(e){return e?this.localCache.filter(r=>{let n=r.domain||"";return n===e||e.endsWith(n)}):[...this.localCache]}getCookiesForDomain(e){return this.localCache.filter(r=>{let n=r.domain||"";return n===e||e.endsWith(n)})}async setCookiesFromResponse(e,r){let n=new URL(e).hostname,i=this.cookieService.parseCookieHeaders(r,n);i.length>0&&(i.forEach(s=>{let o=this.localCache.findIndex(l=>l.name===s.name&&l.domain===(s.domain||n));o>=0?this.localCache[o]=s:this.localCache.push(s)}),await this.cookieService.setFromResponse(i))}getCookieHeader(e){let r=new URL(e).hostname,n=new URL(e).pathname,i=this.localCache.filter(s=>!(_t.isExpired(s)||s.domain&&!_t.domainMatches(r,s.domain)||!s.domain||s.path&&!n.startsWith(s.path)));if(i.length!==0)return _t.formatCookieHeader(i)}clear(){this.localCache=[],this.pendingOperations.push({type:"clear"})}async flush(){for(let e of this.pendingOperations)switch(e.type){case"set":e.cookie&&await this.cookieService.set(e.cookie);break;case"delete":e.name&&await this.cookieService.delete(e.name,e.domain,e.path);break;case"clear":await this.cookieService.clear();break}this.pendingOperations=[]}}});function vd(t){try{let e=JSON.parse(typeof t=="string"?t:t.toString("utf-8"));if(!e)return null;let r=e.environment||e,n=r.name||e.name||"imported-environment",i=r.values||r.variables||e.values||e.variables||[],s={};if(Array.isArray(i))for(let l of i){if(!l)continue;let c=l.key??l.name,d=typeof l.enabled=="boolean"?l.enabled:!0;c&&d!==!1&&(s[c]=l.value??l.initial??"")}else if(typeof i=="object"&&i!==null)for(let[l,c]of Object.entries(i))s[l]=String(c??"");let o=r._postman_exported_at?"Imported from Postman export":r.description||"";return{name:n,variables:s,description:o}}catch{return null}}async function PP(t,e){try{let r=await e.readFile(t);return vd(r)}catch{return null}}var s_=le(()=>{"use strict"});var ur,Cn,bd,nc,o_=le(()=>{"use strict";ur=ve(require("fs")),Cn=ve(require("path"));Un();s_();ig();sm();Af();bd={SELECTED_ENVIRONMENT:"httpForge.selectedEnvironment",ENV_OVERRIDES_PREFIX:"httpForge.envOverrides."},nc=class{constructor(e,r,n,i,s,o=!0){this.workspaceFolder=e;this.workspaceStore=r;this.configService=n;this.fileWatcherFactory=i;this.secretStore=s;this.persistOverrides=o;let l=n.getEnvironmentsPath();this.environmentsPath=l,this.sharedConfigPath=Cn.join(l,"_global.json"),this.localConfigPath=Cn.join(l,"_global.local.json"),this.historiesPath=n.getHistoryPath(),this.selectedEnvironment=r?.get(bd.SELECTED_ENVIRONMENT,"dev")??"dev",this.localGlobalValues={},this.localEnvironmentValues=new Map,this.persistOverrides&&this.loadPersistedEnvironmentOverrides(),this.loadSecretVariables(this.selectedEnvironment).catch(()=>{}),this.setupFileWatcher()}workspaceFolder;workspaceStore;configService;fileWatcherFactory;secretStore;persistOverrides;environmentsPath;sharedConfigPath;localConfigPath;historiesPath;sharedConfig=null;localConfig=null;selectedEnvironment="dev";fileWatcher;localGlobalValues={};localEnvironmentValues=new Map;secretValuesCache=new Map;onEnvironmentsChanged;setupFileWatcher(){if(!this.fileWatcherFactory||!ur.existsSync(this.environmentsPath))return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.environmentsPath,"**/*.json");let e=()=>{this.reload(),this.onEnvironmentsChanged?.()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}dispose(){this.fileWatcher?.dispose()}getWorkspaceFolder(){return this.workspaceFolder}getRootPath(){return this.configService.getRootPath()}loadConfigs(){if(!ur.existsSync(this.environmentsPath)){this.sharedConfig={environments:{},globalVariables:{},defaultHeaders:{}},this.localConfig={credentials:{},variables:{}};return}this.loadFolderConfigs()}getSharedConfig(){return this.sharedConfig||this.loadConfigs(),this.sharedConfig}getLocalConfig(){return this.localConfig||this.loadConfigs(),this.localConfig}getEnvironmentNames(){let e=this.getSharedConfig();return e?.environments?Object.keys(e.environments):[]}getSelectedEnvironment(){return this.selectedEnvironment}async setSelectedEnvironment(e){if(this.selectedEnvironment=e,await this.workspaceStore?.update(bd.SELECTED_ENVIRONMENT,e),!this.localEnvironmentValues.has(e)){let r=this.getEnvOverridesStateKey(e),n=this.workspaceStore?.get(r,{});n&&Object.keys(n).length>0&&this.localEnvironmentValues.set(e,{...n})}await this.loadSecretVariables(e)}getEnvOverridesStateKey(e){return`${bd.ENV_OVERRIDES_PREFIX}${e||this.selectedEnvironment}`}loadPersistedEnvironmentOverrides(){let e=this.getEnvOverridesStateKey(),r=this.workspaceStore?.get(e,{});r&&Object.keys(r).length>0&&this.localEnvironmentValues.set(this.selectedEnvironment,{...r})}persistEnvironmentOverrides(e){if(!this.persistOverrides)return;let r=this.getEnvOverridesStateKey(e),n=this.localEnvironmentValues.get(e)||{};this.workspaceStore?.update(r,n)}setEnvironmentVariable(e,r,n){let i=n??this.selectedEnvironment;this.localEnvironmentValues.has(i)||this.localEnvironmentValues.set(i,{}),this.localEnvironmentValues.get(i)[e]=String(r),this.persistEnvironmentOverrides(i)}deleteEnvironmentVariable(e,r){let n=r??this.selectedEnvironment,i=this.localEnvironmentValues.get(n);i&&(delete i[e],this.persistEnvironmentOverrides(n))}clearEnvironmentVariables(e){let r=e??this.selectedEnvironment;this.localEnvironmentValues.set(r,{}),this.persistEnvironmentOverrides(r)}async resetEnvironmentOverrides(e){let r=e||this.selectedEnvironment;this.localEnvironmentValues.delete(r),await this.workspaceStore?.update(this.getEnvOverridesStateKey(r),void 0)}getEnvironmentVariableLocal(e){return this.localEnvironmentValues.get(this.selectedEnvironment)?.[e]}getEnvironmentVariableLocals(){return{...this.localEnvironmentValues.get(this.selectedEnvironment)||{}}}setGlobalVariable(e,r){this.localGlobalValues[e]=String(r)}getGlobalVariable(e){return this.getSharedConfig()?.globalVariables?.[e]}getGlobalVariableLocal(e){return this.localGlobalValues[e]}getGlobalVariables(){return{...this.getSharedConfig()?.globalVariables||{},...this.getLocalConfig()?.variables||{},...this.localGlobalValues}}getGlobalVariableLocals(){return{...this.localGlobalValues}}deleteGlobalVariable(e){delete this.localGlobalValues[e]}clearGlobalVariables(){this.localGlobalValues={}}getResolvedEnvironment(e){let r=e||this.selectedEnvironment,n=this.getSharedConfig(),i=this.getLocalConfig();if(!n?.environments?.[r])return null;let s=n.environments[r],o=i?.credentials?.[r],l=i?.variables||{},c=o?.variables||{},d=o&&o.headers||{},p=gu(n.defaultHeaders||{},d),m=this.localEnvironmentValues.get(r)||{},y=this.secretValuesCache.get(r)||{},b={...s.variables||{},...c,...m,...y};return{name:r,description:s.description,requiresConfirmation:s.requiresConfirmation,headers:p,variables:b}}async getSecretVariable(e,r){return this.secretStore?.get(`${e}:${r}`)}async setSecretVariable(e,r,n){await this.secretStore?.store(`${e}:${r}`,n),this.secretValuesCache.has(e)||this.secretValuesCache.set(e,{}),this.secretValuesCache.get(e)[r]=n}async deleteSecretVariable(e,r){await this.secretStore?.delete(`${e}:${r}`),this.secretValuesCache.get(e)&&delete this.secretValuesCache.get(e)[r]}async loadSecretVariables(e){if(!this.secretStore)return;let r=e||this.selectedEnvironment,n=this.getSharedConfig()?.environments?.[r]?.secretVariables??[];if(n.length===0)return;let i={};await Promise.all(n.map(async s=>{let o=await this.secretStore.get(`${r}:${s}`);o!==void 0&&(i[s]=o)})),this.secretValuesCache.set(r,i)}resolveVariables(e,r){return this.createResolver(r).resolveString(e,!0)}exportEnvironmentsToFolder(e,r=!0){let n=this.getEnvironmentNames(),i=this.getSharedConfig(),s=i?.globalVariables?{...i.globalVariables}:{};if(!r&&Object.keys(s).length){let o=Cn.join(e,"globals.env");Ka(o,s)}n.forEach(o=>{let l=i?.environments?.[o];if(!l)return;let c={...l.variables||{}};r&&(c={...s,...c});let d=Cn.join(e,`${Bt(o)}.env`);Ka(d,c)})}resolveVariablesWithExtra(e,r,n){return this.createResolver(n,r).resolveString(e,!0)}resolveVariablesInObject(e,r){return this.createResolver(r).resolveObject(e,!0)}resolveVariablesInObjectWithExtra(e,r,n){return this.createResolver(n,r).resolveObject(e,!0)}getHistoriesPath(){return this.historiesPath}getSharedConfigPath(){return this.sharedConfigPath}getLocalConfigPath(){return this.localConfigPath}getEnvironmentConfigPath(e){return Cn.join(this.environmentsPath,`${e}.json`)}localConfigExists(){return ur.existsSync(this.localConfigPath)}saveSharedConfig(e){this.saveFolderSharedConfig(e),this.sharedConfig=e}saveLocalConfig(e){let r={variables:e.variables||{}};this.saveJsonFile(this.localConfigPath,r);for(let[n,i]of Object.entries(e.credentials||{})){let s=this.getEnvLocalConfigPath(n),o={variables:i.variables||{}};this.saveJsonFile(s,o)}this.localConfig=e}importPostmanEnvironmentFile(e){try{let r=ur.readFileSync(e,"utf-8"),n=vd(r);if(!n)throw new Error("Failed to parse Postman environment file");this.sharedConfig||this.loadConfigs(),this.sharedConfig||(this.sharedConfig={environments:{},globalVariables:{},defaultHeaders:{}});let i=n.name||`imported-${Date.now()}`;return this.sharedConfig.environments=this.sharedConfig.environments||{},this.sharedConfig.environments[i]=this.sharedConfig.environments[i]||{},this.sharedConfig.environments[i].variables=n.variables,n.description&&(this.sharedConfig.environments[i].description=n.description),this.saveSharedConfig(this.sharedConfig),n}catch(r){throw console.error("[EnvironmentConfigService] importPostmanEnvironmentFile failed:",r),r}}saveEnvLocalConfig(e,r){let n=this.getEnvLocalConfigPath(e),i={variables:r};this.saveJsonFile(n,i),this.localConfig||(this.localConfig={credentials:{},variables:{}}),this.localConfig.credentials||(this.localConfig.credentials={}),this.localConfig.credentials[e]={variables:r}}getEnvLocalPath(e){return this.getEnvLocalConfigPath(e)}getEnvLocalConfigPath(e){return Cn.join(this.environmentsPath,`${e}.local.json`)}loadFolderConfigs(){let e=wu(this.environmentsPath);this.sharedConfig={environments:e.environments,globalVariables:e.globalVariables,defaultHeaders:e.defaultHeaders},this.localConfig={credentials:e.localCredentials,variables:e.localVariables}}createResolver(e,r){let i=this.getResolvedEnvironment(e)?.variables||{},s=this.getGlobalVariables(),o=this.getGlobalVariableLocals();return new yo({globals:s,collectionVariables:{},environmentVariables:i,variables:{...o,...r||{}}})}saveFolderSharedConfig(e){ur.existsSync(this.environmentsPath)||ur.mkdirSync(this.environmentsPath,{recursive:!0});let r={variables:e.globalVariables||{},defaultHeaders:e.defaultHeaders||{}};this.saveJsonFile(this.sharedConfigPath,r);let n=ur.readdirSync(this.environmentsPath).filter(s=>s.endsWith(".json")).filter(s=>!Of(s)),i=new Set(Object.keys(e.environments||{}));for(let s of n){let o=Cn.basename(s,".json");if(!i.has(o))try{ur.unlinkSync(Cn.join(this.environmentsPath,s))}catch{}}for(let[s,o]of Object.entries(e.environments||{})){let l={name:s,description:o.description,requiresConfirmation:o.requiresConfirmation,variables:o.variables||{}};this.saveJsonFile(Cn.join(this.environmentsPath,`${s}.json`),l)}}reload(){this.sharedConfig=null,this.localConfig=null,this.loadConfigs()}getAllEnvironments(){return this.loadConfigs(),this.sharedConfig?Object.entries(this.sharedConfig.environments).map(([e,r])=>({id:e,name:e,active:e===this.selectedEnvironment,variables:r.variables||{}})):[]}async setActiveEnvironment(e){await this.setSelectedEnvironment(e)}async createEnvironment(e){if(this.loadConfigs(),this.sharedConfig||(this.sharedConfig={environments:{},globalVariables:{}}),this.sharedConfig.environments[e])throw new Error(`Environment "${e}" already exists`);this.sharedConfig.environments[e]={description:`Created ${new Date().toISOString()}`,variables:{}},this.saveSharedConfig(this.sharedConfig)}async deleteEnvironment(e){if(this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentExists(e),delete this.sharedConfig.environments[e],this.selectedEnvironment===e){let r=Object.keys(this.sharedConfig.environments);this.selectedEnvironment=r.length>0?r[0]:"dev",await this.workspaceStore?.update(bd.SELECTED_ENVIRONMENT,this.selectedEnvironment)}this.saveSharedConfig(this.sharedConfig)}async duplicateEnvironment(e,r){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(r),this.validateEnvironmentExists(e),this.validateEnvironmentNameNotTaken(r);let n=this.sharedConfig.environments[e];this.sharedConfig.environments[r]=JSON.parse(JSON.stringify(n)),this.sharedConfig.environments[r].description=`Copied from ${e}`,this.saveSharedConfig(this.sharedConfig)}async renameEnvironment(e,r){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(r),this.validateEnvironmentExists(e),r!==e&&(this.validateEnvironmentNameNotTaken(r),this.sharedConfig.environments[r]=this.sharedConfig.environments[e],delete this.sharedConfig.environments[e],this.selectedEnvironment===e&&(this.selectedEnvironment=r,await this.workspaceStore?.update(bd.SELECTED_ENVIRONMENT,r)),this.saveSharedConfig(this.sharedConfig))}validateEnvironmentName(e){if(!e||e.trim().length===0)throw new Error("Environment name cannot be empty");if(e.length>128)throw new Error("Environment name cannot exceed 128 characters");if(!/^[a-zA-Z0-9_\-\.]+$/.test(e))throw new Error("Environment name can only contain letters, numbers, hyphens, underscores, and dots")}validateEnvironmentExists(e){if(!this.sharedConfig?.environments?.[e])throw new Error(`Environment "${e}" not found`)}validateEnvironmentNameNotTaken(e){if(this.sharedConfig?.environments?.[e])throw new Error(`Environment "${e}" already exists`)}validateConfigLoaded(){if(!this.sharedConfig)throw new Error("No environment configuration loaded")}async updateEnvironmentVariables(e,r){if(this.loadConfigs(),!this.sharedConfig)throw new Error("No configuration loaded");let n=this.sharedConfig.environments[e];if(!n)throw new Error(`Environment "${e}" not found`);n.variables=r,this.saveSharedConfig(this.sharedConfig)}loadJsonFile(e){try{if(!ur.existsSync(e))return null;let r=ur.readFileSync(e,"utf-8");return JSON.parse(r)}catch(r){return console.error(`Failed to load JSON from ${e}:`,r),null}}saveJsonFile(e,r){try{let n=Cn.dirname(e);ur.existsSync(n)||ur.mkdirSync(n,{recursive:!0}),ur.writeFileSync(e,JSON.stringify(r,null,2),"utf-8")}catch(n){throw console.error(`Failed to save JSON to ${e}:`,n),n}}}});var As,og=le(()=>{"use strict";hd();As=class t{constructor(e,r,n,i,s,o,l,c,d,p,m,y,b){this.httpService=e;this.scriptExecutor=r;this.envConfigService=n;this.requestPreparer=i;this.environment=s;this.cookieJar=o;this.collectionScripts=l;this.folderScriptsChain=c;this.onConsoleOutput=d;this.collectionName=p;this.collectionAuth=m;this.iteration=y;this.iterationCount=b}httpService;scriptExecutor;envConfigService;requestPreparer;environment;cookieJar;collectionScripts;folderScriptsChain;onConsoleOutput;collectionName;collectionAuth;iteration;iterationCount;async execute(e,r,n){let i=Date.now();return this.executeWithSession(e,r,n,i)}async executeWithSession(e,r,n,i){let s=this.collectPreRequestScripts(e),o=this.collectPostResponseScripts(e),l=this.envConfigService.getResolvedEnvironment(this.environment);if(!l)throw new Error(`Environment "${this.environment}" not found or not configured`);let c=this.envConfigService.getGlobalVariables(),d={request:e,variables:{...r},environmentVariables:l.variables||{},globals:{...c},environmentName:this.environment,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:this.collectionName,iteration:this.iteration,iterationCount:this.iterationCount},onEnvironmentChange:async(y,b,q)=>{y==="set"&&b&&q!==void 0?this.envConfigService.setEnvironmentVariable(b,q,this.environment):y==="unset"&&b?this.envConfigService.deleteEnvironmentVariable(b,this.environment):y==="clear"&&this.envConfigService.clearEnvironmentVariables(this.environment)},onGlobalsChange:(y,b,q)=>{y==="set"&&b&&q!==void 0?this.envConfigService.setGlobalVariable(b,q):y==="unset"&&b?this.envConfigService.deleteGlobalVariable(b):y==="clear"&&this.envConfigService.clearGlobalVariables()}},p=this.scriptExecutor.createRequestSession(d),m=null;try{let y={...r},b={...e},q;if((!b.auth||b.auth.type==="inherit")&&(b.auth=this.collectionAuth&&this.collectionAuth.type!=="inherit"?this.collectionAuth:void 0),s.length>0){let D=await p.executePreRequest(s);if(D.consoleOutput&&D.consoleOutput.length>0&&this.onConsoleOutput?.(D.consoleOutput,{requestName:e.name||"",phase:"pre-request"}),D.nextRequest!==void 0&&(q=D.nextRequest),D.skipRequest){let J={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:e.url||"",method:e.method||"GET",headers:{},body:J,params:{},query:{}},response:{status:0,statusText:"Skipped",headers:{},body:null,time:0,cookies:[]},duration:Date.now()-i,timestamp:Date.now(),passed:!0,assertions:[],modifiedVariables:y,nextRequest:q}}D.success&&(D.modifiedRequest&&(D.modifiedRequest.url&&(b.url=D.modifiedRequest.url),D.modifiedRequest.headers&&(b.headers=D.modifiedRequest.headers),D.modifiedRequest.params&&(b.params=D.modifiedRequest.params),D.modifiedRequest.query&&(b.query=D.modifiedRequest.query),D.modifiedRequest.body!==void 0&&(b.body=D.modifiedRequest.body)),(D.localVariables??D.modifiedVariables)&&(y=D.localVariables??D.modifiedVariables))}m=await this.requestPreparer.prepareRequest(b,this.environment,l,y);let{url:x,headers:v,body:_,method:E}=m,k={};for(let D in v)Object.prototype.hasOwnProperty.call(v,D)&&(k[D.toUpperCase()]=v[D]);if(!k.COOKIE&&b.settings?.includeCookies!==!1&&this.cookieJar){let J=this.cookieJar.getCookieHeader(x);J&&(k.COOKIE=J)}let P={method:E,url:x,headers:k,body:_.content,signal:n,settings:b.settings?{...b.settings}:void 0},M=await this.httpService.execute(P);this.cookieJar&&M.headers&&await this.cookieJar.setCookiesFromResponse(x,M.headers);let j=Date.now()-i,I=[],R={},A;if(o.length>0){let D=0;if(M.body)if(typeof M.body=="string")D=Buffer.byteLength(M.body,"utf8");else if(Buffer.isBuffer(M.body))D=M.body.length;else try{D=Buffer.byteLength(JSON.stringify(M.body),"utf8")}catch{D=0}let J=Zm(M.headers,M.cookies,m.url),Q={executedRequest:m,status:M.status,statusText:M.statusText,headers:Qm(M.headers||{}),body:M.body,cookies:J,responseTime:M.time,responseSize:D},se=await p.executePostResponse(o,Q);I=se.testResults,R=se.modifiedEnvironmentVariables||{},A=se.visualizerData,(se.localVariables??se.modifiedVariables)&&(y=se.localVariables??se.modifiedVariables),se.nextRequest!==void 0&&(q=se.nextRequest),se.consoleOutput&&se.consoleOutput.length>0&&this.onConsoleOutput?.(se.consoleOutput,{requestName:e.name||"",phase:"post-response"})}let F=I.length===0||I.every(D=>D.passed),U=I.length>0?F:M.status>=200&&M.status<=302;return{requestId:e.id,name:e.name,executedRequest:{...m,headers:k},response:{status:M.status,statusText:M.statusText,headers:M.headers||{},body:M.body,time:M.time||j,cookies:M.cookies||[]},duration:j,timestamp:Date.now(),passed:U,assertions:I,modifiedVariables:y,modifiedEnvironmentVariables:R,nextRequest:q,visualizerData:A}}catch(y){return this.handleError(e,m,y,i)}finally{p.dispose?.()}}collectPreRequestScripts(e){let r=[];if(this.collectionScripts?.preRequest&&r.push(this.collectionScripts.preRequest),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain))for(let n of this.folderScriptsChain)n?.preRequest&&r.push(n.preRequest);else this.folderScriptsChain.preRequest&&r.push(this.folderScriptsChain.preRequest);return e.scripts?.preRequest&&r.push(e.scripts.preRequest),r}collectPostResponseScripts(e){let r=[];if(e.scripts?.postResponse&&r.push(e.scripts.postResponse),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain)){let n=[...this.folderScriptsChain].reverse();for(let i of n)i?.postResponse&&r.push(i.postResponse)}else this.folderScriptsChain.postResponse&&r.push(this.folderScriptsChain.postResponse);return this.collectionScripts?.postResponse&&r.push(this.collectionScripts.postResponse),r}handleError(e,r,n,i){let s=Date.now()-i,o=r?.method||e.method,l=r?.url||e.url;this.onConsoleOutput?.([`${n.message||n}`],{requestName:e.name||"",phase:"error"});let c=String(n.name==="AbortError"?"Request was aborted":n.message||n),d=n?.stack?String(n.stack):"",p=this.errorBodyFormat,m,y;p==="html"||p==="both"?(m=t.formatErrorAsHtml(c,d),y={"content-type":"text/html; charset=utf-8"}):(m=c,y={});let b={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:l||"",method:o||"GET",headers:r?.headers||{},body:r?.body||b,params:r?.params||{},query:r?.query||{}},response:{status:0,statusText:n.name==="AbortError"?"Aborted":n.code||n.message||"Request Error",headers:y,cookies:[],body:m,time:0},duration:s,timestamp:Date.now(),passed:!1,assertions:[],error:c}}get errorBodyFormat(){return"text"}static formatErrorAsHtml(e,r){let n=i=>i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");return`<!doctype html>
|
|
54
|
+
`)}function Hz(t){let e=t.url;if(t.query&&t.query.length){let r=t.query.filter(n=>n.enabled!==!1).map(n=>`${encodeURIComponent(n.key)}=${encodeURIComponent(n.value)}`).join("&");r&&(e+=(e.includes("?")?"&":"?")+r)}return e}var Ya,Po,ig=le(()=>{"use strict";Ya=ve(require("fs")),Po=ve(require("path"));Un()});var Or,Q0,Qa,Z0=le(()=>{"use strict";Or=ve(require("fs")),Q0=ve(require("path"));Un();Qa=class{collectionsDir;cache=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}ensureDirectory(){Or.existsSync(this.collectionsDir)||Or.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),!Or.existsSync(this.collectionsDir))return[];let e=Or.readdirSync(this.collectionsDir),r=[];for(let n of e)if(n.endsWith(".json"))try{let i=Q0.join(this.collectionsDir,n),s=Or.readFileSync(i,"utf-8"),o=JSON.parse(s);o.id&&o.name&&(this.cache.set(o.id,o),r.push(o))}catch(i){console.error(`[JsonCollectionLoader] Failed to load ${n}:`,i)}return r}load(e){if(this.cache.has(e))return this.cache.get(e);let r=this.getCollectionPath(e);if(Or.existsSync(r))try{let n=Or.readFileSync(r,"utf-8"),i=JSON.parse(n);return this.cache.set(e,i),i}catch(n){console.error(`[JsonCollectionLoader] Failed to load collection ${e}:`,n);return}}async save(e){if(this.ensureDirectory(),!e.name)throw new Error("Collection name is required");e.id||(e.id=It(e.name));let r=this.getCollectionPath(e.id),n=JSON.stringify(e,null,2);await Or.promises.writeFile(r,n,"utf-8"),this.cache.set(e.id,e)}async delete(e){let r=this.getCollectionPath(e);if(!Or.existsSync(r))return!1;try{return await Or.promises.unlink(r),this.cache.delete(e),!0}catch(n){return console.error(`[JsonCollectionLoader] Failed to delete collection ${e}:`,n),!1}}exists(e){return Or.existsSync(this.getCollectionPath(e))}getCollectionPath(e){return Q0.join(this.collectionsDir,`${e}.json`)}getItemPath(e,r){}async create(e,r){let n={id:r||It(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,r);s&&(s.scripts=n,await this.save(i))}loadScripts(e,r){let n=this.load(e);return n?this.findItemById(n.items,r)?.scripts:void 0}async updateCollectionMetadata(e,r){let n=this.load(e);if(!n)throw new Error(`Collection ${e} not found`);r.name!==void 0&&(n.name=r.name),r.description!==void 0&&(n.description=r.description),r.version!==void 0&&(n.version=r.version),r.variables!==void 0&&(n.variables=r.variables),r.auth!==void 0&&(n.auth=r.auth),await this.save(n)}async saveItem(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,r.id);if(s)Object.assign(s,r);else if(n){let o=this.findItemById(i.items,n);if(o&&o.type==="folder")o.items=o.items||[],o.items.push(r);else throw new Error(`Parent folder ${n} not found`)}else i.items.push(r);await this.save(i)}async deleteItem(e,r){let n=this.load(e);if(!n)return!1;let i=this.deleteItemById(n.items,r);return i&&await this.save(n),i}async updateItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,r);if(!s)return!1;let{id:o,type:l,...c}=n;return Object.assign(s,c),await this.save(i),!0}async moveItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,r);if(!s)return!1;let o={...s};if(!this.deleteItemById(i.items,r))return!1;if(n){let l=this.findItemById(i.items,n);if(l&&l.type==="folder")l.items=l.items||[],l.items.push(o);else return i.items.push(o),!1}else i.items.push(o);return await this.save(i),!0}async reorderItems(e,r,n){let i=this.load(e);if(!i)return!1;try{let s;if(r){let c=this.findItemById(i.items,r);if(!c||!c.items)return!1;s=c.items}else s=i.items;let o=new Map(s.map(c=>[c.id,c])),l=[];for(let c of n){let d=o.get(c);d&&(l.push(d),o.delete(c))}for(let c of o.values())l.push(c);if(r){let c=this.findItemById(i.items,r);c&&(c.items=l)}else i.items=l;return await this.save(i),!0}catch(s){return console.error("[JsonCollectionLoader] Failed to reorder items:",s),!1}}findItemById(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,r);if(i)return i}}}deleteItemById(e,r){for(let n=0;n<e.length;n++){if(e[n].id===r)return e.splice(n,1),!0;let i=e[n];if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,r))return!0}return!1}}});var Xu,X0=le(()=>{"use strict";nm();Z0();Xu=class{static create(e){let r=e.getStorageConfig(),n=e.getCollectionsPath();return r.format==="folder"?new xs(n):new Qa(n)}static createForFormat(e,r){return e==="folder"?new xs(r):new Qa(r)}}});function IP(t){if(typeof t!="string")return"text";let e=t.trim();try{let r=JSON.parse(e);if(typeof r=="object"&&r!==null)return"json"}catch{}return/^<\?xml/.test(e)||/^<([a-zA-Z_][\w\-\.]*)[\s>]/.test(e)?/^<\!DOCTYPE html>/i.test(e)||/^<html[\s>]/i.test(e)?"html":"xml":/^<\!DOCTYPE html>/i.test(e)||/^<html[\s>]/i.test(e)?"html":/^(function\s*\(|\(\)\s*=>|const |let |var |export |import )/.test(e)?"javascript":"text"}function Bz(t){return{info:{name:t.name,_postman_id:t.id,schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},item:t.items.map(e=>OP(e)),event:e_(t.scripts),variable:t.variables?Object.entries(t.variables).map(([e,r])=>({key:e,value:r})):[]}}function OP(t){if(t.type==="folder")return{name:t.name,item:t.items?t.items.map(OP):[],event:e_(t.scripts)};if(t.type==="request"){let e=t;return{name:e.name,request:{method:e.method,header:(e.headers||[]).map(Vz),url:Wz(e),body:zz(e),auth:Jz(e.auth),description:e.description},event:e_(e.scripts),protocolProfileBehavior:Gz(e.settings)}}}function Vz(t){return{key:t.key,value:t.value,disabled:t.enabled===!1,...t.description!==void 0?{description:t.description}:{},...t.type!==void 0?{type:t.type}:{},...t.required!==void 0?{required:t.required}:{},...t.format!==void 0?{format:t.format}:{},...t.enum!==void 0?{enum:t.enum}:{},...t.deprecated!==void 0?{deprecated:t.deprecated}:{},...t.pattern!==void 0?{pattern:t.pattern}:{},...t.minLength!==void 0?{minLength:t.minLength}:{},...t.maxLength!==void 0?{maxLength:t.maxLength}:{},...t.minimum!==void 0?{minimum:t.minimum}:{},...t.maximum!==void 0?{maximum:t.maximum}:{},...t.exclusiveMinimum!==void 0?{exclusiveMinimum:t.exclusiveMinimum}:{},...t.exclusiveMaximum!==void 0?{exclusiveMaximum:t.exclusiveMaximum}:{},...t.multipleOf!==void 0?{multipleOf:t.multipleOf}:{},...t.minItems!==void 0?{minItems:t.minItems}:{},...t.maxItems!==void 0?{maxItems:t.maxItems}:{},...t.uniqueItems!==void 0?{uniqueItems:t.uniqueItems}:{},...t.nullable!==void 0?{nullable:t.nullable}:{},...t.oneOf!==void 0?{oneOf:t.oneOf}:{}}}function Wz(t){let e=t.url,r=t.url.replace(/^[a-zA-Z]+:\/\//,""),n=[],i=r.match(/^([^\/\?]+)/);if(i){let d=i[1];/^{{.*}}$/.test(d)?n=[d]:n=d.split(".")}let s=[],o=r.match(/^[^\/\?]+(\/[^\?]*)?/);if(o&&o[1]!==void 0){let d=o[1].replace(/^\//,"");d.endsWith("/")?(s=d.slice(0,-1).split("/"),s.push("")):s=d.length>0?d.split("/"):[]}let l;if(Array.isArray(t.query)&&t.query.length>0)l=t.query.map(d=>{let p={key:d.key,value:d.value};return d.enabled===!1&&(p.disabled=!0),d.description!==void 0&&(p.description=d.description),d.type!==void 0&&(p.type=d.type),d.required!==void 0&&(p.required=d.required),d.format!==void 0&&(p.format=d.format),d.enum!==void 0&&(p.enum=d.enum),d.deprecated!==void 0&&(p.deprecated=d.deprecated),d.pattern!==void 0&&(p.pattern=d.pattern),d.minLength!==void 0&&(p.minLength=d.minLength),d.maxLength!==void 0&&(p.maxLength=d.maxLength),d.minimum!==void 0&&(p.minimum=d.minimum),d.maximum!==void 0&&(p.maximum=d.maximum),d.exclusiveMinimum!==void 0&&(p.exclusiveMinimum=d.exclusiveMinimum),d.exclusiveMaximum!==void 0&&(p.exclusiveMaximum=d.exclusiveMaximum),d.multipleOf!==void 0&&(p.multipleOf=d.multipleOf),d.minItems!==void 0&&(p.minItems=d.minItems),d.maxItems!==void 0&&(p.maxItems=d.maxItems),d.uniqueItems!==void 0&&(p.uniqueItems=d.uniqueItems),d.nullable!==void 0&&(p.nullable=d.nullable),d.oneOf!==void 0&&(p.oneOf=d.oneOf),p});else{let d=r.indexOf("?");d!==-1&&(l=r.substring(d+1).split("&").map(m=>{let[y,...b]=m.split("=");return{key:y,value:b.join("=")}}))}let c;return t.params&&typeof t.params=="object"&&(c=Object.entries(t.params).map(([d,p])=>({key:d,value:String(p)}))),{raw:e,host:n.length>0?n:void 0,path:s.length>0?s:void 0,query:l&&l.length>0?l:void 0,variable:c&&c.length>0?c:void 0}}function zz(t){if(!t.body)return;let e=t.body;if(typeof e=="string"){let s=IP(e);return{mode:"raw",raw:e,options:{raw:{language:s}}}}if(e.type==="raw"){let s=e.format||IP(e.content);return{mode:"raw",raw:e.content,options:{raw:{language:s}}}}let r=e.type==="form-data"&&Array.isArray(e.content)?e.content:e.type==="formdata"&&Array.isArray(e.fields)?e.fields:null;if(r)return{mode:"formdata",formdata:r.map(s=>({key:s.key,value:s.value,type:s.type||"text",disabled:s.enabled===!1}))};let n=e.type==="x-www-form-urlencoded"&&Array.isArray(e.content)?e.content:e.type==="urlencoded"&&Array.isArray(e.fields)?e.fields:null;if(n)return{mode:"urlencoded",urlencoded:n.map(s=>({key:s.key,value:s.value,disabled:s.enabled===!1}))};if(e.type==="file"&&e.fileName)return{mode:"file",file:{src:e.fileName}};if(e.type==="binary")return{mode:"binary",file:{}};let i=e.type==="graphql"?e.content??(e.query?e:null):null;if(i){let s=i.query??"",o=i.variables;return{mode:"graphql",graphql:{query:s,variables:o?typeof o=="string"?o:JSON.stringify(o):void 0}}}if(e.content)return{mode:"raw",raw:e.content}}function Jz(t){if(!(!t||!t.type||t.type==="none")){if(t.type==="bearer")return{type:"bearer",bearer:[{key:"token",value:t.bearerToken,type:"string"}]};if(t.type==="basic"&&t.basicAuth)return{type:"basic",basic:[{key:"username",value:t.basicAuth.username,type:"string"},{key:"password",value:t.basicAuth.password,type:"string"}]}}}function Gz(t){if(!t)return;let e={};return t.followRedirects===!1&&(e.followRedirects=!1),t.followOriginalMethod===!0&&(e.followOriginalHttpMethod=!0),t.followAuthHeader===!1&&(e.followAuthorizationHeader=!1),t.maxRedirects!==void 0&&(e.maxRedirects=t.maxRedirects),t.strictSSL===!1&&(e.disableUrlEncoding=!1),t.timeout!==void 0&&(e.requestTimeout=t.timeout),Object.keys(e).length>0?e:void 0}function e_(t){if(!t)return[];let e=[];return t.preRequest&&e.push({listen:"prerequest",script:{type:"text/javascript",exec:[t.preRequest]}}),t.postResponse&&e.push({listen:"test",script:{type:"text/javascript",exec:[t.postResponse]}}),e}var Dt,mi,ec,t_=le(()=>{"use strict";Un();ig();X0();Dt=ve(require("fs")),mi=ve(require("path"));ec=class{constructor(e,r,n){this.workspaceRoot=e;this.configService=r;this.fileWatcherFactory=n;this.collectionsDir=r.getCollectionsPath(),this.loader=Xu.create(r),this.ensureCollectionsDir(),this.loadCollections(),this.setupFileWatcher()}workspaceRoot;configService;fileWatcherFactory;collectionsDir;collections=new Map;fileWatcher;loader;debounceTimer=null;selfWritePending=!1;localCollectionValues=new Map;onCollectionsChanged;ensureCollectionsDir(){Dt.existsSync(this.collectionsDir)||Dt.mkdirSync(this.collectionsDir,{recursive:!0})}loadCollections(){this.collections.clear();let e=this.loader.loadAll();for(let r of e)this.collections.set(r.id,r)}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.collectionsDir,"**/*");let e=()=>{this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null;let r=this.selfWritePending;this.selfWritePending=!1,r||this.loadCollections(),this.onCollectionsChanged?.()},300)};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}getAllCollections(){return Array.from(this.collections.values())}getCollection(e){return this.collections.get(e)}getCollectionById(e){for(let r of this.collections.values())if(r.id===e)return r}getCollectionByName(e){let r=e.toLowerCase();for(let n of this.collections.values())if(n.name.toLowerCase()===r)return n}async saveCollection(e){if(this.ensureCollectionsDir(),!e.name)throw new Error("Collection name is required");e.id||(e.id=It(e.name)),this.selfWritePending=!0,await this.loader.save(e),this.collections.set(e.id,e)}getCollectionVariables(e){let r=this.collections.get(e);return r?.variables?{...r.variables}:{}}getCollectionVariableLocals(e){return{...this.localCollectionValues.get(e)||{}}}setCollectionVariable(e,r,n){this.localCollectionValues.has(e)||this.localCollectionValues.set(e,{}),this.localCollectionValues.get(e)[r]=String(n)}deleteCollectionVariable(e,r){let n=this.localCollectionValues.get(e);n&&delete n[r]}clearCollectionVariables(e){this.localCollectionValues.set(e,{})}async deleteCollection(e){if(!this.collections.get(e))return!1;this.selfWritePending=!0;let n=await this.loader.delete(e);return n&&this.collections.delete(e),n}findRequest(e,r){let n=this.collections.get(e);if(n)return this.findItemRecursive(n.items,r)}findRequestByPath(e,r){let n=this.collections.get(e);if(!n)return;let i=r.split("/").filter(s=>s.trim());return this.findItemByPath(n.items,i)}async updateRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;this.selfWritePending=!0;let s=await this.loader.updateItem(e,r,n);if(s){let o=this.findItemRecursive(i.items,r);if(o){let{id:l,type:c,...d}=n;Object.assign(o,d)}}return s}async addRequest(e,r,n){if(!this.collections.get(e))return!1;r.id||(r.id=It(r.name)),this.selfWritePending=!0;try{return await this.loader.saveItem(e,r,n),!0}catch(s){return console.error("[CollectionService] Failed to add request:",s),!1}}async deleteRequest(e,r){let n=this.collections.get(e);if(!n)return!1;this.selfWritePending=!0;let i=await this.loader.deleteItem(e,r);return i&&this.deleteItemRecursive(n.items,r),i}getAllRequests(e){let r=this.collections.get(e);if(!r)return[];let n=[];return this.collectRequestsRecursive(r.items,n),n}findItemRecursive(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemRecursive(n.items,r);if(i)return i}}}findItemByPath(e,r){if(r.length===0)return;let[n,...i]=r,s=e.find(o=>o.name===n);if(s){if(i.length===0)return s;if(s.type==="folder"&&s.items)return this.findItemByPath(s.items,i)}}updateItemRecursive(e,r,n){for(let i=0;i<e.length;i++){let s=e[i];if(s.id===r)return e[i]={...s,...n},!0;if(s.type==="folder"&&s.items&&this.updateItemRecursive(s.items,r,n))return!0}return!1}deleteItemRecursive(e,r){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===r)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemRecursive(i.items,r))return!0}return!1}collectRequestsRecursive(e,r){for(let n of e)n.type==="request"?r.push(n):n.type==="folder"&&n.items&&this.collectRequestsRecursive(n.items,r)}async createCollection(e){let r={id:It(e),name:e,items:[]};return await this.saveCollection(r),r}async renameCollection(e,r){let n=this.collections.get(e);return n?(n.name=r,await this.saveCollection(n),!0):!1}async duplicateCollection(e,r){if(!this.collections.get(e))throw new Error(`Collection not found: ${e}`);this.selfWritePending=!0;let i=It(r),s=this.loader.getCollectionPath(e),o=mi.join(this.collectionsDir,i);if(!Dt.existsSync(s))throw new Error(`Collection directory not found: ${s}`);this.copyDirRecursive(s,o);let l=mi.join(o,"collection.json");if(Dt.existsSync(l)){let d=JSON.parse(Dt.readFileSync(l,"utf-8"));d.id=i,d.name=r,Dt.writeFileSync(l,JSON.stringify(d,null,2))}else Dt.writeFileSync(l,JSON.stringify({id:i,name:r},null,2));this.loadCollections();let c=this.collections.get(i);if(!c)throw new Error("Failed to load duplicated collection");return c}async createFolder(e){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");this.selfWritePending=!0;let n={id:It(e.name),type:"folder",name:e.name,items:[]};await this.loader.saveItem(e.collectionId,n,e.parentId);let i=this.loader.load(e.collectionId);return i&&this.collections.set(e.collectionId,i),n}async deleteFolder(e,r){let n=this.collections.get(e);if(!n)return!1;this.selfWritePending=!0;let i=await this.loader.deleteItem(e,r);return i&&this.deleteItemById(n.items,r),i}async renameFolder(e,r,n){let i=this.collections.get(e);if(!i)return!1;this.selfWritePending=!0;let s=await this.loader.updateItem(e,r,{name:n});if(s){let o=this.findItemById(i.items,r);o&&(o.name=n)}return s}async duplicateFolder(e,r,n){if(!this.collections.get(e))throw new Error("Collection not found");let s=this.loader.getItemPath(e,r);if(!s||!Dt.existsSync(s))throw new Error(`Folder not found on disk: ${r}`);let o=mi.dirname(s),l=It(n),c=mi.join(o,l);this.selfWritePending=!0,this.copyDirRecursive(s,c);let d=mi.join(c,"folder.json");if(Dt.existsSync(d)){let y=JSON.parse(Dt.readFileSync(d,"utf-8"));y.id=l,y.name=n,Dt.writeFileSync(d,JSON.stringify(y,null,2))}else Dt.writeFileSync(d,JSON.stringify({id:l,name:n,type:"folder"},null,2));this.loadCollections();let p=this.collections.get(e),m=p?this.findItemById(p.items,l):void 0;return m||{id:l,type:"folder",name:n,items:[]}}async createRequest(e){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");this.selfWritePending=!0;let n={id:e.id||It(e.name),type:"request",name:e.name,method:e.method||"GET",url:e.url,params:e.params,query:e.query,headers:e.headers,body:e.body,auth:e.auth,settings:e.settings,scripts:e.scripts,deprecated:e.deprecated,description:e.description,doc:e.doc,responseSchema:e.responseSchema,bodySchema:e.bodySchema,operationId:e.operationId,summary:e.summary,tags:e.tags,examples:e.examples,responses:e.responses,security:e.security};await this.loader.saveItem(e.collectionId,n,e.parentId);let i=this.loader.load(e.collectionId);return i&&this.collections.set(e.collectionId,i),n}async renameRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;this.selfWritePending=!0;let s=await this.loader.updateItem(e,r,{name:n});if(s){let o=this.findItemById(i.items,r);o&&(o.name=n)}return s}async moveItem(e,r,n){if(!this.collections.get(e))return!1;this.selfWritePending=!0;let s=await this.loader.moveItem(e,r,n);return s&&this.loadCollections(),s}async reorderItems(e,r,n){if(!this.collections.get(e))return!1;this.selfWritePending=!0;let s=await this.loader.reorderItems(e,r,n);return s&&this.loadCollections(),s}getRequestScript(e,r,n){let i=this.collections.get(e);if(!i)return;let s=this.findItemById(i.items,r);if(!s||s.type!=="request")return;let o=s;return n==="pre-request"?o.scripts?.preRequest:o.scripts?.postResponse}async setRequestScript(e,r,n,i){let s=this.collections.get(e);if(!s)return!1;let o=this.findItemById(s.items,r);if(!o||o.type!=="request")return!1;let l=o,d={...l.scripts??{},...n==="pre-request"?{preRequest:i}:{postResponse:i}};l.scripts=d,this.selfWritePending=!0;try{return await this.loader.saveScripts(e,r,d),!0}catch{return!1}}findItemById(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,r);if(i)return i}}}copyDirRecursive(e,r){Dt.existsSync(r)||Dt.mkdirSync(r,{recursive:!0});for(let n of Dt.readdirSync(e,{withFileTypes:!0})){let i=mi.join(e,n.name),s=mi.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):Dt.copyFileSync(i,s)}}deleteItemById(e,r){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===r)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,r))return!0}return!1}async importCollection(e){let r=Dt.readFileSync(e,"utf-8"),n;try{n=JSON.parse(r)}catch{throw new Error("Invalid JSON file")}if(n.info&&n.info._postman_id)return this.importPostmanCollection(n);let i={id:n.id||It(n.name||"Imported Collection"),name:n.name||"Imported Collection",description:n.description,items:n.items||[]};return await this.saveCollection(i),i}async importPostmanCollection(e){let r=p=>{if(!p)return;switch(p.type?.toLowerCase()){case"bearer":return{type:"bearer",bearerToken:p.bearer?.find(E=>E.key==="token")?.value||""};case"basic":let b=p.basic?.find(E=>E.key==="username"),q=p.basic?.find(E=>E.key==="password");return{type:"basic",basicAuth:{username:b?.value||"",password:q?.value||""}};case"apikey":let x=p.apikey?.find(E=>E.key==="key"),v=p.apikey?.find(E=>E.key==="value"),R=p.apikey?.find(E=>E.key==="in");return{type:"apikey",apikey:{key:x?.value||"",value:v?.value||"",in:R?.value||"header"}};case"noauth":return{type:"none"};default:return}},n=p=>{if(!Array.isArray(p)||p.length===0)return;let m={};for(let y of p){let b=y.script?.exec;if(!b)continue;let q=Array.isArray(b)?b.join(`
|
|
55
|
+
`):b;y.listen==="prerequest"?m.preRequest=q:y.listen==="test"&&(m.postResponse=q)}return m.preRequest||m.postResponse?m:void 0},i=p=>{if(!p||typeof p!="object")return;let m={};return p.followRedirects===!1&&(m.followRedirects=!1),p.followOriginalHttpMethod===!0&&(m.followOriginalMethod=!0),p.followAuthorizationHeader===!1&&(m.followAuthHeader=!1),p.maxRedirects!==void 0&&(m.maxRedirects=p.maxRedirects),p.requestTimeout!==void 0&&(m.timeout=p.requestTimeout),Object.keys(m).length>0?m:void 0},s=p=>{if(!p||typeof p=="string")return;let m=p.query;if(!(!Array.isArray(m)||m.length===0))return m.map(y=>({key:y.key||"",value:y.value||"",enabled:y.disabled!==!0,...y.description!==void 0?{description:y.description}:{},...y.type!==void 0?{type:y.type}:{},...y.required!==void 0?{required:y.required}:{},...y.format!==void 0?{format:y.format}:{},...y.enum!==void 0?{enum:y.enum}:{},...y.deprecated!==void 0?{deprecated:y.deprecated}:{},...y.pattern!==void 0?{pattern:y.pattern}:{},...y.minLength!==void 0?{minLength:y.minLength}:{},...y.maxLength!==void 0?{maxLength:y.maxLength}:{},...y.minimum!==void 0?{minimum:y.minimum}:{},...y.maximum!==void 0?{maximum:y.maximum}:{},...y.exclusiveMinimum!==void 0?{exclusiveMinimum:y.exclusiveMinimum}:{},...y.exclusiveMaximum!==void 0?{exclusiveMaximum:y.exclusiveMaximum}:{},...y.multipleOf!==void 0?{multipleOf:y.multipleOf}:{},...y.minItems!==void 0?{minItems:y.minItems}:{},...y.maxItems!==void 0?{maxItems:y.maxItems}:{},...y.uniqueItems!==void 0?{uniqueItems:y.uniqueItems}:{},...y.nullable!==void 0?{nullable:y.nullable}:{},...y.oneOf!==void 0?{oneOf:y.oneOf}:{}}))},o=p=>{if(typeof p=="string")return p;if(!p)return"";let m=new Set;if(Array.isArray(p.variable))for(let b of p.variable)b.key&&m.add(b.key);if(m.size===0&&p.raw)return p.raw;let y="";if(p.protocol&&(y+=p.protocol+"://"),p.host&&(y+=Array.isArray(p.host)?p.host.join("."):p.host),p.port&&(y+=":"+p.port),p.path){let q=(Array.isArray(p.path)?p.path:[p.path]).map(x=>{let v=x.startsWith(":")?x.substring(1):x;return m.has(v)?":"+v:(x.startsWith(":"),x)});y+="/"+q.join("/")}return!y&&p.raw?p.raw:y},l=p=>{if(!Array.isArray(p)||p.length===0)return;let m={responses:{}};for(let y of p){let b=String(y.code||200),q,x={};if(Array.isArray(y.header))for(let P of y.header)!P.key||P.disabled||(P.key.toLowerCase()==="content-type"?q=P.value?.split(";")[0]?.trim():x[P.key]={description:String(P.value??""),schema:{type:"string"}});let v=y.body;if(typeof y.body=="string"&&y.body)try{v=JSON.parse(y.body)}catch{}let R=y.originalRequest,E;if(R){let P=typeof R.url=="string"?R.url:R.url?.raw??"";E=`${R.method||""} ${P}`.trim()||void 0}let k=y.name?y.name.replace(/[^a-zA-Z0-9_-]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"").toLowerCase()||`example_${b}`:`example_${b}`;if(m.responses[b]){let P=m.responses[b];P.examples=P.examples??{},P.examples[k]={summary:E,value:v}}else m.responses[b]={description:y.name,contentType:q,examples:{[k]:{summary:E,value:v}},...Object.keys(x).length>0?{headers:x}:{}}}return Object.keys(m.responses).length>0?m:void 0},c=p=>p.map(m=>{if(m.item)return{id:It(m.name),type:"folder",name:m.name,description:m.description,auth:r(m.auth),scripts:n(m.event),items:c(m.item)};{let y=m.request||{};return{id:It(m.name),type:"request",name:m.name,description:m.description||y.description,method:typeof y.method=="string"?y.method:"GET",url:o(y.url),query:s(y.url),headers:Array.isArray(y.header)?y.header.map(b=>({key:b.key||b.name||"",value:b.value||b.value||"",enabled:b.disabled!==!0,...b.description!==void 0?{description:b.description}:{},...b.type!==void 0?{type:b.type}:{},...b.required!==void 0?{required:b.required}:{},...b.format!==void 0?{format:b.format}:{},...b.enum!==void 0?{enum:b.enum}:{},...b.deprecated!==void 0?{deprecated:b.deprecated}:{},...b.pattern!==void 0?{pattern:b.pattern}:{},...b.minLength!==void 0?{minLength:b.minLength}:{},...b.maxLength!==void 0?{maxLength:b.maxLength}:{},...b.minimum!==void 0?{minimum:b.minimum}:{},...b.maximum!==void 0?{maximum:b.maximum}:{},...b.exclusiveMinimum!==void 0?{exclusiveMinimum:b.exclusiveMinimum}:{},...b.exclusiveMaximum!==void 0?{exclusiveMaximum:b.exclusiveMaximum}:{},...b.multipleOf!==void 0?{multipleOf:b.multipleOf}:{},...b.minItems!==void 0?{minItems:b.minItems}:{},...b.maxItems!==void 0?{maxItems:b.maxItems}:{},...b.uniqueItems!==void 0?{uniqueItems:b.uniqueItems}:{},...b.nullable!==void 0?{nullable:b.nullable}:{},...b.oneOf!==void 0?{oneOf:b.oneOf}:{}})):[],body:(()=>{let b=y.body;if(b){if(b.mode==="raw"&&b.raw){let q=b.options?.raw?.language;return{type:"raw",format:q==="xml"?"xml":q==="html"?"html":q==="javascript"?"javascript":q==="text"?"text":"json",content:b.raw}}if(b.mode==="urlencoded"&&Array.isArray(b.urlencoded))return{type:"x-www-form-urlencoded",content:b.urlencoded.map(q=>({key:q.key||"",value:q.value||"",enabled:q.disabled!==!0}))};if(b.mode==="formdata"&&Array.isArray(b.formdata))return{type:"form-data",content:b.formdata.map(q=>({key:q.key||"",value:q.value||"",type:q.type||"text",enabled:q.disabled!==!0}))};if(b.mode==="graphql"&&b.graphql){let q;if(b.graphql.variables)try{q=JSON.parse(b.graphql.variables)}catch{q=void 0}return{type:"graphql",content:{query:b.graphql.query||"",variables:q}}}if(b.mode==="binary")return{type:"binary",content:""}}})(),auth:r(y.auth),scripts:n(m.event),settings:i(m.protocolProfileBehavior),responseSchema:l(m.response)}}}),d={id:It(e.info?.name||"Imported Postman Collection"),name:e.info?.name||"Imported Postman Collection",description:e.info?.description,auth:r(e.auth),scripts:n(e.event),variables:Array.isArray(e.variable)?Object.fromEntries(e.variable.filter(p=>p&&p.key).map(p=>[p.key,String(p.value??"")])):typeof e.variable=="object"&&e.variable!==null?Object.fromEntries(Object.entries(e.variable).map(([p,m])=>[p,String(m??"")])):void 0,items:c(e.item||[])};return await this.saveCollection(d),d}async exportCollection(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=Bz(n),s=JSON.stringify(i,null,2);Dt.writeFileSync(r,s,"utf-8")}async exportCollectionAsRestClientFolder(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=mi.join(r,Bt(n.name));Dt.mkdirSync(i,{recursive:!0});let s=n.variables||{};Ka(mi.join(i,`${Bt(n.name)}.env`),s),Zu(i,Bt(n.name),n.scripts),yd(n.items,i,n)}dispose(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.fileWatcher?.dispose()}}});var rr,ko,Ps,r_=le(()=>{"use strict";rr={version:"1.0",storage:{format:"folder",root:"./.http-forge/assets",history:"./.http-forge/.cache/histories",results:"./.http-forge/.cache/results"},request:{timeout:3e4,followRedirects:!0,maxRedirects:10,strictSSL:!0,tls:{},certificates:[]},scripts:{modulePaths:["./.http-forge/assets/src","./.http-forge/assets/lib"],scope:"shared",timeout:5e3},runner:{resultsRetentionDays:7,indexPageSize:1e3,recentErrorsLimit:20},environments:{default:"dev"},restClientExport:{path:"collections-rest-client",mergeGlobals:!0},mcp:{port:3100,excludedCollections:[],excludedSuites:[],toolPrefix:"",maxRequestsPerCall:500,toolMode:"auto",drilldownThreshold:100,toolPageSize:200,cors:{allowedOrigins:["http://localhost","http://127.0.0.1"]}},proxy:null,secrets:{providers:{aws:{provider:"aws"},azure:{provider:"azure",vaultUrl:""},gcp:{provider:"gcp"},vault:{provider:"vault"},op:{provider:"1password"},doppler:{provider:"doppler"}}}},ko={preferred:".http-forge/http-forge.config.json",legacy:"http-forge.config.json"},Ps={collections:"collections",environments:"environments",flows:"flows",suites:"suites"}});var Vt,Jt,ks,sg=le(()=>{"use strict";Vt=ve(require("fs")),Jt=ve(require("path"));r_();ks=class{constructor(e,r,n){this.workspacePath=e;this.fileWatcherFactory=r;this.notifications=n;this.configPath=this.resolveConfigPath(),this.config=this.loadConfig(),this.setupFileWatcher()}workspacePath;fileWatcherFactory;notifications;config;configPath;fileWatchers=[];resolveConfigPath(){let e=Jt.join(this.workspacePath,ko.preferred);if(Vt.existsSync(e))return e;let r=Jt.join(this.workspacePath,ko.legacy);return Vt.existsSync(r)?r:e}loadConfig(){if(this.configPath=this.resolveConfigPath(),!Vt.existsSync(this.configPath))return{...rr};try{let e=Vt.readFileSync(this.configPath,"utf-8"),r=JSON.parse(e);return this.mergeWithDefaults(r)}catch(e){return console.error("[ConfigService] Failed to load config:",e),this.notifications?.showWarning(`Failed to parse ${Jt.relative(this.workspacePath,this.configPath)}. Using default configuration.`),{...rr}}}mergeWithDefaults(e){return{version:e.version??rr.version,storage:{...rr.storage,...e.storage},request:{...rr.request,...e.request},scripts:{...rr.scripts,...e.scripts},runner:{...rr.runner,...e.runner},environments:{...rr.environments,...e.environments},restClientExport:{...rr.restClientExport,...e.restClientExport},proxy:e.proxy!==void 0?e.proxy:rr.proxy,mcp:{...rr.mcp,...e.mcp,cors:{...rr.mcp.cors,...e.mcp?.cors}},secrets:{...rr.secrets,...e.secrets,providers:{...rr.secrets?.providers,...e.secrets?.providers}}}}setupFileWatcher(){if(!this.fileWatcherFactory)return;let e=()=>{this.reload()};for(let r of[ko.preferred,ko.legacy]){let n=this.fileWatcherFactory.createFileWatcher(this.workspacePath,r);n.onDidChange(e),n.onDidCreate(e),n.onDidDelete(e),this.fileWatchers.push(n)}}getConfig(){return this.config}getStorageConfig(){return this.config.storage}getRequestConfig(){return this.config.request}getScriptsConfig(){return this.config.scripts}getRunnerConfig(){return this.config.runner}getEnvironmentsConfig(){return this.config.environments}getRestClientExportPath(){let e=this.config.restClientExport?.path||"collections-rest-client";return Jt.isAbsolute(e)?e:this.resolvePath(e)}getRestClientMergeGlobals(){return this.config.restClientExport?.mergeGlobals??!0}getProxyConfig(){return this.config.proxy??null}getMcpConfig(){let e=this.config.mcp??rr.mcp,r=["flat","drilldown","auto"];return{...e,port:Math.min(65535,Math.max(1,Math.floor(e.port??3100))),toolMode:r.includes(e.toolMode)?e.toolMode:"auto",drilldownThreshold:Math.min(500,Math.max(10,e.drilldownThreshold??100)),toolPageSize:e.toolPageSize===0?0:Math.min(1e3,Math.max(10,e.toolPageSize??200)),maxRequestsPerCall:Math.min(1e4,Math.max(1,e.maxRequestsPerCall??500))}}resolvePath(e){let r=e.startsWith("./")?e.slice(2):e;return Jt.join(this.workspacePath,...r.split("/"))}hasFolderCollectionsAtRoot(e){let r=Jt.join(e,Ps.collections);if(!Vt.existsSync(r))return!1;let n;try{n=Vt.readdirSync(r,{withFileTypes:!0})}catch{return!1}return n.some(i=>{if(!i.isDirectory())return!1;let s=Jt.join(r,i.name,"collection.json");return Vt.existsSync(s)})}hasAnyEntries(e){if(!Vt.existsSync(e))return!1;try{return Vt.readdirSync(e).length>0}catch{return!1}}resolveStorageRootPath(){let e=this.resolvePath(this.config.storage.root);return this.configExists()||this.hasFolderCollectionsAtRoot(e)?e:[Jt.join(this.workspacePath,"http-forge-assets")].find(i=>this.hasFolderCollectionsAtRoot(i))||e}getRootPath(){return this.resolveStorageRootPath()}getCollectionsPath(){return Jt.join(this.getRootPath(),Ps.collections)}getEnvironmentsPath(){return Jt.join(this.getRootPath(),Ps.environments)}getFlowsPath(){return Jt.join(this.getRootPath(),Ps.flows)}getHistoryPath(){let e=this.resolvePath(this.config.storage.history);if(this.configExists()||this.hasAnyEntries(e))return e;let r=Jt.join(this.workspacePath,".http-forge-cache","histories");return this.hasAnyEntries(r)?r:e}getResultsPath(){let e=this.resolvePath(this.config.storage.results);if(this.configExists()||this.hasAnyEntries(e))return e;let r=Jt.join(this.workspacePath,".http-forge-cache","results");return this.hasAnyEntries(r)?r:e}getSuitesPath(){return Jt.join(this.getRootPath(),Ps.suites)}getModulePaths(){return this.config.scripts.modulePaths.map(e=>this.resolvePath(e))}getScriptScope(){return this.config.scripts.scope??"shared"}getScriptTimeout(){return this.config.scripts.timeout??5e3}getWorkspacePath(){return this.workspacePath}reload(){this.configPath=this.resolveConfigPath(),this.config=this.loadConfig()}configExists(){return Vt.existsSync(this.resolveConfigPath())}async createDefaultConfig(){await Vt.promises.mkdir(Jt.dirname(this.configPath),{recursive:!0});let e=JSON.stringify(rr,null,2);await Vt.promises.writeFile(this.configPath,e,"utf-8");let r=[this.getCollectionsPath(),this.getEnvironmentsPath(),this.getFlowsPath(),this.getSuitesPath()];for(let i of r)Vt.existsSync(i)||await Vt.promises.mkdir(i,{recursive:!0});let n=[this.getHistoryPath(),this.getResultsPath()];for(let i of n)Vt.existsSync(i)||await Vt.promises.mkdir(i,{recursive:!0});await this.createSampleEnvironments()}async createSampleEnvironments(){let e=this.getEnvironmentsPath(),r={id:"globals",name:"Global Variables",variables:{appName:"HTTP Forge"}};await Vt.promises.writeFile(Jt.join(e,"globals.json"),JSON.stringify(r,null,2),"utf-8");let n={id:"env_dev",name:"Development",variables:{baseUrl:"http://localhost:3000",apiVersion:"v1"}};await Vt.promises.writeFile(Jt.join(e,"dev.json"),JSON.stringify(n,null,2),"utf-8");let i={id:"default_headers",name:"Default Headers",headers:{"Content-Type":"application/json",Accept:"application/json"}};await Vt.promises.writeFile(Jt.join(e,"default-headers.json"),JSON.stringify(i,null,2),"utf-8")}dispose(){for(let e of this.fileWatchers)e.dispose();this.fileWatchers=[]}}});var Yz,tc,n_=le(()=>{"use strict";ka();Yz="httpForge.cookies",tc=class{constructor(e,r=Yz){this.store=e;this.storeKey=r;this.loadCookies()}store;storeKey;cookies=new Map;loadCookies(){try{let e=this.store.get(this.storeKey);e&&(this.cookies=new Map(Object.entries(e)),this.cleanExpiredCookies())}catch(e){console.error("[CookieService] Failed to load cookies:",e)}}async saveCookies(){try{let e={};this.cookies.forEach((r,n)=>{e[n]=r}),await this.store.update(this.storeKey,e)}catch(e){console.error("[CookieService] Failed to save cookies:",e)}}getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}get(e,r){if(r){let s=this.getCookieKey(e,r),o=this.cookies.get(s);if(o&&!this.isExpired(o))return o}let n=this.getCookieKey(e,"*"),i=this.cookies.get(n);if(i&&!this.isExpired(i))return i;for(let s of this.cookies.values())if(s.name===e&&!this.isExpired(s))if(r&&s.domain){if(this.domainMatches(r,s.domain))return s}else return s}async set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e),await this.saveCookies()}async setFromResponse(e){for(let r of e){let n=this.getCookieKey(r.name,r.domain,r.path);this.cookies.set(n,r)}await this.saveCookies()}has(e,r){return this.get(e,r)!==void 0}async delete(e,r,n){let i=this.getCookieKey(e,r,n),s=this.cookies.delete(i);return s&&await this.saveCookies(),s}getAll(e){let r=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&r.push(n):r.push(n));return r}getCookieHeader(e){let r=this.getAll(e);return _t.formatCookieHeader(r)}async clear(){this.cookies.clear(),await this.saveCookies()}async clearDomain(e){let r=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&r.push(n);for(let n of r)this.cookies.delete(n);await this.saveCookies()}parseCookieHeaders(e,r){return _t.parseCookieHeaders(e,r)}isExpired(e){return _t.isExpired(e)}cleanExpiredCookies(){let e=[];for(let[r,n]of this.cookies.entries())this.isExpired(n)&&e.push(r);for(let r of e)this.cookies.delete(r);e.length>0&&this.saveCookies()}domainMatches(e,r){return _t.domainMatches(e,r)}get count(){return this.cookies.size}}});var rc,i_=le(()=>{"use strict";ka();rc=class{constructor(e){this.cookieService=e;this.localCache=[...e.getAll()]}cookieService;localCache=[];pendingOperations=[];get(e,r){return r?this.localCache.find(n=>n.name===e&&(!n.domain||n.domain===r||r.endsWith(n.domain))):this.localCache.find(n=>n.name===e)}has(e,r){return this.get(e,r)!==void 0}set(e){let r=this.localCache.findIndex(n=>n.name===e.name&&(!e.domain||n.domain===e.domain));r>=0?this.localCache[r]=e:this.localCache.push(e),this.pendingOperations.push({type:"set",cookie:e})}delete(e,r,n){let i=this.localCache.findIndex(s=>s.name===e&&(!r||s.domain===r||s.domain&&r.endsWith(s.domain)));return i>=0&&this.localCache.splice(i,1),this.pendingOperations.push({type:"delete",name:e,domain:r,path:n}),!0}getAll(e){return e?this.localCache.filter(r=>{let n=r.domain||"";return n===e||e.endsWith(n)}):[...this.localCache]}getCookiesForDomain(e){return this.localCache.filter(r=>{let n=r.domain||"";return n===e||e.endsWith(n)})}async setCookiesFromResponse(e,r){let n=new URL(e).hostname,i=this.cookieService.parseCookieHeaders(r,n);i.length>0&&(i.forEach(s=>{let o=this.localCache.findIndex(l=>l.name===s.name&&l.domain===(s.domain||n));o>=0?this.localCache[o]=s:this.localCache.push(s)}),await this.cookieService.setFromResponse(i))}getCookieHeader(e){let r=new URL(e).hostname,n=new URL(e).pathname,i=this.localCache.filter(s=>!(_t.isExpired(s)||s.domain&&!_t.domainMatches(r,s.domain)||!s.domain||s.path&&!n.startsWith(s.path)));if(i.length!==0)return _t.formatCookieHeader(i)}clear(){this.localCache=[],this.pendingOperations.push({type:"clear"})}async flush(){for(let e of this.pendingOperations)switch(e.type){case"set":e.cookie&&await this.cookieService.set(e.cookie);break;case"delete":e.name&&await this.cookieService.delete(e.name,e.domain,e.path);break;case"clear":await this.cookieService.clear();break}this.pendingOperations=[]}}});function vd(t){try{let e=JSON.parse(typeof t=="string"?t:t.toString("utf-8"));if(!e)return null;let r=e.environment||e,n=r.name||e.name||"imported-environment",i=r.values||r.variables||e.values||e.variables||[],s={};if(Array.isArray(i))for(let l of i){if(!l)continue;let c=l.key??l.name,d=typeof l.enabled=="boolean"?l.enabled:!0;c&&d!==!1&&(s[c]=l.value??l.initial??"")}else if(typeof i=="object"&&i!==null)for(let[l,c]of Object.entries(i))s[l]=String(c??"");let o=r._postman_exported_at?"Imported from Postman export":r.description||"";return{name:n,variables:s,description:o}}catch{return null}}async function PP(t,e){try{let r=await e.readFile(t);return vd(r)}catch{return null}}var s_=le(()=>{"use strict"});var ur,Cn,bd,nc,o_=le(()=>{"use strict";ur=ve(require("fs")),Cn=ve(require("path"));Un();s_();ig();sm();Af();bd={SELECTED_ENVIRONMENT:"httpForge.selectedEnvironment",ENV_OVERRIDES_PREFIX:"httpForge.envOverrides."},nc=class{constructor(e,r,n,i,s,o=!0){this.workspaceFolder=e;this.workspaceStore=r;this.configService=n;this.fileWatcherFactory=i;this.secretStore=s;this.persistOverrides=o;let l=n.getEnvironmentsPath();this.environmentsPath=l,this.sharedConfigPath=Cn.join(l,"_global.json"),this.localConfigPath=Cn.join(l,"_global.local.json"),this.historiesPath=n.getHistoryPath(),this.selectedEnvironment=r?.get(bd.SELECTED_ENVIRONMENT,"dev")??"dev",this.localGlobalValues={},this.localEnvironmentValues=new Map,this.persistOverrides&&this.loadPersistedEnvironmentOverrides(),this.loadSecretVariables(this.selectedEnvironment).catch(()=>{}),this.setupFileWatcher()}workspaceFolder;workspaceStore;configService;fileWatcherFactory;secretStore;persistOverrides;environmentsPath;sharedConfigPath;localConfigPath;historiesPath;sharedConfig=null;localConfig=null;selectedEnvironment="dev";fileWatcher;localGlobalValues={};localEnvironmentValues=new Map;secretValuesCache=new Map;onEnvironmentsChanged;setupFileWatcher(){if(!this.fileWatcherFactory||!ur.existsSync(this.environmentsPath))return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.environmentsPath,"**/*.json");let e=()=>{this.reload(),this.onEnvironmentsChanged?.()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}dispose(){this.fileWatcher?.dispose()}getWorkspaceFolder(){return this.workspaceFolder}getRootPath(){return this.configService.getRootPath()}loadConfigs(){if(!ur.existsSync(this.environmentsPath)){this.sharedConfig={environments:{},globalVariables:{},defaultHeaders:{}},this.localConfig={credentials:{},variables:{}};return}this.loadFolderConfigs()}getSharedConfig(){return this.sharedConfig||this.loadConfigs(),this.sharedConfig}getLocalConfig(){return this.localConfig||this.loadConfigs(),this.localConfig}getEnvironmentNames(){let e=this.getSharedConfig();return e?.environments?Object.keys(e.environments):[]}getSelectedEnvironment(){return this.selectedEnvironment}async setSelectedEnvironment(e){if(this.selectedEnvironment=e,await this.workspaceStore?.update(bd.SELECTED_ENVIRONMENT,e),!this.localEnvironmentValues.has(e)){let r=this.getEnvOverridesStateKey(e),n=this.workspaceStore?.get(r,{});n&&Object.keys(n).length>0&&this.localEnvironmentValues.set(e,{...n})}await this.loadSecretVariables(e)}getEnvOverridesStateKey(e){return`${bd.ENV_OVERRIDES_PREFIX}${e||this.selectedEnvironment}`}loadPersistedEnvironmentOverrides(){let e=this.getEnvOverridesStateKey(),r=this.workspaceStore?.get(e,{});r&&Object.keys(r).length>0&&this.localEnvironmentValues.set(this.selectedEnvironment,{...r})}persistEnvironmentOverrides(e){if(!this.persistOverrides)return;let r=this.getEnvOverridesStateKey(e),n=this.localEnvironmentValues.get(e)||{};this.workspaceStore?.update(r,n)}setEnvironmentVariable(e,r,n){let i=n??this.selectedEnvironment;this.localEnvironmentValues.has(i)||this.localEnvironmentValues.set(i,{}),this.localEnvironmentValues.get(i)[e]=String(r),this.persistEnvironmentOverrides(i)}deleteEnvironmentVariable(e,r){let n=r??this.selectedEnvironment,i=this.localEnvironmentValues.get(n);i&&(delete i[e],this.persistEnvironmentOverrides(n))}clearEnvironmentVariables(e){let r=e??this.selectedEnvironment;this.localEnvironmentValues.set(r,{}),this.persistEnvironmentOverrides(r)}async resetEnvironmentOverrides(e){let r=e||this.selectedEnvironment;this.localEnvironmentValues.delete(r),await this.workspaceStore?.update(this.getEnvOverridesStateKey(r),void 0)}getEnvironmentVariableLocal(e){return this.localEnvironmentValues.get(this.selectedEnvironment)?.[e]}getEnvironmentVariableLocals(){return{...this.localEnvironmentValues.get(this.selectedEnvironment)||{}}}setGlobalVariable(e,r){this.localGlobalValues[e]=String(r)}getGlobalVariable(e){return this.getSharedConfig()?.globalVariables?.[e]}getGlobalVariableLocal(e){return this.localGlobalValues[e]}getGlobalVariables(){return{...this.getSharedConfig()?.globalVariables||{},...this.getLocalConfig()?.variables||{},...this.localGlobalValues}}getGlobalVariableLocals(){return{...this.localGlobalValues}}deleteGlobalVariable(e){delete this.localGlobalValues[e]}clearGlobalVariables(){this.localGlobalValues={}}getResolvedEnvironment(e){let r=e||this.selectedEnvironment,n=this.getSharedConfig(),i=this.getLocalConfig();if(!n?.environments?.[r])return null;let s=n.environments[r],o=i?.credentials?.[r],l=i?.variables||{},c=o?.variables||{},d=o&&o.headers||{},p=gu(n.defaultHeaders||{},d),m=this.localEnvironmentValues.get(r)||{},y=this.secretValuesCache.get(r)||{},b={...s.variables||{},...c,...m,...y};return{name:r,description:s.description,requiresConfirmation:s.requiresConfirmation,headers:p,variables:b}}async getSecretVariable(e,r){return this.secretStore?.get(`${e}:${r}`)}async setSecretVariable(e,r,n){await this.secretStore?.store(`${e}:${r}`,n),this.secretValuesCache.has(e)||this.secretValuesCache.set(e,{}),this.secretValuesCache.get(e)[r]=n}async deleteSecretVariable(e,r){await this.secretStore?.delete(`${e}:${r}`),this.secretValuesCache.get(e)&&delete this.secretValuesCache.get(e)[r]}async loadSecretVariables(e){if(!this.secretStore)return;let r=e||this.selectedEnvironment,n=this.getSharedConfig()?.environments?.[r]?.secretVariables??[];if(n.length===0)return;let i={};await Promise.all(n.map(async s=>{let o=await this.secretStore.get(`${r}:${s}`);o!==void 0&&(i[s]=o)})),this.secretValuesCache.set(r,i)}resolveVariables(e,r){return this.createResolver(r).resolveString(e,!0)}exportEnvironmentsToFolder(e,r=!0){let n=this.getEnvironmentNames(),i=this.getSharedConfig(),s=i?.globalVariables?{...i.globalVariables}:{};if(!r&&Object.keys(s).length){let o=Cn.join(e,"globals.env");Ka(o,s)}n.forEach(o=>{let l=i?.environments?.[o];if(!l)return;let c={...l.variables||{}};r&&(c={...s,...c});let d=Cn.join(e,`${Bt(o)}.env`);Ka(d,c)})}resolveVariablesWithExtra(e,r,n){return this.createResolver(n,r).resolveString(e,!0)}resolveVariablesInObject(e,r){return this.createResolver(r).resolveObject(e,!0)}resolveVariablesInObjectWithExtra(e,r,n){return this.createResolver(n,r).resolveObject(e,!0)}getHistoriesPath(){return this.historiesPath}getSharedConfigPath(){return this.sharedConfigPath}getLocalConfigPath(){return this.localConfigPath}getEnvironmentConfigPath(e){return Cn.join(this.environmentsPath,`${e}.json`)}localConfigExists(){return ur.existsSync(this.localConfigPath)}saveSharedConfig(e){this.saveFolderSharedConfig(e),this.sharedConfig=e}saveLocalConfig(e){let r={variables:e.variables||{}};this.saveJsonFile(this.localConfigPath,r);for(let[n,i]of Object.entries(e.credentials||{})){let s=this.getEnvLocalConfigPath(n),o={variables:i.variables||{}};this.saveJsonFile(s,o)}this.localConfig=e}importPostmanEnvironmentFile(e){try{let r=ur.readFileSync(e,"utf-8"),n=vd(r);if(!n)throw new Error("Failed to parse Postman environment file");this.sharedConfig||this.loadConfigs(),this.sharedConfig||(this.sharedConfig={environments:{},globalVariables:{},defaultHeaders:{}});let i=n.name||`imported-${Date.now()}`;return this.sharedConfig.environments=this.sharedConfig.environments||{},this.sharedConfig.environments[i]=this.sharedConfig.environments[i]||{},this.sharedConfig.environments[i].variables=n.variables,n.description&&(this.sharedConfig.environments[i].description=n.description),this.saveSharedConfig(this.sharedConfig),n}catch(r){throw console.error("[EnvironmentConfigService] importPostmanEnvironmentFile failed:",r),r}}saveEnvLocalConfig(e,r){let n=this.getEnvLocalConfigPath(e),i={variables:r};this.saveJsonFile(n,i),this.localConfig||(this.localConfig={credentials:{},variables:{}}),this.localConfig.credentials||(this.localConfig.credentials={}),this.localConfig.credentials[e]={variables:r}}getEnvLocalPath(e){return this.getEnvLocalConfigPath(e)}getEnvLocalConfigPath(e){return Cn.join(this.environmentsPath,`${e}.local.json`)}loadFolderConfigs(){let e=wu(this.environmentsPath);this.sharedConfig={environments:e.environments,globalVariables:e.globalVariables,defaultHeaders:e.defaultHeaders},this.localConfig={credentials:e.localCredentials,variables:e.localVariables}}createResolver(e,r){let i=this.getResolvedEnvironment(e)?.variables||{},s=this.getGlobalVariables(),o=this.getGlobalVariableLocals();return new yo({globals:s,collectionVariables:{},environmentVariables:i,variables:{...o,...r||{}}})}saveFolderSharedConfig(e){ur.existsSync(this.environmentsPath)||ur.mkdirSync(this.environmentsPath,{recursive:!0});let r={variables:e.globalVariables||{},defaultHeaders:e.defaultHeaders||{}};this.saveJsonFile(this.sharedConfigPath,r);let n=ur.readdirSync(this.environmentsPath).filter(s=>s.endsWith(".json")).filter(s=>!Of(s)),i=new Set(Object.keys(e.environments||{}));for(let s of n){let o=Cn.basename(s,".json");if(!i.has(o))try{ur.unlinkSync(Cn.join(this.environmentsPath,s))}catch{}}for(let[s,o]of Object.entries(e.environments||{})){let l={name:s,description:o.description,requiresConfirmation:o.requiresConfirmation,variables:o.variables||{}};this.saveJsonFile(Cn.join(this.environmentsPath,`${s}.json`),l)}}reload(){this.sharedConfig=null,this.localConfig=null,this.loadConfigs()}getAllEnvironments(){return this.loadConfigs(),this.sharedConfig?Object.entries(this.sharedConfig.environments).map(([e,r])=>({id:e,name:e,active:e===this.selectedEnvironment,variables:r.variables||{}})):[]}async setActiveEnvironment(e){await this.setSelectedEnvironment(e)}async createEnvironment(e){if(this.loadConfigs(),this.sharedConfig||(this.sharedConfig={environments:{},globalVariables:{}}),this.sharedConfig.environments[e])throw new Error(`Environment "${e}" already exists`);this.sharedConfig.environments[e]={description:`Created ${new Date().toISOString()}`,variables:{}},this.saveSharedConfig(this.sharedConfig)}async deleteEnvironment(e){if(this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentExists(e),delete this.sharedConfig.environments[e],this.selectedEnvironment===e){let r=Object.keys(this.sharedConfig.environments);this.selectedEnvironment=r.length>0?r[0]:"dev",await this.workspaceStore?.update(bd.SELECTED_ENVIRONMENT,this.selectedEnvironment)}this.saveSharedConfig(this.sharedConfig)}async duplicateEnvironment(e,r){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(r),this.validateEnvironmentExists(e),this.validateEnvironmentNameNotTaken(r);let n=this.sharedConfig.environments[e];this.sharedConfig.environments[r]=JSON.parse(JSON.stringify(n)),this.sharedConfig.environments[r].description=`Copied from ${e}`,this.saveSharedConfig(this.sharedConfig)}async renameEnvironment(e,r){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(r),this.validateEnvironmentExists(e),r!==e&&(this.validateEnvironmentNameNotTaken(r),this.sharedConfig.environments[r]=this.sharedConfig.environments[e],delete this.sharedConfig.environments[e],this.selectedEnvironment===e&&(this.selectedEnvironment=r,await this.workspaceStore?.update(bd.SELECTED_ENVIRONMENT,r)),this.saveSharedConfig(this.sharedConfig))}validateEnvironmentName(e){if(!e||e.trim().length===0)throw new Error("Environment name cannot be empty");if(e.length>128)throw new Error("Environment name cannot exceed 128 characters");if(!/^[a-zA-Z0-9_\-\.]+$/.test(e))throw new Error("Environment name can only contain letters, numbers, hyphens, underscores, and dots")}validateEnvironmentExists(e){if(!this.sharedConfig?.environments?.[e])throw new Error(`Environment "${e}" not found`)}validateEnvironmentNameNotTaken(e){if(this.sharedConfig?.environments?.[e])throw new Error(`Environment "${e}" already exists`)}validateConfigLoaded(){if(!this.sharedConfig)throw new Error("No environment configuration loaded")}async updateEnvironmentVariables(e,r){if(this.loadConfigs(),!this.sharedConfig)throw new Error("No configuration loaded");let n=this.sharedConfig.environments[e];if(!n)throw new Error(`Environment "${e}" not found`);n.variables=r,this.saveSharedConfig(this.sharedConfig)}loadJsonFile(e){try{if(!ur.existsSync(e))return null;let r=ur.readFileSync(e,"utf-8");return JSON.parse(r)}catch(r){return console.error(`Failed to load JSON from ${e}:`,r),null}}saveJsonFile(e,r){try{let n=Cn.dirname(e);ur.existsSync(n)||ur.mkdirSync(n,{recursive:!0}),ur.writeFileSync(e,JSON.stringify(r,null,2),"utf-8")}catch(n){throw console.error(`Failed to save JSON to ${e}:`,n),n}}}});var As,og=le(()=>{"use strict";hd();As=class t{constructor(e,r,n,i,s,o,l,c,d,p,m,y,b){this.httpService=e;this.scriptExecutor=r;this.envConfigService=n;this.requestPreparer=i;this.environment=s;this.cookieJar=o;this.collectionScripts=l;this.folderScriptsChain=c;this.onConsoleOutput=d;this.collectionName=p;this.collectionAuth=m;this.iteration=y;this.iterationCount=b}httpService;scriptExecutor;envConfigService;requestPreparer;environment;cookieJar;collectionScripts;folderScriptsChain;onConsoleOutput;collectionName;collectionAuth;iteration;iterationCount;async execute(e,r,n){let i=Date.now();return this.executeWithSession(e,r,n,i)}async executeWithSession(e,r,n,i){let s=this.collectPreRequestScripts(e),o=this.collectPostResponseScripts(e),l=this.envConfigService.getResolvedEnvironment(this.environment);if(!l)throw new Error(`Environment "${this.environment}" not found or not configured`);let c=this.envConfigService.getGlobalVariables(),d={request:e,variables:{...r},environmentVariables:l.variables||{},globals:{...c},environmentName:this.environment,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:this.collectionName,iteration:this.iteration,iterationCount:this.iterationCount},onEnvironmentChange:async(y,b,q)=>{y==="set"&&b&&q!==void 0?this.envConfigService.setEnvironmentVariable(b,q,this.environment):y==="unset"&&b?this.envConfigService.deleteEnvironmentVariable(b,this.environment):y==="clear"&&this.envConfigService.clearEnvironmentVariables(this.environment)},onGlobalsChange:(y,b,q)=>{y==="set"&&b&&q!==void 0?this.envConfigService.setGlobalVariable(b,q):y==="unset"&&b?this.envConfigService.deleteGlobalVariable(b):y==="clear"&&this.envConfigService.clearGlobalVariables()}},p=this.scriptExecutor.createRequestSession(d),m=null;try{let y={...r},b={...e},q;if((!b.auth||b.auth.type==="inherit")&&(b.auth=this.collectionAuth&&this.collectionAuth.type!=="inherit"?this.collectionAuth:void 0),s.length>0){let D=await p.executePreRequest(s);if(D.consoleOutput&&D.consoleOutput.length>0&&this.onConsoleOutput?.(D.consoleOutput,{requestName:e.name||"",phase:"pre-request"}),D.nextRequest!==void 0&&(q=D.nextRequest),D.skipRequest){let J={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:e.url||"",method:e.method||"GET",headers:{},body:J,params:{},query:{}},response:{status:0,statusText:"Skipped",headers:{},body:null,time:0,cookies:[]},duration:Date.now()-i,timestamp:Date.now(),passed:!0,assertions:[],modifiedVariables:y,nextRequest:q}}D.success&&(D.modifiedRequest&&(D.modifiedRequest.url&&(b.url=D.modifiedRequest.url),D.modifiedRequest.headers&&(b.headers=D.modifiedRequest.headers),D.modifiedRequest.params&&(b.params=D.modifiedRequest.params),D.modifiedRequest.query&&(b.query=D.modifiedRequest.query),D.modifiedRequest.body!==void 0&&(b.body=D.modifiedRequest.body)),(D.localVariables??D.modifiedVariables)&&(y=D.localVariables??D.modifiedVariables))}m=await this.requestPreparer.prepareRequest(b,this.environment,l,y);let{url:x,headers:v,body:R,method:E}=m,k={};for(let D in v)Object.prototype.hasOwnProperty.call(v,D)&&(k[D.toUpperCase()]=v[D]);if(!k.COOKIE&&b.settings?.includeCookies!==!1&&this.cookieJar){let J=this.cookieJar.getCookieHeader(x);J&&(k.COOKIE=J)}let P={method:E,url:x,headers:k,body:R.content,signal:n,settings:b.settings?{...b.settings}:void 0},M=await this.httpService.execute(P);this.cookieJar&&M.headers&&await this.cookieJar.setCookiesFromResponse(x,M.headers);let j=Date.now()-i,I=[],_={},A;if(o.length>0){let D=0;if(M.body)if(typeof M.body=="string")D=Buffer.byteLength(M.body,"utf8");else if(Buffer.isBuffer(M.body))D=M.body.length;else try{D=Buffer.byteLength(JSON.stringify(M.body),"utf8")}catch{D=0}let J=Zm(M.headers,M.cookies,m.url),Q={executedRequest:m,status:M.status,statusText:M.statusText,headers:Qm(M.headers||{}),body:M.body,cookies:J,responseTime:M.time,responseSize:D},se=await p.executePostResponse(o,Q);I=se.testResults,_=se.modifiedEnvironmentVariables||{},A=se.visualizerData,(se.localVariables??se.modifiedVariables)&&(y=se.localVariables??se.modifiedVariables),se.nextRequest!==void 0&&(q=se.nextRequest),se.consoleOutput&&se.consoleOutput.length>0&&this.onConsoleOutput?.(se.consoleOutput,{requestName:e.name||"",phase:"post-response"})}let F=I.length===0||I.every(D=>D.passed),U=I.length>0?F:M.status>=200&&M.status<=302;return{requestId:e.id,name:e.name,executedRequest:{...m,headers:k},response:{status:M.status,statusText:M.statusText,headers:M.headers||{},body:M.body,time:M.time||j,cookies:M.cookies||[]},duration:j,timestamp:Date.now(),passed:U,assertions:I,modifiedVariables:y,modifiedEnvironmentVariables:_,nextRequest:q,visualizerData:A}}catch(y){return this.handleError(e,m,y,i)}finally{p.dispose?.()}}collectPreRequestScripts(e){let r=[];if(this.collectionScripts?.preRequest&&r.push(this.collectionScripts.preRequest),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain))for(let n of this.folderScriptsChain)n?.preRequest&&r.push(n.preRequest);else this.folderScriptsChain.preRequest&&r.push(this.folderScriptsChain.preRequest);return e.scripts?.preRequest&&r.push(e.scripts.preRequest),r}collectPostResponseScripts(e){let r=[];if(e.scripts?.postResponse&&r.push(e.scripts.postResponse),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain)){let n=[...this.folderScriptsChain].reverse();for(let i of n)i?.postResponse&&r.push(i.postResponse)}else this.folderScriptsChain.postResponse&&r.push(this.folderScriptsChain.postResponse);return this.collectionScripts?.postResponse&&r.push(this.collectionScripts.postResponse),r}handleError(e,r,n,i){let s=Date.now()-i,o=r?.method||e.method,l=r?.url||e.url;this.onConsoleOutput?.([`${n.message||n}`],{requestName:e.name||"",phase:"error"});let c=String(n.name==="AbortError"?"Request was aborted":n.message||n),d=n?.stack?String(n.stack):"",p=this.errorBodyFormat,m,y;p==="html"||p==="both"?(m=t.formatErrorAsHtml(c,d),y={"content-type":"text/html; charset=utf-8"}):(m=c,y={});let b={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:l||"",method:o||"GET",headers:r?.headers||{},body:r?.body||b,params:r?.params||{},query:r?.query||{}},response:{status:0,statusText:n.name==="AbortError"?"Aborted":n.code||n.message||"Request Error",headers:y,cookies:[],body:m,time:0},duration:s,timestamp:Date.now(),passed:!1,assertions:[],error:c}}get errorBodyFormat(){return"text"}static formatErrorAsHtml(e,r){let n=i=>i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");return`<!doctype html>
|
|
56
56
|
<html>
|
|
57
57
|
<body style="font-family:system-ui,Segoe UI,Roboto,-apple-system,Helvetica,Arial,sans-serif;padding:12px;color:#c7254e;">
|
|
58
58
|
<h2 style="margin-top:0;color:#a94442">Request Error</h2>
|
|
@@ -61,7 +61,7 @@ ${i}
|
|
|
61
61
|
${n(r)}
|
|
62
62
|
</pre>`:""}
|
|
63
63
|
</body>
|
|
64
|
-
</html>`}}});var ic,a_=le(()=>{"use strict";Un();ic=class{constructor(e,r,n,i,s,o){this.envConfigService=e;this.httpService=r;this.preprocessor=n;this.tokenManager=i;this.appInfo=s;this.secretRegistry=o}envConfigService;httpService;preprocessor;tokenManager;appInfo;secretRegistry;async prepareRequest(e,r,n,i){if(this.secretRegistry?.hasProviders){let
|
|
64
|
+
</html>`}}});var ic,a_=le(()=>{"use strict";Un();ic=class{constructor(e,r,n,i,s,o){this.envConfigService=e;this.httpService=r;this.preprocessor=n;this.tokenManager=i;this.appInfo=s;this.secretRegistry=o}envConfigService;httpService;preprocessor;tokenManager;appInfo;secretRegistry;async prepareRequest(e,r,n,i){if(this.secretRegistry?.hasProviders){let E=await this.secretRegistry.resolveSecretTokens(e);Object.keys(E).length>0&&(i={...E,...i??{}})}let s=i&&Object.keys(i).length>0,o=s?this.envConfigService.resolveVariablesInObjectWithExtra(e.params||{},i,r):this.envConfigService.resolveVariablesInObject(e.params||{},r),l=s?this.envConfigService.resolveVariablesInObjectWithExtra(e.query||{},i,r):this.envConfigService.resolveVariablesInObject(e.query||{},r),c=gu(n?.headers||{},e.headers||{}),d=s?this.envConfigService.resolveVariablesInObjectWithExtra(c,i,r):this.envConfigService.resolveVariablesInObject(c,r);if(d=this.preprocessor.sanitizeHeaders(d),!Object.keys(d).some(E=>E.toLowerCase()==="user-agent")){let E=this.appInfo?.version||"0.0.0",k=this.appInfo?.name||"HttpForge";d["User-Agent"]=`${k}/${E}`}if(e.auth?.type==="bearer"&&e.auth.bearerToken){let E=s?this.envConfigService.resolveVariablesWithExtra(e.auth.bearerToken,i,r):this.envConfigService.resolveVariables(e.auth.bearerToken,r);d.Authorization=`Bearer ${E}`}if(e.auth?.type==="basic"&&e.auth.basicAuth){let E=s?this.envConfigService.resolveVariablesWithExtra(e.auth.basicAuth.username||"",i,r):this.envConfigService.resolveVariables(e.auth.basicAuth.username||"",r),k=s?this.envConfigService.resolveVariablesWithExtra(e.auth.basicAuth.password||"",i,r):this.envConfigService.resolveVariables(e.auth.basicAuth.password||"",r),P=Buffer.from(`${E}:${k}`).toString("base64");d.Authorization=`Basic ${P}`}e.auth?.type==="apikey"&&e.auth.apikey&&this.applyApiKey(e.auth.apikey,d,l,r,i),e.auth?.type==="oauth2"&&e.auth.oauth2&&await this.applyOAuth2(e.auth.oauth2,d,r);let m=null;if(e.body&&e.body.type!=="none"){let E=i&&Object.keys(i).length>0?this.envConfigService.resolveVariablesInObjectWithExtra(e.body.content,i,r):this.envConfigService.resolveVariablesInObject(e.body.content,r);if((e.body.format==="json"||e.body.type==="graphql")&&typeof E=="string")try{E=JSON.parse(E)}catch{e.body.format==="json"&&console.warn("[RequestPreparer] Failed to parse JSON body after variable resolution, keeping as string")}let k={type:e.body.type,format:e.body.format,content:E};e.body.type==="form-data"?m=this.buildMultipartFormData(k.content):m=this.preprocessor.encodeBody(k)}e.body?.type!=="form-data"&&this.preprocessor.setContentTypeHeader(d,e.body,e.bodyContentType);let y=e.method||"GET",b=e.url||"",q=i&&Object.keys(i).length>0?this.envConfigService.resolveVariablesWithExtra(b,i,r):this.envConfigService.resolveVariables(b,r),x=this.httpService.buildUrl(q,o,l),v=this.extractQueryFromUrl(x),R={type:e.body?.type||"none",format:e.body?.format,content:m};return{url:x,method:y,headers:d,body:R,params:o,query:v}}extractQueryFromUrl(e){let r=e.indexOf("?");if(r===-1)return{};let n=e.indexOf("#",r),i=n===-1?e.slice(r+1):e.slice(r+1,n);if(!i)return{};let s={};return new URLSearchParams(i).forEach((l,c)=>{s[c]=l}),s}async applyOAuth2(e,r,n){if(e.accessToken){let s=this.envConfigService.resolveVariables(e.accessToken,n),o=e.tokenPrefix||"Bearer";r.Authorization=`${o} ${s}`;return}if(!this.tokenManager)throw new Error("OAuth2 authentication requires IOAuth2TokenManager. Ensure the service is properly registered.");let i=await this.tokenManager.getToken(e,n);r.Authorization=`${i.tokenType} ${i.accessToken}`}applyApiKey(e,r,n,i,s){if(!e||!e.key)return;let o=s&&Object.keys(s).length>0,l=o?this.envConfigService.resolveVariablesWithExtra(e.key||"",s,i):this.envConfigService.resolveVariables(e.key||"",i),c=o?this.envConfigService.resolveVariablesWithExtra(e.value||"",s,i):this.envConfigService.resolveVariables(e.value||"",i);(e.in||"header").toLowerCase()==="query"?n[l]=c:r[l]=c}buildMultipartFormData(e){if(!Array.isArray(e))return;let r=new FormData;for(let n of e)!n?.key||n.enabled===!1||r.append(n.key,n.value==null?"":String(n.value));return r}}});var Kz,sc,l_=le(()=>{"use strict";Kz=`
|
|
65
65
|
query IntrospectionQuery {
|
|
66
66
|
__schema {
|
|
67
67
|
queryType { name }
|
|
@@ -98,10 +98,10 @@ fragment TypeRef on __Type {
|
|
|
98
98
|
`)}};xd.defaultYaml={explicit:!1,version:"1.2"};xd.defaultTags={"!!":"tag:yaml.org,2002:"};VP.Directives=xd});var yg=V(Cd=>{"use strict";var WP=ot(),fJ=Rd();function dJ(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function zP(t){let e=new Set;return fJ.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function JP(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function pJ(t,e){let r=[],n=new Map,i=null;return{onAnchor:s=>{r.push(s),i??(i=zP(t));let o=JP(e,i);return i.add(o),o},setAnchors:()=>{for(let s of r){let o=n.get(s);if(typeof o=="object"&&o.anchor&&(WP.isScalar(o.node)||WP.isCollection(o.node)))o.node.anchor=o.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},sourceObjects:n}}Cd.anchorIsValid=dJ;Cd.anchorNames=zP;Cd.createNodeAnchors=pJ;Cd.findNewAnchor=JP});var y_=V(GP=>{"use strict";function Ed(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,s=n.length;i<s;++i){let o=n[i],l=Ed(t,n,String(i),o);l===void 0?delete n[i]:l!==o&&(n[i]=l)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let s=n.get(i),o=Ed(t,n,i,s);o===void 0?n.delete(i):o!==s&&n.set(i,o)}else if(n instanceof Set)for(let i of Array.from(n)){let s=Ed(t,n,i,i);s===void 0?n.delete(i):s!==i&&(n.delete(i),n.add(s))}else for(let[i,s]of Object.entries(n)){let o=Ed(t,n,i,s);o===void 0?delete n[i]:o!==s&&(n[i]=o)}return t.call(e,r,n)}GP.applyReviver=Ed});var To=V(KP=>{"use strict";var hJ=ot();function YP(t,e,r){if(Array.isArray(t))return t.map((n,i)=>YP(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!hJ.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=s=>{n.res=s,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}KP.toJS=YP});var vg=V(ZP=>{"use strict";var mJ=y_(),QP=ot(),gJ=To(),v_=class{constructor(e){Object.defineProperty(this,QP.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:s}={}){if(!QP.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},l=gJ.toJS(this,"",o);if(typeof i=="function")for(let{count:c,res:d}of o.anchors.values())i(d,c);return typeof s=="function"?mJ.applyReviver(s,{"":l},"",l):l}};ZP.NodeBase=v_});var qd=V(XP=>{"use strict";var yJ=yg(),vJ=Rd(),uc=ot(),bJ=vg(),SJ=To(),b_=class extends bJ.NodeBase{constructor(e){super(uc.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],vJ.visit(e,{Node:(s,o)=>{(uc.isAlias(o)||uc.hasAnchor(o))&&n.push(o)}}),r&&(r.aliasResolveCache=n));let i;for(let s of n){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:s}=r,o=this.resolve(i,r);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let l=n.get(o);if(l||(SJ.toJS(o,null,r),l=n.get(o)),l?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=bg(i,o,n)),l.count*l.aliasCount>s)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return l.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(yJ.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${i} `}return i}};function bg(t,e,r){if(uc.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(uc.isCollection(e)){let n=0;for(let i of e.items){let s=bg(t,i,r);s>n&&(n=s)}return n}else if(uc.isPair(e)){let n=bg(t,e.key,r),i=bg(t,e.value,r);return Math.max(n,i)}return 1}XP.Alias=b_});var nr=V(S_=>{"use strict";var wJ=ot(),_J=vg(),RJ=To(),xJ=t=>!t||typeof t!="function"&&typeof t!="object",$o=class extends _J.NodeBase{constructor(e){super(wJ.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:RJ.toJS(this.value,e,r)}toString(){return String(this.value)}};$o.BLOCK_FOLDED="BLOCK_FOLDED";$o.BLOCK_LITERAL="BLOCK_LITERAL";$o.PLAIN="PLAIN";$o.QUOTE_DOUBLE="QUOTE_DOUBLE";$o.QUOTE_SINGLE="QUOTE_SINGLE";S_.Scalar=$o;S_.isScalarValue=xJ});var Id=V(tk=>{"use strict";var CJ=qd(),el=ot(),ek=nr(),EJ="tag:yaml.org,2002:";function qJ(t,e,r){if(e){let n=r.filter(s=>s.tag===e),i=n.find(s=>!s.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return r.find(n=>n.identify?.(t)&&!n.format)}function IJ(t,e,r){if(el.isDocument(t)&&(t=t.contents),el.isNode(t))return t;if(el.isPair(t)){let m=r.schema[el.MAP].createNode?.(r.schema,null,r);return m.items.push(t),m}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:s,schema:o,sourceObjects:l}=r,c;if(n&&t&&typeof t=="object"){if(c=l.get(t),c)return c.anchor??(c.anchor=i(t)),new CJ.Alias(c.anchor);c={anchor:null,node:null},l.set(t,c)}e?.startsWith("!!")&&(e=EJ+e.slice(2));let d=qJ(t,e,o.tags);if(!d){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let m=new ek.Scalar(t);return c&&(c.node=m),m}d=t instanceof Map?o[el.MAP]:Symbol.iterator in Object(t)?o[el.SEQ]:o[el.MAP]}s&&(s(d),delete r.onTagObj);let p=d?.createNode?d.createNode(r.schema,t,r):typeof d?.nodeClass?.from=="function"?d.nodeClass.from(r.schema,t,r):new ek.Scalar(t);return e?p.tag=e:d.default||(p.tag=d.tag),c&&(c.node=p),p}tk.createNode=IJ});var wg=V(Sg=>{"use strict";var OJ=Id(),Zi=ot(),PJ=vg();function w_(t,e,r){let n=r;for(let i=e.length-1;i>=0;--i){let s=e[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let o=[];o[s]=n,n=o}else n=new Map([[s,n]])}return OJ.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var rk=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,__=class extends PJ.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>Zi.isNode(n)||Zi.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(rk(e))this.add(r);else{let[n,...i]=e,s=this.get(n,!0);if(Zi.isCollection(s))s.addIn(i,r);else if(s===void 0&&this.schema)this.set(n,w_(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(Zi.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,s=this.get(n,!0);return i.length===0?!r&&Zi.isScalar(s)?s.value:s:Zi.isCollection(s)?s.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!Zi.isPair(r))return!1;let n=r.value;return n==null||e&&Zi.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return Zi.isCollection(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let s=this.get(n,!0);if(Zi.isCollection(s))s.setIn(i,r);else if(s===void 0&&this.schema)this.set(n,w_(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};Sg.Collection=__;Sg.collectionFromPath=w_;Sg.isEmptyPath=rk});var Od=V(_g=>{"use strict";var kJ=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function R_(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var AJ=(t,e,r)=>t.endsWith(`
|
|
99
99
|
`)?R_(r,e):r.includes(`
|
|
100
100
|
`)?`
|
|
101
|
-
`+R_(r,e):(t.endsWith(" ")?"":" ")+r;_g.indentComment=R_;_g.lineComment=AJ;_g.stringifyComment=kJ});var ik=V(Pd=>{"use strict";var TJ="flow",x_="block",Rg="quoted";function $J(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:s=20,onFold:o,onOverflow:l}={}){if(!i||i<0)return t;i<s&&(s=0);let c=Math.max(1+s,1+i-e.length);if(t.length<=c)return t;let d=[],p={},m=i-e.length;typeof n=="number"&&(n>i-Math.max(2,s)?d.push(0):m=i-n);let y,b,q=!1,x=-1,v=-1,
|
|
101
|
+
`+R_(r,e):(t.endsWith(" ")?"":" ")+r;_g.indentComment=R_;_g.lineComment=AJ;_g.stringifyComment=kJ});var ik=V(Pd=>{"use strict";var TJ="flow",x_="block",Rg="quoted";function $J(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:s=20,onFold:o,onOverflow:l}={}){if(!i||i<0)return t;i<s&&(s=0);let c=Math.max(1+s,1+i-e.length);if(t.length<=c)return t;let d=[],p={},m=i-e.length;typeof n=="number"&&(n>i-Math.max(2,s)?d.push(0):m=i-n);let y,b,q=!1,x=-1,v=-1,R=-1;r===x_&&(x=nk(t,x,e.length),x!==-1&&(m=x+c));for(let k;k=t[x+=1];){if(r===Rg&&k==="\\"){switch(v=x,t[x+1]){case"x":x+=3;break;case"u":x+=5;break;case"U":x+=9;break;default:x+=1}R=x}if(k===`
|
|
102
102
|
`)r===x_&&(x=nk(t,x,e.length)),m=x+e.length+c,y=void 0;else{if(k===" "&&b&&b!==" "&&b!==`
|
|
103
103
|
`&&b!==" "){let P=t[x+1];P&&P!==" "&&P!==`
|
|
104
|
-
`&&P!==" "&&(y=x)}if(x>=m)if(y)d.push(y),m=y+c,y=void 0;else if(r===Rg){for(;b===" "||b===" ";)b=k,k=t[x+=1],q=!0;let P=x>
|
|
104
|
+
`&&P!==" "&&(y=x)}if(x>=m)if(y)d.push(y),m=y+c,y=void 0;else if(r===Rg){for(;b===" "||b===" ";)b=k,k=t[x+=1],q=!0;let P=x>R+1?x-2:v-1;if(p[P])return t;d.push(P),p[P]=!0,m=P+c,y=void 0}else q=!0}b=k}if(q&&l&&l(),d.length===0)return t;o&&o();let E=t.slice(0,d[0]);for(let k=0;k<d.length;++k){let P=d[k],M=d[k+1]||t.length;P===0?E=`
|
|
105
105
|
${e}${t.slice(0,M)}`:(r===Rg&&p[P]&&(E+=`${t[P]}\\`),E+=`
|
|
106
106
|
${e}${t.slice(P+1,M)}`)}return E}function nk(t,e,r){let n=e,i=e+1,s=t[i];for(;s===" "||s===" ";)if(e<i+r)s=t[++e];else{do s=t[++e];while(s&&s!==`
|
|
107
107
|
`);n=e,i=e+1,s=t[i]}return n}Pd.FOLD_BLOCK=x_;Pd.FOLD_FLOW=TJ;Pd.FOLD_QUOTED=Rg;Pd.foldFlowLines=$J});var Ad=V(sk=>{"use strict";var yi=nr(),No=ik(),Cg=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Eg=t=>/^(%|---|\.\.\.)/m.test(t);function NJ(t,e,r){if(!e||e<0)return!1;let n=e-r,i=t.length;if(i<=n)return!1;for(let s=0,o=0;s<i;++s)if(t[s]===`
|
|
@@ -118,30 +118,30 @@ ${r}`)+"'";return e.implicitKey?n:No.foldFlowLines(n,r,No.FOLD_FLOW,Cg(e,!1))}fu
|
|
|
118
118
|
`;let m,y;for(y=r.length;y>0;--y){let M=r[y-1];if(M!==`
|
|
119
119
|
`&&M!==" "&&M!==" ")break}let b=r.substring(y),q=b.indexOf(`
|
|
120
120
|
`);q===-1?m="-":r===b||q!==b.length-1?(m="+",s&&s()):m="",b&&(r=r.slice(0,-b.length),b[b.length-1]===`
|
|
121
|
-
`&&(b=b.slice(0,-1)),b=b.replace(E_,`$&${d}`));let x=!1,v,
|
|
122
|
-
`)
|
|
123
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${d}`),j=!1,I=Cg(n,!0);o!=="folded"&&e!==yi.Scalar.BLOCK_FOLDED&&(I.onOverflow=()=>{j=!0});let
|
|
124
|
-
${d}${
|
|
121
|
+
`&&(b=b.slice(0,-1)),b=b.replace(E_,`$&${d}`));let x=!1,v,R=-1;for(v=0;v<r.length;++v){let M=r[v];if(M===" ")x=!0;else if(M===`
|
|
122
|
+
`)R=v;else break}let E=r.substring(0,R<v?R+1:v);E&&(r=r.substring(E.length),E=E.replace(/\n+/g,`$&${d}`));let P=(x?d?"2":"1":"")+m;if(t&&(P+=" "+l(t.replace(/ ?[\r\n]+/g," ")),i&&i()),!p){let M=r.replace(/\n+/g,`
|
|
123
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${d}`),j=!1,I=Cg(n,!0);o!=="folded"&&e!==yi.Scalar.BLOCK_FOLDED&&(I.onOverflow=()=>{j=!0});let _=No.foldFlowLines(`${E}${M}${b}`,d,No.FOLD_BLOCK,I);if(!j)return`>${P}
|
|
124
|
+
${d}${_}`}return r=r.replace(/\n+/g,`$&${d}`),`|${P}
|
|
125
125
|
${d}${E}${r}${b}`}function MJ(t,e,r,n){let{type:i,value:s}=t,{actualString:o,implicitKey:l,indent:c,indentStep:d,inFlow:p}=e;if(l&&s.includes(`
|
|
126
126
|
`)||p&&/[[\]{},]/.test(s))return cc(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||p||!s.includes(`
|
|
127
127
|
`)?cc(s,e):xg(t,e,r,n);if(!l&&!p&&i!==yi.Scalar.PLAIN&&s.includes(`
|
|
128
128
|
`))return xg(t,e,r,n);if(Eg(s)){if(c==="")return e.forceBlockIndent=!0,xg(t,e,r,n);if(l&&c===d)return cc(s,e)}let m=s.replace(/\n+/g,`$&
|
|
129
129
|
${c}`);if(o){let y=x=>x.default&&x.tag!=="tag:yaml.org,2002:str"&&x.test?.test(m),{compat:b,tags:q}=e.doc.schema;if(q.some(y)||b?.some(y))return cc(s,e)}return l?m:No.foldFlowLines(m,c,No.FOLD_FLOW,Cg(e,!1))}function FJ(t,e,r,n){let{implicitKey:i,inFlow:s}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:l}=t;l!==yi.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=yi.Scalar.QUOTE_DOUBLE);let c=p=>{switch(p){case yi.Scalar.BLOCK_FOLDED:case yi.Scalar.BLOCK_LITERAL:return i||s?cc(o.value,e):xg(o,e,r,n);case yi.Scalar.QUOTE_DOUBLE:return kd(o.value,e);case yi.Scalar.QUOTE_SINGLE:return C_(o.value,e);case yi.Scalar.PLAIN:return MJ(o,e,r,n);default:return null}},d=c(l);if(d===null){let{defaultKeyType:p,defaultStringType:m}=e.options,y=i&&p||m;if(d=c(y),d===null)throw new Error(`Unsupported default string type ${y}`)}return d}sk.stringifyString=FJ});var Td=V(q_=>{"use strict";var DJ=yg(),Mo=ot(),jJ=Od(),LJ=Ad();function UJ(t,e){let r=Object.assign({blockQuote:!0,commentString:jJ.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function HJ(t,e){if(e.tag){let i=t.filter(s=>s.tag===e.tag);if(i.length>0)return i.find(s=>s.format===e.format)??i[0]}let r,n;if(Mo.isScalar(e)){n=e.value;let i=t.filter(s=>s.identify?.(n));if(i.length>1){let s=i.filter(o=>o.test);s.length>0&&(i=s)}r=i.find(s=>s.format===e.format)??i.find(s=>!s.format)}else n=e,r=t.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return r}function BJ(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],s=(Mo.isScalar(t)||Mo.isCollection(t))&&t.anchor;s&&DJ.anchorIsValid(s)&&(r.add(s),i.push(`&${s}`));let o=t.tag??(e.default?null:e.tag);return o&&i.push(n.directives.tagString(o)),i.join(" ")}function VJ(t,e,r,n){if(Mo.isPair(t))return t.toString(e,r,n);if(Mo.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,s=Mo.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i??(i=HJ(e.doc.schema.tags,s));let o=BJ(s,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let l=typeof i.stringify=="function"?i.stringify(s,e,r,n):Mo.isScalar(s)?LJ.stringifyString(s,e,r,n):s.toString(e,r,n);return o?Mo.isScalar(s)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}
|
|
130
130
|
${e.indent}${l}`:l}q_.createStringifyContext=UJ;q_.stringify=VJ});var uk=V(lk=>{"use strict";var $s=ot(),ok=nr(),ak=Td(),$d=Od();function WJ({key:t,value:e},r,n,i){let{allNullValues:s,doc:o,indent:l,indentStep:c,options:{commentString:d,indentSeq:p,simpleKeys:m}}=r,y=$s.isNode(t)&&t.comment||null;if(m){if(y)throw new Error("With simple keys, key nodes cannot have comments");if($s.isCollection(t)||!$s.isNode(t)&&typeof t=="object"){let I="With simple keys, collection cannot be used as a key value";throw new Error(I)}}let b=!m&&(!t||y&&e==null&&!r.inFlow||$s.isCollection(t)||($s.isScalar(t)?t.type===ok.Scalar.BLOCK_FOLDED||t.type===ok.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!b&&(m||!s),indent:l+c});let q=!1,x=!1,v=ak.stringify(t,r,()=>q=!0,()=>x=!0);if(!b&&!r.inFlow&&v.length>1024){if(m)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");b=!0}if(r.inFlow){if(s||e==null)return q&&n&&n(),v===""?"?":b?`? ${v}`:v}else if(s&&!m||e==null&&b)return v=`? ${v}`,y&&!q?v+=$d.lineComment(v,r.indent,d(y)):x&&i&&i(),v;q&&(y=null),b?(y&&(v+=$d.lineComment(v,r.indent,d(y))),v=`? ${v}
|
|
131
|
-
${l}:`):(v=`${v}:`,y&&(v+=$d.lineComment(v,r.indent,d(y))));let
|
|
131
|
+
${l}:`):(v=`${v}:`,y&&(v+=$d.lineComment(v,r.indent,d(y))));let R,E,k;$s.isNode(e)?(R=!!e.spaceBefore,E=e.commentBefore,k=e.comment):(R=!1,E=null,k=null,e&&typeof e=="object"&&(e=o.createNode(e))),r.implicitKey=!1,!b&&!y&&$s.isScalar(e)&&(r.indentAtStart=v.length+1),x=!1,!p&&c.length>=2&&!r.inFlow&&!b&&$s.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let P=!1,M=ak.stringify(e,r,()=>P=!0,()=>x=!0),j=" ";if(y||R||E){if(j=R?`
|
|
132
132
|
`:"",E){let I=d(E);j+=`
|
|
133
133
|
${$d.indentComment(I,r.indent)}`}M===""&&!r.inFlow?j===`
|
|
134
134
|
`&&k&&(j=`
|
|
135
135
|
|
|
136
136
|
`):j+=`
|
|
137
|
-
${r.indent}`}else if(!b&&$s.isCollection(e)){let I=M[0],
|
|
138
|
-
`),A=
|
|
137
|
+
${r.indent}`}else if(!b&&$s.isCollection(e)){let I=M[0],_=M.indexOf(`
|
|
138
|
+
`),A=_!==-1,F=r.inFlow??e.flow??e.items.length===0;if(A||!F){let U=!1;if(A&&(I==="&"||I==="!")){let D=M.indexOf(" ");I==="&"&&D!==-1&&D<_&&M[D+1]==="!"&&(D=M.indexOf(" ",D+1)),(D===-1||_<D)&&(U=!0)}U||(j=`
|
|
139
139
|
${r.indent}`)}}else(M===""||M[0]===`
|
|
140
|
-
`)&&(j="");return v+=j+M,r.inFlow?P&&n&&n():k&&!P?v+=$d.lineComment(v,r.indent,d(k)):x&&i&&i(),v}lk.stringifyPair=WJ});var O_=V(I_=>{"use strict";var ck=require("process");function zJ(t,...e){t==="debug"&&console.log(...e)}function JJ(t,e){(t==="debug"||t==="warn")&&(typeof ck.emitWarning=="function"?ck.emitWarning(e):console.warn(e))}I_.debug=zJ;I_.warn=JJ});var kg=V(Pg=>{"use strict";var Og=ot(),fk=nr(),qg="<<",Ig={identify:t=>t===qg||typeof t=="symbol"&&t.description===qg,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new fk.Scalar(Symbol(qg)),{addToJSMap:dk}),stringify:()=>qg},GJ=(t,e)=>(Ig.identify(e)||Og.isScalar(e)&&(!e.type||e.type===fk.Scalar.PLAIN)&&Ig.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===Ig.tag&&r.default);function dk(t,e,r){let n=pk(t,r);if(Og.isSeq(n))for(let i of n.items)P_(t,e,i);else if(Array.isArray(n))for(let i of n)P_(t,e,i);else P_(t,e,n)}function P_(t,e,r){let n=pk(t,r);if(!Og.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[s,o]of i)e instanceof Map?e.has(s)||e.set(s,o):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function pk(t,e){return t&&Og.isAlias(e)?e.resolve(t.doc,t):e}Pg.addMergeToJSMap=dk;Pg.isMergeKey=GJ;Pg.merge=Ig});var A_=V(gk=>{"use strict";var YJ=O_(),hk=kg(),KJ=Td(),mk=ot(),k_=To();function QJ(t,e,{key:r,value:n}){if(mk.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(hk.isMergeKey(t,r))hk.addMergeToJSMap(t,e,n);else{let i=k_.toJS(r,"",t);if(e instanceof Map)e.set(i,k_.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let s=ZJ(r,i,t),o=k_.toJS(n,s,t);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function ZJ(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(mk.isNode(t)&&r?.doc){let n=KJ.createStringifyContext(r.doc,{});n.anchors=new Set;for(let s of r.anchors.keys())n.anchors.add(s.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),YJ.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}gk.addPairToJSMap=QJ});var Fo=V(T_=>{"use strict";var yk=Id(),XJ=uk(),eG=A_(),Ag=ot();function tG(t,e,r){let n=yk.createNode(t,void 0,r),i=yk.createNode(e,void 0,r);return new Tg(n,i)}var Tg=class t{constructor(e,r=null){Object.defineProperty(this,Ag.NODE_TYPE,{value:Ag.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return Ag.isNode(r)&&(r=r.clone(e)),Ag.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return eG.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?XJ.stringifyPair(this,e,r,n):JSON.stringify(this)}};T_.Pair=Tg;T_.createPair=tG});var $_=V(bk=>{"use strict";var tl=ot(),vk=Td(),$g=Od();function rG(t,e,r){return(e.inFlow??t.flow?iG:nG)(t,e,r)}function nG({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:s,onChompKeep:o,onComment:l}){let{indent:c,options:{commentString:d}}=r,p=Object.assign({},r,{indent:s,type:null}),m=!1,y=[];for(let q=0;q<e.length;++q){let x=e[q],v=null;if(tl.isNode(x))!m&&x.spaceBefore&&y.push(""),Ng(r,y,x.commentBefore,m),x.comment&&(v=x.comment);else if(tl.isPair(x)){let E=tl.isNode(x.key)?x.key:null;E&&(!m&&E.spaceBefore&&y.push(""),Ng(r,y,E.commentBefore,m))}m=!1;let
|
|
140
|
+
`)&&(j="");return v+=j+M,r.inFlow?P&&n&&n():k&&!P?v+=$d.lineComment(v,r.indent,d(k)):x&&i&&i(),v}lk.stringifyPair=WJ});var O_=V(I_=>{"use strict";var ck=require("process");function zJ(t,...e){t==="debug"&&console.log(...e)}function JJ(t,e){(t==="debug"||t==="warn")&&(typeof ck.emitWarning=="function"?ck.emitWarning(e):console.warn(e))}I_.debug=zJ;I_.warn=JJ});var kg=V(Pg=>{"use strict";var Og=ot(),fk=nr(),qg="<<",Ig={identify:t=>t===qg||typeof t=="symbol"&&t.description===qg,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new fk.Scalar(Symbol(qg)),{addToJSMap:dk}),stringify:()=>qg},GJ=(t,e)=>(Ig.identify(e)||Og.isScalar(e)&&(!e.type||e.type===fk.Scalar.PLAIN)&&Ig.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===Ig.tag&&r.default);function dk(t,e,r){let n=pk(t,r);if(Og.isSeq(n))for(let i of n.items)P_(t,e,i);else if(Array.isArray(n))for(let i of n)P_(t,e,i);else P_(t,e,n)}function P_(t,e,r){let n=pk(t,r);if(!Og.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[s,o]of i)e instanceof Map?e.has(s)||e.set(s,o):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function pk(t,e){return t&&Og.isAlias(e)?e.resolve(t.doc,t):e}Pg.addMergeToJSMap=dk;Pg.isMergeKey=GJ;Pg.merge=Ig});var A_=V(gk=>{"use strict";var YJ=O_(),hk=kg(),KJ=Td(),mk=ot(),k_=To();function QJ(t,e,{key:r,value:n}){if(mk.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(hk.isMergeKey(t,r))hk.addMergeToJSMap(t,e,n);else{let i=k_.toJS(r,"",t);if(e instanceof Map)e.set(i,k_.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let s=ZJ(r,i,t),o=k_.toJS(n,s,t);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function ZJ(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(mk.isNode(t)&&r?.doc){let n=KJ.createStringifyContext(r.doc,{});n.anchors=new Set;for(let s of r.anchors.keys())n.anchors.add(s.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),YJ.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}gk.addPairToJSMap=QJ});var Fo=V(T_=>{"use strict";var yk=Id(),XJ=uk(),eG=A_(),Ag=ot();function tG(t,e,r){let n=yk.createNode(t,void 0,r),i=yk.createNode(e,void 0,r);return new Tg(n,i)}var Tg=class t{constructor(e,r=null){Object.defineProperty(this,Ag.NODE_TYPE,{value:Ag.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return Ag.isNode(r)&&(r=r.clone(e)),Ag.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return eG.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?XJ.stringifyPair(this,e,r,n):JSON.stringify(this)}};T_.Pair=Tg;T_.createPair=tG});var $_=V(bk=>{"use strict";var tl=ot(),vk=Td(),$g=Od();function rG(t,e,r){return(e.inFlow??t.flow?iG:nG)(t,e,r)}function nG({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:s,onChompKeep:o,onComment:l}){let{indent:c,options:{commentString:d}}=r,p=Object.assign({},r,{indent:s,type:null}),m=!1,y=[];for(let q=0;q<e.length;++q){let x=e[q],v=null;if(tl.isNode(x))!m&&x.spaceBefore&&y.push(""),Ng(r,y,x.commentBefore,m),x.comment&&(v=x.comment);else if(tl.isPair(x)){let E=tl.isNode(x.key)?x.key:null;E&&(!m&&E.spaceBefore&&y.push(""),Ng(r,y,E.commentBefore,m))}m=!1;let R=vk.stringify(x,p,()=>v=null,()=>m=!0);v&&(R+=$g.lineComment(R,s,d(v))),m&&v&&(m=!1),y.push(n+R)}let b;if(y.length===0)b=i.start+i.end;else{b=y[0];for(let q=1;q<y.length;++q){let x=y[q];b+=x?`
|
|
141
141
|
${c}${x}`:`
|
|
142
142
|
`}}return t?(b+=`
|
|
143
|
-
`+$g.indentComment(d(t),c),l&&l()):m&&o&&o(),b}function iG({items:t},e,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:s,flowCollectionPadding:o,options:{commentString:l}}=e;n+=s;let c=Object.assign({},e,{indent:n,inFlow:!0,type:null}),d=!1,p=0,m=[];for(let q=0;q<t.length;++q){let x=t[q],v=null;if(tl.isNode(x))x.spaceBefore&&m.push(""),Ng(e,m,x.commentBefore,!1),x.comment&&(v=x.comment);else if(tl.isPair(x)){let E=tl.isNode(x.key)?x.key:null;E&&(E.spaceBefore&&m.push(""),Ng(e,m,E.commentBefore,!1),E.comment&&(d=!0));let k=tl.isNode(x.value)?x.value:null;k?(k.comment&&(v=k.comment),k.commentBefore&&(d=!0)):x.value==null&&E?.comment&&(v=E.comment)}v&&(d=!0);let
|
|
144
|
-
`)),q<t.length-1?
|
|
143
|
+
`+$g.indentComment(d(t),c),l&&l()):m&&o&&o(),b}function iG({items:t},e,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:s,flowCollectionPadding:o,options:{commentString:l}}=e;n+=s;let c=Object.assign({},e,{indent:n,inFlow:!0,type:null}),d=!1,p=0,m=[];for(let q=0;q<t.length;++q){let x=t[q],v=null;if(tl.isNode(x))x.spaceBefore&&m.push(""),Ng(e,m,x.commentBefore,!1),x.comment&&(v=x.comment);else if(tl.isPair(x)){let E=tl.isNode(x.key)?x.key:null;E&&(E.spaceBefore&&m.push(""),Ng(e,m,E.commentBefore,!1),E.comment&&(d=!0));let k=tl.isNode(x.value)?x.value:null;k?(k.comment&&(v=k.comment),k.commentBefore&&(d=!0)):x.value==null&&E?.comment&&(v=E.comment)}v&&(d=!0);let R=vk.stringify(x,c,()=>v=null);d||(d=m.length>p||R.includes(`
|
|
144
|
+
`)),q<t.length-1?R+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(d||(d=m.reduce((E,k)=>E+k.length+2,2)+(R.length+2)>e.options.lineWidth)),d&&(R+=",")),v&&(R+=$g.lineComment(R,n,l(v))),m.push(R),p=m.length}let{start:y,end:b}=r;if(m.length===0)return y+b;if(!d){let q=m.reduce((x,v)=>x+v.length+2,2);d=e.options.lineWidth>0&&q>e.options.lineWidth}if(d){let q=y;for(let x of m)q+=x?`
|
|
145
145
|
${s}${i}${x}`:`
|
|
146
146
|
`;return`${q}
|
|
147
147
|
${i}${b}`}else return`${y}${o}${m.join(" ")}${o}${b}`}function Ng({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let s=$g.indentComment(e(n),t);r.push(s.trimStart())}}bk.stringifyCollection=rG});var jo=V(M_=>{"use strict";var sG=$_(),oG=A_(),aG=wg(),Do=ot(),Mg=Fo(),lG=nr();function Nd(t,e){let r=Do.isScalar(e)?e.value:e;for(let n of t)if(Do.isPair(n)&&(n.key===e||n.key===r||Do.isScalar(n.key)&&n.key.value===r))return n}var N_=class extends aG.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Do.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:s}=n,o=new this(e),l=(c,d)=>{if(typeof s=="function")d=s.call(r,c,d);else if(Array.isArray(s)&&!s.includes(c))return;(d!==void 0||i)&&o.items.push(Mg.createPair(c,d,n))};if(r instanceof Map)for(let[c,d]of r)l(c,d);else if(r&&typeof r=="object")for(let c of Object.keys(r))l(c,r[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,r){let n;Do.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new Mg.Pair(e,e?.value):n=new Mg.Pair(e.key,e.value);let i=Nd(this.items,n.key),s=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);Do.isScalar(i.value)&&lG.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(s){let o=this.items.findIndex(l=>s(n,l)<0);o===-1?this.items.push(n):this.items.splice(o,0,n)}else this.items.push(n)}delete(e){let r=Nd(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=Nd(this.items,e)?.value;return(!r&&Do.isScalar(i)?i.value:i)??void 0}has(e){return!!Nd(this.items,e)}set(e,r){this.add(new Mg.Pair(e,r),!0)}toJSON(e,r,n){let i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(let s of this.items)oG.addPairToJSMap(r,i,s);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!Do.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),sG.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};M_.YAMLMap=N_;M_.findPair=Nd});var fc=V(wk=>{"use strict";var uG=ot(),Sk=jo(),cG={collection:"map",default:!0,nodeClass:Sk.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return uG.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>Sk.YAMLMap.from(t,e,r)};wk.map=cG});var Lo=V(_k=>{"use strict";var fG=Id(),dG=$_(),pG=wg(),Dg=ot(),hG=nr(),mG=To(),F_=class extends pG.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Dg.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=Fg(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=Fg(e);if(typeof n!="number")return;let i=this.items[n];return!r&&Dg.isScalar(i)?i.value:i}has(e){let r=Fg(e);return typeof r=="number"&&r<this.items.length}set(e,r){let n=Fg(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];Dg.isScalar(i)&&hG.isScalarValue(r)?i.value=r:this.items[n]=r}toJSON(e,r){let n=[];r?.onCreate&&r.onCreate(n);let i=0;for(let s of this.items)n.push(mG.toJS(s,String(i++),r));return n}toString(e,r,n){return e?dG.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:r}):JSON.stringify(this)}static from(e,r,n){let{replacer:i}=n,s=new this(e);if(r&&Symbol.iterator in Object(r)){let o=0;for(let l of r){if(typeof i=="function"){let c=r instanceof Set?l:String(o++);l=i.call(r,c,l)}s.items.push(fG.createNode(l,void 0,n))}}return s}};function Fg(t){let e=Dg.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}_k.YAMLSeq=F_});var dc=V(xk=>{"use strict";var gG=ot(),Rk=Lo(),yG={collection:"seq",default:!0,nodeClass:Rk.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return gG.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>Rk.YAMLSeq.from(t,e,r)};xk.seq=yG});var Md=V(Ck=>{"use strict";var vG=Ad(),bG={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),vG.stringifyString(t,e,r,n)}};Ck.string=bG});var jg=V(Ik=>{"use strict";var Ek=nr(),qk={identify:t=>t==null,createNode:()=>new Ek.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ek.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&qk.test.test(t)?t:e.options.nullStr};Ik.nullTag=qk});var D_=V(Pk=>{"use strict";var SG=nr(),Ok={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new SG.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&Ok.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};Pk.boolTag=Ok});var pc=V(kk=>{"use strict";function wG({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let o=s.indexOf(".");o<0&&(o=s.length,s+=".");let l=e-(s.length-o-1);for(;l-- >0;)s+="0"}return s}kk.stringifyNumber=wG});var L_=V(Lg=>{"use strict";var _G=nr(),j_=pc(),RG={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:j_.stringifyNumber},xG={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():j_.stringifyNumber(t)}},CG={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new _G.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:j_.stringifyNumber};Lg.float=CG;Lg.floatExp=xG;Lg.floatNaN=RG});var H_=V(Hg=>{"use strict";var Ak=pc(),Ug=t=>typeof t=="bigint"||Number.isInteger(t),U_=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function Tk(t,e,r){let{value:n}=t;return Ug(n)&&n>=0?r+n.toString(e):Ak.stringifyNumber(t)}var EG={identify:t=>Ug(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>U_(t,2,8,r),stringify:t=>Tk(t,8,"0o")},qG={identify:Ug,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>U_(t,0,10,r),stringify:Ak.stringifyNumber},IG={identify:t=>Ug(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>U_(t,2,16,r),stringify:t=>Tk(t,16,"0x")};Hg.int=qG;Hg.intHex=IG;Hg.intOct=EG});var Nk=V($k=>{"use strict";var OG=fc(),PG=jg(),kG=dc(),AG=Md(),TG=D_(),B_=L_(),V_=H_(),$G=[OG.map,kG.seq,AG.string,PG.nullTag,TG.boolTag,V_.intOct,V_.int,V_.intHex,B_.floatNaN,B_.floatExp,B_.float];$k.schema=$G});var Dk=V(Fk=>{"use strict";var NG=nr(),MG=fc(),FG=dc();function Mk(t){return typeof t=="bigint"||Number.isInteger(t)}var Bg=({value:t})=>JSON.stringify(t),DG=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Bg},{identify:t=>t==null,createNode:()=>new NG.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Bg},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Bg},{identify:Mk,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>Mk(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Bg}],jG={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},LG=[MG.map,FG.seq].concat(DG,jG);Fk.schema=LG});var z_=V(jk=>{"use strict";var Fd=require("buffer"),W_=nr(),UG=Ad(),HG={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof Fd.Buffer=="function")return Fd.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i<r.length;++i)n[i]=r.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:r},n,i,s){if(!r)return"";let o=r,l;if(typeof Fd.Buffer=="function")l=o instanceof Fd.Buffer?o.toString("base64"):Fd.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let d=0;d<o.length;++d)c+=String.fromCharCode(o[d]);l=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=W_.Scalar.BLOCK_LITERAL),e!==W_.Scalar.QUOTE_DOUBLE){let c=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),d=Math.ceil(l.length/c),p=new Array(d);for(let m=0,y=0;m<d;++m,y+=c)p[m]=l.substr(y,c);l=p.join(e===W_.Scalar.BLOCK_LITERAL?`
|
|
@@ -150,30 +150,30 @@ ${i.key.commentBefore}`:n.commentBefore),n.comment){let s=i.value??i.key;s.comme
|
|
|
150
150
|
${s.comment}`:n.comment}n=i}t.items[r]=Vg.isPair(n)?n:new J_.Pair(n)}}else e("Expected a sequence for this tag");return t}function Uk(t,e,r){let{replacer:n}=r,i=new VG.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof n=="function"&&(o=n.call(e,String(s++),o));let l,c;if(Array.isArray(o))if(o.length===2)l=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let d=Object.keys(o);if(d.length===1)l=d[0],c=o[l];else throw new TypeError(`Expected tuple with one key, not ${d.length} keys`)}else l=o;i.items.push(J_.createPair(l,c,r))}return i}var WG={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Lk,createNode:Uk};Wg.createPairs=Uk;Wg.pairs=WG;Wg.resolvePairs=Lk});var K_=V(Y_=>{"use strict";var Hk=ot(),G_=To(),Dd=jo(),zG=Lo(),Bk=zg(),rl=class t extends zG.YAMLSeq{constructor(){super(),this.add=Dd.YAMLMap.prototype.add.bind(this),this.delete=Dd.YAMLMap.prototype.delete.bind(this),this.get=Dd.YAMLMap.prototype.get.bind(this),this.has=Dd.YAMLMap.prototype.has.bind(this),this.set=Dd.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let s,o;if(Hk.isPair(i)?(s=G_.toJS(i.key,"",r),o=G_.toJS(i.value,s,r)):s=G_.toJS(i,"",r),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,o)}return n}static from(e,r,n){let i=Bk.createPairs(e,r,n),s=new this;return s.items=i.items,s}};rl.tag="tag:yaml.org,2002:omap";var JG={collection:"seq",identify:t=>t instanceof Map,nodeClass:rl,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=Bk.resolvePairs(t,e),n=[];for(let{key:i}of r.items)Hk.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new rl,r)},createNode:(t,e,r)=>rl.from(t,e,r)};Y_.YAMLOMap=rl;Y_.omap=JG});var Gk=V(Q_=>{"use strict";var Vk=nr();function Wk({value:t,source:e},r){return e&&(t?zk:Jk).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var zk={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Vk.Scalar(!0),stringify:Wk},Jk={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Vk.Scalar(!1),stringify:Wk};Q_.falseTag=Jk;Q_.trueTag=zk});var Yk=V(Jg=>{"use strict";var GG=nr(),Z_=pc(),YG={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Z_.stringifyNumber},KG={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Z_.stringifyNumber(t)}},QG={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new GG.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:Z_.stringifyNumber};Jg.float=QG;Jg.floatExp=KG;Jg.floatNaN=YG});var Qk=V(Ld=>{"use strict";var Kk=pc(),jd=t=>typeof t=="bigint"||Number.isInteger(t);function Gg(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return i==="-"?BigInt(-1)*o:o}let s=parseInt(t,r);return i==="-"?-1*s:s}function X_(t,e,r){let{value:n}=t;if(jd(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return Kk.stringifyNumber(t)}var ZG={identify:jd,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>Gg(t,2,2,r),stringify:t=>X_(t,2,"0b")},XG={identify:jd,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>Gg(t,1,8,r),stringify:t=>X_(t,8,"0")},eY={identify:jd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>Gg(t,0,10,r),stringify:Kk.stringifyNumber},tY={identify:jd,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>Gg(t,2,16,r),stringify:t=>X_(t,16,"0x")};Ld.int=eY;Ld.intBin=ZG;Ld.intHex=tY;Ld.intOct=XG});var tR=V(eR=>{"use strict";var Qg=ot(),Yg=Fo(),Kg=jo(),nl=class t extends Kg.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;Qg.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Yg.Pair(e.key,null):r=new Yg.Pair(e,null),Kg.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Kg.findPair(this.items,e);return!r&&Qg.isPair(n)?Qg.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=Kg.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new Yg.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,s=new this(e);if(r&&Symbol.iterator in Object(r))for(let o of r)typeof i=="function"&&(o=i.call(r,o,o)),s.items.push(Yg.createPair(o,null,n));return s}};nl.tag="tag:yaml.org,2002:set";var rY={collection:"map",identify:t=>t instanceof Set,nodeClass:nl,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>nl.from(t,e,r),resolve(t,e){if(Qg.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new nl,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};eR.YAMLSet=nl;eR.set=rY});var nR=V(Zg=>{"use strict";var nY=pc();function rR(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=o=>e?BigInt(o):Number(o),s=n.replace(/_/g,"").split(":").reduce((o,l)=>o*i(60)+i(l),i(0));return r==="-"?i(-1)*s:s}function Zk(t){let{value:e}=t,r=o=>o;if(typeof e=="bigint")r=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return nY.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(60),s=[e%i];return e<60?s.unshift(0):(e=(e-s[0])/i,s.unshift(e%i),e>=60&&(e=(e-s[0])/i,s.unshift(e))),n+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var iY={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>rR(t,r),stringify:Zk},sY={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>rR(t,!1),stringify:Zk},Xk={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(Xk.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,s,o,l]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,d=Date.UTC(r,n-1,i,s||0,o||0,l||0,c),p=e[8];if(p&&p!=="Z"){let m=rR(p,!1);Math.abs(m)<30&&(m*=60),d-=6e4*m}return new Date(d)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Zg.floatTime=sY;Zg.intTime=iY;Zg.timestamp=Xk});var rA=V(tA=>{"use strict";var oY=fc(),aY=jg(),lY=dc(),uY=Md(),cY=z_(),eA=Gk(),iR=Yk(),Xg=Qk(),fY=kg(),dY=K_(),pY=zg(),hY=tR(),sR=nR(),mY=[oY.map,lY.seq,uY.string,aY.nullTag,eA.trueTag,eA.falseTag,Xg.intBin,Xg.intOct,Xg.int,Xg.intHex,iR.floatNaN,iR.floatExp,iR.float,cY.binary,fY.merge,dY.omap,pY.pairs,hY.set,sR.intTime,sR.floatTime,sR.timestamp];tA.schema=mY});var dA=V(lR=>{"use strict";var oA=fc(),gY=jg(),aA=dc(),yY=Md(),vY=D_(),oR=L_(),aR=H_(),bY=Nk(),SY=Dk(),lA=z_(),Ud=kg(),uA=K_(),cA=zg(),nA=rA(),fA=tR(),ey=nR(),iA=new Map([["core",bY.schema],["failsafe",[oA.map,aA.seq,yY.string]],["json",SY.schema],["yaml11",nA.schema],["yaml-1.1",nA.schema]]),sA={binary:lA.binary,bool:vY.boolTag,float:oR.float,floatExp:oR.floatExp,floatNaN:oR.floatNaN,floatTime:ey.floatTime,int:aR.int,intHex:aR.intHex,intOct:aR.intOct,intTime:ey.intTime,map:oA.map,merge:Ud.merge,null:gY.nullTag,omap:uA.omap,pairs:cA.pairs,seq:aA.seq,set:fA.set,timestamp:ey.timestamp},wY={"tag:yaml.org,2002:binary":lA.binary,"tag:yaml.org,2002:merge":Ud.merge,"tag:yaml.org,2002:omap":uA.omap,"tag:yaml.org,2002:pairs":cA.pairs,"tag:yaml.org,2002:set":fA.set,"tag:yaml.org,2002:timestamp":ey.timestamp};function _Y(t,e,r){let n=iA.get(e);if(n&&!t)return r&&!n.includes(Ud.merge)?n.concat(Ud.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(iA.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(let s of t)i=i.concat(s);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(Ud.merge)),i.reduce((s,o)=>{let l=typeof o=="string"?sA[o]:o;if(!l){let c=JSON.stringify(o),d=Object.keys(sA).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${d}`)}return s.includes(l)||s.push(l),s},[])}lR.coreKnownTags=wY;lR.getTags=_Y});var fR=V(pA=>{"use strict";var uR=ot(),RY=fc(),xY=dc(),CY=Md(),ty=dA(),EY=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,cR=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(e)?ty.getTags(e,"compat"):e?ty.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?ty.coreKnownTags:{},this.tags=ty.getTags(r,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,uR.MAP,{value:RY.map}),Object.defineProperty(this,uR.SCALAR,{value:CY.string}),Object.defineProperty(this,uR.SEQ,{value:xY.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?EY:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};pA.Schema=cR});var mA=V(hA=>{"use strict";var qY=ot(),dR=Td(),Hd=Od();function IY(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=dR.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=s(t.commentBefore);r.unshift(Hd.indentComment(c,""))}let o=!1,l=null;if(t.contents){if(qY.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let p=s(t.contents.commentBefore);r.push(Hd.indentComment(p,""))}i.forceBlockIndent=!!t.comment,l=t.contents.comment}let c=l?void 0:()=>o=!0,d=dR.stringify(t.contents,i,()=>l=null,c);l&&(d+=Hd.lineComment(d,"",s(l))),(d[0]==="|"||d[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${d}`:r.push(d)}else r.push(dR.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=s(t.comment);c.includes(`
|
|
151
151
|
`)?(r.push("..."),r.push(Hd.indentComment(c,""))):r.push(`... ${c}`)}else r.push("...");else{let c=t.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||l)&&r[r.length-1]!==""&&r.push(""),r.push(Hd.indentComment(s(c),"")))}return r.join(`
|
|
152
152
|
`)+`
|
|
153
|
-
`}hA.stringifyDocument=IY});var Bd=V(gA=>{"use strict";var OY=qd(),hc=wg(),Jn=ot(),PY=Fo(),kY=To(),AY=fR(),TY=mA(),pR=yg(),$Y=y_(),NY=Id(),hR=g_(),mR=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Jn.NODE_TYPE,{value:Jn.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=s;let{version:o}=s;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new hR.Directives({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[Jn.NODE_TYPE]:{value:Jn.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Jn.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){mc(this.contents)&&this.contents.add(e)}addIn(e,r){mc(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=pR.anchorNames(this);e.anchor=!r||n.has(r)?pR.findNewAnchor(r||"a",n):r}return new OY.Alias(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let v=E=>typeof E=="number"||E instanceof String||E instanceof Number,
|
|
153
|
+
`}hA.stringifyDocument=IY});var Bd=V(gA=>{"use strict";var OY=qd(),hc=wg(),Jn=ot(),PY=Fo(),kY=To(),AY=fR(),TY=mA(),pR=yg(),$Y=y_(),NY=Id(),hR=g_(),mR=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Jn.NODE_TYPE,{value:Jn.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=s;let{version:o}=s;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new hR.Directives({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[Jn.NODE_TYPE]:{value:Jn.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Jn.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){mc(this.contents)&&this.contents.add(e)}addIn(e,r){mc(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=pR.anchorNames(this);e.anchor=!r||n.has(r)?pR.findNewAnchor(r||"a",n):r}return new OY.Alias(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let v=E=>typeof E=="number"||E instanceof String||E instanceof Number,R=r.filter(v).map(String);R.length>0&&(r=r.concat(R)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:l,keepUndefined:c,onTagObj:d,tag:p}=n??{},{onAnchor:m,setAnchors:y,sourceObjects:b}=pR.createNodeAnchors(this,o||"a"),q={aliasDuplicateObjects:s??!0,keepUndefined:c??!1,onAnchor:m,onTagObj:d,replacer:i,schema:this.schema,sourceObjects:b},x=NY.createNode(e,p,q);return l&&Jn.isCollection(x)&&(x.flow=!0),y(),x}createPair(e,r,n={}){let i=this.createNode(e,null,n),s=this.createNode(r,null,n);return new PY.Pair(i,s)}delete(e){return mc(this.contents)?this.contents.delete(e):!1}deleteIn(e){return hc.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):mc(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return Jn.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return hc.isEmptyPath(e)?!r&&Jn.isScalar(this.contents)?this.contents.value:this.contents:Jn.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return Jn.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return hc.isEmptyPath(e)?this.contents!==void 0:Jn.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=hc.collectionFromPath(this.schema,[e],r):mc(this.contents)&&this.contents.set(e,r)}setIn(e,r){hc.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=hc.collectionFromPath(this.schema,Array.from(e),r):mc(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new hR.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new hR.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new AY.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:s,reviver:o}={}){let l={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=kY.toJS(this.contents,r??"",l);if(typeof s=="function")for(let{count:d,res:p}of l.anchors.values())s(p,d);return typeof o=="function"?$Y.applyReviver(o,{"":c},"",c):c}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return TY.stringifyDocument(this,e)}};function mc(t){if(Jn.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}gA.Document=mR});var zd=V(Wd=>{"use strict";var Vd=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},gR=class extends Vd{constructor(e,r,n){super("YAMLParseError",e,r,n)}},yR=class extends Vd{constructor(e,r,n){super("YAMLWarning",e,r,n)}},MY=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(l=>e.linePos(l));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let s=i-1,o=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){let l=Math.min(s-39,o.length-79);o="\u2026"+o.substring(l),s-=l-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(o.substring(0,s))){let l=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);l.length>80&&(l=l.substring(0,79)+`\u2026
|
|
154
154
|
`),o=l+o}if(/[^ ]/.test(o)){let l=1,c=r.linePos[1];c?.line===n&&c.col>i&&(l=Math.max(1,Math.min(c.col-i,80-s)));let d=" ".repeat(s)+"^".repeat(l);r.message+=`:
|
|
155
155
|
|
|
156
156
|
${o}
|
|
157
157
|
${d}
|
|
158
|
-
`}};Wd.YAMLError=Vd;Wd.YAMLParseError=gR;Wd.YAMLWarning=yR;Wd.prettifyError=MY});var Jd=V(yA=>{"use strict";function FY(t,{flow:e,indicator:r,next:n,offset:i,onError:s,parentIndent:o,startOnNewline:l}){let c=!1,d=l,p=l,m="",y="",b=!1,q=!1,x=null,v=null,
|
|
158
|
+
`}};Wd.YAMLError=Vd;Wd.YAMLParseError=gR;Wd.YAMLWarning=yR;Wd.prettifyError=MY});var Jd=V(yA=>{"use strict";function FY(t,{flow:e,indicator:r,next:n,offset:i,onError:s,parentIndent:o,startOnNewline:l}){let c=!1,d=l,p=l,m="",y="",b=!1,q=!1,x=null,v=null,R=null,E=null,k=null,P=null,M=null;for(let _ of t)switch(q&&(_.type!=="space"&&_.type!=="newline"&&_.type!=="comma"&&s(_.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),q=!1),x&&(d&&_.type!=="comment"&&_.type!=="newline"&&s(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),x=null),_.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&_.source.includes(" ")&&(x=_),p=!0;break;case"comment":{p||s(_,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let A=_.source.substring(1)||" ";m?m+=y+A:m=A,y="",d=!1;break}case"newline":d?m?m+=_.source:(!P||r!=="seq-item-ind")&&(c=!0):y+=_.source,d=!0,b=!0,(v||R)&&(E=_),p=!0;break;case"anchor":v&&s(_,"MULTIPLE_ANCHORS","A node can have at most one anchor"),_.source.endsWith(":")&&s(_.offset+_.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),v=_,M??(M=_.offset),d=!1,p=!1,q=!0;break;case"tag":{R&&s(_,"MULTIPLE_TAGS","A node can have at most one tag"),R=_,M??(M=_.offset),d=!1,p=!1,q=!0;break}case r:(v||R)&&s(_,"BAD_PROP_ORDER",`Anchors and tags must be after the ${_.source} indicator`),P&&s(_,"UNEXPECTED_TOKEN",`Unexpected ${_.source} in ${e??"collection"}`),P=_,d=r==="seq-item-ind"||r==="explicit-key-ind",p=!1;break;case"comma":if(e){k&&s(_,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=_,d=!1,p=!1;break}default:s(_,"UNEXPECTED_TOKEN",`Unexpected ${_.type} token`),d=!1,p=!1}let j=t[t.length-1],I=j?j.offset+j.source.length:i;return q&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&s(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),x&&(d&&x.indent<=o||n?.type==="block-map"||n?.type==="block-seq")&&s(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:P,spaceBefore:c,comment:m,hasNewline:b,anchor:v,tag:R,newlineAfterProp:E,end:I,start:M??I}}yA.resolveProps=FY});var ry=V(vA=>{"use strict";function vR(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
|
|
159
159
|
`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(vR(e.key)||vR(e.value))return!0}return!1;default:return!0}}vA.containsNewline=vR});var bR=V(bA=>{"use strict";var DY=ry();function jY(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&DY.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}bA.flowIndentCheck=jY});var SR=V(wA=>{"use strict";var SA=ot();function LY(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(s,o)=>s===o||SA.isScalar(s)&&SA.isScalar(o)&&s.value===o.value;return e.some(s=>i(s.key,r))}wA.mapIncludes=LY});var qA=V(EA=>{"use strict";var _A=Fo(),UY=jo(),RA=Jd(),HY=ry(),xA=bR(),BY=SR(),CA="All mapping items must start at the same column";function VY({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=s?.nodeClass??UY.YAMLMap,l=new o(r.schema);r.atRoot&&(r.atRoot=!1);let c=n.offset,d=null;for(let p of n.items){let{start:m,key:y,sep:b,value:q}=p,x=RA.resolveProps(m,{indicator:"explicit-key-ind",next:y??b?.[0],offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),v=!x.found;if(v){if(y&&(y.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==n.indent&&i(c,"BAD_INDENT",CA)),!x.anchor&&!x.tag&&!b){d=x.end,x.comment&&(l.comment?l.comment+=`
|
|
160
|
-
`+x.comment:l.comment=x.comment);continue}(x.newlineAfterProp||HY.containsNewline(y))&&i(y??m[m.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else x.found?.indent!==n.indent&&i(c,"BAD_INDENT",CA);r.atKey=!0;let
|
|
161
|
-
`+k.comment:E.comment=k.comment);let P=new _A.Pair(E);r.options.keepSourceTokens&&(P.srcToken=p),l.items.push(P)}}return d&&d<c&&i(d,"IMPOSSIBLE","Map comment with trailing content"),l.range=[n.offset,c,d??c],l}EA.resolveBlockMap=VY});var OA=V(IA=>{"use strict";var WY=Lo(),zY=Jd(),JY=bR();function GY({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=s?.nodeClass??WY.YAMLSeq,l=new o(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset,d=null;for(let{start:p,value:m}of n.items){let y=zY.resolveProps(p,{indicator:"seq-item-ind",next:m,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||m)m?.type==="block-seq"?i(y.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{d=y.end,y.comment&&(l.comment=y.comment);continue}let b=m?t(r,m,y,i):e(r,y.end,p,null,y,i);r.schema.compat&&JY.flowIndentCheck(n.indent,m,i),c=b.range[2],l.items.push(b)}return l.range=[n.offset,c,d??c],l}IA.resolveBlockSeq=GY});var gc=V(PA=>{"use strict";function YY(t,e,r,n){let i="";if(t){let s=!1,o="";for(let l of t){let{source:c,type:d}=l;switch(d){case"space":s=!0;break;case"comment":{r&&!s&&n(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let p=c.substring(1)||" ";i?i+=o+p:i=p,o="";break}case"newline":i&&(o+=c),s=!0;break;default:n(l,"UNEXPECTED_TOKEN",`Unexpected ${d} at node end`)}e+=c.length}}return{comment:i,offset:e}}PA.resolveEnd=YY});var $A=V(TA=>{"use strict";var KY=ot(),QY=Fo(),kA=jo(),ZY=Lo(),XY=gc(),AA=Jd(),eK=ry(),tK=SR(),wR="Block collections are not allowed within flow collections",_R=t=>t&&(t.type==="block-map"||t.type==="block-seq");function rK({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=n.start.source==="{",l=o?"flow map":"flow sequence",c=s?.nodeClass??(o?kA.YAMLMap:ZY.YAMLSeq),d=new c(r.schema);d.flow=!0;let p=r.atRoot;p&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let m=n.offset+n.start.source.length;for(let v=0;v<n.items.length;++v){let
|
|
162
|
-
`+j.comment:d.comment=j.comment),m=j.end;continue}!o&&r.options.strict&&eK.containsNewline(k)&&i(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(v===0)j.comma&&i(j.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(j.comma||i(j.start,"MISSING_CHAR",`Missing , between ${l} items`),j.comment){let I="";e:for(let
|
|
163
|
-
`+I:
|
|
164
|
-
`+A.comment:
|
|
160
|
+
`+x.comment:l.comment=x.comment);continue}(x.newlineAfterProp||HY.containsNewline(y))&&i(y??m[m.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else x.found?.indent!==n.indent&&i(c,"BAD_INDENT",CA);r.atKey=!0;let R=x.end,E=y?t(r,y,x,i):e(r,R,m,null,x,i);r.schema.compat&&xA.flowIndentCheck(n.indent,y,i),r.atKey=!1,BY.mapIncludes(r,l.items,E)&&i(R,"DUPLICATE_KEY","Map keys must be unique");let k=RA.resolveProps(b??[],{indicator:"map-value-ind",next:q,offset:E.range[2],onError:i,parentIndent:n.indent,startOnNewline:!y||y.type==="block-scalar"});if(c=k.end,k.found){v&&(q?.type==="block-map"&&!k.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&x.start<k.found.offset-1024&&i(E.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let P=q?t(r,q,k,i):e(r,c,b,null,k,i);r.schema.compat&&xA.flowIndentCheck(n.indent,q,i),c=P.range[2];let M=new _A.Pair(E,P);r.options.keepSourceTokens&&(M.srcToken=p),l.items.push(M)}else{v&&i(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(E.comment?E.comment+=`
|
|
161
|
+
`+k.comment:E.comment=k.comment);let P=new _A.Pair(E);r.options.keepSourceTokens&&(P.srcToken=p),l.items.push(P)}}return d&&d<c&&i(d,"IMPOSSIBLE","Map comment with trailing content"),l.range=[n.offset,c,d??c],l}EA.resolveBlockMap=VY});var OA=V(IA=>{"use strict";var WY=Lo(),zY=Jd(),JY=bR();function GY({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=s?.nodeClass??WY.YAMLSeq,l=new o(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset,d=null;for(let{start:p,value:m}of n.items){let y=zY.resolveProps(p,{indicator:"seq-item-ind",next:m,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||m)m?.type==="block-seq"?i(y.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{d=y.end,y.comment&&(l.comment=y.comment);continue}let b=m?t(r,m,y,i):e(r,y.end,p,null,y,i);r.schema.compat&&JY.flowIndentCheck(n.indent,m,i),c=b.range[2],l.items.push(b)}return l.range=[n.offset,c,d??c],l}IA.resolveBlockSeq=GY});var gc=V(PA=>{"use strict";function YY(t,e,r,n){let i="";if(t){let s=!1,o="";for(let l of t){let{source:c,type:d}=l;switch(d){case"space":s=!0;break;case"comment":{r&&!s&&n(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let p=c.substring(1)||" ";i?i+=o+p:i=p,o="";break}case"newline":i&&(o+=c),s=!0;break;default:n(l,"UNEXPECTED_TOKEN",`Unexpected ${d} at node end`)}e+=c.length}}return{comment:i,offset:e}}PA.resolveEnd=YY});var $A=V(TA=>{"use strict";var KY=ot(),QY=Fo(),kA=jo(),ZY=Lo(),XY=gc(),AA=Jd(),eK=ry(),tK=SR(),wR="Block collections are not allowed within flow collections",_R=t=>t&&(t.type==="block-map"||t.type==="block-seq");function rK({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=n.start.source==="{",l=o?"flow map":"flow sequence",c=s?.nodeClass??(o?kA.YAMLMap:ZY.YAMLSeq),d=new c(r.schema);d.flow=!0;let p=r.atRoot;p&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let m=n.offset+n.start.source.length;for(let v=0;v<n.items.length;++v){let R=n.items[v],{start:E,key:k,sep:P,value:M}=R,j=AA.resolveProps(E,{flow:l,indicator:"explicit-key-ind",next:k??P?.[0],offset:m,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!j.found){if(!j.anchor&&!j.tag&&!P&&!M){v===0&&j.comma?i(j.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):v<n.items.length-1&&i(j.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),j.comment&&(d.comment?d.comment+=`
|
|
162
|
+
`+j.comment:d.comment=j.comment),m=j.end;continue}!o&&r.options.strict&&eK.containsNewline(k)&&i(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(v===0)j.comma&&i(j.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(j.comma||i(j.start,"MISSING_CHAR",`Missing , between ${l} items`),j.comment){let I="";e:for(let _ of E)switch(_.type){case"comma":case"space":break;case"comment":I=_.source.substring(1);break e;default:break e}if(I){let _=d.items[d.items.length-1];KY.isPair(_)&&(_=_.value??_.key),_.comment?_.comment+=`
|
|
163
|
+
`+I:_.comment=I,j.comment=j.comment.substring(I.length+1)}}if(!o&&!P&&!j.found){let I=M?t(r,M,j,i):e(r,j.end,P,null,j,i);d.items.push(I),m=I.range[2],_R(M)&&i(I.range,"BLOCK_IN_FLOW",wR)}else{r.atKey=!0;let I=j.end,_=k?t(r,k,j,i):e(r,I,E,null,j,i);_R(k)&&i(_.range,"BLOCK_IN_FLOW",wR),r.atKey=!1;let A=AA.resolveProps(P??[],{flow:l,indicator:"map-value-ind",next:M,offset:_.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(A.found){if(!o&&!j.found&&r.options.strict){if(P)for(let D of P){if(D===A.found)break;if(D.type==="newline"){i(D,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}j.start<A.found.offset-1024&&i(A.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else M&&("source"in M&&M.source?.[0]===":"?i(M,"MISSING_CHAR",`Missing space after : in ${l}`):i(A.start,"MISSING_CHAR",`Missing , or : between ${l} items`));let F=M?t(r,M,A,i):A.found?e(r,A.end,P,null,A,i):null;F?_R(M)&&i(F.range,"BLOCK_IN_FLOW",wR):A.comment&&(_.comment?_.comment+=`
|
|
164
|
+
`+A.comment:_.comment=A.comment);let U=new QY.Pair(_,F);if(r.options.keepSourceTokens&&(U.srcToken=R),o){let D=d;tK.mapIncludes(r,D.items,_)&&i(I,"DUPLICATE_KEY","Map keys must be unique"),D.items.push(U)}else{let D=new kA.YAMLMap(r.schema);D.flow=!0,D.items.push(U);let J=(F??_).range;D.range=[_.range[0],J[1],J[2]],d.items.push(D)}m=F?F.range[2]:A.end}}let y=o?"}":"]",[b,...q]=n.end,x=m;if(b?.source===y)x=b.offset+b.source.length;else{let v=l[0].toUpperCase()+l.substring(1),R=p?`${v} must end with a ${y}`:`${v} in block collection must be sufficiently indented and end with a ${y}`;i(m,p?"MISSING_CHAR":"BAD_INDENT",R),b&&b.source.length!==1&&q.unshift(b)}if(q.length>0){let v=XY.resolveEnd(q,x,r.options.strict,i);v.comment&&(d.comment?d.comment+=`
|
|
165
165
|
`+v.comment:d.comment=v.comment),d.range=[n.offset,x,v.offset]}else d.range=[n.offset,x,x];return d}TA.resolveFlowCollection=rK});var MA=V(NA=>{"use strict";var nK=ot(),iK=nr(),sK=jo(),oK=Lo(),aK=qA(),lK=OA(),uK=$A();function RR(t,e,r,n,i,s){let o=r.type==="block-map"?aK.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?lK.resolveBlockSeq(t,e,r,n,s):uK.resolveFlowCollection(t,e,r,n,s),l=o.constructor;return i==="!"||i===l.tagName?(o.tag=l.tagName,o):(i&&(o.tag=i),o)}function cK(t,e,r,n,i){let s=n.tag,o=s?e.directives.tagName(s.source,y=>i(s,"TAG_RESOLVE_FAILED",y)):null;if(r.type==="block-seq"){let{anchor:y,newlineAfterProp:b}=n,q=y&&s?y.offset>s.offset?y:s:y??s;q&&(!b||b.offset<q.offset)&&i(q,"MISSING_CHAR","Missing newline after block sequence props")}let l=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!s||!o||o==="!"||o===sK.YAMLMap.tagName&&l==="map"||o===oK.YAMLSeq.tagName&&l==="seq")return RR(t,e,r,i,o);let c=e.schema.tags.find(y=>y.tag===o&&y.collection===l);if(!c){let y=e.schema.knownTags[o];if(y?.collection===l)e.schema.tags.push(Object.assign({},y,{default:!1})),c=y;else return y?i(s,"BAD_COLLECTION_TYPE",`${y.tag} used for ${l} collection, but expects ${y.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),RR(t,e,r,i,o)}let d=RR(t,e,r,i,o,c),p=c.resolve?.(d,y=>i(s,"TAG_RESOLVE_FAILED",y),e.options)??d,m=nK.isNode(p)?p:new iK.Scalar(p);return m.range=d.range,m.tag=o,c?.format&&(m.format=c.format),m}NA.composeCollection=cK});var CR=V(FA=>{"use strict";var xR=nr();function fK(t,e,r){let n=e.offset,i=dK(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let s=i.mode===">"?xR.Scalar.BLOCK_FOLDED:xR.Scalar.BLOCK_LITERAL,o=e.source?pK(e.source):[],l=o.length;for(let x=o.length-1;x>=0;--x){let v=o[x][1];if(v===""||v==="\r")l=x;else break}if(l===0){let x=i.chomp==="+"&&o.length>0?`
|
|
166
|
-
`.repeat(Math.max(1,o.length-1)):"",v=n+i.length;return e.source&&(v+=e.source.length),{value:x,type:s,comment:i.comment,range:[n,v,v]}}let c=e.indent+i.indent,d=e.offset+i.length,p=0;for(let x=0;x<l;++x){let[v,
|
|
167
|
-
`;for(let x=p;x<l;++x){let[v,
|
|
168
|
-
`):v.length>c||
|
|
166
|
+
`.repeat(Math.max(1,o.length-1)):"",v=n+i.length;return e.source&&(v+=e.source.length),{value:x,type:s,comment:i.comment,range:[n,v,v]}}let c=e.indent+i.indent,d=e.offset+i.length,p=0;for(let x=0;x<l;++x){let[v,R]=o[x];if(R===""||R==="\r")i.indent===0&&v.length>c&&(c=v.length);else{v.length<c&&r(d+v.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(c=v.length),p=x,c===0&&!t.atRoot&&r(d,"BAD_INDENT","Block scalar values in collections must be indented");break}d+=v.length+R.length+1}for(let x=o.length-1;x>=l;--x)o[x][0].length>c&&(l=x+1);let m="",y="",b=!1;for(let x=0;x<p;++x)m+=o[x][0].slice(c)+`
|
|
167
|
+
`;for(let x=p;x<l;++x){let[v,R]=o[x];d+=v.length+R.length+1;let E=R[R.length-1]==="\r";if(E&&(R=R.slice(0,-1)),R&&v.length<c){let P=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(d-R.length-(E?2:1),"BAD_INDENT",P),v=""}s===xR.Scalar.BLOCK_LITERAL?(m+=y+v.slice(c)+R,y=`
|
|
168
|
+
`):v.length>c||R[0]===" "?(y===" "?y=`
|
|
169
169
|
`:!b&&y===`
|
|
170
170
|
`&&(y=`
|
|
171
171
|
|
|
172
|
-
`),m+=y+v.slice(c)+
|
|
173
|
-
`,b=!0):
|
|
172
|
+
`),m+=y+v.slice(c)+R,y=`
|
|
173
|
+
`,b=!0):R===""?y===`
|
|
174
174
|
`?m+=`
|
|
175
175
|
`:y=`
|
|
176
|
-
`:(m+=y+
|
|
176
|
+
`:(m+=y+R,y=" ",b=!1)}switch(i.chomp){case"-":break;case"+":for(let x=l;x<o.length;++x)m+=`
|
|
177
177
|
`+o[x][0].slice(c);m[m.length-1]!==`
|
|
178
178
|
`&&(m+=`
|
|
179
179
|
`);break;default:m+=`
|
|
@@ -232,7 +232,7 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus
|
|
|
232
232
|
`)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
|
|
233
233
|
`,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){uy(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",s=[];if(i&&r.sep&&!r.value){let o=[];for(let l=0;l<r.sep.length;++l){let c=r.sep[l];switch(c.type){case"newline":o.push(l);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(s=r.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Uo(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(mT(r.key)&&!Uo(r.sep,"newline")){let o=yc(r.start),l=r.key,c=r.sep;c.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:l,sep:c}]})}else s.length>0?r.sep=r.sep.concat(s,this.sourceToken):r.sep.push(this.sourceToken);else if(Uo(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let o=yc(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?e.items.push({start:s,key:null,sep:[this.sourceToken]}):Uo(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);i||r.value?(e.items.push({start:s,key:o,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(o):(Object.assign(r,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!r.explicitKey&&r.sep&&!Uo(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:s});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){uy(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||Uo(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:i,sep:[]}):r.sep?this.stack.push(i):Object.assign(r,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=ly(n),s=yc(i);hT(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(`
|
|
234
234
|
`)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
|
|
235
|
-
`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=ly(e),n=yc(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=ly(e),n=yc(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};gT.Parser=VR});var wT=V(Zd=>{"use strict";var yT=kR(),u4=Bd(),Qd=zd(),c4=O_(),f4=ot(),d4=BR(),vT=WR();function bT(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new d4.LineCounter||null,prettyErrors:e}}function p4(t,e={}){let{lineCounter:r,prettyErrors:n}=bT(e),i=new vT.Parser(r?.addNewLine),s=new yT.Composer(e),o=Array.from(s.compose(i.parse(t)));if(n&&r)for(let l of o)l.errors.forEach(Qd.prettifyError(t,r)),l.warnings.forEach(Qd.prettifyError(t,r));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function ST(t,e={}){let{lineCounter:r,prettyErrors:n}=bT(e),i=new vT.Parser(r?.addNewLine),s=new yT.Composer(e),o=null;for(let l of s.compose(i.parse(t),!0,t.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new Qd.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(o.errors.forEach(Qd.prettifyError(t,r)),o.warnings.forEach(Qd.prettifyError(t,r))),o}function h4(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=ST(t,r);if(!i)return null;if(i.warnings.forEach(s=>c4.warn(i.options.logLevel,s)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},r))}function m4(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return f4.isDocument(t)&&!n?t.toString(r):new u4.Document(t,n,r).toString(r)}Zd.parse=h4;Zd.parseAllDocuments=p4;Zd.parseDocument=ST;Zd.stringify=m4});var Xd=V(Rt=>{"use strict";var g4=kR(),y4=Bd(),v4=fR(),zR=zd(),b4=qd(),Ho=ot(),S4=Fo(),w4=nr(),_4=jo(),R4=Lo(),x4=oy(),C4=UR(),E4=BR(),q4=WR(),cy=wT(),_T=Rd();Rt.Composer=g4.Composer;Rt.Document=y4.Document;Rt.Schema=v4.Schema;Rt.YAMLError=zR.YAMLError;Rt.YAMLParseError=zR.YAMLParseError;Rt.YAMLWarning=zR.YAMLWarning;Rt.Alias=b4.Alias;Rt.isAlias=Ho.isAlias;Rt.isCollection=Ho.isCollection;Rt.isDocument=Ho.isDocument;Rt.isMap=Ho.isMap;Rt.isNode=Ho.isNode;Rt.isPair=Ho.isPair;Rt.isScalar=Ho.isScalar;Rt.isSeq=Ho.isSeq;Rt.Pair=S4.Pair;Rt.Scalar=w4.Scalar;Rt.YAMLMap=_4.YAMLMap;Rt.YAMLSeq=R4.YAMLSeq;Rt.CST=x4;Rt.Lexer=C4.Lexer;Rt.LineCounter=E4.LineCounter;Rt.Parser=q4.Parser;Rt.parse=cy.parse;Rt.parseAllDocuments=cy.parseAllDocuments;Rt.parseDocument=cy.parseDocument;Rt.stringify=cy.stringify;Rt.visit=_T.visit;Rt.visitAsync=_T.visitAsync});var I4,O4,P4,k4,A4,T4,$4,Ns,fy=le(()=>{"use strict";I4=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,O4=/^\d{4}-\d{2}-\d{2}$/,P4=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,k4=/^https?:\/\/[^\s]+$/,A4=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,T4=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,$4=/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/,Ns=class{inferFromValue(e){if(e==null)return{nullable:!0};if(Array.isArray(e))return this.inferArraySchema(e);switch(typeof e){case"string":return this.inferStringSchema(e);case"number":return Number.isInteger(e)?{type:"integer"}:{type:"number"};case"boolean":return{type:"boolean"};case"object":return this.inferObjectSchema(e);default:return{}}}mergeSchemas(e,r){if(!e||Object.keys(e).length===0)return{...r};if(!r||Object.keys(r).length===0)return{...e};let n=e.nullable||r.nullable;if(!e.type&&e.nullable)return{...r,nullable:!0};if(!r.type&&r.nullable)return{...e,nullable:!0};if(e.type!==r.type)return e.type==="integer"&&r.type==="number"||e.type==="number"&&r.type==="integer"?{type:"number",...n&&{nullable:!0}}:{...n&&{nullable:!0}};let i={type:e.type};return n&&(i.nullable=!0),e.type==="object"&&r.type==="object"?this.mergeObjectSchemas(e,r,n):e.type==="array"&&r.type==="array"?this.mergeArraySchemas(e,r,n):(e.format&&e.format===r.format&&(i.format=e.format),i)}inferStringFormat(e){if(I4.test(e))return"date-time";if(O4.test(e))return"date";if(P4.test(e))return"email";if(A4.test(e))return"uuid";if(k4.test(e))return"uri";if(T4.test(e))return"ipv4";if($4.test(e))return"ipv6"}inferStringSchema(e){let r={type:"string"},n=this.inferStringFormat(e);return n&&(r.format=n),r}inferArraySchema(e){let r={type:"array"};if(e.length===0)return r;let n=this.inferFromValue(e[0]);for(let i=1;i<e.length;i++)n=this.mergeSchemas(n,this.inferFromValue(e[i]));return r.items=n,r}inferObjectSchema(e){let r={type:"object",properties:{}},n=Object.keys(e);for(let i of n)r.properties[i]=this.inferFromValue(e[i]);return r}mergeObjectSchemas(e,r,n){let i={type:"object",properties:{},...n&&{nullable:!0}},s=e.properties||{},o=r.properties||{},l=new Set([...Object.keys(s),...Object.keys(o)]);for(let m of l)s[m]&&o[m]?i.properties[m]=this.mergeSchemas(s[m],o[m]):s[m]?i.properties[m]={...s[m]}:i.properties[m]={...o[m]};let c=new Set(e.required||Object.keys(s)),d=new Set(r.required||Object.keys(o)),p=[...l].filter(m=>c.has(m)&&d.has(m));return p.length>0&&(i.required=p),i}mergeArraySchemas(e,r,n){let i={type:"array",...n&&{nullable:!0}};return e.items&&r.items?i.items=this.mergeSchemas(e.items,r.items):e.items?i.items={...e.items}:r.items&&(i.items={...r.items}),i}}});var RT,N4,ol,JR=le(()=>{"use strict";RT=ve(Xd());fy();N4=new Set(["content-type","authorization","accept","cookie","host","content-length"]),ol=class{constructor(e,r,n){this.collectionService=e;this.envConfigService=r;this.inferenceService=n;this.inferrer=new Ns}collectionService;envConfigService;inferenceService;inferrer;async export(e,r){let n=this.collectionService.getCollection(e);if(!n)throw new Error(`Collection ${e} not found`);let i={openapi:"3.0.3",info:this.buildInfo(n,r),servers:this.buildServers(r),paths:{},components:{schemas:{},securitySchemes:{}},tags:[]},s=new Map;if(n.auth&&n.auth.type!=="none"&&n.auth.type!=="inherit"){let c=this.mapAuthToSecurityScheme(n.auth);if(c){let{schemeName:d,scheme:p,requirement:m}=c;s.set(d,p),i.security=[m]}}let o=new Set,l=new Set;if(await this.processItems(n.items,i,s,o,l,void 0,n,r),this.augmentServersFromHostVars(l,i.servers,r),s.size>0)for(let[c,d]of s)i.components.securitySchemes[c]=d;else delete i.components.securitySchemes;return i.tags=[...o].map(c=>({name:c})),i.tags.length===0&&delete i.tags,this.deduplicateComponents(i),Object.keys(i.components.schemas).length===0&&delete i.components.schemas,Object.keys(i.components).length===0&&delete i.components,r.format==="yaml"?RT.stringify(i,{indent:2}):JSON.stringify(i,null,2)}buildInfo(e,r){return{title:r.info?.title||e.name,description:r.info?.description||e.description||"",version:r.info?.version||e.version||"1.0.0"}}buildServers(e){let r=[],n=e.environments||[];if(n.length===0){let i=this.envConfigService.getSelectedEnvironment();if(i){let s=this.envConfigService.resolveVariables("{{baseUrl}}",i);s&&s!=="{{baseUrl}}"&&r.push({url:s,description:i})}}else{let i=new Set;for(let s of n){let o=this.envConfigService.resolveVariables("{{baseUrl}}",s);o&&o!=="{{baseUrl}}"&&!i.has(o)&&(i.add(o),r.push({url:o,description:s}))}}return r.length===0&&r.push({url:"http://localhost",description:"Default server"}),r}async processItems(e,r,n,i,s,o,l,c){for(let d of e)if(d.type==="folder"){let p=d,m=o||p.name;i.add(m),p.items&&await this.processItems(p.items,r,n,i,s,m,l,c)}else{let p=d;await this.processRequest(p,r,n,i,s,o,l,c)}}async processRequest(e,r,n,i,s,o,l,c){let{path:d,hostVar:p}=this.normalizeUrl(e.url);p&&s.add(p);let m=(e.method||"GET").toLowerCase();r.paths[d]||(r.paths[d]={});let y={};y.operationId=e.operationId||this.generateOperationId(e,m,d,r),y.summary=e.summary||this.cleanSummary(e.name),e.description&&(y.description=e.description),(e.deprecated||this.hasDeprecatedPrefix(e.name))&&(y.deprecated=!0,this.hasDeprecatedPrefix(e.name)&&(y.summary=e.name.replace(/^\[DEPRECATED\]\s*/i,"")));let b=e.tags;if(b&&b.length>0){y.tags=b;for(let k of b)i.add(k)}else o&&(y.tags=[o]);let q=this.buildParameters(e);q.length>0&&(y.parameters=q);let x=await this.buildRequestBody(e,c);x&&(y.requestBody=x);let v=e.responses;v&&Object.keys(v).length>0?y.responses=this.mapResponseDefinitions(v):y.responses=await this.buildResponses(e,l.id,c);let _=e.security;if(_&&_.length>0)y.security=_;else{let k=this.buildOperationSecurity(e,l,n);k!==void 0&&(y.security=k)}let E=r.paths[d][m];E?this.mergeOperation(E,y,e.name):r.paths[d][m]=y}mergeOperation(e,r,n){if(r.summary&&r.summary!==e.summary&&(e.description=(e.description||e.summary||"")+`
|
|
235
|
+
`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=ly(e),n=yc(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=ly(e),n=yc(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};gT.Parser=VR});var wT=V(Zd=>{"use strict";var yT=kR(),u4=Bd(),Qd=zd(),c4=O_(),f4=ot(),d4=BR(),vT=WR();function bT(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new d4.LineCounter||null,prettyErrors:e}}function p4(t,e={}){let{lineCounter:r,prettyErrors:n}=bT(e),i=new vT.Parser(r?.addNewLine),s=new yT.Composer(e),o=Array.from(s.compose(i.parse(t)));if(n&&r)for(let l of o)l.errors.forEach(Qd.prettifyError(t,r)),l.warnings.forEach(Qd.prettifyError(t,r));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function ST(t,e={}){let{lineCounter:r,prettyErrors:n}=bT(e),i=new vT.Parser(r?.addNewLine),s=new yT.Composer(e),o=null;for(let l of s.compose(i.parse(t),!0,t.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new Qd.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(o.errors.forEach(Qd.prettifyError(t,r)),o.warnings.forEach(Qd.prettifyError(t,r))),o}function h4(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=ST(t,r);if(!i)return null;if(i.warnings.forEach(s=>c4.warn(i.options.logLevel,s)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},r))}function m4(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return f4.isDocument(t)&&!n?t.toString(r):new u4.Document(t,n,r).toString(r)}Zd.parse=h4;Zd.parseAllDocuments=p4;Zd.parseDocument=ST;Zd.stringify=m4});var Xd=V(Rt=>{"use strict";var g4=kR(),y4=Bd(),v4=fR(),zR=zd(),b4=qd(),Ho=ot(),S4=Fo(),w4=nr(),_4=jo(),R4=Lo(),x4=oy(),C4=UR(),E4=BR(),q4=WR(),cy=wT(),_T=Rd();Rt.Composer=g4.Composer;Rt.Document=y4.Document;Rt.Schema=v4.Schema;Rt.YAMLError=zR.YAMLError;Rt.YAMLParseError=zR.YAMLParseError;Rt.YAMLWarning=zR.YAMLWarning;Rt.Alias=b4.Alias;Rt.isAlias=Ho.isAlias;Rt.isCollection=Ho.isCollection;Rt.isDocument=Ho.isDocument;Rt.isMap=Ho.isMap;Rt.isNode=Ho.isNode;Rt.isPair=Ho.isPair;Rt.isScalar=Ho.isScalar;Rt.isSeq=Ho.isSeq;Rt.Pair=S4.Pair;Rt.Scalar=w4.Scalar;Rt.YAMLMap=_4.YAMLMap;Rt.YAMLSeq=R4.YAMLSeq;Rt.CST=x4;Rt.Lexer=C4.Lexer;Rt.LineCounter=E4.LineCounter;Rt.Parser=q4.Parser;Rt.parse=cy.parse;Rt.parseAllDocuments=cy.parseAllDocuments;Rt.parseDocument=cy.parseDocument;Rt.stringify=cy.stringify;Rt.visit=_T.visit;Rt.visitAsync=_T.visitAsync});var I4,O4,P4,k4,A4,T4,$4,Ns,fy=le(()=>{"use strict";I4=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,O4=/^\d{4}-\d{2}-\d{2}$/,P4=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,k4=/^https?:\/\/[^\s]+$/,A4=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,T4=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,$4=/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/,Ns=class{inferFromValue(e){if(e==null)return{nullable:!0};if(Array.isArray(e))return this.inferArraySchema(e);switch(typeof e){case"string":return this.inferStringSchema(e);case"number":return Number.isInteger(e)?{type:"integer"}:{type:"number"};case"boolean":return{type:"boolean"};case"object":return this.inferObjectSchema(e);default:return{}}}mergeSchemas(e,r){if(!e||Object.keys(e).length===0)return{...r};if(!r||Object.keys(r).length===0)return{...e};let n=e.nullable||r.nullable;if(!e.type&&e.nullable)return{...r,nullable:!0};if(!r.type&&r.nullable)return{...e,nullable:!0};if(e.type!==r.type)return e.type==="integer"&&r.type==="number"||e.type==="number"&&r.type==="integer"?{type:"number",...n&&{nullable:!0}}:{...n&&{nullable:!0}};let i={type:e.type};return n&&(i.nullable=!0),e.type==="object"&&r.type==="object"?this.mergeObjectSchemas(e,r,n):e.type==="array"&&r.type==="array"?this.mergeArraySchemas(e,r,n):(e.format&&e.format===r.format&&(i.format=e.format),i)}inferStringFormat(e){if(I4.test(e))return"date-time";if(O4.test(e))return"date";if(P4.test(e))return"email";if(A4.test(e))return"uuid";if(k4.test(e))return"uri";if(T4.test(e))return"ipv4";if($4.test(e))return"ipv6"}inferStringSchema(e){let r={type:"string"},n=this.inferStringFormat(e);return n&&(r.format=n),r}inferArraySchema(e){let r={type:"array"};if(e.length===0)return r;let n=this.inferFromValue(e[0]);for(let i=1;i<e.length;i++)n=this.mergeSchemas(n,this.inferFromValue(e[i]));return r.items=n,r}inferObjectSchema(e){let r={type:"object",properties:{}},n=Object.keys(e);for(let i of n)r.properties[i]=this.inferFromValue(e[i]);return r}mergeObjectSchemas(e,r,n){let i={type:"object",properties:{},...n&&{nullable:!0}},s=e.properties||{},o=r.properties||{},l=new Set([...Object.keys(s),...Object.keys(o)]);for(let m of l)s[m]&&o[m]?i.properties[m]=this.mergeSchemas(s[m],o[m]):s[m]?i.properties[m]={...s[m]}:i.properties[m]={...o[m]};let c=new Set(e.required||Object.keys(s)),d=new Set(r.required||Object.keys(o)),p=[...l].filter(m=>c.has(m)&&d.has(m));return p.length>0&&(i.required=p),i}mergeArraySchemas(e,r,n){let i={type:"array",...n&&{nullable:!0}};return e.items&&r.items?i.items=this.mergeSchemas(e.items,r.items):e.items?i.items={...e.items}:r.items&&(i.items={...r.items}),i}}});var RT,N4,ol,JR=le(()=>{"use strict";RT=ve(Xd());fy();N4=new Set(["content-type","authorization","accept","cookie","host","content-length"]),ol=class{constructor(e,r,n){this.collectionService=e;this.envConfigService=r;this.inferenceService=n;this.inferrer=new Ns}collectionService;envConfigService;inferenceService;inferrer;async export(e,r){let n=this.collectionService.getCollection(e);if(!n)throw new Error(`Collection ${e} not found`);let i={openapi:"3.0.3",info:this.buildInfo(n,r),servers:this.buildServers(r),paths:{},components:{schemas:{},securitySchemes:{}},tags:[]},s=new Map;if(n.auth&&n.auth.type!=="none"&&n.auth.type!=="inherit"){let c=this.mapAuthToSecurityScheme(n.auth);if(c){let{schemeName:d,scheme:p,requirement:m}=c;s.set(d,p),i.security=[m]}}let o=new Set,l=new Set;if(await this.processItems(n.items,i,s,o,l,void 0,n,r),this.augmentServersFromHostVars(l,i.servers,r),s.size>0)for(let[c,d]of s)i.components.securitySchemes[c]=d;else delete i.components.securitySchemes;return i.tags=[...o].map(c=>({name:c})),i.tags.length===0&&delete i.tags,this.deduplicateComponents(i),Object.keys(i.components.schemas).length===0&&delete i.components.schemas,Object.keys(i.components).length===0&&delete i.components,r.format==="yaml"?RT.stringify(i,{indent:2}):JSON.stringify(i,null,2)}buildInfo(e,r){return{title:r.info?.title||e.name,description:r.info?.description||e.description||"",version:r.info?.version||e.version||"1.0.0"}}buildServers(e){let r=[],n=e.environments||[];if(n.length===0){let i=this.envConfigService.getSelectedEnvironment();if(i){let s=this.envConfigService.resolveVariables("{{baseUrl}}",i);s&&s!=="{{baseUrl}}"&&r.push({url:s,description:i})}}else{let i=new Set;for(let s of n){let o=this.envConfigService.resolveVariables("{{baseUrl}}",s);o&&o!=="{{baseUrl}}"&&!i.has(o)&&(i.add(o),r.push({url:o,description:s}))}}return r.length===0&&r.push({url:"http://localhost",description:"Default server"}),r}async processItems(e,r,n,i,s,o,l,c){for(let d of e)if(d.type==="folder"){let p=d,m=o||p.name;i.add(m),p.items&&await this.processItems(p.items,r,n,i,s,m,l,c)}else{let p=d;await this.processRequest(p,r,n,i,s,o,l,c)}}async processRequest(e,r,n,i,s,o,l,c){let{path:d,hostVar:p}=this.normalizeUrl(e.url);p&&s.add(p);let m=(e.method||"GET").toLowerCase();r.paths[d]||(r.paths[d]={});let y={};y.operationId=e.operationId||this.generateOperationId(e,m,d,r),y.summary=e.summary||this.cleanSummary(e.name),e.description&&(y.description=e.description),(e.deprecated||this.hasDeprecatedPrefix(e.name))&&(y.deprecated=!0,this.hasDeprecatedPrefix(e.name)&&(y.summary=e.name.replace(/^\[DEPRECATED\]\s*/i,"")));let b=e.tags;if(b&&b.length>0){y.tags=b;for(let k of b)i.add(k)}else o&&(y.tags=[o]);let q=this.buildParameters(e);q.length>0&&(y.parameters=q);let x=await this.buildRequestBody(e,c);x&&(y.requestBody=x);let v=e.responses;v&&Object.keys(v).length>0?y.responses=this.mapResponseDefinitions(v):y.responses=await this.buildResponses(e,l.id,c);let R=e.security;if(R&&R.length>0)y.security=R;else{let k=this.buildOperationSecurity(e,l,n);k!==void 0&&(y.security=k)}let E=r.paths[d][m];E?this.mergeOperation(E,y,e.name):r.paths[d][m]=y}mergeOperation(e,r,n){if(r.summary&&r.summary!==e.summary&&(e.description=(e.description||e.summary||"")+`
|
|
236
236
|
|
|
237
237
|
Variant: **${n}**`+(r.description?` \u2014 ${r.description}`:"")),r.tags){let i=new Set(e.tags||[]);for(let s of r.tags)i.add(s);e.tags=[...i]}if(r.parameters){e.parameters||(e.parameters=[]);for(let i of r.parameters){let s=e.parameters.find(o=>o.name===i.name&&o.in===i.in);s?this.mergeParameterSchema(s,i,n):e.parameters.push(i)}}if(r.responses){e.responses||(e.responses={});for(let[i,s]of Object.entries(r.responses))e.responses[i]||(e.responses[i]=s)}if(r.requestBody?.content&&e.requestBody?.content)for(let[i,s]of Object.entries(r.requestBody.content))e.requestBody.content[i]||(e.requestBody.content[i]=s);else r.requestBody&&!e.requestBody&&(e.requestBody=r.requestBody)}mergeParameterSchema(e,r,n){e.schema||(e.schema={});let i=e.schema,s=r.schema||{},o=this.getConstraintKind(i),l=this.getConstraintKind(s);if(o==="none"&&l==="none")this.widenType(i,s);else if(o==="none")Object.assign(i,this.extractConstraints(s)),this.widenType(i,s);else if(l==="none")this.widenType(i,s);else if(o===l)this.mergeSameKindConstraints(i,s,o),this.widenType(i,s);else{if(i.oneOf){let c=this.buildVariantSchema(s);i.oneOf.some(d=>JSON.stringify(d)===JSON.stringify(c))||i.oneOf.push(c)}else if(s.oneOf){let c=this.buildVariantSchema(i);i.oneOf=[c,...s.oneOf]}else{let c=this.buildVariantSchema(i),d=this.buildVariantSchema(s);i.oneOf=[c,d]}this.stripConstraints(i)}if(r.description&&r.description!==e.description&&(e.description=(e.description||"")+(e.description?"; ":"")+r.description),r.example!==void 0&&r.example!==e.example){e.examples||(e.examples={},e.example!==void 0&&(e.examples.variant1={value:e.example}));let c=`variant_${n.replace(/[^a-zA-Z0-9_]/g,"_")}`;e.examples[c]={value:r.example},delete e.example}}getConstraintKind(e){return e.oneOf?"oneOf":e.enum&&e.enum.length>0?"enum":e.pattern?"pattern":e.minimum!==void 0||e.maximum!==void 0||e.exclusiveMinimum!==void 0||e.exclusiveMaximum!==void 0||e.multipleOf!==void 0?"range":e.minLength!==void 0||e.maxLength!==void 0?"length":e.minItems!==void 0||e.maxItems!==void 0||e.uniqueItems?"array":e.format?"format":"none"}mergeSameKindConstraints(e,r,n){switch(n){case"enum":{let i=new Set(e.enum||[]);for(let s of r.enum||[])i.add(s);e.enum=[...i];break}case"pattern":{r.pattern&&r.pattern!==e.pattern&&(e.pattern=`(?:${e.pattern})|(?:${r.pattern})`);break}case"range":{r.minimum!==void 0&&(e.minimum=e.minimum!==void 0?Math.min(e.minimum,r.minimum):r.minimum),r.maximum!==void 0&&(e.maximum=e.maximum!==void 0?Math.max(e.maximum,r.maximum):r.maximum),r.exclusiveMinimum&&(e.exclusiveMinimum=!0),r.exclusiveMaximum&&(e.exclusiveMaximum=!0),r.multipleOf!==void 0&&(e.multipleOf=e.multipleOf!==void 0?Math.min(e.multipleOf,r.multipleOf):r.multipleOf);break}case"length":{r.minLength!==void 0&&(e.minLength=e.minLength!==void 0?Math.min(e.minLength,r.minLength):r.minLength),r.maxLength!==void 0&&(e.maxLength=e.maxLength!==void 0?Math.max(e.maxLength,r.maxLength):r.maxLength);break}case"array":{r.minItems!==void 0&&(e.minItems=e.minItems!==void 0?Math.min(e.minItems,r.minItems):r.minItems),r.maxItems!==void 0&&(e.maxItems=e.maxItems!==void 0?Math.max(e.maxItems,r.maxItems):r.maxItems),r.uniqueItems&&(e.uniqueItems=!0);break}case"format":{if(r.format&&r.format!==e.format){let i={type:e.type||"string",format:e.format},s={type:r.type||"string",format:r.format};delete e.format,e.oneOf=[i,s]}break}case"oneOf":{if(r.oneOf)for(let i of r.oneOf)e.oneOf.some(s=>JSON.stringify(s)===JSON.stringify(i))||e.oneOf.push(i);break}}}buildVariantSchema(e){let r={};return e.type&&(r.type=e.type),e.enum&&(r.enum=[...e.enum]),e.pattern&&(r.pattern=e.pattern),e.format&&(r.format=e.format),e.minimum!==void 0&&(r.minimum=e.minimum),e.maximum!==void 0&&(r.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(r.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(r.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(r.multipleOf=e.multipleOf),e.minLength!==void 0&&(r.minLength=e.minLength),e.maxLength!==void 0&&(r.maxLength=e.maxLength),e.minItems!==void 0&&(r.minItems=e.minItems),e.maxItems!==void 0&&(r.maxItems=e.maxItems),e.uniqueItems&&(r.uniqueItems=!0),e.nullable&&(r.nullable=!0),r}stripConstraints(e){delete e.enum,delete e.pattern,delete e.format,delete e.minimum,delete e.maximum,delete e.exclusiveMinimum,delete e.exclusiveMaximum,delete e.multipleOf,delete e.minLength,delete e.maxLength,delete e.minItems,delete e.maxItems,delete e.uniqueItems,delete e.nullable}extractConstraints(e){let r={};return e.enum&&(r.enum=[...e.enum]),e.pattern&&(r.pattern=e.pattern),e.format&&(r.format=e.format),e.minimum!==void 0&&(r.minimum=e.minimum),e.maximum!==void 0&&(r.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(r.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(r.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(r.multipleOf=e.multipleOf),e.minLength!==void 0&&(r.minLength=e.minLength),e.maxLength!==void 0&&(r.maxLength=e.maxLength),e.minItems!==void 0&&(r.minItems=e.minItems),e.maxItems!==void 0&&(r.maxItems=e.maxItems),e.uniqueItems&&(r.uniqueItems=!0),e.nullable&&(r.nullable=!0),r}widenType(e,r){!r.type||r.type===e.type||(e.type?(e.type==="integer"&&r.type==="number"||e.type==="number"&&r.type==="integer")&&(e.type="number"):e.type=r.type)}normalizeUrl(e){let r=e,n=null,i=r.match(/^\{\{(\w+)\}\}/);return i&&(n=i[1],r=r.slice(i[0].length)),r=r.replace(/:([a-zA-Z_]\w*)/g,"{$1}"),r=r.replace(/\{\{(\w+)\}\}/g,"{$1}"),r.startsWith("/")||(r="/"+r),r.length>1&&r.endsWith("/")&&(r=r.slice(0,-1)),r=r.replace(/\/\//g,"/"),{path:r,hostVar:n}}generateOperationId(e,r,n,i){let s=this.toCamelCase(e.name),o=this.collectOperationIds(i);if(o.has(s)&&(s=`${s}${r.charAt(0).toUpperCase()}${r.slice(1)}`),!s||o.has(s)){let l=n.split("/").filter(c=>c&&!c.startsWith("{"));s=r+l.map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join("")}return s}collectOperationIds(e){let r=new Set;if(e.paths)for(let n of Object.values(e.paths))for(let i of Object.values(n))i.operationId&&r.add(i.operationId);return r}toCamelCase(e){return e.replace(/[^a-zA-Z0-9]+(.)/g,(r,n)=>n.toUpperCase()).replace(/^[A-Z]/,r=>r.toLowerCase()).replace(/[^a-zA-Z0-9]/g,"")}buildParameters(e){let r=[];if(e.params)for(let[n,i]of Object.entries(e.params)){let s={name:n,in:"path",required:!0};if(typeof i=="string")s.schema={type:this.inferTypeFromValue(i)},s.example=this.coerceExample(i,s.schema.type);else{let o=i;o.oneOf?(s.schema={oneOf:o.oneOf},o.type&&(s.schema.type=o.type)):(s.schema={type:o.type||this.inferTypeFromValue(o.value)},o.format&&(s.schema.format=o.format),o.enum&&(s.schema.enum=o.enum),o.pattern&&(s.schema.pattern=o.pattern),o.minimum!==void 0&&(s.schema.minimum=o.minimum),o.maximum!==void 0&&(s.schema.maximum=o.maximum),o.exclusiveMinimum!==void 0&&(s.schema.exclusiveMinimum=o.exclusiveMinimum),o.exclusiveMaximum!==void 0&&(s.schema.exclusiveMaximum=o.exclusiveMaximum),o.multipleOf!==void 0&&(s.schema.multipleOf=o.multipleOf),o.minLength!==void 0&&(s.schema.minLength=o.minLength),o.maxLength!==void 0&&(s.schema.maxLength=o.maxLength),o.minItems!==void 0&&(s.schema.minItems=o.minItems),o.maxItems!==void 0&&(s.schema.maxItems=o.maxItems),o.uniqueItems&&(s.schema.uniqueItems=!0),o.nullable&&(s.schema.nullable=!0)),o.description&&(s.description=o.description),o.deprecated&&(s.deprecated=!0),s.example=this.coerceExample(o.value,s.schema.type||"string")}r.push(s)}if(e.query)for(let n of e.query){if(!n.key)continue;let i=this.buildKeyValueParam(n,"query");r.push(i)}if(e.headers){let n=e.headers.find(i=>i.key.toLowerCase()==="cookie");if(n){let i=this.parseCookieHeader(n.value);r.push(...i)}for(let i of e.headers){if(!i.key||N4.has(i.key.toLowerCase()))continue;let s=this.buildKeyValueParam(i,"header");r.push(s)}}return r}buildKeyValueParam(e,r){let n={name:e.key,in:r,schema:{}};return e.oneOf?(n.schema.oneOf=e.oneOf,e.type&&(n.schema.type=e.type)):(n.schema.type=e.type||"string",e.format&&(n.schema.format=e.format),e.enum&&(n.schema.enum=e.enum),e.pattern&&(n.schema.pattern=e.pattern),e.minimum!==void 0&&(n.schema.minimum=e.minimum),e.maximum!==void 0&&(n.schema.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(n.schema.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(n.schema.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(n.schema.multipleOf=e.multipleOf),e.minLength!==void 0&&(n.schema.minLength=e.minLength),e.maxLength!==void 0&&(n.schema.maxLength=e.maxLength),e.minItems!==void 0&&(n.schema.minItems=e.minItems),e.maxItems!==void 0&&(n.schema.maxItems=e.maxItems),e.uniqueItems&&(n.schema.uniqueItems=!0),e.nullable&&(n.schema.nullable=!0)),e.required&&(n.required=!0),e.description&&(n.description=e.description),e.deprecated&&(n.deprecated=!0),e.value&&(n.example=this.coerceExample(e.value,n.schema.type||"string")),n}parseCookieHeader(e){let r=[],n=e.split(";").map(i=>i.trim()).filter(Boolean);for(let i of n){let s=i.indexOf("=");if(s>0){let o=i.substring(0,s).trim(),l=i.substring(s+1).trim();r.push({name:o,in:"cookie",schema:{type:"string"},example:l})}}return r}inferTypeFromValue(e){return/^-?\d+$/.test(e)?"integer":/^-?\d+\.\d+$/.test(e)?"number":e==="true"||e==="false"?"boolean":"string"}coerceExample(e,r){let n=this.sanitizeEnvVar(e);switch(r){case"integer":return parseInt(n,10)||n;case"number":return parseFloat(n)||n;case"boolean":return n==="true";default:return n}}sanitizeEnvVar(e){return e.replace(/\{\{(\w+)\}\}/g,"<$1>")}sanitizeObjectExamples(e){if(typeof e=="string")return this.sanitizeEnvVar(e);if(Array.isArray(e))return e.map(r=>this.sanitizeObjectExamples(r));if(e!==null&&typeof e=="object"){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeObjectExamples(i);return r}return e}async buildRequestBody(e,r){if(!e.body||e.body.type==="none")return null;let n=e.body,i={required:!0,content:{}},s,o,l,c;if(e.bodySchema){if(e.bodySchema.content){for(let[m,y]of Object.entries(e.bodySchema.content)){let b={};y.schema&&(b.schema=y.schema),y.examples&&(b.examples=y.examples),y.encoding&&(b.encoding=y.encoding),i.content[m]=b}let p=e.bodySchema.contentType||Object.keys(e.bodySchema.content)[0];if(p&&n.content){let m=this.tryParseBodyContent(n);m!==void 0&&i.content[p]&&(i.content[p].example=m)}return i}s=e.bodySchema.contentType||this.getContentType(n),o=e.bodySchema.schema,e.bodySchema.components,l=this.tryParseBodyContent(n),e.bodySchema.encoding&&(c=e.bodySchema.encoding)}else switch(s=this.getContentType(n),n.type){case"raw":{if(n.format==="json"&&n.content){let p=this.tryParseBodyContent(n);p!==void 0?(o=this.inferrer.inferFromValue(p),l=p):o={type:"string"}}else o={type:"string"},l=typeof n.content=="string"?n.content:void 0;break}case"form-data":{o=this.buildFormDataSchemaFromBody(n);break}case"x-www-form-urlencoded":{o=this.buildFormDataSchemaFromBody(n);break}case"binary":{o={type:"string",format:"binary"};break}case"graphql":{o={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},l=this.tryParseBodyContent(n);break}default:return null}let d={};return o&&(d.schema=o),l!==void 0&&(d.example=l),c&&(d.encoding=c),i.content[s]=d,i}getContentType(e){if(!e)return"application/json";switch(e.type){case"raw":switch(e.format){case"json":return"application/json";case"xml":return"application/xml";case"html":return"text/html";case"text":return"text/plain";default:return"text/plain"}case"form-data":return"multipart/form-data";case"x-www-form-urlencoded":return"application/x-www-form-urlencoded";case"binary":return"application/octet-stream";case"graphql":return"application/json";default:return"application/json"}}tryParseBodyContent(e){if(!e||!e.content)return;let r;if(typeof e.content=="string")try{r=JSON.parse(e.content)}catch{r=e.content}else r=e.content;return this.sanitizeObjectExamples(r)}buildFormDataSchemaFromBody(e){let r={type:"object",properties:{}},n=e.formData||e.urlencoded||[];for(let i of n)i.enabled!==!1&&(i.type==="file"?r.properties[i.key]={type:"string",format:"binary"}:r.properties[i.key]={type:"string"});return r}async buildResponses(e,r,n){let i={};if(e.responseSchema)for(let[s,o]of Object.entries(e.responseSchema.responses)){let l={description:o.description||`Status ${s}`};if(o.content){l.content={};for(let[c,d]of Object.entries(o.content)){let p={};d.schema&&(p.schema=d.schema),d.examples&&(p.examples=d.examples),l.content[c]=p}}else if(o.schema){let c=o.contentType||"application/json",d={schema:o.schema};o.examples&&(d.examples=o.examples),l.content={[c]:d}}if(o.headers){l.headers={};for(let[c,d]of Object.entries(o.headers))l.headers[c]={...d.description&&{description:d.description},schema:d.schema}}i[s]=l}return Object.keys(i).length===0&&(i[200]={description:"Successful response"}),i}mapResponseDefinitions(e){let r={};for(let[n,i]of Object.entries(e)){let s={description:i.description||`Status ${n}`};if(i.schema||i.examples){let o=i.contentType||"application/json",l={};i.schema&&(l.schema=i.schema),i.examples&&Object.keys(i.examples).length>0&&(l.examples=i.examples),s.content={[o]:l}}if(i.headers&&Object.keys(i.headers).length>0){s.headers={};for(let[o,l]of Object.entries(i.headers)){let c=l;s.headers[o]={...c.description&&{description:c.description},...c.schema&&{schema:c.schema}}}}r[n]=s}return Object.keys(r).length===0&&(r[200]={description:"Successful response"}),r}buildOperationSecurity(e,r,n){if(!e.auth||e.auth.type==="inherit")return;if(e.auth.type==="none")return[];let i=this.mapAuthToSecurityScheme(e.auth);if(!i)return;let{schemeName:s,scheme:o,requirement:l}=i;return n.set(s,o),[l]}mapAuthToSecurityScheme(e){switch(e.type){case"bearer":return{schemeName:"BearerAuth",scheme:{type:"http",scheme:"bearer"},requirement:{BearerAuth:[]}};case"basic":return{schemeName:"BasicAuth",scheme:{type:"http",scheme:"basic"},requirement:{BasicAuth:[]}};case"apikey":{let r=e.apikey||{key:"X-Api-Key",value:"",in:"header"},n=`ApiKey_${r.key||"key"}`;return{schemeName:n,scheme:{type:"apiKey",in:r.in||"header",name:r.key||"X-Api-Key"},requirement:{[n]:[]}}}case"oauth2":{let r=e.oauth2;if(!r)return;let n={};switch(r.grantType){case"client_credentials":n.clientCredentials={tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"authorization_code":n.authorizationCode={authorizationUrl:r.authUrl||"",tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"password":n.password={tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"implicit":n.implicit={authorizationUrl:r.authUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;default:n.clientCredentials={tokenUrl:r.tokenUrl||"",scopes:{}}}return{schemeName:"OAuth2",scheme:{type:"oauth2",flows:n},requirement:{OAuth2:[]}}}default:return{schemeName:"BearerAuth",scheme:{type:"http",scheme:"bearer"},requirement:{BearerAuth:[]}}}}parseScopes(e){let r={};for(let n of e.split(/\s+/))n&&(r[n]="");return r}deduplicateComponents(e){let r=new Map,n=new Map;if(e.paths)for(let[i,s]of Object.entries(e.paths))for(let[o,l]of Object.entries(s)){let c=l;if(c.responses){for(let[d,p]of Object.entries(c.responses))if(p.content)for(let m of Object.values(p.content))m.schema&&this.trackSchema(m.schema,`${o}${i}Response${d}`,r,n)}if(c.requestBody?.content)for(let d of Object.values(c.requestBody.content))d.schema&&this.trackSchema(d.schema,`${o}${i}Request`,r,n)}for(let[i,s]of r)if((n.get(i)||0)>=2){let l=this.sanitizeComponentName(s.name);e.components.schemas[l]=s.schema,this.replaceInlineSchema(e,s.schema,`#/components/schemas/${l}`)}}trackSchema(e,r,n,i){if(!e||e.type!=="object"||!e.properties)return;let s=JSON.stringify(e);n.has(s)||n.set(s,{name:r,schema:e}),i.set(s,(i.get(s)||0)+1)}replaceInlineSchema(e,r,n){let i=JSON.stringify(r);if(e.paths)for(let s of Object.values(e.paths))for(let o of Object.values(s)){if(o.responses){for(let l of Object.values(o.responses))if(l.content)for(let c of Object.values(l.content))c.schema&&JSON.stringify(c.schema)===i&&(c.schema={$ref:n})}if(o.requestBody?.content)for(let l of Object.values(o.requestBody.content))l.schema&&JSON.stringify(l.schema)===i&&(l.schema={$ref:n})}}sanitizeComponentName(e){return e.replace(/[^a-zA-Z0-9._-]/g,"").replace(/^[^a-zA-Z]/,"Schema")}cleanSummary(e){return e.replace(/^\[DEPRECATED\]\s*/i,"")}hasDeprecatedPrefix(e){return/^\[DEPRECATED\]/i.test(e)}augmentServersFromHostVars(e,r,n){if(e.size===0)return;let i=new Set(r.map(o=>o.url)),s=n.environments?.length?n.environments:[this.envConfigService.getSelectedEnvironment()].filter(o=>!!o);for(let o of e){let l=`{{${o}}}`,c=!1;for(let d of s){let p=this.envConfigService.resolveVariables(l,d);p&&p!==l&&!i.has(p)&&(r.push({url:p,description:d}),i.add(p),c=!0)}if(!c){let d=`{${o}}`;i.has(d)||(r.push({url:d,variables:{[o]:{default:""}}}),i.add(d))}}}}});var al,GR=le(()=>{"use strict";al=class{generate(e,r){if(!e)return;let n=r||{};if(e.$ref){let i=this.resolveLocalRef(e.$ref,n.components);return i?this.generate(i,n):{}}if(e.nullable&&!e.type)return null;if(e.enum&&e.enum.length>0)return e.enum[0];if(e.default!==void 0)return e.default;if(e.example!==void 0)return e.example;if(e.allOf)return this.generateFromAllOf(e.allOf,e.discriminator,n);if(e.oneOf)return this.generateFromOneOfAnyOf(e.oneOf,e.discriminator,n);if(e.anyOf)return this.generateFromOneOfAnyOf(e.anyOf,e.discriminator,n);switch(e.type){case"string":return this.generateString(e);case"integer":return this.generateInteger(e);case"number":return this.generateNumber(e);case"boolean":return!1;case"array":return this.generateArray(e,n);case"object":return this.generateObject(e,n);default:return e.properties?this.generateObject(e,n):{}}}generateString(e){switch(e.format){case"email":return"user@example.com";case"date-time":return"2026-01-01T00:00:00Z";case"date":return"2026-01-01";case"time":return"00:00:00";case"uri":case"url":return"https://example.com";case"uuid":return"00000000-0000-0000-0000-000000000000";case"ipv4":return"127.0.0.1";case"ipv6":return"::1";case"hostname":return"example.com";case"binary":return"";case"byte":return"c3RyaW5n";case"password":return"********";default:return"string"}}generateInteger(e){return e.minimum!==void 0?e.minimum:e.exclusiveMinimum!==void 0?e.exclusiveMinimum+1:0}generateNumber(e){return e.minimum!==void 0?e.minimum:e.exclusiveMinimum!==void 0?e.exclusiveMinimum+.1:0}generateArray(e,r){return e.items?[this.generate(e.items,r)]:[]}generateObject(e,r){let n={},i=e.properties||{};for(let[s,o]of Object.entries(i))r.omitReadOnly&&o.readOnly||(n[s]=this.generate(o,r));return n}generateFromAllOf(e,r,n){let i={type:"object",properties:{},required:[]};for(let o of e){let l=o.$ref?this.resolveLocalRef(o.$ref,n.components)||{}:o;l.properties&&Object.assign(i.properties,l.properties),l.required&&(i.required=[...i.required||[],...l.required])}let s=this.generateObject(i,n);return r?.propertyName&&(s[r.propertyName]=this.guessDiscriminatorValue(e,n)),s}generateFromOneOfAnyOf(e,r,n){if(e.length===0)return{};let i=e[0].$ref&&this.resolveLocalRef(e[0].$ref,n.components)||e[0],s=this.generate(i,n);return r?.propertyName&&typeof s=="object"&&s!==null&&(s[r.propertyName]=this.guessDiscriminatorValue(e,n)),s}guessDiscriminatorValue(e,r){if(e.length===0)return"unknown";let n=e[0];if(n.$ref){let i=n.$ref.split("/");return i[i.length-1]}return"variant1"}resolveLocalRef(e,r){if(!e||!r)return;let n=e.match(/^#\/components\/(?:schemas\/)?(.+)$/);if(n)return r[n[1]];let i=e.match(/^#\/components\/(.+)$/);if(i)return r[i[1]]}}});var dy=V(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.getDeepKeys=vc.toJSON=void 0;var M4=["function","symbol","undefined"],F4=["constructor","prototype","__proto__"],D4=Object.getPrototypeOf({});function j4(){let t={},e=this;for(let r of xT(e))if(typeof r=="string"){let n=e[r],i=typeof n;M4.includes(i)||(t[r]=n)}return t}vc.toJSON=j4;function xT(t,e=[]){let r=[];for(;t&&t!==D4;)r=r.concat(Object.getOwnPropertyNames(t),Object.getOwnPropertySymbols(t)),t=Object.getPrototypeOf(t);let n=new Set(r);for(let i of e.concat(F4))n.delete(i);return n}vc.getDeepKeys=xT});var YR=V(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.addInspectMethod=bc.format=void 0;var CT=require("util"),L4=dy(),ET=CT.inspect.custom||Symbol.for("nodejs.util.inspect.custom");bc.format=CT.format;function U4(t){t[ET]=H4}bc.addInspectMethod=U4;function H4(){let t={},e=this;for(let r of L4.getDeepKeys(e)){let n=e[r];t[r]=n}return delete t[ET],t}});var OT=V(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.lazyJoinStacks=Xi.joinStacks=Xi.isWritableStack=Xi.isLazyStack=void 0;var B4=/\r?\n/,V4=/\bono[ @]/;function W4(t){return!!(t&&t.configurable&&typeof t.get=="function")}Xi.isLazyStack=W4;function z4(t){return!!(!t||t.writable||typeof t.set=="function")}Xi.isWritableStack=z4;function qT(t,e){let r=IT(t.stack),n=e?e.stack:void 0;return r&&n?r+`
|
|
238
238
|
|
|
@@ -251,13 +251,13 @@ Parsed value is empty`);return o}catch(o){throw!o&&e.continueOnError?new ul.Unma
|
|
|
251
251
|
`}return l.replace(/\n$/,"")}l$.exports=c6});var kr=V((vre,f$)=>{"use strict";var c$=Cc(),f6=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],d6=["scalar","sequence","mapping"];function p6(t){let e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}function h6(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(f6.indexOf(r)===-1)throw new c$('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=p6(e.styleAliases||null),d6.indexOf(this.kind)===-1)throw new c$('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}f$.exports=h6});var Rx=V((bre,p$)=>{"use strict";var ip=Cc(),wx=kr();function d$(t,e){let r=[];return t[e].forEach(function(n){let i=r.length;r.forEach(function(s,o){s.tag===n.tag&&s.kind===n.kind&&s.multi===n.multi&&(i=o)}),r[i]=n}),r}function m6(){let t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function e(r){r.multi?(t.multi[r.kind].push(r),t.multi.fallback.push(r)):t[r.kind][r.tag]=t.fallback[r.tag]=r}for(let r=0,n=arguments.length;r<n;r+=1)arguments[r].forEach(e);return t}function _x(t){return this.extend(t)}_x.prototype.extend=function(e){let r=[],n=[];if(e instanceof wx)n.push(e);else if(Array.isArray(e))n=n.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(r=r.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit));else throw new ip("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(s){if(!(s instanceof wx))throw new ip("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new ip("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new ip("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(s){if(!(s instanceof wx))throw new ip("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let i=Object.create(_x.prototype);return i.implicit=(this.implicit||[]).concat(r),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=d$(i,"implicit"),i.compiledExplicit=d$(i,"explicit"),i.compiledTypeMap=m6(i.compiledImplicit,i.compiledExplicit),i};p$.exports=_x});var xx=V((Sre,h$)=>{"use strict";var g6=kr();h$.exports=new g6("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}})});var Cx=V((wre,m$)=>{"use strict";var y6=kr();m$.exports=new y6("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}})});var Ex=V((_re,g$)=>{"use strict";var v6=kr();g$.exports=new v6("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}})});var qx=V((Rre,y$)=>{"use strict";var b6=Rx();y$.exports=new b6({explicit:[xx(),Cx(),Ex()]})});var Ix=V((xre,v$)=>{"use strict";var S6=kr();function w6(t){if(t===null)return!0;let e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}function _6(){return null}function R6(t){return t===null}v$.exports=new S6("tag:yaml.org,2002:null",{kind:"scalar",resolve:w6,construct:_6,predicate:R6,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"})});var Ox=V((Cre,b$)=>{"use strict";var x6=kr();function C6(t){if(t===null)return!1;let e=t.length;return e===4&&(t==="true"||t==="True"||t==="TRUE")||e===5&&(t==="false"||t==="False"||t==="FALSE")}function E6(t){return t==="true"||t==="True"||t==="TRUE"}function q6(t){return Object.prototype.toString.call(t)==="[object Boolean]"}b$.exports=new x6("tag:yaml.org,2002:bool",{kind:"scalar",resolve:C6,construct:E6,predicate:q6,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"})});var Px=V((Ere,S$)=>{"use strict";var I6=xc(),O6=kr();function P6(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function k6(t){return t>=48&&t<=55}function A6(t){return t>=48&&t<=57}function T6(t){if(t===null)return!1;let e=t.length,r=0,n=!1;if(!e)return!1;let i=t[r];if((i==="-"||i==="+")&&(i=t[++r]),i==="0"){if(r+1===e)return!0;if(i=t[++r],i==="b"){for(r++;r<e;r++){if(i=t[r],i!=="0"&&i!=="1")return!1;n=!0}return n&&Number.isFinite(sp(t))}if(i==="x"){for(r++;r<e;r++){if(!P6(t.charCodeAt(r)))return!1;n=!0}return n&&Number.isFinite(sp(t))}if(i==="o"){for(r++;r<e;r++){if(!k6(t.charCodeAt(r)))return!1;n=!0}return n&&Number.isFinite(sp(t))}}for(;r<e;r++){if(!A6(t.charCodeAt(r)))return!1;n=!0}return n?Number.isFinite(sp(t)):!1}function sp(t){let e=t,r=1,n=e[0];if((n==="-"||n==="+")&&(n==="-"&&(r=-1),e=e.slice(1),n=e[0]),e==="0")return 0;if(n==="0"){if(e[1]==="b")return r*parseInt(e.slice(2),2);if(e[1]==="x")return r*parseInt(e.slice(2),16);if(e[1]==="o")return r*parseInt(e.slice(2),8)}return r*parseInt(e,10)}function $6(t){return sp(t)}function N6(t){return Object.prototype.toString.call(t)==="[object Number]"&&t%1===0&&!I6.isNegativeZero(t)}S$.exports=new O6("tag:yaml.org,2002:int",{kind:"scalar",resolve:T6,construct:$6,predicate:N6,represent:{binary:function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})});var kx=V((qre,_$)=>{"use strict";var w$=xc(),M6=kr(),F6=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),D6=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function j6(t){return t===null||!F6.test(t)?!1:Number.isFinite(parseFloat(t,10))?!0:D6.test(t)}function L6(t){let e=t.toLowerCase(),r=e[0]==="-"?-1:1;return"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:r*parseFloat(e,10)}var U6=/^[-+]?[0-9]+e/;function H6(t,e){if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(w$.isNegativeZero(t))return"-0.0";let r=t.toString(10);return U6.test(r)?r.replace("e",".e"):r}function B6(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||w$.isNegativeZero(t))}_$.exports=new M6("tag:yaml.org,2002:float",{kind:"scalar",resolve:j6,construct:L6,predicate:B6,represent:H6,defaultStyle:"lowercase"})});var Ax=V((Ire,R$)=>{"use strict";R$.exports=qx().extend({implicit:[Ix(),Ox(),Px(),kx()]})});var Tx=V((Ore,x$)=>{"use strict";x$.exports=Ax()});var $x=V((Pre,q$)=>{"use strict";var V6=kr(),C$=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),E$=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]))?))?$");function W6(t){return t===null?!1:C$.exec(t)!==null||E$.exec(t)!==null}function z6(t){let e=0,r=null,n=C$.exec(t);if(n===null&&(n=E$.exec(t)),n===null)throw new Error("Date resolve error");let i=+n[1],s=+n[2]-1,o=+n[3];if(!n[4])return new Date(Date.UTC(i,s,o));let l=+n[4],c=+n[5],d=+n[6];if(n[7]){for(e=n[7].slice(0,3);e.length<3;)e+="0";e=+e}if(n[9]){let m=+n[10],y=+(n[11]||0);r=(m*60+y)*6e4,n[9]==="-"&&(r=-r)}let p=new Date(Date.UTC(i,s,o,l,c,d,e));return r&&p.setTime(p.getTime()-r),p}function J6(t){return t.toISOString()}q$.exports=new V6("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:W6,construct:z6,instanceOf:Date,represent:J6})});var Nx=V((kre,I$)=>{"use strict";var G6=kr();function Y6(t){return t==="<<"||t===null}I$.exports=new G6("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Y6})});var Fx=V((Are,O$)=>{"use strict";var K6=kr(),Mx=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
252
252
|
\r`;function Q6(t){if(t===null)return!1;let e=0,r=t.length,n=Mx;for(let i=0;i<r;i++){let s=n.indexOf(t.charAt(i));if(!(s>64)){if(s<0)return!1;e+=6}}return e%8===0}function Z6(t){let e=t.replace(/[\r\n=]/g,""),r=e.length,n=Mx,i=0,s=[];for(let l=0;l<r;l++)l%4===0&&l&&(s.push(i>>16&255),s.push(i>>8&255),s.push(i&255)),i=i<<6|n.indexOf(e.charAt(l));let o=r%4*6;return o===0?(s.push(i>>16&255),s.push(i>>8&255),s.push(i&255)):o===18?(s.push(i>>10&255),s.push(i>>2&255)):o===12&&s.push(i>>4&255),new Uint8Array(s)}function X6(t){let e="",r=0,n=t.length,i=Mx;for(let o=0;o<n;o++)o%3===0&&o&&(e+=i[r>>18&63],e+=i[r>>12&63],e+=i[r>>6&63],e+=i[r&63]),r=(r<<8)+t[o];let s=n%3;return s===0?(e+=i[r>>18&63],e+=i[r>>12&63],e+=i[r>>6&63],e+=i[r&63]):s===2?(e+=i[r>>10&63],e+=i[r>>4&63],e+=i[r<<2&63],e+=i[64]):s===1&&(e+=i[r>>2&63],e+=i[r<<4&63],e+=i[64],e+=i[64]),e}function e9(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}O$.exports=new K6("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Q6,construct:Z6,predicate:e9,represent:X6})});var Dx=V((Tre,P$)=>{"use strict";var t9=kr(),r9=Object.prototype.hasOwnProperty,n9=Object.prototype.toString;function i9(t){if(t===null)return!0;let e=[],r=t;for(let n=0,i=r.length;n<i;n+=1){let s=r[n],o=!1;if(n9.call(s)!=="[object Object]")return!1;let l;for(l in s)if(r9.call(s,l))if(!o)o=!0;else return!1;if(!o)return!1;if(e.indexOf(l)===-1)e.push(l);else return!1}return!0}function s9(t){return t!==null?t:[]}P$.exports=new t9("tag:yaml.org,2002:omap",{kind:"sequence",resolve:i9,construct:s9})});var jx=V(($re,k$)=>{"use strict";var o9=kr(),a9=Object.prototype.toString;function l9(t){if(t===null)return!0;let e=t,r=new Array(e.length);for(let n=0,i=e.length;n<i;n+=1){let s=e[n];if(a9.call(s)!=="[object Object]")return!1;let o=Object.keys(s);if(o.length!==1)return!1;r[n]=[o[0],s[o[0]]]}return!0}function u9(t){if(t===null)return[];let e=t,r=new Array(e.length);for(let n=0,i=e.length;n<i;n+=1){let s=e[n],o=Object.keys(s);r[n]=[o[0],s[o[0]]]}return r}k$.exports=new o9("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:l9,construct:u9})});var Lx=V((Nre,A$)=>{"use strict";var c9=kr(),f9=Object.prototype.hasOwnProperty;function d9(t){if(t===null)return!0;let e=t;for(let r in e)if(f9.call(e,r)&&e[r]!==null)return!1;return!0}function p9(t){return t!==null?t:{}}A$.exports=new c9("tag:yaml.org,2002:set",{kind:"mapping",resolve:d9,construct:p9})});var Iy=V((Mre,T$)=>{"use strict";T$.exports=Tx().extend({implicit:[$x(),Nx()],explicit:[Fx(),Dx(),jx(),Lx()]})});var X$=V((Fre,Vx)=>{"use strict";var fl=xc(),U$=Cc(),h9=u$(),m9=Iy(),_i=Object.prototype.hasOwnProperty,Oy=1,H$=2,B$=3,Py=4,Ux=1,g9=2,$$=3,y9=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,v9=/[\x85\u2028\u2029]/,b9=/[,\[\]{}]/,V$=/^(?:!|!!|![0-9A-Za-z-]+!)$/,W$=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function N$(t){return Object.prototype.toString.call(t)}function ts(t){return t===10||t===13}function Ds(t){return t===9||t===32}function pn(t){return t===9||t===32||t===10||t===13}function Ec(t){return t===44||t===91||t===93||t===123||t===125}function S9(t){if(t>=48&&t<=57)return t-48;let e=t|32;return e>=97&&e<=102?e-97+10:-1}function w9(t){return t===120?2:t===117?4:t===85?8:0}function _9(t){return t>=48&&t<=57?t-48:-1}function M$(t){switch(t){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
|
|
253
253
|
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function R9(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}function z$(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}var J$=new Array(256),G$=new Array(256);for(let t=0;t<256;t++)J$[t]=M$(t)?1:0,G$[t]=M$(t);function x9(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||m9,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:100,this.maxMergeSeqLength=typeof e.maxMergeSeqLength=="number"?e.maxMergeSeqLength:20,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function Y$(t,e){let r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=h9(r),new U$(e,r)}function Se(t,e){throw Y$(t,e)}function ky(t,e){t.onWarning&&t.onWarning.call(null,Y$(t,e))}function dl(t,e,r){let n=t.anchorMapTransactions;if(n.length!==0){let i=n[n.length-1];_i.call(i,e)||(i[e]={existed:_i.call(t.anchorMap,e),value:t.anchorMap[e]})}t.anchorMap[e]=r}function C9(t){t.anchorMapTransactions.push(Object.create(null))}function E9(t){let e=t.anchorMapTransactions.pop(),r=t.anchorMapTransactions;if(r.length===0)return;let n=r[r.length-1],i=Object.keys(e);for(let s=0,o=i.length;s<o;s+=1){let l=i[s];_i.call(n,l)||(n[l]=e[l])}}function q9(t){let e=t.anchorMapTransactions.pop(),r=Object.keys(e);for(let n=r.length-1;n>=0;n-=1){let i=e[r[n]];i.existed?t.anchorMap[r[n]]=i.value:delete t.anchorMap[r[n]]}}function K$(t){return{position:t.position,line:t.line,lineStart:t.lineStart,lineIndent:t.lineIndent,firstTabInLine:t.firstTabInLine,tag:t.tag,anchor:t.anchor,kind:t.kind,result:t.result}}function F$(t,e){t.position=e.position,t.line=e.line,t.lineStart=e.lineStart,t.lineIndent=e.lineIndent,t.firstTabInLine=e.firstTabInLine,t.tag=e.tag,t.anchor=e.anchor,t.kind=e.kind,t.result=e.result}var D$={YAML:function(e,r,n){e.version!==null&&Se(e,"duplication of %YAML directive"),n.length!==1&&Se(e,"YAML directive accepts exactly one argument");let i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]);i===null&&Se(e,"ill-formed argument of the YAML directive");let s=parseInt(i[1],10),o=parseInt(i[2],10);s!==1&&Se(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&ky(e,"unsupported YAML version of the document")},TAG:function(e,r,n){let i;n.length!==2&&Se(e,"TAG directive accepts exactly two arguments");let s=n[0];i=n[1],V$.test(s)||Se(e,"ill-formed tag handle (first argument) of the TAG directive"),_i.call(e.tagMap,s)&&Se(e,'there is a previously declared suffix for "'+s+'" tag handle'),W$.test(i)||Se(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch{Se(e,"tag prefix is malformed: "+i)}e.tagMap[s]=i}};function zo(t,e,r,n){if(e<r){let i=t.input.slice(e,r);if(n)for(let s=0,o=i.length;s<o;s+=1){let l=i.charCodeAt(s);l===9||l>=32&&l<=1114111||Se(t,"expected valid JSON character")}else y9.test(i)&&Se(t,"the stream contains non-printable characters");t.result+=i}}function j$(t,e,r,n){fl.isObject(r)||Se(t,"cannot merge mappings; the provided source object is unacceptable");let i=Object.keys(r);for(let s=0,o=i.length;s<o;s+=1){let l=i[s];_i.call(e,l)||(z$(e,l,r[l]),n[l]=!0)}}function qc(t,e,r,n,i,s,o,l,c){if(Array.isArray(i)){i=Array.prototype.slice.call(i);for(let d=0,p=i.length;d<p;d+=1)Array.isArray(i[d])&&Se(t,"nested arrays are not supported inside keys"),typeof i=="object"&&N$(i[d])==="[object Object]"&&(i[d]="[object Object]")}if(typeof i=="object"&&N$(i)==="[object Object]"&&(i="[object Object]"),i=String(i),e===null&&(e={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(s)){s.length>t.maxMergeSeqLength&&Se(t,"merge sequence length exceeded maxMergeSeqLength ("+t.maxMergeSeqLength+")");let d=new Set;for(let p=0,m=s.length;p<m;p+=1){let y=s[p];d.has(y)||(d.add(y),j$(t,e,y,r))}}else j$(t,e,s,r);else!t.json&&!_i.call(r,i)&&_i.call(e,i)&&(t.line=o||t.line,t.lineStart=l||t.lineStart,t.position=c||t.position,Se(t,"duplicated mapping key")),z$(e,i,s),delete r[i];return e}function Hx(t){let e=t.input.charCodeAt(t.position);e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):Se(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function ir(t,e,r){let n=0,i=t.input.charCodeAt(t.position);for(;i!==0;){for(;Ds(i);)i===9&&t.firstTabInLine===-1&&(t.firstTabInLine=t.position),i=t.input.charCodeAt(++t.position);if(e&&i===35)do i=t.input.charCodeAt(++t.position);while(i!==10&&i!==13&&i!==0);if(ts(i))for(Hx(t),i=t.input.charCodeAt(t.position),n++,t.lineIndent=0;i===32;)t.lineIndent++,i=t.input.charCodeAt(++t.position);else break}return r!==-1&&n!==0&&t.lineIndent<r&&ky(t,"deficient indentation"),n}function Ay(t){let e=t.position,r=t.input.charCodeAt(e);return!!((r===45||r===46)&&r===t.input.charCodeAt(e+1)&&r===t.input.charCodeAt(e+2)&&(e+=3,r=t.input.charCodeAt(e),r===0||pn(r)))}function Bx(t,e){e===1?t.result+=" ":e>1&&(t.result+=fl.repeat(`
|
|
254
|
-
`,e-1))}function I9(t,e,r){let n,i,s,o,l,c,d=t.kind,p=t.result,m=t.input.charCodeAt(t.position);if(pn(m)||Ec(m)||m===35||m===38||m===42||m===33||m===124||m===62||m===39||m===34||m===37||m===64||m===96)return!1;if(m===63||m===45){let y=t.input.charCodeAt(t.position+1);if(pn(y)||r&&Ec(y))return!1}for(t.kind="scalar",t.result="",n=i=t.position,s=!1;m!==0;){if(m===58){let y=t.input.charCodeAt(t.position+1);if(pn(y)||r&&Ec(y))break}else if(m===35){let y=t.input.charCodeAt(t.position-1);if(pn(y))break}else{if(t.position===t.lineStart&&Ay(t)||r&&Ec(m))break;if(ts(m))if(o=t.line,l=t.lineStart,c=t.lineIndent,ir(t,!1,-1),t.lineIndent>=e){s=!0,m=t.input.charCodeAt(t.position);continue}else{t.position=i,t.line=o,t.lineStart=l,t.lineIndent=c;break}}s&&(zo(t,n,i,!1),Bx(t,t.line-o),n=i=t.position,s=!1),Ds(m)||(i=t.position+1),m=t.input.charCodeAt(++t.position)}return zo(t,n,i,!1),t.result?!0:(t.kind=d,t.result=p,!1)}function O9(t,e){let r,n,i=t.input.charCodeAt(t.position);if(i!==39)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(i=t.input.charCodeAt(t.position))!==0;)if(i===39)if(zo(t,r,t.position,!0),i=t.input.charCodeAt(++t.position),i===39)r=t.position,t.position++,n=t.position;else return!0;else ts(i)?(zo(t,r,n,!0),Bx(t,ir(t,!1,e)),r=n=t.position):t.position===t.lineStart&&Ay(t)?Se(t,"unexpected end of the document within a single quoted scalar"):(t.position++,Ds(i)||(n=t.position));Se(t,"unexpected end of the stream within a single quoted scalar")}function P9(t,e){let r,n,i,s=t.input.charCodeAt(t.position);if(s!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(s=t.input.charCodeAt(t.position))!==0;){if(s===34)return zo(t,r,t.position,!0),t.position++,!0;if(s===92){if(zo(t,r,t.position,!0),s=t.input.charCodeAt(++t.position),ts(s))ir(t,!1,e);else if(s<256&&J$[s])t.result+=G$[s],t.position++;else if((i=w9(s))>0){let o=i,l=0;for(;o>0;o--)s=t.input.charCodeAt(++t.position),(i=S9(s))>=0?l=(l<<4)+i:Se(t,"expected hexadecimal character");t.result+=R9(l),t.position++}else Se(t,"unknown escape sequence");r=n=t.position}else ts(s)?(zo(t,r,n,!0),Bx(t,ir(t,!1,e)),r=n=t.position):t.position===t.lineStart&&Ay(t)?Se(t,"unexpected end of the document within a double quoted scalar"):(t.position++,Ds(s)||(n=t.position))}Se(t,"unexpected end of the stream within a double quoted scalar")}function k9(t,e){let r=!0,n,i,s,o=t.tag,l,c=t.anchor,d,p,m,y,b=Object.create(null),q,x,v,
|
|
254
|
+
`,e-1))}function I9(t,e,r){let n,i,s,o,l,c,d=t.kind,p=t.result,m=t.input.charCodeAt(t.position);if(pn(m)||Ec(m)||m===35||m===38||m===42||m===33||m===124||m===62||m===39||m===34||m===37||m===64||m===96)return!1;if(m===63||m===45){let y=t.input.charCodeAt(t.position+1);if(pn(y)||r&&Ec(y))return!1}for(t.kind="scalar",t.result="",n=i=t.position,s=!1;m!==0;){if(m===58){let y=t.input.charCodeAt(t.position+1);if(pn(y)||r&&Ec(y))break}else if(m===35){let y=t.input.charCodeAt(t.position-1);if(pn(y))break}else{if(t.position===t.lineStart&&Ay(t)||r&&Ec(m))break;if(ts(m))if(o=t.line,l=t.lineStart,c=t.lineIndent,ir(t,!1,-1),t.lineIndent>=e){s=!0,m=t.input.charCodeAt(t.position);continue}else{t.position=i,t.line=o,t.lineStart=l,t.lineIndent=c;break}}s&&(zo(t,n,i,!1),Bx(t,t.line-o),n=i=t.position,s=!1),Ds(m)||(i=t.position+1),m=t.input.charCodeAt(++t.position)}return zo(t,n,i,!1),t.result?!0:(t.kind=d,t.result=p,!1)}function O9(t,e){let r,n,i=t.input.charCodeAt(t.position);if(i!==39)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(i=t.input.charCodeAt(t.position))!==0;)if(i===39)if(zo(t,r,t.position,!0),i=t.input.charCodeAt(++t.position),i===39)r=t.position,t.position++,n=t.position;else return!0;else ts(i)?(zo(t,r,n,!0),Bx(t,ir(t,!1,e)),r=n=t.position):t.position===t.lineStart&&Ay(t)?Se(t,"unexpected end of the document within a single quoted scalar"):(t.position++,Ds(i)||(n=t.position));Se(t,"unexpected end of the stream within a single quoted scalar")}function P9(t,e){let r,n,i,s=t.input.charCodeAt(t.position);if(s!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(s=t.input.charCodeAt(t.position))!==0;){if(s===34)return zo(t,r,t.position,!0),t.position++,!0;if(s===92){if(zo(t,r,t.position,!0),s=t.input.charCodeAt(++t.position),ts(s))ir(t,!1,e);else if(s<256&&J$[s])t.result+=G$[s],t.position++;else if((i=w9(s))>0){let o=i,l=0;for(;o>0;o--)s=t.input.charCodeAt(++t.position),(i=S9(s))>=0?l=(l<<4)+i:Se(t,"expected hexadecimal character");t.result+=R9(l),t.position++}else Se(t,"unknown escape sequence");r=n=t.position}else ts(s)?(zo(t,r,n,!0),Bx(t,ir(t,!1,e)),r=n=t.position):t.position===t.lineStart&&Ay(t)?Se(t,"unexpected end of the document within a double quoted scalar"):(t.position++,Ds(s)||(n=t.position))}Se(t,"unexpected end of the stream within a double quoted scalar")}function k9(t,e){let r=!0,n,i,s,o=t.tag,l,c=t.anchor,d,p,m,y,b=Object.create(null),q,x,v,R=t.input.charCodeAt(t.position);if(R===91)d=93,y=!1,l=[];else if(R===123)d=125,y=!0,l={};else return!1;for(t.anchor!==null&&dl(t,t.anchor,l),R=t.input.charCodeAt(++t.position);R!==0;){if(ir(t,!0,e),R=t.input.charCodeAt(t.position),R===d)return t.position++,t.tag=o,t.anchor=c,t.kind=y?"mapping":"sequence",t.result=l,!0;if(r?R===44&&Se(t,"expected the node content, but found ','"):Se(t,"missed comma between flow collection entries"),x=q=v=null,p=m=!1,R===63){let E=t.input.charCodeAt(t.position+1);pn(E)&&(p=m=!0,t.position++,ir(t,!0,e))}n=t.line,i=t.lineStart,s=t.position,Ic(t,e,Oy,!1,!0),x=t.tag,q=t.result,ir(t,!0,e),R=t.input.charCodeAt(t.position),(m||t.line===n)&&R===58&&(p=!0,R=t.input.charCodeAt(++t.position),ir(t,!0,e),Ic(t,e,Oy,!1,!0),v=t.result),y?qc(t,l,b,x,q,v,n,i,s):p?l.push(qc(t,null,b,x,q,v,n,i,s)):l.push(q),ir(t,!0,e),R=t.input.charCodeAt(t.position),R===44?(r=!0,R=t.input.charCodeAt(++t.position)):r=!1}Se(t,"unexpected end of the stream within a flow collection")}function A9(t,e){let r,n=Ux,i=!1,s=!1,o=e,l=0,c=!1,d,p=t.input.charCodeAt(t.position);if(p===124)r=!1;else if(p===62)r=!0;else return!1;for(t.kind="scalar",t.result="";p!==0;)if(p=t.input.charCodeAt(++t.position),p===43||p===45)Ux===n?n=p===43?$$:g9:Se(t,"repeat of a chomping mode identifier");else if((d=_9(p))>=0)d===0?Se(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?Se(t,"repeat of an indentation width identifier"):(o=e+d-1,s=!0);else break;if(Ds(p)){do p=t.input.charCodeAt(++t.position);while(Ds(p));if(p===35)do p=t.input.charCodeAt(++t.position);while(!ts(p)&&p!==0)}for(;p!==0;){for(Hx(t),t.lineIndent=0,p=t.input.charCodeAt(t.position);(!s||t.lineIndent<o)&&p===32;)t.lineIndent++,p=t.input.charCodeAt(++t.position);if(!s&&t.lineIndent>o&&(o=t.lineIndent),ts(p)){l++;continue}if(!s&&o===0&&Se(t,"missing indentation for block scalar"),t.lineIndent<o){n===$$?t.result+=fl.repeat(`
|
|
255
255
|
`,i?1+l:l):n===Ux&&i&&(t.result+=`
|
|
256
256
|
`);break}r?Ds(p)?(c=!0,t.result+=fl.repeat(`
|
|
257
257
|
`,i?1+l:l)):c?(c=!1,t.result+=fl.repeat(`
|
|
258
258
|
`,l+1)):l===0?i&&(t.result+=" "):t.result+=fl.repeat(`
|
|
259
259
|
`,l):t.result+=fl.repeat(`
|
|
260
|
-
`,i?1+l:l),i=!0,s=!0,l=0;let m=t.position;for(;!ts(p)&&p!==0;)p=t.input.charCodeAt(++t.position);zo(t,m,t.position,!1)}return!0}function L$(t,e){let r=t.tag,n=t.anchor,i=[],s=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&dl(t,t.anchor,i);let o=t.input.charCodeAt(t.position);for(;o!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,Se(t,"tab characters must not be used in indentation")),o===45);){let l=t.input.charCodeAt(t.position+1);if(!pn(l))break;if(s=!0,t.position++,ir(t,!0,-1)&&t.lineIndent<=e){i.push(null),o=t.input.charCodeAt(t.position);continue}let c=t.line;if(Ic(t,e,B$,!1,!0),i.push(t.result),ir(t,!0,-1),o=t.input.charCodeAt(t.position),(t.line===c||t.lineIndent>e)&&o!==0)Se(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break}return s?(t.tag=r,t.anchor=n,t.kind="sequence",t.result=i,!0):!1}function Q$(t,e,r){let n,i,s,o,l=t.tag,c=t.anchor,d={},p=Object.create(null),m=null,y=null,b=null,q=!1,x=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&dl(t,t.anchor,d);let v=t.input.charCodeAt(t.position);for(;v!==0;){!q&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,Se(t,"tab characters must not be used in indentation"));let
|
|
260
|
+
`,i?1+l:l),i=!0,s=!0,l=0;let m=t.position;for(;!ts(p)&&p!==0;)p=t.input.charCodeAt(++t.position);zo(t,m,t.position,!1)}return!0}function L$(t,e){let r=t.tag,n=t.anchor,i=[],s=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&dl(t,t.anchor,i);let o=t.input.charCodeAt(t.position);for(;o!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,Se(t,"tab characters must not be used in indentation")),o===45);){let l=t.input.charCodeAt(t.position+1);if(!pn(l))break;if(s=!0,t.position++,ir(t,!0,-1)&&t.lineIndent<=e){i.push(null),o=t.input.charCodeAt(t.position);continue}let c=t.line;if(Ic(t,e,B$,!1,!0),i.push(t.result),ir(t,!0,-1),o=t.input.charCodeAt(t.position),(t.line===c||t.lineIndent>e)&&o!==0)Se(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break}return s?(t.tag=r,t.anchor=n,t.kind="sequence",t.result=i,!0):!1}function Q$(t,e,r){let n,i,s,o,l=t.tag,c=t.anchor,d={},p=Object.create(null),m=null,y=null,b=null,q=!1,x=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&dl(t,t.anchor,d);let v=t.input.charCodeAt(t.position);for(;v!==0;){!q&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,Se(t,"tab characters must not be used in indentation"));let R=t.input.charCodeAt(t.position+1),E=t.line;if((v===63||v===58)&&pn(R))v===63?(q&&(qc(t,d,p,m,y,null,i,s,o),m=y=b=null),x=!0,q=!0,n=!0):q?(q=!1,n=!0):Se(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,v=R;else{if(i=t.line,s=t.lineStart,o=t.position,!Ic(t,r,H$,!1,!0))break;if(t.line===E){for(v=t.input.charCodeAt(t.position);Ds(v);)v=t.input.charCodeAt(++t.position);if(v===58)v=t.input.charCodeAt(++t.position),pn(v)||Se(t,"a whitespace character is expected after the key-value separator within a block mapping"),q&&(qc(t,d,p,m,y,null,i,s,o),m=y=b=null),x=!0,q=!1,n=!1,m=t.tag,y=t.result;else if(x)Se(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=l,t.anchor=c,!0}else if(x)Se(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=l,t.anchor=c,!0}if((t.line===E||t.lineIndent>e)&&(q&&(i=t.line,s=t.lineStart,o=t.position),Ic(t,e,Py,!0,n)&&(q?y=t.result:b=t.result),q||(qc(t,d,p,m,y,b,i,s,o),m=y=b=null),ir(t,!0,-1),v=t.input.charCodeAt(t.position)),(t.line===E||t.lineIndent>e)&&v!==0)Se(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return q&&qc(t,d,p,m,y,null,i,s,o),x&&(t.tag=l,t.anchor=c,t.kind="mapping",t.result=d),x}function T9(t){let e=!1,r=!1,n,i,s=t.input.charCodeAt(t.position);if(s!==33)return!1;t.tag!==null&&Se(t,"duplication of a tag property"),s=t.input.charCodeAt(++t.position),s===60?(e=!0,s=t.input.charCodeAt(++t.position)):s===33?(r=!0,n="!!",s=t.input.charCodeAt(++t.position)):n="!";let o=t.position;if(e){do s=t.input.charCodeAt(++t.position);while(s!==0&&s!==62);t.position<t.length?(i=t.input.slice(o,t.position),s=t.input.charCodeAt(++t.position)):Se(t,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!pn(s);)s===33&&(r?Se(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(o-1,t.position+1),V$.test(n)||Se(t,"named tag handle cannot contain such characters"),r=!0,o=t.position+1)),s=t.input.charCodeAt(++t.position);i=t.input.slice(o,t.position),b9.test(i)&&Se(t,"tag suffix cannot contain flow indicator characters")}i&&!W$.test(i)&&Se(t,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{Se(t,"tag name is malformed: "+i)}return e?t.tag=i:_i.call(t.tagMap,n)?t.tag=t.tagMap[n]+i:n==="!"?t.tag="!"+i:n==="!!"?t.tag="tag:yaml.org,2002:"+i:Se(t,'undeclared tag handle "'+n+'"'),!0}function $9(t){let e=t.input.charCodeAt(t.position);if(e!==38)return!1;t.anchor!==null&&Se(t,"duplication of an anchor property"),e=t.input.charCodeAt(++t.position);let r=t.position;for(;e!==0&&!pn(e)&&!Ec(e);)e=t.input.charCodeAt(++t.position);return t.position===r&&Se(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(r,t.position),!0}function N9(t){let e=t.input.charCodeAt(t.position);if(e!==42)return!1;e=t.input.charCodeAt(++t.position);let r=t.position;for(;e!==0&&!pn(e)&&!Ec(e);)e=t.input.charCodeAt(++t.position);t.position===r&&Se(t,"name of an alias node must contain at least one character");let n=t.input.slice(r,t.position);return _i.call(t.anchorMap,n)||Se(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],ir(t,!0,-1),!0}function M9(t,e,r,n){let i=K$(t);return C9(t),F$(t,e),t.tag=null,t.anchor=null,t.kind=null,t.result=null,Q$(t,r,n)&&t.kind==="mapping"?(E9(t),!0):(q9(t),F$(t,i),!1)}function Ic(t,e,r,n,i){let s,o,l=1,c=!1,d=!1,p=null,m,y,b;t.depth>=t.maxDepth&&Se(t,"nesting exceeded maxDepth ("+t.maxDepth+")"),t.depth+=1,t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null;let q=s=o=Py===r||B$===r;if(n&&ir(t,!0,-1)&&(c=!0,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)),l===1)for(;;){let x=t.input.charCodeAt(t.position),v=K$(t);if(c&&(x===33&&t.tag!==null||x===38&&t.anchor!==null)||!T9(t)&&!$9(t))break;p===null&&(p=v),ir(t,!0,-1)?(c=!0,o=q,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)):o=!1}if(o&&(o=c||i),l===1||Py===r)if(Oy===r||H$===r?y=e:y=e+1,b=t.position-t.lineStart,l===1)if(o&&(L$(t,b)||Q$(t,b,y))||k9(t,y))d=!0;else{let x=t.input.charCodeAt(t.position);p!==null&&q&&!o&&x!==124&&x!==62&&M9(t,p,p.position-p.lineStart,y)||s&&A9(t,y)||O9(t,y)||P9(t,y)?d=!0:N9(t)?(d=!0,(t.tag!==null||t.anchor!==null)&&Se(t,"alias node should not have any properties")):I9(t,y,Oy===r)&&(d=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&dl(t,t.anchor,t.result)}else l===0&&(d=o&&L$(t,b));if(t.tag===null)t.anchor!==null&&dl(t,t.anchor,t.result);else if(t.tag==="?"){t.result!==null&&t.kind!=="scalar"&&Se(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"');for(let x=0,v=t.implicitTypes.length;x<v;x+=1)if(m=t.implicitTypes[x],m.resolve(t.result)){t.result=m.construct(t.result),t.tag=m.tag,t.anchor!==null&&dl(t,t.anchor,t.result);break}}else if(t.tag!=="!"){if(_i.call(t.typeMap[t.kind||"fallback"],t.tag))m=t.typeMap[t.kind||"fallback"][t.tag];else{m=null;let x=t.typeMap.multi[t.kind||"fallback"];for(let v=0,R=x.length;v<R;v+=1)if(t.tag.slice(0,x[v].tag.length)===x[v].tag){m=x[v];break}}m||Se(t,"unknown tag !<"+t.tag+">"),t.result!==null&&m.kind!==t.kind&&Se(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+m.kind+'", not "'+t.kind+'"'),m.resolve(t.result,t.tag)?(t.result=m.construct(t.result,t.tag),t.anchor!==null&&dl(t,t.anchor,t.result)):Se(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.depth-=1,t.tag!==null||t.anchor!==null||d}function F9(t){let e=t.position,r=!1,n;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(n=t.input.charCodeAt(t.position))!==0&&(ir(t,!0,-1),n=t.input.charCodeAt(t.position),!(t.lineIndent>0||n!==37));){r=!0,n=t.input.charCodeAt(++t.position);let i=t.position;for(;n!==0&&!pn(n);)n=t.input.charCodeAt(++t.position);let s=t.input.slice(i,t.position),o=[];for(s.length<1&&Se(t,"directive name must not be less than one character in length");n!==0;){for(;Ds(n);)n=t.input.charCodeAt(++t.position);if(n===35){do n=t.input.charCodeAt(++t.position);while(n!==0&&!ts(n));break}if(ts(n))break;for(i=t.position;n!==0&&!pn(n);)n=t.input.charCodeAt(++t.position);o.push(t.input.slice(i,t.position))}n!==0&&Hx(t),_i.call(D$,s)?D$[s](t,s,o):ky(t,'unknown document directive "'+s+'"')}if(ir(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,ir(t,!0,-1)):r&&Se(t,"directives end mark is expected"),Ic(t,t.lineIndent-1,Py,!1,!0),ir(t,!0,-1),t.checkLineBreaks&&v9.test(t.input.slice(e,t.position))&&ky(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Ay(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,ir(t,!0,-1));return}t.position<t.length-1&&Se(t,"end of the stream or a document separator is expected")}function Z$(t,e){t=String(t),e=e||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
|
|
261
261
|
`),t.charCodeAt(0)===65279&&(t=t.slice(1)));let r=new x9(t,e),n=t.indexOf("\0");for(n!==-1&&(r.position=n,Se(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;)F9(r);return r.documents}function D9(t,e,r){e!==null&&typeof e=="object"&&typeof r>"u"&&(r=e,e=null);let n=Z$(t,r);if(typeof e!="function")return n;for(let i=0,s=n.length;i<s;i+=1)e(n[i])}function j9(t,e){let r=Z$(t,e);if(r.length!==0){if(r.length===1)return r[0];throw new U$("expected a single document in the stream, but found more")}}Vx.exports.loadAll=D9;Vx.exports.load=j9});var S1=V((Dre,b1)=>{"use strict";var Ny=xc(),cp=Cc(),L9=Iy(),l1=Object.prototype.toString,u1=Object.prototype.hasOwnProperty,Yx=65279,U9=9,ap=10,H9=13,B9=32,V9=33,W9=34,Wx=35,z9=37,J9=38,G9=39,Y9=42,c1=44,K9=45,Ty=58,Q9=61,Z9=62,X9=63,e8=64,f1=91,d1=93,t8=96,p1=123,r8=124,h1=125,Ar={};Ar[0]="\\0";Ar[7]="\\a";Ar[8]="\\b";Ar[9]="\\t";Ar[10]="\\n";Ar[11]="\\v";Ar[12]="\\f";Ar[13]="\\r";Ar[27]="\\e";Ar[34]='\\"';Ar[92]="\\\\";Ar[133]="\\N";Ar[160]="\\_";Ar[8232]="\\L";Ar[8233]="\\P";var n8=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],i8=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function s8(t,e){if(e===null)return{};let r={},n=Object.keys(e);for(let i=0,s=n.length;i<s;i+=1){let o=n[i],l=String(e[o]);o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2));let c=t.compiledTypeMap.fallback[o];c&&u1.call(c.styleAliases,l)&&(l=c.styleAliases[l]),r[o]=l}return r}function o8(t){let e,r,n=t.toString(16).toUpperCase();if(t<=255)e="x",r=2;else if(t<=65535)e="u",r=4;else if(t<=4294967295)e="U",r=8;else throw new cp("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+e+Ny.repeat("0",r-n.length)+n}var a8=1,lp=2;function l8(t){this.schema=t.schema||L9,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=Ny.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=s8(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType=t.quotingType==='"'?lp:a8,this.forceQuotes=t.forceQuotes||!1,this.replacer=typeof t.replacer=="function"?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function e1(t,e){let r=Ny.repeat(" ",e),n=0,i="",s=t.length;for(;n<s;){let o,l=t.indexOf(`
|
|
262
262
|
`,n);l===-1?(o=t.slice(n),n=s):(o=t.slice(n,l+1),n=l+1),o.length&&o!==`
|
|
263
263
|
`&&(i+=r),i+=o}return i}function zx(t,e){return`
|
|
@@ -276,7 +276,7 @@ Parsed value is empty`);return o}catch(o){throw!o&&e.continueOnError?new ul.Unma
|
|
|
276
276
|
`:""}b1.exports.dump=S8});var Qx=V((jre,Wr)=>{"use strict";var w1=X$(),w8=S1();function Kx(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}Wr.exports.Type=kr();Wr.exports.Schema=Rx();Wr.exports.FAILSAFE_SCHEMA=qx();Wr.exports.JSON_SCHEMA=Ax();Wr.exports.CORE_SCHEMA=Tx();Wr.exports.DEFAULT_SCHEMA=Iy();Wr.exports.load=w1.load;Wr.exports.loadAll=w1.loadAll;Wr.exports.dump=w8.dump;Wr.exports.YAMLException=Cc();Wr.exports.types={binary:Fx(),float:kx(),map:Ex(),null:Ix(),pairs:jx(),set:Lx(),timestamp:$x(),bool:Ox(),int:Px(),merge:Nx(),omap:Dx(),seq:Cx(),str:xx()};Wr.exports.safeLoad=Kx("safeLoad","load");Wr.exports.safeLoadAll=Kx("safeLoadAll","loadAll");Wr.exports.safeDump=Kx("safeDump","dump")});var _1=V(fp=>{"use strict";var _8=fp&&fp.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fp,"__esModule",{value:!0});var R8=Yn(),x8=_8(Qx()),C8=Qx();fp.default={order:200,allowEmpty:!0,canParse:[".yaml",".yml",".json"],async parse(t){let e=t.data;if(Buffer.isBuffer(e)&&(e=e.toString()),typeof e=="string")try{return x8.default.load(e,{schema:C8.JSON_SCHEMA})}catch(r){throw new R8.ParserError(r?.message||"Parser Error",t.url)}else return e}}});var R1=V(Zx=>{"use strict";Object.defineProperty(Zx,"__esModule",{value:!0});var E8=Yn(),q8=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i;Zx.default={order:300,allowEmpty:!0,encoding:"utf8",canParse(t){return(typeof t.data=="string"||Buffer.isBuffer(t.data))&&q8.test(t.url)},parse(t){if(typeof t.data=="string")return t.data;if(Buffer.isBuffer(t.data))return t.data.toString(this.encoding);throw new E8.ParserError("data is not text",t.url)}}});var x1=V(Xx=>{"use strict";Object.defineProperty(Xx,"__esModule",{value:!0});var I8=/\.(jpeg|jpg|gif|png|bmp|ico)$/i;Xx.default={order:400,allowEmpty:!0,canParse(t){return Buffer.isBuffer(t.data)&&I8.test(t.url)},parse(t){return Buffer.isBuffer(t.data)?t.data:Buffer.from(t.data)}}});var I1=V(Ri=>{"use strict";var O8=Ri&&Ri.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),P8=Ri&&Ri.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),k8=Ri&&Ri.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&O8(r,e,n[i]);return P8(r,e),r}})(),A8=Ri&&Ri.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ri,"__esModule",{value:!0});var T8=A8(require("fs")),C1=Bo(),E1=k8(Gn()),q1=Yn();Ri.default={order:100,canRead(t){return E1.isFileSystemPath(t.url)},async read(t){let e;try{e=E1.toFileSystemPath(t.url)}catch(r){throw new q1.ResolverError(C1.ono.uri(r,`Malformed URI: ${t.url}`),t.url)}try{return await T8.default.promises.readFile(e)}catch(r){throw new q1.ResolverError((0,C1.ono)(r,`Error opening file "${e}"`),e)}}}});var k1=V(Ls=>{"use strict";var $8=Ls&&Ls.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),N8=Ls&&Ls.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),M8=Ls&&Ls.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&$8(r,e,n[i]);return N8(r,e),r}})();Object.defineProperty(Ls,"__esModule",{value:!0});var My=Bo(),dp=M8(Gn()),O1=Yn();Ls.default={order:200,headers:null,timeout:6e4,redirects:5,withCredentials:!1,canRead(t){return dp.isHttp(t.url)},read(t){let e=dp.parse(t.url);return typeof window<"u"&&!e.protocol&&(e.protocol=dp.parse(location.href).protocol),P1(e,this)}};async function P1(t,e,r){t=dp.parse(t);let n=r||[];n.push(t.href);try{let i=await F8(t,e);if(i.status>=400)throw(0,My.ono)({status:i.status},`HTTP ERROR ${i.status}`);if(i.status>=300){if(!Number.isNaN(e.redirects)&&n.length>e.redirects)throw new O1.ResolverError((0,My.ono)({status:i.status},`Error downloading ${n[0]}.
|
|
277
277
|
Too many redirects:
|
|
278
278
|
${n.join(`
|
|
279
|
-
`)}`));if(!("location"in i.headers)||!i.headers.location)throw(0,My.ono)({status:i.status},`HTTP ${i.status} redirect with no location header`);{let s=dp.resolve(t.href,i.headers.location);return P1(s,e,n)}}else{if(i.body){let s=await i.arrayBuffer();return Buffer.from(s)}return Buffer.alloc(0)}}catch(i){throw new O1.ResolverError((0,My.ono)(i,`Error downloading ${t.href}`),t.href)}}async function F8(t,e){let r,n;e.timeout&&(r=new AbortController,n=setTimeout(()=>r.abort(),e.timeout));let i=await fetch(t,{method:"GET",headers:e.headers||{},credentials:e.withCredentials?"include":"same-origin",signal:r?r.signal:null});return n&&clearTimeout(n),i}});var eC=V(Us=>{"use strict";var Pc=Us&&Us.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Us,"__esModule",{value:!0});Us.getNewOptions=Us.getJsonSchemaRefParserDefaultOptions=void 0;var D8=Pc(i$()),j8=Pc(_1()),L8=Pc(R1()),U8=Pc(x1()),H8=Pc(I1()),B8=Pc(k1()),V8=()=>({parse:{json:{...D8.default},yaml:{...j8.default},text:{...L8.default},binary:{...U8.default}},resolve:{file:{...H8.default},http:{...B8.default},external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative"},mutateInputSchema:!0});Us.getJsonSchemaRefParserDefaultOptions=V8;var W8=t=>{let e=(0,Us.getJsonSchemaRefParserDefaultOptions)();return t&&T1(e,t),e};Us.getNewOptions=W8;function T1(t,e){if(A1(e)){let r=Object.keys(e).filter(n=>!["__proto__","constructor","prototype"].includes(n));for(let n=0;n<r.length;n++){let i=r[n],s=e[i],o=t[i];A1(s)?t[i]=T1(o||{},s):s!==void 0&&(t[i]=s)}}return t}function A1(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}});var N1=V(Fy=>{"use strict";Object.defineProperty(Fy,"__esModule",{value:!0});Fy.normalizeArgs=$1;var z8=eC();function $1(t){let e,r,n,i,s=Array.prototype.slice.call(t);typeof s[s.length-1]=="function"&&(i=s.pop()),typeof s[0]=="string"?(e=s[0],typeof s[2]=="object"?(r=s[1],n=s[2]):(r=void 0,n=s[1])):(e="",r=s[0],n=s[1]);try{n=(0,z8.getNewOptions)(n)}catch(o){console.error(`JSON Schema Ref Parser: Error normalizing options: ${o}`)}return!n.mutateInputSchema&&typeof r=="object"&&(r=JSON.parse(JSON.stringify(r))),{path:e,schema:r,options:n,callback:i}}Fy.default=$1});var M1=V(xi=>{"use strict";var J8=xi&&xi.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),G8=xi&&xi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Y8=xi&&xi.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&J8(r,e,n[i]);return G8(r,e),r}})(),tC=xi&&xi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xi,"__esModule",{value:!0});var K8=tC(_c()),Q8=tC(tp()),Z8=tC(yx()),kc=Y8(Gn()),X8=Yn();function e5(t,e){if(!e.resolve?.external)return Promise.resolve();try{let r=rC(t.schema,t.$refs._root$Ref.path+"#",t.$refs,e);return Promise.all(r)}catch(r){return Promise.reject(r)}}function rC(t,e,r,n,i,s){i||(i=new Set);let o=[];if(t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!i.has(t)){i.add(t),K8.default.isExternal$Ref(t)&&o.push(t5(t,e,r,n));let l=Object.keys(t);for(let c of l){let d=Q8.default.join(e,c),p=t[c];o=o.concat(rC(p,d,r,n,i,s))}}return o}async function t5(t,e,r,n){let i=n.dereference?.externalReferenceResolution==="root",s=kc.resolve(i?kc.cwd():e,t.$ref),o=kc.stripHash(s),l=r._$refs[o];if(l)return Promise.resolve(l.value);try{let c=await(0,Z8.default)(s,r,n),d=rC(c,o+"#",r,n,new Set,!0);return Promise.all(d)}catch(c){if(!n?.continueOnError||!(0,X8.isHandledError)(c))throw c;return r._$refs[o]&&(c.source=decodeURI(kc.stripHash(e)),c.path=kc.safePointerToPath(kc.getHash(e))),[]}}xi.default=e5});var j1=V(Ci=>{"use strict";var r5=Ci&&Ci.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),n5=Ci&&Ci.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),i5=Ci&&Ci.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&r5(r,e,n[i]);return n5(r,e),r}})(),D1=Ci&&Ci.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ci,"__esModule",{value:!0});var Dy=D1(_c()),pp=D1(tp()),nC=i5(Gn());function s5(t,e){let r=[];iC(t,"schema",t.$refs._root$Ref.path+"#","#",0,r,t.$refs,e),o5(r)}function iC(t,e,r,n,i,s,o,l){let c=e===null?t:t[e];if(c&&typeof c=="object"&&!ArrayBuffer.isView(c))if(Dy.default.isAllowed$Ref(c))F1(t,e,r,n,i,s,o,l);else{let d=Object.keys(c).sort((p,m)=>p==="definitions"?-1:m==="definitions"?1:p.length-m.length);for(let p of d){let m=pp.default.join(r,p),y=pp.default.join(n,p),b=c[p];Dy.default.isAllowed$Ref(b)?F1(c,p,r,y,i,s,o,l):iC(c,p,m,y,i,s,o,l)}}}function F1(t,e,r,n,i,s,o,l){let c=e===null?t:t[e],d=nC.resolve(r,c.$ref),p=o._resolve(d,n,l);if(p===null)return;let y=pp.default.parse(n).length,b=nC.stripHash(p.path),q=nC.getHash(p.path),x=b!==o._root$Ref.path,v=Dy.default.isExtended$Ref(c);i+=p.indirections;let _=a5(s,t,e);if(_)if(y<_.depth||i<_.indirections)l5(s,_);else return;s.push({$ref:c,parent:t,key:e,pathFromRoot:n,depth:y,file:b,hash:q,value:p.value,circular:p.circular,extended:v,external:x,indirections:i}),(!_||x)&&iC(p.value,null,p.path,n,i+1,s,o,l)}function o5(t){t.sort((i,s)=>{if(i.file!==s.file)return i.file<s.file?-1:1;if(i.hash!==s.hash)return i.hash<s.hash?-1:1;if(i.circular!==s.circular)return i.circular?-1:1;if(i.extended!==s.extended)return i.extended?1:-1;if(i.indirections!==s.indirections)return i.indirections-s.indirections;if(i.depth!==s.depth)return i.depth-s.depth;{let o=i.pathFromRoot.lastIndexOf("/definitions"),l=s.pathFromRoot.lastIndexOf("/definitions");return o!==l?l-o:i.pathFromRoot.length-s.pathFromRoot.length}});let e,r,n;for(let i of t)i.external?i.file===e&&i.hash===r?i.$ref.$ref=n:i.file===e&&i.hash.indexOf(r+"/")===0?i.$ref.$ref=pp.default.join(n,pp.default.parse(i.hash.replace(r,"#"))):(e=i.file,r=i.hash,n=i.pathFromRoot,i.$ref=i.parent[i.key]=Dy.default.dereference(i.$ref,i.value),i.circular&&(i.$ref.$ref=i.pathFromRoot)):i.$ref.$ref=i.hash}function a5(t,e,r){for(let n of t)if(n&&n.parent===e&&n.key===r)return n}function l5(t,e){let r=t.indexOf(e);t.splice(r,1)}Ci.default=s5});var W1=V(Ei=>{"use strict";var u5=Ei&&Ei.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),c5=Ei&&Ei.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),f5=Ei&&Ei.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&u5(r,e,n[i]);return c5(r,e),r}})(),B1=Ei&&Ei.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ei,"__esModule",{value:!0});var jy=B1(_c()),L1=B1(tp()),d5=Bo(),U1=f5(Gn()),p5=Yn();Ei.default=h5;function h5(t,e){let r=Date.now(),n=sC(t.schema,t.$refs._root$Ref.path,"#",new Set,new Set,new Map,t.$refs,e,r);t.$refs.circular=n.circular,t.schema=n.value}function sC(t,e,r,n,i,s,o,l,c){let d,p={value:t,circular:!1};if(l&&l.timeoutMs&&Date.now()-c>l.timeoutMs)throw new p5.TimeoutError(l.timeoutMs);let m=l.dereference||{},y=m.excludedPathMatcher||(()=>!1);if((m?.circular==="ignore"||!i.has(t))&&t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!y(r)){if(n.add(t),i.add(t),jy.default.isAllowed$Ref(t,l))d=H1(t,e,r,n,i,s,o,l,c),p.circular=d.circular,p.value=d.value;else for(let b of Object.keys(t)){let q=L1.default.join(e,b),x=L1.default.join(r,b);if(y(x))continue;let v=t[b],_=!1;if(jy.default.isAllowed$Ref(v,l)){if(d=H1(v,q,x,n,i,s,o,l,c),_=d.circular,t[b]!==d.value){let E=new Map;m?.preservedProperties&&typeof t[b]=="object"&&!Array.isArray(t[b])&&m?.preservedProperties.forEach(k=>{k in t[b]&&E.set(k,t[b][k])}),t[b]=d.value,m?.preservedProperties&&E.size&&typeof t[b]=="object"&&!Array.isArray(t[b])&&E.forEach((k,P)=>{t[b][P]=k}),m?.onDereference?.(v.$ref,t[b],t,b)}}else n.has(v)?_=V1(q,o,l):(d=sC(v,q,x,n,i,s,o,l,c),_=d.circular,t[b]!==d.value&&(t[b]=d.value));p.circular=p.circular||_}n.delete(t)}return p}function H1(t,e,r,n,i,s,o,l,c){let p=jy.default.isExternal$Ref(t)&&l?.dereference?.externalReferenceResolution==="root",m=U1.resolve(p?U1.cwd():e,t.$ref),y=s.get(m);if(y&&!y.circular){let E=Object.keys(t);if(E.length>1){let k={};for(let P of E)P!=="$ref"&&!(P in y.value)&&(k[P]=t[P]);return{circular:y.circular,value:Object.assign({},y.value,k)}}return y}let b=o._resolve(m,e,l);if(b===null)return{circular:!1,value:null};let q=b.circular,x=q||n.has(b.value);x&&V1(e,o,l);let v=jy.default.dereference(t,b.value);if(!x){let E=sC(v,b.path,r,n,i,s,o,l,c);x=E.circular,v=E.value}x&&!q&&l.dereference?.circular==="ignore"&&(v=t),q&&(v.$ref=r);let _={circular:x,value:v};return Object.keys(t).length===1&&s.set(m,_),_}function V1(t,e,r){if(e.circular=!0,r?.dereference?.onCircular?.(t),!r.dereference.circular)throw d5.ono.reference(`Circular $ref pointer found at ${t}`);return!0}});var z1=V(oC=>{"use strict";Object.defineProperty(oC,"__esModule",{value:!0});function m5(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(e){setTimeout(e,0)}}oC.default=m5()});var G1=V(hp=>{"use strict";var g5=hp&&hp.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hp,"__esModule",{value:!0});hp.default=y5;var J1=g5(z1());function y5(t,e){if(t){e.then(function(r){(0,J1.default)(function(){t(null,r)})},function(r){(0,J1.default)(function(){t(r)})});return}else return e}});var Z1=V(Ae=>{"use strict";var v5=Ae&&Ae.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),b5=Ae&&Ae.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),S5=Ae&&Ae.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&v5(r,e,n[i]);return b5(r,e),r}})(),hl=Ae&&Ae.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.getJsonSchemaRefParserDefaultOptions=Ae.jsonSchemaParserNormalizeArgs=Ae.dereferenceInternal=Ae.JSONParserErrorGroup=Ae.isHandledError=Ae.UnmatchedParserError=Ae.ParserError=Ae.ResolverError=Ae.MissingPointerError=Ae.InvalidPointerError=Ae.JSONParserError=Ae.UnmatchedResolverError=Ae.dereference=Ae.bundle=Ae.resolve=Ae.parse=Ae.$RefParser=void 0;var Y1=hl(XT()),w5=hl(yx()),mp=hl(N1());Ae.jsonSchemaParserNormalizeArgs=mp.default;var _5=hl(M1()),R5=hl(j1()),Q1=hl(W1());Ae.dereferenceInternal=Q1.default;var pl=S5(Gn()),Kn=Yn();Object.defineProperty(Ae,"JSONParserError",{enumerable:!0,get:function(){return Kn.JSONParserError}});Object.defineProperty(Ae,"InvalidPointerError",{enumerable:!0,get:function(){return Kn.InvalidPointerError}});Object.defineProperty(Ae,"MissingPointerError",{enumerable:!0,get:function(){return Kn.MissingPointerError}});Object.defineProperty(Ae,"ResolverError",{enumerable:!0,get:function(){return Kn.ResolverError}});Object.defineProperty(Ae,"ParserError",{enumerable:!0,get:function(){return Kn.ParserError}});Object.defineProperty(Ae,"UnmatchedParserError",{enumerable:!0,get:function(){return Kn.UnmatchedParserError}});Object.defineProperty(Ae,"UnmatchedResolverError",{enumerable:!0,get:function(){return Kn.UnmatchedResolverError}});Object.defineProperty(Ae,"isHandledError",{enumerable:!0,get:function(){return Kn.isHandledError}});Object.defineProperty(Ae,"JSONParserErrorGroup",{enumerable:!0,get:function(){return Kn.JSONParserErrorGroup}});var K1=Bo(),qi=hl(G1()),x5=eC();Object.defineProperty(Ae,"getJsonSchemaRefParserDefaultOptions",{enumerable:!0,get:function(){return x5.getJsonSchemaRefParserDefaultOptions}});var Jo=class t{constructor(){this.schema=null,this.$refs=new Y1.default}async parse(){let e=(0,mp.default)(arguments),r;if(!e.path&&!e.schema){let i=(0,K1.ono)(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return(0,qi.default)(e.callback,Promise.reject(i))}this.schema=null,this.$refs=new Y1.default;let n="http";if(pl.isFileSystemPath(e.path))e.path=pl.fromFileSystemPath(e.path),n="file";else if(!e.path&&e.schema&&"$id"in e.schema&&e.schema.$id){let i=pl.parse(e.schema.$id),s=i.protocol==="https:"?443:80;e.path=`${i.protocol}//${i.hostname}:${s}`}if(e.path=pl.resolve(pl.cwd(),e.path),e.schema&&typeof e.schema=="object"){let i=this.$refs._add(e.path);i.value=e.schema,i.pathType=n,r=Promise.resolve(e.schema)}else r=(0,w5.default)(e.path,this.$refs,e.options);try{let i=await r;if(i!==null&&typeof i=="object"&&!Buffer.isBuffer(i))return this.schema=i,(0,qi.default)(e.callback,Promise.resolve(this.schema));if(e.options.continueOnError)return this.schema=null,(0,qi.default)(e.callback,Promise.resolve(this.schema));throw K1.ono.syntax(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(i){return!e.options.continueOnError||!(0,Kn.isHandledError)(i)?(0,qi.default)(e.callback,Promise.reject(i)):(this.$refs._$refs[pl.stripHash(e.path)]&&this.$refs._$refs[pl.stripHash(e.path)].addError(i),(0,qi.default)(e.callback,Promise.resolve(null)))}}static parse(){let e=new t;return e.parse.apply(e,arguments)}async resolve(){let e=(0,mp.default)(arguments);try{return await this.parse(e.path,e.schema,e.options),await(0,_5.default)(this,e.options),aC(this),(0,qi.default)(e.callback,Promise.resolve(this.$refs))}catch(r){return(0,qi.default)(e.callback,Promise.reject(r))}}static resolve(){let e=new t;return e.resolve.apply(e,arguments)}static bundle(){let e=new t;return e.bundle.apply(e,arguments)}async bundle(){let e=(0,mp.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,R5.default)(this,e.options),aC(this),(0,qi.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,qi.default)(e.callback,Promise.reject(r))}}static dereference(){let e=new t;return e.dereference.apply(e,arguments)}async dereference(){let e=(0,mp.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,Q1.default)(this,e.options),aC(this),(0,qi.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,qi.default)(e.callback,Promise.reject(r))}}};Ae.$RefParser=Jo;Ae.default=Jo;function aC(t){if(Kn.JSONParserErrorGroup.getParserErrors(t).length>0)throw new Kn.JSONParserErrorGroup(t)}Ae.parse=Jo.parse;Ae.resolve=Jo.resolve;Ae.bundle=Jo.bundle;Ae.dereference=Jo.dereference});var Ly,ml,lC=le(()=>{"use strict";Ly=ve(Z1()),ml=class{async resolve(e){try{return await Ly.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){return console.error("[RefResolver] Failed to fully resolve $ref pointers:",r),e}}async bundle(e){try{return await Ly.default.bundle(e)}catch(r){return console.error("[RefResolver] Failed to bundle $ref pointers:",r),e}}async resolveFile(e){try{return await Ly.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){throw console.error(`[RefResolver] Failed to resolve file ${e}:`,r),r}}}});var X1,eN,C5,Hs,Uy=le(()=>{"use strict";X1=ve(require("fs")),eN=ve(Xd());Un();GR();lC();C5=["application/json","text/plain","text/html","multipart/form-data","application/x-www-form-urlencoded"],Hs=class{constructor(e,r){this.collectionService=e;this.envConfigService=r;this.exampleGenerator=new al,this.refResolver=new ml}collectionService;envConfigService;exampleGenerator;refResolver;async import(e,r){let n=await X1.promises.readFile(e,"utf-8"),i;e.endsWith(".yaml")||e.endsWith(".yml")?i=eN.parse(n):i=JSON.parse(n),i=await this.refResolver.resolve(i);let s=i.components?.schemas||{},o=r?.collectionName||i.info?.title||"Imported API",c={id:It(o),name:o,description:i.info?.description||"",version:i.info?.version||"1.0.0",variables:{},items:[]};if(i.servers&&i.servers.length>0&&(c.variables.baseUrl=i.servers[0].url),i.security&&i.security.length>0&&i.components?.securitySchemes){let m=this.mapSecurityToAuth(i.security[0],i.components.securitySchemes);m&&(c.auth=m)}let d=new Map;if(i.tags)for(let m of i.tags){let y={type:"folder",id:It(m.name),name:m.name,description:m.description,items:[]};d.set(m.name,y),c.items.push(y)}if(i.paths)for(let[m,y]of Object.entries(i.paths))for(let b of["get","post","put","patch","delete","head","options","trace"]){let q=y[b];if(!q)continue;let x=this.processOperation(b,m,q,y,i,s),v=q.tags?.[0];if(v&&d.has(v))d.get(v).items.push(x);else if(v){let _={type:"folder",id:It(v),name:v,items:[x]};d.set(v,_),c.items.push(_)}else c.items.push(x)}await this.collectionService.saveCollection(c);let p;return r?.environmentName&&i.servers&&(p=await this.createEnvironmentFromServers(i.servers,r.environmentName)),{collection:c,environmentCreated:p}}processOperation(e,r,n,i,s,o){let l=It(n.operationId||`${e}-${r}`),c=`{{baseUrl}}${this.convertPathParams(r)}`,d=n.summary||n.operationId||`${e.toUpperCase()} ${r}`,p=n.deprecated===!0;p&&(d=`[DEPRECATED] ${d}`);let m={type:"request",id:l,name:d,method:e.toUpperCase(),url:c,description:n.description||"",deprecated:p},y=[...i.parameters||[],...n.parameters||[]];if(this.processParameters(m,y,o),n.requestBody&&this.processRequestBody(m,n.requestBody,o),n.responses&&(m.responseSchema=this.processResponses(n.responses,o)),n.security!==void 0&&s.components?.securitySchemes){if(Array.isArray(n.security)&&n.security.length===0)m.auth={type:"none"};else if(n.security&&n.security.length>0){let b=this.mapSecurityToAuth(n.security[0],s.components.securitySchemes);b&&(m.auth=b)}}return m}convertPathParams(e){return e.replace(/\{(\w+)\}/g,":$1")}processParameters(e,r,n){let i=[],s=[],o={},l=[];for(let c of r){let d=c.name,p=c.in,m=c.schema||{},y=c.example!==void 0?String(c.example):this.generateExampleForParam(m,n),b=c.deprecated===!0;switch(p){case"path":{if(c.description||m.type||m.format||m.enum||b||m.pattern||m.minimum!==void 0||m.maximum!==void 0||m.minLength!==void 0||m.maxLength!==void 0||m.multipleOf!==void 0||m.minItems!==void 0||m.maxItems!==void 0||m.uniqueItems||m.nullable||m.oneOf){let x={value:y};m.oneOf?(x.oneOf=m.oneOf,this.applyOneOfHints(x,m.oneOf)):(m.type&&(x.type=m.type),m.format&&(x.format=m.format),m.enum&&(x.enum=m.enum.map(String)),m.pattern&&(x.pattern=m.pattern),m.minimum!==void 0&&(x.minimum=m.minimum),m.maximum!==void 0&&(x.maximum=m.maximum),m.exclusiveMinimum!==void 0&&(x.exclusiveMinimum=m.exclusiveMinimum),m.exclusiveMaximum!==void 0&&(x.exclusiveMaximum=m.exclusiveMaximum),m.multipleOf!==void 0&&(x.multipleOf=m.multipleOf),m.minLength!==void 0&&(x.minLength=m.minLength),m.maxLength!==void 0&&(x.maxLength=m.maxLength),m.minItems!==void 0&&(x.minItems=m.minItems),m.maxItems!==void 0&&(x.maxItems=m.maxItems),m.uniqueItems&&(x.uniqueItems=!0),m.nullable&&(x.nullable=!0)),c.description&&(x.description=c.description),b&&(x.deprecated=!0),o[d]=x}else o[d]=y;break}case"query":{let q={key:d,value:y};this.applySchemaConstraints(q,m,c,b),s.push(q);break}case"header":{let q={key:d,value:y};this.applySchemaConstraints(q,m,c,b),i.push(q);break}case"cookie":{l.push(`${d}={{${d}}}`);break}}}l.length>0&&i.push({key:"Cookie",value:l.join("; ")}),Object.keys(o).length>0&&(e.params=o),s.length>0&&(e.query=s),i.length>0&&(e.headers=i)}applySchemaConstraints(e,r,n,i){r.oneOf?(e.oneOf=r.oneOf,this.applyOneOfHints(e,r.oneOf)):(r.type&&(e.type=r.type),r.format&&(e.format=r.format),r.enum&&(e.enum=r.enum.map(String)),r.pattern&&(e.pattern=r.pattern),r.minimum!==void 0&&(e.minimum=r.minimum),r.maximum!==void 0&&(e.maximum=r.maximum),r.exclusiveMinimum!==void 0&&(e.exclusiveMinimum=r.exclusiveMinimum),r.exclusiveMaximum!==void 0&&(e.exclusiveMaximum=r.exclusiveMaximum),r.multipleOf!==void 0&&(e.multipleOf=r.multipleOf),r.minLength!==void 0&&(e.minLength=r.minLength),r.maxLength!==void 0&&(e.maxLength=r.maxLength),r.minItems!==void 0&&(e.minItems=r.minItems),r.maxItems!==void 0&&(e.maxItems=r.maxItems),r.uniqueItems&&(e.uniqueItems=!0),r.nullable&&(e.nullable=!0)),n.required&&(e.required=!0),n.description&&(e.description=n.description),i&&(e.deprecated=!0)}applyOneOfHints(e,r){let n=[],i=new Set;for(let s of r)s.type&&i.add(s.type),s.enum&&n.push(...s.enum.map(String));i.size===1&&(e.type=[...i][0]),n.length>0&&(e.enum=[...new Set(n)])}generateExampleForParam(e,r){if(!e)return"";let n=this.exampleGenerator.generate(e,{components:r});return n==null?"":String(n)}processRequestBody(e,r,n){if(!r.content)return;let i=Object.keys(r.content);if(i.length===0)return;let s=this.selectPrimaryContentType(i),o=r.content[s],{bodyType:l,bodyFormat:c}=this.mapContentTypeToBodyType(s);if(e.body={type:l,...c&&{format:c},content:""},o){let p=this.generateBodyContent(o,s,n);p!==void 0&&(e.body.content=typeof p=="string"?p:JSON.stringify(p,null,2)),l==="form-data"&&o.schema?.properties&&(e.body.content=this.buildFormDataEntries(o.schema,n)),l==="x-www-form-urlencoded"&&o.schema?.properties&&(e.body.content=this.buildFormDataEntries(o.schema,n))}let d=this.buildBodySchema(r,s,n);d&&(e.bodySchema=d)}selectPrimaryContentType(e){for(let i of C5)if(e.includes(i))return i;let r=e.find(i=>i.includes("json"));if(r)return r;let n=e.find(i=>i.startsWith("text/"));return n||e[0]}mapContentTypeToBodyType(e){return e.includes("json")?{bodyType:"raw",bodyFormat:"json"}:e==="application/xml"||e==="text/xml"?{bodyType:"raw",bodyFormat:"xml"}:e==="text/html"?{bodyType:"raw",bodyFormat:"html"}:e.startsWith("text/")?{bodyType:"raw",bodyFormat:"text"}:e==="multipart/form-data"?{bodyType:"form-data"}:e==="application/x-www-form-urlencoded"?{bodyType:"x-www-form-urlencoded"}:e==="application/octet-stream"?{bodyType:"binary"}:{bodyType:"raw",bodyFormat:"text"}}generateBodyContent(e,r,n){if(e.example!==void 0)return e.example;if(e.examples){let i=Object.values(e.examples)[0];if(i?.value!==void 0)return i.value}if(e.schema)return this.exampleGenerator.generate(e.schema,{omitReadOnly:!0,components:n})}buildFormDataEntries(e,r){let n=[],i=e.properties||{},s=new Set(e.required||[]);for(let[o,l]of Object.entries(i)){let c=l,d=c.type==="string"&&c.format==="binary",p={key:o,value:d?"":String(this.exampleGenerator.generate(c,{components:r})||""),type:d?"file":"text",enabled:!0};n.push(p)}return n}buildBodySchema(e,r,n){let i=Object.keys(e.content),s=e.content[r];if(!s?.schema)return;let o={contentType:r,schema:s.schema};if(i.length>1){o.content={};for(let c of i){let d=e.content[c],p={};d.schema&&(p.schema=d.schema),d.examples&&(p.examples=d.examples),d.encoding&&(p.encoding=d.encoding),o.content[c]=p}}s.encoding&&(o.encoding=s.encoding);let l=this.extractUsedComponents(s.schema,n);return Object.keys(l).length>0&&(o.components=l),o}processResponses(e,r){let n={responses:{}},i={};for(let[s,o]of Object.entries(e)){let l=o,c={description:l.description||`Status ${s}`};if(l.content){let d=Object.keys(l.content);if(d.length===1){let p=d[0],m=l.content[p];c.contentType=p,m.schema&&(c.schema=m.schema),m.examples&&(c.examples=m.examples),m.schema&&Object.assign(i,this.extractUsedComponents(m.schema,r))}else{c.content={};for(let p of d){let m=l.content[p],y={};m.schema&&(y.schema=m.schema),m.examples&&(y.examples=m.examples),c.content[p]=y,m.schema&&Object.assign(i,this.extractUsedComponents(m.schema,r))}}}if(l.headers){c.headers={};for(let[d,p]of Object.entries(l.headers)){let m=p;c.headers[d]={...m.description&&{description:m.description},schema:m.schema||{type:"string"}}}}n.responses[s]=c}return Object.keys(i).length>0&&(n.components=i),n}mapSecurityToAuth(e,r){let n=Object.keys(e)[0];if(!n)return;let i=r[n];if(i)switch(i.type){case"http":if(i.scheme==="bearer")return{type:"bearer",bearerToken:""};if(i.scheme==="basic")return{type:"basic",basicAuth:{username:"",password:""}};break;case"apiKey":return{type:"apikey",apikey:{key:i.name||"X-Api-Key",value:"",in:i.in||"header"}};case"oauth2":{let s=i.flows||{},o=s.authorizationCode||s.clientCredentials||s.password||s.implicit||{},l="client_credentials";return s.authorizationCode?l="authorization_code":s.password?l="password":s.implicit&&(l="implicit"),{type:"oauth2",oauth2:{grantType:l,tokenUrl:o.tokenUrl||"",authUrl:o.authorizationUrl||"",clientId:"",clientSecret:"",scope:Object.keys(o.scopes||{}).join(" ")}}}}}async createEnvironmentFromServers(e,r){if(e.length>0){let n=e[0].url;this.envConfigService.setEnvironmentVariable("baseUrl",n)}return r}extractUsedComponents(e,r,n){let i=n||{};if(!e)return i;if(e.$ref){let s=this.extractRefName(e.$ref);s&&r[s]&&!i[s]&&(i[s]=r[s],this.extractUsedComponents(r[s],r,i))}if(e.properties)for(let s of Object.values(e.properties))this.extractUsedComponents(s,r,i);e.items&&this.extractUsedComponents(e.items,r,i);for(let s of["allOf","oneOf","anyOf"])if(e[s])for(let o of e[s])this.extractUsedComponents(o,r,i);return e.additionalProperties&&typeof e.additionalProperties=="object"&&this.extractUsedComponents(e.additionalProperties,r,i),i}extractRefName(e){return e.match(/^#\/components\/schemas\/(.+)$/)?.[1]}}});var gl,uC=le(()=>{"use strict";gl=class{constructor(e,r,n){this.historyAnalyzer=e;this.scriptAnalyzer=r;this.inferrer=n}historyAnalyzer;scriptAnalyzer;inferrer;async infer(e,r,n,i){let s=await this.historyAnalyzer.analyze(e,r,{environment:i?.environment}),o;return i?.postResponseScript&&(o=this.scriptAnalyzer.analyze(i.postResponseScript)),this.mergeResponseSchemas(n,s,o)}async inferBodySchema(e,r,n,i,s){let o,l;if(r==="raw"&&n==="json"&&e){let c=e;if(typeof e=="string")try{c=JSON.parse(e)}catch{return}o=this.inferrer.inferFromValue(c),l="application/json"}else r==="form-data"&&i?(o=this.buildFormDataSchema(i),l="multipart/form-data"):r==="x-www-form-urlencoded"&&i?(o=this.buildFormDataSchema(i),l="application/x-www-form-urlencoded"):r==="raw"&&n==="xml"?(o={type:"string"},l="application/xml"):r==="raw"&&(n==="text"||n==="html")?(o={type:"string"},l=n==="html"?"text/html":"text/plain"):r==="binary"?(o={type:"string",format:"binary"},l="application/octet-stream"):r==="graphql"&&(o={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},l="application/json");if(o)return s?this.mergeBodySchemaWithExisting(o,s):{contentType:l,schema:o}}buildFormDataSchema(e){let r={type:"object",properties:{}},n=[];for(let i of e){if(!i.enabled&&i.enabled!==void 0)continue;let s={};i.type?s.type=i.type:s.type="string",i.description&&(s.description=i.description),i.format&&(s.format=i.format),i.enum&&(s.enum=i.enum),i.type==="file"&&(s.type="string",s.format="binary"),r.properties[i.key]=s,i.required&&n.push(i.key)}return n.length>0&&(r.required=n),r}mergeResponseSchemas(e,r,n){let i={responses:{}};for(let[s,o]of Object.entries(r.responses))i.responses[s]={...o};if(n&&this.applyScriptHints(i,n),e){for(let[s,o]of Object.entries(e.responses))i.responses[s]?i.responses[s]=this.mergeResponseDefinitions(i.responses[s],o):i.responses[s]={...o};e.components&&(i.components={...e.components})}return i}applyScriptHints(e,r){for(let n of r.expectedStatuses){let i=String(n);e.responses[i]||(e.responses[i]={description:`Status ${n}`})}for(let[,n]of Object.entries(e.responses))n.schema&&this.augmentSchemaWithHints(n.schema,r)}augmentSchemaWithHints(e,r){if(!(e.type!=="object"||!e.properties))for(let n of r.fieldPaths){let i=n.split(".");this.ensureFieldPath(e,i,r)}}ensureFieldPath(e,r,n,i=""){if(r.length===0||e.type!=="object")return;e.properties||(e.properties={});let s=r[0],o=s.endsWith("[]"),l=o?s.slice(0,-2):s,c=i?`${i}.${s}`:s,d=r.slice(1);if(!e.properties[l])if(o)e.properties[l]={type:"array",items:{type:"object"}};else if(d.length>0)e.properties[l]={type:"object",properties:{}};else{let p=n.typeHints[c];e.properties[l]={type:p||"string"};return}if(d.length>0){let p=o?e.properties[l].items:e.properties[l];p&&this.ensureFieldPath(p,d,n,c)}}mergeResponseDefinitions(e,r){let n={...e};return r.description&&(n.description=r.description),r.contentType&&(n.contentType=r.contentType),r.schema&&e.schema?n.schema=this.inferrer.mergeSchemas(e.schema,r.schema):r.schema&&(n.schema=r.schema),r.examples&&(n.examples={...e.examples||{},...r.examples}),r.content&&(n.content={...e.content||{},...r.content}),r.headers&&(n.headers={...e.headers||{},...r.headers}),n}mergeBodySchemaWithExisting(e,r){let n={...r};return r.schema?n.schema=this.inferrer.mergeSchemas(e,r.schema):n.schema=e,n}}});var tN,Hy,rN,nN,iN,sN,oN,yl,cC=le(()=>{"use strict";tN=/(?:jsonData|responseJson|data|json|body|response\.json\(\))\.([a-zA-Z_][\w.\[\]]*)/g,Hy="(?:pm|hf|ctx)",rN=new RegExp(`${Hy}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(?:a|an)\\(['"](\\w+)['"]\\)`,"g"),nN=new RegExp(`${Hy}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.(?:equal|eql)\\((.+?)\\)`,"g"),iN=/(?:to\.have\.status|response\.code.*?equal)\((\d+)\)/g,sN=new RegExp(`${Hy}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(true|false)`,"g"),oN=new RegExp(`${Hy}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.have\\.(?:lengthOf|length\\.above|length\\.below)`,"g"),yl=class{analyze(e){let r={fieldPaths:[],typeHints:{},valueHints:{},expectedStatuses:[]};if(!e||e.trim().length===0)return r;let n=this.stripComments(e);return this.extractFieldPaths(n,r),this.extractTypeAssertions(n,r),this.extractEqualityAssertions(n,r),this.extractBooleanAssertions(n,r),this.extractLengthAssertions(n,r),this.extractStatusAssertions(n,r),r.fieldPaths=[...new Set(r.fieldPaths)],r.expectedStatuses=[...new Set(r.expectedStatuses)],r}stripComments(e){let r=e.replace(/\/\*[\s\S]*?\*\//g,"");return r=r.replace(/\/\/.*$/gm,""),r}extractFieldPaths(e,r){let n,i=new RegExp(tN.source,tN.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&!this.isCommonMethodCall(s)&&r.fieldPaths.push(s)}}extractTypeAssertions(e,r){let n,i=new RegExp(rN.source,rN.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),o=n[2].toLowerCase();s&&(r.typeHints[s]=this.mapAssertionType(o),r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractEqualityAssertions(e,r){let n,i=new RegExp(nN.source,nN.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),o=n[2].trim();if(s){let l=this.parseAssertionValue(o);l!==void 0&&(r.valueHints[s]=l,typeof l=="string"?r.typeHints[s]=r.typeHints[s]||"string":typeof l=="number"?r.typeHints[s]=r.typeHints[s]||(Number.isInteger(l)?"integer":"number"):typeof l=="boolean"&&(r.typeHints[s]=r.typeHints[s]||"boolean")),r.fieldPaths.includes(s)||r.fieldPaths.push(s)}}}extractBooleanAssertions(e,r){let n,i=new RegExp(sN.source,sN.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(r.typeHints[s]="boolean",r.valueHints[s]=n[2]==="true",r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractLengthAssertions(e,r){let n,i=new RegExp(oN.source,oN.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(r.typeHints[s]=r.typeHints[s]||"array",r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractStatusAssertions(e,r){let n,i=new RegExp(iN.source,iN.flags);for(;(n=i.exec(e))!==null;){let s=parseInt(n[1],10);!isNaN(s)&&s>=100&&s<600&&r.expectedStatuses.push(s)}}normalizeFieldPath(e){let r=e.replace(/^\./,"");return r=r.replace(/\[\d+\]/g,"[]"),r}isCommonMethodCall(e){return new Set(["to","be","have","not","deep","any","all","that","is","has","include","includes","equal","eql","above","below","least","most","within","length","lengthOf","match","string","keys","key","property","ownProperty","status","header","json","text"]).has(e.split(".")[0])}mapAssertionType(e){return{string:"string",number:"number",object:"object",array:"array",boolean:"boolean",null:"null",undefined:"null",int:"integer",integer:"integer",float:"number",double:"number"}[e]||"string"}parseAssertionValue(e){if(e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"'))return e.slice(1,-1);let r=Number(e);return!isNaN(r)&&e.trim().length>0?r:e==="true"?!0:e==="false"?!1:e==="null"?null:e}}});var aN={};Rs(aN,{AwsSecretResolver:()=>gp});var gp,fC=le(()=>{"use strict";gp=class{providerName="aws";region;moduleRequire;constructor(e,r){this.region=e.region??process.env.AWS_DEFAULT_REGION??process.env.AWS_REGION,this.moduleRequire=r??(n=>require(n))}async resolve(e){let r=e.lastIndexOf("#"),n=r>=0?e.slice(0,r):e,i=r>=0?e.slice(r+1):void 0;try{let{SecretsManagerClient:s,GetSecretValueCommand:o}=this.moduleRequire("@aws-sdk/client-secrets-manager"),c=await new s(this.region?{region:this.region}:{}).send(new o({SecretId:n})),d=c.SecretString??(c.SecretBinary?Buffer.from(c.SecretBinary).toString("utf-8"):void 0);if(d===void 0)return;if(i)try{let p=JSON.parse(d);return p[i]!==void 0?String(p[i]):void 0}catch{return}return d}catch(s){throw s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND"?new Error("[HTTP Forge] AWS secret resolver requires @aws-sdk/client-secrets-manager. Install it in your project: npm install @aws-sdk/client-secrets-manager"):s}}}});var lN={};Rs(lN,{AzureKeyVaultResolver:()=>yp});var yp,dC=le(()=>{"use strict";yp=class{providerName="azure";vaultUrl;moduleRequire;constructor(e,r){let n=(e.vaultUrl||process.env.AZURE_KEYVAULT_URL)??"";this.vaultUrl=n.replace(/\/$/,""),this.moduleRequire=r??(i=>require(i))}async resolve(e){if(!this.vaultUrl)throw new Error("[HTTP Forge] Azure Key Vault resolver: no vault URL configured. Set secrets.providers.<alias>.vaultUrl or the AZURE_KEYVAULT_URL env var.");let r=e.split("/"),n=r[0],i=r[1];try{let{SecretClient:s}=this.moduleRequire("@azure/keyvault-secrets"),{DefaultAzureCredential:o}=this.moduleRequire("@azure/identity"),l=new o;return(await new s(this.vaultUrl,l).getSecret(n,i?{version:i}:{})).value}catch(s){throw s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND"?new Error("[HTTP Forge] Azure Key Vault resolver requires @azure/keyvault-secrets and @azure/identity. Install them: npm install @azure/keyvault-secrets @azure/identity"):s}}}});var uN={};Rs(uN,{HashiCorpVaultResolver:()=>vp});var vp,pC=le(()=>{"use strict";vp=class{providerName="vault";address;mountPath;namespace;constructor(e){this.address=(e.address??process.env.VAULT_ADDR??"http://127.0.0.1:8200").replace(/\/$/,""),this.mountPath=e.mountPath??"secret",this.namespace=e.namespace??process.env.VAULT_NAMESPACE}async resolve(e){let r=e.lastIndexOf("#"),n=r>=0?e.slice(0,r):e,i=r>=0?e.slice(r+1):void 0,s=process.env.VAULT_TOKEN;if(!s)throw new Error("[HTTP Forge] HashiCorp Vault resolver requires VAULT_TOKEN environment variable to be set.");let o=`${this.address}/v1/${this.mountPath}/data/${n}`,l={"X-Vault-Token":s};this.namespace&&(l["X-Vault-Namespace"]=this.namespace);let c;try{c=await fetch(o,{headers:l})}catch(y){throw new Error(`[HTTP Forge] Vault request failed: ${y?.message??y}`)}if(c.status===404)return;if(!c.ok)throw new Error(`[HTTP Forge] Vault returned HTTP ${c.status} for path: ${n}`);let p=(await c.json())?.data?.data;if(!p)return;if(i)return p[i]!==void 0?String(p[i]):void 0;if("value"in p)return String(p.value);let m=Object.keys(p);return m.length===1?String(p[m[0]]):void 0}}});var dN={};Rs(dN,{OnePasswordResolver:()=>bp});var cN,fN,E5,bp,hC=le(()=>{"use strict";cN=require("child_process"),fN=require("util"),E5=(0,fN.promisify)(cN.execFile),bp=class{providerName="1password";defaultVault;constructor(e){this.defaultVault=e.vault}async resolve(e){let r=e.split("/"),n,i,s;if(this.defaultVault){if(r.length<2)throw new Error(`[HTTP Forge] 1Password path "${e}" must be "<item>/<field>" when vault is set in config.`);n=this.defaultVault,i=r.slice(0,r.length-1).join("/"),s=r[r.length-1]}else{if(r.length<3)throw new Error(`[HTTP Forge] 1Password path "${e}" must be "<vault>/<item>/<field>".`);n=r[0],i=r.slice(1,r.length-1).join("/"),s=r[r.length-1]}let o=await this.tryResolveSdk(n,i,s);return o!==null?o:this.resolveViaCli(n,i,s)}async tryResolveSdk(e,r,n){let i=process.env.OP_SERVICE_ACCOUNT_TOKEN;if(!i)return null;try{let{createClient:s}=require("@1password/sdk"),o=await s({auth:i,integrationName:"HTTP Forge",integrationVersion:"1.0.0"}),l=`op://${e}/${r}/${n}`;return await o.secrets.resolve(l)}catch(s){if(s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND")return null;throw new Error(`[HTTP Forge] 1Password SDK error for "${e}/${r}/${n}": ${s?.message??s}`)}}async resolveViaCli(e,r,n){try{let{stdout:i}=await E5("op",["item","get",r,"--vault",e,"--field",n,"--format","json"],{env:{...process.env},timeout:1e4}),s=JSON.parse(i.trim());return typeof s=="string"?s:s&&typeof s.value=="string"?s.value:void 0}catch(i){if(i?.code==="ENOENT")throw new Error("[HTTP Forge] 1Password resolver requires either the @1password/sdk npm package or the `op` CLI to be installed.\n Service Account: set OP_SERVICE_ACCOUNT_TOKEN and install @1password/sdk\n CLI: install 1Password CLI and run `op signin`");if(i?.stderr?.includes("not found")||i?.code===1)return;throw new Error(`[HTTP Forge] 1Password CLI error: ${i?.message??i}`)}}}});var pN={};Rs(pN,{GcpSecretResolver:()=>Sp});var Sp,mC=le(()=>{"use strict";Sp=class{providerName="gcp";projectId;moduleRequire;constructor(e,r){this.projectId=e.projectId??process.env.GOOGLE_CLOUD_PROJECT??process.env.GCLOUD_PROJECT??process.env.GCP_PROJECT,this.moduleRequire=r??(n=>require(n))}async resolve(e){let r=e.split("/"),n=r[0],i=r[1]==="versions"&&r[2]?r[2]:"latest";if(!this.projectId)throw new Error("[HTTP Forge] GCP secret resolver: no projectId configured and GOOGLE_CLOUD_PROJECT env var is not set.");try{let{SecretManagerServiceClient:s}=this.moduleRequire("@google-cloud/secret-manager"),o=new s,l=`projects/${this.projectId}/secrets/${n}/versions/${i}`,[c]=await o.accessSecretVersion({name:l}),d=c.payload?.data;return d?Buffer.isBuffer(d)?d.toString("utf-8"):Buffer.from(d).toString("utf-8"):void 0}catch(s){throw s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND"?new Error("[HTTP Forge] GCP secret resolver requires @google-cloud/secret-manager. Install it: npm install @google-cloud/secret-manager"):s}}}});var mN={};Rs(mN,{DopplerResolver:()=>wp});var hN,wp,gC=le(()=>{"use strict";hN=ve(require("https")),wp=class{providerName="doppler";token;constructor(e){this.token=e.serviceToken??process.env.DOPPLER_TOKEN}async resolve(e){let r=e.trim().toUpperCase(),n=this.token;if(!n)throw new Error("[HTTP Forge] Doppler secret resolver: no service token found. Set DOPPLER_TOKEN env var or add serviceToken to config.");let i=`https://api.doppler.com/v3/configs/config/secret?name=${encodeURIComponent(r)}`;return new Promise((s,o)=>{let l=hN.request(i,{method:"GET",headers:{Authorization:`Bearer ${n}`,Accept:"application/json"}},c=>{let d=[];c.on("data",p=>d.push(p)),c.on("end",()=>{let p=Buffer.concat(d).toString("utf-8");if(c.statusCode===404){s(void 0);return}if(c.statusCode!==200){o(new Error(`[HTTP Forge] Doppler API returned ${c.statusCode} for secret "${r}": ${p}`));return}try{let y=JSON.parse(p)?.value?.computed;s(y!=null?String(y):void 0)}catch{o(new Error(`[HTTP Forge] Doppler API returned non-JSON response for secret "${r}"`))}})});l.on("error",o),l.end()})}}});var By,gN,yN,Ac,yC=le(()=>{"use strict";By=ve(require("fs")),gN=require("module"),yN=ve(require("path")),Ac=class{resolvers=new Map;moduleRequire;constructor(e){if(this.moduleRequire=this.buildModuleRequire(e),!e)return;let r;try{r=e.getConfig().secrets}catch{return}if(!(!r?.providers||typeof r.providers!="object"))for(let[n,i]of Object.entries(r.providers))try{let s=this.createResolver(i);s&&this.resolvers.set(n,s)}catch{}}async resolveSecretTokens(e,r){let n=r??new Map,i=new Set;if(this.collectTokens(e,i),i.size===0)return{};await Promise.all(Array.from(i).map(async o=>{if(n.has(o))return;let l=o.slice(7),c=l.indexOf("/");if(c<0)return;let d=l.slice(0,c),p=l.slice(c+1),m=this.resolvers.get(d);if(m)try{let y=await m.resolve(p);y!==void 0&&n.set(o,y)}catch(y){let b=y?.message??String(y);console.warn(`[HTTP Forge] {{${o}}} could not be resolved: ${b}`)}}));let s={};for(let[o,l]of n.entries())s[o]=l;return s}get hasProviders(){return this.resolvers.size>0}collectTokens(e,r){if(typeof e=="string"){let n=/\{\{(secret:[^}]+)\}\}/g,i;for(;(i=n.exec(e))!==null;)r.add(i[1])}else Array.isArray(e)?e.forEach(n=>this.collectTokens(n,r)):e!==null&&typeof e=="object"&&Object.values(e).forEach(n=>this.collectTokens(n,r))}createResolver(e){switch(e.provider){case"aws":{let{AwsSecretResolver:r}=(fC(),Ia(aN));return new r(e,this.moduleRequire)}case"azure":{let{AzureKeyVaultResolver:r}=(dC(),Ia(lN));return new r(e,this.moduleRequire)}case"vault":{let{HashiCorpVaultResolver:r}=(pC(),Ia(uN));return new r(e)}case"1password":{let{OnePasswordResolver:r}=(hC(),Ia(dN));return new r(e)}case"gcp":{let{GcpSecretResolver:r}=(mC(),Ia(pN));return new r(e,this.moduleRequire)}case"doppler":{let{DopplerResolver:r}=(gC(),Ia(mN));return new r(e)}default:return}}buildModuleRequire(e){let r=i=>require(i);if(!e)return r;let n=[];try{n=e.getModulePaths()??[]}catch{return r}for(let i of n)try{let s=yN.resolve(i,"package.json");if(By.existsSync(s)){let o=By.realpathSync(s),l=(0,gN.createRequire)(o);return c=>{try{return l(c)}catch{return r(c)}}}}catch{}return r}}});function hr(t){return t.replace(/\//g,"%2F")}function vC(t){return t.replace(/%2F/gi,"/")}function rs(t){return t?t.split("/").map(vC).join(" / "):""}function _p(t){return t.includes(" / ")?t.split(" / ").map(e=>hr(e.trim())).join("/"):hr(t)}function rt(t,e=t.items,r=""){let n=[];for(let i of e)if(i.type==="request")n.push({request:i,folderPath:r});else{let s=i,o=hr(s.name),l=r?`${r}/${o}`:o;n.push(...rt(t,s.items??[],l))}return n}function zr(t,e=t.items,r=""){let n=[];for(let i of e)if(i.type==="folder"){let s=i,o=hr(s.name),l=r?`${r}/${o}`:o;n.push({folderId:s.id,folderPath:l,requestCount:Vy(s.items??[])}),n.push(...zr(t,s.items??[],l))}return n}function Vy(t){let e=0;for(let r of t)r.type==="request"?e++:e+=Vy(r.items??[]);return e}var Ii=le(()=>{"use strict"});var Go,bC=le(()=>{"use strict";Go={iterations:1,delayBetweenRequests:0,stopOnError:!1,readFromSharedSession:!1,writeToSharedSession:!1}});var bt,Oi,Tc,SC=le(()=>{"use strict";bt=ve(require("fs")),Oi=ve(require("path"));Ii();Un();bC();Tc=class{constructor(e,r,n){this.collectionService=e;this.configService=r;this.suitesDir=r.getSuitesPath(),this.onSuitesChanged=n?.onSuitesChanged,this.ensureSuitesDir(),this.loadSuites(),n?.watch!==!1&&this.setupFileWatcher()}collectionService;configService;suitesDir;suites=new Map;fileWatcher=null;debounceTimer=null;onSuitesChanged;ensureSuitesDir(){bt.existsSync(this.suitesDir)||bt.mkdirSync(this.suitesDir,{recursive:!0})}setupFileWatcher(){try{this.fileWatcher=bt.watch(this.suitesDir,(e,r)=>{r&&!r.endsWith(".suite.json")||(this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.loadSuites(),this.onSuitesChanged?.()},200))}),this.fileWatcher.on("error",()=>{})}catch{}}dispose(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.fileWatcher?.close(),this.fileWatcher=null}loadSuites(){if(this.suites.clear(),!bt.existsSync(this.suitesDir))return;let e=bt.readdirSync(this.suitesDir);for(let r of e)if(r.endsWith(".suite.json"))try{let n=Oi.join(this.suitesDir,r),i=bt.readFileSync(n,"utf-8"),s=JSON.parse(i),o=Array.isArray(s.nodes)&&s.nodes.length>0?s.nodes:(Array.isArray(s.requests)?s.requests:[]).map(c=>({type:"request",name:c.description||c.name,request:c,enabled:c.enabled!==!1})),l={id:s.id,name:s.name,description:s.description,scripts:s.scripts,nodes:o,config:s.config??{...Go},isTemporary:s.isTemporary,createdAt:s.createdAt??Date.now(),updatedAt:s.updatedAt??Date.now()};l.id&&l.name&&this.suites.set(l.id,l)}catch(n){console.error(`[TestSuiteService] Failed to load ${r}:`,n)}}async getAllSuites(){return Array.from(this.suites.values())}async getSuite(e){return this.suites.get(e)}async createSuite(e){let r=Date.now(),n={id:It(e),name:e,nodes:[],config:{...Go},createdAt:r,updatedAt:r};return await this.saveSuiteToDisk(n),this.suites.set(n.id,n),n}async updateSuite(e){e.updatedAt=Date.now(),await this.saveSuiteToDisk(e),this.suites.set(e.id,e)}async duplicateSuite(e,r){let n=this.suites.get(e);if(!n)throw new Error(`Suite not found: ${e}`);let i=n.nodes||[],s=await this.createSuite(r);s.nodes=i.map(c=>({...c})),s.config={...n.config},s.description=n.description;let o=Oi.join(this.suitesDir,e),l=Oi.join(this.suitesDir,s.id);return bt.existsSync(o)&&this.copyDirRecursive(o,l),await this.saveSuiteToDisk(s),this.suites.set(s.id,s),s}copyDirRecursive(e,r){bt.existsSync(r)||bt.mkdirSync(r,{recursive:!0});for(let n of bt.readdirSync(e,{withFileTypes:!0})){let i=Oi.join(e,n.name),s=Oi.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):bt.copyFileSync(i,s)}}async deleteSuite(e){let r=this.suites.get(e);if(!r)return!1;let n=`${r.id}.suite.json`,i=Oi.join(this.suitesDir,n),s=Oi.join(this.suitesDir,r.id);try{return bt.existsSync(i)&&bt.unlinkSync(i),bt.existsSync(s)&&bt.rmSync(s,{recursive:!0,force:!0}),this.suites.delete(e),!0}catch(o){return console.error("[TestSuiteService] Failed to delete suite:",o),!1}}async createTempSuiteFromCollection(e){let r=this.collectionService.getCollection(e);if(!r){console.error(`[TestSuiteService] Collection not found: ${e}`);return}let n=[];this.extractRequestsFromCollection(r,e,r.name,"",n);let i=n.map(l=>({type:"request",name:l.description||l.name,request:l,enabled:l.enabled!==!1})),s=Date.now();return{id:`temp-${e}`,name:r.name,nodes:i,config:{...Go},isTemporary:!0,createdAt:s,updatedAt:s}}async createTempSuiteFromFolder(e,r,n=!0){let i=this.collectionService.getCollection(e);if(!i){console.error(`[TestSuiteService] Collection not found: ${e}`);return}let s=[];this.extractRequestsFromCollection(i,e,i.name,"",s);let o=r.replace(/\/+$/,""),l=s.filter(m=>n?m.folderPath===o||m.folderPath.startsWith(`${o}/`):m.folderPath===o);if(l.length===0){console.error(`[TestSuiteService] No requests under folder "${r}" in collection: ${e}`);return}let c=l.map(m=>({type:"request",name:m.description||m.name,request:m,enabled:m.enabled!==!1})),d=Date.now();return{id:`temp-${e}-${this.slugifyFolderPath(o)}`,name:`${i.name} / ${rs(o)}`,nodes:c,config:{...Go},isTemporary:!0,createdAt:d,updatedAt:d}}slugifyFolderPath(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}async saveTempSuite(e,r){let n=Date.now(),i=Oi.join(this.suitesDir,e.id),s={...e,id:It(r),name:r,isTemporary:!1,createdAt:n,updatedAt:n},o=Oi.join(this.suitesDir,s.id);return bt.existsSync(i)&&(bt.existsSync(o)&&bt.rmSync(o,{recursive:!0,force:!0}),bt.renameSync(i,o)),await this.saveSuiteToDisk(s),this.suites.set(s.id,s),s}getAllAvailableRequests(){let e=[],r=this.collectionService.getAllCollections();for(let n of r)this.extractRequestsFromCollection(n,n.id,n.name,"",e);return e}extractRequestsFromCollection(e,r,n,i,s){if(e.requests)for(let o of e.requests)s.push({collectionId:r,collectionName:n,requestId:o.id,name:o.name||"Unnamed Request",method:o.method||"GET",folderPath:i});if(e.items)for(let o of e.items)if(o.items||o.folders||o.requests){let l=i?`${i}/${hr(o.name)}`:hr(o.name);this.extractRequestsFromCollection(o,r,n,l,s)}else s.push({collectionId:r,collectionName:n,requestId:o.id,name:o.name||"Unnamed Request",method:o.method||"GET",folderPath:i});if(e.folders)for(let o of e.folders){let l=i?`${i}/${hr(o.name)}`:hr(o.name);this.extractRequestsFromCollection(o,r,n,l,s)}}async saveSuiteToDisk(e){this.ensureSuitesDir();let r=`${e.id}.suite.json`,n=Oi.join(this.suitesDir,r),i=`${n}.tmp-${process.pid}-${Date.now()}`,s={id:e.id,name:e.name,description:e.description,scripts:e.scripts,nodes:Array.isArray(e.nodes)?e.nodes:[],config:e.config??{...Go},isTemporary:e.isTemporary,createdAt:e.createdAt??Date.now(),updatedAt:e.updatedAt??Date.now()},o=JSON.stringify(s,null,2);bt.writeFileSync(i,o,"utf-8"),bt.renameSync(i,n)}}});var ae,Wy=le(()=>{"use strict";ae={Config:Symbol.for("IConfigService"),Console:Symbol.for("IConsoleService"),EnvironmentConfig:Symbol.for("IEnvironmentConfigService"),Collection:Symbol.for("ICollectionService"),HttpRequest:Symbol.for("IHttpRequestService"),HttpClient:Symbol.for("IHttpClient"),Cookie:Symbol.for("ICookieService"),RequestHistory:Symbol.for("IRequestHistoryService"),TestSuite:Symbol.for("ITestSuiteService"),UrlBuilder:Symbol.for("IUrlBuilder"),RequestPreprocessor:Symbol.for("IRequestPreprocessor"),RequestPreparer:Symbol.for("IRequestPreparer"),InterceptorChain:Symbol.for("IInterceptorChain"),ScriptExecutor:Symbol.for("IScriptExecutor"),DataFileParser:Symbol.for("IDataFileParser"),CollectionRequestExecutor:Symbol.for("ICollectionRequestExecutor"),WorkspaceFolder:Symbol.for("WorkspaceFolder"),PersistentCookieJar:Symbol.for("PersistentCookieJar"),OAuth2TokenManager:Symbol.for("IOAuth2TokenManager"),GraphQLSchemaService:Symbol.for("IGraphQLSchemaService"),SchemaInferrer:Symbol.for("SchemaInferrer"),HistoryAnalyzer:Symbol.for("HistoryAnalyzer"),ScriptAnalyzer:Symbol.for("ScriptAnalyzer"),SchemaInferenceService:Symbol.for("SchemaInferenceService"),OpenApiExporter:Symbol.for("OpenApiExporter"),OpenApiImporter:Symbol.for("OpenApiImporter"),SecretResolverRegistry:Symbol.for("SecretResolverRegistry")}});function Rp(t,e){let{workspaceFolder:r,fileWatcherFactory:n,notificationService:i,workspaceStore:s,globalStore:o,secretStore:l,browserService:c,applicationInfo:d,consoleService:p}=e;t.registerValue(ae.WorkspaceFolder,r),t.registerSingleton(ae.Config,()=>new ks(r,n,i)),t.registerSingleton(ae.Console,()=>p??q5),t.registerSingleton(ae.EnvironmentConfig,y=>new nc(r,s,y.resolve(ae.Config),n,l,e.persistOverrides??!0)),t.registerSingleton(ae.Cookie,()=>new tc(o)),t.registerSingleton(ae.Collection,y=>new ec(r,y.resolve(ae.Config),n)),t.registerSingleton(ae.TestSuite,y=>new Tc(y.resolve(ae.Collection),y.resolve(ae.Config))),t.registerSingleton(ae.HttpClient,y=>{let b=y.resolve(ae.Config);return new Eo(b.getRequestConfig(),r)}),t.registerSingleton(ae.UrlBuilder,()=>new Hn),t.registerSingleton(ae.InterceptorChain,()=>new zi),t.registerSingleton(ae.HttpRequest,y=>new Wi(y.resolve(ae.UrlBuilder),y.resolve(ae.InterceptorChain),y.resolve(ae.HttpClient))),t.registerSingleton(ae.RequestPreprocessor,()=>new qo),t.registerSingleton(ae.RequestHistory,y=>{let b=y.resolve(ae.EnvironmentConfig);return new oc(b.getHistoriesPath(),vN.join(b.getRootPath(),"shared-histories"))}),l&&c&&t.registerSingleton(ae.OAuth2TokenManager,y=>new Qu(l,c,y.resolve(ae.EnvironmentConfig),y.resolve(ae.HttpRequest))),t.registerSingleton(ae.GraphQLSchemaService,y=>new sc(y.resolve(ae.HttpClient))),t.registerSingleton(ae.SecretResolverRegistry,y=>new Ac(y.resolve(ae.Config)));let m=d??{name:"HttpForge",version:"0.0.0"};t.registerSingleton(ae.RequestPreparer,y=>new ic(y.resolve(ae.EnvironmentConfig),y.resolve(ae.HttpRequest),y.resolve(ae.RequestPreprocessor),y.has(ae.OAuth2TokenManager)?y.resolve(ae.OAuth2TokenManager):void 0,m,y.resolve(ae.SecretResolverRegistry))),t.registerSingleton(ae.ScriptExecutor,y=>{let b=y.resolve(ae.Config);return new Ki(y.resolve(ae.HttpRequest),b.getModulePaths(),y.resolve(ae.SecretResolverRegistry),b.getScriptScope(),b.getScriptTimeout())}),t.registerSingleton(ae.DataFileParser,()=>new Oo),t.registerSingleton(ae.CollectionRequestExecutor,y=>new As(y.resolve(ae.HttpRequest),y.resolve(ae.ScriptExecutor),y.resolve(ae.EnvironmentConfig),y.resolve(ae.RequestPreparer),"")),t.registerSingleton(ae.PersistentCookieJar,y=>new rc(y.resolve(ae.Cookie))),t.registerSingleton(ae.SchemaInferrer,()=>new Ns),t.registerSingleton(ae.HistoryAnalyzer,y=>new Xa(y.resolve(ae.RequestHistory),y.resolve(ae.SchemaInferrer))),t.registerSingleton(ae.ScriptAnalyzer,()=>new yl),t.registerSingleton(ae.SchemaInferenceService,y=>new gl(y.resolve(ae.HistoryAnalyzer),y.resolve(ae.ScriptAnalyzer),y.resolve(ae.SchemaInferrer))),t.registerSingleton(ae.OpenApiExporter,y=>new ol(y.resolve(ae.Collection),y.resolve(ae.EnvironmentConfig),y.resolve(ae.SchemaInferenceService))),t.registerSingleton(ae.OpenApiImporter,y=>new Hs(y.resolve(ae.Collection),y.resolve(ae.EnvironmentConfig)))}var vN,q5,wC=le(()=>{"use strict";vN=ve(require("path"));K0();t_();sg();n_();i_();o_();og();a_();l_();f_();Tf();$f();gd();tg();_u();d_();JR();Uy();uC();fy();cC();rg();md();yC();SC();Wy();q5={log:()=>{},trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},logBatch:()=>{},logRawLines:()=>{},show:()=>{},clear:()=>{},dispose:()=>{}}});function _C(){return Yo.instance}var Yo,RC=le(()=>{"use strict";Wy();Yo=class t{static _instance;services=new Map;primitives=new Map;constructor(){}static get instance(){return t._instance||(t._instance=new t),t._instance}static createFresh(){return new t}static reset(){t._instance&&t._instance.clear(),t._instance=void 0}registerValue(e,r){return this.primitives.set(e,r),this}registerSingleton(e,r){return this.services.set(e,{factory:r,singleton:!0}),this}registerTransient(e,r){return this.services.set(e,{factory:r,singleton:!1}),this}registerInstance(e,r){return this.services.set(e,{factory:()=>r,singleton:!0,instance:r}),this}resolve(e){if(this.primitives.has(e))return this.primitives.get(e);let r=this.services.get(e);if(!r)throw new Error(`Service not registered: ${e.toString()}`);return r.singleton?(r.instance||(r.instance=r.factory(this)),r.instance):r.factory(this)}has(e){return this.services.has(e)||this.primitives.has(e)}clear(){this.services.clear(),this.primitives.clear()}get config(){return this.resolve(ae.Config)}get console(){return this.resolve(ae.Console)}get environmentConfig(){return this.resolve(ae.EnvironmentConfig)}get collection(){return this.resolve(ae.Collection)}get httpRequest(){return this.resolve(ae.HttpRequest)}get httpClient(){return this.resolve(ae.HttpClient)}get cookie(){return this.resolve(ae.Cookie)}get requestHistory(){return this.resolve(ae.RequestHistory)}get dataFileParser(){return this.resolve(ae.DataFileParser)}get scriptExecutor(){return this.resolve(ae.ScriptExecutor)}get requestPreparer(){return this.resolve(ae.RequestPreparer)}get persistentCookieJar(){return this.resolve(ae.PersistentCookieJar)}get oauth2TokenManager(){return this.has(ae.OAuth2TokenManager)?this.resolve(ae.OAuth2TokenManager):void 0}get graphqlSchemaService(){return this.resolve(ae.GraphQLSchemaService)}get testSuite(){return this.resolve(ae.TestSuite)}}});function bN(t){return/\{\{[^}]+\}\}/.test(t)}function xp(t,e=16){return!!t&&t.length>=e&&!bN(t)}function xC(t){return t.toUpperCase().replace(/[^A-Z0-9]/g,"_")}function Cp(t,e,r,n,i,s=10){let o=t.get(e);o||(o={varName:r,reason:n,occurrences:[],priority:s},t.set(e,o));let l=`${i.requestId}::${i.field}`;o.occurrences.some(c=>`${c.requestId}::${c.field}`===l)||o.occurrences.push(i)}function Ep(t,e=1){let r=rt(t),n=new Map;for(let{request:s}of r){let o=l=>({requestId:s.id,requestName:s.name,field:l});for(let l of s.headers??[]){if(l.enabled===!1)continue;let c=l.key.toLowerCase(),d=l.value;if(c==="authorization"){let p=d.match(/^(bearer|basic|token|digest)\s+(.+)$/i);p&&xp(p[2])?Cp(n,p[2],`${p[1].toUpperCase()}_TOKEN`,`Authorization ${p[1]} token`,o(`header:${l.key}`),1):xp(d)&&Cp(n,d,"AUTH_TOKEN","Authorization header value",o(`header:${l.key}`),1)}else I5.has(c)&&xp(d)?Cp(n,d,xC(l.key),`Sensitive header: ${l.key}`,o(`header:${l.key}`),2):xp(d,20)&&!d.includes(" ")&&/^[A-Za-z0-9+/=_.-]+$/.test(d)&&Cp(n,d,xC(l.key)||"HEADER_VALUE",`Long opaque value in header: ${l.key}`,o(`header:${l.key}`),5)}for(let l of s.query??[])l.enabled!==!1&&O5.has(l.key.toLowerCase())&&xp(l.value)&&Cp(n,l.value,xC(l.key),`Sensitive query param: ${l.key}`,o(`query:${l.key}`),2)}let i=new Map;for(let{request:s}of r)if(!(!s.url||bN(s.url)))try{let o=new URL(s.url);if(!["localhost","127.0.0.1","0.0.0.0","::1"].includes(o.hostname)){let c=`${o.protocol}//${o.host}`,d=i.get(c)??[];d.push({requestId:s.id,requestName:s.name,field:"url"}),i.set(c,d)}}catch{}for(let[s,o]of i)o.length>=Math.max(e,2)&&!n.has(s)&&n.set(s,{varName:"BASE_URL",reason:`Shared base URL across ${o.length} requests`,occurrences:o,priority:3});return[...n.entries()].filter(([,s])=>s.occurrences.length>=e).sort((s,o)=>s[1].priority-o[1].priority||s[0].localeCompare(o[0])).map(([s,o])=>({varName:o.varName,value:s,reason:o.reason,occurrences:o.occurrences}))}function zy(t,e){let r={};return SN(t,e,r),r}function SN(t,e,r){for(let n of t){if(n.type==="folder"){n.items&&SN(n.items,e,r);continue}let i=n;for(let s of e){let o=`{{${s.varName}}}`;i.url?.includes(s.value)&&(i.url=i.url.split(s.value).join(o),r[s.varName]=(r[s.varName]??0)+1);for(let l of i.headers??[]){let c=l.value.match(/^(bearer|basic|token|digest)\s+(.+)$/i);c&&c[2]===s.value?(l.value=`${c[1]} ${o}`,r[s.varName]=(r[s.varName]??0)+1):l.value===s.value&&(l.value=o,r[s.varName]=(r[s.varName]??0)+1)}for(let l of i.query??[])l.value===s.value&&(l.value=o,r[s.varName]=(r[s.varName]??0)+1)}}}var I5,O5,CC=le(()=>{"use strict";Ii();I5=new Set(["x-api-key","x-auth-token","x-access-token","x-token","x-secret","api-key","apikey","x-client-secret","x-rapidapi-key"]),O5=new Set(["api_key","apikey","api-key","access_token","token","auth_token","client_id","client_secret","key","secret"])});function Jr(t,e){let r={type:"string",description:t};return e.length>0&&(r.enum=[...e]),r}function Jy(t,e,r){let n=i=>Jr("Name of the collection to act on."+(i?"":" Optional."),e);return[{name:`${t}${G.listCollections}`,description:"List all available HTTP Forge collections (name, description, and request count). Call this first to discover what collections exist, then use list_folders, list_requests or run_* tools.",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${G.listFolders}`,description:"List all folders in a collection with their full paths and request counts. Use this before run_folder to discover the exact folder path string to pass.",inputSchema:{type:"object",properties:{collection:n(!0)},required:["collection"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.listRequests}`,description:"List the saved requests in a collection (name, HTTP method, folder, and description). Use this to find the exact request name before calling run_request. For large collections use the folder filter and offset/limit to page through results.",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:'Optional folder path to filter by (e.g. "Auth").'},offset:{type:"number",description:"Zero-based index to start from (default: 0)."},limit:{type:"number",description:"Maximum number of results to return (default: 50, max: 200)."}},required:["collection"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.searchRequests}`,description:"Search for requests across a collection by name, URL, method, or folder path. Returns matching requests with their folder location. Useful for large collections.",inputSchema:{type:"object",properties:{collection:n(!0),query:{type:"string",description:"Text to search for in request names, URLs, methods, and folder paths (case-insensitive)."}},required:["collection","query"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.getRequest}`,description:"Get the full details of a single saved request: URL, method, headers, body, auth, and scripts. Use this to inspect a request before editing it, or to read a script before rewriting it.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id. Use list_requests to find names."}},required:["collection","request"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.getEnvironment}`,description:"Show the current environment variable values (merged initial + runtime pm.environment.set overrides). Use this to inspect variable state before running a folder, or to debug {{variable}} resolution failures.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name to inspect (defaults to the currently selected environment)."}}},annotations:{readOnlyHint:!0}},{name:`${t}${G.setVariable}`,description:'Override an environment variable for the current session. In the VS Code extension the change is saved to VS Code workspace storage (survives restarts, but is not in the env JSON file and not source-controlled). In the standalone CLI/core runtime the change is in-memory only and lost when the server restarts. Use set_environment_variable with scope:"permanent" to write to the env JSON file (source-controlled, works in both runtimes).',inputSchema:{type:"object",properties:{key:{type:"string",description:"Variable name (the part inside {{...}})."},value:{type:"string",description:"New value to set."},environment:{type:"string",description:"Environment to update (defaults to the currently selected environment)."}},required:["key","value"]},annotations:{idempotentHint:!0}},{name:`${t}${G.getRunStatus}`,description:"Check whether an async run is still running, completed, or failed. Poll this after calling run_folder/run_collection/run_suite with async:true.",inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by an async run_* call."}},required:["runId"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.getRunSummary}`,description:'Get the pass/fail summary of a completed async run (total, passed, failed counts). Use after get_run_status shows "completed". When failures are present the response includes a failedRequests array with full details (method, url, requestBody, status, responseBody, failedTests) and a _nextStep directive. You MUST follow the _nextStep directive immediately \u2014 analyze the failures and provide diagnosis without waiting for the user to ask.',inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by an async run_* call."}},required:["runId"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.getFailedRequests}`,description:"Get the list of failed requests from a completed async run \u2014 the failures-first view. Never returns passing requests. Use this instead of get_run_summary when you need to see what broke.",inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by an async run_* call."},offset:{type:"number",description:"Zero-based index to start from (default: 0)."},limit:{type:"number",description:"Maximum failures to return (default: 20, max: 100)."}},required:["runId"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.getRequestResult}`,description:"Get the full result (status, body, assertions, console output) for one specific request from an async run. Use after get_failed_requests to drill into a single failure.",inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by an async run_* call."},request:{type:"string",description:"Name of the request to look up."},iteration:{type:"number",description:"Iteration number (default: 1)."}},required:["runId","request"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.cancelRun}`,description:'Request cancellation of an in-progress async run. Cancellation is best-effort: the currently-executing HTTP request completes normally, but no further requests in the run are started. The run status changes to "cancelled". Has no effect on runs that are already completed, failed, or cancelled.',inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by run_collection, run_folder, or run_suite with async:true."}},required:["runId"]},annotations:{idempotentHint:!0}},{name:`${t}${G.runRequest}`,description:"Run a single saved request. Pick the collection, then the request name within it.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Name of the request to run. Use list_requests or search_requests to find names."},requestId:{type:"string",description:'ID of the request (from list_requests/search_requests). Preferred over "request" name when available \u2014 avoids ambiguity with duplicate names.'},...qp.properties},required:["collection","request"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${G.runFolder}`,description:"Run every request inside a folder of a collection.",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:'Folder path within the collection (e.g. "Auth/Login").'},...Op.properties},required:["collection","folder"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${G.runCollection}`,description:"Run every request in a collection.",inputSchema:{type:"object",properties:{collection:n(!0),...Ip.properties},required:["collection"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${G.runSuite}`,description:"Run a saved test suite.",inputSchema:{type:"object",properties:{suite:Jr("Name of the test suite to run.",r),...Pp.properties},required:["suite"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${G.createCollection}`,description:"Create a new empty collection.",inputSchema:{type:"object",properties:{name:{type:"string",description:"Display name for the new collection."}},required:["name"]},annotations:{idempotentHint:!1}},{name:`${t}${G.renameCollection}`,description:"Rename an existing collection.",inputSchema:{type:"object",properties:{collection:n(!0),newName:{type:"string",description:"New display name for the collection."}},required:["collection","newName"]},annotations:{idempotentHint:!0}},{name:`${t}${G.deleteCollection}`,description:"Permanently delete a collection and all its contents. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{collection:n(!0),confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["collection","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${G.duplicateCollection}`,description:"Clone a collection under a new name (all folders, requests, and scripts are copied).",inputSchema:{type:"object",properties:{collection:n(!0),newName:{type:"string",description:"Name for the duplicated collection."}},required:["collection","newName"]},annotations:{idempotentHint:!1}},{name:`${t}${G.createFolder}`,description:"Create a folder inside a collection (optionally nested inside another folder).",inputSchema:{type:"object",properties:{collection:n(!0),name:{type:"string",description:"Display name for the new folder."},parentFolder:{type:"string",description:"Slash-separated folder path or folder id of the parent. Omit to create at collection root."}},required:["collection","name"]},annotations:{idempotentHint:!1}},{name:`${t}${G.deleteFolder}`,description:"Delete a folder and all its requests. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:"Slash-separated folder path or folder id to delete."},confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["collection","folder","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${G.createRequest}`,description:"Create a new HTTP request inside a collection (optionally inside a folder).",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:"Folder path or id. Omit to add at collection root."},name:{type:"string",description:"Display name for the request."},method:{type:"string",enum:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],description:"HTTP method."},url:{type:"string",description:"Request URL, may include {{variable}} placeholders."},headers:{type:"object",description:"Key/value header map.",additionalProperties:{type:"string"}},body:{type:"string",description:"Raw request body (JSON, text, etc.)."},description:{type:"string",description:"Human-readable description."}},required:["collection","name","method","url"]},annotations:{idempotentHint:!1}},{name:`${t}${G.updateRequest}`,description:"Update fields on an existing request (partial update \u2014 omit fields to keep current values).",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id."},name:{type:"string",description:"New display name."},method:{type:"string",enum:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]},url:{type:"string"},headers:{type:"object",additionalProperties:{type:"string"}},body:{type:"string"},description:{type:"string"}},required:["collection","request"]},annotations:{idempotentHint:!0}},{name:`${t}${G.deleteRequest}`,description:"Remove a request from a collection. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id to delete."},confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["collection","request","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${G.getRequestScript}`,description:"Read the pre-request or post-response script of a request.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id."},phase:{type:"string",enum:["pre-request","post-response"],description:"Which script phase to read."}},required:["collection","request","phase"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.setRequestScript}`,description:"Write or replace the pre-request or post-response script of a request.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id."},phase:{type:"string",enum:["pre-request","post-response"],description:"Which script phase to write."},script:{type:"string",description:"Full JavaScript source to write."}},required:["collection","request","phase","script"]},annotations:{idempotentHint:!0}},{name:`${t}${G.reorderCollectionItems}`,description:"Set the execution/display order of direct children of a collection root or folder. Items not listed are appended at the end.",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:"Folder path or id. Omit to reorder collection root."},order:{type:"array",items:{type:"string"},description:"Ordered list of item names or ids."}},required:["collection","order"]},annotations:{idempotentHint:!0}},{name:`${t}${G.listSuites}`,description:"List all test suites with name, id, request count, and configuration summary.",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${G.getSuite}`,description:"Get full details of a test suite including flow nodes (suite.nodes) and a flattened request list.",inputSchema:{type:"object",properties:{suite:Jr("Name or id of the test suite.",r)},required:["suite"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.createSuite}`,description:"Create a new test suite (empty, pre-populated from a collection/folder, or initialized with an explicit flow nodes graph).",inputSchema:{type:"object",properties:{name:{type:"string",description:"Display name for the new suite."},description:{type:"string",description:"Optional description."},fromCollection:{type:"string",description:"Collection name or id to seed the suite from (all requests in execution order)."},fromFolder:{type:"string",description:"Folder path within fromCollection to seed from."},nodes:{type:"array",items:{type:"object"},description:"Optional full suite.nodes graph. If provided, this becomes the suite flow definition."},iterations:{type:"number",description:"Number of iterations (default: 1)."},stopOnError:{type:"boolean",description:"Stop on first failure (default: false)."},delayBetweenRequests:{type:"number",description:"Milliseconds delay between requests (default: 0)."}},required:["name"]},annotations:{idempotentHint:!1}},{name:`${t}${G.updateSuiteConfig}`,description:"Change a suite's name/description/run configuration and optionally replace the full suite.nodes flow graph.",inputSchema:{type:"object",properties:{suite:Jr("Name or id of the suite to update.",r),name:{type:"string",description:"New display name."},description:{type:"string",description:"New description."},nodes:{type:"array",items:{type:"object"},description:"Optional full suite.nodes graph replacement."},iterations:{type:"number"},stopOnError:{type:"boolean"},delayBetweenRequests:{type:"number"}},required:["suite"]},annotations:{idempotentHint:!0}},{name:`${t}${G.getSuiteNode}`,description:'Get a single suite flow node by path (for example: "2.then.0" or "1.cases.0.nodes.1").',inputSchema:{type:"object",properties:{suite:Jr("Name or id of the suite.",r),path:{type:"string",description:"Node path to read (dot notation)."}},required:["suite","path"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.listSuiteNodePaths}`,description:"List all node paths and editable branch-array paths for a suite flow graph. Use before add/update/remove/move_suite_node.",inputSchema:{type:"object",properties:{suite:Jr("Name or id of the suite.",r),includeBranches:{type:"boolean",description:"Include branch-array paths (default: true)."}},required:["suite"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.addSuiteNode}`,description:"Add a flow node to a suite. Insert at root or into a branch array of a parent node.",inputSchema:{type:"object",properties:{suite:Jr("Name or id of the suite.",r),node:{type:"object",description:"Node object to insert (request/script/if/switch/for/while/block)."},parentPath:{type:"string",description:'Optional parent node path (for example: "2" or "1.cases.0"). Omit to insert at root.'},branch:{type:"string",description:'Branch array on parent node (for example: "nodes", "then", "else", "default", "cases.0.nodes"). Required when parentPath is provided.'},index:{type:"number",description:"Optional insertion index inside target array. Omit to append."}},required:["suite","node"]},annotations:{idempotentHint:!1}},{name:`${t}${G.updateSuiteNode}`,description:"Replace a flow node at a specific path in suite.nodes.",inputSchema:{type:"object",properties:{suite:Jr("Name or id of the suite.",r),path:{type:"string",description:'Node path to replace (for example: "0" or "2.then.1").'},node:{type:"object",description:"Full replacement node object."}},required:["suite","path","node"]},annotations:{idempotentHint:!0}},{name:`${t}${G.removeSuiteNode}`,description:"Remove a flow node at a specific path from suite.nodes.",inputSchema:{type:"object",properties:{suite:Jr("Name or id of the suite.",r),path:{type:"string",description:'Node path to remove (for example: "0" or "2.else.0").'}},required:["suite","path"]},annotations:{destructiveHint:!0}},{name:`${t}${G.moveSuiteNode}`,description:"Move a flow node from one path to another parent/branch/index within suite.nodes.",inputSchema:{type:"object",properties:{suite:Jr("Name or id of the suite.",r),fromPath:{type:"string",description:'Source node path (for example: "1.then.0").'},toParentPath:{type:"string",description:"Optional destination parent node path. Omit to move to root."},toBranch:{type:"string",description:"Destination branch array on parent node. Required when toParentPath is provided."},toIndex:{type:"number",description:"Optional destination index in target array. Omit to append."}},required:["suite","fromPath"]},annotations:{idempotentHint:!1}},{name:`${t}${G.addSuiteRequests}`,description:'Legacy compatibility helper. Add one or more request nodes at the suite root, using the same insertion semantics as add_suite_node with type:"request".',inputSchema:{type:"object",properties:{suite:Jr("Name or id of the suite.",r),requests:{type:"array",items:{type:"object",properties:{collection:{type:"string",description:"Collection name or id."},request:{type:"string",description:"Request name or id."}},required:["collection","request"]},description:"Requests to add."},insertAt:{type:"number",description:"Zero-based root nodes-array index to insert at. Omit to append at end."}},required:["suite","requests"]},annotations:{idempotentHint:!1}},{name:`${t}${G.removeSuiteRequest}`,description:"Remove a request from a request-only root suite by position (0-based) or by name. For flow suites, edit nodes via get_suite/update_suite_config.",inputSchema:{type:"object",properties:{suite:Jr("Name or id of the suite.",r),index:{type:"number",description:"Zero-based position in the suite requests list."},request:{type:"string",description:"Request name to remove (used if index is not provided)."}},required:["suite"]},annotations:{destructiveHint:!0}},{name:`${t}${G.reorderSuiteRequests}`,description:"Reorder requests in a request-only root suite. Requests not listed are moved to the end. For flow suites, edit nodes via get_suite/update_suite_config.",inputSchema:{type:"object",properties:{suite:Jr("Name or id of the suite.",r),order:{type:"array",items:{type:"string"},description:"Ordered list of request names."}},required:["suite","order"]},annotations:{idempotentHint:!0}},{name:`${t}${G.duplicateSuite}`,description:"Clone an existing suite under a new name.",inputSchema:{type:"object",properties:{suite:Jr("Name or id of the suite to clone.",r),newName:{type:"string",description:"Name for the duplicated suite."}},required:["suite","newName"]},annotations:{idempotentHint:!1}},{name:`${t}${G.deleteSuite}`,description:"Delete a test suite permanently. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{suite:Jr("Name or id of the suite to delete.",r),confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["suite","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${G.listEnvironments}`,description:"List all environments with their variable keys (values hidden). Use get_environment_variables to see values.",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${G.getEnvironmentVariables}`,description:"Get the resolved (merged file + session overrides) variables for an environment.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name (defaults to active environment)."}}},annotations:{readOnlyHint:!0}},{name:`${t}${G.selectEnvironment}`,description:"Set the active environment for all subsequent run_* calls in this session.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Name of the environment to activate."}},required:["environment"]},annotations:{idempotentHint:!0}},{name:`${t}${G.createEnvironment}`,description:"Create a new environment file, optionally pre-populated with variables.",inputSchema:{type:"object",properties:{name:{type:"string",description:"Environment name (becomes the filename)."},variables:{type:"object",description:"Initial key/value variable map.",additionalProperties:{type:"string"}}},required:["name"]},annotations:{idempotentHint:!1}},{name:`${t}${G.deleteEnvironment}`,description:"Delete an environment file permanently. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name to delete."},confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["environment","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${G.setEnvironmentVariable}`,description:'Set a variable in an environment. Scope "session" (default) is in-memory only and always temporary (both runtimes). Scope "permanent" writes to the env JSON config file \u2014 source-controlled and shared with the CLI runtime.',inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name (defaults to active environment)."},key:{type:"string",description:"Variable name."},value:{type:"string",description:"New value."},scope:{type:"string",enum:["session","permanent"],description:'Storage scope. "permanent" writes to disk.'}},required:["key","value"]},annotations:{idempotentHint:!0}},{name:`${t}${G.unsetEnvironmentVariable}`,description:"Remove a session-scoped variable override, restoring the file value.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name (defaults to active environment)."},key:{type:"string",description:"Variable name to unset."}},required:["key"]},annotations:{idempotentHint:!0}},{name:`${t}${G.setGlobalVariable}`,description:'Set a global variable visible across all environments. Scope "session" (default) is in-memory only and lost on restart (both runtimes). Scope "permanent" writes to _global.json \u2014 source-controlled and shared with the CLI runtime.',inputSchema:{type:"object",properties:{key:{type:"string",description:"Global variable name."},value:{type:"string",description:"Value to set."},scope:{type:"string",enum:["session","permanent"],description:'Storage scope. "permanent" writes to _global.json.'}},required:["key","value"]},annotations:{idempotentHint:!0}},{name:`${t}${G.getGlobals}`,description:"Return all global variables (merged _global.json + runtime pm.globals.set() values).",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${G.scaffoldCollectionFromOpenApi}`,description:"Import an OpenAPI 3.0 spec (JSON or YAML) and scaffold a complete HTTP Forge collection from it. All operations become requests grouped by tag/path. An optional environment is created from the server URL. Returns the new collection id and name. Use this to quickly bootstrap API testing from a spec file.",inputSchema:{type:"object",properties:{specPath:{type:"string",description:"Absolute or workspace-relative path to the OpenAPI 3.0 JSON or YAML file."},collectionName:{type:"string",description:"Override the collection name (defaults to the spec title)."},environmentName:{type:"string",description:"Name for the generated environment that contains the server base URL. Omit to skip environment creation."}},required:["specPath"]},annotations:{idempotentHint:!1}},{name:`${t}${G.suggestAssertions}`,description:"Analyse the last execution history for a request and suggest pm.test() assertions to add to its post-response script. Covers status code, response time, required JSON fields, Content-Type header, and schema conformance. Returns an array of ready-to-paste JavaScript test snippets and a rationale for each.",inputSchema:{type:"object",properties:{collection:{type:"string",description:"Collection name or id that owns the request."},request:{type:"string",description:"Request name or id to analyse."},environment:{type:"string",description:"Environment used when the run was recorded (defaults to active environment)."},maxSuggestions:{type:"number",description:"Cap the number of suggestions returned (default: 10)."}},required:["collection","request"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.explainFailure}`,description:"Explain why a specific request failed in a recent run. Returns the full request (URL, method, headers, body), the response received (status, headers, body), all assertion results, any script errors, and a plain-English diagnosis with suggested fixes. Provide either runId (from a prior run_suite/run_collection call) + request name, or the collection and request names to pull the most recent history entry.",inputSchema:{type:"object",properties:{runId:{type:"string",description:"MCP run id (from run_suite or run_collection). Mutually exclusive with collection+request history lookup."},collection:{type:"string",description:"Collection name or id. Required when runId is omitted."},request:{type:"string",description:"Request name or id."},iteration:{type:"number",description:"Iteration number within the run (default: 1)."}}},annotations:{readOnlyHint:!0}},{name:`${t}${G.suggestEnvVars}`,description:`Scan a collection for hardcoded values (API keys, base URLs, tokens, tenant IDs) that should become environment variables.
|
|
279
|
+
`)}`));if(!("location"in i.headers)||!i.headers.location)throw(0,My.ono)({status:i.status},`HTTP ${i.status} redirect with no location header`);{let s=dp.resolve(t.href,i.headers.location);return P1(s,e,n)}}else{if(i.body){let s=await i.arrayBuffer();return Buffer.from(s)}return Buffer.alloc(0)}}catch(i){throw new O1.ResolverError((0,My.ono)(i,`Error downloading ${t.href}`),t.href)}}async function F8(t,e){let r,n;e.timeout&&(r=new AbortController,n=setTimeout(()=>r.abort(),e.timeout));let i=await fetch(t,{method:"GET",headers:e.headers||{},credentials:e.withCredentials?"include":"same-origin",signal:r?r.signal:null});return n&&clearTimeout(n),i}});var eC=V(Us=>{"use strict";var Pc=Us&&Us.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Us,"__esModule",{value:!0});Us.getNewOptions=Us.getJsonSchemaRefParserDefaultOptions=void 0;var D8=Pc(i$()),j8=Pc(_1()),L8=Pc(R1()),U8=Pc(x1()),H8=Pc(I1()),B8=Pc(k1()),V8=()=>({parse:{json:{...D8.default},yaml:{...j8.default},text:{...L8.default},binary:{...U8.default}},resolve:{file:{...H8.default},http:{...B8.default},external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative"},mutateInputSchema:!0});Us.getJsonSchemaRefParserDefaultOptions=V8;var W8=t=>{let e=(0,Us.getJsonSchemaRefParserDefaultOptions)();return t&&T1(e,t),e};Us.getNewOptions=W8;function T1(t,e){if(A1(e)){let r=Object.keys(e).filter(n=>!["__proto__","constructor","prototype"].includes(n));for(let n=0;n<r.length;n++){let i=r[n],s=e[i],o=t[i];A1(s)?t[i]=T1(o||{},s):s!==void 0&&(t[i]=s)}}return t}function A1(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}});var N1=V(Fy=>{"use strict";Object.defineProperty(Fy,"__esModule",{value:!0});Fy.normalizeArgs=$1;var z8=eC();function $1(t){let e,r,n,i,s=Array.prototype.slice.call(t);typeof s[s.length-1]=="function"&&(i=s.pop()),typeof s[0]=="string"?(e=s[0],typeof s[2]=="object"?(r=s[1],n=s[2]):(r=void 0,n=s[1])):(e="",r=s[0],n=s[1]);try{n=(0,z8.getNewOptions)(n)}catch(o){console.error(`JSON Schema Ref Parser: Error normalizing options: ${o}`)}return!n.mutateInputSchema&&typeof r=="object"&&(r=JSON.parse(JSON.stringify(r))),{path:e,schema:r,options:n,callback:i}}Fy.default=$1});var M1=V(xi=>{"use strict";var J8=xi&&xi.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),G8=xi&&xi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Y8=xi&&xi.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&J8(r,e,n[i]);return G8(r,e),r}})(),tC=xi&&xi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xi,"__esModule",{value:!0});var K8=tC(_c()),Q8=tC(tp()),Z8=tC(yx()),kc=Y8(Gn()),X8=Yn();function e5(t,e){if(!e.resolve?.external)return Promise.resolve();try{let r=rC(t.schema,t.$refs._root$Ref.path+"#",t.$refs,e);return Promise.all(r)}catch(r){return Promise.reject(r)}}function rC(t,e,r,n,i,s){i||(i=new Set);let o=[];if(t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!i.has(t)){i.add(t),K8.default.isExternal$Ref(t)&&o.push(t5(t,e,r,n));let l=Object.keys(t);for(let c of l){let d=Q8.default.join(e,c),p=t[c];o=o.concat(rC(p,d,r,n,i,s))}}return o}async function t5(t,e,r,n){let i=n.dereference?.externalReferenceResolution==="root",s=kc.resolve(i?kc.cwd():e,t.$ref),o=kc.stripHash(s),l=r._$refs[o];if(l)return Promise.resolve(l.value);try{let c=await(0,Z8.default)(s,r,n),d=rC(c,o+"#",r,n,new Set,!0);return Promise.all(d)}catch(c){if(!n?.continueOnError||!(0,X8.isHandledError)(c))throw c;return r._$refs[o]&&(c.source=decodeURI(kc.stripHash(e)),c.path=kc.safePointerToPath(kc.getHash(e))),[]}}xi.default=e5});var j1=V(Ci=>{"use strict";var r5=Ci&&Ci.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),n5=Ci&&Ci.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),i5=Ci&&Ci.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&r5(r,e,n[i]);return n5(r,e),r}})(),D1=Ci&&Ci.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ci,"__esModule",{value:!0});var Dy=D1(_c()),pp=D1(tp()),nC=i5(Gn());function s5(t,e){let r=[];iC(t,"schema",t.$refs._root$Ref.path+"#","#",0,r,t.$refs,e),o5(r)}function iC(t,e,r,n,i,s,o,l){let c=e===null?t:t[e];if(c&&typeof c=="object"&&!ArrayBuffer.isView(c))if(Dy.default.isAllowed$Ref(c))F1(t,e,r,n,i,s,o,l);else{let d=Object.keys(c).sort((p,m)=>p==="definitions"?-1:m==="definitions"?1:p.length-m.length);for(let p of d){let m=pp.default.join(r,p),y=pp.default.join(n,p),b=c[p];Dy.default.isAllowed$Ref(b)?F1(c,p,r,y,i,s,o,l):iC(c,p,m,y,i,s,o,l)}}}function F1(t,e,r,n,i,s,o,l){let c=e===null?t:t[e],d=nC.resolve(r,c.$ref),p=o._resolve(d,n,l);if(p===null)return;let y=pp.default.parse(n).length,b=nC.stripHash(p.path),q=nC.getHash(p.path),x=b!==o._root$Ref.path,v=Dy.default.isExtended$Ref(c);i+=p.indirections;let R=a5(s,t,e);if(R)if(y<R.depth||i<R.indirections)l5(s,R);else return;s.push({$ref:c,parent:t,key:e,pathFromRoot:n,depth:y,file:b,hash:q,value:p.value,circular:p.circular,extended:v,external:x,indirections:i}),(!R||x)&&iC(p.value,null,p.path,n,i+1,s,o,l)}function o5(t){t.sort((i,s)=>{if(i.file!==s.file)return i.file<s.file?-1:1;if(i.hash!==s.hash)return i.hash<s.hash?-1:1;if(i.circular!==s.circular)return i.circular?-1:1;if(i.extended!==s.extended)return i.extended?1:-1;if(i.indirections!==s.indirections)return i.indirections-s.indirections;if(i.depth!==s.depth)return i.depth-s.depth;{let o=i.pathFromRoot.lastIndexOf("/definitions"),l=s.pathFromRoot.lastIndexOf("/definitions");return o!==l?l-o:i.pathFromRoot.length-s.pathFromRoot.length}});let e,r,n;for(let i of t)i.external?i.file===e&&i.hash===r?i.$ref.$ref=n:i.file===e&&i.hash.indexOf(r+"/")===0?i.$ref.$ref=pp.default.join(n,pp.default.parse(i.hash.replace(r,"#"))):(e=i.file,r=i.hash,n=i.pathFromRoot,i.$ref=i.parent[i.key]=Dy.default.dereference(i.$ref,i.value),i.circular&&(i.$ref.$ref=i.pathFromRoot)):i.$ref.$ref=i.hash}function a5(t,e,r){for(let n of t)if(n&&n.parent===e&&n.key===r)return n}function l5(t,e){let r=t.indexOf(e);t.splice(r,1)}Ci.default=s5});var W1=V(Ei=>{"use strict";var u5=Ei&&Ei.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),c5=Ei&&Ei.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),f5=Ei&&Ei.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&u5(r,e,n[i]);return c5(r,e),r}})(),B1=Ei&&Ei.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ei,"__esModule",{value:!0});var jy=B1(_c()),L1=B1(tp()),d5=Bo(),U1=f5(Gn()),p5=Yn();Ei.default=h5;function h5(t,e){let r=Date.now(),n=sC(t.schema,t.$refs._root$Ref.path,"#",new Set,new Set,new Map,t.$refs,e,r);t.$refs.circular=n.circular,t.schema=n.value}function sC(t,e,r,n,i,s,o,l,c){let d,p={value:t,circular:!1};if(l&&l.timeoutMs&&Date.now()-c>l.timeoutMs)throw new p5.TimeoutError(l.timeoutMs);let m=l.dereference||{},y=m.excludedPathMatcher||(()=>!1);if((m?.circular==="ignore"||!i.has(t))&&t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!y(r)){if(n.add(t),i.add(t),jy.default.isAllowed$Ref(t,l))d=H1(t,e,r,n,i,s,o,l,c),p.circular=d.circular,p.value=d.value;else for(let b of Object.keys(t)){let q=L1.default.join(e,b),x=L1.default.join(r,b);if(y(x))continue;let v=t[b],R=!1;if(jy.default.isAllowed$Ref(v,l)){if(d=H1(v,q,x,n,i,s,o,l,c),R=d.circular,t[b]!==d.value){let E=new Map;m?.preservedProperties&&typeof t[b]=="object"&&!Array.isArray(t[b])&&m?.preservedProperties.forEach(k=>{k in t[b]&&E.set(k,t[b][k])}),t[b]=d.value,m?.preservedProperties&&E.size&&typeof t[b]=="object"&&!Array.isArray(t[b])&&E.forEach((k,P)=>{t[b][P]=k}),m?.onDereference?.(v.$ref,t[b],t,b)}}else n.has(v)?R=V1(q,o,l):(d=sC(v,q,x,n,i,s,o,l,c),R=d.circular,t[b]!==d.value&&(t[b]=d.value));p.circular=p.circular||R}n.delete(t)}return p}function H1(t,e,r,n,i,s,o,l,c){let p=jy.default.isExternal$Ref(t)&&l?.dereference?.externalReferenceResolution==="root",m=U1.resolve(p?U1.cwd():e,t.$ref),y=s.get(m);if(y&&!y.circular){let E=Object.keys(t);if(E.length>1){let k={};for(let P of E)P!=="$ref"&&!(P in y.value)&&(k[P]=t[P]);return{circular:y.circular,value:Object.assign({},y.value,k)}}return y}let b=o._resolve(m,e,l);if(b===null)return{circular:!1,value:null};let q=b.circular,x=q||n.has(b.value);x&&V1(e,o,l);let v=jy.default.dereference(t,b.value);if(!x){let E=sC(v,b.path,r,n,i,s,o,l,c);x=E.circular,v=E.value}x&&!q&&l.dereference?.circular==="ignore"&&(v=t),q&&(v.$ref=r);let R={circular:x,value:v};return Object.keys(t).length===1&&s.set(m,R),R}function V1(t,e,r){if(e.circular=!0,r?.dereference?.onCircular?.(t),!r.dereference.circular)throw d5.ono.reference(`Circular $ref pointer found at ${t}`);return!0}});var z1=V(oC=>{"use strict";Object.defineProperty(oC,"__esModule",{value:!0});function m5(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(e){setTimeout(e,0)}}oC.default=m5()});var G1=V(hp=>{"use strict";var g5=hp&&hp.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hp,"__esModule",{value:!0});hp.default=y5;var J1=g5(z1());function y5(t,e){if(t){e.then(function(r){(0,J1.default)(function(){t(null,r)})},function(r){(0,J1.default)(function(){t(r)})});return}else return e}});var Z1=V(Ae=>{"use strict";var v5=Ae&&Ae.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),b5=Ae&&Ae.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),S5=Ae&&Ae.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&v5(r,e,n[i]);return b5(r,e),r}})(),hl=Ae&&Ae.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.getJsonSchemaRefParserDefaultOptions=Ae.jsonSchemaParserNormalizeArgs=Ae.dereferenceInternal=Ae.JSONParserErrorGroup=Ae.isHandledError=Ae.UnmatchedParserError=Ae.ParserError=Ae.ResolverError=Ae.MissingPointerError=Ae.InvalidPointerError=Ae.JSONParserError=Ae.UnmatchedResolverError=Ae.dereference=Ae.bundle=Ae.resolve=Ae.parse=Ae.$RefParser=void 0;var Y1=hl(XT()),w5=hl(yx()),mp=hl(N1());Ae.jsonSchemaParserNormalizeArgs=mp.default;var _5=hl(M1()),R5=hl(j1()),Q1=hl(W1());Ae.dereferenceInternal=Q1.default;var pl=S5(Gn()),Kn=Yn();Object.defineProperty(Ae,"JSONParserError",{enumerable:!0,get:function(){return Kn.JSONParserError}});Object.defineProperty(Ae,"InvalidPointerError",{enumerable:!0,get:function(){return Kn.InvalidPointerError}});Object.defineProperty(Ae,"MissingPointerError",{enumerable:!0,get:function(){return Kn.MissingPointerError}});Object.defineProperty(Ae,"ResolverError",{enumerable:!0,get:function(){return Kn.ResolverError}});Object.defineProperty(Ae,"ParserError",{enumerable:!0,get:function(){return Kn.ParserError}});Object.defineProperty(Ae,"UnmatchedParserError",{enumerable:!0,get:function(){return Kn.UnmatchedParserError}});Object.defineProperty(Ae,"UnmatchedResolverError",{enumerable:!0,get:function(){return Kn.UnmatchedResolverError}});Object.defineProperty(Ae,"isHandledError",{enumerable:!0,get:function(){return Kn.isHandledError}});Object.defineProperty(Ae,"JSONParserErrorGroup",{enumerable:!0,get:function(){return Kn.JSONParserErrorGroup}});var K1=Bo(),qi=hl(G1()),x5=eC();Object.defineProperty(Ae,"getJsonSchemaRefParserDefaultOptions",{enumerable:!0,get:function(){return x5.getJsonSchemaRefParserDefaultOptions}});var Jo=class t{constructor(){this.schema=null,this.$refs=new Y1.default}async parse(){let e=(0,mp.default)(arguments),r;if(!e.path&&!e.schema){let i=(0,K1.ono)(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return(0,qi.default)(e.callback,Promise.reject(i))}this.schema=null,this.$refs=new Y1.default;let n="http";if(pl.isFileSystemPath(e.path))e.path=pl.fromFileSystemPath(e.path),n="file";else if(!e.path&&e.schema&&"$id"in e.schema&&e.schema.$id){let i=pl.parse(e.schema.$id),s=i.protocol==="https:"?443:80;e.path=`${i.protocol}//${i.hostname}:${s}`}if(e.path=pl.resolve(pl.cwd(),e.path),e.schema&&typeof e.schema=="object"){let i=this.$refs._add(e.path);i.value=e.schema,i.pathType=n,r=Promise.resolve(e.schema)}else r=(0,w5.default)(e.path,this.$refs,e.options);try{let i=await r;if(i!==null&&typeof i=="object"&&!Buffer.isBuffer(i))return this.schema=i,(0,qi.default)(e.callback,Promise.resolve(this.schema));if(e.options.continueOnError)return this.schema=null,(0,qi.default)(e.callback,Promise.resolve(this.schema));throw K1.ono.syntax(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(i){return!e.options.continueOnError||!(0,Kn.isHandledError)(i)?(0,qi.default)(e.callback,Promise.reject(i)):(this.$refs._$refs[pl.stripHash(e.path)]&&this.$refs._$refs[pl.stripHash(e.path)].addError(i),(0,qi.default)(e.callback,Promise.resolve(null)))}}static parse(){let e=new t;return e.parse.apply(e,arguments)}async resolve(){let e=(0,mp.default)(arguments);try{return await this.parse(e.path,e.schema,e.options),await(0,_5.default)(this,e.options),aC(this),(0,qi.default)(e.callback,Promise.resolve(this.$refs))}catch(r){return(0,qi.default)(e.callback,Promise.reject(r))}}static resolve(){let e=new t;return e.resolve.apply(e,arguments)}static bundle(){let e=new t;return e.bundle.apply(e,arguments)}async bundle(){let e=(0,mp.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,R5.default)(this,e.options),aC(this),(0,qi.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,qi.default)(e.callback,Promise.reject(r))}}static dereference(){let e=new t;return e.dereference.apply(e,arguments)}async dereference(){let e=(0,mp.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,Q1.default)(this,e.options),aC(this),(0,qi.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,qi.default)(e.callback,Promise.reject(r))}}};Ae.$RefParser=Jo;Ae.default=Jo;function aC(t){if(Kn.JSONParserErrorGroup.getParserErrors(t).length>0)throw new Kn.JSONParserErrorGroup(t)}Ae.parse=Jo.parse;Ae.resolve=Jo.resolve;Ae.bundle=Jo.bundle;Ae.dereference=Jo.dereference});var Ly,ml,lC=le(()=>{"use strict";Ly=ve(Z1()),ml=class{async resolve(e){try{return await Ly.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){return console.error("[RefResolver] Failed to fully resolve $ref pointers:",r),e}}async bundle(e){try{return await Ly.default.bundle(e)}catch(r){return console.error("[RefResolver] Failed to bundle $ref pointers:",r),e}}async resolveFile(e){try{return await Ly.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){throw console.error(`[RefResolver] Failed to resolve file ${e}:`,r),r}}}});var X1,eN,C5,Hs,Uy=le(()=>{"use strict";X1=ve(require("fs")),eN=ve(Xd());Un();GR();lC();C5=["application/json","text/plain","text/html","multipart/form-data","application/x-www-form-urlencoded"],Hs=class{constructor(e,r){this.collectionService=e;this.envConfigService=r;this.exampleGenerator=new al,this.refResolver=new ml}collectionService;envConfigService;exampleGenerator;refResolver;async import(e,r){let n=await X1.promises.readFile(e,"utf-8"),i;e.endsWith(".yaml")||e.endsWith(".yml")?i=eN.parse(n):i=JSON.parse(n),i=await this.refResolver.resolve(i);let s=i.components?.schemas||{},o=r?.collectionName||i.info?.title||"Imported API",c={id:It(o),name:o,description:i.info?.description||"",version:i.info?.version||"1.0.0",variables:{},items:[]};if(i.servers&&i.servers.length>0&&(c.variables.baseUrl=i.servers[0].url),i.security&&i.security.length>0&&i.components?.securitySchemes){let m=this.mapSecurityToAuth(i.security[0],i.components.securitySchemes);m&&(c.auth=m)}let d=new Map;if(i.tags)for(let m of i.tags){let y={type:"folder",id:It(m.name),name:m.name,description:m.description,items:[]};d.set(m.name,y),c.items.push(y)}if(i.paths)for(let[m,y]of Object.entries(i.paths))for(let b of["get","post","put","patch","delete","head","options","trace"]){let q=y[b];if(!q)continue;let x=this.processOperation(b,m,q,y,i,s),v=q.tags?.[0];if(v&&d.has(v))d.get(v).items.push(x);else if(v){let R={type:"folder",id:It(v),name:v,items:[x]};d.set(v,R),c.items.push(R)}else c.items.push(x)}await this.collectionService.saveCollection(c);let p;return r?.environmentName&&i.servers&&(p=await this.createEnvironmentFromServers(i.servers,r.environmentName)),{collection:c,environmentCreated:p}}processOperation(e,r,n,i,s,o){let l=It(n.operationId||`${e}-${r}`),c=`{{baseUrl}}${this.convertPathParams(r)}`,d=n.summary||n.operationId||`${e.toUpperCase()} ${r}`,p=n.deprecated===!0;p&&(d=`[DEPRECATED] ${d}`);let m={type:"request",id:l,name:d,method:e.toUpperCase(),url:c,description:n.description||"",deprecated:p},y=[...i.parameters||[],...n.parameters||[]];if(this.processParameters(m,y,o),n.requestBody&&this.processRequestBody(m,n.requestBody,o),n.responses&&(m.responseSchema=this.processResponses(n.responses,o)),n.security!==void 0&&s.components?.securitySchemes){if(Array.isArray(n.security)&&n.security.length===0)m.auth={type:"none"};else if(n.security&&n.security.length>0){let b=this.mapSecurityToAuth(n.security[0],s.components.securitySchemes);b&&(m.auth=b)}}return m}convertPathParams(e){return e.replace(/\{(\w+)\}/g,":$1")}processParameters(e,r,n){let i=[],s=[],o={},l=[];for(let c of r){let d=c.name,p=c.in,m=c.schema||{},y=c.example!==void 0?String(c.example):this.generateExampleForParam(m,n),b=c.deprecated===!0;switch(p){case"path":{if(c.description||m.type||m.format||m.enum||b||m.pattern||m.minimum!==void 0||m.maximum!==void 0||m.minLength!==void 0||m.maxLength!==void 0||m.multipleOf!==void 0||m.minItems!==void 0||m.maxItems!==void 0||m.uniqueItems||m.nullable||m.oneOf){let x={value:y};m.oneOf?(x.oneOf=m.oneOf,this.applyOneOfHints(x,m.oneOf)):(m.type&&(x.type=m.type),m.format&&(x.format=m.format),m.enum&&(x.enum=m.enum.map(String)),m.pattern&&(x.pattern=m.pattern),m.minimum!==void 0&&(x.minimum=m.minimum),m.maximum!==void 0&&(x.maximum=m.maximum),m.exclusiveMinimum!==void 0&&(x.exclusiveMinimum=m.exclusiveMinimum),m.exclusiveMaximum!==void 0&&(x.exclusiveMaximum=m.exclusiveMaximum),m.multipleOf!==void 0&&(x.multipleOf=m.multipleOf),m.minLength!==void 0&&(x.minLength=m.minLength),m.maxLength!==void 0&&(x.maxLength=m.maxLength),m.minItems!==void 0&&(x.minItems=m.minItems),m.maxItems!==void 0&&(x.maxItems=m.maxItems),m.uniqueItems&&(x.uniqueItems=!0),m.nullable&&(x.nullable=!0)),c.description&&(x.description=c.description),b&&(x.deprecated=!0),o[d]=x}else o[d]=y;break}case"query":{let q={key:d,value:y};this.applySchemaConstraints(q,m,c,b),s.push(q);break}case"header":{let q={key:d,value:y};this.applySchemaConstraints(q,m,c,b),i.push(q);break}case"cookie":{l.push(`${d}={{${d}}}`);break}}}l.length>0&&i.push({key:"Cookie",value:l.join("; ")}),Object.keys(o).length>0&&(e.params=o),s.length>0&&(e.query=s),i.length>0&&(e.headers=i)}applySchemaConstraints(e,r,n,i){r.oneOf?(e.oneOf=r.oneOf,this.applyOneOfHints(e,r.oneOf)):(r.type&&(e.type=r.type),r.format&&(e.format=r.format),r.enum&&(e.enum=r.enum.map(String)),r.pattern&&(e.pattern=r.pattern),r.minimum!==void 0&&(e.minimum=r.minimum),r.maximum!==void 0&&(e.maximum=r.maximum),r.exclusiveMinimum!==void 0&&(e.exclusiveMinimum=r.exclusiveMinimum),r.exclusiveMaximum!==void 0&&(e.exclusiveMaximum=r.exclusiveMaximum),r.multipleOf!==void 0&&(e.multipleOf=r.multipleOf),r.minLength!==void 0&&(e.minLength=r.minLength),r.maxLength!==void 0&&(e.maxLength=r.maxLength),r.minItems!==void 0&&(e.minItems=r.minItems),r.maxItems!==void 0&&(e.maxItems=r.maxItems),r.uniqueItems&&(e.uniqueItems=!0),r.nullable&&(e.nullable=!0)),n.required&&(e.required=!0),n.description&&(e.description=n.description),i&&(e.deprecated=!0)}applyOneOfHints(e,r){let n=[],i=new Set;for(let s of r)s.type&&i.add(s.type),s.enum&&n.push(...s.enum.map(String));i.size===1&&(e.type=[...i][0]),n.length>0&&(e.enum=[...new Set(n)])}generateExampleForParam(e,r){if(!e)return"";let n=this.exampleGenerator.generate(e,{components:r});return n==null?"":String(n)}processRequestBody(e,r,n){if(!r.content)return;let i=Object.keys(r.content);if(i.length===0)return;let s=this.selectPrimaryContentType(i),o=r.content[s],{bodyType:l,bodyFormat:c}=this.mapContentTypeToBodyType(s);if(e.body={type:l,...c&&{format:c},content:""},o){let p=this.generateBodyContent(o,s,n);p!==void 0&&(e.body.content=typeof p=="string"?p:JSON.stringify(p,null,2)),l==="form-data"&&o.schema?.properties&&(e.body.content=this.buildFormDataEntries(o.schema,n)),l==="x-www-form-urlencoded"&&o.schema?.properties&&(e.body.content=this.buildFormDataEntries(o.schema,n))}let d=this.buildBodySchema(r,s,n);d&&(e.bodySchema=d)}selectPrimaryContentType(e){for(let i of C5)if(e.includes(i))return i;let r=e.find(i=>i.includes("json"));if(r)return r;let n=e.find(i=>i.startsWith("text/"));return n||e[0]}mapContentTypeToBodyType(e){return e.includes("json")?{bodyType:"raw",bodyFormat:"json"}:e==="application/xml"||e==="text/xml"?{bodyType:"raw",bodyFormat:"xml"}:e==="text/html"?{bodyType:"raw",bodyFormat:"html"}:e.startsWith("text/")?{bodyType:"raw",bodyFormat:"text"}:e==="multipart/form-data"?{bodyType:"form-data"}:e==="application/x-www-form-urlencoded"?{bodyType:"x-www-form-urlencoded"}:e==="application/octet-stream"?{bodyType:"binary"}:{bodyType:"raw",bodyFormat:"text"}}generateBodyContent(e,r,n){if(e.example!==void 0)return e.example;if(e.examples){let i=Object.values(e.examples)[0];if(i?.value!==void 0)return i.value}if(e.schema)return this.exampleGenerator.generate(e.schema,{omitReadOnly:!0,components:n})}buildFormDataEntries(e,r){let n=[],i=e.properties||{},s=new Set(e.required||[]);for(let[o,l]of Object.entries(i)){let c=l,d=c.type==="string"&&c.format==="binary",p={key:o,value:d?"":String(this.exampleGenerator.generate(c,{components:r})||""),type:d?"file":"text",enabled:!0};n.push(p)}return n}buildBodySchema(e,r,n){let i=Object.keys(e.content),s=e.content[r];if(!s?.schema)return;let o={contentType:r,schema:s.schema};if(i.length>1){o.content={};for(let c of i){let d=e.content[c],p={};d.schema&&(p.schema=d.schema),d.examples&&(p.examples=d.examples),d.encoding&&(p.encoding=d.encoding),o.content[c]=p}}s.encoding&&(o.encoding=s.encoding);let l=this.extractUsedComponents(s.schema,n);return Object.keys(l).length>0&&(o.components=l),o}processResponses(e,r){let n={responses:{}},i={};for(let[s,o]of Object.entries(e)){let l=o,c={description:l.description||`Status ${s}`};if(l.content){let d=Object.keys(l.content);if(d.length===1){let p=d[0],m=l.content[p];c.contentType=p,m.schema&&(c.schema=m.schema),m.examples&&(c.examples=m.examples),m.schema&&Object.assign(i,this.extractUsedComponents(m.schema,r))}else{c.content={};for(let p of d){let m=l.content[p],y={};m.schema&&(y.schema=m.schema),m.examples&&(y.examples=m.examples),c.content[p]=y,m.schema&&Object.assign(i,this.extractUsedComponents(m.schema,r))}}}if(l.headers){c.headers={};for(let[d,p]of Object.entries(l.headers)){let m=p;c.headers[d]={...m.description&&{description:m.description},schema:m.schema||{type:"string"}}}}n.responses[s]=c}return Object.keys(i).length>0&&(n.components=i),n}mapSecurityToAuth(e,r){let n=Object.keys(e)[0];if(!n)return;let i=r[n];if(i)switch(i.type){case"http":if(i.scheme==="bearer")return{type:"bearer",bearerToken:""};if(i.scheme==="basic")return{type:"basic",basicAuth:{username:"",password:""}};break;case"apiKey":return{type:"apikey",apikey:{key:i.name||"X-Api-Key",value:"",in:i.in||"header"}};case"oauth2":{let s=i.flows||{},o=s.authorizationCode||s.clientCredentials||s.password||s.implicit||{},l="client_credentials";return s.authorizationCode?l="authorization_code":s.password?l="password":s.implicit&&(l="implicit"),{type:"oauth2",oauth2:{grantType:l,tokenUrl:o.tokenUrl||"",authUrl:o.authorizationUrl||"",clientId:"",clientSecret:"",scope:Object.keys(o.scopes||{}).join(" ")}}}}}async createEnvironmentFromServers(e,r){if(e.length>0){let n=e[0].url;this.envConfigService.setEnvironmentVariable("baseUrl",n)}return r}extractUsedComponents(e,r,n){let i=n||{};if(!e)return i;if(e.$ref){let s=this.extractRefName(e.$ref);s&&r[s]&&!i[s]&&(i[s]=r[s],this.extractUsedComponents(r[s],r,i))}if(e.properties)for(let s of Object.values(e.properties))this.extractUsedComponents(s,r,i);e.items&&this.extractUsedComponents(e.items,r,i);for(let s of["allOf","oneOf","anyOf"])if(e[s])for(let o of e[s])this.extractUsedComponents(o,r,i);return e.additionalProperties&&typeof e.additionalProperties=="object"&&this.extractUsedComponents(e.additionalProperties,r,i),i}extractRefName(e){return e.match(/^#\/components\/schemas\/(.+)$/)?.[1]}}});var gl,uC=le(()=>{"use strict";gl=class{constructor(e,r,n){this.historyAnalyzer=e;this.scriptAnalyzer=r;this.inferrer=n}historyAnalyzer;scriptAnalyzer;inferrer;async infer(e,r,n,i){let s=await this.historyAnalyzer.analyze(e,r,{environment:i?.environment}),o;return i?.postResponseScript&&(o=this.scriptAnalyzer.analyze(i.postResponseScript)),this.mergeResponseSchemas(n,s,o)}async inferBodySchema(e,r,n,i,s){let o,l;if(r==="raw"&&n==="json"&&e){let c=e;if(typeof e=="string")try{c=JSON.parse(e)}catch{return}o=this.inferrer.inferFromValue(c),l="application/json"}else r==="form-data"&&i?(o=this.buildFormDataSchema(i),l="multipart/form-data"):r==="x-www-form-urlencoded"&&i?(o=this.buildFormDataSchema(i),l="application/x-www-form-urlencoded"):r==="raw"&&n==="xml"?(o={type:"string"},l="application/xml"):r==="raw"&&(n==="text"||n==="html")?(o={type:"string"},l=n==="html"?"text/html":"text/plain"):r==="binary"?(o={type:"string",format:"binary"},l="application/octet-stream"):r==="graphql"&&(o={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},l="application/json");if(o)return s?this.mergeBodySchemaWithExisting(o,s):{contentType:l,schema:o}}buildFormDataSchema(e){let r={type:"object",properties:{}},n=[];for(let i of e){if(!i.enabled&&i.enabled!==void 0)continue;let s={};i.type?s.type=i.type:s.type="string",i.description&&(s.description=i.description),i.format&&(s.format=i.format),i.enum&&(s.enum=i.enum),i.type==="file"&&(s.type="string",s.format="binary"),r.properties[i.key]=s,i.required&&n.push(i.key)}return n.length>0&&(r.required=n),r}mergeResponseSchemas(e,r,n){let i={responses:{}};for(let[s,o]of Object.entries(r.responses))i.responses[s]={...o};if(n&&this.applyScriptHints(i,n),e){for(let[s,o]of Object.entries(e.responses))i.responses[s]?i.responses[s]=this.mergeResponseDefinitions(i.responses[s],o):i.responses[s]={...o};e.components&&(i.components={...e.components})}return i}applyScriptHints(e,r){for(let n of r.expectedStatuses){let i=String(n);e.responses[i]||(e.responses[i]={description:`Status ${n}`})}for(let[,n]of Object.entries(e.responses))n.schema&&this.augmentSchemaWithHints(n.schema,r)}augmentSchemaWithHints(e,r){if(!(e.type!=="object"||!e.properties))for(let n of r.fieldPaths){let i=n.split(".");this.ensureFieldPath(e,i,r)}}ensureFieldPath(e,r,n,i=""){if(r.length===0||e.type!=="object")return;e.properties||(e.properties={});let s=r[0],o=s.endsWith("[]"),l=o?s.slice(0,-2):s,c=i?`${i}.${s}`:s,d=r.slice(1);if(!e.properties[l])if(o)e.properties[l]={type:"array",items:{type:"object"}};else if(d.length>0)e.properties[l]={type:"object",properties:{}};else{let p=n.typeHints[c];e.properties[l]={type:p||"string"};return}if(d.length>0){let p=o?e.properties[l].items:e.properties[l];p&&this.ensureFieldPath(p,d,n,c)}}mergeResponseDefinitions(e,r){let n={...e};return r.description&&(n.description=r.description),r.contentType&&(n.contentType=r.contentType),r.schema&&e.schema?n.schema=this.inferrer.mergeSchemas(e.schema,r.schema):r.schema&&(n.schema=r.schema),r.examples&&(n.examples={...e.examples||{},...r.examples}),r.content&&(n.content={...e.content||{},...r.content}),r.headers&&(n.headers={...e.headers||{},...r.headers}),n}mergeBodySchemaWithExisting(e,r){let n={...r};return r.schema?n.schema=this.inferrer.mergeSchemas(e,r.schema):n.schema=e,n}}});var tN,Hy,rN,nN,iN,sN,oN,yl,cC=le(()=>{"use strict";tN=/(?:jsonData|responseJson|data|json|body|response\.json\(\))\.([a-zA-Z_][\w.\[\]]*)/g,Hy="(?:pm|hf|ctx)",rN=new RegExp(`${Hy}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(?:a|an)\\(['"](\\w+)['"]\\)`,"g"),nN=new RegExp(`${Hy}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.(?:equal|eql)\\((.+?)\\)`,"g"),iN=/(?:to\.have\.status|response\.code.*?equal)\((\d+)\)/g,sN=new RegExp(`${Hy}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(true|false)`,"g"),oN=new RegExp(`${Hy}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.have\\.(?:lengthOf|length\\.above|length\\.below)`,"g"),yl=class{analyze(e){let r={fieldPaths:[],typeHints:{},valueHints:{},expectedStatuses:[]};if(!e||e.trim().length===0)return r;let n=this.stripComments(e);return this.extractFieldPaths(n,r),this.extractTypeAssertions(n,r),this.extractEqualityAssertions(n,r),this.extractBooleanAssertions(n,r),this.extractLengthAssertions(n,r),this.extractStatusAssertions(n,r),r.fieldPaths=[...new Set(r.fieldPaths)],r.expectedStatuses=[...new Set(r.expectedStatuses)],r}stripComments(e){let r=e.replace(/\/\*[\s\S]*?\*\//g,"");return r=r.replace(/\/\/.*$/gm,""),r}extractFieldPaths(e,r){let n,i=new RegExp(tN.source,tN.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&!this.isCommonMethodCall(s)&&r.fieldPaths.push(s)}}extractTypeAssertions(e,r){let n,i=new RegExp(rN.source,rN.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),o=n[2].toLowerCase();s&&(r.typeHints[s]=this.mapAssertionType(o),r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractEqualityAssertions(e,r){let n,i=new RegExp(nN.source,nN.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),o=n[2].trim();if(s){let l=this.parseAssertionValue(o);l!==void 0&&(r.valueHints[s]=l,typeof l=="string"?r.typeHints[s]=r.typeHints[s]||"string":typeof l=="number"?r.typeHints[s]=r.typeHints[s]||(Number.isInteger(l)?"integer":"number"):typeof l=="boolean"&&(r.typeHints[s]=r.typeHints[s]||"boolean")),r.fieldPaths.includes(s)||r.fieldPaths.push(s)}}}extractBooleanAssertions(e,r){let n,i=new RegExp(sN.source,sN.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(r.typeHints[s]="boolean",r.valueHints[s]=n[2]==="true",r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractLengthAssertions(e,r){let n,i=new RegExp(oN.source,oN.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(r.typeHints[s]=r.typeHints[s]||"array",r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractStatusAssertions(e,r){let n,i=new RegExp(iN.source,iN.flags);for(;(n=i.exec(e))!==null;){let s=parseInt(n[1],10);!isNaN(s)&&s>=100&&s<600&&r.expectedStatuses.push(s)}}normalizeFieldPath(e){let r=e.replace(/^\./,"");return r=r.replace(/\[\d+\]/g,"[]"),r}isCommonMethodCall(e){return new Set(["to","be","have","not","deep","any","all","that","is","has","include","includes","equal","eql","above","below","least","most","within","length","lengthOf","match","string","keys","key","property","ownProperty","status","header","json","text"]).has(e.split(".")[0])}mapAssertionType(e){return{string:"string",number:"number",object:"object",array:"array",boolean:"boolean",null:"null",undefined:"null",int:"integer",integer:"integer",float:"number",double:"number"}[e]||"string"}parseAssertionValue(e){if(e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"'))return e.slice(1,-1);let r=Number(e);return!isNaN(r)&&e.trim().length>0?r:e==="true"?!0:e==="false"?!1:e==="null"?null:e}}});var aN={};Rs(aN,{AwsSecretResolver:()=>gp});var gp,fC=le(()=>{"use strict";gp=class{providerName="aws";region;moduleRequire;constructor(e,r){this.region=e.region??process.env.AWS_DEFAULT_REGION??process.env.AWS_REGION,this.moduleRequire=r??(n=>require(n))}async resolve(e){let r=e.lastIndexOf("#"),n=r>=0?e.slice(0,r):e,i=r>=0?e.slice(r+1):void 0;try{let{SecretsManagerClient:s,GetSecretValueCommand:o}=this.moduleRequire("@aws-sdk/client-secrets-manager"),c=await new s(this.region?{region:this.region}:{}).send(new o({SecretId:n})),d=c.SecretString??(c.SecretBinary?Buffer.from(c.SecretBinary).toString("utf-8"):void 0);if(d===void 0)return;if(i)try{let p=JSON.parse(d);return p[i]!==void 0?String(p[i]):void 0}catch{return}return d}catch(s){throw s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND"?new Error("[HTTP Forge] AWS secret resolver requires @aws-sdk/client-secrets-manager. Install it in your project: npm install @aws-sdk/client-secrets-manager"):s}}}});var lN={};Rs(lN,{AzureKeyVaultResolver:()=>yp});var yp,dC=le(()=>{"use strict";yp=class{providerName="azure";vaultUrl;moduleRequire;constructor(e,r){let n=(e.vaultUrl||process.env.AZURE_KEYVAULT_URL)??"";this.vaultUrl=n.replace(/\/$/,""),this.moduleRequire=r??(i=>require(i))}async resolve(e){if(!this.vaultUrl)throw new Error("[HTTP Forge] Azure Key Vault resolver: no vault URL configured. Set secrets.providers.<alias>.vaultUrl or the AZURE_KEYVAULT_URL env var.");let r=e.split("/"),n=r[0],i=r[1];try{let{SecretClient:s}=this.moduleRequire("@azure/keyvault-secrets"),{DefaultAzureCredential:o}=this.moduleRequire("@azure/identity"),l=new o;return(await new s(this.vaultUrl,l).getSecret(n,i?{version:i}:{})).value}catch(s){throw s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND"?new Error("[HTTP Forge] Azure Key Vault resolver requires @azure/keyvault-secrets and @azure/identity. Install them: npm install @azure/keyvault-secrets @azure/identity"):s}}}});var uN={};Rs(uN,{HashiCorpVaultResolver:()=>vp});var vp,pC=le(()=>{"use strict";vp=class{providerName="vault";address;mountPath;namespace;constructor(e){this.address=(e.address??process.env.VAULT_ADDR??"http://127.0.0.1:8200").replace(/\/$/,""),this.mountPath=e.mountPath??"secret",this.namespace=e.namespace??process.env.VAULT_NAMESPACE}async resolve(e){let r=e.lastIndexOf("#"),n=r>=0?e.slice(0,r):e,i=r>=0?e.slice(r+1):void 0,s=process.env.VAULT_TOKEN;if(!s)throw new Error("[HTTP Forge] HashiCorp Vault resolver requires VAULT_TOKEN environment variable to be set.");let o=`${this.address}/v1/${this.mountPath}/data/${n}`,l={"X-Vault-Token":s};this.namespace&&(l["X-Vault-Namespace"]=this.namespace);let c;try{c=await fetch(o,{headers:l})}catch(y){throw new Error(`[HTTP Forge] Vault request failed: ${y?.message??y}`)}if(c.status===404)return;if(!c.ok)throw new Error(`[HTTP Forge] Vault returned HTTP ${c.status} for path: ${n}`);let p=(await c.json())?.data?.data;if(!p)return;if(i)return p[i]!==void 0?String(p[i]):void 0;if("value"in p)return String(p.value);let m=Object.keys(p);return m.length===1?String(p[m[0]]):void 0}}});var dN={};Rs(dN,{OnePasswordResolver:()=>bp});var cN,fN,E5,bp,hC=le(()=>{"use strict";cN=require("child_process"),fN=require("util"),E5=(0,fN.promisify)(cN.execFile),bp=class{providerName="1password";defaultVault;constructor(e){this.defaultVault=e.vault}async resolve(e){let r=e.split("/"),n,i,s;if(this.defaultVault){if(r.length<2)throw new Error(`[HTTP Forge] 1Password path "${e}" must be "<item>/<field>" when vault is set in config.`);n=this.defaultVault,i=r.slice(0,r.length-1).join("/"),s=r[r.length-1]}else{if(r.length<3)throw new Error(`[HTTP Forge] 1Password path "${e}" must be "<vault>/<item>/<field>".`);n=r[0],i=r.slice(1,r.length-1).join("/"),s=r[r.length-1]}let o=await this.tryResolveSdk(n,i,s);return o!==null?o:this.resolveViaCli(n,i,s)}async tryResolveSdk(e,r,n){let i=process.env.OP_SERVICE_ACCOUNT_TOKEN;if(!i)return null;try{let{createClient:s}=require("@1password/sdk"),o=await s({auth:i,integrationName:"HTTP Forge",integrationVersion:"1.0.0"}),l=`op://${e}/${r}/${n}`;return await o.secrets.resolve(l)}catch(s){if(s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND")return null;throw new Error(`[HTTP Forge] 1Password SDK error for "${e}/${r}/${n}": ${s?.message??s}`)}}async resolveViaCli(e,r,n){try{let{stdout:i}=await E5("op",["item","get",r,"--vault",e,"--field",n,"--format","json"],{env:{...process.env},timeout:1e4}),s=JSON.parse(i.trim());return typeof s=="string"?s:s&&typeof s.value=="string"?s.value:void 0}catch(i){if(i?.code==="ENOENT")throw new Error("[HTTP Forge] 1Password resolver requires either the @1password/sdk npm package or the `op` CLI to be installed.\n Service Account: set OP_SERVICE_ACCOUNT_TOKEN and install @1password/sdk\n CLI: install 1Password CLI and run `op signin`");if(i?.stderr?.includes("not found")||i?.code===1)return;throw new Error(`[HTTP Forge] 1Password CLI error: ${i?.message??i}`)}}}});var pN={};Rs(pN,{GcpSecretResolver:()=>Sp});var Sp,mC=le(()=>{"use strict";Sp=class{providerName="gcp";projectId;moduleRequire;constructor(e,r){this.projectId=e.projectId??process.env.GOOGLE_CLOUD_PROJECT??process.env.GCLOUD_PROJECT??process.env.GCP_PROJECT,this.moduleRequire=r??(n=>require(n))}async resolve(e){let r=e.split("/"),n=r[0],i=r[1]==="versions"&&r[2]?r[2]:"latest";if(!this.projectId)throw new Error("[HTTP Forge] GCP secret resolver: no projectId configured and GOOGLE_CLOUD_PROJECT env var is not set.");try{let{SecretManagerServiceClient:s}=this.moduleRequire("@google-cloud/secret-manager"),o=new s,l=`projects/${this.projectId}/secrets/${n}/versions/${i}`,[c]=await o.accessSecretVersion({name:l}),d=c.payload?.data;return d?Buffer.isBuffer(d)?d.toString("utf-8"):Buffer.from(d).toString("utf-8"):void 0}catch(s){throw s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND"?new Error("[HTTP Forge] GCP secret resolver requires @google-cloud/secret-manager. Install it: npm install @google-cloud/secret-manager"):s}}}});var mN={};Rs(mN,{DopplerResolver:()=>wp});var hN,wp,gC=le(()=>{"use strict";hN=ve(require("https")),wp=class{providerName="doppler";token;constructor(e){this.token=e.serviceToken??process.env.DOPPLER_TOKEN}async resolve(e){let r=e.trim().toUpperCase(),n=this.token;if(!n)throw new Error("[HTTP Forge] Doppler secret resolver: no service token found. Set DOPPLER_TOKEN env var or add serviceToken to config.");let i=`https://api.doppler.com/v3/configs/config/secret?name=${encodeURIComponent(r)}`;return new Promise((s,o)=>{let l=hN.request(i,{method:"GET",headers:{Authorization:`Bearer ${n}`,Accept:"application/json"}},c=>{let d=[];c.on("data",p=>d.push(p)),c.on("end",()=>{let p=Buffer.concat(d).toString("utf-8");if(c.statusCode===404){s(void 0);return}if(c.statusCode!==200){o(new Error(`[HTTP Forge] Doppler API returned ${c.statusCode} for secret "${r}": ${p}`));return}try{let y=JSON.parse(p)?.value?.computed;s(y!=null?String(y):void 0)}catch{o(new Error(`[HTTP Forge] Doppler API returned non-JSON response for secret "${r}"`))}})});l.on("error",o),l.end()})}}});var By,gN,yN,Ac,yC=le(()=>{"use strict";By=ve(require("fs")),gN=require("module"),yN=ve(require("path")),Ac=class{resolvers=new Map;moduleRequire;constructor(e){if(this.moduleRequire=this.buildModuleRequire(e),!e)return;let r;try{r=e.getConfig().secrets}catch{return}if(!(!r?.providers||typeof r.providers!="object"))for(let[n,i]of Object.entries(r.providers))try{let s=this.createResolver(i);s&&this.resolvers.set(n,s)}catch{}}async resolveSecretTokens(e,r){let n=r??new Map,i=new Set;if(this.collectTokens(e,i),i.size===0)return{};await Promise.all(Array.from(i).map(async o=>{if(n.has(o))return;let l=o.slice(7),c=l.indexOf("/");if(c<0)return;let d=l.slice(0,c),p=l.slice(c+1),m=this.resolvers.get(d);if(m)try{let y=await m.resolve(p);y!==void 0&&n.set(o,y)}catch(y){let b=y?.message??String(y);console.warn(`[HTTP Forge] {{${o}}} could not be resolved: ${b}`)}}));let s={};for(let[o,l]of n.entries())s[o]=l;return s}get hasProviders(){return this.resolvers.size>0}collectTokens(e,r){if(typeof e=="string"){let n=/\{\{(secret:[^}]+)\}\}/g,i;for(;(i=n.exec(e))!==null;)r.add(i[1])}else Array.isArray(e)?e.forEach(n=>this.collectTokens(n,r)):e!==null&&typeof e=="object"&&Object.values(e).forEach(n=>this.collectTokens(n,r))}createResolver(e){switch(e.provider){case"aws":{let{AwsSecretResolver:r}=(fC(),Ia(aN));return new r(e,this.moduleRequire)}case"azure":{let{AzureKeyVaultResolver:r}=(dC(),Ia(lN));return new r(e,this.moduleRequire)}case"vault":{let{HashiCorpVaultResolver:r}=(pC(),Ia(uN));return new r(e)}case"1password":{let{OnePasswordResolver:r}=(hC(),Ia(dN));return new r(e)}case"gcp":{let{GcpSecretResolver:r}=(mC(),Ia(pN));return new r(e,this.moduleRequire)}case"doppler":{let{DopplerResolver:r}=(gC(),Ia(mN));return new r(e)}default:return}}buildModuleRequire(e){let r=i=>require(i);if(!e)return r;let n=[];try{n=e.getModulePaths()??[]}catch{return r}for(let i of n)try{let s=yN.resolve(i,"package.json");if(By.existsSync(s)){let o=By.realpathSync(s),l=(0,gN.createRequire)(o);return c=>{try{return l(c)}catch{return r(c)}}}}catch{}return r}}});function hr(t){return t.replace(/\//g,"%2F")}function vC(t){return t.replace(/%2F/gi,"/")}function rs(t){return t?t.split("/").map(vC).join(" / "):""}function _p(t){return t.includes(" / ")?t.split(" / ").map(e=>hr(e.trim())).join("/"):hr(t)}function rt(t,e=t.items,r=""){let n=[];for(let i of e)if(i.type==="request")n.push({request:i,folderPath:r});else{let s=i,o=hr(s.name),l=r?`${r}/${o}`:o;n.push(...rt(t,s.items??[],l))}return n}function zr(t,e=t.items,r=""){let n=[];for(let i of e)if(i.type==="folder"){let s=i,o=hr(s.name),l=r?`${r}/${o}`:o;n.push({folderId:s.id,folderPath:l,requestCount:Vy(s.items??[])}),n.push(...zr(t,s.items??[],l))}return n}function Vy(t){let e=0;for(let r of t)r.type==="request"?e++:e+=Vy(r.items??[]);return e}var Ii=le(()=>{"use strict"});var Go,bC=le(()=>{"use strict";Go={iterations:1,delayBetweenRequests:0,stopOnError:!1,readFromSharedSession:!1,writeToSharedSession:!1}});var bt,Oi,Tc,SC=le(()=>{"use strict";bt=ve(require("fs")),Oi=ve(require("path"));Ii();Un();bC();Tc=class{constructor(e,r,n){this.collectionService=e;this.configService=r;this.suitesDir=r.getSuitesPath(),this.onSuitesChanged=n?.onSuitesChanged,this.ensureSuitesDir(),this.loadSuites(),n?.watch!==!1&&this.setupFileWatcher()}collectionService;configService;suitesDir;suites=new Map;fileWatcher=null;debounceTimer=null;onSuitesChanged;ensureSuitesDir(){bt.existsSync(this.suitesDir)||bt.mkdirSync(this.suitesDir,{recursive:!0})}setupFileWatcher(){try{this.fileWatcher=bt.watch(this.suitesDir,(e,r)=>{r&&!r.endsWith(".suite.json")||(this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.loadSuites(),this.onSuitesChanged?.()},200))}),this.fileWatcher.on("error",()=>{})}catch{}}dispose(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.fileWatcher?.close(),this.fileWatcher=null}loadSuites(){if(this.suites.clear(),!bt.existsSync(this.suitesDir))return;let e=bt.readdirSync(this.suitesDir);for(let r of e)if(r.endsWith(".suite.json"))try{let n=Oi.join(this.suitesDir,r),i=bt.readFileSync(n,"utf-8"),s=JSON.parse(i),o=Array.isArray(s.nodes)&&s.nodes.length>0?s.nodes:(Array.isArray(s.requests)?s.requests:[]).map(c=>({type:"request",name:c.description||c.name,request:c,enabled:c.enabled!==!1})),l={id:s.id,name:s.name,description:s.description,scripts:s.scripts,nodes:o,config:s.config??{...Go},isTemporary:s.isTemporary,createdAt:s.createdAt??Date.now(),updatedAt:s.updatedAt??Date.now()};l.id&&l.name&&this.suites.set(l.id,l)}catch(n){console.error(`[TestSuiteService] Failed to load ${r}:`,n)}}async getAllSuites(){return Array.from(this.suites.values())}async getSuite(e){return this.suites.get(e)}async createSuite(e){let r=Date.now(),n={id:It(e),name:e,nodes:[],config:{...Go},createdAt:r,updatedAt:r};return await this.saveSuiteToDisk(n),this.suites.set(n.id,n),n}async updateSuite(e){e.updatedAt=Date.now(),await this.saveSuiteToDisk(e),this.suites.set(e.id,e)}async duplicateSuite(e,r){let n=this.suites.get(e);if(!n)throw new Error(`Suite not found: ${e}`);let i=n.nodes||[],s=await this.createSuite(r);s.nodes=i.map(c=>({...c})),s.config={...n.config},s.description=n.description;let o=Oi.join(this.suitesDir,e),l=Oi.join(this.suitesDir,s.id);return bt.existsSync(o)&&this.copyDirRecursive(o,l),await this.saveSuiteToDisk(s),this.suites.set(s.id,s),s}copyDirRecursive(e,r){bt.existsSync(r)||bt.mkdirSync(r,{recursive:!0});for(let n of bt.readdirSync(e,{withFileTypes:!0})){let i=Oi.join(e,n.name),s=Oi.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):bt.copyFileSync(i,s)}}async deleteSuite(e){let r=this.suites.get(e);if(!r)return!1;let n=`${r.id}.suite.json`,i=Oi.join(this.suitesDir,n),s=Oi.join(this.suitesDir,r.id);try{return bt.existsSync(i)&&bt.unlinkSync(i),bt.existsSync(s)&&bt.rmSync(s,{recursive:!0,force:!0}),this.suites.delete(e),!0}catch(o){return console.error("[TestSuiteService] Failed to delete suite:",o),!1}}async createTempSuiteFromCollection(e){let r=this.collectionService.getCollection(e);if(!r){console.error(`[TestSuiteService] Collection not found: ${e}`);return}let n=[];this.extractRequestsFromCollection(r,e,r.name,"",n);let i=n.map(l=>({type:"request",name:l.description||l.name,request:l,enabled:l.enabled!==!1})),s=Date.now();return{id:`temp-${e}`,name:r.name,nodes:i,config:{...Go},isTemporary:!0,createdAt:s,updatedAt:s}}async createTempSuiteFromFolder(e,r,n=!0){let i=this.collectionService.getCollection(e);if(!i){console.error(`[TestSuiteService] Collection not found: ${e}`);return}let s=[];this.extractRequestsFromCollection(i,e,i.name,"",s);let o=r.replace(/\/+$/,""),l=s.filter(m=>n?m.folderPath===o||m.folderPath.startsWith(`${o}/`):m.folderPath===o);if(l.length===0){console.error(`[TestSuiteService] No requests under folder "${r}" in collection: ${e}`);return}let c=l.map(m=>({type:"request",name:m.description||m.name,request:m,enabled:m.enabled!==!1})),d=Date.now();return{id:`temp-${e}-${this.slugifyFolderPath(o)}`,name:`${i.name} / ${rs(o)}`,nodes:c,config:{...Go},isTemporary:!0,createdAt:d,updatedAt:d}}slugifyFolderPath(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}async saveTempSuite(e,r){let n=Date.now(),i=Oi.join(this.suitesDir,e.id),s={...e,id:It(r),name:r,isTemporary:!1,createdAt:n,updatedAt:n},o=Oi.join(this.suitesDir,s.id);return bt.existsSync(i)&&(bt.existsSync(o)&&bt.rmSync(o,{recursive:!0,force:!0}),bt.renameSync(i,o)),await this.saveSuiteToDisk(s),this.suites.set(s.id,s),s}getAllAvailableRequests(){let e=[],r=this.collectionService.getAllCollections();for(let n of r)this.extractRequestsFromCollection(n,n.id,n.name,"",e);return e}extractRequestsFromCollection(e,r,n,i,s){if(e.requests)for(let o of e.requests)s.push({collectionId:r,collectionName:n,requestId:o.id,name:o.name||"Unnamed Request",method:o.method||"GET",folderPath:i});if(e.items)for(let o of e.items)if(o.items||o.folders||o.requests){let l=i?`${i}/${hr(o.name)}`:hr(o.name);this.extractRequestsFromCollection(o,r,n,l,s)}else s.push({collectionId:r,collectionName:n,requestId:o.id,name:o.name||"Unnamed Request",method:o.method||"GET",folderPath:i});if(e.folders)for(let o of e.folders){let l=i?`${i}/${hr(o.name)}`:hr(o.name);this.extractRequestsFromCollection(o,r,n,l,s)}}async saveSuiteToDisk(e){this.ensureSuitesDir();let r=`${e.id}.suite.json`,n=Oi.join(this.suitesDir,r),i=`${n}.tmp-${process.pid}-${Date.now()}`,s={id:e.id,name:e.name,description:e.description,scripts:e.scripts,nodes:Array.isArray(e.nodes)?e.nodes:[],config:e.config??{...Go},isTemporary:e.isTemporary,createdAt:e.createdAt??Date.now(),updatedAt:e.updatedAt??Date.now()},o=JSON.stringify(s,null,2);bt.writeFileSync(i,o,"utf-8"),bt.renameSync(i,n)}}});var ae,Wy=le(()=>{"use strict";ae={Config:Symbol.for("IConfigService"),Console:Symbol.for("IConsoleService"),EnvironmentConfig:Symbol.for("IEnvironmentConfigService"),Collection:Symbol.for("ICollectionService"),HttpRequest:Symbol.for("IHttpRequestService"),HttpClient:Symbol.for("IHttpClient"),Cookie:Symbol.for("ICookieService"),RequestHistory:Symbol.for("IRequestHistoryService"),TestSuite:Symbol.for("ITestSuiteService"),UrlBuilder:Symbol.for("IUrlBuilder"),RequestPreprocessor:Symbol.for("IRequestPreprocessor"),RequestPreparer:Symbol.for("IRequestPreparer"),InterceptorChain:Symbol.for("IInterceptorChain"),ScriptExecutor:Symbol.for("IScriptExecutor"),DataFileParser:Symbol.for("IDataFileParser"),CollectionRequestExecutor:Symbol.for("ICollectionRequestExecutor"),WorkspaceFolder:Symbol.for("WorkspaceFolder"),PersistentCookieJar:Symbol.for("PersistentCookieJar"),OAuth2TokenManager:Symbol.for("IOAuth2TokenManager"),GraphQLSchemaService:Symbol.for("IGraphQLSchemaService"),SchemaInferrer:Symbol.for("SchemaInferrer"),HistoryAnalyzer:Symbol.for("HistoryAnalyzer"),ScriptAnalyzer:Symbol.for("ScriptAnalyzer"),SchemaInferenceService:Symbol.for("SchemaInferenceService"),OpenApiExporter:Symbol.for("OpenApiExporter"),OpenApiImporter:Symbol.for("OpenApiImporter"),SecretResolverRegistry:Symbol.for("SecretResolverRegistry")}});function Rp(t,e){let{workspaceFolder:r,fileWatcherFactory:n,notificationService:i,workspaceStore:s,globalStore:o,secretStore:l,browserService:c,applicationInfo:d,consoleService:p}=e;t.registerValue(ae.WorkspaceFolder,r),t.registerSingleton(ae.Config,()=>new ks(r,n,i)),t.registerSingleton(ae.Console,()=>p??q5),t.registerSingleton(ae.EnvironmentConfig,y=>new nc(r,s,y.resolve(ae.Config),n,l,e.persistOverrides??!0)),t.registerSingleton(ae.Cookie,()=>new tc(o)),t.registerSingleton(ae.Collection,y=>new ec(r,y.resolve(ae.Config),n)),t.registerSingleton(ae.TestSuite,y=>new Tc(y.resolve(ae.Collection),y.resolve(ae.Config))),t.registerSingleton(ae.HttpClient,y=>{let b=y.resolve(ae.Config);return new Eo(b.getRequestConfig(),r)}),t.registerSingleton(ae.UrlBuilder,()=>new Hn),t.registerSingleton(ae.InterceptorChain,()=>new zi),t.registerSingleton(ae.HttpRequest,y=>new Wi(y.resolve(ae.UrlBuilder),y.resolve(ae.InterceptorChain),y.resolve(ae.HttpClient))),t.registerSingleton(ae.RequestPreprocessor,()=>new qo),t.registerSingleton(ae.RequestHistory,y=>{let b=y.resolve(ae.EnvironmentConfig);return new oc(b.getHistoriesPath(),vN.join(b.getRootPath(),"shared-histories"))}),l&&c&&t.registerSingleton(ae.OAuth2TokenManager,y=>new Qu(l,c,y.resolve(ae.EnvironmentConfig),y.resolve(ae.HttpRequest))),t.registerSingleton(ae.GraphQLSchemaService,y=>new sc(y.resolve(ae.HttpClient))),t.registerSingleton(ae.SecretResolverRegistry,y=>new Ac(y.resolve(ae.Config)));let m=d??{name:"HttpForge",version:"0.0.0"};t.registerSingleton(ae.RequestPreparer,y=>new ic(y.resolve(ae.EnvironmentConfig),y.resolve(ae.HttpRequest),y.resolve(ae.RequestPreprocessor),y.has(ae.OAuth2TokenManager)?y.resolve(ae.OAuth2TokenManager):void 0,m,y.resolve(ae.SecretResolverRegistry))),t.registerSingleton(ae.ScriptExecutor,y=>{let b=y.resolve(ae.Config);return new Ki(y.resolve(ae.HttpRequest),b.getModulePaths(),y.resolve(ae.SecretResolverRegistry),b.getScriptScope(),b.getScriptTimeout())}),t.registerSingleton(ae.DataFileParser,()=>new Oo),t.registerSingleton(ae.CollectionRequestExecutor,y=>new As(y.resolve(ae.HttpRequest),y.resolve(ae.ScriptExecutor),y.resolve(ae.EnvironmentConfig),y.resolve(ae.RequestPreparer),"")),t.registerSingleton(ae.PersistentCookieJar,y=>new rc(y.resolve(ae.Cookie))),t.registerSingleton(ae.SchemaInferrer,()=>new Ns),t.registerSingleton(ae.HistoryAnalyzer,y=>new Xa(y.resolve(ae.RequestHistory),y.resolve(ae.SchemaInferrer))),t.registerSingleton(ae.ScriptAnalyzer,()=>new yl),t.registerSingleton(ae.SchemaInferenceService,y=>new gl(y.resolve(ae.HistoryAnalyzer),y.resolve(ae.ScriptAnalyzer),y.resolve(ae.SchemaInferrer))),t.registerSingleton(ae.OpenApiExporter,y=>new ol(y.resolve(ae.Collection),y.resolve(ae.EnvironmentConfig),y.resolve(ae.SchemaInferenceService))),t.registerSingleton(ae.OpenApiImporter,y=>new Hs(y.resolve(ae.Collection),y.resolve(ae.EnvironmentConfig)))}var vN,q5,wC=le(()=>{"use strict";vN=ve(require("path"));K0();t_();sg();n_();i_();o_();og();a_();l_();f_();Tf();$f();gd();tg();_u();d_();JR();Uy();uC();fy();cC();rg();md();yC();SC();Wy();q5={log:()=>{},trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},logBatch:()=>{},logRawLines:()=>{},show:()=>{},clear:()=>{},dispose:()=>{}}});function _C(){return Yo.instance}var Yo,RC=le(()=>{"use strict";Wy();Yo=class t{static _instance;services=new Map;primitives=new Map;constructor(){}static get instance(){return t._instance||(t._instance=new t),t._instance}static createFresh(){return new t}static reset(){t._instance&&t._instance.clear(),t._instance=void 0}registerValue(e,r){return this.primitives.set(e,r),this}registerSingleton(e,r){return this.services.set(e,{factory:r,singleton:!0}),this}registerTransient(e,r){return this.services.set(e,{factory:r,singleton:!1}),this}registerInstance(e,r){return this.services.set(e,{factory:()=>r,singleton:!0,instance:r}),this}resolve(e){if(this.primitives.has(e))return this.primitives.get(e);let r=this.services.get(e);if(!r)throw new Error(`Service not registered: ${e.toString()}`);return r.singleton?(r.instance||(r.instance=r.factory(this)),r.instance):r.factory(this)}has(e){return this.services.has(e)||this.primitives.has(e)}clear(){this.services.clear(),this.primitives.clear()}get config(){return this.resolve(ae.Config)}get console(){return this.resolve(ae.Console)}get environmentConfig(){return this.resolve(ae.EnvironmentConfig)}get collection(){return this.resolve(ae.Collection)}get httpRequest(){return this.resolve(ae.HttpRequest)}get httpClient(){return this.resolve(ae.HttpClient)}get cookie(){return this.resolve(ae.Cookie)}get requestHistory(){return this.resolve(ae.RequestHistory)}get dataFileParser(){return this.resolve(ae.DataFileParser)}get scriptExecutor(){return this.resolve(ae.ScriptExecutor)}get requestPreparer(){return this.resolve(ae.RequestPreparer)}get persistentCookieJar(){return this.resolve(ae.PersistentCookieJar)}get oauth2TokenManager(){return this.has(ae.OAuth2TokenManager)?this.resolve(ae.OAuth2TokenManager):void 0}get graphqlSchemaService(){return this.resolve(ae.GraphQLSchemaService)}get testSuite(){return this.resolve(ae.TestSuite)}}});function bN(t){return/\{\{[^}]+\}\}/.test(t)}function xp(t,e=16){return!!t&&t.length>=e&&!bN(t)}function xC(t){return t.toUpperCase().replace(/[^A-Z0-9]/g,"_")}function Cp(t,e,r,n,i,s=10){let o=t.get(e);o||(o={varName:r,reason:n,occurrences:[],priority:s},t.set(e,o));let l=`${i.requestId}::${i.field}`;o.occurrences.some(c=>`${c.requestId}::${c.field}`===l)||o.occurrences.push(i)}function Ep(t,e=1){let r=rt(t),n=new Map;for(let{request:s}of r){let o=l=>({requestId:s.id,requestName:s.name,field:l});for(let l of s.headers??[]){if(l.enabled===!1)continue;let c=l.key.toLowerCase(),d=l.value;if(c==="authorization"){let p=d.match(/^(bearer|basic|token|digest)\s+(.+)$/i);p&&xp(p[2])?Cp(n,p[2],`${p[1].toUpperCase()}_TOKEN`,`Authorization ${p[1]} token`,o(`header:${l.key}`),1):xp(d)&&Cp(n,d,"AUTH_TOKEN","Authorization header value",o(`header:${l.key}`),1)}else I5.has(c)&&xp(d)?Cp(n,d,xC(l.key),`Sensitive header: ${l.key}`,o(`header:${l.key}`),2):xp(d,20)&&!d.includes(" ")&&/^[A-Za-z0-9+/=_.-]+$/.test(d)&&Cp(n,d,xC(l.key)||"HEADER_VALUE",`Long opaque value in header: ${l.key}`,o(`header:${l.key}`),5)}for(let l of s.query??[])l.enabled!==!1&&O5.has(l.key.toLowerCase())&&xp(l.value)&&Cp(n,l.value,xC(l.key),`Sensitive query param: ${l.key}`,o(`query:${l.key}`),2)}let i=new Map;for(let{request:s}of r)if(!(!s.url||bN(s.url)))try{let o=new URL(s.url);if(!["localhost","127.0.0.1","0.0.0.0","::1"].includes(o.hostname)){let c=`${o.protocol}//${o.host}`,d=i.get(c)??[];d.push({requestId:s.id,requestName:s.name,field:"url"}),i.set(c,d)}}catch{}for(let[s,o]of i)o.length>=Math.max(e,2)&&!n.has(s)&&n.set(s,{varName:"BASE_URL",reason:`Shared base URL across ${o.length} requests`,occurrences:o,priority:3});return[...n.entries()].filter(([,s])=>s.occurrences.length>=e).sort((s,o)=>s[1].priority-o[1].priority||s[0].localeCompare(o[0])).map(([s,o])=>({varName:o.varName,value:s,reason:o.reason,occurrences:o.occurrences}))}function zy(t,e){let r={};return SN(t,e,r),r}function SN(t,e,r){for(let n of t){if(n.type==="folder"){n.items&&SN(n.items,e,r);continue}let i=n;for(let s of e){let o=`{{${s.varName}}}`;i.url?.includes(s.value)&&(i.url=i.url.split(s.value).join(o),r[s.varName]=(r[s.varName]??0)+1);for(let l of i.headers??[]){let c=l.value.match(/^(bearer|basic|token|digest)\s+(.+)$/i);c&&c[2]===s.value?(l.value=`${c[1]} ${o}`,r[s.varName]=(r[s.varName]??0)+1):l.value===s.value&&(l.value=o,r[s.varName]=(r[s.varName]??0)+1)}for(let l of i.query??[])l.value===s.value&&(l.value=o,r[s.varName]=(r[s.varName]??0)+1)}}}var I5,O5,CC=le(()=>{"use strict";Ii();I5=new Set(["x-api-key","x-auth-token","x-access-token","x-token","x-secret","api-key","apikey","x-client-secret","x-rapidapi-key"]),O5=new Set(["api_key","apikey","api-key","access_token","token","auth_token","client_id","client_secret","key","secret"])});function Jr(t,e){let r={type:"string",description:t};return e.length>0&&(r.enum=[...e]),r}function Jy(t,e,r){let n=i=>Jr("Name of the collection to act on."+(i?"":" Optional."),e);return[{name:`${t}${G.listCollections}`,description:"List all available HTTP Forge collections (name, description, and request count). Call this first to discover what collections exist, then use list_folders, list_requests or run_* tools.",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${G.listFolders}`,description:"List all folders in a collection with their full paths and request counts. Use this before run_folder to discover the exact folder path string to pass.",inputSchema:{type:"object",properties:{collection:n(!0)},required:["collection"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.listRequests}`,description:"List the saved requests in a collection (name, HTTP method, folder, and description). Use this to find the exact request name before calling run_request. For large collections use the folder filter and offset/limit to page through results.",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:'Optional folder path to filter by (e.g. "Auth").'},offset:{type:"number",description:"Zero-based index to start from (default: 0)."},limit:{type:"number",description:"Maximum number of results to return (default: 50, max: 200)."}},required:["collection"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.searchRequests}`,description:"Search for requests across a collection by name, URL, method, or folder path. Returns matching requests with their folder location. Useful for large collections.",inputSchema:{type:"object",properties:{collection:n(!0),query:{type:"string",description:"Text to search for in request names, URLs, methods, and folder paths (case-insensitive)."}},required:["collection","query"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.getRequest}`,description:"Get the full details of a single saved request: URL, method, headers, body, auth, and scripts. Use this to inspect a request before editing it, or to read a script before rewriting it.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id. Use list_requests to find names."}},required:["collection","request"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.getEnvironment}`,description:"Show the current environment variable values (merged initial + runtime pm.environment.set overrides). Use this to inspect variable state before running a folder, or to debug {{variable}} resolution failures.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name to inspect (defaults to the currently selected environment)."}}},annotations:{readOnlyHint:!0}},{name:`${t}${G.setVariable}`,description:'Override an environment variable for the current session. In the VS Code extension the change is saved to VS Code workspace storage (survives restarts, but is not in the env JSON file and not source-controlled). In the standalone CLI/core runtime the change is in-memory only and lost when the server restarts. Use set_environment_variable with scope:"permanent" to write to the env JSON file (source-controlled, works in both runtimes).',inputSchema:{type:"object",properties:{key:{type:"string",description:"Variable name (the part inside {{...}})."},value:{type:"string",description:"New value to set."},environment:{type:"string",description:"Environment to update (defaults to the currently selected environment)."}},required:["key","value"]},annotations:{idempotentHint:!0}},{name:`${t}${G.getRunStatus}`,description:"Check whether an async run is still running, completed, or failed. Poll this after calling run_folder/run_collection/run_suite with async:true.",inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by an async run_* call."}},required:["runId"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.getRunSummary}`,description:'Get the pass/fail summary of a completed async run (total, passed, failed counts). Use after get_run_status shows "completed". When failures are present the response includes a failedRequests array with full details (method, url, requestBody, status, responseBody, failedTests) and a _nextStep directive. You MUST follow the _nextStep directive immediately \u2014 analyze the failures and provide diagnosis without waiting for the user to ask.',inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by an async run_* call."}},required:["runId"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.getFailedRequests}`,description:"Get the list of failed requests from a completed async run \u2014 the failures-first view. Never returns passing requests. Use this instead of get_run_summary when you need to see what broke.",inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by an async run_* call."},offset:{type:"number",description:"Zero-based index to start from (default: 0)."},limit:{type:"number",description:"Maximum failures to return (default: 20, max: 100)."}},required:["runId"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.getRequestResult}`,description:"Get the full result (status, body, assertions, console output) for one specific request from an async run. Use after get_failed_requests to drill into a single failure.",inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by an async run_* call."},request:{type:"string",description:"Name of the request to look up."},iteration:{type:"number",description:"Iteration number (default: 1)."}},required:["runId","request"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.cancelRun}`,description:'Request cancellation of an in-progress async run. Cancellation is best-effort: the currently-executing HTTP request completes normally, but no further requests in the run are started. The run status changes to "cancelled". Has no effect on runs that are already completed, failed, or cancelled.',inputSchema:{type:"object",properties:{runId:{type:"string",description:"Run ID returned by run_collection, run_folder, or run_suite with async:true."}},required:["runId"]},annotations:{idempotentHint:!0}},{name:`${t}${G.runRequest}`,description:"Run a single saved request. Pick the collection, then the request name within it.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Name of the request to run. Use list_requests or search_requests to find names."},requestId:{type:"string",description:'ID of the request (from list_requests/search_requests). Preferred over "request" name when available \u2014 avoids ambiguity with duplicate names.'},...qp.properties},required:["collection","request"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${G.runFolder}`,description:"Run every request inside a folder of a collection.",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:'Folder path within the collection (e.g. "Auth/Login").'},...Op.properties},required:["collection","folder"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${G.runCollection}`,description:"Run every request in a collection.",inputSchema:{type:"object",properties:{collection:n(!0),...Ip.properties},required:["collection"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${G.runSuite}`,description:"Run a saved test suite.",inputSchema:{type:"object",properties:{suite:Jr("Name of the test suite to run.",r),...Pp.properties},required:["suite"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${G.createCollection}`,description:"Create a new empty collection.",inputSchema:{type:"object",properties:{name:{type:"string",description:"Display name for the new collection."}},required:["name"]},annotations:{idempotentHint:!1}},{name:`${t}${G.renameCollection}`,description:"Rename an existing collection.",inputSchema:{type:"object",properties:{collection:n(!0),newName:{type:"string",description:"New display name for the collection."}},required:["collection","newName"]},annotations:{idempotentHint:!0}},{name:`${t}${G.deleteCollection}`,description:"Permanently delete a collection and all its contents. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{collection:n(!0),confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["collection","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${G.duplicateCollection}`,description:"Clone a collection under a new name (all folders, requests, and scripts are copied).",inputSchema:{type:"object",properties:{collection:n(!0),newName:{type:"string",description:"Name for the duplicated collection."}},required:["collection","newName"]},annotations:{idempotentHint:!1}},{name:`${t}${G.createFolder}`,description:"Create a folder inside a collection (optionally nested inside another folder).",inputSchema:{type:"object",properties:{collection:n(!0),name:{type:"string",description:"Display name for the new folder."},parentFolder:{type:"string",description:"Slash-separated folder path or folder id of the parent. Omit to create at collection root."}},required:["collection","name"]},annotations:{idempotentHint:!1}},{name:`${t}${G.deleteFolder}`,description:"Delete a folder and all its requests. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:"Slash-separated folder path or folder id to delete."},confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["collection","folder","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${G.createRequest}`,description:"Create a new HTTP request inside a collection (optionally inside a folder).",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:"Folder path or id. Omit to add at collection root."},name:{type:"string",description:"Display name for the request."},method:{type:"string",enum:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],description:"HTTP method."},url:{type:"string",description:"Request URL, may include {{variable}} placeholders."},headers:{type:"object",description:"Key/value header map.",additionalProperties:{type:"string"}},body:{type:"string",description:"Raw request body (JSON, text, etc.)."},description:{type:"string",description:"Human-readable description."}},required:["collection","name","method","url"]},annotations:{idempotentHint:!1}},{name:`${t}${G.updateRequest}`,description:"Update fields on an existing request (partial update \u2014 omit fields to keep current values).",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id."},name:{type:"string",description:"New display name."},method:{type:"string",enum:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]},url:{type:"string"},headers:{type:"object",additionalProperties:{type:"string"}},body:{type:"string"},description:{type:"string"}},required:["collection","request"]},annotations:{idempotentHint:!0}},{name:`${t}${G.deleteRequest}`,description:"Remove a request from a collection. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id to delete."},confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["collection","request","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${G.getRequestScript}`,description:"Read the pre-request or post-response script of a request.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id."},phase:{type:"string",enum:["pre-request","post-response"],description:"Which script phase to read."}},required:["collection","request","phase"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.setRequestScript}`,description:"Write or replace the pre-request or post-response script of a request.",inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name or id."},phase:{type:"string",enum:["pre-request","post-response"],description:"Which script phase to write."},script:{type:"string",description:"Full JavaScript source to write."}},required:["collection","request","phase","script"]},annotations:{idempotentHint:!0}},{name:`${t}${G.reorderCollectionItems}`,description:"Set the execution/display order of direct children of a collection root or folder. Items not listed are appended at the end.",inputSchema:{type:"object",properties:{collection:n(!0),folder:{type:"string",description:"Folder path or id. Omit to reorder collection root."},order:{type:"array",items:{type:"string"},description:"Ordered list of item names or ids."}},required:["collection","order"]},annotations:{idempotentHint:!0}},{name:`${t}${G.listSuites}`,description:"List all test suites with name, id, request count, and configuration summary.",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${G.getSuite}`,description:"Get full details of a test suite including flow nodes (suite.nodes) and a flattened request list.",inputSchema:{type:"object",properties:{suite:Jr("Name or id of the test suite.",r)},required:["suite"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.createSuite}`,description:"Create a new test suite (empty, pre-populated from a collection/folder, or initialized with an explicit flow nodes graph).",inputSchema:{type:"object",properties:{name:{type:"string",description:"Display name for the new suite."},description:{type:"string",description:"Optional description."},fromCollection:{type:"string",description:"Collection name or id to seed the suite from (all requests in execution order)."},fromFolder:{type:"string",description:"Folder path within fromCollection to seed from."},nodes:{type:"array",items:{type:"object"},description:"Optional full suite.nodes graph. If provided, this becomes the suite flow definition."},iterations:{type:"number",description:"Number of iterations (default: 1)."},stopOnError:{type:"boolean",description:"Stop on first failure (default: false)."},delayBetweenRequests:{type:"number",description:"Milliseconds delay between requests (default: 0)."}},required:["name"]},annotations:{idempotentHint:!1}},{name:`${t}${G.updateSuiteConfig}`,description:"Change a suite's name/description/run configuration and optionally replace the full suite.nodes flow graph.",inputSchema:{type:"object",properties:{suite:Jr("Name or id of the suite to update.",r),name:{type:"string",description:"New display name."},description:{type:"string",description:"New description."},nodes:{type:"array",items:{type:"object"},description:"Optional full suite.nodes graph replacement."},iterations:{type:"number"},stopOnError:{type:"boolean"},delayBetweenRequests:{type:"number"}},required:["suite"]},annotations:{idempotentHint:!0}},{name:`${t}${G.getSuiteNode}`,description:'Get a single suite flow node by path (for example: "2.then.0" or "1.cases.0.nodes.1").',inputSchema:{type:"object",properties:{suite:Jr("Name or id of the suite.",r),path:{type:"string",description:"Node path to read (dot notation)."}},required:["suite","path"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.listSuiteNodePaths}`,description:"List all node paths and editable branch-array paths for a suite flow graph. Use before add/update/remove/move_suite_node.",inputSchema:{type:"object",properties:{suite:Jr("Name or id of the suite.",r),includeBranches:{type:"boolean",description:"Include branch-array paths (default: true)."}},required:["suite"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.addSuiteNode}`,description:"Add a flow node to a suite. Insert at root or into a branch array of a parent node.",inputSchema:{type:"object",properties:{suite:Jr("Name or id of the suite.",r),node:{type:"object",description:"Node object to insert (request/script/if/switch/for/while/block)."},parentPath:{type:"string",description:'Optional parent node path (for example: "2" or "1.cases.0"). Omit to insert at root.'},branch:{type:"string",description:'Branch array on parent node (for example: "nodes", "then", "else", "default", "cases.0.nodes"). Required when parentPath is provided.'},index:{type:"number",description:"Optional insertion index inside target array. Omit to append."}},required:["suite","node"]},annotations:{idempotentHint:!1}},{name:`${t}${G.updateSuiteNode}`,description:"Replace a flow node at a specific path in suite.nodes.",inputSchema:{type:"object",properties:{suite:Jr("Name or id of the suite.",r),path:{type:"string",description:'Node path to replace (for example: "0" or "2.then.1").'},node:{type:"object",description:"Full replacement node object."}},required:["suite","path","node"]},annotations:{idempotentHint:!0}},{name:`${t}${G.removeSuiteNode}`,description:"Remove a flow node at a specific path from suite.nodes.",inputSchema:{type:"object",properties:{suite:Jr("Name or id of the suite.",r),path:{type:"string",description:'Node path to remove (for example: "0" or "2.else.0").'}},required:["suite","path"]},annotations:{destructiveHint:!0}},{name:`${t}${G.moveSuiteNode}`,description:"Move a flow node from one path to another parent/branch/index within suite.nodes.",inputSchema:{type:"object",properties:{suite:Jr("Name or id of the suite.",r),fromPath:{type:"string",description:'Source node path (for example: "1.then.0").'},toParentPath:{type:"string",description:"Optional destination parent node path. Omit to move to root."},toBranch:{type:"string",description:"Destination branch array on parent node. Required when toParentPath is provided."},toIndex:{type:"number",description:"Optional destination index in target array. Omit to append."}},required:["suite","fromPath"]},annotations:{idempotentHint:!1}},{name:`${t}${G.addSuiteRequests}`,description:'Legacy compatibility helper. Add one or more request nodes at the suite root, using the same insertion semantics as add_suite_node with type:"request".',inputSchema:{type:"object",properties:{suite:Jr("Name or id of the suite.",r),requests:{type:"array",items:{type:"object",properties:{collection:{type:"string",description:"Collection name or id."},request:{type:"string",description:"Request name or id."}},required:["collection","request"]},description:"Requests to add."},insertAt:{type:"number",description:"Zero-based root nodes-array index to insert at. Omit to append at end."}},required:["suite","requests"]},annotations:{idempotentHint:!1}},{name:`${t}${G.removeSuiteRequest}`,description:"Remove a request from a request-only root suite by position (0-based) or by name. For flow suites, edit nodes via get_suite/update_suite_config.",inputSchema:{type:"object",properties:{suite:Jr("Name or id of the suite.",r),index:{type:"number",description:"Zero-based position in the suite requests list."},request:{type:"string",description:"Request name to remove (used if index is not provided)."}},required:["suite"]},annotations:{destructiveHint:!0}},{name:`${t}${G.reorderSuiteRequests}`,description:"Reorder requests in a request-only root suite. Requests not listed are moved to the end. For flow suites, edit nodes via get_suite/update_suite_config.",inputSchema:{type:"object",properties:{suite:Jr("Name or id of the suite.",r),order:{type:"array",items:{type:"string"},description:"Ordered list of request names."}},required:["suite","order"]},annotations:{idempotentHint:!0}},{name:`${t}${G.duplicateSuite}`,description:"Clone an existing suite under a new name.",inputSchema:{type:"object",properties:{suite:Jr("Name or id of the suite to clone.",r),newName:{type:"string",description:"Name for the duplicated suite."}},required:["suite","newName"]},annotations:{idempotentHint:!1}},{name:`${t}${G.deleteSuite}`,description:"Delete a test suite permanently. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{suite:Jr("Name or id of the suite to delete.",r),confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["suite","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${G.listEnvironments}`,description:"List all environments with their variable keys (values hidden). Use get_environment_variables to see values.",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${G.getEnvironmentVariables}`,description:"Get the resolved (merged file + session overrides) variables for an environment.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name (defaults to active environment)."}}},annotations:{readOnlyHint:!0}},{name:`${t}${G.selectEnvironment}`,description:"Set the active environment for all subsequent run_* calls in this session.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Name of the environment to activate."}},required:["environment"]},annotations:{idempotentHint:!0}},{name:`${t}${G.createEnvironment}`,description:"Create a new environment file, optionally pre-populated with variables.",inputSchema:{type:"object",properties:{name:{type:"string",description:"Environment name (becomes the filename)."},variables:{type:"object",description:"Initial key/value variable map.",additionalProperties:{type:"string"}}},required:["name"]},annotations:{idempotentHint:!1}},{name:`${t}${G.deleteEnvironment}`,description:"Delete an environment file permanently. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name to delete."},confirm:{type:"boolean",description:"Must be true to confirm deletion."}},required:["environment","confirm"]},annotations:{destructiveHint:!0}},{name:`${t}${G.setEnvironmentVariable}`,description:'Set a variable in an environment. Scope "session" (default) is in-memory only and always temporary (both runtimes). Scope "permanent" writes to the env JSON config file \u2014 source-controlled and shared with the CLI runtime.',inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name (defaults to active environment)."},key:{type:"string",description:"Variable name."},value:{type:"string",description:"New value."},scope:{type:"string",enum:["session","permanent"],description:'Storage scope. "permanent" writes to disk.'}},required:["key","value"]},annotations:{idempotentHint:!0}},{name:`${t}${G.unsetEnvironmentVariable}`,description:"Remove a session-scoped variable override, restoring the file value.",inputSchema:{type:"object",properties:{environment:{type:"string",description:"Environment name (defaults to active environment)."},key:{type:"string",description:"Variable name to unset."}},required:["key"]},annotations:{idempotentHint:!0}},{name:`${t}${G.setGlobalVariable}`,description:'Set a global variable visible across all environments. Scope "session" (default) is in-memory only and lost on restart (both runtimes). Scope "permanent" writes to _global.json \u2014 source-controlled and shared with the CLI runtime.',inputSchema:{type:"object",properties:{key:{type:"string",description:"Global variable name."},value:{type:"string",description:"Value to set."},scope:{type:"string",enum:["session","permanent"],description:'Storage scope. "permanent" writes to _global.json.'}},required:["key","value"]},annotations:{idempotentHint:!0}},{name:`${t}${G.getGlobals}`,description:"Return all global variables (merged _global.json + runtime pm.globals.set() values).",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${G.scaffoldCollectionFromOpenApi}`,description:"Import an OpenAPI 3.0 spec (JSON or YAML) and scaffold a complete HTTP Forge collection from it. All operations become requests grouped by tag/path. An optional environment is created from the server URL. Returns the new collection id and name. Use this to quickly bootstrap API testing from a spec file.",inputSchema:{type:"object",properties:{specPath:{type:"string",description:"Absolute or workspace-relative path to the OpenAPI 3.0 JSON or YAML file."},collectionName:{type:"string",description:"Override the collection name (defaults to the spec title)."},environmentName:{type:"string",description:"Name for the generated environment that contains the server base URL. Omit to skip environment creation."}},required:["specPath"]},annotations:{idempotentHint:!1}},{name:`${t}${G.suggestAssertions}`,description:"Analyse the last execution history for a request and suggest pm.test() assertions to add to its post-response script. Covers status code, response time, required JSON fields, Content-Type header, and schema conformance. Returns an array of ready-to-paste JavaScript test snippets and a rationale for each.",inputSchema:{type:"object",properties:{collection:{type:"string",description:"Collection name or id that owns the request."},request:{type:"string",description:"Request name or id to analyse."},environment:{type:"string",description:"Environment used when the run was recorded (defaults to active environment)."},maxSuggestions:{type:"number",description:"Cap the number of suggestions returned (default: 10)."}},required:["collection","request"]},annotations:{readOnlyHint:!0}},{name:`${t}${G.explainFailure}`,description:"Explain why a specific request failed in a recent run. Returns the full request (URL, method, headers, body), the response received (status, headers, body), all assertion results, any script errors, and a plain-English diagnosis with suggested fixes. Provide either runId (from a prior run_suite/run_collection call) + request name, or the collection and request names to pull the most recent history entry.",inputSchema:{type:"object",properties:{runId:{type:"string",description:"MCP run id (from run_suite or run_collection). Mutually exclusive with collection+request history lookup."},collection:{type:"string",description:"Collection name or id. Required when runId is omitted."},request:{type:"string",description:"Request name or id."},iteration:{type:"number",description:"Iteration number within the run (default: 1)."}}},annotations:{readOnlyHint:!0}},{name:`${t}${G.suggestEnvVars}`,description:`Scan a collection for hardcoded values (API keys, base URLs, tokens, tenant IDs) that should become environment variables.
|
|
280
280
|
|
|
281
281
|
Returns:
|
|
282
282
|
\u2022 heuristicSuggestions \u2014 values identified by pattern-matching rules (ready to apply)
|
|
@@ -349,20 +349,20 @@ This tool returns request details AND a structured task. You MUST:
|
|
|
349
349
|
3. Return the rows as a JSON array under the key "iterationData" \u2014 each row is an object whose keys match the {{variable}} placeholders in the request.
|
|
350
350
|
4. Respond with the JSON array directly so the user can pass it to run_collection or the CLI --variables flag.
|
|
351
351
|
|
|
352
|
-
Example: for POST /users with body {"name":"{{name}}","email":"{{email}}"} and iterations=4, generate 4 rows: valid user, duplicate email, missing name, email with invalid format.`,inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name, slug, or id."},iterations:{type:"number",description:"Number of test data rows to generate (default: 5, max: 50)."}},required:["collection","request"]},annotations:{readOnlyHint:!0}}]}var qp,Ip,Op,Pp,G,kp=le(()=>{"use strict";qp={type:"object",properties:{environment:{type:"string",description:"Environment name to use (defaults to the currently selected environment)"},variables:{type:"object",description:"Extra variables to inject \u2014 merged with environment variables, {{name}} syntax",additionalProperties:{type:"string"}},headers:{type:"object",description:"Override or add request headers",additionalProperties:{type:"string"}},query:{type:"object",description:"Override query parameters",additionalProperties:{type:"string"}},body:{type:"string",description:"Replace the request body (JSON string). Omit to use the saved body."},include:{type:"array",items:{type:"string",enum:["headers","cookies","tests","consoleOutput","report"]},description:"Extra fields to include in the response (default: status, ok, body, allPassed)"}}},Ip={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},variables:{type:"object",description:"Extra variables injected into every request",additionalProperties:{type:"string"}},iterations:{type:"number",description:"Number of iterations (default: 1)"},concurrency:{type:"number",description:"Number of parallel virtual users (1\u201350, default: 1). Each VU runs the full request sequence independently, preserving inter-request dependencies."},stopOnError:{type:"boolean",description:"Stop on first failure"},delay:{type:"number",description:"Delay between requests in ms"},include:{type:"array",items:{type:"string",enum:["perRequest","failedOnly","consoleOutput","report"]},description:"Result detail level"},async:{type:"boolean",description:"When true, start the run in the background and return a runId immediately. Use get_run_status / get_failed_requests to poll results. Recommended for folders with many requests."}}},Op={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},variables:{type:"object",description:"Extra variables injected into every request",additionalProperties:{type:"string"}},iterations:{type:"number",description:"Number of iterations (default: 1)"},concurrency:{type:"number",description:"Number of parallel virtual users (1\u201350, default: 1). Each VU runs the full request sequence independently."},stopOnError:{type:"boolean",description:"Stop on first failure"},delay:{type:"number",description:"Delay between requests in ms"},recursive:{type:"boolean",description:"Include requests in nested subfolders (default: true)"},include:{type:"array",items:{type:"string",enum:["perRequest","failedOnly","consoleOutput","report"]},description:"Result detail level"},async:{type:"boolean",description:"When true, start the run in the background and return a runId immediately. Use get_run_status / get_failed_requests to poll results. Recommended for folders with many requests."}}},Pp={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},iterations:{type:"number",description:"Number of iterations (overrides suite default)"},concurrency:{type:"number",description:"Number of parallel virtual users (1\u201350, default: 1). Each VU runs the full request sequence independently."},stopOnError:{type:"boolean",description:"Stop on first failure"},delay:{type:"number",description:"Delay between requests in ms"},variables:{type:"object",description:"Extra variables injected into every request",additionalProperties:{type:"string"}},async:{type:"boolean",description:"When true, start the run in the background and return a runId immediately. Use get_run_status / get_failed_requests to poll results."},requestFilter:{type:"array",items:{type:"string"},description:"Run only requests whose names match one of these strings (case-insensitive)"},include:{type:"array",items:{type:"string",enum:["perRequest","failedOnly","consoleOutput","report"]},description:"Result detail level (default: summary + failedRequests)"}}},G={listCollections:"list_collections",listFolders:"list_folders",listRequests:"list_requests",searchRequests:"search_requests",getEnvironment:"get_environment",runRequest:"run_request",runFolder:"run_folder",runCollection:"run_collection",runSuite:"run_suite",getRunStatus:"get_run_status",getRunSummary:"get_run_summary",getFailedRequests:"get_failed_requests",getRequestResult:"get_request_result",cancelRun:"cancel_run",setVariable:"set_variable",createCollection:"create_collection",renameCollection:"rename_collection",deleteCollection:"delete_collection",duplicateCollection:"duplicate_collection",createFolder:"create_folder",deleteFolder:"delete_folder",getRequest:"get_request",createRequest:"create_request",updateRequest:"update_request",deleteRequest:"delete_request",getRequestScript:"get_request_script",setRequestScript:"set_request_script",reorderCollectionItems:"reorder_collection_items",listSuites:"list_suites",getSuite:"get_suite",createSuite:"create_suite",updateSuiteConfig:"update_suite_config",getSuiteNode:"get_suite_node",listSuiteNodePaths:"list_suite_node_paths",addSuiteNode:"add_suite_node",updateSuiteNode:"update_suite_node",removeSuiteNode:"remove_suite_node",moveSuiteNode:"move_suite_node",addSuiteRequests:"add_suite_requests",removeSuiteRequest:"remove_suite_request",reorderSuiteRequests:"reorder_suite_requests",duplicateSuite:"duplicate_suite",deleteSuite:"delete_suite",listEnvironments:"list_environments",getEnvironmentVariables:"get_environment_variables",selectEnvironment:"select_environment",createEnvironment:"create_environment",deleteEnvironment:"delete_environment",setEnvironmentVariable:"set_environment_variable",unsetEnvironmentVariable:"unset_environment_variable",setGlobalVariable:"set_global_variable",getGlobals:"get_globals",scaffoldCollectionFromOpenApi:"scaffold_collection_from_openapi",suggestAssertions:"suggest_assertions",explainFailure:"explain_failure",suggestEnvVars:"suggest_env_vars",applyEnvVars:"apply_env_vars",getRequestsForEnhancement:"get_requests_for_enhancement",applyRequestEnhancements:"apply_request_enhancements",aiSuggestEnvVars:"ai_suggest_env_vars",aiEnhanceCollection:"ai_enhance_collection",analyzeCoverage:"analyze_coverage",aiAnalyzeCoverage:"ai_analyze_coverage",generateRequestFromIntent:"generate_request_from_intent",validateAgainstSpec:"validate_against_spec",generateScenarios:"generate_scenarios",healAssertions:"heal_assertions",generateIterationData:"generate_iteration_data"}});function ue(t){return new Error(`Bad request: ${t}`)}function at(t,e){if(typeof t!="string"||!t.trim())throw ue('the "collection" argument is required');let r=t.toLowerCase(),n=e.find(i=>i.id===t||i.name===t)??e.find(i=>i.name.toLowerCase()===r)??e.find(i=>i.name.toLowerCase().includes(r))??e.find(i=>i.id.toLowerCase().includes(r));if(!n){let i=e.map(s=>`"${s.name}"`).join(", ");throw ue(`collection not found: "${t}". Available collections: ${i||"(none)"}. Call list_collections to see all.`)}return n}function ns(t,e){if(typeof t!="string"||!t.trim())throw ue('the "request" argument is required');let r=rt(e),n=t.toLowerCase(),i=r.find(s=>s.request.id===t||s.request.name===t)??r.find(s=>s.request.name.toLowerCase()===n)??r.find(s=>s.request.name.toLowerCase().includes(n));if(!i){let s=r.slice(0,10).map(o=>`"${o.request.name}"`).join(", ");throw ue(`request "${t}" not found in collection "${e.name}". First ${Math.min(r.length,10)} requests: ${s||"(none)"}. Call list_requests or search_requests to find the exact name.`)}return i.request}function wN(t,e){for(let r of t){if(r.type!=="folder")continue;let n=r;if(n.id===e)return n;let i=wN(n.items??[],e);if(i)return i}}async function qn(t,e){if(typeof t!="string"||!t.trim())throw ue('the "suite" argument is required');let r=await e.testSuite.getAllSuites(),n=t.toLowerCase(),i=r.find(s=>s.id===t||s.name===t)??r.find(s=>s.name.toLowerCase()===n);if(!i){let s=r.map(o=>`"${o.name}"`).join(", ");throw ue(`suite "${t}" not found. Available suites: ${s||"(none)"}. Call list_suites to see all.`)}return i}async function Yy(t,e,r,n,i){let s=r.collection.getAllCollections();if(t===G.listCollections)return{collections:s.map(v=>({name:v.name,id:v.id,description:v.description??"",requestCount:rt(v).length}))};if(t===G.listFolders){let v=at(e.collection,s);return{collection:v.name,folders:zr(v).map(({folderPath:_,requestCount:E})=>({path:rs(_),requestCount:E}))}}if(t===G.listRequests){let v=at(e.collection,s),_=typeof e.folder=="string"?e.folder.toLowerCase():void 0,E=typeof e.offset=="number"?Math.max(0,e.offset):0,k=typeof e.limit=="number"?Math.min(200,Math.max(1,e.limit)):50,P=rt(v).filter(({folderPath:M})=>!_||M.toLowerCase().includes(_)).map(({request:M,folderPath:j})=>({id:M.id,name:M.name,method:M.method,folder:rs(j),description:M.description??""}));return{collection:v.name,total:P.length,offset:E,limit:k,requests:P.slice(E,E+k)}}if(t===G.searchRequests){let v=at(e.collection,s),_=typeof e.query=="string"?e.query.toLowerCase().trim():"";if(!_)throw ue('the "query" argument is required');let E=rt(v).filter(({request:k,folderPath:P})=>k.name.toLowerCase().includes(_)||(k.url??"").toLowerCase().includes(_)||k.method.toLowerCase().includes(_)||P.toLowerCase().includes(_)||(k.description??"").toLowerCase().includes(_)).map(({request:k,folderPath:P})=>({id:k.id,name:k.name,method:k.method,url:k.url??"",folder:rs(P),description:k.description??""}));return{collection:v.name,query:e.query,total:E.length,requests:E}}if(t===G.getRequest){let v=at(e.collection,s),_=ns(e.request,v),E=r.collection.getRequestScript(v.id,_.id,"pre-request")??"",k=r.collection.getRequestScript(v.id,_.id,"post-response")??"";return{id:_.id,name:_.name,method:_.method,url:_.url??"",description:_.description??"",headers:_.headers??[],body:_.body??null,auth:_.auth??null,scripts:{preRequest:E,postResponse:k},hint:"Use update_request to modify fields, set_request_script to modify scripts, or run_request to execute it."}}if(t===G.getEnvironment){let v=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),_=r.environmentConfig.getResolvedEnvironment(v);if(!_)throw ue(`environment "${v}" not found`);return{name:_.name,variables:_.variables}}if(t===G.setVariable){let v=typeof e.key=="string"?e.key.trim():"",_=typeof e.value=="string"?e.value:String(e.value??"");if(!v)throw ue('"key" is required');let E=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment();return r.environmentConfig.setEnvironmentVariable(v,_,E),{set:!0,key:v,environment:E}}if(t===G.getRunStatus){let v=n.require(e.runId);return{runId:v.id,status:v.status,suiteName:v.suiteName,progress:v.progress,...v.error?{error:v.error}:{}}}if(t===G.getRunSummary){let v=n.require(e.runId);if(v.status==="running")return{runId:v.id,status:"running",progress:v.progress};let _=(v.summary.failed??0)>0||v.summary.allPassed===!1,E=v.noAssertionExamples??[],k=E.length,P=v.summary.total,M=k>0?k/(P||1)>.5?`${k}/${P} requests have no pm.test() assertions. Invoke the "review-collection" prompt (collection="${v.suiteName}") for a full coverage analysis.`:`${k} request(s) have no pm.test() assertions (e.g. ${E.slice(0,3).map(j=>`"${j}"`).join(", ")}). Invoke the "suggest-assertions" prompt (collection="${v.suiteName}") to add test coverage.`:null;return{runId:v.id,status:v.status,suiteName:v.suiteName,summary:v.summary,...v.reportPath?{report:{uri:`file://${v.reportPath}`}}:{},..._?{failedRequests:v.failedRequests}:{},..._?{_nextStep:`REQUIRED ACTION: ${v.summary.failed} request(s) failed. The failedRequests array above contains the full details (method, url, requestBody, requestHeaders, status, responseBody, failedTests). Immediately analyze each failed request and provide: (1) root cause, (2) specific fix, (3) corrected pm.test() assertions if relevant. Do NOT wait for the user to ask \u2014 diagnose now.`}:{},...M?{_suggestions:[M]}:{}}}if(t===G.getFailedRequests){let v=n.require(e.runId);if(v.status==="running")return{runId:v.id,status:"running",progress:v.progress,failedSoFar:v.failedRequests.length};let _=typeof e.offset=="number"?Math.max(0,e.offset):0,E=typeof e.limit=="number"?Math.min(100,Math.max(1,e.limit)):20;return{runId:v.id,status:v.status,totalFailed:v.failedRequests.length,offset:_,limit:E,failedRequests:v.failedRequests.slice(_,_+E)}}if(t===G.getRequestResult){let v=n.require(e.runId),_=e.request;if(typeof _!="string"||!_)throw ue('"request" is required');let E=typeof e.iteration=="number"?e.iteration:1,k=v.allResults.find(P=>P.iteration===E&&(P.name===_||P.name.toLowerCase()===_.toLowerCase()));if(!k){if(v.status==="running")return{runId:v.id,status:"running",message:`Request "${_}" has not completed yet.`};throw new Error(`Request "${_}" (iteration ${E}) not found in run "${v.id}".`)}return{runId:v.id,...k}}if(t===G.cancelRun){let v=n.require(e.runId);if(v.status!=="running")return{runId:v.id,status:v.status,cancelled:!1,message:`Run is already "${v.status}" \u2014 nothing to cancel.`};let _=n.cancel(String(e.runId));return{runId:v.id,status:"cancelled",cancelled:_,progress:v.progress,message:"Cancellation requested. The currently-executing request will finish; remaining requests will be skipped."}}if(t===G.runRequest){let v=at(e.collection,s),_=rt(v),E=typeof e.requestId=="string"?e.requestId.trim():void 0,k=e.request,P;if(E){if(P=_.find(M=>M.request.id===E),!P)throw ue(`request with id "${E}" not found in collection "${v.name}"`)}else{if(typeof k!="string"||!k.trim())throw ue('the "request" or "requestId" argument is required');if(P=_.find(M=>M.request.name===k)??_.find(M=>M.request.name.toLowerCase()===k.toLowerCase()),!P)throw ue(`request "${k}" not found in collection "${v.name}"`)}return i.runRequest(v,P.request.id,e)}if(t===G.runFolder){let v=at(e.collection,s);if(typeof e.folder!="string"||!e.folder.trim())throw ue('the "folder" argument is required');let _=e.folder.toLowerCase(),E=_p(e.folder),k=E.toLowerCase(),P=zr(v).map(j=>j.folderPath),M=P.find(j=>j===E)??P.find(j=>j.toLowerCase()===k)??P.find(j=>j.toLowerCase().includes(k))??P.find(j=>j.split("/").some(I=>I.toLowerCase().includes(k)));if(!M){let j=P.map(I=>`"${I}"`).join(", ");throw ue(`folder "${e.folder}" not found in collection "${v.name}". Available folders: ${j||"(none)"}. Call list_folders to see all.`)}return i.runFolder(v,M,e)}if(t===G.runCollection){let v=at(e.collection,s);return i.runCollection(v,e)}if(t===G.createCollection){let v=typeof e.name=="string"?e.name.trim():"";if(!v)throw ue('"name" is required');let _=await r.collection.createCollection(v);return{id:_.id,name:_.name,created:!0,hint:"Collection is empty. Call create_folder to add folders, or create_request to add requests directly."}}if(t===G.renameCollection){let v=at(e.collection,s),_=typeof e.newName=="string"?e.newName.trim():"";if(!_)throw ue('"newName" is required');return await r.collection.renameCollection(v.id,_),{id:v.id,oldName:v.name,newName:_,renamed:!0}}if(t===G.deleteCollection){if(e.confirm!==!0)throw ue('"confirm" must be true to delete a collection');let v=at(e.collection,s);return await r.collection.deleteCollection(v.id),{deleted:!0,collection:v.name}}if(t===G.duplicateCollection){let v=at(e.collection,s),_=typeof e.newName=="string"?e.newName.trim():"";if(!_)throw ue('"newName" is required');let E=await r.collection.duplicateCollection(v.id,_);return{id:E.id,name:E.name,duplicatedFrom:v.name}}if(t===G.createFolder){let v=at(e.collection,s),_=typeof e.name=="string"?e.name.trim():"";if(!_)throw ue('"name" is required');let E;if(typeof e.parentFolder=="string"&&e.parentFolder.trim()){let P=e.parentFolder.toLowerCase(),M=zr(v);if(rt(v).map(I=>I.folderPath)&&M.find(I=>I.folderPath===e.parentFolder||I.folderPath.toLowerCase()===P)){let R=zr(v).find(A=>A.folderPath===e.parentFolder||A.folderPath.toLowerCase()===P);if(R){let A=v.items,F=(D,J)=>{for(let Q of D)if(Q.type==="folder"){let se=Q;if(se.name===J||J.endsWith("/"+se.name))return se;let fe=F(se.items??[],J);if(fe)return fe}};E=F(A,R.folderPath)?.id}}}let k=await r.collection.createFolder({collectionId:v.id,name:_,parentId:E});return{id:k.id,name:k.name,created:!0,collection:v.name}}if(t===G.deleteFolder){if(e.confirm!==!0)throw ue('"confirm" must be true to delete a folder');let v=at(e.collection,s);if(typeof e.folder!="string"||!e.folder.trim())throw ue('"folder" is required');let _=e.folder.toLowerCase(),E=zr(v).find(M=>M.folderPath===e.folder||M.folderPath.toLowerCase()===_);if(!E)throw ue(`folder "${e.folder}" not found in collection "${v.name}"`);let k=wN(v.items,E.folderId);if(!k)throw ue(`folder "${e.folder}" could not be resolved`);let P=E.requestCount;return await r.collection.deleteFolder(v.id,k.id),{deleted:!0,folder:E.folderPath,requestsRemoved:P}}if(t===G.createRequest){let v=at(e.collection,s),_=typeof e.name=="string"?e.name.trim():"";if(!_)throw ue('"name" is required');let E=typeof e.method=="string"?e.method.toUpperCase():"GET",k=typeof e.url=="string"?e.url:"";if(!k)throw ue('"url" is required');let P;if(typeof e.folder=="string"&&e.folder.trim()){let I=e.folder.toLowerCase(),R=zr(v).find(A=>A.folderPath===e.folder||A.folderPath.toLowerCase()===I);R&&(P=R.folderId)}let M={collectionId:v.id,parentId:P,name:_,method:E,url:k,headers:void 0,body:e.body?{type:"raw",raw:String(e.body),contentType:"application/json"}:void 0,description:typeof e.description=="string"?e.description:void 0},j=await r.collection.createRequest(M);return{id:j.id,name:j.name,created:!0,collection:v.name,hint:"Request created. Call run_request to execute it, or set_request_script to add pre-request/post-response scripts."}}if(t===G.updateRequest){let v=at(e.collection,s),_=ns(e.request,v),E={};return typeof e.name=="string"&&(E.name=e.name),typeof e.method=="string"&&(E.method=e.method.toUpperCase()),typeof e.url=="string"&&(E.url=e.url),e.headers&&typeof e.headers=="object"&&!Array.isArray(e.headers)&&(E.headers=Object.entries(e.headers).map(([k,P])=>({name:k,value:String(P),enabled:!0}))),typeof e.body=="string"&&(E.body={type:"raw",raw:e.body,contentType:"application/json"}),typeof e.description=="string"&&(E.description=e.description),await r.collection.updateRequest(v.id,_.id,E),{updated:!0,request:_.name}}if(t===G.deleteRequest){if(e.confirm!==!0)throw ue('"confirm" must be true to delete a request');let v=at(e.collection,s),_=ns(e.request,v);return await r.collection.deleteRequest(v.id,_.id),{deleted:!0,request:_.name}}if(t===G.getRequestScript){let v=at(e.collection,s),_=ns(e.request,v),E=e.phase;if(E!=="pre-request"&&E!=="post-response")throw ue('"phase" must be "pre-request" or "post-response"');let k=r.collection.getRequestScript(v.id,_.id,E);return{collection:v.name,request:_.name,phase:E,script:k??""}}if(t===G.setRequestScript){let v=at(e.collection,s),_=ns(e.request,v),E=e.phase;if(E!=="pre-request"&&E!=="post-response")throw ue('"phase" must be "pre-request" or "post-response"');if(typeof e.script!="string")throw ue('"script" is required');return await r.collection.setRequestScript(v.id,_.id,E,e.script),{updated:!0,collection:v.name,request:_.name,phase:E}}if(t===G.reorderCollectionItems){let v=at(e.collection,s);if(!Array.isArray(e.order))throw ue('"order" must be an array');let _;if(typeof e.folder=="string"&&e.folder.trim()){let P=e.folder.toLowerCase(),M=zr(v).find(j=>j.folderPath===e.folder||j.folderPath.toLowerCase()===P);if(!M)throw ue(`folder "${e.folder}" not found in collection "${v.name}"`);_=M.folderId}let E=_?v.items.find(P=>P.id===_)?.items??[]:v.items,k=e.order.map(P=>E.find(j=>j.id===P||j.name===P)?.id??P);return await r.collection.reorderItems(v.id,_,k),{reordered:!0,collection:v.name,order:e.order}}let o=v=>(Array.isArray(v.nodes)?v.nodes:[]).every(E=>E?.type==="request"),l=(v,_="")=>{let E=[];if(!Array.isArray(v))return E;for(let k=0;k<v.length;k+=1){let P=v[k],M=_?`${_}.${k}`:`${k}`;!P||typeof P!="object"||(P.type==="request"&&E.push({node:P,path:M}),Array.isArray(P.nodes)&&E.push(...l(P.nodes,`${M}.nodes`)),Array.isArray(P.then)&&E.push(...l(P.then,`${M}.then`)),Array.isArray(P.else)&&E.push(...l(P.else,`${M}.else`)),Array.isArray(P.default)&&E.push(...l(P.default,`${M}.default`)),Array.isArray(P.elseif)&&P.elseif.forEach((j,I)=>{Array.isArray(j?.nodes)&&E.push(...l(j.nodes,`${M}.elseif.${I}.nodes`)),Array.isArray(j?.then)&&E.push(...l(j.then,`${M}.elseif.${I}.then`))}),Array.isArray(P.cases)&&P.cases.forEach((j,I)=>{Array.isArray(j?.nodes)&&E.push(...l(j.nodes,`${M}.cases.${I}.nodes`)),Array.isArray(j?.then)&&E.push(...l(j.then,`${M}.cases.${I}.then`))}))}return E},c=(v,_)=>{if(typeof v!="string"||!v.trim())throw ue(`"${_}" is required`);let E=v.trim(),k=E.split(".");if(k.some(P=>P===""))throw ue(`"${_}" is invalid: "${E}"`);return k.map(P=>/^\d+$/.test(P)?Number(P):P)},d=(v,_)=>{let E=c(_,"path"),k=v;for(let P of E)if(typeof P=="number"){if(!Array.isArray(k)||P<0||P>=k.length)throw ue(`node path not found: "${String(_)}"`);k=k[P]}else{if(!k||typeof k!="object"||!(P in k))throw ue(`node path not found: "${String(_)}"`);k=k[P]}return k},p=(v,_)=>{let E=c(_,"path"),k=E[E.length-1];if(typeof k!="number")throw ue(`"path" must end with a numeric index: "${String(_)}"`);let P=v;for(let M=0;M<E.length-1;M+=1){let j=E[M];if(typeof j=="number"){if(!Array.isArray(P)||j<0||j>=P.length)throw ue(`node path not found: "${String(_)}"`);P=P[j]}else{if(!P||typeof P!="object"||!(j in P))throw ue(`node path not found: "${String(_)}"`);P=P[j]}}if(!Array.isArray(P)||k<0||k>=P.length)throw ue(`node path not found: "${String(_)}"`);return{array:P,index:k}},m=(v,_,E,k)=>{if(_==null||_===""){if(E!=null&&E!=="")throw ue(`"${k}" is only valid when a parent path is provided`);return{array:v,pathPrefix:""}}if(typeof E!="string"||!E.trim())throw ue(`"${k}" is required when parent path is provided`);let P=String(_).trim(),M=E.trim(),j=d(v,P),I=c(M,k),R=j;for(let A=0;A<I.length;A+=1){let F=I[A],U=A===I.length-1;if(typeof F=="number"){if(!Array.isArray(R)||F<0||F>=R.length)throw ue(`branch path not found: "${M}"`);R=R[F]}else{if(!R||typeof R!="object")throw ue(`branch path not found: "${M}"`);if(!(F in R))if(U)R[F]=[];else throw ue(`branch path not found: "${M}"`);R=R[F]}}if(!Array.isArray(R))throw ue(`target branch must be an array: "${M}"`);return{array:R,pathPrefix:`${P}.${M}`}},y=(v,_="")=>{let E=[],k=[],P=(M,j)=>{if(Array.isArray(M)){j&&k.push(j);for(let I=0;I<M.length;I+=1){let R=M[I],A=j?`${j}.${I}`:`${I}`;E.push({path:A,type:R?.type,name:R?.name}),!(!R||typeof R!="object")&&(Array.isArray(R.nodes)&&P(R.nodes,`${A}.nodes`),Array.isArray(R.then)&&P(R.then,`${A}.then`),Array.isArray(R.else)&&P(R.else,`${A}.else`),Array.isArray(R.default)&&P(R.default,`${A}.default`),Array.isArray(R.cases)&&R.cases.forEach((F,U)=>{Array.isArray(F?.nodes)&&P(F.nodes,`${A}.cases.${U}.nodes`),Array.isArray(F?.then)&&P(F.then,`${A}.cases.${U}.then`)}),Array.isArray(R.elseif)&&R.elseif.forEach((F,U)=>{Array.isArray(F?.nodes)&&P(F.nodes,`${A}.elseif.${U}.nodes`),Array.isArray(F?.then)&&P(F.then,`${A}.elseif.${U}.then`)}))}}};return P(v,_),{nodePaths:E,branchPaths:k}};if(t===G.listSuites)return{suites:(await r.testSuite.getAllSuites()).map(_=>({id:_.id,name:_.name,description:_.description??"",requestCount:l(_.nodes||[]).length,flowNodeCount:_.nodes?.length??0,iterations:_.config?.iterations??1}))};if(t===G.getSuite){let v=await qn(e.suite,r),_=l(v.nodes||[]);return{id:v.id,name:v.name,description:v.description??"",config:{iterations:v.config?.iterations??1,delayBetweenRequests:v.config?.delayBetweenRequests??0,stopOnError:v.config?.stopOnError??!1},nodes:v.nodes||[],requests:_.map(({node:E,path:k})=>{let P=E.request;return{nodePath:k,slug:P.slug??P.requestId,collectionId:P.collectionId,requestId:P.requestId,name:P.name,method:P.method,folderPath:P.folderPath??"",enabled:E.enabled!==!1}})}}if(t===G.createSuite){let v=typeof e.name=="string"?e.name.trim():"";if(!v)throw ue('"name" is required');let _;if(typeof e.fromCollection=="string"&&e.fromCollection.trim()){let E=at(e.fromCollection,s),k=await r.testSuite.createTempSuiteFromCollection(E.id);if(!k)throw new Error(`Could not build suite from collection "${E.name}"`);if(typeof e.fromFolder=="string"&&e.fromFolder.trim()){let P=_p(e.fromFolder),M=k.nodes||[];k.nodes=M.filter(j=>{if(j.type!=="request")return!0;let I=j.request?.folderPath||"";return I===P||I.startsWith(`${P}/`)})}_=await r.testSuite.saveTempSuite(k,v)}else _=await r.testSuite.createSuite(v);if(e.iterations!==void 0||e.stopOnError!==void 0||e.delayBetweenRequests!==void 0||e.description!==void 0||e.nodes!==void 0){if(e.description!==void 0&&(_.description=String(e.description)),e.nodes!==void 0){if(!Array.isArray(e.nodes))throw ue('"nodes" must be an array when provided');_.nodes=e.nodes}_.config={..._.config,...typeof e.iterations=="number"?{iterations:e.iterations}:{},...typeof e.stopOnError=="boolean"?{stopOnError:e.stopOnError}:{},...typeof e.delayBetweenRequests=="number"?{delayBetweenRequests:e.delayBetweenRequests}:{}},await r.testSuite.updateSuite(_)}return{id:_.id,name:_.name,requestCount:_.nodes?.filter(E=>E.type==="request").length??0,created:!0,hint:(_.nodes?.filter(E=>E.type==="request").length??0)===0?"Suite is empty. Call add_suite_requests to populate it with requests from a collection.":"Suite created. Call run_suite to execute it."}}if(t===G.updateSuiteConfig){let v=await qn(e.suite,r);if(typeof e.name=="string"&&e.name.trim()&&(v.name=e.name.trim()),typeof e.description=="string"&&(v.description=e.description),e.nodes!==void 0){if(!Array.isArray(e.nodes))throw ue('"nodes" must be an array when provided');v.nodes=e.nodes}return v.config={...v.config,...typeof e.iterations=="number"?{iterations:e.iterations}:{},...typeof e.stopOnError=="boolean"?{stopOnError:e.stopOnError}:{},...typeof e.delayBetweenRequests=="number"?{delayBetweenRequests:e.delayBetweenRequests}:{}},await r.testSuite.updateSuite(v),{updated:!0,suite:v.name}}if(t===G.getSuiteNode){let v=await qn(e.suite,r);Array.isArray(v.nodes)||(v.nodes=[]);let _=d(v.nodes,e.path);return{suite:v.name,path:String(e.path),node:_}}if(t===G.listSuiteNodePaths){let v=await qn(e.suite,r);Array.isArray(v.nodes)||(v.nodes=[]);let _=e.includeBranches!==!1,E=y(v.nodes);return{suite:v.name,nodeCount:E.nodePaths.length,nodePaths:E.nodePaths,branchPaths:_?E.branchPaths:void 0,rootBranchPath:""}}if(t===G.addSuiteNode){let v=await qn(e.suite,r);if(Array.isArray(v.nodes)||(v.nodes=[]),!e.node||typeof e.node!="object"||Array.isArray(e.node))throw ue('"node" must be an object');let{array:_,pathPrefix:E}=m(v.nodes,e.parentPath,e.branch,"branch"),k=typeof e.index=="number"?Math.max(0,Math.min(e.index,_.length)):_.length;_.splice(k,0,e.node),await r.testSuite.updateSuite(v);let P=E?`${E}.${k}`:`${k}`;return{added:!0,suite:v.name,path:P}}if(t===G.updateSuiteNode){let v=await qn(e.suite,r);if(Array.isArray(v.nodes)||(v.nodes=[]),!e.node||typeof e.node!="object"||Array.isArray(e.node))throw ue('"node" must be an object');let _=p(v.nodes,e.path);return _.array[_.index]=e.node,await r.testSuite.updateSuite(v),{updated:!0,suite:v.name,path:String(e.path)}}if(t===G.removeSuiteNode){let v=await qn(e.suite,r);Array.isArray(v.nodes)||(v.nodes=[]);let _=p(v.nodes,e.path),[E]=_.array.splice(_.index,1);return await r.testSuite.updateSuite(v),{removed:!0,suite:v.name,path:String(e.path),removedType:E?.type}}if(t===G.moveSuiteNode){let v=await qn(e.suite,r);Array.isArray(v.nodes)||(v.nodes=[]);let _=p(v.nodes,e.fromPath),E=_.array[_.index];_.array.splice(_.index,1);let{array:k,pathPrefix:P}=m(v.nodes,e.toParentPath,e.toBranch,"toBranch"),M=typeof e.toIndex=="number"?Math.max(0,Math.min(e.toIndex,k.length)):k.length;_.array===k&&_.index<M&&(M-=1),k.splice(M,0,E),await r.testSuite.updateSuite(v);let j=P?`${P}.${M}`:`${M}`;return{moved:!0,suite:v.name,fromPath:String(e.fromPath),toPath:j}}if(t===G.addSuiteRequests){let v=await qn(e.suite,r),_=Array.isArray(e.requests)?e.requests:[];if(_.length===0)throw ue('"requests" array is required and must not be empty');let E=[];for(let M of _){let j=at(M.collection,s),I=ns(M.request,j),R=rt(j).find(A=>A.request.id===I.id)?.folderPath??"";E.push({slug:I.id,collectionId:j.id,requestId:I.id,name:I.name,method:I.method,collectionName:j.name,folderPath:R,enabled:!0})}v.nodes||(v.nodes=[]);let k=E.map(M=>({type:"request",name:M.name,request:M,enabled:!0})),P=typeof e.insertAt=="number"?Math.max(0,Math.min(e.insertAt,v.nodes.length)):v.nodes.length;return v.nodes.splice(P,0,...k),await r.testSuite.updateSuite(v),{added:E.length,suite:v.name,insertAt:P,addedPaths:k.map((M,j)=>`${P+j}`),newRequestCount:l(v.nodes||[]).length}}if(t===G.removeSuiteRequest){let v=await qn(e.suite,r);if(!o(v))throw ue('remove_suite_request currently supports request-only root suites. For flow suites, use get_suite/update_suite_config with the full "nodes" graph.');v.nodes||(v.nodes=[]);let _=v.nodes.filter(k=>k.type==="request"),E;if(typeof e.index=="number"){if(e.index<0||e.index>=_.length)throw ue(`index ${e.index} is out of range`);let k=_[e.index];E=k.name||k.request?.name,v.nodes=v.nodes.filter(P=>P!==k)}else if(typeof e.request=="string"){let k=e.request.toLowerCase(),P=_.find(M=>{let j=M.request?.name||M.name||"";return j===e.request||j.toLowerCase()===k});if(!P)throw ue(`request "${e.request}" not found in suite "${v.name}"`);E=P.name||P.request?.name,v.nodes=v.nodes.filter(M=>M!==P)}else throw ue('either "index" or "request" is required');return await r.testSuite.updateSuite(v),{removed:!0,request:E,newRequestCount:v.nodes.filter(k=>k.type==="request").length}}if(t===G.reorderSuiteRequests){let v=await qn(e.suite,r);if(!o(v))throw ue('reorder_suite_requests currently supports request-only root suites. For flow suites, use get_suite/update_suite_config with the full "nodes" graph.');if(!Array.isArray(e.order))throw ue('"order" must be an array of request names');let _=e.order,E=(v.nodes||[]).filter(M=>M.type==="request"),k=(v.nodes||[]).filter(M=>M.type!=="request"),P=[...E].sort((M,j)=>{let I=M.request?.name||M.name||"",R=j.request?.name||j.name||"",A=_.findIndex(J=>J===I||J.toLowerCase()===I.toLowerCase()),F=_.findIndex(J=>J===R||J.toLowerCase()===R.toLowerCase());return(A===-1?1/0:A)-(F===-1?1/0:F)});return v.nodes=[...P,...k],await r.testSuite.updateSuite(v),{reordered:!0,suite:v.name,newOrder:P.map(M=>M.request?.name||M.name)}}if(t===G.duplicateSuite){let v=await qn(e.suite,r),_=typeof e.newName=="string"?e.newName.trim():"";if(!_)throw ue('"newName" is required');let E=await r.testSuite.duplicateSuite(v.id,_);return{id:E.id,name:E.name,duplicatedFrom:v.name,requestCount:E.nodes?.filter(k=>k.type==="request").length??0}}if(t===G.deleteSuite){if(e.confirm!==!0)throw ue('"confirm" must be true to delete a suite');let v=await qn(e.suite,r);return await r.testSuite.deleteSuite(v.id),{deleted:!0,suite:v.name}}if(t===G.listEnvironments){let v=r.environmentConfig.getAllEnvironments(),_=r.environmentConfig.getSelectedEnvironment();return{environments:v.map(E=>({name:E.name,active:E.active,variableKeys:Object.keys(E.variables)})),active:_}}if(t===G.getEnvironmentVariables){let v=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),_=r.environmentConfig.getResolvedEnvironment(v);if(!_)throw ue(`environment "${v}" not found`);let k=r.environmentConfig.getSharedConfig()?.environments?.[v]?.variables??{},P=r.environmentConfig.getEnvironmentVariableLocals();return{environment:v,active:r.environmentConfig.getSelectedEnvironment()===v,fileVariables:k,sessionOverrides:P,resolved:_.variables}}if(t===G.selectEnvironment){let v=typeof e.environment=="string"?e.environment.trim():"";if(!v)throw ue('"environment" is required');return await r.environmentConfig.setSelectedEnvironment(v),{selected:!0,environment:v}}if(t===G.createEnvironment){let v=typeof e.name=="string"?e.name.trim():"";if(!v)throw ue('"name" is required');if(await r.environmentConfig.createEnvironment(v),e.variables&&typeof e.variables=="object"){let _=e.variables,E=r.environmentConfig.getSharedConfig();E&&(E.environments=E.environments??{},E.environments[v]={...E.environments[v]??{},variables:{...E.environments[v]?.variables??{},..._}},r.environmentConfig.saveSharedConfig(E))}return{created:!0,environment:v}}if(t===G.deleteEnvironment){if(e.confirm!==!0)throw ue('"confirm" must be true to delete an environment');let v=typeof e.environment=="string"?e.environment.trim():"";if(!v)throw ue('"environment" is required');let _=r.environmentConfig.getSelectedEnvironment();return await r.environmentConfig.deleteEnvironment(v),{deleted:!0,environment:v,newActive:_===v?void 0:_}}if(t===G.setEnvironmentVariable){let v=typeof e.key=="string"?e.key.trim():"",_=typeof e.value=="string"?e.value:String(e.value??"");if(!v)throw ue('"key" is required');let E=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),k=e.scope==="permanent"?"permanent":"session";if(k==="permanent"){let P=r.environmentConfig.getSharedConfig();P&&(P.environments=P.environments??{},P.environments[E]=P.environments[E]??{variables:{}},P.environments[E].variables=P.environments[E].variables??{},P.environments[E].variables[v]=_,r.environmentConfig.saveSharedConfig(P))}else r.environmentConfig.setEnvironmentVariable(v,_,E);return{set:!0,key:v,environment:E,scope:k}}if(t===G.unsetEnvironmentVariable){let v=typeof e.key=="string"?e.key.trim():"";if(!v)throw ue('"key" is required');let _=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment();return r.environmentConfig.deleteEnvironmentVariable(v,_),{unset:!0,key:v,environment:_}}if(t===G.setGlobalVariable){let v=typeof e.key=="string"?e.key.trim():"",_=typeof e.value=="string"?e.value:String(e.value??"");if(!v)throw ue('"key" is required');let E=e.scope==="permanent"?"permanent":"session";if(E==="permanent"){let k=r.environmentConfig.getSharedConfig();k&&(k.globalVariables=k.globalVariables??{},k.globalVariables[v]=_,r.environmentConfig.saveSharedConfig(k))}else r.environmentConfig.setGlobalVariable(v,_);return{set:!0,key:v,scope:E}}if(t===G.getGlobals)return{globals:r.environmentConfig.getGlobalVariables()};if(t===G.scaffoldCollectionFromOpenApi){let v=typeof e.specPath=="string"?e.specPath.trim():"";if(!v)throw ue('"specPath" is required');let _=r.workspaceFolder&&!is.isAbsolute(v)?is.join(r.workspaceFolder,v):v;if(!Ap.existsSync(_))throw ue(`OpenAPI spec file not found: "${_}"`);let k=await new Hs(r.collection,r.environmentConfig).import(_,{collectionName:typeof e.collectionName=="string"?e.collectionName:void 0,environmentName:typeof e.environmentName=="string"?e.environmentName:void 0});return{collectionId:k.collection.id,collectionName:k.collection.name,requestCount:k.collection.items.filter(P=>P.type==="request").length,environmentCreated:k.environmentCreated??null,hint:"Use list_requests to browse the scaffolded collection, then run_request to test individual endpoints."}}if(t===G.suggestAssertions){let v=e.collection;if(!(typeof e.request=="string"?e.request.trim():""))throw ue('"request" is required');let E=at(v,s),k=ns(e.request,E),P=typeof e.maxSuggestions=="number"?Math.min(20,Math.max(1,e.maxSuggestions)):10,M=[],I=Array.from(n.values()).filter(U=>U.status!=="running").flatMap(U=>U.allResults??[]).filter(U=>U.name===k.name||typeof U.name=="string"&&U.name.toLowerCase()===k.name.toLowerCase()),R=I[I.length-1],A=R?.status;A?M.push({snippet:`pm.test("Status code is ${A}", function () {
|
|
352
|
+
Example: for POST /users with body {"name":"{{name}}","email":"{{email}}"} and iterations=4, generate 4 rows: valid user, duplicate email, missing name, email with invalid format.`,inputSchema:{type:"object",properties:{collection:n(!0),request:{type:"string",description:"Request name, slug, or id."},iterations:{type:"number",description:"Number of test data rows to generate (default: 5, max: 50)."}},required:["collection","request"]},annotations:{readOnlyHint:!0}}]}var qp,Ip,Op,Pp,G,kp=le(()=>{"use strict";qp={type:"object",properties:{environment:{type:"string",description:"Environment name to use (defaults to the currently selected environment)"},variables:{type:"object",description:"Extra variables to inject \u2014 merged with environment variables, {{name}} syntax",additionalProperties:{type:"string"}},headers:{type:"object",description:"Override or add request headers",additionalProperties:{type:"string"}},query:{type:"object",description:"Override query parameters",additionalProperties:{type:"string"}},body:{type:"string",description:"Replace the request body (JSON string). Omit to use the saved body."},include:{type:"array",items:{type:"string",enum:["headers","cookies","tests","consoleOutput","report"]},description:"Extra fields to include in the response (default: status, ok, body, allPassed)"}}},Ip={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},variables:{type:"object",description:"Extra variables injected into every request",additionalProperties:{type:"string"}},iterations:{type:"number",description:"Number of iterations (default: 1)"},concurrency:{type:"number",description:"Number of parallel virtual users (1\u201350, default: 1). Each VU runs the full request sequence independently, preserving inter-request dependencies."},stopOnError:{type:"boolean",description:"Stop on first failure"},delay:{type:"number",description:"Delay between requests in ms"},include:{type:"array",items:{type:"string",enum:["perRequest","failedOnly","consoleOutput","report"]},description:"Result detail level"},async:{type:"boolean",description:"When true, start the run in the background and return a runId immediately. Use get_run_status / get_failed_requests to poll results. Recommended for folders with many requests."}}},Op={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},variables:{type:"object",description:"Extra variables injected into every request",additionalProperties:{type:"string"}},iterations:{type:"number",description:"Number of iterations (default: 1)"},concurrency:{type:"number",description:"Number of parallel virtual users (1\u201350, default: 1). Each VU runs the full request sequence independently."},stopOnError:{type:"boolean",description:"Stop on first failure"},delay:{type:"number",description:"Delay between requests in ms"},recursive:{type:"boolean",description:"Include requests in nested subfolders (default: true)"},include:{type:"array",items:{type:"string",enum:["perRequest","failedOnly","consoleOutput","report"]},description:"Result detail level"},async:{type:"boolean",description:"When true, start the run in the background and return a runId immediately. Use get_run_status / get_failed_requests to poll results. Recommended for folders with many requests."}}},Pp={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},iterations:{type:"number",description:"Number of iterations (overrides suite default)"},concurrency:{type:"number",description:"Number of parallel virtual users (1\u201350, default: 1). Each VU runs the full request sequence independently."},stopOnError:{type:"boolean",description:"Stop on first failure"},delay:{type:"number",description:"Delay between requests in ms"},variables:{type:"object",description:"Extra variables injected into every request",additionalProperties:{type:"string"}},async:{type:"boolean",description:"When true, start the run in the background and return a runId immediately. Use get_run_status / get_failed_requests to poll results."},requestFilter:{type:"array",items:{type:"string"},description:"Run only requests whose names match one of these strings (case-insensitive)"},include:{type:"array",items:{type:"string",enum:["perRequest","failedOnly","consoleOutput","report"]},description:"Result detail level (default: summary + failedRequests)"}}},G={listCollections:"list_collections",listFolders:"list_folders",listRequests:"list_requests",searchRequests:"search_requests",getEnvironment:"get_environment",runRequest:"run_request",runFolder:"run_folder",runCollection:"run_collection",runSuite:"run_suite",getRunStatus:"get_run_status",getRunSummary:"get_run_summary",getFailedRequests:"get_failed_requests",getRequestResult:"get_request_result",cancelRun:"cancel_run",setVariable:"set_variable",createCollection:"create_collection",renameCollection:"rename_collection",deleteCollection:"delete_collection",duplicateCollection:"duplicate_collection",createFolder:"create_folder",deleteFolder:"delete_folder",getRequest:"get_request",createRequest:"create_request",updateRequest:"update_request",deleteRequest:"delete_request",getRequestScript:"get_request_script",setRequestScript:"set_request_script",reorderCollectionItems:"reorder_collection_items",listSuites:"list_suites",getSuite:"get_suite",createSuite:"create_suite",updateSuiteConfig:"update_suite_config",getSuiteNode:"get_suite_node",listSuiteNodePaths:"list_suite_node_paths",addSuiteNode:"add_suite_node",updateSuiteNode:"update_suite_node",removeSuiteNode:"remove_suite_node",moveSuiteNode:"move_suite_node",addSuiteRequests:"add_suite_requests",removeSuiteRequest:"remove_suite_request",reorderSuiteRequests:"reorder_suite_requests",duplicateSuite:"duplicate_suite",deleteSuite:"delete_suite",listEnvironments:"list_environments",getEnvironmentVariables:"get_environment_variables",selectEnvironment:"select_environment",createEnvironment:"create_environment",deleteEnvironment:"delete_environment",setEnvironmentVariable:"set_environment_variable",unsetEnvironmentVariable:"unset_environment_variable",setGlobalVariable:"set_global_variable",getGlobals:"get_globals",scaffoldCollectionFromOpenApi:"scaffold_collection_from_openapi",suggestAssertions:"suggest_assertions",explainFailure:"explain_failure",suggestEnvVars:"suggest_env_vars",applyEnvVars:"apply_env_vars",getRequestsForEnhancement:"get_requests_for_enhancement",applyRequestEnhancements:"apply_request_enhancements",aiSuggestEnvVars:"ai_suggest_env_vars",aiEnhanceCollection:"ai_enhance_collection",analyzeCoverage:"analyze_coverage",aiAnalyzeCoverage:"ai_analyze_coverage",generateRequestFromIntent:"generate_request_from_intent",validateAgainstSpec:"validate_against_spec",generateScenarios:"generate_scenarios",healAssertions:"heal_assertions",generateIterationData:"generate_iteration_data"}});function ue(t){return new Error(`Bad request: ${t}`)}function at(t,e){if(typeof t!="string"||!t.trim())throw ue('the "collection" argument is required');let r=t.toLowerCase(),n=e.find(i=>i.id===t||i.name===t)??e.find(i=>i.name.toLowerCase()===r)??e.find(i=>i.name.toLowerCase().includes(r))??e.find(i=>i.id.toLowerCase().includes(r));if(!n){let i=e.map(s=>`"${s.name}"`).join(", ");throw ue(`collection not found: "${t}". Available collections: ${i||"(none)"}. Call list_collections to see all.`)}return n}function ns(t,e){if(typeof t!="string"||!t.trim())throw ue('the "request" argument is required');let r=rt(e),n=t.toLowerCase(),i=r.find(s=>s.request.id===t||s.request.name===t)??r.find(s=>s.request.name.toLowerCase()===n)??r.find(s=>s.request.name.toLowerCase().includes(n));if(!i){let s=r.slice(0,10).map(o=>`"${o.request.name}"`).join(", ");throw ue(`request "${t}" not found in collection "${e.name}". First ${Math.min(r.length,10)} requests: ${s||"(none)"}. Call list_requests or search_requests to find the exact name.`)}return i.request}function wN(t,e){for(let r of t){if(r.type!=="folder")continue;let n=r;if(n.id===e)return n;let i=wN(n.items??[],e);if(i)return i}}async function qn(t,e){if(typeof t!="string"||!t.trim())throw ue('the "suite" argument is required');let r=await e.testSuite.getAllSuites(),n=t.toLowerCase(),i=r.find(s=>s.id===t||s.name===t)??r.find(s=>s.name.toLowerCase()===n);if(!i){let s=r.map(o=>`"${o.name}"`).join(", ");throw ue(`suite "${t}" not found. Available suites: ${s||"(none)"}. Call list_suites to see all.`)}return i}async function Yy(t,e,r,n,i){let s=r.collection.getAllCollections();if(t===G.listCollections)return{collections:s.map(v=>({name:v.name,id:v.id,description:v.description??"",requestCount:rt(v).length}))};if(t===G.listFolders){let v=at(e.collection,s);return{collection:v.name,folders:zr(v).map(({folderPath:R,requestCount:E})=>({path:rs(R),requestCount:E}))}}if(t===G.listRequests){let v=at(e.collection,s),R=typeof e.folder=="string"?e.folder.toLowerCase():void 0,E=typeof e.offset=="number"?Math.max(0,e.offset):0,k=typeof e.limit=="number"?Math.min(200,Math.max(1,e.limit)):50,P=rt(v).filter(({folderPath:M})=>!R||M.toLowerCase().includes(R)).map(({request:M,folderPath:j})=>({id:M.id,name:M.name,method:M.method,folder:rs(j),description:M.description??""}));return{collection:v.name,total:P.length,offset:E,limit:k,requests:P.slice(E,E+k)}}if(t===G.searchRequests){let v=at(e.collection,s),R=typeof e.query=="string"?e.query.toLowerCase().trim():"";if(!R)throw ue('the "query" argument is required');let E=rt(v).filter(({request:k,folderPath:P})=>k.name.toLowerCase().includes(R)||(k.url??"").toLowerCase().includes(R)||k.method.toLowerCase().includes(R)||P.toLowerCase().includes(R)||(k.description??"").toLowerCase().includes(R)).map(({request:k,folderPath:P})=>({id:k.id,name:k.name,method:k.method,url:k.url??"",folder:rs(P),description:k.description??""}));return{collection:v.name,query:e.query,total:E.length,requests:E}}if(t===G.getRequest){let v=at(e.collection,s),R=ns(e.request,v),E=r.collection.getRequestScript(v.id,R.id,"pre-request")??"",k=r.collection.getRequestScript(v.id,R.id,"post-response")??"";return{id:R.id,name:R.name,method:R.method,url:R.url??"",description:R.description??"",headers:R.headers??[],body:R.body??null,auth:R.auth??null,scripts:{preRequest:E,postResponse:k},hint:"Use update_request to modify fields, set_request_script to modify scripts, or run_request to execute it."}}if(t===G.getEnvironment){let v=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),R=r.environmentConfig.getResolvedEnvironment(v);if(!R)throw ue(`environment "${v}" not found`);return{name:R.name,variables:R.variables}}if(t===G.setVariable){let v=typeof e.key=="string"?e.key.trim():"",R=typeof e.value=="string"?e.value:String(e.value??"");if(!v)throw ue('"key" is required');let E=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment();return r.environmentConfig.setEnvironmentVariable(v,R,E),{set:!0,key:v,environment:E}}if(t===G.getRunStatus){let v=n.require(e.runId);return{runId:v.id,status:v.status,suiteName:v.suiteName,progress:v.progress,...v.error?{error:v.error}:{}}}if(t===G.getRunSummary){let v=n.require(e.runId);if(v.status==="running")return{runId:v.id,status:"running",progress:v.progress};let R=(v.summary.failed??0)>0||v.summary.allPassed===!1,E=v.noAssertionExamples??[],k=E.length,P=v.summary.total,M=k>0?k/(P||1)>.5?`${k}/${P} requests have no pm.test() assertions. Invoke the "review-collection" prompt (collection="${v.suiteName}") for a full coverage analysis.`:`${k} request(s) have no pm.test() assertions (e.g. ${E.slice(0,3).map(j=>`"${j}"`).join(", ")}). Invoke the "suggest-assertions" prompt (collection="${v.suiteName}") to add test coverage.`:null;return{runId:v.id,status:v.status,suiteName:v.suiteName,summary:v.summary,...v.reportPath?{report:{uri:`file://${v.reportPath}`}}:{},...R?{failedRequests:v.failedRequests}:{},...R?{_nextStep:`REQUIRED ACTION: ${v.summary.failed} request(s) failed. The failedRequests array above contains the full details (method, url, requestBody, requestHeaders, status, responseBody, failedTests). Immediately analyze each failed request and provide: (1) root cause, (2) specific fix, (3) corrected pm.test() assertions if relevant. Do NOT wait for the user to ask \u2014 diagnose now.`}:{},...M?{_suggestions:[M]}:{}}}if(t===G.getFailedRequests){let v=n.require(e.runId);if(v.status==="running")return{runId:v.id,status:"running",progress:v.progress,failedSoFar:v.failedRequests.length};let R=typeof e.offset=="number"?Math.max(0,e.offset):0,E=typeof e.limit=="number"?Math.min(100,Math.max(1,e.limit)):20;return{runId:v.id,status:v.status,totalFailed:v.failedRequests.length,offset:R,limit:E,failedRequests:v.failedRequests.slice(R,R+E)}}if(t===G.getRequestResult){let v=n.require(e.runId),R=e.request;if(typeof R!="string"||!R)throw ue('"request" is required');let E=typeof e.iteration=="number"?e.iteration:1,k=v.allResults.find(P=>P.iteration===E&&(P.name===R||P.name.toLowerCase()===R.toLowerCase()));if(!k){if(v.status==="running")return{runId:v.id,status:"running",message:`Request "${R}" has not completed yet.`};throw new Error(`Request "${R}" (iteration ${E}) not found in run "${v.id}".`)}return{runId:v.id,...k}}if(t===G.cancelRun){let v=n.require(e.runId);if(v.status!=="running")return{runId:v.id,status:v.status,cancelled:!1,message:`Run is already "${v.status}" \u2014 nothing to cancel.`};let R=n.cancel(String(e.runId));return{runId:v.id,status:"cancelled",cancelled:R,progress:v.progress,message:"Cancellation requested. The currently-executing request will finish; remaining requests will be skipped."}}if(t===G.runRequest){let v=at(e.collection,s),R=rt(v),E=typeof e.requestId=="string"?e.requestId.trim():void 0,k=e.request,P;if(E){if(P=R.find(M=>M.request.id===E),!P)throw ue(`request with id "${E}" not found in collection "${v.name}"`)}else{if(typeof k!="string"||!k.trim())throw ue('the "request" or "requestId" argument is required');if(P=R.find(M=>M.request.name===k)??R.find(M=>M.request.name.toLowerCase()===k.toLowerCase()),!P)throw ue(`request "${k}" not found in collection "${v.name}"`)}return i.runRequest(v,P.request.id,e)}if(t===G.runFolder){let v=at(e.collection,s);if(typeof e.folder!="string"||!e.folder.trim())throw ue('the "folder" argument is required');let R=e.folder.toLowerCase(),E=_p(e.folder),k=E.toLowerCase(),P=zr(v).map(j=>j.folderPath),M=P.find(j=>j===E)??P.find(j=>j.toLowerCase()===k)??P.find(j=>j.toLowerCase().includes(k))??P.find(j=>j.split("/").some(I=>I.toLowerCase().includes(k)));if(!M){let j=P.map(I=>`"${I}"`).join(", ");throw ue(`folder "${e.folder}" not found in collection "${v.name}". Available folders: ${j||"(none)"}. Call list_folders to see all.`)}return i.runFolder(v,M,e)}if(t===G.runCollection){let v=at(e.collection,s);return i.runCollection(v,e)}if(t===G.createCollection){let v=typeof e.name=="string"?e.name.trim():"";if(!v)throw ue('"name" is required');let R=await r.collection.createCollection(v);return{id:R.id,name:R.name,created:!0,hint:"Collection is empty. Call create_folder to add folders, or create_request to add requests directly."}}if(t===G.renameCollection){let v=at(e.collection,s),R=typeof e.newName=="string"?e.newName.trim():"";if(!R)throw ue('"newName" is required');return await r.collection.renameCollection(v.id,R),{id:v.id,oldName:v.name,newName:R,renamed:!0}}if(t===G.deleteCollection){if(e.confirm!==!0)throw ue('"confirm" must be true to delete a collection');let v=at(e.collection,s);return await r.collection.deleteCollection(v.id),{deleted:!0,collection:v.name}}if(t===G.duplicateCollection){let v=at(e.collection,s),R=typeof e.newName=="string"?e.newName.trim():"";if(!R)throw ue('"newName" is required');let E=await r.collection.duplicateCollection(v.id,R);return{id:E.id,name:E.name,duplicatedFrom:v.name}}if(t===G.createFolder){let v=at(e.collection,s),R=typeof e.name=="string"?e.name.trim():"";if(!R)throw ue('"name" is required');let E;if(typeof e.parentFolder=="string"&&e.parentFolder.trim()){let P=e.parentFolder.toLowerCase(),M=zr(v);if(rt(v).map(I=>I.folderPath)&&M.find(I=>I.folderPath===e.parentFolder||I.folderPath.toLowerCase()===P)){let _=zr(v).find(A=>A.folderPath===e.parentFolder||A.folderPath.toLowerCase()===P);if(_){let A=v.items,F=(D,J)=>{for(let Q of D)if(Q.type==="folder"){let se=Q;if(se.name===J||J.endsWith("/"+se.name))return se;let fe=F(se.items??[],J);if(fe)return fe}};E=F(A,_.folderPath)?.id}}}let k=await r.collection.createFolder({collectionId:v.id,name:R,parentId:E});return{id:k.id,name:k.name,created:!0,collection:v.name}}if(t===G.deleteFolder){if(e.confirm!==!0)throw ue('"confirm" must be true to delete a folder');let v=at(e.collection,s);if(typeof e.folder!="string"||!e.folder.trim())throw ue('"folder" is required');let R=e.folder.toLowerCase(),E=zr(v).find(M=>M.folderPath===e.folder||M.folderPath.toLowerCase()===R);if(!E)throw ue(`folder "${e.folder}" not found in collection "${v.name}"`);let k=wN(v.items,E.folderId);if(!k)throw ue(`folder "${e.folder}" could not be resolved`);let P=E.requestCount;return await r.collection.deleteFolder(v.id,k.id),{deleted:!0,folder:E.folderPath,requestsRemoved:P}}if(t===G.createRequest){let v=at(e.collection,s),R=typeof e.name=="string"?e.name.trim():"";if(!R)throw ue('"name" is required');let E=typeof e.method=="string"?e.method.toUpperCase():"GET",k=typeof e.url=="string"?e.url:"";if(!k)throw ue('"url" is required');let P;if(typeof e.folder=="string"&&e.folder.trim()){let I=e.folder.toLowerCase(),_=zr(v).find(A=>A.folderPath===e.folder||A.folderPath.toLowerCase()===I);_&&(P=_.folderId)}let M={collectionId:v.id,parentId:P,name:R,method:E,url:k,headers:void 0,body:e.body?{type:"raw",raw:String(e.body),contentType:"application/json"}:void 0,description:typeof e.description=="string"?e.description:void 0},j=await r.collection.createRequest(M);return{id:j.id,name:j.name,created:!0,collection:v.name,hint:"Request created. Call run_request to execute it, or set_request_script to add pre-request/post-response scripts."}}if(t===G.updateRequest){let v=at(e.collection,s),R=ns(e.request,v),E={};return typeof e.name=="string"&&(E.name=e.name),typeof e.method=="string"&&(E.method=e.method.toUpperCase()),typeof e.url=="string"&&(E.url=e.url),e.headers&&typeof e.headers=="object"&&!Array.isArray(e.headers)&&(E.headers=Object.entries(e.headers).map(([k,P])=>({name:k,value:String(P),enabled:!0}))),typeof e.body=="string"&&(E.body={type:"raw",raw:e.body,contentType:"application/json"}),typeof e.description=="string"&&(E.description=e.description),await r.collection.updateRequest(v.id,R.id,E),{updated:!0,request:R.name}}if(t===G.deleteRequest){if(e.confirm!==!0)throw ue('"confirm" must be true to delete a request');let v=at(e.collection,s),R=ns(e.request,v);return await r.collection.deleteRequest(v.id,R.id),{deleted:!0,request:R.name}}if(t===G.getRequestScript){let v=at(e.collection,s),R=ns(e.request,v),E=e.phase;if(E!=="pre-request"&&E!=="post-response")throw ue('"phase" must be "pre-request" or "post-response"');let k=r.collection.getRequestScript(v.id,R.id,E);return{collection:v.name,request:R.name,phase:E,script:k??""}}if(t===G.setRequestScript){let v=at(e.collection,s),R=ns(e.request,v),E=e.phase;if(E!=="pre-request"&&E!=="post-response")throw ue('"phase" must be "pre-request" or "post-response"');if(typeof e.script!="string")throw ue('"script" is required');return await r.collection.setRequestScript(v.id,R.id,E,e.script),{updated:!0,collection:v.name,request:R.name,phase:E}}if(t===G.reorderCollectionItems){let v=at(e.collection,s);if(!Array.isArray(e.order))throw ue('"order" must be an array');let R;if(typeof e.folder=="string"&&e.folder.trim()){let P=e.folder.toLowerCase(),M=zr(v).find(j=>j.folderPath===e.folder||j.folderPath.toLowerCase()===P);if(!M)throw ue(`folder "${e.folder}" not found in collection "${v.name}"`);R=M.folderId}let E=R?v.items.find(P=>P.id===R)?.items??[]:v.items,k=e.order.map(P=>E.find(j=>j.id===P||j.name===P)?.id??P);return await r.collection.reorderItems(v.id,R,k),{reordered:!0,collection:v.name,order:e.order}}let o=v=>(Array.isArray(v.nodes)?v.nodes:[]).every(E=>E?.type==="request"),l=(v,R="")=>{let E=[];if(!Array.isArray(v))return E;for(let k=0;k<v.length;k+=1){let P=v[k],M=R?`${R}.${k}`:`${k}`;!P||typeof P!="object"||(P.type==="request"&&E.push({node:P,path:M}),Array.isArray(P.nodes)&&E.push(...l(P.nodes,`${M}.nodes`)),Array.isArray(P.then)&&E.push(...l(P.then,`${M}.then`)),Array.isArray(P.else)&&E.push(...l(P.else,`${M}.else`)),Array.isArray(P.default)&&E.push(...l(P.default,`${M}.default`)),Array.isArray(P.elseif)&&P.elseif.forEach((j,I)=>{Array.isArray(j?.nodes)&&E.push(...l(j.nodes,`${M}.elseif.${I}.nodes`)),Array.isArray(j?.then)&&E.push(...l(j.then,`${M}.elseif.${I}.then`))}),Array.isArray(P.cases)&&P.cases.forEach((j,I)=>{Array.isArray(j?.nodes)&&E.push(...l(j.nodes,`${M}.cases.${I}.nodes`)),Array.isArray(j?.then)&&E.push(...l(j.then,`${M}.cases.${I}.then`))}))}return E},c=(v,R)=>{if(typeof v!="string"||!v.trim())throw ue(`"${R}" is required`);let E=v.trim(),k=E.split(".");if(k.some(P=>P===""))throw ue(`"${R}" is invalid: "${E}"`);return k.map(P=>/^\d+$/.test(P)?Number(P):P)},d=(v,R)=>{let E=c(R,"path"),k=v;for(let P of E)if(typeof P=="number"){if(!Array.isArray(k)||P<0||P>=k.length)throw ue(`node path not found: "${String(R)}"`);k=k[P]}else{if(!k||typeof k!="object"||!(P in k))throw ue(`node path not found: "${String(R)}"`);k=k[P]}return k},p=(v,R)=>{let E=c(R,"path"),k=E[E.length-1];if(typeof k!="number")throw ue(`"path" must end with a numeric index: "${String(R)}"`);let P=v;for(let M=0;M<E.length-1;M+=1){let j=E[M];if(typeof j=="number"){if(!Array.isArray(P)||j<0||j>=P.length)throw ue(`node path not found: "${String(R)}"`);P=P[j]}else{if(!P||typeof P!="object"||!(j in P))throw ue(`node path not found: "${String(R)}"`);P=P[j]}}if(!Array.isArray(P)||k<0||k>=P.length)throw ue(`node path not found: "${String(R)}"`);return{array:P,index:k}},m=(v,R,E,k)=>{if(R==null||R===""){if(E!=null&&E!=="")throw ue(`"${k}" is only valid when a parent path is provided`);return{array:v,pathPrefix:""}}if(typeof E!="string"||!E.trim())throw ue(`"${k}" is required when parent path is provided`);let P=String(R).trim(),M=E.trim(),j=d(v,P),I=c(M,k),_=j;for(let A=0;A<I.length;A+=1){let F=I[A],U=A===I.length-1;if(typeof F=="number"){if(!Array.isArray(_)||F<0||F>=_.length)throw ue(`branch path not found: "${M}"`);_=_[F]}else{if(!_||typeof _!="object")throw ue(`branch path not found: "${M}"`);if(!(F in _))if(U)_[F]=[];else throw ue(`branch path not found: "${M}"`);_=_[F]}}if(!Array.isArray(_))throw ue(`target branch must be an array: "${M}"`);return{array:_,pathPrefix:`${P}.${M}`}},y=(v,R="")=>{let E=[],k=[],P=(M,j)=>{if(Array.isArray(M)){j&&k.push(j);for(let I=0;I<M.length;I+=1){let _=M[I],A=j?`${j}.${I}`:`${I}`;E.push({path:A,type:_?.type,name:_?.name}),!(!_||typeof _!="object")&&(Array.isArray(_.nodes)&&P(_.nodes,`${A}.nodes`),Array.isArray(_.then)&&P(_.then,`${A}.then`),Array.isArray(_.else)&&P(_.else,`${A}.else`),Array.isArray(_.default)&&P(_.default,`${A}.default`),Array.isArray(_.cases)&&_.cases.forEach((F,U)=>{Array.isArray(F?.nodes)&&P(F.nodes,`${A}.cases.${U}.nodes`),Array.isArray(F?.then)&&P(F.then,`${A}.cases.${U}.then`)}),Array.isArray(_.elseif)&&_.elseif.forEach((F,U)=>{Array.isArray(F?.nodes)&&P(F.nodes,`${A}.elseif.${U}.nodes`),Array.isArray(F?.then)&&P(F.then,`${A}.elseif.${U}.then`)}))}}};return P(v,R),{nodePaths:E,branchPaths:k}};if(t===G.listSuites)return{suites:(await r.testSuite.getAllSuites()).map(R=>({id:R.id,name:R.name,description:R.description??"",requestCount:l(R.nodes||[]).length,flowNodeCount:R.nodes?.length??0,iterations:R.config?.iterations??1}))};if(t===G.getSuite){let v=await qn(e.suite,r),R=l(v.nodes||[]);return{id:v.id,name:v.name,description:v.description??"",config:{iterations:v.config?.iterations??1,delayBetweenRequests:v.config?.delayBetweenRequests??0,stopOnError:v.config?.stopOnError??!1},nodes:v.nodes||[],requests:R.map(({node:E,path:k})=>{let P=E.request;return{nodePath:k,slug:P.slug??P.requestId,collectionId:P.collectionId,requestId:P.requestId,name:P.name,method:P.method,folderPath:P.folderPath??"",enabled:E.enabled!==!1}})}}if(t===G.createSuite){let v=typeof e.name=="string"?e.name.trim():"";if(!v)throw ue('"name" is required');let R;if(typeof e.fromCollection=="string"&&e.fromCollection.trim()){let E=at(e.fromCollection,s),k=await r.testSuite.createTempSuiteFromCollection(E.id);if(!k)throw new Error(`Could not build suite from collection "${E.name}"`);if(typeof e.fromFolder=="string"&&e.fromFolder.trim()){let P=_p(e.fromFolder),M=k.nodes||[];k.nodes=M.filter(j=>{if(j.type!=="request")return!0;let I=j.request?.folderPath||"";return I===P||I.startsWith(`${P}/`)})}R=await r.testSuite.saveTempSuite(k,v)}else R=await r.testSuite.createSuite(v);if(e.iterations!==void 0||e.stopOnError!==void 0||e.delayBetweenRequests!==void 0||e.description!==void 0||e.nodes!==void 0){if(e.description!==void 0&&(R.description=String(e.description)),e.nodes!==void 0){if(!Array.isArray(e.nodes))throw ue('"nodes" must be an array when provided');R.nodes=e.nodes}R.config={...R.config,...typeof e.iterations=="number"?{iterations:e.iterations}:{},...typeof e.stopOnError=="boolean"?{stopOnError:e.stopOnError}:{},...typeof e.delayBetweenRequests=="number"?{delayBetweenRequests:e.delayBetweenRequests}:{}},await r.testSuite.updateSuite(R)}return{id:R.id,name:R.name,requestCount:R.nodes?.filter(E=>E.type==="request").length??0,created:!0,hint:(R.nodes?.filter(E=>E.type==="request").length??0)===0?"Suite is empty. Call add_suite_requests to populate it with requests from a collection.":"Suite created. Call run_suite to execute it."}}if(t===G.updateSuiteConfig){let v=await qn(e.suite,r);if(typeof e.name=="string"&&e.name.trim()&&(v.name=e.name.trim()),typeof e.description=="string"&&(v.description=e.description),e.nodes!==void 0){if(!Array.isArray(e.nodes))throw ue('"nodes" must be an array when provided');v.nodes=e.nodes}return v.config={...v.config,...typeof e.iterations=="number"?{iterations:e.iterations}:{},...typeof e.stopOnError=="boolean"?{stopOnError:e.stopOnError}:{},...typeof e.delayBetweenRequests=="number"?{delayBetweenRequests:e.delayBetweenRequests}:{}},await r.testSuite.updateSuite(v),{updated:!0,suite:v.name}}if(t===G.getSuiteNode){let v=await qn(e.suite,r);Array.isArray(v.nodes)||(v.nodes=[]);let R=d(v.nodes,e.path);return{suite:v.name,path:String(e.path),node:R}}if(t===G.listSuiteNodePaths){let v=await qn(e.suite,r);Array.isArray(v.nodes)||(v.nodes=[]);let R=e.includeBranches!==!1,E=y(v.nodes);return{suite:v.name,nodeCount:E.nodePaths.length,nodePaths:E.nodePaths,branchPaths:R?E.branchPaths:void 0,rootBranchPath:""}}if(t===G.addSuiteNode){let v=await qn(e.suite,r);if(Array.isArray(v.nodes)||(v.nodes=[]),!e.node||typeof e.node!="object"||Array.isArray(e.node))throw ue('"node" must be an object');let{array:R,pathPrefix:E}=m(v.nodes,e.parentPath,e.branch,"branch"),k=typeof e.index=="number"?Math.max(0,Math.min(e.index,R.length)):R.length;R.splice(k,0,e.node),await r.testSuite.updateSuite(v);let P=E?`${E}.${k}`:`${k}`;return{added:!0,suite:v.name,path:P}}if(t===G.updateSuiteNode){let v=await qn(e.suite,r);if(Array.isArray(v.nodes)||(v.nodes=[]),!e.node||typeof e.node!="object"||Array.isArray(e.node))throw ue('"node" must be an object');let R=p(v.nodes,e.path);return R.array[R.index]=e.node,await r.testSuite.updateSuite(v),{updated:!0,suite:v.name,path:String(e.path)}}if(t===G.removeSuiteNode){let v=await qn(e.suite,r);Array.isArray(v.nodes)||(v.nodes=[]);let R=p(v.nodes,e.path),[E]=R.array.splice(R.index,1);return await r.testSuite.updateSuite(v),{removed:!0,suite:v.name,path:String(e.path),removedType:E?.type}}if(t===G.moveSuiteNode){let v=await qn(e.suite,r);Array.isArray(v.nodes)||(v.nodes=[]);let R=p(v.nodes,e.fromPath),E=R.array[R.index];R.array.splice(R.index,1);let{array:k,pathPrefix:P}=m(v.nodes,e.toParentPath,e.toBranch,"toBranch"),M=typeof e.toIndex=="number"?Math.max(0,Math.min(e.toIndex,k.length)):k.length;R.array===k&&R.index<M&&(M-=1),k.splice(M,0,E),await r.testSuite.updateSuite(v);let j=P?`${P}.${M}`:`${M}`;return{moved:!0,suite:v.name,fromPath:String(e.fromPath),toPath:j}}if(t===G.addSuiteRequests){let v=await qn(e.suite,r),R=Array.isArray(e.requests)?e.requests:[];if(R.length===0)throw ue('"requests" array is required and must not be empty');let E=[];for(let M of R){let j=at(M.collection,s),I=ns(M.request,j),_=rt(j).find(A=>A.request.id===I.id)?.folderPath??"";E.push({slug:I.id,collectionId:j.id,requestId:I.id,name:I.name,method:I.method,collectionName:j.name,folderPath:_,enabled:!0})}v.nodes||(v.nodes=[]);let k=E.map(M=>({type:"request",name:M.name,request:M,enabled:!0})),P=typeof e.insertAt=="number"?Math.max(0,Math.min(e.insertAt,v.nodes.length)):v.nodes.length;return v.nodes.splice(P,0,...k),await r.testSuite.updateSuite(v),{added:E.length,suite:v.name,insertAt:P,addedPaths:k.map((M,j)=>`${P+j}`),newRequestCount:l(v.nodes||[]).length}}if(t===G.removeSuiteRequest){let v=await qn(e.suite,r);if(!o(v))throw ue('remove_suite_request currently supports request-only root suites. For flow suites, use get_suite/update_suite_config with the full "nodes" graph.');v.nodes||(v.nodes=[]);let R=v.nodes.filter(k=>k.type==="request"),E;if(typeof e.index=="number"){if(e.index<0||e.index>=R.length)throw ue(`index ${e.index} is out of range`);let k=R[e.index];E=k.name||k.request?.name,v.nodes=v.nodes.filter(P=>P!==k)}else if(typeof e.request=="string"){let k=e.request.toLowerCase(),P=R.find(M=>{let j=M.request?.name||M.name||"";return j===e.request||j.toLowerCase()===k});if(!P)throw ue(`request "${e.request}" not found in suite "${v.name}"`);E=P.name||P.request?.name,v.nodes=v.nodes.filter(M=>M!==P)}else throw ue('either "index" or "request" is required');return await r.testSuite.updateSuite(v),{removed:!0,request:E,newRequestCount:v.nodes.filter(k=>k.type==="request").length}}if(t===G.reorderSuiteRequests){let v=await qn(e.suite,r);if(!o(v))throw ue('reorder_suite_requests currently supports request-only root suites. For flow suites, use get_suite/update_suite_config with the full "nodes" graph.');if(!Array.isArray(e.order))throw ue('"order" must be an array of request names');let R=e.order,E=(v.nodes||[]).filter(M=>M.type==="request"),k=(v.nodes||[]).filter(M=>M.type!=="request"),P=[...E].sort((M,j)=>{let I=M.request?.name||M.name||"",_=j.request?.name||j.name||"",A=R.findIndex(J=>J===I||J.toLowerCase()===I.toLowerCase()),F=R.findIndex(J=>J===_||J.toLowerCase()===_.toLowerCase());return(A===-1?1/0:A)-(F===-1?1/0:F)});return v.nodes=[...P,...k],await r.testSuite.updateSuite(v),{reordered:!0,suite:v.name,newOrder:P.map(M=>M.request?.name||M.name)}}if(t===G.duplicateSuite){let v=await qn(e.suite,r),R=typeof e.newName=="string"?e.newName.trim():"";if(!R)throw ue('"newName" is required');let E=await r.testSuite.duplicateSuite(v.id,R);return{id:E.id,name:E.name,duplicatedFrom:v.name,requestCount:E.nodes?.filter(k=>k.type==="request").length??0}}if(t===G.deleteSuite){if(e.confirm!==!0)throw ue('"confirm" must be true to delete a suite');let v=await qn(e.suite,r);return await r.testSuite.deleteSuite(v.id),{deleted:!0,suite:v.name}}if(t===G.listEnvironments){let v=r.environmentConfig.getAllEnvironments(),R=r.environmentConfig.getSelectedEnvironment();return{environments:v.map(E=>({name:E.name,active:E.active,variableKeys:Object.keys(E.variables)})),active:R}}if(t===G.getEnvironmentVariables){let v=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),R=r.environmentConfig.getResolvedEnvironment(v);if(!R)throw ue(`environment "${v}" not found`);let k=r.environmentConfig.getSharedConfig()?.environments?.[v]?.variables??{},P=r.environmentConfig.getEnvironmentVariableLocals();return{environment:v,active:r.environmentConfig.getSelectedEnvironment()===v,fileVariables:k,sessionOverrides:P,resolved:R.variables}}if(t===G.selectEnvironment){let v=typeof e.environment=="string"?e.environment.trim():"";if(!v)throw ue('"environment" is required');return await r.environmentConfig.setSelectedEnvironment(v),{selected:!0,environment:v}}if(t===G.createEnvironment){let v=typeof e.name=="string"?e.name.trim():"";if(!v)throw ue('"name" is required');if(await r.environmentConfig.createEnvironment(v),e.variables&&typeof e.variables=="object"){let R=e.variables,E=r.environmentConfig.getSharedConfig();E&&(E.environments=E.environments??{},E.environments[v]={...E.environments[v]??{},variables:{...E.environments[v]?.variables??{},...R}},r.environmentConfig.saveSharedConfig(E))}return{created:!0,environment:v}}if(t===G.deleteEnvironment){if(e.confirm!==!0)throw ue('"confirm" must be true to delete an environment');let v=typeof e.environment=="string"?e.environment.trim():"";if(!v)throw ue('"environment" is required');let R=r.environmentConfig.getSelectedEnvironment();return await r.environmentConfig.deleteEnvironment(v),{deleted:!0,environment:v,newActive:R===v?void 0:R}}if(t===G.setEnvironmentVariable){let v=typeof e.key=="string"?e.key.trim():"",R=typeof e.value=="string"?e.value:String(e.value??"");if(!v)throw ue('"key" is required');let E=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),k=e.scope==="permanent"?"permanent":"session";if(k==="permanent"){let P=r.environmentConfig.getSharedConfig();P&&(P.environments=P.environments??{},P.environments[E]=P.environments[E]??{variables:{}},P.environments[E].variables=P.environments[E].variables??{},P.environments[E].variables[v]=R,r.environmentConfig.saveSharedConfig(P))}else r.environmentConfig.setEnvironmentVariable(v,R,E);return{set:!0,key:v,environment:E,scope:k}}if(t===G.unsetEnvironmentVariable){let v=typeof e.key=="string"?e.key.trim():"";if(!v)throw ue('"key" is required');let R=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment();return r.environmentConfig.deleteEnvironmentVariable(v,R),{unset:!0,key:v,environment:R}}if(t===G.setGlobalVariable){let v=typeof e.key=="string"?e.key.trim():"",R=typeof e.value=="string"?e.value:String(e.value??"");if(!v)throw ue('"key" is required');let E=e.scope==="permanent"?"permanent":"session";if(E==="permanent"){let k=r.environmentConfig.getSharedConfig();k&&(k.globalVariables=k.globalVariables??{},k.globalVariables[v]=R,r.environmentConfig.saveSharedConfig(k))}else r.environmentConfig.setGlobalVariable(v,R);return{set:!0,key:v,scope:E}}if(t===G.getGlobals)return{globals:r.environmentConfig.getGlobalVariables()};if(t===G.scaffoldCollectionFromOpenApi){let v=typeof e.specPath=="string"?e.specPath.trim():"";if(!v)throw ue('"specPath" is required');let R=r.workspaceFolder&&!is.isAbsolute(v)?is.join(r.workspaceFolder,v):v;if(!Ap.existsSync(R))throw ue(`OpenAPI spec file not found: "${R}"`);let k=await new Hs(r.collection,r.environmentConfig).import(R,{collectionName:typeof e.collectionName=="string"?e.collectionName:void 0,environmentName:typeof e.environmentName=="string"?e.environmentName:void 0});return{collectionId:k.collection.id,collectionName:k.collection.name,requestCount:k.collection.items.filter(P=>P.type==="request").length,environmentCreated:k.environmentCreated??null,hint:"Use list_requests to browse the scaffolded collection, then run_request to test individual endpoints."}}if(t===G.suggestAssertions){let v=e.collection;if(!(typeof e.request=="string"?e.request.trim():""))throw ue('"request" is required');let E=at(v,s),k=ns(e.request,E),P=typeof e.maxSuggestions=="number"?Math.min(20,Math.max(1,e.maxSuggestions)):10,M=[],I=Array.from(n.values()).filter(U=>U.status!=="running").flatMap(U=>U.allResults??[]).filter(U=>U.name===k.name||typeof U.name=="string"&&U.name.toLowerCase()===k.name.toLowerCase()),_=I[I.length-1],A=_?.status;A?M.push({snippet:`pm.test("Status code is ${A}", function () {
|
|
353
353
|
pm.response.to.have.status(${A});
|
|
354
354
|
});`,rationale:`Observed status ${A} in the most recent run.`}):M.push({snippet:`pm.test("Status code is 2xx", function () {
|
|
355
355
|
pm.expect(pm.response.code).to.be.within(200, 299);
|
|
356
356
|
});`,rationale:"No run history in this session \u2014 asserting a generic 2xx success."}),M.push({snippet:`pm.test("Response time is under 2000ms", function () {
|
|
357
357
|
pm.expect(pm.response.responseTime).to.be.below(2000);
|
|
358
|
-
});`,rationale:"Good practice to gate on response time in CI."});let F=
|
|
358
|
+
});`,rationale:"Good practice to gate on response time in CI."});let F=_?.responseBody;if(F)try{let U=JSON.parse(F);if(U&&typeof U=="object"){M.push({snippet:`pm.test("Content-Type is application/json", function () {
|
|
359
359
|
pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json");
|
|
360
360
|
});`,rationale:"Response body was valid JSON \u2014 assert Content-Type accordingly."});let D=Object.keys(Array.isArray(U)&&U.length>0?U[0]:U).slice(0,5);for(let J of D){if(M.length>=P)break;let Q=Array.isArray(U)?"body[0]":"body";M.push({snippet:`pm.test("Response has field '${J}'", function () {
|
|
361
361
|
const body = pm.response.json();
|
|
362
362
|
pm.expect(${Q}).to.have.property("${J}");
|
|
363
363
|
});`,rationale:`Field "${J}" was present in the observed response body.`})}}}catch{M.push({snippet:`pm.test("Response body is not empty", function () {
|
|
364
364
|
pm.expect(pm.response.text()).to.not.be.empty;
|
|
365
|
-
});`,rationale:"Response body was non-JSON text."})}return{collection:E.name,request:k.name,suggestions:M.slice(0,P),hint:"Paste the snippets into the request's post-response script using set_request_script."}}if(t===G.explainFailure){let v=typeof e.runId=="string"?e.runId.trim():void 0,_=typeof e.request=="string"?e.request.trim():"",E=typeof e.iteration=="number"?e.iteration:1;if(v){let j=n.require(v);if(j.status==="running")return{runId:v,status:"running",message:"The run has not completed yet. Try again in a moment."};if(!_)throw ue('"request" is required when "runId" is provided');let I=j.allResults.find(D=>D.iteration===E&&(D.name===_||typeof D.name=="string"&&D.name.toLowerCase()===_.toLowerCase()));if(!I)throw new Error(`Request "${_}" (iteration ${E}) not found in run "${v}".`);let R=I.assertions?.every(D=>D.passed)??!0,A=I.error,F=I.assertions?.filter(D=>!D.passed)??[],U="";return A?U=`The request itself failed to execute: ${A}. Check the URL, network access, authentication, and that the environment variables are set correctly.`:F.length>0?U=`${F.length} assertion(s) failed. Review the expected vs actual values below and verify the API contract.`:R?U="No failures detected. The request appears to have passed.":U="The request was marked as failed but no specific errors were captured.",{runId:v,request:I.name,iteration:E,status:I.status??"unknown",passed:I.passed??!0,error:A??null,failedAssertions:F,allAssertions:I.assertions??[],requestDetails:{method:I.method,url:I.url,requestBody:I.requestBody},responseDetails:{status:I.responseStatus,headers:I.responseHeaders,body:I.responseBody},diagnosis:U,suggestedFixes:A?["Verify the URL is correct and reachable","Check all required environment variables are set","Inspect authentication headers"]:F.map(D=>`Fix assertion "${D.name}": ${D.message??"expected value mismatch"}`)}}let k=e.collection;if(!_)throw ue('"request" is required');let P=at(k,s);return{request:ns(e.request,P).name,collection:P.name,message:"No live run id provided. Run the request first using run_request, then call explain_failure with the runId from the result.",hint:'Use run_request or run_collection with include:["consoleOutput"] to capture a fresh run, then pass the runId here.'}}if(t===G.aiSuggestEnvVars){let v=at(e.collection,s),_=typeof e.minOccurrences=="number"?Math.max(1,e.minOccurrences):1,k=(typeof e.environment=="string"?e.environment:void 0)??r.environmentConfig.getSelectedEnvironment()??void 0,P=Ep(v,_),M=rt(v).map(({request:j,folderPath:I})=>({id:j.id,name:j.name,folder:I,method:j.method,url:j.url,headers:(j.headers??[]).filter(R=>R.enabled!==!1).map(R=>({key:R.key,value:R.value})),query:(j.query??[]).filter(R=>R.enabled!==!1).map(R=>({key:R.key,value:R.value})),bodyExcerpt:j.body?.type==="raw"&&typeof j.body.content=="string"?j.body.content.slice(0,300):void 0}));return{task:{action:"analyze_and_apply_env_vars",instructions:["Review requestSummary. Find ALL hardcoded values: base URLs, API keys/tokens, tenant IDs, user IDs, secrets, repeated hostnames.","Skip placeholders ({{...}}), HTTP methods, standard header names, empty strings, booleans, short numbers.","Combine heuristicSuggestions with your own findings into one list.",`Call apply_env_vars immediately with: { collection: "${v.name}", suggestions: [...], ${k?`environment: "${k}"`:""} }`,"Do NOT ask for confirmation. Apply everything at once."],collection:v.name,heuristicSuggestions:P.map(j=>({varName:j.varName,value:j.value,reason:j.reason})),requestSummary:M,expectedCallAfterThis:"apply_env_vars"}}}if(t===G.aiEnhanceCollection){let v=at(e.collection,s),_=typeof e.offset=="number"?Math.max(0,e.offset):0,E=typeof e.limit=="number"?Math.min(20,Math.max(1,e.limit)):10,k=typeof e.folder=="string"?e.folder.toLowerCase():void 0,P=rt(v).filter(({folderPath:I})=>!k||I.toLowerCase().includes(k)),M=P.slice(_,_+E).map(({request:I,folderPath:R})=>({id:I.id,name:I.name,folder:R,method:I.method,url:I.url,headers:(I.headers??[]).filter(A=>A.enabled!==!1).map(A=>({key:A.key,value:A.value})),query:(I.query??[]).filter(A=>A.enabled!==!1).map(A=>({key:A.key,value:A.value})),currentBody:I.body?.type==="raw"&&typeof I.body.content=="string"?I.body.content:void 0,currentTestScript:r.collection.getRequestScript(v.id,I.id,"post-response")??void 0})),j=_+E<P.length;return{task:{action:"enhance_requests",instructions:["For each request in requests, produce body and/or testScript as appropriate:"," body: realistic JSON (or form) example matching the endpoint purpose. Only for POST/PUT/PATCH."," testScript: pm.test() assertions \u2014 check status code, response schema, key fields. Always provide this.",`Call apply_request_enhancements immediately with: { collection: "${v.name}", enhancements: [{ requestId, body?, testScript }] }`,j?`After applying, call ai_enhance_collection again with: { collection: "${v.name}", offset: ${_+E}, limit: ${E} } to continue.`:"This is the last batch \u2014 no further calls needed after applying.","Do NOT ask for confirmation. Apply everything at once."],collection:v.name,total:P.length,offset:_,hasMore:j,nextOffset:j?_+E:void 0,requests:M,expectedCallAfterThis:"apply_request_enhancements"}}}if(t===G.suggestEnvVars){let v=at(e.collection,s),_=typeof e.minOccurrences=="number"?Math.max(1,e.minOccurrences):1,E=Ep(v,_),k=rt(v).map(({request:P,folderPath:M})=>({id:P.id,name:P.name,folder:M,method:P.method,url:P.url,headers:(P.headers??[]).filter(j=>j.enabled!==!1).map(j=>({key:j.key,value:j.value})),query:(P.query??[]).filter(j=>j.enabled!==!1).map(j=>({key:j.key,value:j.value})),bodyExcerpt:P.body?.type==="raw"&&typeof P.body.content=="string"?P.body.content.slice(0,300):void 0}));return{collection:v.name,heuristicSuggestions:E.map(P=>({varName:P.varName,value:P.value,reason:P.reason,occurrences:P.occurrences.length})),requestSummary:k,hint:"Review requestSummary for additional hardcoded values, then call apply_env_vars with your combined {value, varName} list."}}if(t===G.applyEnvVars){let v=at(e.collection,s),_=e.suggestions;if(!Array.isArray(_)||_.length===0)throw ue('"suggestions" must be a non-empty array of {value, varName} objects');let E=_,k=zy(v.items,E);await r.collection.saveCollection(v);let M=(typeof e.environment=="string"?e.environment:void 0)??r.environmentConfig.getSelectedEnvironment();if(M)for(let I of E)r.environmentConfig.setEnvironmentVariable(I.varName,I.value,M);let j=Object.values(k).reduce((I,R)=>I+R,0);return{collection:v.name,applied:E.map(I=>({varName:I.varName,replacements:k[I.varName]??0})),totalReplacements:j,...M?{writtenToEnvironment:M}:{}}}if(t===G.getRequestsForEnhancement){let v=at(e.collection,s),_=typeof e.offset=="number"?Math.max(0,e.offset):0,E=typeof e.limit=="number"?Math.min(30,Math.max(1,e.limit)):10,k=typeof e.folder=="string"?e.folder.toLowerCase():void 0,P=rt(v).filter(({folderPath:j})=>!k||j.toLowerCase().includes(k)),M=P.slice(_,_+E).map(({request:j,folderPath:I})=>({id:j.id,name:j.name,folder:I,method:j.method,url:j.url,headers:(j.headers??[]).filter(R=>R.enabled!==!1).map(R=>({key:R.key,value:R.value})),query:(j.query??[]).filter(R=>R.enabled!==!1).map(R=>({key:R.key,value:R.value})),currentBody:j.body?.type==="raw"&&typeof j.body.content=="string"?j.body.content:void 0,currentTestScript:r.collection.getRequestScript(v.id,j.id,"post-response")??void 0}));return{collection:v.name,total:P.length,offset:_,limit:E,requests:M,hasMore:_+E<P.length,hint:"For each request write a realistic body and pm.test() assertions, then call apply_request_enhancements."}}if(t===G.applyRequestEnhancements){let v=at(e.collection,s),_=e.enhancements;if(!Array.isArray(_)||_.length===0)throw ue('"enhancements" must be a non-empty array');let E=[];for(let k of _){let{requestId:P,body:M,testScript:j}=k;if(!rt(v).find(({request:A})=>A.id===P)){E.push({requestId:P,applied:["skipped: request not found"]});continue}let R=[];typeof M=="string"&&(await r.collection.updateRequest(v.id,P,{body:{type:"raw",content:M,format:"json"}}),R.push("body")),typeof j=="string"&&(await r.collection.setRequestScript(v.id,P,"post-response",j),R.push("testScript")),E.push({requestId:P,applied:R})}return{collection:v.name,results:E,totalUpdated:E.filter(k=>k.applied.length>0&&!k.applied[0].startsWith("skipped")).length}}if(t===G.analyzeCoverage||t===G.aiAnalyzeCoverage){let v=at(e.collection,s),_=typeof e.folder=="string"?e.folder.toLowerCase():void 0,E=rt(v).filter(({folderPath:F})=>!_||F.toLowerCase().includes(_)),k=E.map(({request:F,folderPath:U})=>{let J=((r.collection.getRequestScript(v.id,F.id,"post-response")??"").match(/pm\.test\s*\(/g)??[]).length;return{id:F.id,name:F.name,method:F.method,folder:U,hasAssertions:J>0,assertionCount:J}}),P=k.filter(F=>F.hasAssertions).length,M=k.length,j=M===0?100:Math.round(P/M*100),I=[],R=typeof e.specPath=="string"?e.specPath.trim():"";if(R)try{let F=r.workspaceFolder&&!is.isAbsolute(R)?is.join(r.workspaceFolder,R):R,U=Ap.readFileSync(F,"utf8"),{parse:D}=await Promise.resolve().then(()=>ve(Xd())),Q=(R.endsWith(".json")?JSON.parse(U):D(U)).paths??{},se=["get","post","put","patch","delete","head","options"];for(let[fe,Be]of Object.entries(Q))for(let Re of se){if(!(Re in Be))continue;let ye=Re.toUpperCase();E.some(({request:mt})=>mt.method.toUpperCase()===ye&&(mt.url??"").replace(/\{\{[^}]+\}\}/g,"{param}").includes(fe.replace(/\{[^}]+\}/g,"{param}").replace(/^\//,"")))||I.push({method:ye,path:fe})}}catch{}let A=k.filter(F=>!F.hasAssertions);if(t===G.aiAnalyzeCoverage){let F=[];return A.length>0&&F.push(`${A.length} request(s) have no pm.test() assertions. Call ai_enhance_collection (collection="${v.name}") to add assertions to all of them.`),I.length>0&&F.push(`${I.length} spec operation(s) have no matching collection request. Call generate_scenarios (collection="${v.name}") to generate negative and edge-case requests for them.`),F.length===0&&F.push(`Coverage is ${j}% \u2014 all requests have assertions and all spec operations are covered.`),{task:{action:"ai_analyze_coverage",instructions:["Review the coverage data below.",...F,"Address the highest-impact gap first. Do NOT ask for confirmation \u2014 proceed immediately."],collection:v.name,coveragePct:j,covered:P,total:M,untestedRequests:A,untestedOperations:I,expectedCallAfterThis:A.length>0?"ai_enhance_collection":I.length>0?"generate_scenarios":null}}}return{collection:v.name,coveragePct:j,covered:P,total:M,requests:k,...I.length>0?{untestedOperations:I}:{}}}if(t===G.generateRequestFromIntent){let v=at(e.collection,s),_=typeof e.intent=="string"?e.intent.trim():"";if(!_)throw ue('"intent" is required \u2014 describe what to test in plain English');let k=rt(v).slice(0,20).map(({request:M,folderPath:j})=>({name:M.name,method:M.method,url:M.url??"",folder:j})),P=Object.keys(r.environmentConfig.getResolvedEnvironment(r.environmentConfig.getSelectedEnvironment())?.variables??{});return{task:{action:"generate_request_from_intent",instructions:[`Intent: "${_}"`,"Using the collection context below, determine: method, full URL (reuse existing {{vars}} where possible), headers, request body (if applicable), and expected HTTP status.","Then immediately:"," 1. Call create_request with name, method, url, and body.",' 2. Call set_request_script (phase: "post-response") with pm.test() assertions that verify the intent.',"Do NOT ask for confirmation \u2014 implement the full request + assertions in one shot."],collection:v.name,intent:_,existingRequests:k,availableEnvVars:P,targetFolder:typeof e.folder=="string"?e.folder:void 0,expectedCallAfterThis:"create_request"}}}if(t===G.validateAgainstSpec){let v=at(e.collection,s),_=typeof e.specPath=="string"?e.specPath.trim():"";if(!_)throw ue('"specPath" is required');let E=r.workspaceFolder&&!is.isAbsolute(_)?is.join(r.workspaceFolder,_):_,k;try{let D=Ap.readFileSync(E,"utf8"),{parse:J}=await Promise.resolve().then(()=>ve(Xd()));k=_.endsWith(".json")?JSON.parse(D):J(D)}catch(D){throw new Error(`Could not load spec at "${E}": ${D instanceof Error?D.message:String(D)}`)}let P=k.paths??{},M=["get","post","put","patch","delete","head","options"],j=rt(v),I=[],R=[],A=[],F=D=>D.replace(/\{\{[^}]+\}\}/g,"{p}").replace(/\{[^}]+\}/g,"{p}").replace(/\/+$/,"");for(let[D,J]of Object.entries(P))for(let Q of M){if(!(Q in J))continue;let se=J[Q],fe=Q.toUpperCase(),Be=F(D),Re=j.find(({request:ye})=>ye.method.toUpperCase()===fe&&F(ye.url??"").includes(Be));if(!Re)I.push({method:fe,path:D,operationId:se.operationId});else{let ye=r.collection.getRequestScript(v.id,Re.request.id,"post-response")??"";/pm\.test\s*\(/.test(ye)||R.push({method:fe,path:D,requestName:Re.request.name})}}let U=new Set(Object.entries(P).flatMap(([D,J])=>M.filter(Q=>Q in J).map(Q=>`${Q.toUpperCase()}:${F(D)}`)));for(let{request:D}of j){let J=F(D.url??""),Q=`${D.method.toUpperCase()}:`;[...U].some(fe=>fe.startsWith(Q)&&J.includes(fe.split(":")[1]))||A.push({method:D.method,url:D.url??"",requestName:D.name})}return{collection:v.name,spec:is.basename(_),summary:{untestedOperations:I.length,matchedWithoutAssertions:R.length,extraRequests:A.length},untestedOperations:I,matchedWithoutAssertions:R,extraRequests:A,hint:I.length>0?`Call generate_scenarios (collection="${v.name}") to create negative/edge-case requests for untested operations.`:"All spec operations have matching collection requests."}}if(t===G.generateScenarios){let v=at(e.collection,s),_=typeof e.request=="string"?e.request.trim().toLowerCase():void 0,E=typeof e.folder=="string"?e.folder.toLowerCase():void 0,k=typeof e.offset=="number"?Math.max(0,e.offset):0,P=typeof e.limit=="number"?Math.min(10,Math.max(1,e.limit)):5,M=rt(v).filter(({request:I,folderPath:R})=>!(_&&I.name.toLowerCase()!==_&&!I.name.toLowerCase().includes(_)||E&&!R.toLowerCase().includes(E))),j=M.slice(k,k+P).map(({request:I,folderPath:R})=>({id:I.id,name:I.name,method:I.method,url:I.url??"",folder:R,headers:(I.headers??[]).filter(A=>A.enabled!==!1).map(A=>({key:A.key,value:A.value})),body:I.body?.type==="raw"&&typeof I.body.content=="string"?I.body.content:void 0,currentTestScript:r.collection.getRequestScript(v.id,I.id,"post-response")??void 0}));return{task:{action:"generate_scenarios",instructions:["For each request below, generate negative and edge-case test scenario variants.","Scenarios to generate per request (as applicable):"," - Missing required fields \u2192 expect 400 or 422"," - Invalid field type or format (e.g. string where number expected) \u2192 expect 400"," - No Authorization header (remove it) \u2192 expect 401"," - Valid auth but insufficient scope/role \u2192 expect 403"," - Non-existent resource ID in URL \u2192 expect 404"," - Boundary values: empty string, max-length string, 0, -1, very large number","For each scenario:",' 1. Call create_request with a descriptive name (e.g. "Create User - Missing Email \u2192 422"), method, url, and body.',' 2. Immediately call set_request_script (phase: "post-response") with the status assertion.'," 3. Place the new request in the same folder as the original (use folder argument in create_request).","If task.hasMore is true, call generate_scenarios again with task.nextOffset after finishing this batch.","Do NOT ask for confirmation \u2014 generate all scenarios autonomously."],collection:v.name,requests:j,total:M.length,offset:k,hasMore:k+P<M.length,nextOffset:k+P,expectedCallAfterThis:"create_request"}}}if(t===G.healAssertions){let v=at(e.collection,s),_=ns(e.request,v),E=r.collection.getRequestScript(v.id,_.id,"post-response")??"",k,P=typeof e.runId=="string"?e.runId.trim():void 0;if(P)try{let j=n.require(P).allResults.find(I=>typeof I.name=="string"&&I.name.toLowerCase()===_.name.toLowerCase());j&&(k={status:j.status,responseBody:j.responseBody,responseHeaders:j.responseHeaders,failedTests:j.failedTests})}catch{}return{task:{action:"heal_assertions",instructions:[`Request: ${_.method} ${_.url??""}`,"The current test script may have stale or incorrect assertions (e.g. wrong status code, missing/renamed fields).","Compare task.currentScript against task.lastResponse (if available).","Rewrite the complete post-response script so all assertions match the observed response while keeping valid checks.",'Call set_request_script (phase: "post-response") with the updated script immediately.',"Do NOT ask for confirmation."],collection:v.name,request:_.name,method:_.method,url:_.url??"",currentScript:E,lastResponse:k??null,note:k?"Last response data available \u2014 use it to align assertions with actual behavior.":"No run data available \u2014 run the request first with run_request, then call heal_assertions again with the runId.",expectedCallAfterThis:"set_request_script"}}}if(t===G.generateIterationData){let v=at(e.collection,s),_=ns(e.request,v),E=typeof e.iterations=="number"?Math.min(50,Math.max(1,e.iterations)):5,k=_.body?.type==="raw"&&typeof _.body.content=="string"?_.body.content:void 0,P=(_.headers??[]).filter(R=>R.enabled!==!1).map(R=>({key:R.key,value:R.value})),M=(_.query??[]).filter(R=>R.enabled!==!1).map(R=>({key:R.key,value:R.value})),j=/\{\{([^}]+)\}\}/g,I=new Set;for(let R of[_.url??"",k??"",...P.map(A=>A.value),...M.map(A=>A.value)]){let A;for(j.lastIndex=0;(A=j.exec(R))!==null;)I.add(A[1])}return{task:{action:"generate_iteration_data",instructions:[`Generate ${E} test data rows for: ${_.method} ${_.url??""}`,`The request uses these {{variable}} placeholders: ${[...I].join(", ")||"(none detected)"}`,"Each row must be a JSON object whose keys match the placeholder names.","Cover a mix of: (1) valid happy-path data, (2) boundary values, (3) invalid inputs that should fail, (4) edge cases.",'Return the rows as a JSON array in a code block labeled "iterationData".',"This data can be used with: http-forge run-request --collection ... --variables '[...]' or passed to run_request via the variables argument."],collection:v.name,request:_.name,method:_.method,url:_.url??"",body:k??null,headers:P,queryParams:M,placeholders:[...I],iterations:E}}}let b=e.suite;if(typeof b!="string"||!b.trim())throw ue('the "suite" argument is required');let q=await r.testSuite.getAllSuites(),x=q.find(v=>v.id===b||v.name===b)??q.find(v=>v.name.toLowerCase()===b.toLowerCase());if(!x)throw ue(`test suite not found: "${b}"`);return i.runSuite(x.id,x.name,e)}var Ap,is,Gy,EC=le(()=>{"use strict";Ap=ve(require("fs")),is=ve(require("path"));CC();Uy();Ii();kp();Gy=new Set([G.createCollection,G.renameCollection,G.deleteCollection,G.duplicateCollection,G.createFolder,G.deleteFolder,G.createRequest,G.updateRequest,G.deleteRequest,G.reorderCollectionItems,G.createSuite,G.updateSuiteConfig,G.addSuiteNode,G.updateSuiteNode,G.removeSuiteNode,G.moveSuiteNode,G.duplicateSuite,G.deleteSuite])});function Ko(t,e=2e3){return!t||t.length<=e?t:t.slice(0,e)+`
|
|
365
|
+
});`,rationale:"Response body was non-JSON text."})}return{collection:E.name,request:k.name,suggestions:M.slice(0,P),hint:"Paste the snippets into the request's post-response script using set_request_script."}}if(t===G.explainFailure){let v=typeof e.runId=="string"?e.runId.trim():void 0,R=typeof e.request=="string"?e.request.trim():"",E=typeof e.iteration=="number"?e.iteration:1;if(v){let j=n.require(v);if(j.status==="running")return{runId:v,status:"running",message:"The run has not completed yet. Try again in a moment."};if(!R)throw ue('"request" is required when "runId" is provided');let I=j.allResults.find(D=>D.iteration===E&&(D.name===R||typeof D.name=="string"&&D.name.toLowerCase()===R.toLowerCase()));if(!I)throw new Error(`Request "${R}" (iteration ${E}) not found in run "${v}".`);let _=I.assertions?.every(D=>D.passed)??!0,A=I.error,F=I.assertions?.filter(D=>!D.passed)??[],U="";return A?U=`The request itself failed to execute: ${A}. Check the URL, network access, authentication, and that the environment variables are set correctly.`:F.length>0?U=`${F.length} assertion(s) failed. Review the expected vs actual values below and verify the API contract.`:_?U="No failures detected. The request appears to have passed.":U="The request was marked as failed but no specific errors were captured.",{runId:v,request:I.name,iteration:E,status:I.status??"unknown",passed:I.passed??!0,error:A??null,failedAssertions:F,allAssertions:I.assertions??[],requestDetails:{method:I.method,url:I.url,requestBody:I.requestBody},responseDetails:{status:I.responseStatus,headers:I.responseHeaders,body:I.responseBody},diagnosis:U,suggestedFixes:A?["Verify the URL is correct and reachable","Check all required environment variables are set","Inspect authentication headers"]:F.map(D=>`Fix assertion "${D.name}": ${D.message??"expected value mismatch"}`)}}let k=e.collection;if(!R)throw ue('"request" is required');let P=at(k,s);return{request:ns(e.request,P).name,collection:P.name,message:"No live run id provided. Run the request first using run_request, then call explain_failure with the runId from the result.",hint:'Use run_request or run_collection with include:["consoleOutput"] to capture a fresh run, then pass the runId here.'}}if(t===G.aiSuggestEnvVars){let v=at(e.collection,s),R=typeof e.minOccurrences=="number"?Math.max(1,e.minOccurrences):1,k=(typeof e.environment=="string"?e.environment:void 0)??r.environmentConfig.getSelectedEnvironment()??void 0,P=Ep(v,R),M=rt(v).map(({request:j,folderPath:I})=>({id:j.id,name:j.name,folder:I,method:j.method,url:j.url,headers:(j.headers??[]).filter(_=>_.enabled!==!1).map(_=>({key:_.key,value:_.value})),query:(j.query??[]).filter(_=>_.enabled!==!1).map(_=>({key:_.key,value:_.value})),bodyExcerpt:j.body?.type==="raw"&&typeof j.body.content=="string"?j.body.content.slice(0,300):void 0}));return{task:{action:"analyze_and_apply_env_vars",instructions:["Review requestSummary. Find ALL hardcoded values: base URLs, API keys/tokens, tenant IDs, user IDs, secrets, repeated hostnames.","Skip placeholders ({{...}}), HTTP methods, standard header names, empty strings, booleans, short numbers.","Combine heuristicSuggestions with your own findings into one list.",`Call apply_env_vars immediately with: { collection: "${v.name}", suggestions: [...], ${k?`environment: "${k}"`:""} }`,"Do NOT ask for confirmation. Apply everything at once."],collection:v.name,heuristicSuggestions:P.map(j=>({varName:j.varName,value:j.value,reason:j.reason})),requestSummary:M,expectedCallAfterThis:"apply_env_vars"}}}if(t===G.aiEnhanceCollection){let v=at(e.collection,s),R=typeof e.offset=="number"?Math.max(0,e.offset):0,E=typeof e.limit=="number"?Math.min(20,Math.max(1,e.limit)):10,k=typeof e.folder=="string"?e.folder.toLowerCase():void 0,P=rt(v).filter(({folderPath:I})=>!k||I.toLowerCase().includes(k)),M=P.slice(R,R+E).map(({request:I,folderPath:_})=>({id:I.id,name:I.name,folder:_,method:I.method,url:I.url,headers:(I.headers??[]).filter(A=>A.enabled!==!1).map(A=>({key:A.key,value:A.value})),query:(I.query??[]).filter(A=>A.enabled!==!1).map(A=>({key:A.key,value:A.value})),currentBody:I.body?.type==="raw"&&typeof I.body.content=="string"?I.body.content:void 0,currentTestScript:r.collection.getRequestScript(v.id,I.id,"post-response")??void 0})),j=R+E<P.length;return{task:{action:"enhance_requests",instructions:["For each request in requests, produce body and/or testScript as appropriate:"," body: realistic JSON (or form) example matching the endpoint purpose. Only for POST/PUT/PATCH."," testScript: pm.test() assertions \u2014 check status code, response schema, key fields. Always provide this.",`Call apply_request_enhancements immediately with: { collection: "${v.name}", enhancements: [{ requestId, body?, testScript }] }`,j?`After applying, call ai_enhance_collection again with: { collection: "${v.name}", offset: ${R+E}, limit: ${E} } to continue.`:"This is the last batch \u2014 no further calls needed after applying.","Do NOT ask for confirmation. Apply everything at once."],collection:v.name,total:P.length,offset:R,hasMore:j,nextOffset:j?R+E:void 0,requests:M,expectedCallAfterThis:"apply_request_enhancements"}}}if(t===G.suggestEnvVars){let v=at(e.collection,s),R=typeof e.minOccurrences=="number"?Math.max(1,e.minOccurrences):1,E=Ep(v,R),k=rt(v).map(({request:P,folderPath:M})=>({id:P.id,name:P.name,folder:M,method:P.method,url:P.url,headers:(P.headers??[]).filter(j=>j.enabled!==!1).map(j=>({key:j.key,value:j.value})),query:(P.query??[]).filter(j=>j.enabled!==!1).map(j=>({key:j.key,value:j.value})),bodyExcerpt:P.body?.type==="raw"&&typeof P.body.content=="string"?P.body.content.slice(0,300):void 0}));return{collection:v.name,heuristicSuggestions:E.map(P=>({varName:P.varName,value:P.value,reason:P.reason,occurrences:P.occurrences.length})),requestSummary:k,hint:"Review requestSummary for additional hardcoded values, then call apply_env_vars with your combined {value, varName} list."}}if(t===G.applyEnvVars){let v=at(e.collection,s),R=e.suggestions;if(!Array.isArray(R)||R.length===0)throw ue('"suggestions" must be a non-empty array of {value, varName} objects');let E=R,k=zy(v.items,E);await r.collection.saveCollection(v);let M=(typeof e.environment=="string"?e.environment:void 0)??r.environmentConfig.getSelectedEnvironment();if(M)for(let I of E)r.environmentConfig.setEnvironmentVariable(I.varName,I.value,M);let j=Object.values(k).reduce((I,_)=>I+_,0);return{collection:v.name,applied:E.map(I=>({varName:I.varName,replacements:k[I.varName]??0})),totalReplacements:j,...M?{writtenToEnvironment:M}:{}}}if(t===G.getRequestsForEnhancement){let v=at(e.collection,s),R=typeof e.offset=="number"?Math.max(0,e.offset):0,E=typeof e.limit=="number"?Math.min(30,Math.max(1,e.limit)):10,k=typeof e.folder=="string"?e.folder.toLowerCase():void 0,P=rt(v).filter(({folderPath:j})=>!k||j.toLowerCase().includes(k)),M=P.slice(R,R+E).map(({request:j,folderPath:I})=>({id:j.id,name:j.name,folder:I,method:j.method,url:j.url,headers:(j.headers??[]).filter(_=>_.enabled!==!1).map(_=>({key:_.key,value:_.value})),query:(j.query??[]).filter(_=>_.enabled!==!1).map(_=>({key:_.key,value:_.value})),currentBody:j.body?.type==="raw"&&typeof j.body.content=="string"?j.body.content:void 0,currentTestScript:r.collection.getRequestScript(v.id,j.id,"post-response")??void 0}));return{collection:v.name,total:P.length,offset:R,limit:E,requests:M,hasMore:R+E<P.length,hint:"For each request write a realistic body and pm.test() assertions, then call apply_request_enhancements."}}if(t===G.applyRequestEnhancements){let v=at(e.collection,s),R=e.enhancements;if(!Array.isArray(R)||R.length===0)throw ue('"enhancements" must be a non-empty array');let E=[];for(let k of R){let{requestId:P,body:M,testScript:j}=k;if(!rt(v).find(({request:A})=>A.id===P)){E.push({requestId:P,applied:["skipped: request not found"]});continue}let _=[];typeof M=="string"&&(await r.collection.updateRequest(v.id,P,{body:{type:"raw",content:M,format:"json"}}),_.push("body")),typeof j=="string"&&(await r.collection.setRequestScript(v.id,P,"post-response",j),_.push("testScript")),E.push({requestId:P,applied:_})}return{collection:v.name,results:E,totalUpdated:E.filter(k=>k.applied.length>0&&!k.applied[0].startsWith("skipped")).length}}if(t===G.analyzeCoverage||t===G.aiAnalyzeCoverage){let v=at(e.collection,s),R=typeof e.folder=="string"?e.folder.toLowerCase():void 0,E=rt(v).filter(({folderPath:F})=>!R||F.toLowerCase().includes(R)),k=E.map(({request:F,folderPath:U})=>{let J=((r.collection.getRequestScript(v.id,F.id,"post-response")??"").match(/pm\.test\s*\(/g)??[]).length;return{id:F.id,name:F.name,method:F.method,folder:U,hasAssertions:J>0,assertionCount:J}}),P=k.filter(F=>F.hasAssertions).length,M=k.length,j=M===0?100:Math.round(P/M*100),I=[],_=typeof e.specPath=="string"?e.specPath.trim():"";if(_)try{let F=r.workspaceFolder&&!is.isAbsolute(_)?is.join(r.workspaceFolder,_):_,U=Ap.readFileSync(F,"utf8"),{parse:D}=await Promise.resolve().then(()=>ve(Xd())),Q=(_.endsWith(".json")?JSON.parse(U):D(U)).paths??{},se=["get","post","put","patch","delete","head","options"];for(let[fe,Be]of Object.entries(Q))for(let Re of se){if(!(Re in Be))continue;let ye=Re.toUpperCase();E.some(({request:mt})=>mt.method.toUpperCase()===ye&&(mt.url??"").replace(/\{\{[^}]+\}\}/g,"{param}").includes(fe.replace(/\{[^}]+\}/g,"{param}").replace(/^\//,"")))||I.push({method:ye,path:fe})}}catch{}let A=k.filter(F=>!F.hasAssertions);if(t===G.aiAnalyzeCoverage){let F=[];return A.length>0&&F.push(`${A.length} request(s) have no pm.test() assertions. Call ai_enhance_collection (collection="${v.name}") to add assertions to all of them.`),I.length>0&&F.push(`${I.length} spec operation(s) have no matching collection request. Call generate_scenarios (collection="${v.name}") to generate negative and edge-case requests for them.`),F.length===0&&F.push(`Coverage is ${j}% \u2014 all requests have assertions and all spec operations are covered.`),{task:{action:"ai_analyze_coverage",instructions:["Review the coverage data below.",...F,"Address the highest-impact gap first. Do NOT ask for confirmation \u2014 proceed immediately."],collection:v.name,coveragePct:j,covered:P,total:M,untestedRequests:A,untestedOperations:I,expectedCallAfterThis:A.length>0?"ai_enhance_collection":I.length>0?"generate_scenarios":null}}}return{collection:v.name,coveragePct:j,covered:P,total:M,requests:k,...I.length>0?{untestedOperations:I}:{}}}if(t===G.generateRequestFromIntent){let v=at(e.collection,s),R=typeof e.intent=="string"?e.intent.trim():"";if(!R)throw ue('"intent" is required \u2014 describe what to test in plain English');let k=rt(v).slice(0,20).map(({request:M,folderPath:j})=>({name:M.name,method:M.method,url:M.url??"",folder:j})),P=Object.keys(r.environmentConfig.getResolvedEnvironment(r.environmentConfig.getSelectedEnvironment())?.variables??{});return{task:{action:"generate_request_from_intent",instructions:[`Intent: "${R}"`,"Using the collection context below, determine: method, full URL (reuse existing {{vars}} where possible), headers, request body (if applicable), and expected HTTP status.","Then immediately:"," 1. Call create_request with name, method, url, and body.",' 2. Call set_request_script (phase: "post-response") with pm.test() assertions that verify the intent.',"Do NOT ask for confirmation \u2014 implement the full request + assertions in one shot."],collection:v.name,intent:R,existingRequests:k,availableEnvVars:P,targetFolder:typeof e.folder=="string"?e.folder:void 0,expectedCallAfterThis:"create_request"}}}if(t===G.validateAgainstSpec){let v=at(e.collection,s),R=typeof e.specPath=="string"?e.specPath.trim():"";if(!R)throw ue('"specPath" is required');let E=r.workspaceFolder&&!is.isAbsolute(R)?is.join(r.workspaceFolder,R):R,k;try{let D=Ap.readFileSync(E,"utf8"),{parse:J}=await Promise.resolve().then(()=>ve(Xd()));k=R.endsWith(".json")?JSON.parse(D):J(D)}catch(D){throw new Error(`Could not load spec at "${E}": ${D instanceof Error?D.message:String(D)}`)}let P=k.paths??{},M=["get","post","put","patch","delete","head","options"],j=rt(v),I=[],_=[],A=[],F=D=>D.replace(/\{\{[^}]+\}\}/g,"{p}").replace(/\{[^}]+\}/g,"{p}").replace(/\/+$/,"");for(let[D,J]of Object.entries(P))for(let Q of M){if(!(Q in J))continue;let se=J[Q],fe=Q.toUpperCase(),Be=F(D),Re=j.find(({request:ye})=>ye.method.toUpperCase()===fe&&F(ye.url??"").includes(Be));if(!Re)I.push({method:fe,path:D,operationId:se.operationId});else{let ye=r.collection.getRequestScript(v.id,Re.request.id,"post-response")??"";/pm\.test\s*\(/.test(ye)||_.push({method:fe,path:D,requestName:Re.request.name})}}let U=new Set(Object.entries(P).flatMap(([D,J])=>M.filter(Q=>Q in J).map(Q=>`${Q.toUpperCase()}:${F(D)}`)));for(let{request:D}of j){let J=F(D.url??""),Q=`${D.method.toUpperCase()}:`;[...U].some(fe=>fe.startsWith(Q)&&J.includes(fe.split(":")[1]))||A.push({method:D.method,url:D.url??"",requestName:D.name})}return{collection:v.name,spec:is.basename(R),summary:{untestedOperations:I.length,matchedWithoutAssertions:_.length,extraRequests:A.length},untestedOperations:I,matchedWithoutAssertions:_,extraRequests:A,hint:I.length>0?`Call generate_scenarios (collection="${v.name}") to create negative/edge-case requests for untested operations.`:"All spec operations have matching collection requests."}}if(t===G.generateScenarios){let v=at(e.collection,s),R=typeof e.request=="string"?e.request.trim().toLowerCase():void 0,E=typeof e.folder=="string"?e.folder.toLowerCase():void 0,k=typeof e.offset=="number"?Math.max(0,e.offset):0,P=typeof e.limit=="number"?Math.min(10,Math.max(1,e.limit)):5,M=rt(v).filter(({request:I,folderPath:_})=>!(R&&I.name.toLowerCase()!==R&&!I.name.toLowerCase().includes(R)||E&&!_.toLowerCase().includes(E))),j=M.slice(k,k+P).map(({request:I,folderPath:_})=>({id:I.id,name:I.name,method:I.method,url:I.url??"",folder:_,headers:(I.headers??[]).filter(A=>A.enabled!==!1).map(A=>({key:A.key,value:A.value})),body:I.body?.type==="raw"&&typeof I.body.content=="string"?I.body.content:void 0,currentTestScript:r.collection.getRequestScript(v.id,I.id,"post-response")??void 0}));return{task:{action:"generate_scenarios",instructions:["For each request below, generate negative and edge-case test scenario variants.","Scenarios to generate per request (as applicable):"," - Missing required fields \u2192 expect 400 or 422"," - Invalid field type or format (e.g. string where number expected) \u2192 expect 400"," - No Authorization header (remove it) \u2192 expect 401"," - Valid auth but insufficient scope/role \u2192 expect 403"," - Non-existent resource ID in URL \u2192 expect 404"," - Boundary values: empty string, max-length string, 0, -1, very large number","For each scenario:",' 1. Call create_request with a descriptive name (e.g. "Create User - Missing Email \u2192 422"), method, url, and body.',' 2. Immediately call set_request_script (phase: "post-response") with the status assertion.'," 3. Place the new request in the same folder as the original (use folder argument in create_request).","If task.hasMore is true, call generate_scenarios again with task.nextOffset after finishing this batch.","Do NOT ask for confirmation \u2014 generate all scenarios autonomously."],collection:v.name,requests:j,total:M.length,offset:k,hasMore:k+P<M.length,nextOffset:k+P,expectedCallAfterThis:"create_request"}}}if(t===G.healAssertions){let v=at(e.collection,s),R=ns(e.request,v),E=r.collection.getRequestScript(v.id,R.id,"post-response")??"",k,P=typeof e.runId=="string"?e.runId.trim():void 0;if(P)try{let j=n.require(P).allResults.find(I=>typeof I.name=="string"&&I.name.toLowerCase()===R.name.toLowerCase());j&&(k={status:j.status,responseBody:j.responseBody,responseHeaders:j.responseHeaders,failedTests:j.failedTests})}catch{}return{task:{action:"heal_assertions",instructions:[`Request: ${R.method} ${R.url??""}`,"The current test script may have stale or incorrect assertions (e.g. wrong status code, missing/renamed fields).","Compare task.currentScript against task.lastResponse (if available).","Rewrite the complete post-response script so all assertions match the observed response while keeping valid checks.",'Call set_request_script (phase: "post-response") with the updated script immediately.',"Do NOT ask for confirmation."],collection:v.name,request:R.name,method:R.method,url:R.url??"",currentScript:E,lastResponse:k??null,note:k?"Last response data available \u2014 use it to align assertions with actual behavior.":"No run data available \u2014 run the request first with run_request, then call heal_assertions again with the runId.",expectedCallAfterThis:"set_request_script"}}}if(t===G.generateIterationData){let v=at(e.collection,s),R=ns(e.request,v),E=typeof e.iterations=="number"?Math.min(50,Math.max(1,e.iterations)):5,k=R.body?.type==="raw"&&typeof R.body.content=="string"?R.body.content:void 0,P=(R.headers??[]).filter(_=>_.enabled!==!1).map(_=>({key:_.key,value:_.value})),M=(R.query??[]).filter(_=>_.enabled!==!1).map(_=>({key:_.key,value:_.value})),j=/\{\{([^}]+)\}\}/g,I=new Set;for(let _ of[R.url??"",k??"",...P.map(A=>A.value),...M.map(A=>A.value)]){let A;for(j.lastIndex=0;(A=j.exec(_))!==null;)I.add(A[1])}return{task:{action:"generate_iteration_data",instructions:[`Generate ${E} test data rows for: ${R.method} ${R.url??""}`,`The request uses these {{variable}} placeholders: ${[...I].join(", ")||"(none detected)"}`,"Each row must be a JSON object whose keys match the placeholder names.","Cover a mix of: (1) valid happy-path data, (2) boundary values, (3) invalid inputs that should fail, (4) edge cases.",'Return the rows as a JSON array in a code block labeled "iterationData".',"This data can be used with: http-forge run-request --collection ... --variables '[...]' or passed to run_request via the variables argument."],collection:v.name,request:R.name,method:R.method,url:R.url??"",body:k??null,headers:P,queryParams:M,placeholders:[...I],iterations:E}}}let b=e.suite;if(typeof b!="string"||!b.trim())throw ue('the "suite" argument is required');let q=await r.testSuite.getAllSuites(),x=q.find(v=>v.id===b||v.name===b)??q.find(v=>v.name.toLowerCase()===b.toLowerCase());if(!x)throw ue(`test suite not found: "${b}"`);return i.runSuite(x.id,x.name,e)}var Ap,is,Gy,EC=le(()=>{"use strict";Ap=ve(require("fs")),is=ve(require("path"));CC();Uy();Ii();kp();Gy=new Set([G.createCollection,G.renameCollection,G.deleteCollection,G.duplicateCollection,G.createFolder,G.deleteFolder,G.createRequest,G.updateRequest,G.deleteRequest,G.reorderCollectionItems,G.createSuite,G.updateSuiteConfig,G.addSuiteNode,G.updateSuiteNode,G.removeSuiteNode,G.moveSuiteNode,G.duplicateSuite,G.deleteSuite])});function Ko(t,e=2e3){return!t||t.length<=e?t:t.slice(0,e)+`
|
|
366
366
|
\u2026 (truncated, ${t.length-e} chars omitted)`}function Tp(t){return t.replace(/"(Authorization|authorization)"\s*:\s*"[^"]+"/g,'"Authorization": "[REDACTED]"').replace(/Bearer\s+[A-Za-z0-9\-._~+/]+=*/g,"Bearer [REDACTED]").replace(/"(password|secret|token|api[-_]?key)"\s*:\s*"[^"]+"/gi,'"$1": "[REDACTED]"')}function _N(t,e){let r=e.getAllCollections(),n=t.toLowerCase(),i=r.find(s=>s.id===t||s.name===t)??r.find(s=>s.name.toLowerCase()===n)??r.find(s=>s.name.toLowerCase().includes(n));if(!i){let s=r.map(o=>`"${o.name}"`).join(", ");throw new Error(`Collection "${t}" not found. Available: ${s||"(none)"}`)}return i}function P5(t,e){let r=t.runId,n=t.request?.toLowerCase(),i=e.get(r);if(!i)throw new Error(`Run "${r}" not found. It may have expired or never existed. Use get_run_status to see recent runs.`);if(i.status==="running")throw new Error(`Run "${r}" is still in progress. Wait for it to complete before analyzing.`);let o=(i.allResults??[]).filter(p=>n&&typeof p.name=="string"&&!p.name.toLowerCase().includes(n)?!1:p.passed===!1||Array.isArray(p.assertions)&&p.assertions.some(m=>!m.passed)),l=i.summary,c=o.length,d=`I ran an HTTP API test suite and got failures. Please analyze the results and provide:
|
|
367
367
|
|
|
368
368
|
1. **Root cause** for each failure
|
|
@@ -378,7 +378,7 @@ Example: for POST /users with body {"name":"{{name}}","email":"{{email}}"} and i
|
|
|
378
378
|
## Failed Requests
|
|
379
379
|
`;if(c===0)d+=`
|
|
380
380
|
(No failures found`,n&&(d+=` matching "${t.request}"`),d+=`. The run may have passed entirely or the filter matched nothing.)
|
|
381
|
-
`;else{for(let p of o.slice(0,20)){let m=String(p.name??"(unknown)"),y=String(p.method??""),b=String(p.url??""),q=p.responseStatus??p.status??"?",x=p.error,
|
|
381
|
+
`;else{for(let p of o.slice(0,20)){let m=String(p.name??"(unknown)"),y=String(p.method??""),b=String(p.url??""),q=p.responseStatus??p.status??"?",x=p.error,R=(p.assertions??[]).filter(M=>!M.passed),E=p.failedTests??R,k=typeof p.body=="string"?Ko(Tp(p.body),600):p.body?Ko(Tp(JSON.stringify(p.body)),600):"",P=typeof p.requestBody=="string"?Ko(Tp(p.requestBody),400):p.requestBody?Ko(Tp(JSON.stringify(p.requestBody)),400):"";if(d+=`
|
|
382
382
|
### ${m}`,(y||b)&&(d+=` [${y} ${b}]`),d+=`
|
|
383
383
|
- HTTP status received: ${q}`,x&&(d+=`
|
|
384
384
|
- Request error: ${x}`),P&&(d+=`
|
|
@@ -395,9 +395,9 @@ ${k}
|
|
|
395
395
|
`}c>20&&(d+=`
|
|
396
396
|
_(${c-20} more failures omitted \u2014 fix the above first)_
|
|
397
397
|
`)}return d+=`
|
|
398
|
-
Please diagnose each failure and provide concrete, actionable fixes.`,{description:`Analyze ${c} failure(s) from run "${r}"`,messages:[{role:"user",content:{type:"text",text:d}}]}}async function k5(t,e,r){let n=_N(t.collection,e),i=rt(n),s=t.request.toLowerCase(),o=i.find(q=>q.request.id===t.request||q.request.name===t.request)??i.find(q=>q.request.name.toLowerCase()===s)??i.find(q=>q.request.name.toLowerCase().includes(s));if(!o)throw new Error(`Request "${t.request}" not found in collection "${n.name}"`);let l=o.request,c=e.getRequestScript(n.id,l.id,"pre-request")??"",d=e.getRequestScript(n.id,l.id,"post-response")??"",p="";if(t.runId){let q=r.get(t.runId);if(q&&q.status!=="running"){let v=(q.allResults??[]).find(
|
|
398
|
+
Please diagnose each failure and provide concrete, actionable fixes.`,{description:`Analyze ${c} failure(s) from run "${r}"`,messages:[{role:"user",content:{type:"text",text:d}}]}}async function k5(t,e,r){let n=_N(t.collection,e),i=rt(n),s=t.request.toLowerCase(),o=i.find(q=>q.request.id===t.request||q.request.name===t.request)??i.find(q=>q.request.name.toLowerCase()===s)??i.find(q=>q.request.name.toLowerCase().includes(s));if(!o)throw new Error(`Request "${t.request}" not found in collection "${n.name}"`);let l=o.request,c=e.getRequestScript(n.id,l.id,"pre-request")??"",d=e.getRequestScript(n.id,l.id,"post-response")??"",p="";if(t.runId){let q=r.get(t.runId);if(q&&q.status!=="running"){let v=(q.allResults??[]).find(R=>typeof R.name=="string"&&R.name.toLowerCase()===l.name.toLowerCase());if(v){let R=v.responseStatus??v.status,E=typeof v.responseBody=="string"?Ko(Tp(v.responseBody),1500):"",k=v.responseHeaders?Ko(JSON.stringify(v.responseHeaders,null,2),500):"";p=`
|
|
399
399
|
## Observed Response (run ${t.runId})
|
|
400
|
-
- Status: ${
|
|
400
|
+
- Status: ${R}
|
|
401
401
|
`,k&&(p+=`- Headers:
|
|
402
402
|
\`\`\`json
|
|
403
403
|
${k}
|
|
@@ -473,12 +473,12 @@ Please provide recommendations for:
|
|
|
473
473
|
5. **Authentication** \u2014 is auth consistent across requests that need it?
|
|
474
474
|
6. **Environment variables** \u2014 are URLs and credentials properly parameterized?
|
|
475
475
|
|
|
476
|
-
Be specific: name the exact requests or folders that need attention.`;return{description:`Review collection "${r.name}" (${n.length} requests, ${o.length} without assertions)`,messages:[{role:"user",content:{type:"text",text:p}}]}}async function Ky(t,e,r,n){switch(t){case"analyze-test-failure":return P5(e,n);case"suggest-assertions":return k5(e,r,n);case"review-collection":return A5(e,r);default:throw new Error(`Unknown prompt: "${t}". Available: ${$p.map(i=>i.name).join(", ")}`)}}var $p,qC=le(()=>{"use strict";Ii();$p=[{name:"analyze-test-failure",description:"Analyze a failed API test run. Returns a structured prompt the LLM uses to diagnose each failure and suggest concrete fixes \u2014 no extra AI configuration needed.",arguments:[{name:"runId",description:"Run ID returned by run_suite, run_collection, or run_folder",required:!0},{name:"request",description:"Filter analysis to a specific request name (omit to analyze all failures)",required:!1}]},{name:"suggest-assertions",description:"Generate pm.test() assertion scripts for a request. The LLM writes Chai-style assertions based on the request definition and optionally an observed response.",arguments:[{name:"collection",description:"Collection name or id",required:!0},{name:"request",description:"Request name or id",required:!0},{name:"runId",description:"Run ID to use observed response data for more accurate assertions (optional)",required:!1}]},{name:"review-collection",description:"Get an AI review of a collection's structure, naming conventions, test coverage gaps, and assertion quality.",arguments:[{name:"collection",description:"Collection name or id",required:!0}]}]});var $c,IC=le(()=>{"use strict";$c=class{store=new Map;newId(){return`run_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`}create(e,r){this.prune();let n={id:this.newId(),status:"running",suiteName:e,startedAt:Date.now(),progress:{completed:0,total:r},summary:{passed:0,failed:0,total:0,allPassed:!1},failedRequests:[],allResults:[],reportPath:null};return this.store.set(n.id,n),n}get(e){return this.store.get(e)}require(e){if(typeof e!="string"||!e)throw new Error('"runId" is required');let r=this.store.get(e);if(!r)throw new Error(`Run "${e}" not found. It may have expired (1-hour TTL) or never existed.`);return r}prune(){let e=Date.now()-36e5;for(let[r,n]of this.store)n.startedAt<e&&this.store.delete(r)}values(){return this.store.values()}cancel(e){let r=this.store.get(e);return!r||r.status!=="running"?!1:(r.status="cancelled",r.completedAt=Date.now(),!0)}}});function xN(t){return(0,RN.createHash)("sha256").update(t,"utf8").digest("hex").slice(0,T5)}function M5(t){let e=t.replace(/[^a-zA-Z0-9_-]+/g,"_").replace(/__+/g,"_").replace(/^_+|_+$/g,"").toLowerCase();return e?e.slice(0,$5):"id"}function ss(t){return`${M5(t)}_${xN(t)}`}function F5(t,e){return t.length>0&&t.length<=e&&/^[a-zA-Z0-9_-]+$/.test(t)&&!t.includes("__")}function Qo(t,e=N5){return F5(t,e)?t:ss(t)}function Zy(t,e,r){let n=`${t}request__${Qo(e)}__${Qo(r)}`;return n.length<=Qy?n:`${t}request__${ss(e)}__${ss(r)}`}function Xy(t,e){let r=`${t}collection__${Qo(e,100)}`;return r.length<=Qy?r:`${t}collection__${ss(e)}`}function ev(t,e,r){let n=`${t}folder__${Qo(e)}__${Qo(r)}`;return n.length<=Qy?n:`${t}folder__${ss(e)}__${ss(r)}`}function tv(t,e){let r=`${t}suite__${Qo(e,100)}`;return r.length<=Qy?r:`${t}suite__${ss(e)}`}function rv(t){for(let e of["request","collection","folder","suite"]){let r=`${e}__`;if(t.startsWith(r))return{kind:e,tokens:t.slice(r.length).split("__")}}throw new Error(`Unknown MCP tool name: ${t}`)}function vl(t,e){let r=t.includes("_")?t.slice(t.lastIndexOf("_")+1):t;for(let n of e)if(xN(n)===r)return n;for(let n of e)if(ss(n)===t)return n;for(let n of e)if(n===t)return n}function nv(t,e){let r=vl(t,e);if(r!==void 0)return r;try{let n=Buffer.from(t,"base64url").toString("utf8");if(e.includes(n))return n}catch{}}function iv(t,e,r,n){let i=n?` in folder "${n}"`:"";return`Run the "${e}" request [${t}]${i} of the "${r}" collection.`}function sv(t,e){return`Run all ${e} requests in the "${t}" collection.`}function ov(t,e,r){return`Run all ${r} requests in folder "${t}" of the "${e}" collection.`}function av(t,e,r){return`Run the "${t}" test suite (${e} requests, ${r} iteration(s) by default).`}var RN,T5,$5,N5,Qy,lv=le(()=>{"use strict";RN=require("crypto"),T5=12,$5=16,N5=60,Qy=126});function uv(t){let e=new Set,r=[];for(let n of t)e.has(n.name)||(e.add(n.name),r.push(n));return r}function cv(t){return Buffer.from(String(t)).toString("base64url")}function fv(t){if(!t)return 0;try{let e=parseInt(Buffer.from(t,"base64url").toString(),10);return Number.isFinite(e)&&e>=0?e:0}catch{return 0}}function dv(t,e,r){let n=r.toolPrefix??"",i=r.toolMode??"auto",s=r.drilldownThreshold??100,o=0;for(let d of t)o+=rt(d).length;let l=i==="drilldown"||i==="auto"&&o>s;if(i==="flat"&&o>500&&console.warn(`[http-forge MCP] WARNING: toolMode is "flat" but ${o} requests would produce ${o}+ tools. This will likely degrade AI tool-selection quality and bloat the context window. Consider setting toolMode to "auto" or "drilldown" in http-forge.config.json.`),l)return uv(Jy(n,t.map(d=>d.name),e.map(d=>d.name)).map(d=>({name:d.name,description:d.description,inputSchema:d.inputSchema,...d.annotations&&{annotations:d.annotations}})));let c=[];for(let d of t){let p=rt(d);for(let{request:m,folderPath:y}of p)c.push({name:Zy(n,d.id,m.id),description:iv(m.method,m.name,d.name,y),inputSchema:qp});c.push({name:Xy(n,d.id),description:sv(d.name,p.length),inputSchema:Ip});for(let{folderPath:m,requestCount:y}of zr(d))y!==0&&c.push({name:ev(n,d.id,m),description:ov(m,d.name,y),inputSchema:Op})}for(let d of e)c.push({name:tv(n,d.id),description:av(d.name,d.nodes.filter(p=>p.type==="request").length,d.config.iterations),inputSchema:Pp});return uv(c)}var OC=le(()=>{"use strict";Ii();lv();kp()});function Np(t){let e=typeof t.blockLabel=="string"?t.blockLabel.trim():"";if(e)return{groupPath:e,groupType:"block"};let r=typeof t.collectionName=="string"?t.collectionName.trim():"",n=typeof t.folderPath=="string"?t.folderPath.trim():"";return r?{groupPath:n?`${r}/${n}`:r,groupType:"folder"}:{groupPath:n,groupType:n?"folder":void 0}}var PC=le(()=>{"use strict"});var bl,kC=le(()=>{"use strict";ka();bl=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}getCookiesForDomain(e){let r=[];for(let n of this.cookies.values())_t.isExpired(n)||(!n.domain||_t.domainMatches(e,n.domain))&&r.push(n);return r}has(e,r){return this.get(e,r)!==void 0}get(e,r){let n=this.getCookieKey(e,r),i=this.cookies.get(n);if(i&&!_t.isExpired(i))return i}set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e)}delete(e,r,n){let i=this.getCookieKey(e,r,n);return this.cookies.delete(i)}getAll(e){if(e)return this.getCookiesForDomain(e);let r=[];for(let n of this.cookies.values())_t.isExpired(n)||r.push(n);return r}setCookiesFromResponse(e,r){let n=_t.extractDomain(e),i=_t.parseCookieHeaders(r,n);for(let s of i){let o=this.getCookieKey(s.name,s.domain,s.path);this.cookies.set(o,s)}}getCookieHeader(e){let r=_t.extractDomain(e),n=_t.extractPath(e),s=this.getCookiesForDomain(r).filter(o=>o.path?n.startsWith(o.path):!0);if(s.length!==0)return _t.formatCookieHeader(s)}clear(){this.cookies.clear()}}});function Sl(t,e,r){let n=String(t).padStart(6,"0"),i=String(e).padStart(4,"0");return`result-${n}-iter-${i}-${r}.json`}function CN(t){return{index:t.i,iteration:t.it,name:t.n,method:Bs[t.m]||"GET",status:t.s,duration:t.d,passed:t.p,assertionsPassed:t.ap,assertionsFailed:t.af,requestId:t.r,resultFile:Sl(t.i,t.it,t.r),error:t.e}}var pv,Bs,Mp=le(()=>{"use strict";pv={GET:0,POST:1,PUT:2,DELETE:3,PATCH:4,HEAD:5,OPTIONS:6,TRACE:7,CONNECT:8},Bs={0:"GET",1:"POST",2:"PUT",3:"DELETE",4:"PATCH",5:"HEAD",6:"OPTIONS",7:"TRACE",8:"CONNECT"}});function os(t){return String(t??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g,"")}function AC(t){return(Math.max(0,t)/1e3).toFixed(3)}var Mc,Nc,wl,TC=le(()=>{"use strict";Mc=ve(require("fs/promises")),Nc=ve(require("path"));Mp();wl=class{constructor(e){this.basePath=e}basePath;async generate(e,r){let n=Nc.join(this.basePath,e,r),i=JSON.parse(await Mc.readFile(Nc.join(n,"manifest.json"),"utf-8")),s=await this.loadAllSummaries(n,i.totalIndexPages),o=await this.loadAllDetails(n,s),l=this.buildXml(i,s,o),c=Nc.join(n,"junit.xml");return await Mc.writeFile(c,l,"utf-8"),c}async loadAllSummaries(e,r){let n=[];for(let i=1;i<=r;i++){let s=Nc.join(e,"index",`page-${String(i).padStart(4,"0")}.json`);try{let o=JSON.parse(await Mc.readFile(s,"utf-8"));n.push(...o.summaries)}catch{}}return n}async loadAllDetails(e,r){let n=new Map;for(let i of r){let s=Sl(i.i,i.it,i.r),o=`${i.i}-${i.it}`;try{let l=JSON.parse(await Mc.readFile(Nc.join(e,"results",s),"utf-8"));n.set(o,l)}catch{}}return n}buildGroups(e,r,n){let i=e.config?.iterations>1,s=[],o=new Map;for(let l of r){let c=n.get(`${l.i}-${l.it}`),d=l.cn||c?.collectionName||e.suiteName||"",p=l.fp||c?.folderPath||"",m=`${d}\0${p}`;if(!o.has(m)){let x=[d,p].filter(Boolean).join(" / ")||e.suiteName||"Requests";o.set(m,{label:x,cases:[]}),s.push(m)}let y=l.n||c?.name||Bs[l.m]||"request",b=i?`${y} (iteration ${l.it})`:y,q=(c?.assertions??[]).filter(x=>!x.passed).map(x=>({name:x.name,message:x.message}));q.length===0&&l.af>0&&q.push({name:`${l.af} assertion(s) failed`,message:null}),o.get(m).cases.push({name:b,classname:[d,p].filter(Boolean).join(".")||e.suiteName||"http-forge",durationMs:l.d,status:l.s,passed:l.p,error:l.e??c?.error??null,failedAssertions:q,consoleOutput:c?.consoleOutput})}return s.map(l=>o.get(l))}buildXml(e,r,n){let i=this.buildGroups(e,r,n),s=0,o=0,l=0,c=0,d=[];i.forEach((y,b)=>{let q=0,x=0,v=0,_=0,E=[];for(let k of y.cases){q++,_+=k.durationMs;let P=!k.passed&&k.failedAssertions.length===0&&!!k.error,M=!k.passed&&!P;P&&v++,M&&x++;let j=[];if(M){let R=k.failedAssertions.length>0?k.failedAssertions.map(F=>F.name).join("; "):k.error||"Assertion failed",A=k.failedAssertions.map(F=>F.message?`${F.name}: ${F.message}`:F.name).join(`
|
|
477
|
-
`);j.push(` <failure message="${os(
|
|
476
|
+
Be specific: name the exact requests or folders that need attention.`;return{description:`Review collection "${r.name}" (${n.length} requests, ${o.length} without assertions)`,messages:[{role:"user",content:{type:"text",text:p}}]}}async function Ky(t,e,r,n){switch(t){case"analyze-test-failure":return P5(e,n);case"suggest-assertions":return k5(e,r,n);case"review-collection":return A5(e,r);default:throw new Error(`Unknown prompt: "${t}". Available: ${$p.map(i=>i.name).join(", ")}`)}}var $p,qC=le(()=>{"use strict";Ii();$p=[{name:"analyze-test-failure",description:"Analyze a failed API test run. Returns a structured prompt the LLM uses to diagnose each failure and suggest concrete fixes \u2014 no extra AI configuration needed.",arguments:[{name:"runId",description:"Run ID returned by run_suite, run_collection, or run_folder",required:!0},{name:"request",description:"Filter analysis to a specific request name (omit to analyze all failures)",required:!1}]},{name:"suggest-assertions",description:"Generate pm.test() assertion scripts for a request. The LLM writes Chai-style assertions based on the request definition and optionally an observed response.",arguments:[{name:"collection",description:"Collection name or id",required:!0},{name:"request",description:"Request name or id",required:!0},{name:"runId",description:"Run ID to use observed response data for more accurate assertions (optional)",required:!1}]},{name:"review-collection",description:"Get an AI review of a collection's structure, naming conventions, test coverage gaps, and assertion quality.",arguments:[{name:"collection",description:"Collection name or id",required:!0}]}]});var $c,IC=le(()=>{"use strict";$c=class{store=new Map;newId(){return`run_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`}create(e,r){this.prune();let n={id:this.newId(),status:"running",suiteName:e,startedAt:Date.now(),progress:{completed:0,total:r},summary:{passed:0,failed:0,total:0,allPassed:!1},failedRequests:[],allResults:[],reportPath:null};return this.store.set(n.id,n),n}get(e){return this.store.get(e)}require(e){if(typeof e!="string"||!e)throw new Error('"runId" is required');let r=this.store.get(e);if(!r)throw new Error(`Run "${e}" not found. It may have expired (1-hour TTL) or never existed.`);return r}prune(){let e=Date.now()-36e5;for(let[r,n]of this.store)n.startedAt<e&&this.store.delete(r)}values(){return this.store.values()}cancel(e){let r=this.store.get(e);return!r||r.status!=="running"?!1:(r.status="cancelled",r.completedAt=Date.now(),!0)}}});function xN(t){return(0,RN.createHash)("sha256").update(t,"utf8").digest("hex").slice(0,T5)}function M5(t){let e=t.replace(/[^a-zA-Z0-9_-]+/g,"_").replace(/__+/g,"_").replace(/^_+|_+$/g,"").toLowerCase();return e?e.slice(0,$5):"id"}function ss(t){return`${M5(t)}_${xN(t)}`}function F5(t,e){return t.length>0&&t.length<=e&&/^[a-zA-Z0-9_-]+$/.test(t)&&!t.includes("__")}function Qo(t,e=N5){return F5(t,e)?t:ss(t)}function Zy(t,e,r){let n=`${t}request__${Qo(e)}__${Qo(r)}`;return n.length<=Qy?n:`${t}request__${ss(e)}__${ss(r)}`}function Xy(t,e){let r=`${t}collection__${Qo(e,100)}`;return r.length<=Qy?r:`${t}collection__${ss(e)}`}function ev(t,e,r){let n=`${t}folder__${Qo(e)}__${Qo(r)}`;return n.length<=Qy?n:`${t}folder__${ss(e)}__${ss(r)}`}function tv(t,e){let r=`${t}suite__${Qo(e,100)}`;return r.length<=Qy?r:`${t}suite__${ss(e)}`}function rv(t){for(let e of["request","collection","folder","suite"]){let r=`${e}__`;if(t.startsWith(r))return{kind:e,tokens:t.slice(r.length).split("__")}}throw new Error(`Unknown MCP tool name: ${t}`)}function vl(t,e){let r=t.includes("_")?t.slice(t.lastIndexOf("_")+1):t;for(let n of e)if(xN(n)===r)return n;for(let n of e)if(ss(n)===t)return n;for(let n of e)if(n===t)return n}function nv(t,e){let r=vl(t,e);if(r!==void 0)return r;try{let n=Buffer.from(t,"base64url").toString("utf8");if(e.includes(n))return n}catch{}}function iv(t,e,r,n){let i=n?` in folder "${n}"`:"";return`Run the "${e}" request [${t}]${i} of the "${r}" collection.`}function sv(t,e){return`Run all ${e} requests in the "${t}" collection.`}function ov(t,e,r){return`Run all ${r} requests in folder "${t}" of the "${e}" collection.`}function av(t,e,r){return`Run the "${t}" test suite (${e} requests, ${r} iteration(s) by default).`}var RN,T5,$5,N5,Qy,lv=le(()=>{"use strict";RN=require("crypto"),T5=12,$5=16,N5=60,Qy=126});function uv(t){let e=new Set,r=[];for(let n of t)e.has(n.name)||(e.add(n.name),r.push(n));return r}function cv(t){return Buffer.from(String(t)).toString("base64url")}function fv(t){if(!t)return 0;try{let e=parseInt(Buffer.from(t,"base64url").toString(),10);return Number.isFinite(e)&&e>=0?e:0}catch{return 0}}function dv(t,e,r){let n=r.toolPrefix??"",i=r.toolMode??"auto",s=r.drilldownThreshold??100,o=0;for(let d of t)o+=rt(d).length;let l=i==="drilldown"||i==="auto"&&o>s;if(i==="flat"&&o>500&&console.warn(`[http-forge MCP] WARNING: toolMode is "flat" but ${o} requests would produce ${o}+ tools. This will likely degrade AI tool-selection quality and bloat the context window. Consider setting toolMode to "auto" or "drilldown" in http-forge.config.json.`),l)return uv(Jy(n,t.map(d=>d.name),e.map(d=>d.name)).map(d=>({name:d.name,description:d.description,inputSchema:d.inputSchema,...d.annotations&&{annotations:d.annotations}})));let c=[];for(let d of t){let p=rt(d);for(let{request:m,folderPath:y}of p)c.push({name:Zy(n,d.id,m.id),description:iv(m.method,m.name,d.name,y),inputSchema:qp});c.push({name:Xy(n,d.id),description:sv(d.name,p.length),inputSchema:Ip});for(let{folderPath:m,requestCount:y}of zr(d))y!==0&&c.push({name:ev(n,d.id,m),description:ov(m,d.name,y),inputSchema:Op})}for(let d of e)c.push({name:tv(n,d.id),description:av(d.name,d.nodes.filter(p=>p.type==="request").length,d.config.iterations),inputSchema:Pp});return uv(c)}var OC=le(()=>{"use strict";Ii();lv();kp()});function Np(t){let e=typeof t.blockLabel=="string"?t.blockLabel.trim():"";if(e)return{groupPath:e,groupType:"block"};let r=typeof t.collectionName=="string"?t.collectionName.trim():"",n=typeof t.folderPath=="string"?t.folderPath.trim():"";return r?{groupPath:n?`${r}/${n}`:r,groupType:"folder"}:{groupPath:n,groupType:n?"folder":void 0}}var PC=le(()=>{"use strict"});var bl,kC=le(()=>{"use strict";ka();bl=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}getCookiesForDomain(e){let r=[];for(let n of this.cookies.values())_t.isExpired(n)||(!n.domain||_t.domainMatches(e,n.domain))&&r.push(n);return r}has(e,r){return this.get(e,r)!==void 0}get(e,r){let n=this.getCookieKey(e,r),i=this.cookies.get(n);if(i&&!_t.isExpired(i))return i}set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e)}delete(e,r,n){let i=this.getCookieKey(e,r,n);return this.cookies.delete(i)}getAll(e){if(e)return this.getCookiesForDomain(e);let r=[];for(let n of this.cookies.values())_t.isExpired(n)||r.push(n);return r}setCookiesFromResponse(e,r){let n=_t.extractDomain(e),i=_t.parseCookieHeaders(r,n);for(let s of i){let o=this.getCookieKey(s.name,s.domain,s.path);this.cookies.set(o,s)}}getCookieHeader(e){let r=_t.extractDomain(e),n=_t.extractPath(e),s=this.getCookiesForDomain(r).filter(o=>o.path?n.startsWith(o.path):!0);if(s.length!==0)return _t.formatCookieHeader(s)}clear(){this.cookies.clear()}}});function Sl(t,e,r){let n=String(t).padStart(6,"0"),i=String(e).padStart(4,"0");return`result-${n}-iter-${i}-${r}.json`}function CN(t){return{index:t.i,iteration:t.it,name:t.n,method:Bs[t.m]||"GET",status:t.s,duration:t.d,passed:t.p,assertionsPassed:t.ap,assertionsFailed:t.af,requestId:t.r,resultFile:Sl(t.i,t.it,t.r),error:t.e}}var pv,Bs,Mp=le(()=>{"use strict";pv={GET:0,POST:1,PUT:2,DELETE:3,PATCH:4,HEAD:5,OPTIONS:6,TRACE:7,CONNECT:8},Bs={0:"GET",1:"POST",2:"PUT",3:"DELETE",4:"PATCH",5:"HEAD",6:"OPTIONS",7:"TRACE",8:"CONNECT"}});function os(t){return String(t??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g,"")}function AC(t){return(Math.max(0,t)/1e3).toFixed(3)}var Mc,Nc,wl,TC=le(()=>{"use strict";Mc=ve(require("fs/promises")),Nc=ve(require("path"));Mp();wl=class{constructor(e){this.basePath=e}basePath;async generate(e,r){let n=Nc.join(this.basePath,e,r),i=JSON.parse(await Mc.readFile(Nc.join(n,"manifest.json"),"utf-8")),s=await this.loadAllSummaries(n,i.totalIndexPages),o=await this.loadAllDetails(n,s),l=this.buildXml(i,s,o),c=Nc.join(n,"junit.xml");return await Mc.writeFile(c,l,"utf-8"),c}async loadAllSummaries(e,r){let n=[];for(let i=1;i<=r;i++){let s=Nc.join(e,"index",`page-${String(i).padStart(4,"0")}.json`);try{let o=JSON.parse(await Mc.readFile(s,"utf-8"));n.push(...o.summaries)}catch{}}return n}async loadAllDetails(e,r){let n=new Map;for(let i of r){let s=Sl(i.i,i.it,i.r),o=`${i.i}-${i.it}`;try{let l=JSON.parse(await Mc.readFile(Nc.join(e,"results",s),"utf-8"));n.set(o,l)}catch{}}return n}buildGroups(e,r,n){let i=e.config?.iterations>1,s=[],o=new Map;for(let l of r){let c=n.get(`${l.i}-${l.it}`),d=l.cn||c?.collectionName||e.suiteName||"",p=l.fp||c?.folderPath||"",m=`${d}\0${p}`;if(!o.has(m)){let x=[d,p].filter(Boolean).join(" / ")||e.suiteName||"Requests";o.set(m,{label:x,cases:[]}),s.push(m)}let y=l.n||c?.name||Bs[l.m]||"request",b=i?`${y} (iteration ${l.it})`:y,q=(c?.assertions??[]).filter(x=>!x.passed).map(x=>({name:x.name,message:x.message}));q.length===0&&l.af>0&&q.push({name:`${l.af} assertion(s) failed`,message:null}),o.get(m).cases.push({name:b,classname:[d,p].filter(Boolean).join(".")||e.suiteName||"http-forge",durationMs:l.d,status:l.s,passed:l.p,error:l.e??c?.error??null,failedAssertions:q,consoleOutput:c?.consoleOutput})}return s.map(l=>o.get(l))}buildXml(e,r,n){let i=this.buildGroups(e,r,n),s=0,o=0,l=0,c=0,d=[];i.forEach((y,b)=>{let q=0,x=0,v=0,R=0,E=[];for(let k of y.cases){q++,R+=k.durationMs;let P=!k.passed&&k.failedAssertions.length===0&&!!k.error,M=!k.passed&&!P;P&&v++,M&&x++;let j=[];if(M){let _=k.failedAssertions.length>0?k.failedAssertions.map(F=>F.name).join("; "):k.error||"Assertion failed",A=k.failedAssertions.map(F=>F.message?`${F.name}: ${F.message}`:F.name).join(`
|
|
477
|
+
`);j.push(` <failure message="${os(_)}" type="AssertionFailure">${os(A)}</failure>`)}P&&j.push(` <error message="${os(k.error)}" type="RequestError">${os(k.error)}</error>`),k.consoleOutput&&k.consoleOutput.length>0&&j.push(` <system-out>${os(k.consoleOutput.join(`
|
|
478
478
|
`))}</system-out>`);let I=` <testcase name="${os(k.name)}" classname="${os(k.classname)}" time="${AC(k.durationMs)}"`;j.length===0?E.push(`${I} />`):E.push(`${I}>
|
|
479
479
|
${j.join(`
|
|
480
480
|
`)}
|
|
481
|
-
</testcase>`)}s+=q,o+=x,l+=v,c+=
|
|
481
|
+
</testcase>`)}s+=q,o+=x,l+=v,c+=R,d.push(` <testsuite name="${os(y.label)}" tests="${q}" failures="${x}" errors="${v}" skipped="0" time="${AC(R)}" timestamp="${os(e.startTime)}" id="${b}">
|
|
482
482
|
${E.join(`
|
|
483
483
|
`)}
|
|
484
484
|
</testsuite>`)});let p='<?xml version="1.0" encoding="UTF-8"?>',m=`<testsuites name="${os(e.suiteName)}" tests="${s}" failures="${o}" errors="${l}" skipped="0" time="${AC(c)}">`;return`${p}
|
|
@@ -518,8 +518,8 @@ ${d.join(`
|
|
|
518
518
|
<td>${b.p90!==void 0?_l(b.p90):"\u2014"}</td>
|
|
519
519
|
<td>${b.p99!==void 0?_l(b.p99):"\u2014"}</td>
|
|
520
520
|
<td class="${b.failed>0?"fail":"pass"}">${q}</td>
|
|
521
|
-
</tr>`}).join(""),l=Math.max(...r.map(b=>b.d),1),c=b=>{let q=Bs[b.m]??"GET",x=Math.max(2,Math.round(b.d/l*100)),v=b.p?"bar-pass":"bar-fail",
|
|
522
|
-
<tr${
|
|
521
|
+
</tr>`}).join(""),l=Math.max(...r.map(b=>b.d),1),c=b=>{let q=Bs[b.m]??"GET",x=Math.max(2,Math.round(b.d/l*100)),v=b.p?"bar-pass":"bar-fail",R=b.p?"":' class="row-fail"',E=`req-${b.i}-${b.it}`;return`
|
|
522
|
+
<tr${R}>
|
|
523
523
|
<td class="dim">${b.i}</td>
|
|
524
524
|
<td>${b.it}</td>
|
|
525
525
|
<td><span class="method method-${q.toLowerCase()}">${q}</span></td>
|
|
@@ -528,12 +528,12 @@ ${d.join(`
|
|
|
528
528
|
<td>${_l(b.d)}</td>
|
|
529
529
|
<td><div class="bar-wrap"><div class="${v}" style="width:${x}%"></div></div></td>
|
|
530
530
|
<td class="${b.p?"pass":"fail"}">${b.p?"\u2713":"\u2717"}</td>
|
|
531
|
-
</tr>`},d=this.renderGroupedTimeline(r,e,c),p=b=>{let q=`${b.i}-${b.it}`,x=n.get(q),v=Bs[b.m]??"GET",
|
|
531
|
+
</tr>`},d=this.renderGroupedTimeline(r,e,c),p=b=>{let q=`${b.i}-${b.it}`,x=n.get(q),v=Bs[b.m]??"GET",R=`req-${b.i}-${b.it}`,E=b.p,k=E?"#1f6feb40":"#f8514940",P=x?.assertions?.length?`<ul class="assert-list">${x.assertions.map(xt=>`
|
|
532
532
|
<li class="${xt.passed?"pass":"fail"}">
|
|
533
533
|
<span class="assert-icon">${xt.passed?"\u2713":"\u2717"}</span>
|
|
534
534
|
${$t(xt.name)}
|
|
535
535
|
${xt.message?`<span class="assert-msg"> \u2014 ${$t(xt.message)}</span>`:""}
|
|
536
|
-
</li>`).join("")}</ul>`:'<span class="dim">No assertions</span>',M=EN(x?.request?.headers),j=NC(x?{method:x.request?.method,url:x.request?.url,query:x.request?.query,params:x.request?.params,bodyType:x.request?.body?.type,bodyFormat:x.request?.body?.format}:void 0),I=x?.request?.body,
|
|
536
|
+
</li>`).join("")}</ul>`:'<span class="dim">No assertions</span>',M=EN(x?.request?.headers),j=NC(x?{method:x.request?.method,url:x.request?.url,query:x.request?.query,params:x.request?.params,bodyType:x.request?.body?.type,bodyFormat:x.request?.body?.format}:void 0),I=x?.request?.body,_=I&&typeof I=="object"?I.type:void 0,A=I&&typeof I=="object"&&"content"in I?I.content:I,F=_!=="none"&&!(A==null||A===""),U=F?qN(A):"",D=EN(x?.response?.headers),J=NC(x?{status:x.status,statusText:x.statusText,durationMs:x.duration,responseTimeMs:x.response?.time,responseSizeBytes:x.response?.size}:void 0),Q=x?.response?.body!==void 0&&x.response.body!==null?qN(x.response.body):'<span class="dim">\u2014 no body \u2014</span>',se=L5(x?.response?.cookies),fe=NC(x?{timestamp:x.timestamp?new Date(x.timestamp).toISOString():void 0,nextRequest:x.nextRequest,visualizerTemplate:x.visualizerData?.template,visualizerData:x.visualizerData?.data}:void 0),Be=`
|
|
537
537
|
<div class="detail-section">
|
|
538
538
|
<div class="pane-section-title">Assertions
|
|
539
539
|
<span class="assert-counts">
|
|
@@ -584,7 +584,7 @@ ${d.join(`
|
|
|
584
584
|
${Q}
|
|
585
585
|
</div>`,mt=ye.length<=ke.length,Nt=mt?Re:"",he=mt?"":Re,Yt=x?.consoleOutput?.length?`<div class="console-block"><pre class="code console-code">${x.consoleOutput.map(xt=>$t(typeof xt=="string"?xt:JSON.stringify(xt))).join(`
|
|
586
586
|
`)}</pre></div>`:"",Tr=x?.error?`<div class="error-box">\u26A0 ${$t(x.error)}</div>`:"",lt=x?`<span class="${hv(x.status)} status-badge">${x.status} ${$t(x.statusText??"")}</span>`:"",$r=`<span class="dur-badge">${_l(b.d)}</span>`,wr=e.config.iterations>1?`<span class="iter-badge">iter ${b.it}</span>`:"";return`
|
|
587
|
-
<details class="req-detail ${E?"req-pass":"req-fail"}" id="${
|
|
587
|
+
<details class="req-detail ${E?"req-pass":"req-fail"}" id="${R}" style="--border:${k}">
|
|
588
588
|
<summary class="req-summary">
|
|
589
589
|
<span class="toggle-icon">\u25B6</span>
|
|
590
590
|
<span class="req-index dim">#${b.i}</span>
|
|
@@ -1015,10 +1015,10 @@ ${d.join(`
|
|
|
1015
1015
|
</html>`}}});function Rl(t,e){if(t.length===0)return 0;let r=Math.ceil(e/100*t.length)-1;return t[Math.max(0,Math.min(r,t.length-1))]}var sr,hn,xl,FC=le(()=>{"use strict";sr=ve(require("fs/promises")),hn=ve(require("path"));Un();_d();MC();Mp();xl=class{constructor(e){this.configService=e;let r=e.getRunnerConfig();this.basePath=e.getResultsPath(),this.indexPageSize=r.indexPageSize,this.recentErrorsLimit=r.recentErrorsLimit}configService;basePath;currentRunPath=null;currentRunId=null;currentSuiteId=null;currentManifest=null;currentIndexPage=[];currentPageNumber=1;indexPageSize;recentErrors=[];recentErrorsLimit;resultIndex=0;requestDurations={};getBasePath(){return this.basePath}async initializeRun(e,r,n,i){let s=this.generateRunId();return this.currentRunId=s,this.currentSuiteId=e,this.currentRunPath=hn.join(this.basePath,e,s),await sr.mkdir(hn.join(this.currentRunPath,"results"),{recursive:!0}),await sr.mkdir(hn.join(this.currentRunPath,"index"),{recursive:!0}),this.currentManifest={version:"1.0",runId:s,suiteId:e,suiteName:r,environment:n,startTime:new Date().toISOString(),status:"running",config:i,stats:{totalRequests:0,passed:0,failed:0,skipped:0,totalDuration:0,avgDuration:0,minDuration:Number.MAX_SAFE_INTEGER,maxDuration:0},requestStats:{},totalIndexPages:0,indexPageSize:this.indexPageSize},this.currentIndexPage=[],this.currentPageNumber=1,this.recentErrors=[],this.resultIndex=0,this.requestDurations={},await this.saveManifest(),s}async saveResult(e,r){if(!this.currentRunPath||!this.currentManifest)throw new Error("No active run. Call initializeRun first.");this.resultIndex++;let n=Date.now(),i=String(e).padStart(4,"0"),s=String(this.resultIndex).padStart(6,"0"),o=Bt(r.requestId),l=`result-${s}-iter-${i}-${o}.json`,c=hn.join(this.currentRunPath,"results",l),d={index:this.resultIndex,iteration:e,requestId:r.requestId,name:r.name,method:r.executedRequest.method,url:r.executedRequest.url,folderPath:r.folderPath||"",groupPath:r.groupPath||r.folderPath||"",groupType:r.groupType,collectionName:r.collectionName||"",status:r.response.status,statusText:r.response.statusText||"",duration:r.duration,passed:r.passed,timestamp:n,request:{method:r.executedRequest.method,url:r.executedRequest.url,headers:r.executedRequest.headers,query:r.executedRequest.query,params:r.executedRequest.params,body:r.executedRequest.body},response:{headers:r.response.headers,body:r.response.body,time:r.response.time,size:r.response.size,cookies:r.response.cookies},assertions:r.assertions.map(b=>({name:b.name,passed:b.passed,message:b.message||null})),error:r.error||null,consoleOutput:r.consoleOutput,modifiedVariables:r.modifiedVariables,modifiedEnvironmentVariables:r.modifiedEnvironmentVariables,modifiedCollectionVariables:r.modifiedCollectionVariables,nextRequest:r.nextRequest??null,visualizerData:r.visualizerData};await sr.writeFile(c,JSON.stringify(dg(d),null,2),"utf-8");let p=r.assertions.filter(b=>b.passed).length,m=r.assertions.filter(b=>!b.passed).length,y={i:this.resultIndex,it:e,n:r.name,m:pv[r.executedRequest.method.toUpperCase()]??0,s:r.response.status,d:r.duration,p:r.passed,ap:p,af:m,r:r.requestId,e:r.passed?null:r.error||null,fp:r.folderPath||"",gp:r.groupPath||r.folderPath||"",gt:r.groupType,cn:r.collectionName||""};return this.currentIndexPage.push(y),this.currentIndexPage.length>=this.indexPageSize&&await this.writeCurrentIndexPage(),this.updateStats(r),this.requestDurations[r.requestId]||(this.requestDurations[r.requestId]=[]),this.requestDurations[r.requestId].push(r.duration),r.passed||(this.recentErrors.unshift({timestamp:n,iteration:e,requestName:r.name,status:r.response.status,error:r.error||`Status ${r.response.status}`,resultFile:l}),this.recentErrors.length>this.recentErrorsLimit&&this.recentErrors.pop()),y}async finalizeRun(e="completed",r=!0){if(!this.currentManifest)return null;this.currentIndexPage.length>0&&await this.writeCurrentIndexPage(),this.currentManifest.endTime=new Date().toISOString(),this.currentManifest.status=e,this.currentManifest.totalIndexPages=this.currentPageNumber-1,this.currentManifest.stats.totalRequests>0&&(this.currentManifest.stats.avgDuration=Math.round(this.currentManifest.stats.totalDuration/this.currentManifest.stats.totalRequests)),this.currentManifest.stats.minDuration===Number.MAX_SAFE_INTEGER&&(this.currentManifest.stats.minDuration=0);for(let c in this.currentManifest.requestStats){let d=this.currentManifest.requestStats[c],p=this.requestDurations[c]||[];d.count>0&&(d.avgDuration=Math.round(d.totalDuration/d.count)),d.minDuration===Number.MAX_SAFE_INTEGER&&(d.minDuration=0),p.length>0&&(p.sort((m,y)=>m-y),d.p50=Rl(p,50),d.p90=Rl(p,90),d.p95=Rl(p,95),d.p99=Rl(p,99))}let n=Object.values(this.requestDurations).flat();n.length>0&&(n.sort((c,d)=>c-d),this.currentManifest.stats.p50=Rl(n,50),this.currentManifest.stats.p95=Rl(n,95),this.currentManifest.stats.p99=Rl(n,99)),this.requestDurations={},await this.saveManifest();let i=null,s=this.currentRunPath,o=this.currentSuiteId,l=this.currentRunId;if(this.currentRunPath=null,this.currentRunId=null,this.currentSuiteId=null,this.currentManifest=null,this.currentIndexPage=[],this.recentErrors=[],this.resultIndex=0,r&&o&&l&&s)try{i=await new jc(this.basePath).generate(o,l)}catch(c){console.warn("[ResultStorage] HTML report generation failed:",c)}return i}getCurrentStats(){return this.currentManifest?{stats:{...this.currentManifest.stats},requestStats:{...this.currentManifest.requestStats},recentErrors:[...this.recentErrors]}:null}getCurrentRunId(){return this.currentRunId}getCurrentSuiteId(){return this.currentSuiteId}async getResultDetails(e,r,n){let i=hn.join(this.basePath,e,r,"results",n),s=await sr.readFile(i,"utf-8");return JSON.parse(s)}async getIndexPage(e,r,n){let i=hn.join(this.basePath,e,r,"index",`page-${String(n).padStart(4,"0")}.json`),s=await sr.readFile(i,"utf-8");return JSON.parse(s)}async getManifest(e,r){let n=hn.join(this.basePath,e,r,"manifest.json"),i=await sr.readFile(n,"utf-8");return JSON.parse(i)}async listRuns(e){let r=hn.join(this.basePath,e);try{let n=await sr.readdir(r),i=[];for(let s of n.sort().reverse())try{let o=await this.getManifest(e,s);i.push(o)}catch{}return i}catch{return[]}}async listSuites(){try{return(await sr.readdir(this.basePath,{withFileTypes:!0})).filter(r=>r.isDirectory()).map(r=>r.name)}catch{return[]}}async deleteRun(e,r){let n=hn.join(this.basePath,e,r);await sr.rm(n,{recursive:!0,force:!0})}async cleanupOldRuns(){let r=this.configService.getRunnerConfig().resultsRetentionDays;if(r===0)return{deleted:0,freed:0};let n=new Date;n.setDate(n.getDate()-r);let i=0,s=0,o=await this.listSuites();for(let l of o){let c=await this.listRuns(l);for(let d of c)if(new Date(d.startTime)<n){let p=hn.join(this.basePath,l,d.runId),m=await this.getDirectorySize(p);await sr.rm(p,{recursive:!0,force:!0}),i++,s+=m}}return{deleted:i,freed:s}}generateRunId(){let e=new Date,r=e.toISOString().slice(0,10).replace(/-/g,""),n=e.toTimeString().slice(0,8).replace(/:/g,""),i=String(e.getMilliseconds()).padStart(3,"0");return`run-${r}-${n}-${i}`}async saveManifest(){if(!this.currentRunPath||!this.currentManifest)return;let e=hn.join(this.currentRunPath,"manifest.json");await sr.writeFile(e,JSON.stringify(this.currentManifest,null,2),"utf-8")}async writeCurrentIndexPage(){if(!this.currentRunPath||this.currentIndexPage.length===0)return;let e=`page-${String(this.currentPageNumber).padStart(4,"0")}.json`,r=hn.join(this.currentRunPath,"index",e),n={page:this.currentPageNumber,startIndex:(this.currentPageNumber-1)*this.indexPageSize+1,count:this.currentIndexPage.length,summaries:this.currentIndexPage};await sr.writeFile(r,JSON.stringify(n),"utf-8"),this.currentPageNumber++,this.currentIndexPage=[]}updateStats(e){if(!this.currentManifest)return;let r=this.currentManifest.stats,n=this.currentManifest.requestStats;r.totalRequests++,r.totalDuration+=e.duration,r.minDuration=Math.min(r.minDuration,e.duration),r.maxDuration=Math.max(r.maxDuration,e.duration),e.passed?r.passed++:r.failed++,n[e.requestId]||(n[e.requestId]={name:e.name,count:0,passed:0,failed:0,totalDuration:0,avgDuration:0,minDuration:Number.MAX_SAFE_INTEGER,maxDuration:0});let i=n[e.requestId];i.count++,i.totalDuration+=e.duration,i.minDuration=Math.min(i.minDuration,e.duration),i.maxDuration=Math.max(i.maxDuration,e.duration),e.passed?i.passed++:i.failed++}async getDirectorySize(e){let r=0;try{let n=await sr.readdir(e,{withFileTypes:!0});for(let i of n){let s=hn.join(e,i.name);if(i.isDirectory())r+=await this.getDirectorySize(s);else{let o=await sr.stat(s);r+=o.size}}}catch{}return r}}});function Lc(t){return typeof t=="string"?t:""+JSON.stringify(t)}function Cl(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function mv(t){if(!t)return{};let e={};for(let[r,n]of Object.entries(t))e[r]=Cl(n);return e}var DC=le(()=>{"use strict"});var as,Fp,jC,gv,yv,vv,ON=le(()=>{"use strict";as=ve(require("fs")),Fp=ve(require("path")),jC=class{watchers=[];constructor(e,r){let n=this.globToPath(e,r);try{let i=as.watch(n,{recursive:!0},(s,o)=>{if(o){let l=Fp.join(n,o);this.notifyChange(l)}});this.watchers.push(i)}catch{}}globToPath(e,r){return r.includes("**")?e:Fp.join(e,r.replace(/\*/g,""))}notifyChange(e){}onDidChange(e){return{dispose:()=>{}}}onDidCreate(e){return{dispose:()=>{}}}onDidDelete(e){return{dispose:()=>{}}}dispose(){for(let e of this.watchers)e.close();this.watchers=[]}},gv=class{createFileWatcher(e,r){return new jC(e,r)}},yv=class{data={};storeFile;constructor(e){this.storeFile=e,this.load()}load(){try{if(as.existsSync(this.storeFile)){let e=as.readFileSync(this.storeFile,"utf-8");this.data=JSON.parse(e)}}catch{}}save(){try{let e=Fp.dirname(this.storeFile);as.mkdirSync(e,{recursive:!0}),as.writeFileSync(this.storeFile,JSON.stringify(this.data,null,2),"utf-8")}catch{}}get(e,r){let n=this.data[e];return n!==void 0?n:r}async update(e,r){r===void 0?delete this.data[e]:this.data[e]=r,this.save()}},vv=class{async showInformation(e){console.log(`[INFO] ${e}`)}async showWarning(e){console.warn(`[WARN] ${e}`)}async showError(e){console.error(`[ERROR] ${e}`)}}});function LC(t){let e=El.resolve(t.workspaceFolder),{appInfo:r}=t,n=Yo.createFresh(),i=El.join(e,".http-forge",".cache","stores","global-state.json"),s=t.globalStorePath?El.isAbsolute(t.globalStorePath)?t.globalStorePath:El.resolve(e,t.globalStorePath):i,o={workspaceFolder:e,fileWatcherFactory:new gv,notificationService:new vv,globalStore:new yv(s),applicationInfo:r||{name:"http-forge-cli",version:"0.1.0"},persistOverrides:!1};return Rp(n,o),n}function In(t){return LC({workspaceFolder:t})}var El,bv=le(()=>{"use strict";El=ve(require("path"));wC();RC();ON()});function U5(t){let e=[];return t.map(r=>{let n=Rn(r,e);return e.push(n),n})}function PN(t,e,r,n){let i=t.find(d=>d.id===e);if(i)return{item:i,tier:"id"};let s=U5(t.map(d=>d.name)),o=t.filter((d,p)=>s[p]===e);if(o.length===1)return{item:o[0],tier:"slug"};if(o.length>1)throw new Zo(r,e,o.map(d=>({id:d.id,name:d.name,path:n(d)})));let l=e.toLowerCase(),c=t.filter(d=>d.name.toLowerCase()===l);if(c.length===1)return{item:c[0],tier:"name"};throw c.length>1?new Zo(r,e,c.map(d=>({id:d.id,name:d.name,path:n(d)}))):new Error(`${r.charAt(0).toUpperCase()}${r.slice(1)} "${e}" not found`)}function Sv(t,e){let{item:r,tier:n}=PN(t,e,"collection",()=>"");return{collection:r,tier:n}}function wv(t,e){let r=e.split("/").map(o=>o.trim()).filter(o=>o.length>0),n=t.items,i=[],s=[];for(let o of r){let l=n.filter(m=>m.type==="folder"),c=i.join("/"),{item:d,tier:p}=PN(l,o,"folder",m=>c?`${c}/${m.name}`:m.name);i.push(d.name),s.push(p),n=d.items??[]}return{folderPath:i.map(hr).join("/"),tiers:s}}function kN(t,e,r){let n=[];for(let i of t)if(i.type==="request"){let s=Rn(i.name,n);n.push(s),r.push({item:i,folderPath:e,slug:s})}for(let i of t)if(i.type==="folder"){let s=i,o=e?`${e}/${hr(s.name)}`:hr(s.name);kN(s.items??[],o,r)}}function _v(t,e,r){let n=[];kN(t.items,"",n);let i=r?r.replace(/\/+$/,""):void 0,s=i?n.filter(y=>y.folderPath===i||y.folderPath.startsWith(`${i}/`)):n,o=y=>y.folderPath?`${y.folderPath}/${y.item.name}`:y.item.name,l=s.find(y=>y.item.id===e);if(l)return{request:l.item,tier:"id",folderPath:l.folderPath};let c=s.filter(y=>y.slug===e);if(c.length===1)return{request:c[0].item,tier:"slug",folderPath:c[0].folderPath};if(c.length>1)throw new Zo("request",e,c.map(y=>({id:y.item.id,name:y.item.name,path:o(y)})));let d=e.toLowerCase(),p=s.filter(y=>y.item.name.toLowerCase()===d);if(p.length===1)return{request:p[0].item,tier:"name",folderPath:p[0].folderPath};if(p.length>1)throw new Zo("request",e,p.map(y=>({id:y.item.id,name:y.item.name,path:o(y)})));let m=i?` under folder "${i}"`:"";throw new Error(`Request "${e}" not found in collection "${t.name}"${m}`)}var Zo,UC=le(()=>{"use strict";Pa();Ii();Zo=class extends Error{constructor(r,n,i){super(`Ambiguous ${r} reference "${n}" matches ${i.length} items:
|
|
1016
1016
|
`+i.map(s=>` - ${s.name} (id: ${s.id}, path: ${s.path||"/"})`).join(`
|
|
1017
1017
|
`)+`
|
|
1018
|
-
Disambiguate by passing the id or slug.`);this.kind=r;this.value=n;this.candidates=i;this.name="AmbiguousRefError"}kind;value;candidates}});var jp={};Rs(jp,{runCollection:()=>Vs,runFolder:()=>J5,runRequest:()=>xv,runSuite:()=>Dp});function BC(t){let e=[t.testSuite,t.collection,t.environmentConfig,t.config,t.console];for(let r of e)try{r?.dispose?.()}catch{}}function TN(t){return t==="1"||t==="true"||t==="yes"||t==="on"}function H5(){return TN(process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS)}function B5(){let t=process.env.HTTP_FORGE_MAX_REQUESTS;if(!t||t.trim()==="")return 50;let e=Number(t);if(!Number.isFinite(e)||e<=0)throw new Error("HTTP_FORGE_MAX_REQUESTS must be a positive number when provided");return Math.floor(e)}function $N(t,e=[]){return TN(process.env.HTTP_FORGE_GENERATE_REPORTS)||e.includes("html")?!0:t.includes("report")}function HC(t){if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}}function V5(t){return t?Object.fromEntries(Object.entries(t).filter(([e])=>e.toLowerCase()!=="set-cookie")):{}}function NN(t){return gi(V5(t))}function MN(t){return c_((t??[]).map(e=>({name:e.name,value:e.value})))}function AN(t){return t.replace(/[^a-zA-Z0-9_-]/g,"_")}function FN(t){let e=["none","inherit","basic","bearer","apikey","oauth2"],r=t.auth?.type&&e.includes(t.auth.type)?t.auth.type:void 0;return{id:t.id,name:t.name,method:t.method,url:t.url,headers:Array.isArray(t.headers)?t.headers.reduce((n,i)=>(i.enabled&&i.key&&(n[i.key]=i.value??""),n),{}):t.headers,query:Array.isArray(t.query)?t.query.reduce((n,i)=>(i.enabled&&i.key&&(n[i.key]=i.value??""),n),{}):t.query,params:t.params?Object.entries(t.params).reduce((n,[i,s])=>(n[i]=typeof s=="string"?s:s.value??"",n),{}):void 0,body:t.body??null,scripts:t.scripts,settings:t.settings,auth:{type:r==="inherit"?"none":r,bearerToken:t.auth?.bearerToken,basicAuth:t.auth?.basicAuth,apikey:t.auth?.apikey,oauth2:t.auth?.oauth2}}}function DN(t,e){let r={...t};return e.headers&&(r.headers={...t.headers??{},...e.headers}),e.query&&(r.query=e.query),e.body!==void 0&&(r.body={type:"raw",raw:e.body,contentType:"application/json"}),r}function Rv(t){return t?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,String(r)])):{}}function jN(t,e,r){if(t&&t.type&&t.type!=="inherit")return t.type==="none"?void 0:t;for(let n=e.length-1;n>=0;n--){let i=e[n];if(i?.type&&i.type!=="inherit")return i.type==="none"?void 0:i}if(r&&r.type&&r.type!=="inherit")return r.type==="none"?void 0:r}function VC(t,e,r=t.items,n=[],i=[],s=[]){for(let o of r){if(o.type==="request"&&o.id===e)return{request:o,folderScriptsChain:[...n],folderAuthChain:[...i],folderPath:s.map(hr).join("/")};if(o.type==="folder"){let l=o,c=l.scripts?[...n,l.scripts]:[...n],d=l.auth?[...i,l.auth]:[...i],p=[...s,l.name],m=VC(t,e,l.items??[],c,d,p);if(m)return m}}}function LN(t,e=t.items,r=[],n=[]){let i=[];for(let s of e)if(s.type==="request")i.push({request:s,folderScriptsChain:[...r],folderPath:n.map(hr).join("/")});else{let o=s,l=o.scripts?[...r,o.scripts]:[...r],c=[...n,o.name];i.push(...LN(t,o.items??[],l,c))}return i}function W5(t,e,r=!0){if(!e)return t;let n=e.replace(/\/+$/,"");return t.filter(({folderPath:i})=>r?i===n||i.startsWith(`${n}/`):i===n)}function z5(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function UN(t,e){if(e.collectionId){let r=t.getCollection(e.collectionId);if(!r)throw new Error(`Collection "${e.collectionId}" not found`);return r}if(e.collectionRef){let{collection:r,tier:n}=Sv(t.getAllCollections(),e.collectionRef);return e.onResolve?.({kind:"collection",value:e.collectionRef,tier:n,id:r.id}),r}throw new Error("A collection reference is required (collectionId or collectionRef)")}function HN(t,e){if(e.folderPath)return e.folderPath;if(e.folderRef){let{folderPath:r}=wv(t,e.folderRef);return e.onResolve?.({kind:"folder",value:e.folderRef,tier:"name",id:r,path:r}),r}}async function BN(t,e,r,n){let i=r.environment??t.environmentConfig.getSelectedEnvironment(),s=r.iterations??e.config?.iterations??1,o=r.stopOnError??e.config?.stopOnError??!1,l=r.delay??e.config?.delayBetweenRequests??0,c=Math.max(1,Math.min(50,r.concurrency??1)),d=r.requestFilter,p=r.include??[],m=r.reporters??[],y=m.includes("junit"),b=Rv(r.variables),q=H5(),x=$N(p,m),v=Math.max(1,Math.min(1e4,Number(r.maxNodeLoopIterations??100))),
|
|
1019
|
-
`)}function k(te){if(!(!te||typeof te!="object")){if(te.script!==void 0)return te.script;if(typeof te.scriptRef=="string"&&te.scriptRef.trim()){let re=e?.scripts;if(re&&typeof re=="object")return re[te.scriptRef]}}}function P(te){return te?.name||te?.label||te?.id||"flow-node"}function M(te,re){let Te=t.environmentConfig.getResolvedEnvironment(i),ge=mv(_.vars),or={variables:{get:oe=>Cl(_.vars[oe]),set:(oe,fr)=>{typeof oe=="string"&&oe.trim()&&(_.vars[oe]=Lc(fr))},unset:oe=>{typeof oe=="string"&&oe.trim()&&delete _.vars[oe]},has:oe=>Object.prototype.hasOwnProperty.call(_.vars,oe),toObject:()=>({...ge})},environment:{get:oe=>Cl(Te?.variables?.[oe]),set:(oe,fr)=>{typeof oe=="string"&&oe.trim()&&t.environmentConfig.setEnvironmentVariable(oe,Lc(fr),i)},unset:oe=>{typeof oe=="string"&&oe.trim()&&t.environmentConfig.deleteEnvironmentVariable(oe,i)},clear:()=>{t.environmentConfig.clearEnvironmentVariables(i)}},globals:{get:oe=>Cl(t.environmentConfig.getGlobalVariables()?.[oe]),set:(oe,fr)=>{typeof oe=="string"&&oe.trim()&&t.environmentConfig.setGlobalVariable(oe,Lc(fr))},unset:oe=>{typeof oe=="string"&&oe.trim()&&t.environmentConfig.deleteGlobalVariable(oe)},clear:()=>{t.environmentConfig.clearGlobalVariables()}}};return{vars:ge,lastResult:_.lastResult,iteration:re,node:te,pm:or,ctx:or,hf:or}}function j(te,re,Te){return typeof te!="string"||!te.trim()?!0:!!ui(te,M(re,Te))}function I(te){if(!te)return{};let re={};for(let[Te,ge]of Object.entries(te))re[Te]=Array.isArray(ge)?ge.join("; "):String(ge);return re}function R(te){return{executedRequest:te.executedRequest,status:te.response?.status??0,statusText:te.response?.statusText??"",headers:I(te.response?.headers),body:te.response?.body,cookies:te.response?.cookies,responseTime:te.duration,responseSize:typeof te.response?.body=="string"?Buffer.byteLength(te.response.body,"utf8"):0}}async function A(te,re,Te,ge,we){let Ze=E(te);if(!Ze||!Ze.trim())return;let Ct=t.environmentConfig.getResolvedEnvironment(i),or=t.environmentConfig.getGlobalVariables(),fr={request:{url:we?.request?.url??_.lastResult?.executedRequest?.url??"http://flow.local/node",method:we?.request?.method??_.lastResult?.executedRequest?.method??"GET",headers:I(we?.request?.headers),body:we?.request?.body??null,params:we?.request?.params??{},query:we?.request?.query??{}},variables:Rv(_.vars),environmentVariables:Ct?.variables||{},globals:{...or},environmentName:i,info:{eventName:ge==="post"?"test":"prerequest",requestName:P(re),requestId:String(re?.id??P(re)),collectionName:e.name,iteration:Te,iterationCount:s},onEnvironmentChange:(gt,qe,Pn)=>{gt==="set"&&qe&&Pn!==void 0?t.environmentConfig.setEnvironmentVariable(qe,Pn,i):gt==="unset"&&qe?t.environmentConfig.deleteEnvironmentVariable(qe,i):gt==="clear"&&t.environmentConfig.clearEnvironmentVariables(i)},onGlobalsChange:(gt,qe,Pn)=>{gt==="set"&&qe&&Pn!==void 0?t.environmentConfig.setGlobalVariable(qe,Pn):gt==="unset"&&qe?t.environmentConfig.deleteGlobalVariable(qe):gt==="clear"&&t.environmentConfig.clearGlobalVariables()}},Lt=t.scriptExecutor.createRequestSession(fr);try{if(ge==="post"&&we?.response){let gt=await Lt.executePostResponse(Ze,we.response),qe=gt.localVariables??gt.modifiedVariables;qe&&typeof qe=="object"&&(_.vars={...qe})}else{let gt=await Lt.executePreRequest(Ze);if(!gt.success)throw new Error(gt.error||"Script execution failed");let qe=gt.localVariables??gt.modifiedVariables;qe&&typeof qe=="object"&&(_.vars={...qe})}}catch(gt){let qe=gt instanceof Error?gt.message:String(gt);throw new Error(`Suite ${ge}-script failed on node "${P(re)}": ${qe}`)}finally{Lt.dispose?.()}}function F(te){let re=te?.type==="request"&&te?.request?te.request:te;if(!(!re||typeof re!="object")&&!(!re.collectionId||!re.requestId||!re.name))return{collectionId:re.collectionId,requestId:re.requestId,name:re.name,folderPath:re.folderPath,enabled:re.enabled}}function U(te){return!te||typeof te!="object"?!1:te.type==="request"?!!F(te):!!(te.collectionId&&te.requestId&&te.name)}function D(te,re){for(let Te of re){let ge=te?.[Te];if(Array.isArray(ge))return ge}return[]}async function J(te,re,Te){if(lt.signal.aborted||re.enabled===!1||d&&!d.some(Lt=>re.name.toLowerCase().includes(Lt.toLowerCase())))return;let ge=t.collection.getCollection(re.collectionId);if(!ge)return;let we=VC(ge,re.requestId);if(!we)return;let Ze=jN(we.request.auth,we.folderAuthChain,ge.auth),Ct=new As(t.httpRequest,t.scriptExecutor,t.environmentConfig,t.requestPreparer,i,$r,ge.scripts,we.folderScriptsChain,void 0,ge.name,ge.auth,te,s),or=DN(FN({...we.request,auth:Ze}),{headers:r.headers,query:r.query,body:r.body,variables:{..._.vars,...r.variables}}),oe=await Ct.execute(or,Rv(_.vars),lt.signal);_.lastResult=oe,oe.modifiedVariables&&typeof oe.modifiedVariables=="object"&&(_.vars={...oe.modifiedVariables});let fr=Np({collectionName:ge.name,folderPath:re.folderPath??"",blockLabel:Te});oe.folderPath=re.folderPath??"",oe.collectionName=ge.name,oe.groupPath=fr.groupPath,oe.groupType=fr.groupType,await ye.saveResult(te,oe),oe.assertions?.length||Tr.add(re.name),oe.passed?he++:Yt++,p.includes("perRequest")&&mt.push({name:re.name,iteration:te,status:oe.response?.status,ok:(oe.response?.status??0)>=200&&(oe.response?.status??0)<300,duration:`${oe.duration}ms`,allPassed:oe.passed,...p.includes("consoleOutput")&&oe.consoleOutput?.length?{consoleOutput:oe.consoleOutput}:{}}),oe.passed||(Nt.push({name:re.name,iteration:te,method:oe.executedRequest?.method,url:oe.executedRequest?.url,requestBody:HC(oe.executedRequest?.body?.content)??oe.executedRequest?.body?.content??null,requestHeaders:gi(oe.executedRequest?.headers??{}),status:oe.response?.status,duration:`${oe.duration}ms`,body:HC(oe.response?.body),headers:NN(oe.response?.headers),cookies:MN(oe.response?.cookies),failedTests:oe.assertions?.filter(Lt=>!Lt.passed).map(Lt=>({name:Lt.name,...Lt.message?{message:Lt.message}:{}})),...oe.error?{error:oe.error}:{},...p.includes("consoleOutput")&&oe.consoleOutput?.length?{consoleOutput:oe.consoleOutput}:{}}),o&<.abort()),l>0&&!lt.signal.aborted&&await new Promise(Lt=>setTimeout(Lt,l))}async function Q(te,re,Te){for(let ge of re){if(lt.signal.aborted)break;await se(te,ge,Te)}}async function se(te,re,Te){if(!re||typeof re!="object"||re.enabled===!1||!j(re.condition,re,te))return;if(U(re)){let Ze=F(re);Ze&&await J(te,Ze,Te);return}let ge=typeof re.type=="string"?re.type.toLowerCase():"",we=D(re,["then","nodes","body"]);if(ge==="block"){let Ze=typeof re.name=="string"?re.name.trim():"";await Q(te,we,Ze||Te);return}if(ge==="script"){let Ze=k(re),Ct=re.phase==="post"?"post":"pre";await A(Ze,re,te,Ct);return}if(ge==="if"){let Ze=typeof re.if=="string"?re.if:re.condition;if(j(Ze,re,te)){await Q(te,we,Te);return}if(Array.isArray(re.elseif)){for(let Ct of re.elseif)if(j(Ct?.condition,Ct,te)){await Q(te,D(Ct,["then","nodes","body"]),Te);return}}await Q(te,D(re,["else","elseNodes"]),Te);return}if(ge==="switch"){let Ze=ui(String(re.expression??""),M(re,te));if(Array.isArray(re.cases)){for(let Ct of re.cases)if(Object.prototype.hasOwnProperty.call(Ct??{},"equals")?Ct.equals===Ze:j(Ct?.condition,Ct,te)){await Q(te,D(Ct,["then","nodes","body"]),Te);return}}await Q(te,D(re,["default","defaultNodes"]),Te);return}if(ge==="while"){let Ze=typeof re.while=="string"?re.while:re.condition,Ct=Math.max(1,Math.min(1e4,Number(re.maxIterations??v))),or=0;for(;j(Ze,re,te);){if(or+=1,or>Ct)throw new Error(`Suite while loop exceeded maxIterations (${Ct}) on node "${P(re)}"`);if(await Q(te,we,Te),lt.signal.aborted)break}return}if(ge==="for"){let Ze=Math.max(1,Math.min(1e4,Number(re.maxIterations??v))),Ct=E(re.init),or=E(re.update),oe=typeof re.loopCondition=="string"&&re.loopCondition.trim()?re.loopCondition:typeof re.condition=="string"&&re.condition.trim()?re.condition:"true";Ct&&await A(Ct,re,te,"pre");let fr=0;for(;j(oe,re,te);){if(fr+=1,fr>Ze)throw new Error(`Suite for loop exceeded maxIterations (${Ze}) on node "${P(re)}"`);if(await Q(te,we,Te),lt.signal.aborted)break;or&&await A(or,re,te,"post")}return}we.length>0&&await Q(te,we,Te)}function fe(te){let re=0,Te=[...te];for(;Te.length>0;){let ge=Te.pop();if(!(!ge||typeof ge!="object"||ge.enabled===!1)){if(U(ge)){let we=F(ge);we&&(!d||d.some(Ze=>we.name.toLowerCase().includes(Ze.toLowerCase())))&&(re+=1);continue}for(let we of["nodes","then","body","else","elseNodes","default","defaultNodes"])Array.isArray(ge[we])&&Te.push(...ge[we]);if(Array.isArray(ge.elseif))for(let we of ge.elseif)Array.isArray(we?.nodes)&&Te.push(...we.nodes),Array.isArray(we?.then)&&Te.push(...we.then);if(Array.isArray(ge.cases))for(let we of ge.cases)Array.isArray(we?.nodes)&&Te.push(...we.nodes),Array.isArray(we?.then)&&Te.push(...we.then)}}return re}let Be=Array.isArray(e.nodes)?e.nodes:Array.isArray(e.requests)?e.requests.map(te=>({type:"request",request:te})):[],Re=fe(Be);if(q){let te=B5(),re=Re*s;if(re>te)throw new Error(`Suite "${e.name}" would execute ${re} request calls (${Re} requests \xD7 ${s} iterations), which exceeds HTTP_FORGE_MAX_REQUESTS (${te}). Reduce iterations, use requestFilter, or increase HTTP_FORGE_MAX_REQUESTS.`)}let ye=new xl(t.config),ke=await ye.initializeRun(e.id,e.name,i,{iterations:s,delayBetweenRequests:l,stopOnError:o}),mt=[],Nt=[],he=0,Yt=0,Tr=new Set,lt=new AbortController,$r=new bl;async function wr(te){await Q(te,Be)}for(let te=1;te<=s&&!lt.signal.aborted;te+=c){let re=Math.min(te+c-1,s),Te=Array.from({length:re-te+1},(ge,we)=>te+we);await Promise.all(Te.map(wr))}let xt=await ye.finalizeRun("completed",x),St=null;if(y)try{St=await new wl(ye.getBasePath()).generate(e.id,ke)}catch(te){console.warn("[direct-execution] JUnit report generation failed:",te)}let Gr=n==="collection"?"collection":"suite",At=ye.getCurrentStats()?.stats,Ai=At?{min:At.minDuration,max:At.maxDuration,avg:At.avgDuration,p50:At.p50??null,p95:At.p95??null,p99:At.p99??null}:null,On={[Gr]:e.name,environment:i,summary:{total:he+Yt,passed:he,failed:Yt,...s>1?{iterations:s}:{},...c>1?{concurrency:c}:{},allPassed:Yt===0,...Ai?{durationMs:Ai}:{}}};if((Yt>0||p.includes("failedOnly"))&&(On.failedRequests=Nt),p.includes("perRequest")&&(On.results=mt),xt!==null&&(On.report={uri:`file://${xt}`,hint:"Click the URI to open the HTML report in your browser"}),St!==null&&(On.junitReport={path:St}),Tr.size>0){let te=Math.max(Re,1),re=Tr.size,Te=Array.from(Tr).slice(0,5);On.noAssertionExamples=Te;let ge=e.name;if(re/te>.5)On._suggestions=[`${re}/${te} requests have no pm.test() assertions. Invoke the "review-collection" prompt (collection="${ge}") for a full coverage analysis and to identify assertion gaps.`];else{let we=Te.map(Ze=>`"${Ze}"`).join(", ");On._suggestions=[`${re} request(s) have no pm.test() assertions: ${we}. Invoke the "suggest-assertions" prompt (collection="${ge}") to generate test coverage for them.`]}}return On}async function xv(t){let e=In(t.workspaceFolder),r=t.include??[],n=t.reporters??[],i=n.includes("junit"),s=$N(r,n);try{let o=e.collection,l=UN(o,t),c=HN(l,t),d=t.requestId;if(!d){if(!t.requestRef)throw new Error("A request reference is required (requestId or requestRef)");let M=_v(l,t.requestRef,c);d=M.request.id,t.onResolve?.({kind:"request",value:t.requestRef,tier:M.tier,id:d,path:M.folderPath?`${M.folderPath}/${M.request.name}`:M.request.name})}let p=VC(l,d);if(!p)throw new Error(`Request "${d}" not found in collection "${l.name}"`);let m=jN(p.request.auth,p.folderAuthChain,l.auth),y=t.environment||e.environmentConfig.getSelectedEnvironment(),b=DN(FN({...p.request,auth:m}),{headers:t.headers,query:t.query,body:t.body,variables:t.variables}),x=await new As(e.httpRequest,e.scriptExecutor,e.environmentConfig,e.requestPreparer,y,new bl,l.scripts,p.folderScriptsChain,void 0,l.name,l.auth).execute(b,Rv(t.variables)),v=Np({collectionName:l.name,folderPath:p.folderPath});x.folderPath=p.folderPath,x.collectionName=l.name,x.groupPath=v.groupPath,x.groupType=v.groupType;let _=null,E=null;if(s||i){let M=new xl(e.config),j=`request-${AN(l.id)}-${AN(d)}`,I=`Request: ${p.request.name}`,R=await M.initializeRun(j,I,y,{iterations:1,delayBetweenRequests:0,stopOnError:!0});if(await M.saveResult(1,x),_=await M.finalizeRun("completed",s),i)try{E=await new wl(M.getBasePath()).generate(j,R)}catch(A){console.warn("[direct-execution] JUnit report generation failed:",A)}}let k=NN(x.response?.headers),P=MN(x.response?.cookies);return{request:p.request.name,status:x.response?.status||0,ok:(x.response?.status??0)>=200&&(x.response?.status??0)<300,duration:`${x.duration}ms`,body:HC(x.response?.body),allPassed:x.passed,assertions:x.assertions?.map(M=>({name:M.name,passed:M.passed,message:M.message})),...r.includes("headers")?{headers:k}:{},...r.includes("cookies")?{cookies:P}:{},...r.includes("tests")?{tests:x.assertions?.map(M=>({name:M.name,passed:M.passed,...M.message?{message:M.message}:{}}))}:{},...Object.keys(x.modifiedVariables??{}).length?{modifiedVariables:x.modifiedVariables}:{},...r.includes("consoleOutput")&&x.consoleOutput?.length?{consoleOutput:x.consoleOutput}:{},..._!==null?{report:{uri:`file://${_}`,hint:"Click the URI to open the HTML report in your browser"}}:{},...E!==null?{junitReport:{path:E}}:{},...x.error?{error:x.error}:{}}}catch(o){throw o}finally{BC(e)}}async function Vs(t){let e=In(t.workspaceFolder);try{let r=e.collection,n=UN(r,t),i=HN(n,t),s=LN(n),o=W5(s,i,t.recursive);if(o.length===0&&i)throw new Error(`No requests found under folder "${i}" in collection "${n.name}"`);let l=o.map(({request:d,folderPath:p})=>({id:d.id,slug:d.id.toLowerCase().replace(/\s+/g,"-"),collectionId:n.id,requestId:d.id,name:d.name,method:d.method,collectionName:n.name,folderPath:p,enabled:!0})),c={id:i?`temp-${n.id}-${z5(i)}`:`temp-${n.id}`,name:i?`${n.name} / ${i}`:n.name,requests:l,config:{iterations:1,delay:0,stopOnError:t.stopOnError??!1,readFromSharedSession:!1,writeToSharedSession:!1},isTemporary:!0,createdAt:Date.now(),updatedAt:Date.now()};return BN(e,c,{environment:t.environment,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,requestFilter:void 0,include:t.include,reporters:t.reporters,concurrency:t.concurrency,variables:t.variables},"collection")}catch(r){throw r}finally{BC(e)}}async function J5(t){return Vs({recursive:!0,...t})}async function Dp(t){let e=In(t.workspaceFolder);try{let n=await e.testSuite.getSuite(t.suiteId);if(!n)throw new Error(`Test suite "${t.suiteId}" not found`);return BN(e,n,{environment:t.environment,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,requestFilter:t.requestFilter,include:t.include,reporters:t.reporters,concurrency:t.concurrency,variables:t.variables},"suite")}catch(r){throw r}finally{BC(e)}}var Uc=le(()=>{"use strict";kC();og();_d();TC();FC();Pf();DC();Ii();bv();UC();PC()});var GN={};Rs(GN,{createMcpRuntime:()=>a7});async function Pi(t){let e=process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS,r=process.env.HTTP_FORGE_GENERATE_REPORTS;process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS="true",process.env.HTTP_FORGE_GENERATE_REPORTS="true";try{return await t()}finally{e===void 0?delete process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS:process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS=e,r===void 0?delete process.env.HTTP_FORGE_GENERATE_REPORTS:process.env.HTTP_FORGE_GENERATE_REPORTS=r}}function Hc(t){let e=[t.testSuite,t.collection,t.environmentConfig,t.config,t.console];for(let r of e)try{r?.dispose?.()}catch{}}async function K5(t,e){let r=JC.get(t);if(r&&r.expiresAt>Date.now())return r.tools;let n=WC.get(t);if(n)return n;let i=(async()=>{let s=e.config.getMcpConfig(),o=(d,p)=>!!d?.length&&(d.includes(p.id)||d.includes(p.name)),l=e.collection.getAllCollections().filter(d=>!o(s.excludedCollections,d)),c=(await e.testSuite.getAllSuites()).filter(d=>!o(s.excludedSuites,d));return dv(l,c,s)})().then(s=>(JC.set(t,{tools:s,expiresAt:Date.now()+Y5}),s)).finally(()=>WC.delete(t));return WC.set(t,i),i}function Q5(t,e){let r=t.config.getMcpConfig().toolPrefix??"";return r&&e.startsWith(r)?e.slice(r.length):e}function Z5(t,e,r){return t.replace(/"uri"\s*:\s*"file:\/\/([^"]+)"/g,(n,i)=>`"uri":"http://${e}:${r}/report?path=${encodeURIComponent(i)}"`)}function VN(t,e,r,n){ql(t,200,{jsonrpc:"2.0",id:e,error:{code:r,message:n}})}function X5(t){return t.config.getMcpConfig().toolPageSize??200}async function e7(t,e){switch(e.method){case"initialize":return{protocolVersion:"2024-11-05",capabilities:{tools:{},prompts:{}},serverInfo:{name:"http-forge",version:"1.0.0"},instructions:"You are assisting with HTTP API testing via HTTP Forge. When a run_suite, run_collection, or run_folder call completes with failures (summary.failed > 0 or allPassed === false), automatically analyze the 'failedRequests' in the response and provide: (1) root cause for each failure, (2) specific fix recommendations, (3) updated pm.test() assertion scripts where relevant. Do not wait for the user to ask \u2014 proactively diagnose and suggest fixes. For async runs (status: 'running'), poll with get_run_status until complete, then call get_run_summary. When get_run_summary returns a _nextStep field you MUST execute it immediately \u2014 the failedRequests array is already included inline so no extra tool call is needed. Analyze the failures and provide diagnosis without waiting for the user."};case"tools/list":{let r=await K5(t.workspaceFolder,t.container),n=e.params??{},i=typeof n.cursor=="string"?n.cursor:void 0,s=X5(t.container);if(s<=0||r.length<=s)return{tools:r};let o=fv(i),l=r.slice(o,o+s),c=o+s,d={tools:l};return c<r.length&&(d.nextCursor=cv(c)),d}case"tools/call":{let r=e.params??{},n=r.name,i=r.arguments;if(!n)throw new Error("Missing tool name");let s=await GC(t,n,i??{}),o=s,l=o?.summary;l&&((l.failed??0)>0||l.allPassed===!1)&&(o._nextStep=`${l.failed??"Some"} request(s) failed. Please analyze the 'failedRequests' above: identify the root cause of each failure, suggest specific fixes (URL, auth, body, environment variables), and provide updated pm.test() assertion scripts where the assertions are incorrect.`);let c=JSON.stringify(s,null,2),d=Z5(c,t.host,t.port),p=d.match(/"uri"\s*:\s*"(http:\/\/[^"]+\/report\?[^"]+)"/),m=p?`
|
|
1018
|
+
Disambiguate by passing the id or slug.`);this.kind=r;this.value=n;this.candidates=i;this.name="AmbiguousRefError"}kind;value;candidates}});var jp={};Rs(jp,{runCollection:()=>Vs,runFolder:()=>J5,runRequest:()=>xv,runSuite:()=>Dp});function BC(t){let e=[t.testSuite,t.collection,t.environmentConfig,t.config,t.console];for(let r of e)try{r?.dispose?.()}catch{}}function TN(t){return t==="1"||t==="true"||t==="yes"||t==="on"}function H5(){return TN(process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS)}function B5(){let t=process.env.HTTP_FORGE_MAX_REQUESTS;if(!t||t.trim()==="")return 50;let e=Number(t);if(!Number.isFinite(e)||e<=0)throw new Error("HTTP_FORGE_MAX_REQUESTS must be a positive number when provided");return Math.floor(e)}function $N(t,e=[]){return TN(process.env.HTTP_FORGE_GENERATE_REPORTS)||e.includes("html")?!0:t.includes("report")}function HC(t){if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}}function V5(t){return t?Object.fromEntries(Object.entries(t).filter(([e])=>e.toLowerCase()!=="set-cookie")):{}}function NN(t){return gi(V5(t))}function MN(t){return c_((t??[]).map(e=>({name:e.name,value:e.value})))}function AN(t){return t.replace(/[^a-zA-Z0-9_-]/g,"_")}function FN(t){let e=["none","inherit","basic","bearer","apikey","oauth2"],r=t.auth?.type&&e.includes(t.auth.type)?t.auth.type:void 0;return{id:t.id,name:t.name,method:t.method,url:t.url,headers:Array.isArray(t.headers)?t.headers.reduce((n,i)=>(i.enabled&&i.key&&(n[i.key]=i.value??""),n),{}):t.headers,query:Array.isArray(t.query)?t.query.reduce((n,i)=>(i.enabled&&i.key&&(n[i.key]=i.value??""),n),{}):t.query,params:t.params?Object.entries(t.params).reduce((n,[i,s])=>(n[i]=typeof s=="string"?s:s.value??"",n),{}):void 0,body:t.body??null,scripts:t.scripts,settings:t.settings,auth:{type:r==="inherit"?"none":r,bearerToken:t.auth?.bearerToken,basicAuth:t.auth?.basicAuth,apikey:t.auth?.apikey,oauth2:t.auth?.oauth2}}}function DN(t,e){let r={...t};return e.headers&&(r.headers={...t.headers??{},...e.headers}),e.query&&(r.query=e.query),e.body!==void 0&&(r.body={type:"raw",raw:e.body,contentType:"application/json"}),r}function Rv(t){return t?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,String(r)])):{}}function jN(t,e,r){if(t&&t.type&&t.type!=="inherit")return t.type==="none"?void 0:t;for(let n=e.length-1;n>=0;n--){let i=e[n];if(i?.type&&i.type!=="inherit")return i.type==="none"?void 0:i}if(r&&r.type&&r.type!=="inherit")return r.type==="none"?void 0:r}function VC(t,e,r=t.items,n=[],i=[],s=[]){for(let o of r){if(o.type==="request"&&o.id===e)return{request:o,folderScriptsChain:[...n],folderAuthChain:[...i],folderPath:s.map(hr).join("/")};if(o.type==="folder"){let l=o,c=l.scripts?[...n,l.scripts]:[...n],d=l.auth?[...i,l.auth]:[...i],p=[...s,l.name],m=VC(t,e,l.items??[],c,d,p);if(m)return m}}}function LN(t,e=t.items,r=[],n=[]){let i=[];for(let s of e)if(s.type==="request")i.push({request:s,folderScriptsChain:[...r],folderPath:n.map(hr).join("/")});else{let o=s,l=o.scripts?[...r,o.scripts]:[...r],c=[...n,o.name];i.push(...LN(t,o.items??[],l,c))}return i}function W5(t,e,r=!0){if(!e)return t;let n=e.replace(/\/+$/,"");return t.filter(({folderPath:i})=>r?i===n||i.startsWith(`${n}/`):i===n)}function z5(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function UN(t,e){if(e.collectionId){let r=t.getCollection(e.collectionId);if(!r)throw new Error(`Collection "${e.collectionId}" not found`);return r}if(e.collectionRef){let{collection:r,tier:n}=Sv(t.getAllCollections(),e.collectionRef);return e.onResolve?.({kind:"collection",value:e.collectionRef,tier:n,id:r.id}),r}throw new Error("A collection reference is required (collectionId or collectionRef)")}function HN(t,e){if(e.folderPath)return e.folderPath;if(e.folderRef){let{folderPath:r}=wv(t,e.folderRef);return e.onResolve?.({kind:"folder",value:e.folderRef,tier:"name",id:r,path:r}),r}}async function BN(t,e,r,n){let i=r.environment??t.environmentConfig.getSelectedEnvironment(),s=r.iterations??e.config?.iterations??1,o=r.stopOnError??e.config?.stopOnError??!1,l=r.delay??e.config?.delayBetweenRequests??0,c=Math.max(1,Math.min(50,r.concurrency??1)),d=r.requestFilter,p=r.include??[],m=r.reporters??[],y=m.includes("junit"),b=Rv(r.variables),q=H5(),x=$N(p,m),v=Math.max(1,Math.min(1e4,Number(r.maxNodeLoopIterations??100))),R={vars:{...b}};function E(te){if(typeof te=="string")return te;if(Array.isArray(te))return te.filter(Te=>typeof Te=="string").join(`
|
|
1019
|
+
`)}function k(te){if(!(!te||typeof te!="object")){if(te.script!==void 0)return te.script;if(typeof te.scriptRef=="string"&&te.scriptRef.trim()){let re=e?.scripts;if(re&&typeof re=="object")return re[te.scriptRef]}}}function P(te){return te?.name||te?.label||te?.id||"flow-node"}function M(te,re){let Te=t.environmentConfig.getResolvedEnvironment(i),ge=mv(R.vars),or={variables:{get:oe=>Cl(R.vars[oe]),set:(oe,fr)=>{typeof oe=="string"&&oe.trim()&&(R.vars[oe]=Lc(fr))},unset:oe=>{typeof oe=="string"&&oe.trim()&&delete R.vars[oe]},has:oe=>Object.prototype.hasOwnProperty.call(R.vars,oe),toObject:()=>({...ge})},environment:{get:oe=>Cl(Te?.variables?.[oe]),set:(oe,fr)=>{typeof oe=="string"&&oe.trim()&&t.environmentConfig.setEnvironmentVariable(oe,Lc(fr),i)},unset:oe=>{typeof oe=="string"&&oe.trim()&&t.environmentConfig.deleteEnvironmentVariable(oe,i)},clear:()=>{t.environmentConfig.clearEnvironmentVariables(i)}},globals:{get:oe=>Cl(t.environmentConfig.getGlobalVariables()?.[oe]),set:(oe,fr)=>{typeof oe=="string"&&oe.trim()&&t.environmentConfig.setGlobalVariable(oe,Lc(fr))},unset:oe=>{typeof oe=="string"&&oe.trim()&&t.environmentConfig.deleteGlobalVariable(oe)},clear:()=>{t.environmentConfig.clearGlobalVariables()}}};return{vars:ge,lastResult:R.lastResult,iteration:re,node:te,pm:or,ctx:or,hf:or}}function j(te,re,Te){return typeof te!="string"||!te.trim()?!0:!!ui(te,M(re,Te))}function I(te){if(!te)return{};let re={};for(let[Te,ge]of Object.entries(te))re[Te]=Array.isArray(ge)?ge.join("; "):String(ge);return re}function _(te){return{executedRequest:te.executedRequest,status:te.response?.status??0,statusText:te.response?.statusText??"",headers:I(te.response?.headers),body:te.response?.body,cookies:te.response?.cookies,responseTime:te.duration,responseSize:typeof te.response?.body=="string"?Buffer.byteLength(te.response.body,"utf8"):0}}async function A(te,re,Te,ge,we){let Ze=E(te);if(!Ze||!Ze.trim())return;let Ct=t.environmentConfig.getResolvedEnvironment(i),or=t.environmentConfig.getGlobalVariables(),fr={request:{url:we?.request?.url??R.lastResult?.executedRequest?.url??"http://flow.local/node",method:we?.request?.method??R.lastResult?.executedRequest?.method??"GET",headers:I(we?.request?.headers),body:we?.request?.body??null,params:we?.request?.params??{},query:we?.request?.query??{}},variables:Rv(R.vars),environmentVariables:Ct?.variables||{},globals:{...or},environmentName:i,info:{eventName:ge==="post"?"test":"prerequest",requestName:P(re),requestId:String(re?.id??P(re)),collectionName:e.name,iteration:Te,iterationCount:s},onEnvironmentChange:(gt,qe,Pn)=>{gt==="set"&&qe&&Pn!==void 0?t.environmentConfig.setEnvironmentVariable(qe,Pn,i):gt==="unset"&&qe?t.environmentConfig.deleteEnvironmentVariable(qe,i):gt==="clear"&&t.environmentConfig.clearEnvironmentVariables(i)},onGlobalsChange:(gt,qe,Pn)=>{gt==="set"&&qe&&Pn!==void 0?t.environmentConfig.setGlobalVariable(qe,Pn):gt==="unset"&&qe?t.environmentConfig.deleteGlobalVariable(qe):gt==="clear"&&t.environmentConfig.clearGlobalVariables()}},Lt=t.scriptExecutor.createRequestSession(fr);try{if(ge==="post"&&we?.response){let gt=await Lt.executePostResponse(Ze,we.response),qe=gt.localVariables??gt.modifiedVariables;qe&&typeof qe=="object"&&(R.vars={...qe})}else{let gt=await Lt.executePreRequest(Ze);if(!gt.success)throw new Error(gt.error||"Script execution failed");let qe=gt.localVariables??gt.modifiedVariables;qe&&typeof qe=="object"&&(R.vars={...qe})}}catch(gt){let qe=gt instanceof Error?gt.message:String(gt);throw new Error(`Suite ${ge}-script failed on node "${P(re)}": ${qe}`)}finally{Lt.dispose?.()}}function F(te){let re=te?.type==="request"&&te?.request?te.request:te;if(!(!re||typeof re!="object")&&!(!re.collectionId||!re.requestId||!re.name))return{collectionId:re.collectionId,requestId:re.requestId,name:re.name,folderPath:re.folderPath,enabled:re.enabled}}function U(te){return!te||typeof te!="object"?!1:te.type==="request"?!!F(te):!!(te.collectionId&&te.requestId&&te.name)}function D(te,re){for(let Te of re){let ge=te?.[Te];if(Array.isArray(ge))return ge}return[]}async function J(te,re,Te){if(lt.signal.aborted||re.enabled===!1||d&&!d.some(Lt=>re.name.toLowerCase().includes(Lt.toLowerCase())))return;let ge=t.collection.getCollection(re.collectionId);if(!ge)return;let we=VC(ge,re.requestId);if(!we)return;let Ze=jN(we.request.auth,we.folderAuthChain,ge.auth),Ct=new As(t.httpRequest,t.scriptExecutor,t.environmentConfig,t.requestPreparer,i,$r,ge.scripts,we.folderScriptsChain,void 0,ge.name,ge.auth,te,s),or=DN(FN({...we.request,auth:Ze}),{headers:r.headers,query:r.query,body:r.body,variables:{...R.vars,...r.variables}}),oe=await Ct.execute(or,Rv(R.vars),lt.signal);R.lastResult=oe,oe.modifiedVariables&&typeof oe.modifiedVariables=="object"&&(R.vars={...oe.modifiedVariables});let fr=Np({collectionName:ge.name,folderPath:re.folderPath??"",blockLabel:Te});oe.folderPath=re.folderPath??"",oe.collectionName=ge.name,oe.groupPath=fr.groupPath,oe.groupType=fr.groupType,await ye.saveResult(te,oe),oe.assertions?.length||Tr.add(re.name),oe.passed?he++:Yt++,p.includes("perRequest")&&mt.push({name:re.name,iteration:te,status:oe.response?.status,ok:(oe.response?.status??0)>=200&&(oe.response?.status??0)<300,duration:`${oe.duration}ms`,allPassed:oe.passed,...p.includes("consoleOutput")&&oe.consoleOutput?.length?{consoleOutput:oe.consoleOutput}:{}}),oe.passed||(Nt.push({name:re.name,iteration:te,method:oe.executedRequest?.method,url:oe.executedRequest?.url,requestBody:HC(oe.executedRequest?.body?.content)??oe.executedRequest?.body?.content??null,requestHeaders:gi(oe.executedRequest?.headers??{}),status:oe.response?.status,duration:`${oe.duration}ms`,body:HC(oe.response?.body),headers:NN(oe.response?.headers),cookies:MN(oe.response?.cookies),failedTests:oe.assertions?.filter(Lt=>!Lt.passed).map(Lt=>({name:Lt.name,...Lt.message?{message:Lt.message}:{}})),...oe.error?{error:oe.error}:{},...p.includes("consoleOutput")&&oe.consoleOutput?.length?{consoleOutput:oe.consoleOutput}:{}}),o&<.abort()),l>0&&!lt.signal.aborted&&await new Promise(Lt=>setTimeout(Lt,l))}async function Q(te,re,Te){for(let ge of re){if(lt.signal.aborted)break;await se(te,ge,Te)}}async function se(te,re,Te){if(!re||typeof re!="object"||re.enabled===!1||!j(re.condition,re,te))return;if(U(re)){let Ze=F(re);Ze&&await J(te,Ze,Te);return}let ge=typeof re.type=="string"?re.type.toLowerCase():"",we=D(re,["then","nodes","body"]);if(ge==="block"){let Ze=typeof re.name=="string"?re.name.trim():"";await Q(te,we,Ze||Te);return}if(ge==="script"){let Ze=k(re),Ct=re.phase==="post"?"post":"pre";await A(Ze,re,te,Ct);return}if(ge==="if"){let Ze=typeof re.if=="string"?re.if:re.condition;if(j(Ze,re,te)){await Q(te,we,Te);return}if(Array.isArray(re.elseif)){for(let Ct of re.elseif)if(j(Ct?.condition,Ct,te)){await Q(te,D(Ct,["then","nodes","body"]),Te);return}}await Q(te,D(re,["else","elseNodes"]),Te);return}if(ge==="switch"){let Ze=ui(String(re.expression??""),M(re,te));if(Array.isArray(re.cases)){for(let Ct of re.cases)if(Object.prototype.hasOwnProperty.call(Ct??{},"equals")?Ct.equals===Ze:j(Ct?.condition,Ct,te)){await Q(te,D(Ct,["then","nodes","body"]),Te);return}}await Q(te,D(re,["default","defaultNodes"]),Te);return}if(ge==="while"){let Ze=typeof re.while=="string"?re.while:re.condition,Ct=Math.max(1,Math.min(1e4,Number(re.maxIterations??v))),or=0;for(;j(Ze,re,te);){if(or+=1,or>Ct)throw new Error(`Suite while loop exceeded maxIterations (${Ct}) on node "${P(re)}"`);if(await Q(te,we,Te),lt.signal.aborted)break}return}if(ge==="for"){let Ze=Math.max(1,Math.min(1e4,Number(re.maxIterations??v))),Ct=E(re.init),or=E(re.update),oe=typeof re.loopCondition=="string"&&re.loopCondition.trim()?re.loopCondition:typeof re.condition=="string"&&re.condition.trim()?re.condition:"true";Ct&&await A(Ct,re,te,"pre");let fr=0;for(;j(oe,re,te);){if(fr+=1,fr>Ze)throw new Error(`Suite for loop exceeded maxIterations (${Ze}) on node "${P(re)}"`);if(await Q(te,we,Te),lt.signal.aborted)break;or&&await A(or,re,te,"post")}return}we.length>0&&await Q(te,we,Te)}function fe(te){let re=0,Te=[...te];for(;Te.length>0;){let ge=Te.pop();if(!(!ge||typeof ge!="object"||ge.enabled===!1)){if(U(ge)){let we=F(ge);we&&(!d||d.some(Ze=>we.name.toLowerCase().includes(Ze.toLowerCase())))&&(re+=1);continue}for(let we of["nodes","then","body","else","elseNodes","default","defaultNodes"])Array.isArray(ge[we])&&Te.push(...ge[we]);if(Array.isArray(ge.elseif))for(let we of ge.elseif)Array.isArray(we?.nodes)&&Te.push(...we.nodes),Array.isArray(we?.then)&&Te.push(...we.then);if(Array.isArray(ge.cases))for(let we of ge.cases)Array.isArray(we?.nodes)&&Te.push(...we.nodes),Array.isArray(we?.then)&&Te.push(...we.then)}}return re}let Be=Array.isArray(e.nodes)?e.nodes:Array.isArray(e.requests)?e.requests.map(te=>({type:"request",request:te})):[],Re=fe(Be);if(q){let te=B5(),re=Re*s;if(re>te)throw new Error(`Suite "${e.name}" would execute ${re} request calls (${Re} requests \xD7 ${s} iterations), which exceeds HTTP_FORGE_MAX_REQUESTS (${te}). Reduce iterations, use requestFilter, or increase HTTP_FORGE_MAX_REQUESTS.`)}let ye=new xl(t.config),ke=await ye.initializeRun(e.id,e.name,i,{iterations:s,delayBetweenRequests:l,stopOnError:o}),mt=[],Nt=[],he=0,Yt=0,Tr=new Set,lt=new AbortController,$r=new bl;async function wr(te){await Q(te,Be)}for(let te=1;te<=s&&!lt.signal.aborted;te+=c){let re=Math.min(te+c-1,s),Te=Array.from({length:re-te+1},(ge,we)=>te+we);await Promise.all(Te.map(wr))}let xt=await ye.finalizeRun("completed",x),St=null;if(y)try{St=await new wl(ye.getBasePath()).generate(e.id,ke)}catch(te){console.warn("[direct-execution] JUnit report generation failed:",te)}let Gr=n==="collection"?"collection":"suite",At=ye.getCurrentStats()?.stats,Ai=At?{min:At.minDuration,max:At.maxDuration,avg:At.avgDuration,p50:At.p50??null,p95:At.p95??null,p99:At.p99??null}:null,On={[Gr]:e.name,environment:i,summary:{total:he+Yt,passed:he,failed:Yt,...s>1?{iterations:s}:{},...c>1?{concurrency:c}:{},allPassed:Yt===0,...Ai?{durationMs:Ai}:{}}};if((Yt>0||p.includes("failedOnly"))&&(On.failedRequests=Nt),p.includes("perRequest")&&(On.results=mt),xt!==null&&(On.report={uri:`file://${xt}`,hint:"Click the URI to open the HTML report in your browser"}),St!==null&&(On.junitReport={path:St}),Tr.size>0){let te=Math.max(Re,1),re=Tr.size,Te=Array.from(Tr).slice(0,5);On.noAssertionExamples=Te;let ge=e.name;if(re/te>.5)On._suggestions=[`${re}/${te} requests have no pm.test() assertions. Invoke the "review-collection" prompt (collection="${ge}") for a full coverage analysis and to identify assertion gaps.`];else{let we=Te.map(Ze=>`"${Ze}"`).join(", ");On._suggestions=[`${re} request(s) have no pm.test() assertions: ${we}. Invoke the "suggest-assertions" prompt (collection="${ge}") to generate test coverage for them.`]}}return On}async function xv(t){let e=In(t.workspaceFolder),r=t.include??[],n=t.reporters??[],i=n.includes("junit"),s=$N(r,n);try{let o=e.collection,l=UN(o,t),c=HN(l,t),d=t.requestId;if(!d){if(!t.requestRef)throw new Error("A request reference is required (requestId or requestRef)");let M=_v(l,t.requestRef,c);d=M.request.id,t.onResolve?.({kind:"request",value:t.requestRef,tier:M.tier,id:d,path:M.folderPath?`${M.folderPath}/${M.request.name}`:M.request.name})}let p=VC(l,d);if(!p)throw new Error(`Request "${d}" not found in collection "${l.name}"`);let m=jN(p.request.auth,p.folderAuthChain,l.auth),y=t.environment||e.environmentConfig.getSelectedEnvironment(),b=DN(FN({...p.request,auth:m}),{headers:t.headers,query:t.query,body:t.body,variables:t.variables}),x=await new As(e.httpRequest,e.scriptExecutor,e.environmentConfig,e.requestPreparer,y,new bl,l.scripts,p.folderScriptsChain,void 0,l.name,l.auth).execute(b,Rv(t.variables)),v=Np({collectionName:l.name,folderPath:p.folderPath});x.folderPath=p.folderPath,x.collectionName=l.name,x.groupPath=v.groupPath,x.groupType=v.groupType;let R=null,E=null;if(s||i){let M=new xl(e.config),j=`request-${AN(l.id)}-${AN(d)}`,I=`Request: ${p.request.name}`,_=await M.initializeRun(j,I,y,{iterations:1,delayBetweenRequests:0,stopOnError:!0});if(await M.saveResult(1,x),R=await M.finalizeRun("completed",s),i)try{E=await new wl(M.getBasePath()).generate(j,_)}catch(A){console.warn("[direct-execution] JUnit report generation failed:",A)}}let k=NN(x.response?.headers),P=MN(x.response?.cookies);return{request:p.request.name,status:x.response?.status||0,ok:(x.response?.status??0)>=200&&(x.response?.status??0)<300,duration:`${x.duration}ms`,body:HC(x.response?.body),allPassed:x.passed,assertions:x.assertions?.map(M=>({name:M.name,passed:M.passed,message:M.message})),...r.includes("headers")?{headers:k}:{},...r.includes("cookies")?{cookies:P}:{},...r.includes("tests")?{tests:x.assertions?.map(M=>({name:M.name,passed:M.passed,...M.message?{message:M.message}:{}}))}:{},...Object.keys(x.modifiedVariables??{}).length?{modifiedVariables:x.modifiedVariables}:{},...r.includes("consoleOutput")&&x.consoleOutput?.length?{consoleOutput:x.consoleOutput}:{},...R!==null?{report:{uri:`file://${R}`,hint:"Click the URI to open the HTML report in your browser"}}:{},...E!==null?{junitReport:{path:E}}:{},...x.error?{error:x.error}:{}}}catch(o){throw o}finally{BC(e)}}async function Vs(t){let e=In(t.workspaceFolder);try{let r=e.collection,n=UN(r,t),i=HN(n,t),s=LN(n),o=W5(s,i,t.recursive);if(o.length===0&&i)throw new Error(`No requests found under folder "${i}" in collection "${n.name}"`);let l=o.map(({request:d,folderPath:p})=>({id:d.id,slug:d.id.toLowerCase().replace(/\s+/g,"-"),collectionId:n.id,requestId:d.id,name:d.name,method:d.method,collectionName:n.name,folderPath:p,enabled:!0})),c={id:i?`temp-${n.id}-${z5(i)}`:`temp-${n.id}`,name:i?`${n.name} / ${i}`:n.name,requests:l,config:{iterations:1,delay:0,stopOnError:t.stopOnError??!1,readFromSharedSession:!1,writeToSharedSession:!1},isTemporary:!0,createdAt:Date.now(),updatedAt:Date.now()};return BN(e,c,{environment:t.environment,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,requestFilter:void 0,include:t.include,reporters:t.reporters,concurrency:t.concurrency,variables:t.variables},"collection")}catch(r){throw r}finally{BC(e)}}async function J5(t){return Vs({recursive:!0,...t})}async function Dp(t){let e=In(t.workspaceFolder);try{let n=await e.testSuite.getSuite(t.suiteId);if(!n)throw new Error(`Test suite "${t.suiteId}" not found`);return BN(e,n,{environment:t.environment,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,requestFilter:t.requestFilter,include:t.include,reporters:t.reporters,concurrency:t.concurrency,variables:t.variables},"suite")}catch(r){throw r}finally{BC(e)}}var Uc=le(()=>{"use strict";kC();og();_d();TC();FC();Pf();DC();Ii();bv();UC();PC()});var GN={};Rs(GN,{createMcpRuntime:()=>a7});async function Pi(t){let e=process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS,r=process.env.HTTP_FORGE_GENERATE_REPORTS;process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS="true",process.env.HTTP_FORGE_GENERATE_REPORTS="true";try{return await t()}finally{e===void 0?delete process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS:process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS=e,r===void 0?delete process.env.HTTP_FORGE_GENERATE_REPORTS:process.env.HTTP_FORGE_GENERATE_REPORTS=r}}function Hc(t){let e=[t.testSuite,t.collection,t.environmentConfig,t.config,t.console];for(let r of e)try{r?.dispose?.()}catch{}}async function K5(t,e){let r=JC.get(t);if(r&&r.expiresAt>Date.now())return r.tools;let n=WC.get(t);if(n)return n;let i=(async()=>{let s=e.config.getMcpConfig(),o=(d,p)=>!!d?.length&&(d.includes(p.id)||d.includes(p.name)),l=e.collection.getAllCollections().filter(d=>!o(s.excludedCollections,d)),c=(await e.testSuite.getAllSuites()).filter(d=>!o(s.excludedSuites,d));return dv(l,c,s)})().then(s=>(JC.set(t,{tools:s,expiresAt:Date.now()+Y5}),s)).finally(()=>WC.delete(t));return WC.set(t,i),i}function Q5(t,e){let r=t.config.getMcpConfig().toolPrefix??"";return r&&e.startsWith(r)?e.slice(r.length):e}function Z5(t,e,r){return t.replace(/"uri"\s*:\s*"file:\/\/([^"]+)"/g,(n,i)=>`"uri":"http://${e}:${r}/report?path=${encodeURIComponent(i)}"`)}function VN(t,e,r,n){ql(t,200,{jsonrpc:"2.0",id:e,error:{code:r,message:n}})}function X5(t){return t.config.getMcpConfig().toolPageSize??200}async function e7(t,e){switch(e.method){case"initialize":return{protocolVersion:"2024-11-05",capabilities:{tools:{},prompts:{}},serverInfo:{name:"http-forge",version:"1.0.0"},instructions:"You are assisting with HTTP API testing via HTTP Forge. When a run_suite, run_collection, or run_folder call completes with failures (summary.failed > 0 or allPassed === false), automatically analyze the 'failedRequests' in the response and provide: (1) root cause for each failure, (2) specific fix recommendations, (3) updated pm.test() assertion scripts where relevant. Do not wait for the user to ask \u2014 proactively diagnose and suggest fixes. For async runs (status: 'running'), poll with get_run_status until complete, then call get_run_summary. When get_run_summary returns a _nextStep field you MUST execute it immediately \u2014 the failedRequests array is already included inline so no extra tool call is needed. Analyze the failures and provide diagnosis without waiting for the user."};case"tools/list":{let r=await K5(t.workspaceFolder,t.container),n=e.params??{},i=typeof n.cursor=="string"?n.cursor:void 0,s=X5(t.container);if(s<=0||r.length<=s)return{tools:r};let o=fv(i),l=r.slice(o,o+s),c=o+s,d={tools:l};return c<r.length&&(d.nextCursor=cv(c)),d}case"tools/call":{let r=e.params??{},n=r.name,i=r.arguments;if(!n)throw new Error("Missing tool name");let s=await GC(t,n,i??{}),o=s,l=o?.summary;l&&((l.failed??0)>0||l.allPassed===!1)&&(o._nextStep=`${l.failed??"Some"} request(s) failed. Please analyze the 'failedRequests' above: identify the root cause of each failure, suggest specific fixes (URL, auth, body, environment variables), and provide updated pm.test() assertion scripts where the assertions are incorrect.`);let c=JSON.stringify(s,null,2),d=Z5(c,t.host,t.port),p=d.match(/"uri"\s*:\s*"(http:\/\/[^"]+\/report\?[^"]+)"/),m=p?`
|
|
1020
1020
|
|
|
1021
|
-
[View HTML Report](${p[1]})`:"";return{content:[{type:"text",text:d+m}]}}case"prompts/list":return{prompts:$p};case"prompts/get":{let r=e.params??{},n=r.name,i=r.arguments??{};if(!n)throw new Error("Missing prompt name");let s=In(t.workspaceFolder);try{return await Ky(n,i,s.collection,t.runStore)}finally{Hc(s)}}default:throw new Error(`Method not found: ${e.method}`)}}function t7(t,e,r){let n=!t.container,i=t.container??In(t.workspaceFolder),s;try{s=i.config.getMcpConfig().cors.allowedOrigins??["http://localhost","http://127.0.0.1"]}finally{n&&Hc(i)}let o=e.headers.origin??"",l=s.includes(o)?o:s[0]??"http://localhost";r.setHeader("Access-Control-Allow-Origin",l),r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS"),r.setHeader("Access-Control-Allow-Headers","Content-Type, Mcp-Session-Id")}function r7(t,e,r){let i=new URL(e.url,`http://${t.host}:${t.port}`).searchParams.get("path");if(!i){r.statusCode=400,r.end("Missing path parameter");return}let s=Xo.resolve(i),o=t.container?.config.getResultsPath(),l=o?Xo.dirname(o):Xo.resolve(t.workspaceFolder,".http-forge",".cache");if(!s.startsWith(l+Xo.sep)||!s.endsWith(".html")){r.statusCode=403,r.end("Forbidden");return}zN.readFile(s,"utf-8",(c,d)=>{if(c){r.statusCode=404,r.end("Report not found");return}r.statusCode=200,r.setHeader("content-type","text/html; charset=utf-8"),r.end(d)})}function zC(t,e,r,n){let i=t.create(e,r);return n().then(s=>{i.status!=="cancelled"&&(i.status="completed",i.completedAt=Date.now(),i.summary=s?.summary??i.summary,s?.failedRequests&&(i.failedRequests=s.failedRequests),s?.noAssertionExamples&&(i.noAssertionExamples=s.noAssertionExamples),i.reportPath=s?.report?.uri?.replace("file://","")??null,i.progress.completed=i.progress.total)}).catch(s=>{i.status!=="cancelled"&&(i.status="failed",i.completedAt=Date.now(),i.error=s.message)}),{runId:i.id,status:"running",total:r,message:"Run started. Use get_run_status to poll."}}function n7(t){let e=t.workspaceFolder;return{async runRequest(r,n,i){return Pi(()=>xv({workspaceFolder:e,collectionId:r.id,requestId:n,environment:i.environment,variables:i.variables,headers:i.headers,query:i.query,body:i.body,include:i.include}))},async runFolder(r,n,i){let s=rt(r).filter(({folderPath:o})=>o===n||o.startsWith(`${n}/`)).length;return i.async===!0?zC(t.runStore,`${r.name} / ${rs(n)}`,s,()=>Pi(()=>Vs({workspaceFolder:e,collectionId:r.id,folderPath:n,recursive:i.recursive,environment:i.environment,variables:i.variables,iterations:i.iterations,stopOnError:i.stopOnError,delay:i.delay,include:i.include}))):Pi(()=>Vs({workspaceFolder:e,collectionId:r.id,folderPath:n,recursive:i.recursive,environment:i.environment,variables:i.variables,iterations:i.iterations,stopOnError:i.stopOnError,delay:i.delay,include:i.include}))},async runCollection(r,n){let i=rt(r).length;return n.async===!0?zC(t.runStore,r.name,i,()=>Pi(()=>Vs({workspaceFolder:e,collectionId:r.id,environment:n.environment,variables:n.variables,iterations:n.iterations,stopOnError:n.stopOnError,delay:n.delay,include:n.include}))):Pi(()=>Vs({workspaceFolder:e,collectionId:r.id,environment:n.environment,variables:n.variables,iterations:n.iterations,stopOnError:n.stopOnError,delay:n.delay,include:n.include}))},async runSuite(r,n,i){let s=In(e),o=0;try{let l=await s.testSuite.getSuite(r);o=(l?.nodes.filter(d=>d.type==="request").length??0)*(i.iterations??l?.config?.iterations??1)}finally{Hc(s)}return i.async===!0?zC(t.runStore,n,o,()=>Pi(()=>Dp({workspaceFolder:e,suiteId:r,environment:i.environment,variables:i.variables,iterations:i.iterations,stopOnError:i.stopOnError,delay:i.delay,requestFilter:i.requestFilter,include:i.include}))):Pi(()=>Dp({workspaceFolder:e,suiteId:r,environment:i.environment,variables:i.variables,iterations:i.iterations,stopOnError:i.stopOnError,delay:i.delay,requestFilter:i.requestFilter,include:i.include}))}}}async function GC(t,e,r={}){let n=t.workspaceFolder,i=Q5(t.container,e);if(Object.values(G).includes(i)){let l=In(n);try{let c=await Yy(i,r,{collection:l.collection,testSuite:l.testSuite,environmentConfig:l.environmentConfig,workspaceFolder:n},t.runStore,n7(t));return i7.has(i)&&JC.delete(n),c}finally{Hc(l)}}let s=rv(i),o=In(n);try{let l=o.collection.getAllCollections(),c=l.map(b=>b.id),d=b=>{let q=vl(b,c),x=q?l.find(v=>v.id===q):void 0;if(!x)throw new Error(`Collection not found for tool: ${e}`);return x};if(s.kind==="request"){let[b,q]=s.tokens;if(!b||!q)throw new Error(`Malformed request tool: ${e}`);let x=d(b),v=rt(x).map(E=>E.request.id),_=vl(q,v);if(!_)throw new Error(`Request not found in collection "${x.name}" for tool: ${e}`);return Pi(()=>xv({workspaceFolder:n,collectionId:x.id,requestId:_,environment:r.environment,variables:r.variables,headers:r.headers,query:r.query,body:r.body,include:r.include}))}if(s.kind==="collection"){let[b]=s.tokens;if(!b)throw new Error(`Malformed collection tool: ${e}`);let q=d(b);return Pi(()=>Vs({workspaceFolder:n,collectionId:q.id,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include}))}if(s.kind==="folder"){let[b,q]=s.tokens;if(!b||!q)throw new Error(`Malformed folder tool: ${e}`);let x=d(b),v=(o.collection.getAllCollections().find(k=>k.id===x.id),void 0),_=rt(x).map(k=>k.folderPath).filter((k,P,M)=>k&&M.indexOf(k)===P),E=nv(q,_);if(!E)throw new Error(`Folder not found in collection "${x.name}" for tool: ${e}`);return Pi(()=>Vs({workspaceFolder:n,collectionId:x.id,folderPath:E,recursive:r.recursive,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include}))}let[p]=s.tokens;if(!p)throw new Error(`Malformed suite tool: ${e}`);let m=await o.testSuite.getAllSuites(),y=vl(p,m.map(b=>b.id));if(!y)throw new Error(`Test suite not found for tool: ${e}`);return Pi(()=>Dp({workspaceFolder:n,suiteId:y,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,requestFilter:r.requestFilter,include:r.include}))}finally{Hc(o)}}function ql(t,e,r){t.statusCode=e,t.setHeader("content-type","application/json; charset=utf-8"),t.end(JSON.stringify(r))}function WN(t){return new Promise((e,r)=>{let n="";t.on("data",i=>{n+=i,n.length>1024*1024&&r(new Error("Request body too large (max 1MB)"))}),t.on("end",()=>{if(!n){e({});return}try{e(JSON.parse(n))}catch{r(new Error("Invalid JSON body"))}}),t.on("error",r)})}function s7(t){return(0,JN.createServer)(async(e,r)=>{try{if(t7(t,e,r),e.method==="OPTIONS"){r.statusCode=204,r.end();return}if(e.method==="GET"&&e.url==="/health"){ql(r,200,{status:"ok",port:t.port});return}if(e.method==="GET"&&e.url?.startsWith("/report?")){r7(t,e,r);return}if(e.method==="POST"&&(e.url==="/"||e.url==="/mcp")){let n;try{n=await WN(e)}catch{VN(r,null,-32700,"Parse error");return}try{let i=await e7(t,n);ql(r,200,{jsonrpc:"2.0",id:n.id??null,result:i})}catch(i){VN(r,n.id??null,-32603,i.message||"Internal error")}return}if(e.method==="POST"&&e.url==="/tools/execute"){let n=await WN(e);if(!n||typeof n.name!="string"||n.name.trim()===""){ql(r,400,{error:'Field "name" is required'});return}let i=await GC(t,n.name,n.args??{});ql(r,200,{result:i});return}ql(r,405,{error:"Method not allowed"})}catch(n){ql(r,500,{error:n.message})}})}function o7(t){if(typeof t.port=="number"&&Number.isFinite(t.port))return Math.min(65535,Math.max(1,Math.floor(t.port)));let r=new ks(Xo.resolve(t.workspaceFolder)).getMcpConfig().port;return Math.min(65535,Math.max(1,Math.floor(r||3100)))}async function a7(t){let e=o7(t),r=t.host||"127.0.0.1",n=`${r}:${e}`,i={workspaceFolder:t.workspaceFolder,port:e,host:r,isRunning:!1,runStore:new $c};return G5.set(n,i),{async start(){if(i.isRunning)return;i.container||(i.container=In(i.workspaceFolder));let s=s7(i);await new Promise((o,l)=>{s.once("error",l),s.listen(i.port,i.host,()=>{s.off("error",l),o()})}),i.server=s,i.isRunning=!0},async stop(){if(i.container&&(Hc(i.container),i.container=void 0),!i.server){i.isRunning=!1;return}await new Promise((s,o)=>{i.server.close(l=>{if(l){o(l);return}s()})}),i.server=void 0,i.isRunning=!1},isRunning(){return i.isRunning},getPort(){return i.port},async executeTool(s,o){return GC(i,s,o??{})}}}var zN,JN,Xo,G5,Y5,JC,WC,i7,YN=le(()=>{"use strict";zN=ve(require("fs")),JN=require("http"),Xo=ve(require("path"));sg();Uc();Ii();EC();qC();IC();OC();lv();kp();bv();G5=new Map;Y5=3e3,JC=new Map,WC=new Map;i7=Gy});var k7={};Rs(k7,{AmbiguousRefError:()=>Zo,AwsSecretResolver:()=>gp,AzureKeyVaultResolver:()=>yp,BODY_FILE_MAP:()=>VS,CACHE_BUSTING_TOOLS:()=>Gy,COLLECTION_INPUT_SCHEMA:()=>Ip,CONFIG_FILES:()=>ko,CollectionLoader:()=>Oa,CollectionLoaderFactory:()=>Xu,CollectionRequestExecutor:()=>As,CollectionService:()=>ec,ConfigService:()=>ks,CookieJar:()=>Su,CookieService:()=>tc,CookieUtils:()=>_t,DEFAULT_CONFIG:()=>rr,DEFAULT_REQUEST_SETTINGS:()=>ln,DEFAULT_SUITE_CONFIG:()=>Go,DYNAMIC_VARIABLES:()=>tw,DataFileParser:()=>Oo,DopplerResolver:()=>wp,EnvironmentConfigService:()=>nc,EnvironmentResolver:()=>Bi,ExampleGenerator:()=>al,FOLDER_INPUT_SCHEMA:()=>Op,FetchHttpClient:()=>Ju,FolderCollectionLoader:()=>vu,FolderCollectionStore:()=>xs,ForgeContainer:()=>ng,ForgeEnv:()=>Cs,GENERIC_TOOL_NAMES:()=>G,GcpSecretResolver:()=>Sp,GraphQLSchemaService:()=>sc,HTTP_METHOD_MAP:()=>pv,HTTP_METHOD_REVERSE:()=>Bs,HashiCorpVaultResolver:()=>vp,HistoryAnalyzer:()=>Xa,HtmlReportGenerator:()=>jc,HttpForgeParser:()=>Io,HttpRequestService:()=>Wi,InMemoryCookieJar:()=>bl,InterceptorChain:()=>zi,JUnitReportGenerator:()=>wl,JsonCollectionLoader:()=>Qa,LoggingRequestInterceptor:()=>cm,MCP_PROMPTS:()=>$p,METADATA_FILES:()=>Cr,McpRunStore:()=>$c,ModuleLoader:()=>cd,NodeFileSystem:()=>Gu,NodeHttpClient:()=>Eo,OAuth2TokenManager:()=>Qu,OnePasswordResolver:()=>bp,OpenApiExporter:()=>ol,OpenApiImporter:()=>Hs,ParserRegistry:()=>bu,PersistentCookieJar:()=>rc,REQUEST_INPUT_SCHEMA:()=>qp,ROOT_DIRECTORIES:()=>Ps,RefResolver:()=>ml,RequestExecutor:()=>Ga,RequestHistoryService:()=>oc,RequestHistoryStore:()=>zu,RequestPreparer:()=>ic,RequestPreprocessor:()=>qo,RequestScriptSession:()=>Wu,ResultStorageService:()=>xl,RetryErrorInterceptor:()=>dm,SCHEMA_FILES:()=>yu,SCRIPTS_DIR:()=>rn,SCRIPT_FILES:()=>Ef,SUITE_INPUT_SCHEMA:()=>Pp,SchemaInferenceService:()=>gl,SchemaInferrer:()=>Ns,ScriptAnalyzer:()=>yl,ScriptExecutor:()=>Ki,SecretResolverRegistry:()=>Ac,ServiceContainer:()=>Yo,ServiceIdentifiers:()=>ae,StatisticsService:()=>qv,TestSuiteService:()=>Tc,TestSuiteStore:()=>Iv,TimingResponseInterceptor:()=>fm,UrlBuilder:()=>Hn,VariableInterpolator:()=>vo,VariableResolver:()=>yo,applyEnvSuggestionsToItems:()=>zy,applyExtractionPlan:()=>$P,applyFilterChain:()=>Cu,augmentWithDynamicVars:()=>mo,bootstrapNodeRuntime:()=>LC,buildCollectionToolDescription:()=>sv,buildCollectionToolName:()=>Xy,buildExtractionPlan:()=>TP,buildFolderToolDescription:()=>ov,buildFolderToolName:()=>ev,buildGenericTools:()=>Jy,buildMcpToolList:()=>dv,buildPromptResult:()=>Ky,buildRequestToolDescription:()=>iv,buildRequestToolName:()=>Zy,buildResultFileName:()=>Sl,buildSuiteToolDescription:()=>av,buildSuiteToolName:()=>tv,cleanupOldBodyFiles:()=>JS,concatenateScripts:()=>pd,countRequests:()=>Vy,createExpectChain:()=>za,createLodashShim:()=>H0,createMcpRuntime:()=>KN,createModuleLoader:()=>Jm,createMomentShim:()=>fd,createNodeContainer:()=>In,createResponseObject:()=>dd,createScriptConsole:()=>SP,createTestFunction:()=>Km,createVariableResolver:()=>Tq,decodeCursor:()=>fv,decodeFolderName:()=>vC,decodeFolderPath:()=>rs,dedupeToolsByName:()=>uv,deepClone:()=>bq,deleteItemFromTree:()=>em,deserializeTypedRecord:()=>mv,deserializeTypedValue:()=>Cl,detectEnvSuggestions:()=>Ep,detectSensitiveData:()=>AP,dispatchGenericTool:()=>Yy,encodeCursor:()=>cv,encodeFolderName:()=>hr,enhanceCollection:()=>sM,enumerateFolders:()=>zr,evaluateExpression:()=>ui,expandSummary:()=>CN,exportCollectionToRestClient:()=>qP,findItemById:()=>Xh,flattenRequests:()=>rt,formatBytes:()=>_q,formatConsoleOutput:()=>Ja,formatDuration:()=>Rq,generateId:()=>It,generateSlug:()=>Rn,generateUUID:()=>Zh,getCompletions:()=>fM,getRestClientExportFolder:()=>EP,getServiceContainer:()=>_C,hasChanged:()=>Vu,isExpression:()=>go,isPlainObject:()=>Sq,isSystemEnvironmentFile:()=>Of,loadEnvironmentsFromFolder:()=>wu,mcpToolSegment:()=>Qo,mcpToolToken:()=>ss,mergeHeadersCaseInsensitive:()=>gu,mergeRequestSettings:()=>tM,normalizeFolderInput:()=>_p,normalizeHeaders:()=>Qm,parseCurlCommand:()=>iM,parseFilterChain:()=>xu,parseMcpToolName:()=>rv,parsePostmanEnvironment:()=>vd,parsePostmanEnvironmentFile:()=>PP,parseQueryContext:()=>cM,prepareBodyForSave:()=>zS,readBodyFromDir:()=>WS,readSchemaFile:()=>GS,readScriptsFromDir:()=>qf,redactBody:()=>ug,redactFullResponse:()=>fg,redactFullResultDetails:()=>dg,redactHeaders:()=>gi,redactHistoryEntry:()=>cg,redactUrl:()=>wd,registerCoreServices:()=>Rp,resolveCollectionRef:()=>Sv,resolveDynamicVariable:()=>Vi,resolveDynamicVariablesInString:()=>kq,resolveFolderRef:()=>wv,resolveFolderToken:()=>nv,resolveRequestRef:()=>_v,resolveResultGrouping:()=>Np,resolveToken:()=>vl,runCollection:()=>ZN,runFolder:()=>XN,runRequest:()=>QN,runSuite:()=>eM,safeJsonParse:()=>wq,sanitizeName:()=>Bt,scanCollectionForEnvVarsWithAi:()=>aM,searchForItemPath:()=>tm,searchForItemPathById:()=>rm,serializeTypedValue:()=>Lc,sortItemsByOrder:()=>KS,writeEnvFile:()=>Ka,writeFolderItems:()=>yd,writeSchemaFiles:()=>YS,writeScriptFile:()=>Zu,writeScriptsToDir:()=>If});module.exports=Ia(k7);var Oa=class{constructor(e,r){this.fileSystem=e;this.parserRegistry=r}fileSystem;parserRegistry;directory;setDirectory(e){this.directory=e}async loadAll(){return this.directory?this.loadDirectory(this.directory):[]}async load(e,r={}){let n=await this.fileSystem.readFile(e);if(r.format){let s=this.parserRegistry.get(r.format);if(!s)throw new Error(`No parser registered for format: ${r.format}`);return s.parse(n,e)}let i=this.parserRegistry.detect(n);if(!i)throw new Error(`Could not detect collection format for: ${e}. Supported formats: ${this.parserRegistry.getFormats().join(", ")}`);return i.parser.parse(n,e)}async loadDirectory(e,r=["*.json","*.forge.json"]){let n=[],i=await this.fileSystem.glob(r,e);for(let s of i)try{let o=await this.load(s);n.push(o)}catch{}return n}async canLoad(e){try{if(!await this.fileSystem.exists(e))return!1;let r=await this.fileSystem.readFile(e);return this.parserRegistry.detect(r)!==null}catch{return!1}}getSupportedFormats(){return this.parserRegistry.getFormats()}};nm();Pa();function QS(t,e){return{id:t.id,name:t.name,description:t.description,variables:t.variables||{},auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(xq),source:{format:"folder",filePath:e,version:t.version}}}function xq(t){if(t.type==="folder")return{type:"folder",id:t.id,name:t.name,description:t.description,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(xq)};let e=t;return{type:"request",id:e.id,name:e.name,description:e.description,method:e.method||"GET",url:e.url||"",headers:e.headers||[],query:e.query||[],params:e.params,body:e.body??void 0,auth:e.auth,settings:e.settings,scripts:e.scripts,...e.deprecated&&{deprecated:e.deprecated},...e.doc&&{doc:e.doc},...e.responseSchema&&{responseSchema:e.responseSchema},...e.bodySchema&&{bodySchema:e.bodySchema},...e.operationId&&{operationId:e.operationId},...e.summary&&{summary:e.summary},...e.tags&&e.tags.length>0&&{tags:e.tags},...e.examples&&e.examples.length>0&&{examples:e.examples},...e.responses&&Object.keys(e.responses).length>0&&{responses:e.responses},...e.security&&e.security.length>0&&{security:e.security}}}function g2(t){return{id:t.id,name:t.name,description:t.description,version:t.source?.version,variables:t.variables,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(ZS)}}function ZS(t){return t.type==="folder"?{type:"folder",id:t.id,name:t.name,description:t.description,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(ZS)}:{type:"request",id:t.id,name:t.name,description:t.description,method:t.method,url:t.url,headers:t.headers,query:t.query,params:t.params,body:t.body,auth:t.auth,settings:t.settings,scripts:t.scripts,...t.deprecated&&{deprecated:t.deprecated},...t.doc&&{doc:t.doc},...t.responseSchema&&{responseSchema:t.responseSchema},...t.bodySchema&&{bodySchema:t.bodySchema},...t.operationId&&{operationId:t.operationId},...t.summary&&{summary:t.summary},...t.tags&&{tags:t.tags},...t.examples&&{examples:t.examples},...t.responses&&{responses:t.responses},...t.security&&{security:t.security}}}var vu=class{store;constructor(e){this.store=new xs(e)}loadAll(){return this.store.loadAll().map(r=>QS(r,this.store.getCollectionPath(r.id)))}getSlugById(e){return this.store.getSlugById(e)}getIdBySlug(e){return this.store.getIdBySlug(e)}load(e){let r=this.store.load(e);if(r)return QS(r,this.store.getCollectionPath(r.id))}async create(e,r){let n=await this.store.create(e,r);return QS(n,this.store.getCollectionPath(n.id))}async save(e){return this.store.save(g2(e))}async delete(e){return this.store.delete(e)}exists(e){return this.store.exists(e)}getCollectionPath(e){return this.store.getCollectionPath(e)}async updateCollectionMetadata(e,r){return this.store.updateCollectionMetadata(e,r)}async saveItem(e,r,n){return this.store.saveItem(e,ZS(r),n)}async updateItem(e,r,n){let i={...n};return this.store.updateItem(e,r,i)}async deleteItem(e,r){return this.store.deleteItem(e,r)}async moveItem(e,r,n){return this.store.moveItem(e,r,n)}async reorderItems(e,r,n){return this.store.reorderItems(e,r,n)}async saveScripts(e,r,n){return this.store.saveScripts(e,r,n)}loadScripts(e,r){return this.store.loadScripts(e,r)}};var bu=class{parsers=new Map;register(e,r){this.parsers.set(e.toLowerCase(),r)}get(e){return this.parsers.get(e.toLowerCase())}has(e){return this.parsers.has(e.toLowerCase())}getFormats(){return Array.from(this.parsers.keys())}detect(e){for(let[r,n]of this.parsers)if(n.canParse(e))return{parser:n,format:r};return null}clear(){this.parsers.clear()}};ka();var Su=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}get(e,r){if(r){let s=this.getCookieKey(e,r),o=this.cookies.get(s);if(o&&!this.isExpired(o))return o}let n=this.getCookieKey(e,"*"),i=this.cookies.get(n);if(i&&!this.isExpired(i))return i;for(let s of this.cookies.values())if(s.name===e&&!this.isExpired(s))if(r&&s.domain){if(this.domainMatches(r,s.domain))return s}else return s}set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e)}setFromResponse(e){for(let r of e){let n=this.getCookieKey(r.name,r.domain,r.path);this.cookies.set(n,r)}}has(e,r){return this.get(e,r)!==void 0}delete(e,r,n){let i=this.getCookieKey(e,r,n);return this.cookies.delete(i)}getAll(e){let r=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&r.push(n):r.push(n));return r}getCookieHeader(e){let r=this.getAll(e);return _t.formatCookieHeader(r)}clear(){this.cookies.clear()}clearDomain(e){let r=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&r.push(n);for(let n of r)this.cookies.delete(n)}parseCookieHeaders(e,r){return _t.parseCookieHeaders(e,r)}isExpired(e){return _t.isExpired(e)}domainMatches(e,r){return _t.domainMatches(e,r)}get count(){return this.cookies.size}cleanExpiredCookies(){let e=[];for(let[r,n]of this.cookies.entries())this.isExpired(n)&&e.push(r);for(let r of e)this.cookies.delete(r)}};sm();var Bi=class t{config;selectedEnvironment;sessionGlobals={};sessionEnvironmentValues=new Map;constructor(e){this.config=e,this.selectedEnvironment=e.selectedEnvironment||Object.keys(e.environments)[0]||"default"}get(e){return this.getVariables()[e]}set(e,r){let n=this.sessionEnvironmentValues.get(this.selectedEnvironment);n||(n={},this.sessionEnvironmentValues.set(this.selectedEnvironment,n)),n[e]=r}getAll(){return this.getVariables()}getEnvironments(){return Object.keys(this.config.environments)}getActive(){return this.selectedEnvironment}setActive(e){if(!this.config.environments[e])throw new Error(`Environment not found: ${e}`);this.selectedEnvironment=e}getVariables(e){let r=e||this.selectedEnvironment,n=this.config.environments[r],i={...this.config.globalVariables||{},...this.sessionGlobals};if(n){if(n.inherits&&this.config.environments[n.inherits]){let o=this.getEnvironmentVariables(n.inherits);i={...i,...o}}i={...i,...n.variables};let s=this.sessionEnvironmentValues.get(r);s&&(i={...i,...s})}return i}getEnvironmentVariables(e){let r=this.config.environments[e];if(!r)return{};let n={};return r.inherits&&this.config.environments[r.inherits]&&(n={...this.getEnvironmentVariables(r.inherits)}),{...n,...r.variables}}getGlobals(){return{...this.config.globalVariables||{},...this.sessionGlobals}}setGlobal(e,r){this.sessionGlobals[e]=r}unsetGlobal(e){delete this.sessionGlobals[e]}clearGlobals(){this.sessionGlobals={}}resolve(e){let r=e||this.selectedEnvironment;return{name:r,merged:this.getVariables(r),globals:this.getGlobals()}}static fromVariables(e,r="default"){return new t({environments:{[r]:{name:r,variables:e}},selectedEnvironment:r})}};_u();Af();var Cs=class t{envStore;interpolator;urlBuilder;constructor(e,r){this.envStore=e,this.interpolator=r||new vo,this.urlBuilder=new Hn}get(e){return this.envStore.get(e)}set(e,r){this.envStore.set(e,r)}has(e){return this.envStore.get(e)!==void 0}delete(e){this.envStore.set(e,"")}getAll(){return this.envStore.getAll()}getActiveEnvironment(){return this.envStore.getActive()}setActiveEnvironment(e){this.envStore.setActive(e)}getEnvironments(){let e=this.envStore;return typeof e.getEnvironments=="function"?e.getEnvironments():[]}getGlobals(){let e=this.envStore;return typeof e.getGlobals=="function"?e.getGlobals():{}}setGlobal(e,r){let n=this.envStore;typeof n.setGlobal=="function"&&n.setGlobal(e,r)}unsetGlobal(e){let r=this.envStore;typeof r.unsetGlobal=="function"&&r.unsetGlobal(e)}clearGlobals(){let e=this.envStore;typeof e.clearGlobals=="function"&&e.clearGlobals()}resolve(e){return this.interpolator.interpolate(e,this.getAll())}resolvePath(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r)}buildUrl(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r.params||{},r.query||{})}resolveObject(e){return this.interpolator.interpolateObject(e,this.getAll())}extractVariables(e){return this.interpolator.extractVariables(e)}extractPathParams(e){return this.urlBuilder.extractPathParams(e)}static create(e={}){let r=Bi.fromVariables(e);return new t(r)}static fromResolver(e){return new t(e)}};Af();Tf();$f();_u();md();hd();var Ga=class{constructor(e,r,n,i,s){this.httpClient=e;this.forgeEnv=r;this.cookieJar=n;this.preprocessor=i;if(s?.scriptExecutor)this.scriptExecutor=s.scriptExecutor;else{let o=s?.forgeRoot?[require("path").join(s.forgeRoot,"modules")]:[],l=new Wi(new Hn,new zi,e);this.scriptExecutor=new Ki(l,o,void 0,s?.scriptScope??"shared",s?.scriptTimeout??5e3)}}httpClient;forgeEnv;cookieJar;preprocessor;scriptExecutor;async execute(e,r,n={}){let i=Date.now(),s={...this.forgeEnv.getAll()},o={...this.forgeEnv.getGlobals()},l={...n.additionalVariables||{}},c={...s},d=this.buildHttpRequest(e,n.overrides),p=n.overrides?.body||e.body,m=this.findFolderPath(r,e.id),y=this.buildScriptChain(e,r,m),b={request:{url:d.url,method:d.method,headers:{...d.headers},body:p?typeof p=="string"?{type:"raw",content:p}:p:void 0},variables:l,collectionVariables:r.variables||{},globals:{...o},environmentVariables:c,environmentName:this.forgeEnv.getActiveEnvironment?.()||void 0,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:r?.name},onEnvironmentChange:n.onEnvironmentChange,onGlobalsChange:(_,E,k)=>{_==="set"&&E&&k!==void 0?this.forgeEnv.setGlobal(E,k):_==="unset"&&E?this.forgeEnv.unsetGlobal(E):_==="clear"&&this.forgeEnv.clearGlobals()}},q=this.scriptExecutor.createRequestSession(b),x,v;try{if(!n.skipPreRequest&&y.preRequest.length>0){let P=await q.executePreRequest(y.preRequest);if(x={success:P.success,error:P.error,modifiedVariables:P.modifiedVariables,modifiedEnvironment:P.modifiedEnvironmentVariables,modifiedGlobals:P.modifiedGlobals,modifiedCollectionVariables:P.modifiedCollectionVariables,consoleOutput:P.consoleOutput,modifiedRequest:P.modifiedRequest?{url:P.modifiedRequest.url,method:P.modifiedRequest.method,headers:P.modifiedRequest.headers,body:P.modifiedRequest.body?.content}:void 0},P.modifiedVariables&&(l={...l,...P.localVariables??P.modifiedVariables}),P.modifiedEnvironmentVariables&&(c={...c,...P.modifiedEnvironmentVariables}),P.modifiedRequest){let M=P.modifiedRequest;M.url&&(d.url=M.url),M.method&&(d.method=M.method),M.headers&&(d.headers={...d.headers,...M.headers}),M.body!==void 0&&(d.body=M.body?.content||M.body)}if(!P.success)throw new Error(`Pre-request script failed: ${P.error}`)}let _={...c,...l};d=this.interpolateRequest(d,_);let E=n.overrides?.body||e.body;if(this.preprocessor&&E&&typeof E!="string"&&E.type==="graphql"&&d.body!==void 0){let P=this.preprocessor.encodeBody({type:"graphql",content:d.body});P!=null&&(d.body=typeof P=="string"?P:JSON.stringify(P))}if(p&&typeof p=="object"&&p.type==="form-data"&&Array.isArray(d.body)){let P=this.buildMultipartFormData({type:"form-data",content:d.body});P&&(d.body=P)}let k=await this.httpClient.send(d);if(!n.skipPostResponse&&y.postResponse.length>0){let P=await q.executePostResponse(y.postResponse,{status:k.status,statusText:k.statusText,headers:k.headers,body:k.body,cookies:Zm(k.headers,k.cookies,d.url),responseTime:k.time,responseSize:k.size,executedRequest:{url:d.url,method:d.method,headers:d.headers||{},body:d.body?typeof d.body=="string"?{type:"raw",content:d.body}:d.body:{type:"none",content:""},params:{},query:{}}});v={success:!0,assertions:P.testResults,consoleOutput:P.consoleOutput,modifiedEnvironment:P.modifiedEnvironmentVariables},P.modifiedEnvironmentVariables&&(c={...c,...P.modifiedEnvironmentVariables})}return{response:k,preRequestResult:x,postResponseResult:v,totalTime:Date.now()-i,finalRequest:d,variables:{environment:c,local:l}}}finally{q.dispose?.()}}async executeSimple(e,r={}){let n=e,i={...this.forgeEnv.getAll(),...r.variables||{}};return n=this.interpolateRequest(e,i),r.timeout&&(n={...n,timeout:r.timeout}),this.httpClient.send(n)}buildHttpRequest(e,r){let n=e.url;if(e.query&&e.query.length>0){let p=new URLSearchParams;for(let m of e.query)m.enabled!==!1&&p.append(m.key,m.value);n+=(n.includes("?")?"&":"?")+p.toString()}let i=r?.url||n,s=r?.method||e.method,o={};if(e.headers&&Array.isArray(e.headers))for(let p of e.headers)p.enabled!==!1&&(o[p.key]=p.value);let l={...o,...r?.headers||{}},c,d=r?.body||e.body;if(d)if(typeof d=="string")c=d;else if(this.preprocessor&&d.type)if(d.type==="graphql")c=typeof d.content=="string"?d.content:JSON.stringify(d.content);else if(d.type==="form-data")c=this.buildMultipartFormData(d);else{let p=this.preprocessor.encodeBody(d);c=p!=null?String(p):void 0}else d.content&&(c=typeof d.content=="string"?d.content:JSON.stringify(d.content));return this.preprocessor&&d&&d.type!=="form-data"&&this.preprocessor.setContentTypeHeader(l,d),{url:i,method:s,headers:l,body:c,timeout:r?.timeout||e.settings?.timeout,settings:{...e.settings,...r?.settings}}}interpolateRequest(e,r){let n=Cs.create(r),i=e.body,s=i;return typeof i=="string"?s=n.resolve(i):i instanceof FormData||i instanceof URLSearchParams?s=i:i&&typeof i=="object"&&(s=n.resolve(i)),{...e,url:n.resolvePath(e.url),headers:n.resolveObject(e.headers),body:s}}buildMultipartFormData(e){if(!e||e.type!=="form-data"||!Array.isArray(e.content))return;let r=new FormData;for(let n of e.content)!n?.key||n.enabled===!1||r.append(n.key,n.value==null?"":String(n.value));return r}buildScriptChain(e,r,n=[]){let i=[],s=[];r.scripts?.preRequest&&i.push(r.scripts.preRequest),r.scripts?.postResponse&&s.push(r.scripts.postResponse);for(let o of n)o.scripts?.preRequest&&i.push(o.scripts.preRequest),o.scripts?.postResponse&&s.push(o.scripts.postResponse);return e.scripts?.preRequest&&i.push(e.scripts.preRequest),e.scripts?.postResponse&&s.push(e.scripts.postResponse),{preRequest:i,postResponse:s}}findFolderPath(e,r){let n=[],i=(s,o)=>{for(let l of s){if(l.type==="request"&&l.id===r)return n.push(...o),!0;if(l.type==="folder"){let c=[...o,l];if(i(l.items,c))return!0}}return!1};return i(e.items,[]),n}};function Dz(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}var zu=class{entries=new Map;requestIndex=new Map;fullResponses=new Map;maxEntriesPerRequest;storeFullResponses;constructor(e={}){this.maxEntriesPerRequest=e.maxEntriesPerRequest??100,this.storeFullResponses=e.storeFullResponses??!0}getEntries(e,r){let n=this.requestIndex.get(e)||[],i=[];for(let s of n){let o=this.entries.get(s);o&&(!r||o.environment===r)&&i.push(o)}return i}getEntry(e){return this.entries.get(e)}getFullResponse(e){return this.fullResponses.get(e)}get count(){return this.entries.size}addEntry(e,r,n,i,s){let o=Dz(),l=Date.now(),c={id:o,timestamp:l,environment:i,method:r.method,ticket:s?.ticket,branch:s?.branch,note:s?.note,sentRequest:{url:r.url,method:r.method,headers:{...r.headers},body:r.body},response:{status:n.status,statusText:n.statusText,time:n.time}};this.entries.set(o,c);let d=this.requestIndex.get(e)||[];for(d.unshift(o);d.length>this.maxEntriesPerRequest;){let p=d.pop();p&&(this.entries.delete(p),this.fullResponses.delete(p))}if(this.requestIndex.set(e,d),this.storeFullResponses){let p={timestamp:l,status:n.status,statusText:n.statusText,headers:{...n.headers},cookies:n.cookies||[],body:n.body,time:n.time};this.fullResponses.set(o,p)}return c}deleteEntry(e){if(!this.entries.get(e))return!1;this.entries.delete(e),this.fullResponses.delete(e);for(let[n,i]of this.requestIndex.entries()){let s=i.indexOf(e);if(s!==-1){i.splice(s,1),i.length===0&&this.requestIndex.delete(n);break}}return!0}clearHistory(e){let r=this.requestIndex.get(e);if(r){for(let n of r)this.entries.delete(n),this.fullResponses.delete(n);this.requestIndex.delete(e)}}clearAll(){this.entries.clear(),this.requestIndex.clear(),this.fullResponses.clear()}};var Ju=class{async send(e){let r=Date.now(),n=new AbortController,i=e.timeout??3e4,s=setTimeout(()=>n.abort(),i);try{let o={method:e.method,headers:e.headers,signal:n.signal};e.body!==void 0&&!["GET","HEAD"].includes(e.method.toUpperCase())&&(typeof e.body=="string"||e.body instanceof FormData||e.body instanceof URLSearchParams?o.body=e.body:typeof e.body=="object"&&(o.body=JSON.stringify(e.body),!e.headers?.["Content-Type"]&&!e.headers?.["content-type"]&&(o.headers["Content-Type"]="application/json"))),e.settings?.followRedirects===!1&&(o.redirect="manual");let l=await fetch(e.url,o),c=Date.now(),d;try{d=await l.text()}catch{d=null}let p={};return l.headers.forEach((m,y)=>{let b=p[y];b!==void 0?p[y]=Array.isArray(b)?[...b,m]:[b,m]:p[y]=m}),{status:l.status,statusText:l.statusText,headers:p,cookies:[],body:d,time:c-r}}catch(o){throw o.name==="AbortError"?new Error(`Request timeout after ${i}ms`):o}finally{clearTimeout(s)}}};Tf();$f();gd();tg();_u();var Io=class{format="http-forge";canParse(e){try{let r=JSON.parse(e);return typeof r=="object"&&r!==null&&"id"in r&&"name"in r&&"items"in r&&Array.isArray(r.items)&&!r.info?.schema?.includes("postman")&&!r._type}catch{return!1}}parse(e,r){let n=JSON.parse(e);return{id:n.id,name:n.name,description:n.description,variables:n.variables||{},auth:n.auth,scripts:n.scripts?{preRequest:n.scripts.preRequest,postResponse:n.scripts.postResponse}:void 0,items:this.convertItems(n.items),source:{format:"http-forge",filePath:r,version:n.version}}}convertItems(e){return e.map(r=>r.type==="folder"?this.convertFolder(r):this.convertRequest(r))}convertFolder(e){return{type:"folder",id:e.id,name:e.name,description:e.description,auth:e.auth,scripts:e.scripts?{preRequest:e.scripts.preRequest,postResponse:e.scripts.postResponse}:void 0,items:e.items?this.convertItems(e.items):[]}}convertRequest(e){let r={};if(e.headers)for(let i of e.headers)i.enabled!==!1&&(r[i.key]=i.value);let n={};if(e.query)for(let i of e.query)i.enabled!==!1&&(n[i.key]=i.value);return{type:"request",id:e.id,name:e.name,description:e.description,method:e.method||"GET",url:e.url||"",headers:Object.entries(r).map(([i,s])=>({key:i,value:s,enabled:!0})),query:Object.entries(n).map(([i,s])=>({key:i,value:s,enabled:!0})),params:e.params,body:e.body,auth:e.auth,settings:e.settings,scripts:e.scripts?{preRequest:e.scripts.preRequest,postResponse:e.scripts.postResponse}:void 0}}};rg();var xn=ve(require("fs/promises")),Yu=ve(require("path")),Gu=class{async readFile(e){return xn.readFile(e,"utf-8")}async writeFile(e,r){let n=Yu.dirname(e);await this.mkdir(n),await xn.writeFile(e,r,"utf-8")}async exists(e){try{return await xn.access(e),!0}catch{return!1}}async mkdir(e){await xn.mkdir(e,{recursive:!0})}async glob(e,r){let n=r||process.cwd(),i=[];try{await this.walkDirectory(n,s=>{let o=Yu.basename(s);for(let l of e)if(this.matchPattern(o,l)){i.push(s);break}})}catch{}return i}async readDir(e){return xn.readdir(e)}async isDirectory(e){try{return(await xn.stat(e)).isDirectory()}catch{return!1}}async walkDirectory(e,r){let n=await xn.readdir(e,{withFileTypes:!0});for(let i of n){let s=Yu.join(e,i.name);i.isDirectory()?await this.walkDirectory(s,r):i.isFile()&&r(s)}}matchPattern(e,r){let n=r.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp(`^${n}$`,"i").test(e)}};md();var ng=class t{httpClient;fileSystem;scriptExecutor;interpolator;cookieJar;interceptorChain;preprocessor;dataFileParser;requestHistory;parserRegistry;collectionLoader;environmentStore;forgeEnv;requestExecutor;options;constructor(e={}){if(this.options=e,this.interpolator=e.interpolator||new vo,this.fileSystem=e.fileSystem||new Gu,this.preprocessor=e.preprocessor||new qo,this.dataFileParser=e.dataFileParser||new Oo,this.cookieJar=e.cookieJar||new Su,e.enableHistory?this.requestHistory=e.requestHistory||new zu({maxEntriesPerRequest:e.maxHistoryEntries??100}):this.requestHistory=null,this.interceptorChain=e.interceptorChain||this.createInterceptorChain(e),e.httpClient)this.httpClient=e.httpClient;else if(e.useNativeHttp!==!1){let s={...e.httpSettings,timeout:e.requestTimeout??e.httpSettings?.timeout};this.httpClient=new Eo(s)}else this.httpClient=new Ju;let r=e.forgeRoot?[require("path").join(e.forgeRoot,"modules")]:[],n=new Wi(new Hn,this.interceptorChain,this.httpClient);if(this.scriptExecutor=e.scriptExecutor||new Ki(n,r,void 0,e.scriptScope??"shared",e.scriptTimeout??5e3),this.parserRegistry=new bu,this.parserRegistry.register("http-forge",new Io),(e.storageFormat??"folder")==="folder"&&e.forgeRoot){let s=require("path").join(e.forgeRoot,"collections");this.collectionLoader=new vu(s)}else this.collectionLoader=new Oa(this.fileSystem,this.parserRegistry);this.environmentStore=e.environmentConfig?new Bi(e.environmentConfig):Bi.fromVariables({}),this.forgeEnv=Cs.fromResolver(this.environmentStore),this.requestExecutor=new Ga(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:e.forgeRoot,scriptExecutor:this.scriptExecutor})}createInterceptorChain(e){let r=new zi;if(e.requestInterceptors)for(let n of e.requestInterceptors)r.addRequestInterceptor(n);if(e.responseInterceptors)for(let n of e.responseInterceptors)r.addResponseInterceptor(n);if(e.errorInterceptors)for(let n of e.errorInterceptors)r.addErrorInterceptor(n);return r}async loadCollection(e){if(this.collectionLoader instanceof Oa)return this.collectionLoader.load(e);throw new Error("loadCollection(filePath) is not supported with folder storage format. Use loadAllCollections() instead.")}async loadAllCollections(){return this.collectionLoader.loadAll()}async execute(e,r,n){return this.requestExecutor.execute(e,r,n)}async executeSimple(e,r){return this.requestExecutor.executeSimple(e,r)}registerParser(e,r){this.parserRegistry.register(e,r)}setEnvironmentConfig(e){this.environmentStore=new Bi(e),this.forgeEnv=Cs.fromResolver(this.environmentStore),this.requestExecutor=new Ga(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:this.options.forgeRoot,scriptExecutor:this.scriptExecutor})}static create(e){return new t(e)}static fromForgeRoot(e="./http-forge",r={}){let n=require("path"),i=n.join(e,"environments"),s,o=wu(i);if(Object.keys(o.environments).length>0||Object.keys(o.globalVariables).length>0){s={globalVariables:{...o.globalVariables,...o.localVariables},environments:{},selectedEnvironment:void 0};for(let[c,d]of Object.entries(o.environments)){let p=o.localCredentials[c]?.variables||{};s.environments[c]={name:c,variables:{...d.variables,...p}}}}else{let c=require("fs"),d=n.join(i,"environments.json");if(c.existsSync(d))try{let p=c.readFileSync(d,"utf-8"),m=JSON.parse(p);if(s={globalVariables:m.globalVariables||{},environments:{},selectedEnvironment:m.selectedEnvironment},m.environments)for(let[y,b]of Object.entries(m.environments)){let q=b;s.environments[y]={name:q.name||y,variables:q.variables||{}}}}catch(p){console.warn(`[ForgeContainer] Failed to load environments from ${d}:`,p)}}return new t({...r,forgeRoot:e,storageFormat:r.storageFormat??"folder",environmentConfig:s})}};wC();RC();Wy();Ii();EC();qC();IC();OC();lv();kp();PC();async function KN(t){let{createMcpRuntime:e}=await Promise.resolve().then(()=>(YN(),GN));return e(t)}async function QN(t){let{runRequest:e}=await Promise.resolve().then(()=>(Uc(),jp));return e(t)}async function ZN(t){let{runCollection:e}=await Promise.resolve().then(()=>(Uc(),jp));return e(t)}async function XN(t){let{runFolder:e}=await Promise.resolve().then(()=>(Uc(),jp));return e(t)}async function eM(t){let{runSuite:e}=await Promise.resolve().then(()=>(Uc(),jp));return e(t)}bv();n_();ka();kC();i_();Tf();$f();gd();function tM(t){return{timeout:t?.timeout??ln.timeout,followRedirects:t?.followRedirects??ln.followRedirects,followOriginalMethod:t?.followOriginalMethod??ln.followOriginalMethod,followAuthHeader:t?.followAuthHeader??ln.followAuthHeader,maxRedirects:t?.maxRedirects??ln.maxRedirects,strictSSL:t?.strictSSL??ln.strictSSL,decompress:t?.decompress??ln.decompress,includeCookies:t?.includeCookies??ln.includeCookies,tls:t?.tls??ln.tls,certificates:t?.certificates??ln.certificates}}gd();tg();_u();B0();W0();md();Ym();hd();_d();X0();t_();nm();Pa();Pa();Z0();function l7(t){let e=t.replace(/\\\n/g," "),r=[],n="",i=0;for(;i<e.length;){let s=e[i];if(s==="\\"&&i+1<e.length)n+=e[++i],i++;else if(s==="'"){for(i++;i<e.length&&e[i]!=="'";)n+=e[i++];i++}else if(s==='"'){for(i++;i<e.length&&e[i]!=='"';)if(e[i]==="\\"&&i+1<e.length){let o=e[i+1];o==='"'||o==="\\"||o==="$"||o==="`"?(n+=o,i+=2):n+=e[i++]}else n+=e[i++];i++}else/\s/.test(s)?(n.length>0&&(r.push(n),n=""),i++):(n+=s,i++)}return n.length>0&&r.push(n),r}function u7(t){try{let e="__FV__",r=[],n=t.replace(/\{\{[^}]+\}\}/g,p=>(r.push(p),`${e}${r.length-1}`)),i=n.indexOf("?");if(i===-1)return{cleanUrl:t,params:[]};let s=n.slice(0,i),o=n.slice(i+1),l=p=>p.replace(new RegExp(`${e}(\\d+)`,"g"),(m,y)=>r[parseInt(y,10)]),c=l(s),d=o.split("&").filter(Boolean).map(p=>{let m=l(p),y=m.indexOf("=");return y===-1?{key:m,value:"",enabled:!0}:{key:decodeURIComponent(m.slice(0,y)),value:decodeURIComponent(m.slice(y+1)),enabled:!0}});return{cleanUrl:c,params:d}}catch{return{cleanUrl:t,params:[]}}}function c7(t){try{let e=new URL(t.replace(/\{\{[^}]+\}\}/g,"placeholder")),r=e.pathname.split("/").filter(Boolean),n=r[r.length-1];return n&&!/^\d+$/.test(n)&&!n.startsWith("{")?n.replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase()):r.length>1?r[r.length-2].replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase()):e.hostname.replace(/^www\./,"").split(".")[0]??"Request"}catch{return"Request"}}var f7=new Set(["x-api-key","x-auth-token","x-access-token","x-token","x-secret","api-key","apikey","x-client-secret","x-rapidapi-key"]),d7=new Set(["api_key","apikey","api-key","access_token","token","auth_token","client_id","client_secret","key","secret"]);function rM(t){return t.toUpperCase().replace(/[^A-Z0-9]/g,"_")}function nM(t){return/\{\{[^}]+\}\}/.test(t)}function Cv(t,e=16){return t.length>=e&&!nM(t)}function p7(t,e,r){let n=[],i=new Set,s=(o,l)=>{i.has(l)||(i.add(l),n.push({key:o,value:l}))};for(let o of t){let l=o.key.toLowerCase();if(l==="authorization"){let c=o.value.match(/^(bearer|basic|token|digest)\s+(.+)$/i);c&&Cv(c[2])?s(`${c[1].toUpperCase()}_TOKEN`,c[2]):Cv(o.value)&&s("AUTH_TOKEN",o.value)}else f7.has(l)&&Cv(o.value)&&s(rM(o.key),o.value)}for(let o of e)d7.has(o.key.toLowerCase())&&Cv(o.value)&&s(rM(o.key),o.value);try{let o=new URL(r.replace(/\{\{[^}]+\}\}/g,"placeholder"));if(!["localhost","127.0.0.1","0.0.0.0","::1"].includes(o.hostname)&&!nM(r)){let c=`${o.protocol}//${o.host}`;s("BASE_URL",c)}}catch{}return n}function iM(t){let e=l7(t.trim()),r=0;for(;r<e.length&&e[r].toLowerCase()==="curl";)r++;let n=e.slice(r),i="",s="",o=[],l=null,c=!1,d=!1,p=[],m=[],y=0;for(;y<n.length;){let E=n[y];if(E==="-X"||E==="--request")i=n[++y]??"";else if(E==="-H"||E==="--header"){let k=n[++y]??"",P=k.indexOf(":");P>0&&o.push({key:k.slice(0,P).trim(),value:k.slice(P+1).trim()})}else if(E==="-d"||E==="--data"||E==="--data-raw"||E==="--data-binary"||E==="--data-ascii")l=n[++y]??"";else if(E==="--json")l=n[++y]??"",c=!0;else if(E==="-u"||E==="--user"){let k=n[++y]??"",P=btoa(k);o.push({key:"Authorization",value:`Basic ${P}`})}else if(E==="-b"||E==="--cookie")o.push({key:"Cookie",value:n[++y]??""});else if(E==="--url")s=n[++y]??"";else if(E==="-G"||E==="--get")d=!0;else if(E==="-F"||E==="--form"){let k=n[++y]??"",P=k.indexOf("=");P>0&&p.push({key:k.slice(0,P),value:k.slice(P+1)})}else E==="--data-urlencode"?m.push(n[++y]??""):E==="-A"||E==="--user-agent"?o.push({key:"User-Agent",value:n[++y]??""}):E==="-e"||E==="--referer"||E==="--referrer"?o.push({key:"Referer",value:n[++y]??""}):E==="--compressed"||E==="-L"||E==="--location"||E==="-v"||E==="--verbose"||E==="-s"||E==="--silent"||E==="-i"||E==="--include"||E==="-k"||E==="--insecure"||E==="--http1.1"||E==="--http2"||E==="--http3"||(E==="-o"||E==="--output"||E==="--max-time"||E==="--connect-timeout"||E==="-m"||E==="--limit-rate"||E==="--proxy"||E==="-x"?y++:!E.startsWith("-")&&!s&&(s=E));y++}d?i="GET":i||(i=l!==null||p.length>0||m.length>0?"POST":"GET");let{cleanUrl:b,params:q}=u7(s),x=null;if(p.length>0)x={type:"raw",format:"text",content:p.map(k=>`${encodeURIComponent(k.key)}=${encodeURIComponent(k.value)}`).join("&")},o.some(k=>k.key.toLowerCase()==="content-type")||o.push({key:"Content-Type",value:"multipart/form-data"});else if(m.length>0)x={type:"raw",format:"text",content:m.join("&")},o.some(E=>E.key.toLowerCase()==="content-type")||o.push({key:"Content-Type",value:"application/x-www-form-urlencoded"});else if(l!==null){let E=l.trim(),k=c||E.startsWith("{")||E.startsWith("[");x={type:"raw",format:k?"json":"text",content:l},k&&!o.some(P=>P.key.toLowerCase()==="content-type")&&o.push({key:"Content-Type",value:"application/json"})}let v=o.map(E=>({...E,enabled:!0})),_=p7(o,q,b||s);return{name:c7(b||s),method:i.toUpperCase(),url:b||s,headers:v,queryParams:q,body:x,suggestedVars:_}}async function sM(t,e,r,n){let i=oM(t.items);if(i.length===0)return;let s=Math.ceil(i.length/10);for(let o=0;o<i.length;o+=10){let l=i.slice(o,o+10),c=Math.floor(o/10)+1;n?.(`Enhancing requests (batch ${c}/${s})\u2026`,1/s*100);let d=l.map(p=>({id:p.id,name:p.name,method:p.method??"GET",url:p.url??"",bodyContent:y7(p),responseSchema:p.responseSchema?JSON.stringify(p.responseSchema).slice(0,500):void 0,description:p.description?.slice(0,200)}));try{let p=await r.complete(h7(d)),m=m7(p);g7(l,m)}catch{}}await e.saveCollection(t)}function h7(t){return`You are an API testing expert. For each HTTP request below, return two improvements:
|
|
1021
|
+
[View HTML Report](${p[1]})`:"";return{content:[{type:"text",text:d+m}]}}case"prompts/list":return{prompts:$p};case"prompts/get":{let r=e.params??{},n=r.name,i=r.arguments??{};if(!n)throw new Error("Missing prompt name");let s=In(t.workspaceFolder);try{return await Ky(n,i,s.collection,t.runStore)}finally{Hc(s)}}default:throw new Error(`Method not found: ${e.method}`)}}function t7(t,e,r){let n=!t.container,i=t.container??In(t.workspaceFolder),s;try{s=i.config.getMcpConfig().cors.allowedOrigins??["http://localhost","http://127.0.0.1"]}finally{n&&Hc(i)}let o=e.headers.origin??"",l=s.includes(o)?o:s[0]??"http://localhost";r.setHeader("Access-Control-Allow-Origin",l),r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS"),r.setHeader("Access-Control-Allow-Headers","Content-Type, Mcp-Session-Id")}function r7(t,e,r){let i=new URL(e.url,`http://${t.host}:${t.port}`).searchParams.get("path");if(!i){r.statusCode=400,r.end("Missing path parameter");return}let s=Xo.resolve(i),o=t.container?.config.getResultsPath(),l=o?Xo.dirname(o):Xo.resolve(t.workspaceFolder,".http-forge",".cache");if(!s.startsWith(l+Xo.sep)||!s.endsWith(".html")){r.statusCode=403,r.end("Forbidden");return}zN.readFile(s,"utf-8",(c,d)=>{if(c){r.statusCode=404,r.end("Report not found");return}r.statusCode=200,r.setHeader("content-type","text/html; charset=utf-8"),r.end(d)})}function zC(t,e,r,n){let i=t.create(e,r);return n().then(s=>{i.status!=="cancelled"&&(i.status="completed",i.completedAt=Date.now(),i.summary=s?.summary??i.summary,s?.failedRequests&&(i.failedRequests=s.failedRequests),s?.noAssertionExamples&&(i.noAssertionExamples=s.noAssertionExamples),i.reportPath=s?.report?.uri?.replace("file://","")??null,i.progress.completed=i.progress.total)}).catch(s=>{i.status!=="cancelled"&&(i.status="failed",i.completedAt=Date.now(),i.error=s.message)}),{runId:i.id,status:"running",total:r,message:"Run started. Use get_run_status to poll."}}function n7(t){let e=t.workspaceFolder;return{async runRequest(r,n,i){return Pi(()=>xv({workspaceFolder:e,collectionId:r.id,requestId:n,environment:i.environment,variables:i.variables,headers:i.headers,query:i.query,body:i.body,include:i.include}))},async runFolder(r,n,i){let s=rt(r).filter(({folderPath:o})=>o===n||o.startsWith(`${n}/`)).length;return i.async===!0?zC(t.runStore,`${r.name} / ${rs(n)}`,s,()=>Pi(()=>Vs({workspaceFolder:e,collectionId:r.id,folderPath:n,recursive:i.recursive,environment:i.environment,variables:i.variables,iterations:i.iterations,stopOnError:i.stopOnError,delay:i.delay,include:i.include}))):Pi(()=>Vs({workspaceFolder:e,collectionId:r.id,folderPath:n,recursive:i.recursive,environment:i.environment,variables:i.variables,iterations:i.iterations,stopOnError:i.stopOnError,delay:i.delay,include:i.include}))},async runCollection(r,n){let i=rt(r).length;return n.async===!0?zC(t.runStore,r.name,i,()=>Pi(()=>Vs({workspaceFolder:e,collectionId:r.id,environment:n.environment,variables:n.variables,iterations:n.iterations,stopOnError:n.stopOnError,delay:n.delay,include:n.include}))):Pi(()=>Vs({workspaceFolder:e,collectionId:r.id,environment:n.environment,variables:n.variables,iterations:n.iterations,stopOnError:n.stopOnError,delay:n.delay,include:n.include}))},async runSuite(r,n,i){let s=In(e),o=0;try{let l=await s.testSuite.getSuite(r);o=(l?.nodes.filter(d=>d.type==="request").length??0)*(i.iterations??l?.config?.iterations??1)}finally{Hc(s)}return i.async===!0?zC(t.runStore,n,o,()=>Pi(()=>Dp({workspaceFolder:e,suiteId:r,environment:i.environment,variables:i.variables,iterations:i.iterations,stopOnError:i.stopOnError,delay:i.delay,requestFilter:i.requestFilter,include:i.include}))):Pi(()=>Dp({workspaceFolder:e,suiteId:r,environment:i.environment,variables:i.variables,iterations:i.iterations,stopOnError:i.stopOnError,delay:i.delay,requestFilter:i.requestFilter,include:i.include}))}}}async function GC(t,e,r={}){let n=t.workspaceFolder,i=Q5(t.container,e);if(Object.values(G).includes(i)){let l=In(n);try{let c=await Yy(i,r,{collection:l.collection,testSuite:l.testSuite,environmentConfig:l.environmentConfig,workspaceFolder:n},t.runStore,n7(t));return i7.has(i)&&JC.delete(n),c}finally{Hc(l)}}let s=rv(i),o=In(n);try{let l=o.collection.getAllCollections(),c=l.map(b=>b.id),d=b=>{let q=vl(b,c),x=q?l.find(v=>v.id===q):void 0;if(!x)throw new Error(`Collection not found for tool: ${e}`);return x};if(s.kind==="request"){let[b,q]=s.tokens;if(!b||!q)throw new Error(`Malformed request tool: ${e}`);let x=d(b),v=rt(x).map(E=>E.request.id),R=vl(q,v);if(!R)throw new Error(`Request not found in collection "${x.name}" for tool: ${e}`);return Pi(()=>xv({workspaceFolder:n,collectionId:x.id,requestId:R,environment:r.environment,variables:r.variables,headers:r.headers,query:r.query,body:r.body,include:r.include}))}if(s.kind==="collection"){let[b]=s.tokens;if(!b)throw new Error(`Malformed collection tool: ${e}`);let q=d(b);return Pi(()=>Vs({workspaceFolder:n,collectionId:q.id,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include}))}if(s.kind==="folder"){let[b,q]=s.tokens;if(!b||!q)throw new Error(`Malformed folder tool: ${e}`);let x=d(b),v=(o.collection.getAllCollections().find(k=>k.id===x.id),void 0),R=rt(x).map(k=>k.folderPath).filter((k,P,M)=>k&&M.indexOf(k)===P),E=nv(q,R);if(!E)throw new Error(`Folder not found in collection "${x.name}" for tool: ${e}`);return Pi(()=>Vs({workspaceFolder:n,collectionId:x.id,folderPath:E,recursive:r.recursive,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include}))}let[p]=s.tokens;if(!p)throw new Error(`Malformed suite tool: ${e}`);let m=await o.testSuite.getAllSuites(),y=vl(p,m.map(b=>b.id));if(!y)throw new Error(`Test suite not found for tool: ${e}`);return Pi(()=>Dp({workspaceFolder:n,suiteId:y,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,requestFilter:r.requestFilter,include:r.include}))}finally{Hc(o)}}function ql(t,e,r){t.statusCode=e,t.setHeader("content-type","application/json; charset=utf-8"),t.end(JSON.stringify(r))}function WN(t){return new Promise((e,r)=>{let n="";t.on("data",i=>{n+=i,n.length>1024*1024&&r(new Error("Request body too large (max 1MB)"))}),t.on("end",()=>{if(!n){e({});return}try{e(JSON.parse(n))}catch{r(new Error("Invalid JSON body"))}}),t.on("error",r)})}function s7(t){return(0,JN.createServer)(async(e,r)=>{try{if(t7(t,e,r),e.method==="OPTIONS"){r.statusCode=204,r.end();return}if(e.method==="GET"&&e.url==="/health"){ql(r,200,{status:"ok",port:t.port});return}if(e.method==="GET"&&e.url?.startsWith("/report?")){r7(t,e,r);return}if(e.method==="POST"&&(e.url==="/"||e.url==="/mcp")){let n;try{n=await WN(e)}catch{VN(r,null,-32700,"Parse error");return}try{let i=await e7(t,n);ql(r,200,{jsonrpc:"2.0",id:n.id??null,result:i})}catch(i){VN(r,n.id??null,-32603,i.message||"Internal error")}return}if(e.method==="POST"&&e.url==="/tools/execute"){let n=await WN(e);if(!n||typeof n.name!="string"||n.name.trim()===""){ql(r,400,{error:'Field "name" is required'});return}let i=await GC(t,n.name,n.args??{});ql(r,200,{result:i});return}ql(r,405,{error:"Method not allowed"})}catch(n){ql(r,500,{error:n.message})}})}function o7(t){if(typeof t.port=="number"&&Number.isFinite(t.port))return Math.min(65535,Math.max(1,Math.floor(t.port)));let r=new ks(Xo.resolve(t.workspaceFolder)).getMcpConfig().port;return Math.min(65535,Math.max(1,Math.floor(r||3100)))}async function a7(t){let e=o7(t),r=t.host||"127.0.0.1",n=`${r}:${e}`,i={workspaceFolder:t.workspaceFolder,port:e,host:r,isRunning:!1,runStore:new $c};return G5.set(n,i),{async start(){if(i.isRunning)return;i.container||(i.container=In(i.workspaceFolder));let s=s7(i);await new Promise((o,l)=>{s.once("error",l),s.listen(i.port,i.host,()=>{s.off("error",l),o()})}),i.server=s,i.isRunning=!0},async stop(){if(i.container&&(Hc(i.container),i.container=void 0),!i.server){i.isRunning=!1;return}await new Promise((s,o)=>{i.server.close(l=>{if(l){o(l);return}s()})}),i.server=void 0,i.isRunning=!1},isRunning(){return i.isRunning},getPort(){return i.port},async executeTool(s,o){return GC(i,s,o??{})}}}var zN,JN,Xo,G5,Y5,JC,WC,i7,YN=le(()=>{"use strict";zN=ve(require("fs")),JN=require("http"),Xo=ve(require("path"));sg();Uc();Ii();EC();qC();IC();OC();lv();kp();bv();G5=new Map;Y5=3e3,JC=new Map,WC=new Map;i7=Gy});var k7={};Rs(k7,{AmbiguousRefError:()=>Zo,AwsSecretResolver:()=>gp,AzureKeyVaultResolver:()=>yp,BODY_FILE_MAP:()=>VS,CACHE_BUSTING_TOOLS:()=>Gy,COLLECTION_INPUT_SCHEMA:()=>Ip,CONFIG_FILES:()=>ko,CollectionLoader:()=>Oa,CollectionLoaderFactory:()=>Xu,CollectionRequestExecutor:()=>As,CollectionService:()=>ec,ConfigService:()=>ks,CookieJar:()=>Su,CookieService:()=>tc,CookieUtils:()=>_t,DEFAULT_CONFIG:()=>rr,DEFAULT_REQUEST_SETTINGS:()=>ln,DEFAULT_SUITE_CONFIG:()=>Go,DYNAMIC_VARIABLES:()=>tw,DataFileParser:()=>Oo,DopplerResolver:()=>wp,EnvironmentConfigService:()=>nc,EnvironmentResolver:()=>Bi,ExampleGenerator:()=>al,FOLDER_INPUT_SCHEMA:()=>Op,FetchHttpClient:()=>Ju,FolderCollectionLoader:()=>vu,FolderCollectionStore:()=>xs,ForgeContainer:()=>ng,ForgeEnv:()=>Cs,GENERIC_TOOL_NAMES:()=>G,GcpSecretResolver:()=>Sp,GraphQLSchemaService:()=>sc,HTTP_METHOD_MAP:()=>pv,HTTP_METHOD_REVERSE:()=>Bs,HashiCorpVaultResolver:()=>vp,HistoryAnalyzer:()=>Xa,HtmlReportGenerator:()=>jc,HttpForgeParser:()=>Io,HttpRequestService:()=>Wi,InMemoryCookieJar:()=>bl,InterceptorChain:()=>zi,JUnitReportGenerator:()=>wl,JsonCollectionLoader:()=>Qa,LoggingRequestInterceptor:()=>cm,MCP_PROMPTS:()=>$p,METADATA_FILES:()=>Cr,McpRunStore:()=>$c,ModuleLoader:()=>cd,NodeFileSystem:()=>Gu,NodeHttpClient:()=>Eo,OAuth2TokenManager:()=>Qu,OnePasswordResolver:()=>bp,OpenApiExporter:()=>ol,OpenApiImporter:()=>Hs,ParserRegistry:()=>bu,PersistentCookieJar:()=>rc,REQUEST_INPUT_SCHEMA:()=>qp,ROOT_DIRECTORIES:()=>Ps,RefResolver:()=>ml,RequestExecutor:()=>Ga,RequestHistoryService:()=>oc,RequestHistoryStore:()=>zu,RequestPreparer:()=>ic,RequestPreprocessor:()=>qo,RequestScriptSession:()=>Wu,ResultStorageService:()=>xl,RetryErrorInterceptor:()=>dm,SCHEMA_FILES:()=>yu,SCRIPTS_DIR:()=>rn,SCRIPT_FILES:()=>Ef,SUITE_INPUT_SCHEMA:()=>Pp,SchemaInferenceService:()=>gl,SchemaInferrer:()=>Ns,ScriptAnalyzer:()=>yl,ScriptExecutor:()=>Ki,SecretResolverRegistry:()=>Ac,ServiceContainer:()=>Yo,ServiceIdentifiers:()=>ae,StatisticsService:()=>qv,TestSuiteService:()=>Tc,TestSuiteStore:()=>Iv,TimingResponseInterceptor:()=>fm,UrlBuilder:()=>Hn,VariableInterpolator:()=>vo,VariableResolver:()=>yo,applyEnvSuggestionsToItems:()=>zy,applyExtractionPlan:()=>$P,applyFilterChain:()=>Cu,augmentWithDynamicVars:()=>mo,bootstrapNodeRuntime:()=>LC,buildCollectionToolDescription:()=>sv,buildCollectionToolName:()=>Xy,buildExtractionPlan:()=>TP,buildFolderToolDescription:()=>ov,buildFolderToolName:()=>ev,buildGenericTools:()=>Jy,buildMcpToolList:()=>dv,buildPromptResult:()=>Ky,buildRequestToolDescription:()=>iv,buildRequestToolName:()=>Zy,buildResultFileName:()=>Sl,buildSuiteToolDescription:()=>av,buildSuiteToolName:()=>tv,cleanupOldBodyFiles:()=>JS,concatenateScripts:()=>pd,countRequests:()=>Vy,createExpectChain:()=>za,createLodashShim:()=>H0,createMcpRuntime:()=>KN,createModuleLoader:()=>Jm,createMomentShim:()=>fd,createNodeContainer:()=>In,createResponseObject:()=>dd,createScriptConsole:()=>SP,createTestFunction:()=>Km,createVariableResolver:()=>Tq,decodeCursor:()=>fv,decodeFolderName:()=>vC,decodeFolderPath:()=>rs,dedupeToolsByName:()=>uv,deepClone:()=>bq,deleteItemFromTree:()=>em,deserializeTypedRecord:()=>mv,deserializeTypedValue:()=>Cl,detectEnvSuggestions:()=>Ep,detectSensitiveData:()=>AP,dispatchGenericTool:()=>Yy,encodeCursor:()=>cv,encodeFolderName:()=>hr,enhanceCollection:()=>sM,enumerateFolders:()=>zr,evaluateExpression:()=>ui,expandSummary:()=>CN,exportCollectionToRestClient:()=>qP,findItemById:()=>Xh,flattenRequests:()=>rt,formatBytes:()=>_q,formatConsoleOutput:()=>Ja,formatDuration:()=>Rq,generateId:()=>It,generateSlug:()=>Rn,generateUUID:()=>Zh,getCompletions:()=>fM,getRestClientExportFolder:()=>EP,getServiceContainer:()=>_C,hasChanged:()=>Vu,isExpression:()=>go,isPlainObject:()=>Sq,isSystemEnvironmentFile:()=>Of,loadEnvironmentsFromFolder:()=>wu,mcpToolSegment:()=>Qo,mcpToolToken:()=>ss,mergeHeadersCaseInsensitive:()=>gu,mergeRequestSettings:()=>tM,normalizeFolderInput:()=>_p,normalizeHeaders:()=>Qm,parseCurlCommand:()=>iM,parseFilterChain:()=>xu,parseMcpToolName:()=>rv,parsePostmanEnvironment:()=>vd,parsePostmanEnvironmentFile:()=>PP,parseQueryContext:()=>cM,prepareBodyForSave:()=>zS,readBodyFromDir:()=>WS,readSchemaFile:()=>GS,readScriptsFromDir:()=>qf,redactBody:()=>ug,redactFullResponse:()=>fg,redactFullResultDetails:()=>dg,redactHeaders:()=>gi,redactHistoryEntry:()=>cg,redactUrl:()=>wd,registerCoreServices:()=>Rp,resolveCollectionRef:()=>Sv,resolveDynamicVariable:()=>Vi,resolveDynamicVariablesInString:()=>kq,resolveFolderRef:()=>wv,resolveFolderToken:()=>nv,resolveRequestRef:()=>_v,resolveResultGrouping:()=>Np,resolveToken:()=>vl,runCollection:()=>ZN,runFolder:()=>XN,runRequest:()=>QN,runSuite:()=>eM,safeJsonParse:()=>wq,sanitizeName:()=>Bt,scanCollectionForEnvVarsWithAi:()=>aM,searchForItemPath:()=>tm,searchForItemPathById:()=>rm,serializeTypedValue:()=>Lc,sortItemsByOrder:()=>KS,writeEnvFile:()=>Ka,writeFolderItems:()=>yd,writeSchemaFiles:()=>YS,writeScriptFile:()=>Zu,writeScriptsToDir:()=>If});module.exports=Ia(k7);var Oa=class{constructor(e,r){this.fileSystem=e;this.parserRegistry=r}fileSystem;parserRegistry;directory;setDirectory(e){this.directory=e}async loadAll(){return this.directory?this.loadDirectory(this.directory):[]}async load(e,r={}){let n=await this.fileSystem.readFile(e);if(r.format){let s=this.parserRegistry.get(r.format);if(!s)throw new Error(`No parser registered for format: ${r.format}`);return s.parse(n,e)}let i=this.parserRegistry.detect(n);if(!i)throw new Error(`Could not detect collection format for: ${e}. Supported formats: ${this.parserRegistry.getFormats().join(", ")}`);return i.parser.parse(n,e)}async loadDirectory(e,r=["*.json","*.forge.json"]){let n=[],i=await this.fileSystem.glob(r,e);for(let s of i)try{let o=await this.load(s);n.push(o)}catch{}return n}async canLoad(e){try{if(!await this.fileSystem.exists(e))return!1;let r=await this.fileSystem.readFile(e);return this.parserRegistry.detect(r)!==null}catch{return!1}}getSupportedFormats(){return this.parserRegistry.getFormats()}};nm();Pa();function QS(t,e){return{id:t.id,name:t.name,description:t.description,variables:t.variables||{},auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(xq),source:{format:"folder",filePath:e,version:t.version}}}function xq(t){if(t.type==="folder")return{type:"folder",id:t.id,name:t.name,description:t.description,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(xq)};let e=t;return{type:"request",id:e.id,name:e.name,description:e.description,method:e.method||"GET",url:e.url||"",headers:e.headers||[],query:e.query||[],params:e.params,body:e.body??void 0,auth:e.auth,settings:e.settings,scripts:e.scripts,...e.deprecated&&{deprecated:e.deprecated},...e.doc&&{doc:e.doc},...e.responseSchema&&{responseSchema:e.responseSchema},...e.bodySchema&&{bodySchema:e.bodySchema},...e.operationId&&{operationId:e.operationId},...e.summary&&{summary:e.summary},...e.tags&&e.tags.length>0&&{tags:e.tags},...e.examples&&e.examples.length>0&&{examples:e.examples},...e.responses&&Object.keys(e.responses).length>0&&{responses:e.responses},...e.security&&e.security.length>0&&{security:e.security}}}function g2(t){return{id:t.id,name:t.name,description:t.description,version:t.source?.version,variables:t.variables,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(ZS)}}function ZS(t){return t.type==="folder"?{type:"folder",id:t.id,name:t.name,description:t.description,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(ZS)}:{type:"request",id:t.id,name:t.name,description:t.description,method:t.method,url:t.url,headers:t.headers,query:t.query,params:t.params,body:t.body,auth:t.auth,settings:t.settings,scripts:t.scripts,...t.deprecated&&{deprecated:t.deprecated},...t.doc&&{doc:t.doc},...t.responseSchema&&{responseSchema:t.responseSchema},...t.bodySchema&&{bodySchema:t.bodySchema},...t.operationId&&{operationId:t.operationId},...t.summary&&{summary:t.summary},...t.tags&&{tags:t.tags},...t.examples&&{examples:t.examples},...t.responses&&{responses:t.responses},...t.security&&{security:t.security}}}var vu=class{store;constructor(e){this.store=new xs(e)}loadAll(){return this.store.loadAll().map(r=>QS(r,this.store.getCollectionPath(r.id)))}getSlugById(e){return this.store.getSlugById(e)}getIdBySlug(e){return this.store.getIdBySlug(e)}load(e){let r=this.store.load(e);if(r)return QS(r,this.store.getCollectionPath(r.id))}async create(e,r){let n=await this.store.create(e,r);return QS(n,this.store.getCollectionPath(n.id))}async save(e){return this.store.save(g2(e))}async delete(e){return this.store.delete(e)}exists(e){return this.store.exists(e)}getCollectionPath(e){return this.store.getCollectionPath(e)}async updateCollectionMetadata(e,r){return this.store.updateCollectionMetadata(e,r)}async saveItem(e,r,n){return this.store.saveItem(e,ZS(r),n)}async updateItem(e,r,n){let i={...n};return this.store.updateItem(e,r,i)}async deleteItem(e,r){return this.store.deleteItem(e,r)}async moveItem(e,r,n){return this.store.moveItem(e,r,n)}async reorderItems(e,r,n){return this.store.reorderItems(e,r,n)}async saveScripts(e,r,n){return this.store.saveScripts(e,r,n)}loadScripts(e,r){return this.store.loadScripts(e,r)}};var bu=class{parsers=new Map;register(e,r){this.parsers.set(e.toLowerCase(),r)}get(e){return this.parsers.get(e.toLowerCase())}has(e){return this.parsers.has(e.toLowerCase())}getFormats(){return Array.from(this.parsers.keys())}detect(e){for(let[r,n]of this.parsers)if(n.canParse(e))return{parser:n,format:r};return null}clear(){this.parsers.clear()}};ka();var Su=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}get(e,r){if(r){let s=this.getCookieKey(e,r),o=this.cookies.get(s);if(o&&!this.isExpired(o))return o}let n=this.getCookieKey(e,"*"),i=this.cookies.get(n);if(i&&!this.isExpired(i))return i;for(let s of this.cookies.values())if(s.name===e&&!this.isExpired(s))if(r&&s.domain){if(this.domainMatches(r,s.domain))return s}else return s}set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e)}setFromResponse(e){for(let r of e){let n=this.getCookieKey(r.name,r.domain,r.path);this.cookies.set(n,r)}}has(e,r){return this.get(e,r)!==void 0}delete(e,r,n){let i=this.getCookieKey(e,r,n);return this.cookies.delete(i)}getAll(e){let r=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&r.push(n):r.push(n));return r}getCookieHeader(e){let r=this.getAll(e);return _t.formatCookieHeader(r)}clear(){this.cookies.clear()}clearDomain(e){let r=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&r.push(n);for(let n of r)this.cookies.delete(n)}parseCookieHeaders(e,r){return _t.parseCookieHeaders(e,r)}isExpired(e){return _t.isExpired(e)}domainMatches(e,r){return _t.domainMatches(e,r)}get count(){return this.cookies.size}cleanExpiredCookies(){let e=[];for(let[r,n]of this.cookies.entries())this.isExpired(n)&&e.push(r);for(let r of e)this.cookies.delete(r)}};sm();var Bi=class t{config;selectedEnvironment;sessionGlobals={};sessionEnvironmentValues=new Map;constructor(e){this.config=e,this.selectedEnvironment=e.selectedEnvironment||Object.keys(e.environments)[0]||"default"}get(e){return this.getVariables()[e]}set(e,r){let n=this.sessionEnvironmentValues.get(this.selectedEnvironment);n||(n={},this.sessionEnvironmentValues.set(this.selectedEnvironment,n)),n[e]=r}getAll(){return this.getVariables()}getEnvironments(){return Object.keys(this.config.environments)}getActive(){return this.selectedEnvironment}setActive(e){if(!this.config.environments[e])throw new Error(`Environment not found: ${e}`);this.selectedEnvironment=e}getVariables(e){let r=e||this.selectedEnvironment,n=this.config.environments[r],i={...this.config.globalVariables||{},...this.sessionGlobals};if(n){if(n.inherits&&this.config.environments[n.inherits]){let o=this.getEnvironmentVariables(n.inherits);i={...i,...o}}i={...i,...n.variables};let s=this.sessionEnvironmentValues.get(r);s&&(i={...i,...s})}return i}getEnvironmentVariables(e){let r=this.config.environments[e];if(!r)return{};let n={};return r.inherits&&this.config.environments[r.inherits]&&(n={...this.getEnvironmentVariables(r.inherits)}),{...n,...r.variables}}getGlobals(){return{...this.config.globalVariables||{},...this.sessionGlobals}}setGlobal(e,r){this.sessionGlobals[e]=r}unsetGlobal(e){delete this.sessionGlobals[e]}clearGlobals(){this.sessionGlobals={}}resolve(e){let r=e||this.selectedEnvironment;return{name:r,merged:this.getVariables(r),globals:this.getGlobals()}}static fromVariables(e,r="default"){return new t({environments:{[r]:{name:r,variables:e}},selectedEnvironment:r})}};_u();Af();var Cs=class t{envStore;interpolator;urlBuilder;constructor(e,r){this.envStore=e,this.interpolator=r||new vo,this.urlBuilder=new Hn}get(e){return this.envStore.get(e)}set(e,r){this.envStore.set(e,r)}has(e){return this.envStore.get(e)!==void 0}delete(e){this.envStore.set(e,"")}getAll(){return this.envStore.getAll()}getActiveEnvironment(){return this.envStore.getActive()}setActiveEnvironment(e){this.envStore.setActive(e)}getEnvironments(){let e=this.envStore;return typeof e.getEnvironments=="function"?e.getEnvironments():[]}getGlobals(){let e=this.envStore;return typeof e.getGlobals=="function"?e.getGlobals():{}}setGlobal(e,r){let n=this.envStore;typeof n.setGlobal=="function"&&n.setGlobal(e,r)}unsetGlobal(e){let r=this.envStore;typeof r.unsetGlobal=="function"&&r.unsetGlobal(e)}clearGlobals(){let e=this.envStore;typeof e.clearGlobals=="function"&&e.clearGlobals()}resolve(e){return this.interpolator.interpolate(e,this.getAll())}resolvePath(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r)}buildUrl(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r.params||{},r.query||{})}resolveObject(e){return this.interpolator.interpolateObject(e,this.getAll())}extractVariables(e){return this.interpolator.extractVariables(e)}extractPathParams(e){return this.urlBuilder.extractPathParams(e)}static create(e={}){let r=Bi.fromVariables(e);return new t(r)}static fromResolver(e){return new t(e)}};Af();Tf();$f();_u();md();hd();var Ga=class{constructor(e,r,n,i,s){this.httpClient=e;this.forgeEnv=r;this.cookieJar=n;this.preprocessor=i;if(s?.scriptExecutor)this.scriptExecutor=s.scriptExecutor;else{let o=s?.forgeRoot?[require("path").join(s.forgeRoot,"modules")]:[],l=new Wi(new Hn,new zi,e);this.scriptExecutor=new Ki(l,o,void 0,s?.scriptScope??"shared",s?.scriptTimeout??5e3)}}httpClient;forgeEnv;cookieJar;preprocessor;scriptExecutor;async execute(e,r,n={}){let i=Date.now(),s={...this.forgeEnv.getAll()},o={...this.forgeEnv.getGlobals()},l={...n.additionalVariables||{}},c={...s},d=this.buildHttpRequest(e,n.overrides),p=n.overrides?.body||e.body,m=this.findFolderPath(r,e.id),y=this.buildScriptChain(e,r,m),b={request:{url:d.url,method:d.method,headers:{...d.headers},body:p?typeof p=="string"?{type:"raw",content:p}:p:void 0},variables:l,collectionVariables:r.variables||{},globals:{...o},environmentVariables:c,environmentName:this.forgeEnv.getActiveEnvironment?.()||void 0,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:r?.name},onEnvironmentChange:n.onEnvironmentChange,onGlobalsChange:(R,E,k)=>{R==="set"&&E&&k!==void 0?this.forgeEnv.setGlobal(E,k):R==="unset"&&E?this.forgeEnv.unsetGlobal(E):R==="clear"&&this.forgeEnv.clearGlobals()}},q=this.scriptExecutor.createRequestSession(b),x,v;try{if(!n.skipPreRequest&&y.preRequest.length>0){let P=await q.executePreRequest(y.preRequest);if(x={success:P.success,error:P.error,modifiedVariables:P.modifiedVariables,modifiedEnvironment:P.modifiedEnvironmentVariables,modifiedGlobals:P.modifiedGlobals,modifiedCollectionVariables:P.modifiedCollectionVariables,consoleOutput:P.consoleOutput,modifiedRequest:P.modifiedRequest?{url:P.modifiedRequest.url,method:P.modifiedRequest.method,headers:P.modifiedRequest.headers,body:P.modifiedRequest.body?.content}:void 0},P.modifiedVariables&&(l={...l,...P.localVariables??P.modifiedVariables}),P.modifiedEnvironmentVariables&&(c={...c,...P.modifiedEnvironmentVariables}),P.modifiedRequest){let M=P.modifiedRequest;M.url&&(d.url=M.url),M.method&&(d.method=M.method),M.headers&&(d.headers={...d.headers,...M.headers}),M.body!==void 0&&(d.body=M.body?.content||M.body)}if(!P.success)throw new Error(`Pre-request script failed: ${P.error}`)}let R={...c,...l};d=this.interpolateRequest(d,R);let E=n.overrides?.body||e.body;if(this.preprocessor&&E&&typeof E!="string"&&E.type==="graphql"&&d.body!==void 0){let P=this.preprocessor.encodeBody({type:"graphql",content:d.body});P!=null&&(d.body=typeof P=="string"?P:JSON.stringify(P))}if(p&&typeof p=="object"&&p.type==="form-data"&&Array.isArray(d.body)){let P=this.buildMultipartFormData({type:"form-data",content:d.body});P&&(d.body=P)}let k=await this.httpClient.send(d);if(!n.skipPostResponse&&y.postResponse.length>0){let P=await q.executePostResponse(y.postResponse,{status:k.status,statusText:k.statusText,headers:k.headers,body:k.body,cookies:Zm(k.headers,k.cookies,d.url),responseTime:k.time,responseSize:k.size,executedRequest:{url:d.url,method:d.method,headers:d.headers||{},body:d.body?typeof d.body=="string"?{type:"raw",content:d.body}:d.body:{type:"none",content:""},params:{},query:{}}});v={success:!0,assertions:P.testResults,consoleOutput:P.consoleOutput,modifiedEnvironment:P.modifiedEnvironmentVariables},P.modifiedEnvironmentVariables&&(c={...c,...P.modifiedEnvironmentVariables})}return{response:k,preRequestResult:x,postResponseResult:v,totalTime:Date.now()-i,finalRequest:d,variables:{environment:c,local:l}}}finally{q.dispose?.()}}async executeSimple(e,r={}){let n=e,i={...this.forgeEnv.getAll(),...r.variables||{}};return n=this.interpolateRequest(e,i),r.timeout&&(n={...n,timeout:r.timeout}),this.httpClient.send(n)}buildHttpRequest(e,r){let n=e.url;if(e.query&&e.query.length>0){let p=new URLSearchParams;for(let m of e.query)m.enabled!==!1&&p.append(m.key,m.value);n+=(n.includes("?")?"&":"?")+p.toString()}let i=r?.url||n,s=r?.method||e.method,o={};if(e.headers&&Array.isArray(e.headers))for(let p of e.headers)p.enabled!==!1&&(o[p.key]=p.value);let l={...o,...r?.headers||{}},c,d=r?.body||e.body;if(d)if(typeof d=="string")c=d;else if(this.preprocessor&&d.type)if(d.type==="graphql")c=typeof d.content=="string"?d.content:JSON.stringify(d.content);else if(d.type==="form-data")c=this.buildMultipartFormData(d);else{let p=this.preprocessor.encodeBody(d);c=p!=null?String(p):void 0}else d.content&&(c=typeof d.content=="string"?d.content:JSON.stringify(d.content));return this.preprocessor&&d&&d.type!=="form-data"&&this.preprocessor.setContentTypeHeader(l,d),{url:i,method:s,headers:l,body:c,timeout:r?.timeout||e.settings?.timeout,settings:{...e.settings,...r?.settings}}}interpolateRequest(e,r){let n=Cs.create(r),i=e.body,s=i;return typeof i=="string"?s=n.resolve(i):i instanceof FormData||i instanceof URLSearchParams?s=i:i&&typeof i=="object"&&(s=n.resolve(i)),{...e,url:n.resolvePath(e.url),headers:n.resolveObject(e.headers),body:s}}buildMultipartFormData(e){if(!e||e.type!=="form-data"||!Array.isArray(e.content))return;let r=new FormData;for(let n of e.content)!n?.key||n.enabled===!1||r.append(n.key,n.value==null?"":String(n.value));return r}buildScriptChain(e,r,n=[]){let i=[],s=[];r.scripts?.preRequest&&i.push(r.scripts.preRequest),r.scripts?.postResponse&&s.push(r.scripts.postResponse);for(let o of n)o.scripts?.preRequest&&i.push(o.scripts.preRequest),o.scripts?.postResponse&&s.push(o.scripts.postResponse);return e.scripts?.preRequest&&i.push(e.scripts.preRequest),e.scripts?.postResponse&&s.push(e.scripts.postResponse),{preRequest:i,postResponse:s}}findFolderPath(e,r){let n=[],i=(s,o)=>{for(let l of s){if(l.type==="request"&&l.id===r)return n.push(...o),!0;if(l.type==="folder"){let c=[...o,l];if(i(l.items,c))return!0}}return!1};return i(e.items,[]),n}};function Dz(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}var zu=class{entries=new Map;requestIndex=new Map;fullResponses=new Map;maxEntriesPerRequest;storeFullResponses;constructor(e={}){this.maxEntriesPerRequest=e.maxEntriesPerRequest??100,this.storeFullResponses=e.storeFullResponses??!0}getEntries(e,r){let n=this.requestIndex.get(e)||[],i=[];for(let s of n){let o=this.entries.get(s);o&&(!r||o.environment===r)&&i.push(o)}return i}getEntry(e){return this.entries.get(e)}getFullResponse(e){return this.fullResponses.get(e)}get count(){return this.entries.size}addEntry(e,r,n,i,s){let o=Dz(),l=Date.now(),c={id:o,timestamp:l,environment:i,method:r.method,ticket:s?.ticket,branch:s?.branch,note:s?.note,sentRequest:{url:r.url,method:r.method,headers:{...r.headers},body:r.body},response:{status:n.status,statusText:n.statusText,time:n.time}};this.entries.set(o,c);let d=this.requestIndex.get(e)||[];for(d.unshift(o);d.length>this.maxEntriesPerRequest;){let p=d.pop();p&&(this.entries.delete(p),this.fullResponses.delete(p))}if(this.requestIndex.set(e,d),this.storeFullResponses){let p={timestamp:l,status:n.status,statusText:n.statusText,headers:{...n.headers},cookies:n.cookies||[],body:n.body,time:n.time};this.fullResponses.set(o,p)}return c}deleteEntry(e){if(!this.entries.get(e))return!1;this.entries.delete(e),this.fullResponses.delete(e);for(let[n,i]of this.requestIndex.entries()){let s=i.indexOf(e);if(s!==-1){i.splice(s,1),i.length===0&&this.requestIndex.delete(n);break}}return!0}clearHistory(e){let r=this.requestIndex.get(e);if(r){for(let n of r)this.entries.delete(n),this.fullResponses.delete(n);this.requestIndex.delete(e)}}clearAll(){this.entries.clear(),this.requestIndex.clear(),this.fullResponses.clear()}};var Ju=class{async send(e){let r=Date.now(),n=new AbortController,i=e.timeout??3e4,s=setTimeout(()=>n.abort(),i);try{let o={method:e.method,headers:e.headers,signal:n.signal};e.body!==void 0&&!["GET","HEAD"].includes(e.method.toUpperCase())&&(typeof e.body=="string"||e.body instanceof FormData||e.body instanceof URLSearchParams?o.body=e.body:typeof e.body=="object"&&(o.body=JSON.stringify(e.body),!e.headers?.["Content-Type"]&&!e.headers?.["content-type"]&&(o.headers["Content-Type"]="application/json"))),e.settings?.followRedirects===!1&&(o.redirect="manual");let l=await fetch(e.url,o),c=Date.now(),d;try{d=await l.text()}catch{d=null}let p={};return l.headers.forEach((m,y)=>{let b=p[y];b!==void 0?p[y]=Array.isArray(b)?[...b,m]:[b,m]:p[y]=m}),{status:l.status,statusText:l.statusText,headers:p,cookies:[],body:d,time:c-r}}catch(o){throw o.name==="AbortError"?new Error(`Request timeout after ${i}ms`):o}finally{clearTimeout(s)}}};Tf();$f();gd();tg();_u();var Io=class{format="http-forge";canParse(e){try{let r=JSON.parse(e);return typeof r=="object"&&r!==null&&"id"in r&&"name"in r&&"items"in r&&Array.isArray(r.items)&&!r.info?.schema?.includes("postman")&&!r._type}catch{return!1}}parse(e,r){let n=JSON.parse(e);return{id:n.id,name:n.name,description:n.description,variables:n.variables||{},auth:n.auth,scripts:n.scripts?{preRequest:n.scripts.preRequest,postResponse:n.scripts.postResponse}:void 0,items:this.convertItems(n.items),source:{format:"http-forge",filePath:r,version:n.version}}}convertItems(e){return e.map(r=>r.type==="folder"?this.convertFolder(r):this.convertRequest(r))}convertFolder(e){return{type:"folder",id:e.id,name:e.name,description:e.description,auth:e.auth,scripts:e.scripts?{preRequest:e.scripts.preRequest,postResponse:e.scripts.postResponse}:void 0,items:e.items?this.convertItems(e.items):[]}}convertRequest(e){let r={};if(e.headers)for(let i of e.headers)i.enabled!==!1&&(r[i.key]=i.value);let n={};if(e.query)for(let i of e.query)i.enabled!==!1&&(n[i.key]=i.value);return{type:"request",id:e.id,name:e.name,description:e.description,method:e.method||"GET",url:e.url||"",headers:Object.entries(r).map(([i,s])=>({key:i,value:s,enabled:!0})),query:Object.entries(n).map(([i,s])=>({key:i,value:s,enabled:!0})),params:e.params,body:e.body,auth:e.auth,settings:e.settings,scripts:e.scripts?{preRequest:e.scripts.preRequest,postResponse:e.scripts.postResponse}:void 0}}};rg();var xn=ve(require("fs/promises")),Yu=ve(require("path")),Gu=class{async readFile(e){return xn.readFile(e,"utf-8")}async writeFile(e,r){let n=Yu.dirname(e);await this.mkdir(n),await xn.writeFile(e,r,"utf-8")}async exists(e){try{return await xn.access(e),!0}catch{return!1}}async mkdir(e){await xn.mkdir(e,{recursive:!0})}async glob(e,r){let n=r||process.cwd(),i=[];try{await this.walkDirectory(n,s=>{let o=Yu.basename(s);for(let l of e)if(this.matchPattern(o,l)){i.push(s);break}})}catch{}return i}async readDir(e){return xn.readdir(e)}async isDirectory(e){try{return(await xn.stat(e)).isDirectory()}catch{return!1}}async walkDirectory(e,r){let n=await xn.readdir(e,{withFileTypes:!0});for(let i of n){let s=Yu.join(e,i.name);i.isDirectory()?await this.walkDirectory(s,r):i.isFile()&&r(s)}}matchPattern(e,r){let n=r.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp(`^${n}$`,"i").test(e)}};md();var ng=class t{httpClient;fileSystem;scriptExecutor;interpolator;cookieJar;interceptorChain;preprocessor;dataFileParser;requestHistory;parserRegistry;collectionLoader;environmentStore;forgeEnv;requestExecutor;options;constructor(e={}){if(this.options=e,this.interpolator=e.interpolator||new vo,this.fileSystem=e.fileSystem||new Gu,this.preprocessor=e.preprocessor||new qo,this.dataFileParser=e.dataFileParser||new Oo,this.cookieJar=e.cookieJar||new Su,e.enableHistory?this.requestHistory=e.requestHistory||new zu({maxEntriesPerRequest:e.maxHistoryEntries??100}):this.requestHistory=null,this.interceptorChain=e.interceptorChain||this.createInterceptorChain(e),e.httpClient)this.httpClient=e.httpClient;else if(e.useNativeHttp!==!1){let s={...e.httpSettings,timeout:e.requestTimeout??e.httpSettings?.timeout};this.httpClient=new Eo(s)}else this.httpClient=new Ju;let r=e.forgeRoot?[require("path").join(e.forgeRoot,"modules")]:[],n=new Wi(new Hn,this.interceptorChain,this.httpClient);if(this.scriptExecutor=e.scriptExecutor||new Ki(n,r,void 0,e.scriptScope??"shared",e.scriptTimeout??5e3),this.parserRegistry=new bu,this.parserRegistry.register("http-forge",new Io),(e.storageFormat??"folder")==="folder"&&e.forgeRoot){let s=require("path").join(e.forgeRoot,"collections");this.collectionLoader=new vu(s)}else this.collectionLoader=new Oa(this.fileSystem,this.parserRegistry);this.environmentStore=e.environmentConfig?new Bi(e.environmentConfig):Bi.fromVariables({}),this.forgeEnv=Cs.fromResolver(this.environmentStore),this.requestExecutor=new Ga(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:e.forgeRoot,scriptExecutor:this.scriptExecutor})}createInterceptorChain(e){let r=new zi;if(e.requestInterceptors)for(let n of e.requestInterceptors)r.addRequestInterceptor(n);if(e.responseInterceptors)for(let n of e.responseInterceptors)r.addResponseInterceptor(n);if(e.errorInterceptors)for(let n of e.errorInterceptors)r.addErrorInterceptor(n);return r}async loadCollection(e){if(this.collectionLoader instanceof Oa)return this.collectionLoader.load(e);throw new Error("loadCollection(filePath) is not supported with folder storage format. Use loadAllCollections() instead.")}async loadAllCollections(){return this.collectionLoader.loadAll()}async execute(e,r,n){return this.requestExecutor.execute(e,r,n)}async executeSimple(e,r){return this.requestExecutor.executeSimple(e,r)}registerParser(e,r){this.parserRegistry.register(e,r)}setEnvironmentConfig(e){this.environmentStore=new Bi(e),this.forgeEnv=Cs.fromResolver(this.environmentStore),this.requestExecutor=new Ga(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:this.options.forgeRoot,scriptExecutor:this.scriptExecutor})}static create(e){return new t(e)}static fromForgeRoot(e="./http-forge",r={}){let n=require("path"),i=n.join(e,"environments"),s,o=wu(i);if(Object.keys(o.environments).length>0||Object.keys(o.globalVariables).length>0){s={globalVariables:{...o.globalVariables,...o.localVariables},environments:{},selectedEnvironment:void 0};for(let[c,d]of Object.entries(o.environments)){let p=o.localCredentials[c]?.variables||{};s.environments[c]={name:c,variables:{...d.variables,...p}}}}else{let c=require("fs"),d=n.join(i,"environments.json");if(c.existsSync(d))try{let p=c.readFileSync(d,"utf-8"),m=JSON.parse(p);if(s={globalVariables:m.globalVariables||{},environments:{},selectedEnvironment:m.selectedEnvironment},m.environments)for(let[y,b]of Object.entries(m.environments)){let q=b;s.environments[y]={name:q.name||y,variables:q.variables||{}}}}catch(p){console.warn(`[ForgeContainer] Failed to load environments from ${d}:`,p)}}return new t({...r,forgeRoot:e,storageFormat:r.storageFormat??"folder",environmentConfig:s})}};wC();RC();Wy();Ii();EC();qC();IC();OC();lv();kp();PC();async function KN(t){let{createMcpRuntime:e}=await Promise.resolve().then(()=>(YN(),GN));return e(t)}async function QN(t){let{runRequest:e}=await Promise.resolve().then(()=>(Uc(),jp));return e(t)}async function ZN(t){let{runCollection:e}=await Promise.resolve().then(()=>(Uc(),jp));return e(t)}async function XN(t){let{runFolder:e}=await Promise.resolve().then(()=>(Uc(),jp));return e(t)}async function eM(t){let{runSuite:e}=await Promise.resolve().then(()=>(Uc(),jp));return e(t)}bv();n_();ka();kC();i_();Tf();$f();gd();function tM(t){return{timeout:t?.timeout??ln.timeout,followRedirects:t?.followRedirects??ln.followRedirects,followOriginalMethod:t?.followOriginalMethod??ln.followOriginalMethod,followAuthHeader:t?.followAuthHeader??ln.followAuthHeader,maxRedirects:t?.maxRedirects??ln.maxRedirects,strictSSL:t?.strictSSL??ln.strictSSL,decompress:t?.decompress??ln.decompress,includeCookies:t?.includeCookies??ln.includeCookies,tls:t?.tls??ln.tls,certificates:t?.certificates??ln.certificates}}gd();tg();_u();B0();W0();md();Ym();hd();_d();X0();t_();nm();Pa();Pa();Z0();function l7(t){let e=t.replace(/\\\n/g," "),r=[],n="",i=0;for(;i<e.length;){let s=e[i];if(s==="\\"&&i+1<e.length)n+=e[++i],i++;else if(s==="'"){for(i++;i<e.length&&e[i]!=="'";)n+=e[i++];i++}else if(s==='"'){for(i++;i<e.length&&e[i]!=='"';)if(e[i]==="\\"&&i+1<e.length){let o=e[i+1];o==='"'||o==="\\"||o==="$"||o==="`"?(n+=o,i+=2):n+=e[i++]}else n+=e[i++];i++}else/\s/.test(s)?(n.length>0&&(r.push(n),n=""),i++):(n+=s,i++)}return n.length>0&&r.push(n),r}function u7(t){try{let e="__FV__",r=[],n=t.replace(/\{\{[^}]+\}\}/g,p=>(r.push(p),`${e}${r.length-1}`)),i=n.indexOf("?");if(i===-1)return{cleanUrl:t,params:[]};let s=n.slice(0,i),o=n.slice(i+1),l=p=>p.replace(new RegExp(`${e}(\\d+)`,"g"),(m,y)=>r[parseInt(y,10)]),c=l(s),d=o.split("&").filter(Boolean).map(p=>{let m=l(p),y=m.indexOf("=");return y===-1?{key:m,value:"",enabled:!0}:{key:decodeURIComponent(m.slice(0,y)),value:decodeURIComponent(m.slice(y+1)),enabled:!0}});return{cleanUrl:c,params:d}}catch{return{cleanUrl:t,params:[]}}}function c7(t){try{let e=new URL(t.replace(/\{\{[^}]+\}\}/g,"placeholder")),r=e.pathname.split("/").filter(Boolean),n=r[r.length-1];return n&&!/^\d+$/.test(n)&&!n.startsWith("{")?n.replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase()):r.length>1?r[r.length-2].replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase()):e.hostname.replace(/^www\./,"").split(".")[0]??"Request"}catch{return"Request"}}var f7=new Set(["x-api-key","x-auth-token","x-access-token","x-token","x-secret","api-key","apikey","x-client-secret","x-rapidapi-key"]),d7=new Set(["api_key","apikey","api-key","access_token","token","auth_token","client_id","client_secret","key","secret"]);function rM(t){return t.toUpperCase().replace(/[^A-Z0-9]/g,"_")}function nM(t){return/\{\{[^}]+\}\}/.test(t)}function Cv(t,e=16){return t.length>=e&&!nM(t)}function p7(t,e,r){let n=[],i=new Set,s=(o,l)=>{i.has(l)||(i.add(l),n.push({key:o,value:l}))};for(let o of t){let l=o.key.toLowerCase();if(l==="authorization"){let c=o.value.match(/^(bearer|basic|token|digest)\s+(.+)$/i);c&&Cv(c[2])?s(`${c[1].toUpperCase()}_TOKEN`,c[2]):Cv(o.value)&&s("AUTH_TOKEN",o.value)}else f7.has(l)&&Cv(o.value)&&s(rM(o.key),o.value)}for(let o of e)d7.has(o.key.toLowerCase())&&Cv(o.value)&&s(rM(o.key),o.value);try{let o=new URL(r.replace(/\{\{[^}]+\}\}/g,"placeholder"));if(!["localhost","127.0.0.1","0.0.0.0","::1"].includes(o.hostname)&&!nM(r)){let c=`${o.protocol}//${o.host}`;s("BASE_URL",c)}}catch{}return n}function iM(t){let e=l7(t.trim()),r=0;for(;r<e.length&&e[r].toLowerCase()==="curl";)r++;let n=e.slice(r),i="",s="",o=[],l=null,c=!1,d=!1,p=[],m=[],y=0;for(;y<n.length;){let E=n[y];if(E==="-X"||E==="--request")i=n[++y]??"";else if(E==="-H"||E==="--header"){let k=n[++y]??"",P=k.indexOf(":");P>0&&o.push({key:k.slice(0,P).trim(),value:k.slice(P+1).trim()})}else if(E==="-d"||E==="--data"||E==="--data-raw"||E==="--data-binary"||E==="--data-ascii")l=n[++y]??"";else if(E==="--json")l=n[++y]??"",c=!0;else if(E==="-u"||E==="--user"){let k=n[++y]??"",P=btoa(k);o.push({key:"Authorization",value:`Basic ${P}`})}else if(E==="-b"||E==="--cookie")o.push({key:"Cookie",value:n[++y]??""});else if(E==="--url")s=n[++y]??"";else if(E==="-G"||E==="--get")d=!0;else if(E==="-F"||E==="--form"){let k=n[++y]??"",P=k.indexOf("=");P>0&&p.push({key:k.slice(0,P),value:k.slice(P+1)})}else E==="--data-urlencode"?m.push(n[++y]??""):E==="-A"||E==="--user-agent"?o.push({key:"User-Agent",value:n[++y]??""}):E==="-e"||E==="--referer"||E==="--referrer"?o.push({key:"Referer",value:n[++y]??""}):E==="--compressed"||E==="-L"||E==="--location"||E==="-v"||E==="--verbose"||E==="-s"||E==="--silent"||E==="-i"||E==="--include"||E==="-k"||E==="--insecure"||E==="--http1.1"||E==="--http2"||E==="--http3"||(E==="-o"||E==="--output"||E==="--max-time"||E==="--connect-timeout"||E==="-m"||E==="--limit-rate"||E==="--proxy"||E==="-x"?y++:!E.startsWith("-")&&!s&&(s=E));y++}d?i="GET":i||(i=l!==null||p.length>0||m.length>0?"POST":"GET");let{cleanUrl:b,params:q}=u7(s),x=null;if(p.length>0)x={type:"raw",format:"text",content:p.map(k=>`${encodeURIComponent(k.key)}=${encodeURIComponent(k.value)}`).join("&")},o.some(k=>k.key.toLowerCase()==="content-type")||o.push({key:"Content-Type",value:"multipart/form-data"});else if(m.length>0)x={type:"raw",format:"text",content:m.join("&")},o.some(E=>E.key.toLowerCase()==="content-type")||o.push({key:"Content-Type",value:"application/x-www-form-urlencoded"});else if(l!==null){let E=l.trim(),k=c||E.startsWith("{")||E.startsWith("[");x={type:"raw",format:k?"json":"text",content:l},k&&!o.some(P=>P.key.toLowerCase()==="content-type")&&o.push({key:"Content-Type",value:"application/json"})}let v=o.map(E=>({...E,enabled:!0})),R=p7(o,q,b||s);return{name:c7(b||s),method:i.toUpperCase(),url:b||s,headers:v,queryParams:q,body:x,suggestedVars:R}}async function sM(t,e,r,n){let i=oM(t.items);if(i.length===0)return;let s=Math.ceil(i.length/10);for(let o=0;o<i.length;o+=10){let l=i.slice(o,o+10),c=Math.floor(o/10)+1;n?.(`Enhancing requests (batch ${c}/${s})\u2026`,1/s*100);let d=l.map(p=>({id:p.id,name:p.name,method:p.method??"GET",url:p.url??"",bodyContent:y7(p),responseSchema:p.responseSchema?JSON.stringify(p.responseSchema).slice(0,500):void 0,description:p.description?.slice(0,200)}));try{let p=await r.complete(h7(d)),m=m7(p);g7(l,m)}catch{}}await e.saveCollection(t)}function h7(t){return`You are an API testing expert. For each HTTP request below, return two improvements:
|
|
1022
1022
|
1. "body" \u2014 a realistic, human-readable JSON request body string (not schema placeholders like "string" or 0). If the request has no body or is a GET/HEAD/DELETE, return null.
|
|
1023
1023
|
2. "testScript" \u2014 a JavaScript postResponse test using pm.test() syntax. Always include a status code check. Add response body assertions if a responseSchema is provided.
|
|
1024
1024
|
|