@http-forge/core 0.6.16 → 0.6.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- var Rj=Object.create;var _h=Object.defineProperty;var Cj=Object.getOwnPropertyDescriptor;var xj=Object.getOwnPropertyNames;var Ej=Object.getPrototypeOf,Ij=Object.prototype.hasOwnProperty;var ft=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var se=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var H=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Ws=(t,e)=>{for(var r in e)_h(t,r,{get:e[r],enumerable:!0})},XE=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of xj(e))!Ij.call(t,i)&&i!==r&&_h(t,i,{get:()=>e[i],enumerable:!(n=Cj(e,i))||n.enumerable});return t};var Hc=(t,e,r)=>(r=t!=null?Rj(Ej(t)):{},XE(e||!t||!t.__esModule?_h(r,"default",{value:t,enumerable:!0}):r,t)),Vl=t=>XE(_h({},"__esModule",{value:!0}),t);function At(t){return t.replace(/[^a-zA-Z0-9-_]/g,"_").replace(/\s+/g,"-").toLowerCase().substring(0,100)}function St(t){let e=Date.now().toString(36)+(Oj++).toString(36)+Math.random().toString(36).slice(2,7);return t?`${At(t)}_${e}`:e}function Kb(){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 Bc(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 qj(t){return JSON.parse(JSON.stringify(t))}function kj(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Pj(t,e){try{return JSON.parse(t)}catch{return e}}function Tj(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 Aj(t){return t<1e3?`${t} ms`:`${(t/1e3).toFixed(2)} s`}var Oj,xn=se(()=>{"use strict";Oj=0});import*as at from"fs";import*as un from"path";function Ch(t){if(!at.existsSync(t))return;let e={},r=un.join(t,Rh.preRequest);at.existsSync(r)&&(e.preRequest=at.readFileSync(r,"utf-8"));let n=un.join(t,Rh.postResponse);return at.existsSync(n)&&(e.postResponse=at.readFileSync(n,"utf-8")),Object.keys(e).length>0?e:void 0}async function xh(t,e){await at.promises.mkdir(t,{recursive:!0});let r=un.join(t,Rh.preRequest);e.preRequest?await at.promises.writeFile(r,e.preRequest,"utf-8"):at.existsSync(r)&&await at.promises.unlink(r);let n=un.join(t,Rh.postResponse);e.postResponse?await at.promises.writeFile(n,e.postResponse,"utf-8"):at.existsSync(n)&&await at.promises.unlink(n)}function tI(t){for(let[e,r]of Object.entries(eI)){let n=un.join(t,e);if(at.existsSync(n))try{let i=at.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 rI(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 nI(t,e){for(let r of Object.keys(eI))if(r!==e){let n=un.join(t,r);if(at.existsSync(n))try{await at.promises.unlink(n)}catch{}}}function iI(t){if(at.existsSync(t))try{let e=at.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){console.error(`[FolderIO] Failed to load schema file ${t}:`,e);return}}async function sI(t,e,r){let n=un.join(t,Vc.responseSchema),i=un.join(t,Vc.bodySchema);e?await at.promises.writeFile(n,JSON.stringify(e,null,2),"utf-8"):at.existsSync(n)&&await at.promises.unlink(n),r?await at.promises.writeFile(i,JSON.stringify(r,null,2),"utf-8"):at.existsSync(i)&&await at.promises.unlink(i)}function Qb(t,e){for(let r of t){if(r.id===e)return r;if(r.type==="folder"&&r.items){let n=Qb(r.items,e);if(n)return n}}}function Zb(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&&Zb(n.items,e))return!0}return!1}function oI(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 Xb(t,e){let r;try{r=at.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===cn)continue;if(n.name===e)return un.join(t,n.name);let i=Xb(un.join(t,n.name),e);if(i)return i}}function $j(t){for(let e of[Pr.request,Pr.folder]){let r=un.join(t,e);if(at.existsSync(r))try{let n=at.readFileSync(r,"utf-8");return JSON.parse(n).id}catch{return}}}function eS(t,e){let r;try{r=at.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===cn)continue;let i=un.join(t,n.name);if($j(i)===e)return i;let s=eS(i,e);if(s)return s}}function En(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 g of s){let v=parseInt(g.substring(1));v>o&&(o=v)}let l="";if(o>0)l=`t${o}`;else{let g=r.match(/[_\s-](\d+\.\d+)[_\s-]/);g&&(l=`v${g[1].replace(".","_")}`)}let f=r;n&&(f=f.substring(n[0].length)),f=f.replace(/[_\s-]?t\d+(?:\.\d+)?[_\s-]?/gi,"-"),f=f.replace(/[_\s-]?\d+\.\d+[_\s-]?/g,"-"),f=f.replace(/\([^)]+\)/g,""),f=f.replace(/:[a-z_][a-z0-9_]*/gi,""),f=f.replace(/\{[^}]+\}/g,""),f=f.replace(/\?$/g,"").replace(/[_/\\ ]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"");let c=f.split("-").filter(g=>g.length>0),p=[];i&&p.push(i),p.push(...c),l&&p.push(l);let h=p.join("-");if(h||(h="item"),e.includes(h)){let g=2;for(;e.includes(`${h}-${g}`);)g++;h=`${h}-${g}`}return h}var Rh,Pr,eI,Vc,cn,sa=se(()=>{"use strict";Rh={preRequest:"pre-request.js",postResponse:"post-response.js"},Pr={collection:"collection.json",folder:"folder.json",request:"request.json"},eI={"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"}},Vc={responseSchema:"response.schema.json",bodySchema:"body.schema.json"},cn="scripts"});import*as Ie from"fs";import*as Te from"path";var zs,Eh=se(()=>{"use strict";xn();sa();zs=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(){Ie.existsSync(this.collectionsDir)||Ie.mkdirSync(this.collectionsDir,{recursive:!0})}readJsonFileSafe(e,r){let n;try{n=Ie.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(),!Ie.existsSync(this.collectionsDir))return[];let e=Ie.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=Te.join(this.collectionsDir,e),n=Te.join(r,Pr.collection);if(!Ie.existsSync(n))return;let i=this.readJsonFileSafe(n,"collection");if(i)try{let s=this.loadScriptsFromDir(Te.join(r,cn)),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=Ie.readdirSync(e,{withFileTypes:!0});for(let l of o){if(!l.isDirectory()||l.name===cn)continue;let f=Te.join(e,l.name);if(Ie.existsSync(Te.join(f,Pr.folder))){let c=this.loadFolderFromDir(f,l.name);c&&s.set(l.name,c)}else if(Ie.existsSync(Te.join(f,Pr.request))){let c=this.loadRequestFromDir(f,l.name);c&&s.set(l.name,c)}}if(n&&n.length>0){for(let l of n){let f=s.get(l);f&&(i.push(f),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=Te.join(e,Pr.folder),i=this.readJsonFileSafe(n,"folder");if(i)try{let s=this.loadScriptsFromDir(Te.join(e,cn)),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=Te.join(e,Pr.request),i=this.readJsonFileSafe(n,"request");if(i)try{let s=this.loadScriptsFromDir(Te.join(e,cn)),o=i.body,l=this.loadBodyFromDir(e);l&&(o=l);let f=this.loadSchemaFile(Te.join(e,Vc.responseSchema)),c=this.loadSchemaFile(Te.join(e,Vc.bodySchema)),p=Te.join(e,"doc.md"),h=Ie.existsSync(p)?Ie.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,auth:i.auth,settings:i.settings,scripts:s,deprecated:i.deprecated,operationId:i.operationId,summary:i.summary,tags:i.tags,examples:i.examples,responses:i.responses,security:i.security,...h&&{doc:h},...f&&{responseSchema:f},...c&&{bodySchema:c}}}catch(s){console.error(`[FolderCollectionStore] Failed to load request ${e}:`,s);return}}loadScriptsFromDir(e){return Ch(e)}loadBodyFromDir(e){return tI(e)}loadSchemaFile(e){return iI(e)}async saveSchemaFiles(e,r){return sI(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=St(e.name));let r=this.idToSlugMap.get(e.id);if(!r){let l=Ie.readdirSync(this.collectionsDir);r=En(e.name,l),this.idToSlugMap.set(e.id,r),this.slugToIdMap.set(r,e.id)}let n=Te.join(this.collectionsDir,r),i=!Ie.existsSync(n);await Ie.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(Te.join(n,cn),e.scripts):Promise.resolve()]);o.length>0&&(s.order=o),await Ie.promises.writeFile(Te.join(n,Pr.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=En(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 f=Te.join(e,l);await Ie.promises.mkdir(f,{recursive:!0}),o.type==="folder"?await this.saveFolderToDir(f,o,n):await this.saveRequestToDir(f,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(Te.join(e,cn),r.scripts):Promise.resolve()]);s.length>0&&(i.order=s),await Ie.promises.writeFile(Te.join(e,Pr.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,auth:r.auth,settings:r.settings,...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=[Ie.promises.writeFile(Te.join(e,Pr.request),JSON.stringify(o,null,2),"utf-8")];s&&l.push(Ie.promises.writeFile(Te.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(Ie.promises.writeFile(Te.join(e,"doc.md"),r.doc,"utf-8")),r.scripts&&l.push(this.saveScriptsToDir(Te.join(e,cn),r.scripts)),await Promise.all(l)}prepareBodyForSave(e){return rI(e)}async cleanupOldBodyFiles(e,r){return nI(e,r)}async saveScriptsToDir(e,r){return xh(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=Te.join(this.collectionsDir,r);if(!Ie.existsSync(n))return!1;try{return await Ie.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?Ie.existsSync(Te.join(this.collectionsDir,r,Pr.collection)):!1}getCollectionPath(e){let r=this.idToSlugMap.get(e)||e;return Te.join(this.collectionsDir,r)}getItemPath(e,r){return this.findItemPath(e,r)}async create(e,r){let n={id:r||St(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(Te.join(s,cn),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(Te.join(n,cn))}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=Te.join(this.collectionsDir,i),o=Te.join(s,Pr.collection),l=Ie.readFileSync(o,"utf-8"),c={...JSON.parse(l),...r,id:e};await Ie.promises.writeFile(o,JSON.stringify(c,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=Te.join(this.collectionsDir,s);let l=this.idToSlugMap.get(r.id);if(!l){let p=Ie.readdirSync(o).filter(h=>Ie.statSync(Te.join(o,h)).isDirectory()&&h!==cn);l=En(r.name,p),this.idToSlugMap.set(r.id,l),this.slugToIdMap.set(l,r.id)}let f=Te.join(o,l);await Ie.promises.mkdir(f,{recursive:!0}),r.type==="folder"?await this.saveFolderToDir(f,r):await this.saveRequestToDir(f,r);let c=this.findItemById(i.items,r.id);if(c)Object.assign(c,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||!Ie.existsSync(i))return!1;try{await Ie.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:f,items:c,...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||!Ie.existsSync(o))return!1;let l;if(n){let p=this.findItemPath(e,n);if(!p)return!1;l=p}else l=Te.join(this.collectionsDir,s);let f=this.idToSlugMap.get(r);if(!f)return!1;let c=Te.join(l,f);if(Ie.existsSync(c))return!1;try{await Ie.promises.rename(o,c);let p=this.findItemById(i.items,r);if(p){let h=p.type==="folder"?{...p,items:p.items?[...p.items]:[]}:{...p};if(this.deleteItemFromTree(i.items,r),n){let g=this.findItemById(i.items,n);g&&g.type==="folder"&&(g.items=g.items||[],g.items.push(h))}else i.items.push(h)}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 f=this.idToSlugMap.get(l);f&&o.push(f)}try{if(r){let l=this.findItemPath(e,r);if(!l)return!1;let f=Te.join(l,Pr.folder),c=Ie.readFileSync(f,"utf-8"),p=JSON.parse(c);p.order=o,await Ie.promises.writeFile(f,JSON.stringify(p,null,2),"utf-8");let h=this.findItemById(i.items,r);h&&h.type==="folder"&&h.items&&(h.items=this.sortItemsByOrder(h.items,n))}else{let l=Te.join(this.collectionsDir,s,Pr.collection),f=Ie.readFileSync(l,"utf-8"),c=JSON.parse(f);c.order=o,await Ie.promises.writeFile(l,JSON.stringify(c,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 oI(e,r)}findItemPath(e,r){let n=this.idToSlugMap.get(e);if(!n)return;let i=Te.join(this.collectionsDir,n),s=eS(i,r);if(s)return s;let o=this.load(e);if(o){let f=this.buildSlugPath(o.items,r);if(f)return Te.join(i,...f)}let l=this.idToSlugMap.get(r);if(l)return Xb(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 Qb(e,r)}deleteItemFromTree(e,r){return Zb(e,r)}}});var ht,oa=se(()=>{"use strict";ht=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(),f=i.substring(o+1).trim(),c={name:l,value:f,domain:r};for(let p of s){let h=p.indexOf("="),g=(h===-1?p:p.substring(0,h)).toLowerCase(),v=h===-1?"":p.substring(h+1);switch(g){case"domain":c.domain=v.startsWith(".")?v.substring(1):v;break;case"path":c.path=v;break;case"expires":c.expires=v;break;case"max-age":c.maxAge=parseInt(v,10);break;case"httponly":c.httpOnly=!0;break;case"secure":c.secure=!0;break;case"samesite":c.sameSite=v;break}}return c}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"/"}}}});import*as Js from"fs";import*as aa from"path";function Oh(t){let e=t.toLowerCase();return e==="_global.json"||e==="_global.local.json"||e.endsWith(".local.json")}function Gc(t){if(!Js.existsSync(t))return Mj();let e=Ih(aa.join(t,"_global.json"))||{},r=e.variables||{},n=e.defaultHeaders||{},i=Js.readdirSync(t).filter(c=>c.endsWith(".json")).filter(c=>!c.endsWith(".local.json")).filter(c=>!Oh(c)),s={};for(let c of i){let p=Ih(aa.join(t,c))||{},h=aa.basename(c,".json");s[h]={description:p.description,requiresConfirmation:p.requiresConfirmation,variables:p.variables||{},secretVariables:p.secretVariables}}let l=(Ih(aa.join(t,"_global.local.json"))||{}).variables||{},f={};for(let c of Object.keys(s)){let p=aa.join(t,`${c}.local.json`);if(Js.existsSync(p)){let h=Ih(p)||{};f[c]={variables:h.variables||{}}}}return{globalVariables:r,defaultHeaders:n,environments:s,localVariables:l,localCredentials:f}}function Mj(){return{globalVariables:{},defaultHeaders:{},environments:{},localVariables:{},localCredentials:{}}}function Ih(t){try{if(!Js.existsSync(t))return null;let e=Js.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 qh=se(()=>{"use strict"});var Kn,zl=se(()=>{"use strict";Kn=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 f=s.match(/^(https?:\/\/)([^\/]*)(\/.*)?$/);f&&(n=f[1],i=f[2],s=f[3]||"/");let c=/:(\w+)(?:\([^)]*\))?(\?)?/g,p=s.replace(c,(h,g,v)=>{let _=r[g];return _!==void 0&&_!==""?encodeURIComponent(_):v?"":(console.warn(`[UrlBuilder] Missing required path parameter: ${g}`),h)});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[f,c]=e.split("?");n=f,c&&new URLSearchParams(c).forEach((h,g)=>{i[g]=h})}let s={...i,...r},o=new URLSearchParams;for(let[f,c]of Object.entries(s))c!=null&&o.append(f,c);let l=o.toString();return l?`${n}?${l}`:n}}});function lI(t,e=0){return(ir[t[e+0]]+ir[t[e+1]]+ir[t[e+2]]+ir[t[e+3]]+"-"+ir[t[e+4]]+ir[t[e+5]]+"-"+ir[t[e+6]]+ir[t[e+7]]+"-"+ir[t[e+8]]+ir[t[e+9]]+"-"+ir[t[e+10]]+ir[t[e+11]]+ir[t[e+12]]+ir[t[e+13]]+ir[t[e+14]]+ir[t[e+15]]).toLowerCase()}var ir,uI=se(()=>{ir=[];for(let t=0;t<256;++t)ir.push((t+256).toString(16).slice(1))});function nS(){return crypto.getRandomValues(Fj)}var Fj,cI=se(()=>{Fj=new Uint8Array(16)});function Dj(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():Lj(t,e,r)}function Lj(t,e,r){t=t||{};let n=t.random??t.rng?.()??nS();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 lI(n)}var Jl,fI=se(()=>{cI();uI();Jl=Dj});var iS=se(()=>{fI()});function jj(t=0,e=999){return Math.floor(Math.random()*(e-t+1))+t}function Uj(){return Date.now()}function dI(){return Jl()}function Hj(){return Jl()}function pI(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 Bj(){let t=pI(8).toLowerCase(),e=["example.com","test.org","mail.dev","sample.net"];return`${t}@${e[Math.floor(Math.random()*e.length)]}`}function Vj(){return Math.random()<.5}function Wj(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 zj(){return Math.floor(Date.now()/1e3)}function Jj(){return new Date().toISOString()}function Gj(){return new Date().toISOString().split("T")[0]}function Yj(){return new Date().toISOString().split("T")[1].split(".")[0]}function Kj(){return new Date().toISOString()}function Qj(t=""){return Buffer.from(String(t)).toString("base64")}function Zj(t=""){return Buffer.from(String(t),"base64").toString("utf-8")}function Xj(t=""){return encodeURIComponent(String(t))}function e2(t=""){return decodeURIComponent(String(t))}function t2(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 ns(t,e){let r=hI[t];return r?e&&e.length>0?r(...e):r():null}function r2(t){return!t||typeof t!="string"?t:t.replace(/\{\{\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?\}\}/g,(e,r,n)=>{try{let i=n?t2(n):void 0,s=ns(r,i);return s===null?e:String(s)}catch{return e}})}function la(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=ns(o);l!==null&&(n||(n={...e}),n[s]=l)}}return n??e}var hI,kh=se(()=>{"use strict";iS();hI={randomInt:jj,timestamp:Uj,guid:Hj,uuid:dI,randomUUID:dI,randomString:pI,randomHexadecimal:Wj,randomEmail:Bj,randomBoolean:Vj,isoTimestamp:Kj,timestamp_s:zj,datetime:Jj,date:Gj,time:Yj,base64Encode:Qj,base64Decode:Zj,urlEncode:Xj,urlDecode:e2}});import*as Ph from"vm";function ua(t){let e=t.trim();return!e||/^(\$?)[a-zA-Z_][a-zA-Z0-9_]*(\([^)]*\))?$/.test(e)||/(?<!\|)\|(?!\|)/.test(e)?!1:/[+\-*/%<>=!&|?:~^()[\]{}.,`]/.test(e)}function ca(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=Ph.createContext(r);return Ph.runInContext(t,n,{timeout:n2,displayErrors:!1})}catch{return}}var n2,Th=se(()=>{"use strict";n2=100});import*as Ah from"crypto";function i2(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function Kc(t){if(!t||!t.includes("|"))return null;let e=s2(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=o2(s);o&&n.push(o)}return n.length===0?null:{input:r,filters:n}}function s2(t){let e=[],r="",n=0,i=!1,s=!1;for(let o=0;o<t.length;o++){let l=t[o],f=o>0?t[o-1]:"",c=o<t.length-1?t[o+1]:"";if(f==="\\"){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(c==="|"){r+="||",o++;continue}e.push(r),r="";continue}r+=l}return r&&e.push(r),e}function o2(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:a2(n)}}function a2(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 $t(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=i2(e[t]),i=Number(n);return!isNaN(i)&&n!==""?i:n}return t}function Qc(t,e,r={}){let n=t;for(let i of e)n=l2(n,i.name,i.args,r);return n}function l2(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=$t(r[0],n),s=r[1]!==void 0?$t(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($t(r[0],n)):"",s=r[1]!==void 0?String($t(r[1],n)):"";return String(t).replace(new RegExp(c2(i),"g"),s)}case"split":{let i=r[0]!==void 0?String($t(r[0],n)):",";return String(t).split(i)}case"join":{let i=r[0]!==void 0?String($t(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($t(r[0],n)):"{0}";i=i.replace("{0}",String(t));for(let s=1;s<r.length;s++){let o=$t(r[s],n);i=i.replace(`{${s}}`,String(o))}return i}case"add":{let i=$t(r[0],n);return Number(t)+i}case"subtract":{let i=$t(r[0],n);return Number(t)-i}case"multiply":{let i=$t(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?$t(r[0],n):"md5").toLowerCase(),s=String(r[1]!==void 0?$t(r[1],n):"base64"),l={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[i]||"md5";return Ah.createHash(l).update(String(t)).digest(s)}case"hmac":{let i=r[0]?String($t(r[0],n)):"",s=String(r[1]!==void 0?$t(r[1],n):"sha256").toLowerCase(),o=String(r[2]!==void 0?$t(r[2],n):"base64"),f={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[s]||"sha256";return Ah.createHmac(f,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=$t(r[0],n);return Array.isArray(t)?t.at(i):t}case"slice":{let i=$t(r[0],n),s=r[1]!==void 0?$t(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:u2(t,r[0],n);case"map":{if(!Array.isArray(t))return t;let i=r.map(s=>String($t(s,n)));return i.length===1?t.map(s=>Yc(s,i[0])):t.map(s=>{let o={};for(let l of i){let f=Yc(s,l);f!==void 0&&(o[l]=f)}return o})}case"prop":{let i=r[0]!==void 0?String($t(r[0],n)):"";if(Array.isArray(t)){let s=t.map(o=>Yc(o,i)).filter(o=>o!==void 0);return s.length===1?s[0]:s.join(",")}return t&&typeof t=="object"?Yc(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 u2(t,e,r){let n=e.match(/^([\w.]+)\s*(>=|<=|!=|\*=|\^=|\$=|>|<|=)\s*(.+)$/);if(!n)return t;let[,i,s,o]=n,l=$t(o,r);return t.filter(f=>{let c=Yc(f,i);if(c===void 0)return!1;switch(s){case">":return Number(c)>Number(l);case">=":return Number(c)>=Number(l);case"<":return Number(c)<Number(l);case"<=":return Number(c)<=Number(l);case"=":return String(c)===String(l);case"!=":return String(c)!==String(l);case"*=":return String(c).includes(String(l));case"^=":return String(c).startsWith(String(l));case"$=":return String(c).endsWith(String(l));default:return!0}})}function Yc(t,e){if(!(!t||typeof t!="object"))return e in t?t[e]:e.split(".").reduce((r,n)=>r?.[n],t)}function c2(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var $h=se(()=>{"use strict"});function mI(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 f2(t){return new fa(t)}var fa,da,Zc=se(()=>{"use strict";kh();Th();$h();fa=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,(f,c)=>this.resolveTemplateContent(c.trim(),r,f));let i="",s=0,o=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,l;for(;(l=o.exec(e))!==null;){let f=l[1].trim(),c=this.resolveTemplateContent(f,r,l[0]);if(c!==l[0]){i+=e.slice(s,l.index);let p=this.getStringContext(e,l.index);i+=p?this.escapeForString(String(c),p):String(c)}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=mI(i[2],r),f=ns(i[1],l);return f!==null?String(f):n}let s=Kc(e);if(s){let l=this.resolveFilterInput(s.input,r);if(l!==void 0){let f=Qc(l,s.filters,r);return f!==void 0?String(f):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 f=this.deserializeValue(r[l]),c=o[2],p=this.resolvePropertyAccess(f,c);if(p!==void 0)return typeof p=="object"?JSON.stringify(p):String(p)}}if(r[e]!==void 0){let l=r[e];return typeof l=="string"&&l.charCodeAt(0)===30?l.slice(1):String(l)}if(ua(e)){let l=this.deserializeVariables(r),f=la(e,l),c=ca(e,f);if(c!==void 0)return String(c)}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=mI(n[2],r),o=ns(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(ua(e)){let s=this.deserializeVariables(r),o=la(e,s),l=ca(e,o);if(l!==void 0)return l}}deserializeValue(e){if(typeof e=="string"&&e.charCodeAt(0)===30)try{return JSON.parse(e.slice(1))}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}},da=class{interpolate(e,r){return!e||typeof e!="string"?e:new fa({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}}});import*as d2 from"http";import*as Xc from"https";import{URL as gI}from"url";import*as Nh from"zlib";var Qn,pa,ef=se(()=>{"use strict";Qn={timeout:3e4,followRedirects:!0,followOriginalMethod:!1,followAuthHeader:!1,maxRedirects:10,strictSSL:!0,decompress:!0,includeCookies:!1},pa=class{settings;version;constructor(e){this.settings={...Qn,...e};try{this.version=ft("../../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}}async executeInternal(e,r,n,i){let s=Date.now(),o=new gI(e.url),l=o.protocol==="https:",f=this.sanitizeHeaders(e.headers||{});Object.keys(f).some(h=>h.toLowerCase()==="user-agent")||(f["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:{...f},timeout:r.timeout||void 0};return r.decompress&&!f["accept-encoding"]&&!f["Accept-Encoding"]&&(p.headers["Accept-Encoding"]="gzip, deflate"),l&&(p.rejectUnauthorized=r.strictSSL,r.strictSSL?p.agent=Xc.globalAgent:p.agent=new Xc.Agent({rejectUnauthorized:!1})),new Promise((h,g)=>{if(i?.aborted){let w=new Error("Request cancelled");w.name="AbortError",g(w);return}let _=(l?Xc:d2).request(p,async w=>{let E=w.statusCode||0;if(r.followRedirects&&[301,302,303,307,308].includes(E)){if(n>=r.maxRedirects){g(new Error(`Maximum redirects (${r.maxRedirects}) exceeded`));return}let T=w.headers.location;if(!T){g(new Error("Redirect response missing Location header"));return}let N=new gI(T,e.url).toString(),$=e.method;!r.followOriginalMethod&&[301,302,303].includes(E)&&($="GET");let j={...e.headers};r.followAuthHeader||(delete j.authorization,delete j.Authorization);try{let G=await this.executeInternal({...e,url:N,method:$,headers:j,body:$==="GET"?void 0:e.body},r,n+1,i),q=Date.now();G.time=q-s,h(G)}catch(G){g(G)}return}let k=[];w.on("data",T=>k.push(T)),w.on("end",()=>{let T=Date.now(),N=Buffer.concat(k),$=w.headers["content-encoding"];if(r.decompress&&$)try{$==="gzip"?N=Nh.gunzipSync(N):$==="deflate"&&(N=Nh.inflateSync(N))}catch(C){console.warn("[NodeHttpClient] Decompression failed:",C)}let j=N.toString("utf-8"),G={};for(let[C,A]of Object.entries(w.headers))(typeof A=="string"||Array.isArray(A))&&(G[C]=A);let q=this.parseCookies(w.headers["set-cookie"],o.hostname);h({status:w.statusCode||0,statusText:w.statusMessage||"",headers:G,cookies:q,body:j,time:T-s,size:N.length})})});if(i&&i.addEventListener("abort",()=>{_.destroy();let w=new Error("Request cancelled");w.name="AbortError",g(w)}),_.on("error",w=>{g(w)}),_.on("timeout",()=>{_.destroy(),g(new Error("Request timeout"))}),e.body!==void 0&&e.body!==null){let w=typeof e.body=="string"?e.body:JSON.stringify(e.body);_.write(w)}_.end()})}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,f]=s.split("="),c={name:l.trim(),value:f?.trim()||"",domain:r};for(let p of o){let[h,g]=p.split("=");switch(h.toLowerCase().trim()){case"domain":c.domain=g?.trim();break;case"path":c.path=g?.trim();break;case"expires":c.expires=g?.trim();break;case"httponly":c.httpOnly=!0;break;case"secure":c.secure=!0;break}}return c}):[]}}});function sS(t){return{timeout:t?.timeout??Qn.timeout,followRedirects:t?.followRedirects??Qn.followRedirects,followOriginalMethod:t?.followOriginalMethod??Qn.followOriginalMethod,followAuthHeader:t?.followAuthHeader??Qn.followAuthHeader,maxRedirects:t?.maxRedirects??Qn.maxRedirects,strictSSL:t?.strictSSL??Qn.strictSSL,decompress:t?.decompress??Qn.decompress,includeCookies:t?.includeCookies??Qn.includeCookies}}var oS=se(()=>{"use strict";ef()});var is,tf=se(()=>{"use strict";oS();is=class{constructor(e,r,n){this.urlBuilder=e;this.interceptors=r;this.httpClient=n}urlBuilder;interceptors;httpClient;async execute(e){let r=sS(e.settings),n={},i;try{i=await this.interceptors.executeRequestInterceptors(e,n)}catch(s){let o=await this.interceptors.executeErrorInterceptors(s,e,n);if(o)return o;throw s}try{let s=await this.httpClient.send({...i,settings:r});return await this.interceptors.executeResponseInterceptors(s,i,n)}catch(s){let o=await this.interceptors.executeErrorInterceptors(s,i,n);if(o)return o;throw s}}buildUrl(e,r={},n={}){return this.urlBuilder.buildUrl(e,r,n)}}});var ss,aS,lS,uS,rf=se(()=>{"use strict";ss=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))}},aS=class{name="logging";priority=1e3;intercept(e,r){return e}},lS=class{name="timing";priority=1;intercept(e,r,n){return e}},uS=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 yI=H((Gl,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__",f=500,c="__lodash_placeholder__",p=1,h=2,g=4,v=1,_=2,w=1,E=2,k=4,T=8,N=16,$=32,j=64,G=128,q=256,C=512,A=30,D="...",B=800,F=16,K=1,ee=2,ie=3,pe=1/0,ke=9007199254740991,de=17976931348623157e292,le=NaN,ve=4294967295,We=ve-1,mt=ve>>>1,ce=[["ary",G],["bind",w],["bindKey",E],["curry",T],["curryRight",N],["flip",C],["partial",$],["partialRight",j],["rearg",q]],rr="[object Arguments]",$e="[object Array]",nt="[object AsyncFunction]",en="[object Boolean]",Nr="[object Date]",_t="[object DOMException]",Rt="[object Error]",hn="[object Function]",Oo="[object GeneratorFunction]",Zt="[object Map]",qo="[object Number]",$y="[object Null]",Mn="[object Object]",ap="[object Promise]",lp="[object Proxy]",Xt="[object RegExp]",_r="[object Set]",ko="[object String]",tl="[object Symbol]",up="[object Undefined]",zt="[object WeakMap]",cp="[object WeakSet]",ji="[object ArrayBuffer]",Fn="[object DataView]",pt="[object Float32Array]",rl="[object Float64Array]",nl="[object Int8Array]",Cs="[object Int16Array]",Po="[object Int32Array]",xs="[object Uint8Array]",yi="[object Uint8ClampedArray]",Es="[object Uint16Array]",oc="[object Uint32Array]",il=/\b__p \+= '';/g,Ny=/\b(__p \+=) '' \+/g,To=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ui=/&(?:amp|lt|gt|quot|#39);/g,sl=/[&<>"']/g,ol=RegExp(Ui.source),fe=RegExp(sl.source),My=/<%-([\s\S]+?)%>/g,Fy=/<%([\s\S]+?)%>/g,mn=/<%=([\s\S]+?)%>/g,Mr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fe=/^\w*$/,ac=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,it=/[\\^$.*+?()[\]{}|]/g,Ao=RegExp(it.source),lc=/^\s+/,al=/\s/,er=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Dn=/\{\n\/\* \[wrapped with (.+)\] \*/,gn=/,? & /,Ft=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Fr=/[()=,{}\[\]\/\s]/,Ln=/\\(\\)?/g,Hi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fp=/\w*$/,Dy=/^[-+]0x[0-9a-f]+$/i,$o=/^0b[01]+$/i,dp=/^\[object .+?Constructor\]$/,Ly=/^0o[0-7]+$/i,Is=/^(?:0|[1-9]\d*)$/,No=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Mo=/($^)/,jy=/['\n\r\u2028\u2029\\]/g,ll="\\ud800-\\udfff",Uy="\\u0300-\\u036f",kt="\\ufe20-\\ufe2f",uc="\\u20d0-\\u20ff",pp=Uy+kt+uc,cc="\\u2700-\\u27bf",fc="a-z\\xdf-\\xf6\\xf8-\\xff",Hy="\\xac\\xb1\\xd7\\xf7",By="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Vy="\\u2000-\\u206f",Wy=" \\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",hp="A-Z\\xc0-\\xd6\\xd8-\\xde",mp="\\ufe0e\\ufe0f",dc=Hy+By+Vy+Wy,ul="['\u2019]",zy="["+ll+"]",gp="["+dc+"]",cl="["+pp+"]",pc="\\d+",Jy="["+cc+"]",Os="["+fc+"]",Fo="[^"+ll+dc+pc+cc+fc+hp+"]",fl="\\ud83c[\\udffb-\\udfff]",Do="(?:"+cl+"|"+fl+")",yn="[^"+ll+"]",hc="(?:\\ud83c[\\udde6-\\uddff]){2}",mc="[\\ud800-\\udbff][\\udc00-\\udfff]",qs="["+hp+"]",yp="\\u200d",vp="(?:"+Os+"|"+Fo+")",Gy="(?:"+qs+"|"+Fo+")",bp="(?:"+ul+"(?:d|ll|m|re|s|t|ve))?",Sp="(?:"+ul+"(?:D|LL|M|RE|S|T|VE))?",dl=Do+"?",wp="["+mp+"]?",_p="(?:"+yp+"(?:"+[yn,hc,mc].join("|")+")"+wp+dl+")*",Yy="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ky="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Rp=wp+dl+_p,Qy="(?:"+[Jy,hc,mc].join("|")+")"+Rp,Zy="(?:"+[yn+cl+"?",cl,hc,mc,zy].join("|")+")",Xy=RegExp(ul,"g"),ev=RegExp(cl,"g"),gc=RegExp(fl+"(?="+fl+")|"+Zy+Rp,"g"),tv=RegExp([qs+"?"+Os+"+"+bp+"(?="+[gp,qs,"$"].join("|")+")",Gy+"+"+Sp+"(?="+[gp,qs+vp,"$"].join("|")+")",qs+"?"+vp+"+"+bp,qs+"+"+Sp,Ky,Yy,pc,Qy].join("|"),"g"),rv=RegExp("["+yp+ll+pp+mp+"]"),nv=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,iv=["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"],sv=-1,bt={};bt[pt]=bt[rl]=bt[nl]=bt[Cs]=bt[Po]=bt[xs]=bt[yi]=bt[Es]=bt[oc]=!0,bt[rr]=bt[$e]=bt[ji]=bt[en]=bt[Fn]=bt[Nr]=bt[Rt]=bt[hn]=bt[Zt]=bt[qo]=bt[Mn]=bt[Xt]=bt[_r]=bt[ko]=bt[zt]=!1;var gt={};gt[rr]=gt[$e]=gt[ji]=gt[Fn]=gt[en]=gt[Nr]=gt[pt]=gt[rl]=gt[nl]=gt[Cs]=gt[Po]=gt[Zt]=gt[qo]=gt[Mn]=gt[Xt]=gt[_r]=gt[ko]=gt[tl]=gt[xs]=gt[yi]=gt[Es]=gt[oc]=!0,gt[Rt]=gt[hn]=gt[zt]=!1;var yc={\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"},vc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ov={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Cp={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},xp=parseFloat,av=parseInt,Ep=typeof global=="object"&&global&&global.Object===Object&&global,lv=typeof self=="object"&&self&&self.Object===Object&&self,Ut=Ep||lv||Function("return this")(),pl=typeof Gl=="object"&&Gl&&!Gl.nodeType&&Gl,st=pl&&typeof nf=="object"&&nf&&!nf.nodeType&&nf,ks=st&&st.exports===pl,Bi=ks&&Ep.process,Dr=(function(){try{var V=st&&st.require&&st.require("util").types;return V||Bi&&Bi.binding&&Bi.binding("util")}catch{}})(),bc=Dr&&Dr.isArrayBuffer,Ip=Dr&&Dr.isDate,Op=Dr&&Dr.isMap,Lo=Dr&&Dr.isRegExp,jn=Dr&&Dr.isSet,hl=Dr&&Dr.isTypedArray;function Rr(V,Q,z){switch(z.length){case 0:return V.call(Q);case 1:return V.call(Q,z[0]);case 2:return V.call(Q,z[0],z[1]);case 3:return V.call(Q,z[0],z[1],z[2])}return V.apply(Q,z)}function Un(V,Q,z,ue){for(var Re=-1,tt=V==null?0:V.length;++Re<tt;){var ut=V[Re];Q(ue,ut,z(ut),V)}return ue}function Cr(V,Q){for(var z=-1,ue=V==null?0:V.length;++z<ue&&Q(V[z],z,V)!==!1;);return V}function Sc(V,Q){for(var z=V==null?0:V.length;z--&&Q(V[z],z,V)!==!1;);return V}function qp(V,Q){for(var z=-1,ue=V==null?0:V.length;++z<ue;)if(!Q(V[z],z,V))return!1;return!0}function vi(V,Q){for(var z=-1,ue=V==null?0:V.length,Re=0,tt=[];++z<ue;){var ut=V[z];Q(ut,z,V)&&(tt[Re++]=ut)}return tt}function ml(V,Q){var z=V==null?0:V.length;return!!z&&Vi(V,Q,0)>-1}function Ps(V,Q,z){for(var ue=-1,Re=V==null?0:V.length;++ue<Re;)if(z(Q,V[ue]))return!0;return!1}function yt(V,Q){for(var z=-1,ue=V==null?0:V.length,Re=Array(ue);++z<ue;)Re[z]=Q(V[z],z,V);return Re}function bi(V,Q){for(var z=-1,ue=Q.length,Re=V.length;++z<ue;)V[Re+z]=Q[z];return V}function wc(V,Q,z,ue){var Re=-1,tt=V==null?0:V.length;for(ue&&tt&&(z=V[++Re]);++Re<tt;)z=Q(z,V[Re],Re,V);return z}function uv(V,Q,z,ue){var Re=V==null?0:V.length;for(ue&&Re&&(z=V[--Re]);Re--;)z=Q(z,V[Re],Re,V);return z}function gl(V,Q){for(var z=-1,ue=V==null?0:V.length;++z<ue;)if(Q(V[z],z,V))return!0;return!1}var cv=jo("length");function fv(V){return V.split("")}function dv(V){return V.match(Ft)||[]}function kp(V,Q,z){var ue;return z(V,function(Re,tt,ut){if(Q(Re,tt,ut))return ue=tt,!1}),ue}function yl(V,Q,z,ue){for(var Re=V.length,tt=z+(ue?1:-1);ue?tt--:++tt<Re;)if(Q(V[tt],tt,V))return tt;return-1}function Vi(V,Q,z){return Q===Q?wv(V,Q,z):yl(V,Wi,z)}function pv(V,Q,z,ue){for(var Re=z-1,tt=V.length;++Re<tt;)if(ue(V[Re],Q))return Re;return-1}function Wi(V){return V!==V}function Pp(V,Q){var z=V==null?0:V.length;return z?Rc(V,Q)/z:le}function jo(V){return function(Q){return Q==null?t:Q[V]}}function _c(V){return function(Q){return V==null?t:V[Q]}}function vl(V,Q,z,ue,Re){return Re(V,function(tt,ut,ze){z=ue?(ue=!1,tt):Q(z,tt,ut,ze)}),z}function hv(V,Q){var z=V.length;for(V.sort(Q);z--;)V[z]=V[z].value;return V}function Rc(V,Q){for(var z,ue=-1,Re=V.length;++ue<Re;){var tt=Q(V[ue]);tt!==t&&(z=z===t?tt:z+tt)}return z}function Cc(V,Q){for(var z=-1,ue=Array(V);++z<V;)ue[z]=Q(z);return ue}function mv(V,Q){return yt(Q,function(z){return[z,V[z]]})}function xc(V){return V&&V.slice(0,Mp(V)+1).replace(lc,"")}function xr(V){return function(Q){return V(Q)}}function bl(V,Q){return yt(Q,function(z){return V[z]})}function lt(V,Q){return V.has(Q)}function Tp(V,Q){for(var z=-1,ue=V.length;++z<ue&&Vi(Q,V[z],0)>-1;);return z}function Ap(V,Q){for(var z=V.length;z--&&Vi(Q,V[z],0)>-1;);return z}function $p(V,Q){for(var z=V.length,ue=0;z--;)V[z]===Q&&++ue;return ue}var gv=_c(yc),yv=_c(vc);function vv(V){return"\\"+Cp[V]}function Uo(V,Q){return V==null?t:V[Q]}function Ts(V){return rv.test(V)}function bv(V){return nv.test(V)}function Sv(V){for(var Q,z=[];!(Q=V.next()).done;)z.push(Q.value);return z}function As(V){var Q=-1,z=Array(V.size);return V.forEach(function(ue,Re){z[++Q]=[Re,ue]}),z}function Ho(V,Q){return function(z){return V(Q(z))}}function vn(V,Q){for(var z=-1,ue=V.length,Re=0,tt=[];++z<ue;){var ut=V[z];(ut===Q||ut===c)&&(V[z]=c,tt[Re++]=z)}return tt}function Sl(V){var Q=-1,z=Array(V.size);return V.forEach(function(ue){z[++Q]=ue}),z}function Np(V){var Q=-1,z=Array(V.size);return V.forEach(function(ue){z[++Q]=[ue,ue]}),z}function wv(V,Q,z){for(var ue=z-1,Re=V.length;++ue<Re;)if(V[ue]===Q)return ue;return-1}function Ec(V,Q,z){for(var ue=z+1;ue--;)if(V[ue]===Q)return ue;return ue}function Si(V){return Ts(V)?Rv(V):cv(V)}function Er(V){return Ts(V)?Cv(V):fv(V)}function Mp(V){for(var Q=V.length;Q--&&al.test(V.charAt(Q)););return Q}var _v=_c(ov);function Rv(V){for(var Q=gc.lastIndex=0;gc.test(V);)++Q;return Q}function Cv(V){return V.match(gc)||[]}function xv(V){return V.match(tv)||[]}var Ev=(function V(Q){Q=Q==null?Ut:wi.defaults(Ut.Object(),Q,wi.pick(Ut,iv));var z=Q.Array,ue=Q.Date,Re=Q.Error,tt=Q.Function,ut=Q.Math,ze=Q.Object,wl=Q.RegExp,Iv=Q.String,Ir=Q.TypeError,Bo=z.prototype,Ov=tt.prototype,$s=ze.prototype,Vo=Q["__core-js_shared__"],_l=Ov.toString,ot=$s.hasOwnProperty,qv=0,Fp=(function(){var a=/[^.]+$/.exec(Vo&&Vo.keys&&Vo.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""})(),Rl=$s.toString,kv=_l.call(ze),Pv=Ut._,Tv=wl("^"+_l.call(ot).replace(it,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Cl=ks?Q.Buffer:t,_i=Q.Symbol,xl=Q.Uint8Array,Dp=Cl?Cl.allocUnsafe:t,El=Ho(ze.getPrototypeOf,ze),Lp=ze.create,Wo=$s.propertyIsEnumerable,Il=Bo.splice,jp=_i?_i.isConcatSpreadable:t,zo=_i?_i.iterator:t,zi=_i?_i.toStringTag:t,Ol=(function(){try{var a=ra(ze,"defineProperty");return a({},"",{}),a}catch{}})(),Av=Q.clearTimeout!==Ut.clearTimeout&&Q.clearTimeout,$v=ue&&ue.now!==Ut.Date.now&&ue.now,Nv=Q.setTimeout!==Ut.setTimeout&&Q.setTimeout,Jo=ut.ceil,Go=ut.floor,ql=ze.getOwnPropertySymbols,kl=Cl?Cl.isBuffer:t,Ji=Q.isFinite,Pl=Bo.join,Up=Ho(ze.keys,ze),Ct=ut.max,Jt=ut.min,Hp=ue.now,Mv=Q.parseInt,Bp=ut.random,Fv=Bo.reverse,Ic=ra(Q,"DataView"),Yo=ra(Q,"Map"),Oc=ra(Q,"Promise"),Ns=ra(Q,"Set"),Ko=ra(Q,"WeakMap"),Qo=ra(ze,"create"),Tl=Ko&&new Ko,Ms={},Dv=na(Ic),Lv=na(Yo),jv=na(Oc),Uv=na(Ns),Hv=na(Ko),Al=_i?_i.prototype:t,Zo=Al?Al.valueOf:t,Vp=Al?Al.toString:t;function O(a){if(Tt(a)&&!Ee(a)&&!(a instanceof De)){if(a instanceof fr)return a;if(ot.call(a,"__wrapped__"))return yE(a)}return new fr(a)}var Fs=(function(){function a(){}return function(u){if(!Pt(u))return{};if(Lp)return Lp(u);a.prototype=u;var m=new a;return a.prototype=t,m}})();function $l(){}function fr(a,u){this.__wrapped__=a,this.__actions__=[],this.__chain__=!!u,this.__index__=0,this.__values__=t}O.templateSettings={escape:My,evaluate:Fy,interpolate:mn,variable:"",imports:{_:O}},O.prototype=$l.prototype,O.prototype.constructor=O,fr.prototype=Fs($l.prototype),fr.prototype.constructor=fr;function De(a){this.__wrapped__=a,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ve,this.__views__=[]}function Bv(){var a=new De(this.__wrapped__);return a.__actions__=Lr(this.__actions__),a.__dir__=this.__dir__,a.__filtered__=this.__filtered__,a.__iteratees__=Lr(this.__iteratees__),a.__takeCount__=this.__takeCount__,a.__views__=Lr(this.__views__),a}function Vv(){if(this.__filtered__){var a=new De(this);a.__dir__=-1,a.__filtered__=!0}else a=this.clone(),a.__dir__*=-1;return a}function qc(){var a=this.__wrapped__.value(),u=this.__dir__,m=Ee(a),b=u<0,x=m?a.length:0,P=QN(0,x,this.__views__),M=P.start,U=P.end,W=U-M,Z=b?U:M-1,X=this.__iteratees__,te=X.length,oe=0,he=Jt(W,this.__takeCount__);if(!m||!b&&x==W&&he==W)return jx(a,this.__actions__);var we=[];e:for(;W--&&oe<he;){Z+=u;for(var Pe=-1,be=a[Z];++Pe<te;){var Be=X[Pe],Je=Be.iteratee,an=Be.type,kr=Je(be);if(an==ee)be=kr;else if(!kr){if(an==K)continue e;break e}}we[oe++]=be}return we}De.prototype=Fs($l.prototype),De.prototype.constructor=De;function bn(a){var u=-1,m=a==null?0:a.length;for(this.clear();++u<m;){var b=a[u];this.set(b[0],b[1])}}function Wv(){this.__data__=Qo?Qo(null):{},this.size=0}function zv(a){var u=this.has(a)&&delete this.__data__[a];return this.size-=u?1:0,u}function Jv(a){var u=this.__data__;if(Qo){var m=u[a];return m===l?t:m}return ot.call(u,a)?u[a]:t}function Gv(a){var u=this.__data__;return Qo?u[a]!==t:ot.call(u,a)}function Yv(a,u){var m=this.__data__;return this.size+=this.has(a)?0:1,m[a]=Qo&&u===t?l:u,this}bn.prototype.clear=Wv,bn.prototype.delete=zv,bn.prototype.get=Jv,bn.prototype.has=Gv,bn.prototype.set=Yv;function Hn(a){var u=-1,m=a==null?0:a.length;for(this.clear();++u<m;){var b=a[u];this.set(b[0],b[1])}}function Wp(){this.__data__=[],this.size=0}function Kv(a){var u=this.__data__,m=Ml(u,a);if(m<0)return!1;var b=u.length-1;return m==b?u.pop():Il.call(u,m,1),--this.size,!0}function Qv(a){var u=this.__data__,m=Ml(u,a);return m<0?t:u[m][1]}function zp(a){return Ml(this.__data__,a)>-1}function Zv(a,u){var m=this.__data__,b=Ml(m,a);return b<0?(++this.size,m.push([a,u])):m[b][1]=u,this}Hn.prototype.clear=Wp,Hn.prototype.delete=Kv,Hn.prototype.get=Qv,Hn.prototype.has=zp,Hn.prototype.set=Zv;function Bn(a){var u=-1,m=a==null?0:a.length;for(this.clear();++u<m;){var b=a[u];this.set(b[0],b[1])}}function Xv(){this.size=0,this.__data__={hash:new bn,map:new(Yo||Hn),string:new bn}}function Ri(a){var u=ph(this,a).delete(a);return this.size-=u?1:0,u}function Jp(a){return ph(this,a).get(a)}function eb(a){return ph(this,a).has(a)}function tb(a,u){var m=ph(this,a),b=m.size;return m.set(a,u),this.size+=m.size==b?0:1,this}Bn.prototype.clear=Xv,Bn.prototype.delete=Ri,Bn.prototype.get=Jp,Bn.prototype.has=eb,Bn.prototype.set=tb;function Gi(a){var u=-1,m=a==null?0:a.length;for(this.__data__=new Bn;++u<m;)this.add(a[u])}function re(a){return this.__data__.set(a,l),this}function rb(a){return this.__data__.has(a)}Gi.prototype.add=Gi.prototype.push=re,Gi.prototype.has=rb;function tn(a){var u=this.__data__=new Hn(a);this.size=u.size}function Gp(){this.__data__=new Hn,this.size=0}function Ye(a){var u=this.__data__,m=u.delete(a);return this.size=u.size,m}function Nl(a){return this.__data__.get(a)}function Yp(a){return this.__data__.has(a)}function kc(a,u){var m=this.__data__;if(m instanceof Hn){var b=m.__data__;if(!Yo||b.length<r-1)return b.push([a,u]),this.size=++m.size,this;m=this.__data__=new Bn(b)}return m.set(a,u),this.size=m.size,this}tn.prototype.clear=Gp,tn.prototype.delete=Ye,tn.prototype.get=Nl,tn.prototype.has=Yp,tn.prototype.set=kc;function Kp(a,u){var m=Ee(a),b=!m&&ia(a),x=!m&&!b&&Vs(a),P=!m&&!b&&!x&&Hl(a),M=m||b||x||P,U=M?Cc(a.length,Iv):[],W=U.length;for(var Z in a)(u||ot.call(a,Z))&&!(M&&(Z=="length"||x&&(Z=="offset"||Z=="parent")||P&&(Z=="buffer"||Z=="byteLength"||Z=="byteOffset")||Zi(Z,W)))&&U.push(Z);return U}function Qp(a){var u=a.length;return u?a[mb(0,u-1)]:t}function nb(a,u){return hh(Lr(a),Ci(u,0,a.length))}function ib(a){return hh(Lr(a))}function Pc(a,u,m){(m!==t&&!Gn(a[u],m)||m===t&&!(u in a))&&rn(a,u,m)}function Or(a,u,m){var b=a[u];(!(ot.call(a,u)&&Gn(b,m))||m===t&&!(u in a))&&rn(a,u,m)}function Ml(a,u){for(var m=a.length;m--;)if(Gn(a[m][0],u))return m;return-1}function Zp(a,u,m,b){return xi(a,function(x,P,M){u(b,x,m(x),M)}),b}function Xp(a,u){return a&&Ei(u,tr(u),a)}function sb(a,u){return a&&Ei(u,Ur(u),a)}function rn(a,u,m){u=="__proto__"&&Ol?Ol(a,u,{configurable:!0,enumerable:!0,value:m,writable:!0}):a[u]=m}function Tc(a,u){for(var m=-1,b=u.length,x=z(b),P=a==null;++m<b;)x[m]=P?t:Ub(a,u[m]);return x}function Ci(a,u,m){return a===a&&(m!==t&&(a=a<=m?a:m),u!==t&&(a=a>=u?a:u)),a}function dr(a,u,m,b,x,P){var M,U=u&p,W=u&h,Z=u&g;if(m&&(M=x?m(a,b,x,P):m(a)),M!==t)return M;if(!Pt(a))return a;var X=Ee(a);if(X){if(M=XN(a),!U)return Lr(a,M)}else{var te=pr(a),oe=te==hn||te==Oo;if(Vs(a))return Bx(a,U);if(te==Mn||te==rr||oe&&!x){if(M=W||oe?{}:lE(a),!U)return W?HN(a,sb(M,a)):UN(a,Xp(M,a))}else{if(!gt[te])return x?a:{};M=eM(a,te,U)}}P||(P=new tn);var he=P.get(a);if(he)return he;P.set(a,M),FE(a)?a.forEach(function(be){M.add(dr(be,u,m,be,a,P))}):NE(a)&&a.forEach(function(be,Be){M.set(Be,dr(be,u,m,Be,a,P))});var we=Z?W?Eb:xb:W?Ur:tr,Pe=X?t:we(a);return Cr(Pe||a,function(be,Be){Pe&&(Be=be,be=a[Be]),Or(M,Be,dr(be,u,m,Be,a,P))}),M}function ob(a){var u=tr(a);return function(m){return Sn(m,a,u)}}function Sn(a,u,m){var b=m.length;if(a==null)return!b;for(a=ze(a);b--;){var x=m[b],P=u[x],M=a[x];if(M===t&&!(x in a)||!P(M))return!1}return!0}function Ac(a,u,m){if(typeof a!="function")throw new Ir(i);return jc(function(){a.apply(t,m)},u)}function Xo(a,u,m,b){var x=-1,P=ml,M=!0,U=a.length,W=[],Z=u.length;if(!U)return W;m&&(u=yt(u,xr(m))),b?(P=Ps,M=!1):u.length>=r&&(P=lt,M=!1,u=new Gi(u));e:for(;++x<U;){var X=a[x],te=m==null?X:m(X);if(X=b||X!==0?X:0,M&&te===te){for(var oe=Z;oe--;)if(u[oe]===te)continue e;W.push(X)}else P(u,te,b)||W.push(X)}return W}var xi=Gx(wn),eh=Gx(Vn,!0);function ab(a,u){var m=!0;return xi(a,function(b,x,P){return m=!!u(b,x,P),m}),m}function Fl(a,u,m){for(var b=-1,x=a.length;++b<x;){var P=a[b],M=u(P);if(M!=null&&(U===t?M===M&&!on(M):m(M,U)))var U=M,W=P}return W}function lb(a,u,m,b){var x=a.length;for(m=Oe(m),m<0&&(m=-m>x?0:x+m),b=b===t||b>x?x:Oe(b),b<0&&(b+=x),b=m>b?0:LE(b);m<b;)a[m++]=u;return a}function th(a,u){var m=[];return xi(a,function(b,x,P){u(b,x,P)&&m.push(b)}),m}function Gt(a,u,m,b,x){var P=-1,M=a.length;for(m||(m=rM),x||(x=[]);++P<M;){var U=a[P];u>0&&m(U)?u>1?Gt(U,u-1,m,b,x):bi(x,U):b||(x[x.length]=U)}return x}var $c=Yx(),rh=Yx(!0);function wn(a,u){return a&&$c(a,u,tr)}function Vn(a,u){return a&&rh(a,u,tr)}function Dl(a,u){return vi(u,function(m){return Xi(a[m])})}function Yi(a,u){u=Hs(u,a);for(var m=0,b=u.length;a!=null&&m<b;)a=a[Jn(u[m++])];return m&&m==b?a:t}function nh(a,u,m){var b=u(a);return Ee(a)?b:bi(b,m(a))}function nr(a){return a==null?a===t?up:$y:zi&&zi in ze(a)?KN(a):uM(a)}function Nc(a,u){return a>u}function ub(a,u){return a!=null&&ot.call(a,u)}function cb(a,u){return a!=null&&u in ze(a)}function fb(a,u,m){return a>=Jt(u,m)&&a<Ct(u,m)}function nn(a,u,m){for(var b=m?Ps:ml,x=a[0].length,P=a.length,M=P,U=z(P),W=1/0,Z=[];M--;){var X=a[M];M&&u&&(X=yt(X,xr(u))),W=Jt(X.length,W),U[M]=!m&&(u||x>=120&&X.length>=120)?new Gi(M&&X):t}X=a[0];var te=-1,oe=U[0];e:for(;++te<x&&Z.length<W;){var he=X[te],we=u?u(he):he;if(he=m||he!==0?he:0,!(oe?lt(oe,we):b(Z,we,m))){for(M=P;--M;){var Pe=U[M];if(!(Pe?lt(Pe,we):b(a[M],we,m)))continue e}oe&&oe.push(we),Z.push(he)}}return Z}function Ds(a,u,m,b){return wn(a,function(x,P,M){u(b,m(x),P,M)}),b}function ea(a,u,m){u=Hs(u,a),a=dE(a,u);var b=a==null?a:a[Jn(Rn(u))];return b==null?t:Rr(b,a,m)}function ih(a){return Tt(a)&&nr(a)==rr}function db(a){return Tt(a)&&nr(a)==ji}function pb(a){return Tt(a)&&nr(a)==Nr}function ta(a,u,m,b,x){return a===u?!0:a==null||u==null||!Tt(a)&&!Tt(u)?a!==a&&u!==u:Mc(a,u,m,b,ta,x)}function Mc(a,u,m,b,x,P){var M=Ee(a),U=Ee(u),W=M?$e:pr(a),Z=U?$e:pr(u);W=W==rr?Mn:W,Z=Z==rr?Mn:Z;var X=W==Mn,te=Z==Mn,oe=W==Z;if(oe&&Vs(a)){if(!Vs(u))return!1;M=!0,X=!1}if(oe&&!X)return P||(P=new tn),M||Hl(a)?sE(a,u,m,b,x,P):GN(a,u,W,m,b,x,P);if(!(m&v)){var he=X&&ot.call(a,"__wrapped__"),we=te&&ot.call(u,"__wrapped__");if(he||we){var Pe=he?a.value():a,be=we?u.value():u;return P||(P=new tn),x(Pe,be,m,b,P)}}return oe?(P||(P=new tn),YN(a,u,m,b,x,P)):!1}function Ls(a){return Tt(a)&&pr(a)==Zt}function js(a,u,m,b){var x=m.length,P=x,M=!b;if(a==null)return!P;for(a=ze(a);x--;){var U=m[x];if(M&&U[2]?U[1]!==a[U[0]]:!(U[0]in a))return!1}for(;++x<P;){U=m[x];var W=U[0],Z=a[W],X=U[1];if(M&&U[2]){if(Z===t&&!(W in a))return!1}else{var te=new tn;if(b)var oe=b(Z,X,W,a,u,te);if(!(oe===t?ta(X,Z,v|_,b,te):oe))return!1}}return!0}function He(a){if(!Pt(a)||iM(a))return!1;var u=Xi(a)?Tv:dp;return u.test(na(a))}function d(a){return Tt(a)&&nr(a)==Xt}function y(a){return Tt(a)&&pr(a)==_r}function S(a){return Tt(a)&&Sh(a.length)&&!!bt[nr(a)]}function R(a){return typeof a=="function"?a:a==null?Hr:typeof a=="object"?Ee(a)?Le(a[0],a[1]):_e(a):QE(a)}function I(a){if(!Lc(a))return Up(a);var u=[];for(var m in ze(a))ot.call(a,m)&&m!="constructor"&&u.push(m);return u}function L(a){if(!Pt(a))return lM(a);var u=Lc(a),m=[];for(var b in a)b=="constructor"&&(u||!ot.call(a,b))||m.push(b);return m}function Y(a,u){return a<u}function ae(a,u){var m=-1,b=jr(a)?z(a.length):[];return xi(a,function(x,P,M){b[++m]=u(x,P,M)}),b}function _e(a){var u=Ob(a);return u.length==1&&u[0][2]?cE(u[0][0],u[0][1]):function(m){return m===a||js(m,a,u)}}function Le(a,u){return kb(a)&&uE(u)?cE(Jn(a),u):function(m){var b=Ub(m,a);return b===t&&b===u?Hb(m,a):ta(u,b,v|_)}}function Ht(a,u,m,b,x){a!==u&&$c(u,function(P,M){if(x||(x=new tn),Pt(P))Wn(a,u,M,m,Ht,b,x);else{var U=b?b(Tb(a,M),P,M+"",a,u,x):t;U===t&&(U=P),Pc(a,M,U)}},Ur)}function Wn(a,u,m,b,x,P,M){var U=Tb(a,m),W=Tb(u,m),Z=M.get(W);if(Z){Pc(a,m,Z);return}var X=P?P(U,W,m+"",a,u,M):t,te=X===t;if(te){var oe=Ee(W),he=!oe&&Vs(W),we=!oe&&!he&&Hl(W);X=W,oe||he||we?Ee(U)?X=U:Dt(U)?X=Lr(U):he?(te=!1,X=Bx(W,!0)):we?(te=!1,X=Vx(W,!0)):X=[]:Uc(W)||ia(W)?(X=U,ia(U)?X=jE(U):(!Pt(U)||Xi(U))&&(X=lE(W))):te=!1}te&&(M.set(W,X),x(X,W,b,P,M),M.delete(W)),Pc(a,m,X)}function zn(a,u){var m=a.length;if(m)return u+=u<0?m:0,Zi(u,m)?a[u]:t}function Ax(a,u,m){u.length?u=yt(u,function(P){return Ee(P)?function(M){return Yi(M,P.length===1?P[0]:P)}:P}):u=[Hr];var b=-1;u=yt(u,xr(Se()));var x=ae(a,function(P,M,U){var W=yt(u,function(Z){return Z(P)});return{criteria:W,index:++b,value:P}});return hv(x,function(P,M){return jN(P,M,m)})}function ON(a,u){return $x(a,u,function(m,b){return Hb(a,b)})}function $x(a,u,m){for(var b=-1,x=u.length,P={};++b<x;){var M=u[b],U=Yi(a,M);m(U,M)&&Fc(P,Hs(M,a),U)}return P}function qN(a){return function(u){return Yi(u,a)}}function hb(a,u,m,b){var x=b?pv:Vi,P=-1,M=u.length,U=a;for(a===u&&(u=Lr(u)),m&&(U=yt(a,xr(m)));++P<M;)for(var W=0,Z=u[P],X=m?m(Z):Z;(W=x(U,X,W,b))>-1;)U!==a&&Il.call(U,W,1),Il.call(a,W,1);return a}function Nx(a,u){for(var m=a?u.length:0,b=m-1;m--;){var x=u[m];if(m==b||x!==P){var P=x;Zi(x)?Il.call(a,x,1):vb(a,x)}}return a}function mb(a,u){return a+Go(Bp()*(u-a+1))}function kN(a,u,m,b){for(var x=-1,P=Ct(Jo((u-a)/(m||1)),0),M=z(P);P--;)M[b?P:++x]=a,a+=m;return M}function gb(a,u){var m="";if(!a||u<1||u>ke)return m;do u%2&&(m+=a),u=Go(u/2),u&&(a+=a);while(u);return m}function Ne(a,u){return Ab(fE(a,u,Hr),a+"")}function PN(a){return Qp(Bl(a))}function TN(a,u){var m=Bl(a);return hh(m,Ci(u,0,m.length))}function Fc(a,u,m,b){if(!Pt(a))return a;u=Hs(u,a);for(var x=-1,P=u.length,M=P-1,U=a;U!=null&&++x<P;){var W=Jn(u[x]),Z=m;if(W==="__proto__"||W==="constructor"||W==="prototype")return a;if(x!=M){var X=U[W];Z=b?b(X,W,U):t,Z===t&&(Z=Pt(X)?X:Zi(u[x+1])?[]:{})}Or(U,W,Z),U=U[W]}return a}var Mx=Tl?function(a,u){return Tl.set(a,u),a}:Hr,AN=Ol?function(a,u){return Ol(a,"toString",{configurable:!0,enumerable:!1,value:Vb(u),writable:!0})}:Hr;function $N(a){return hh(Bl(a))}function _n(a,u,m){var b=-1,x=a.length;u<0&&(u=-u>x?0:x+u),m=m>x?x:m,m<0&&(m+=x),x=u>m?0:m-u>>>0,u>>>=0;for(var P=z(x);++b<x;)P[b]=a[b+u];return P}function NN(a,u){var m;return xi(a,function(b,x,P){return m=u(b,x,P),!m}),!!m}function sh(a,u,m){var b=0,x=a==null?b:a.length;if(typeof u=="number"&&u===u&&x<=mt){for(;b<x;){var P=b+x>>>1,M=a[P];M!==null&&!on(M)&&(m?M<=u:M<u)?b=P+1:x=P}return x}return yb(a,u,Hr,m)}function yb(a,u,m,b){var x=0,P=a==null?0:a.length;if(P===0)return 0;u=m(u);for(var M=u!==u,U=u===null,W=on(u),Z=u===t;x<P;){var X=Go((x+P)/2),te=m(a[X]),oe=te!==t,he=te===null,we=te===te,Pe=on(te);if(M)var be=b||we;else Z?be=we&&(b||oe):U?be=we&&oe&&(b||!he):W?be=we&&oe&&!he&&(b||!Pe):he||Pe?be=!1:be=b?te<=u:te<u;be?x=X+1:P=X}return Jt(P,We)}function Fx(a,u){for(var m=-1,b=a.length,x=0,P=[];++m<b;){var M=a[m],U=u?u(M):M;if(!m||!Gn(U,W)){var W=U;P[x++]=M===0?0:M}}return P}function Dx(a){return typeof a=="number"?a:on(a)?le:+a}function sn(a){if(typeof a=="string")return a;if(Ee(a))return yt(a,sn)+"";if(on(a))return Vp?Vp.call(a):"";var u=a+"";return u=="0"&&1/a==-pe?"-0":u}function Us(a,u,m){var b=-1,x=ml,P=a.length,M=!0,U=[],W=U;if(m)M=!1,x=Ps;else if(P>=r){var Z=u?null:zN(a);if(Z)return Sl(Z);M=!1,x=lt,W=new Gi}else W=u?[]:U;e:for(;++b<P;){var X=a[b],te=u?u(X):X;if(X=m||X!==0?X:0,M&&te===te){for(var oe=W.length;oe--;)if(W[oe]===te)continue e;u&&W.push(te),U.push(X)}else x(W,te,m)||(W!==U&&W.push(te),U.push(X))}return U}function vb(a,u){u=Hs(u,a);var m=-1,b=u.length;if(!b)return!0;for(;++m<b;){var x=Jn(u[m]);if(x==="__proto__"&&!ot.call(a,"__proto__")||(x==="constructor"||x==="prototype")&&m<b-1)return!1}var P=dE(a,u);return P==null||delete P[Jn(Rn(u))]}function Lx(a,u,m,b){return Fc(a,u,m(Yi(a,u)),b)}function oh(a,u,m,b){for(var x=a.length,P=b?x:-1;(b?P--:++P<x)&&u(a[P],P,a););return m?_n(a,b?0:P,b?P+1:x):_n(a,b?P+1:0,b?x:P)}function jx(a,u){var m=a;return m instanceof De&&(m=m.value()),wc(u,function(b,x){return x.func.apply(x.thisArg,bi([b],x.args))},m)}function bb(a,u,m){var b=a.length;if(b<2)return b?Us(a[0]):[];for(var x=-1,P=z(b);++x<b;)for(var M=a[x],U=-1;++U<b;)U!=x&&(P[x]=Xo(P[x]||M,a[U],u,m));return Us(Gt(P,1),u,m)}function Ux(a,u,m){for(var b=-1,x=a.length,P=u.length,M={};++b<x;){var U=b<P?u[b]:t;m(M,a[b],U)}return M}function Sb(a){return Dt(a)?a:[]}function wb(a){return typeof a=="function"?a:Hr}function Hs(a,u){return Ee(a)?a:kb(a,u)?[a]:gE(ct(a))}var MN=Ne;function Bs(a,u,m){var b=a.length;return m=m===t?b:m,!u&&m>=b?a:_n(a,u,m)}var Hx=Av||function(a){return Ut.clearTimeout(a)};function Bx(a,u){if(u)return a.slice();var m=a.length,b=Dp?Dp(m):new a.constructor(m);return a.copy(b),b}function _b(a){var u=new a.constructor(a.byteLength);return new xl(u).set(new xl(a)),u}function FN(a,u){var m=u?_b(a.buffer):a.buffer;return new a.constructor(m,a.byteOffset,a.byteLength)}function DN(a){var u=new a.constructor(a.source,fp.exec(a));return u.lastIndex=a.lastIndex,u}function LN(a){return Zo?ze(Zo.call(a)):{}}function Vx(a,u){var m=u?_b(a.buffer):a.buffer;return new a.constructor(m,a.byteOffset,a.length)}function Wx(a,u){if(a!==u){var m=a!==t,b=a===null,x=a===a,P=on(a),M=u!==t,U=u===null,W=u===u,Z=on(u);if(!U&&!Z&&!P&&a>u||P&&M&&W&&!U&&!Z||b&&M&&W||!m&&W||!x)return 1;if(!b&&!P&&!Z&&a<u||Z&&m&&x&&!b&&!P||U&&m&&x||!M&&x||!W)return-1}return 0}function jN(a,u,m){for(var b=-1,x=a.criteria,P=u.criteria,M=x.length,U=m.length;++b<M;){var W=Wx(x[b],P[b]);if(W){if(b>=U)return W;var Z=m[b];return W*(Z=="desc"?-1:1)}}return a.index-u.index}function zx(a,u,m,b){for(var x=-1,P=a.length,M=m.length,U=-1,W=u.length,Z=Ct(P-M,0),X=z(W+Z),te=!b;++U<W;)X[U]=u[U];for(;++x<M;)(te||x<P)&&(X[m[x]]=a[x]);for(;Z--;)X[U++]=a[x++];return X}function Jx(a,u,m,b){for(var x=-1,P=a.length,M=-1,U=m.length,W=-1,Z=u.length,X=Ct(P-U,0),te=z(X+Z),oe=!b;++x<X;)te[x]=a[x];for(var he=x;++W<Z;)te[he+W]=u[W];for(;++M<U;)(oe||x<P)&&(te[he+m[M]]=a[x++]);return te}function Lr(a,u){var m=-1,b=a.length;for(u||(u=z(b));++m<b;)u[m]=a[m];return u}function Ei(a,u,m,b){var x=!m;m||(m={});for(var P=-1,M=u.length;++P<M;){var U=u[P],W=b?b(m[U],a[U],U,m,a):t;W===t&&(W=a[U]),x?rn(m,U,W):Or(m,U,W)}return m}function UN(a,u){return Ei(a,qb(a),u)}function HN(a,u){return Ei(a,oE(a),u)}function ah(a,u){return function(m,b){var x=Ee(m)?Un:Zp,P=u?u():{};return x(m,a,Se(b,2),P)}}function Ll(a){return Ne(function(u,m){var b=-1,x=m.length,P=x>1?m[x-1]:t,M=x>2?m[2]:t;for(P=a.length>3&&typeof P=="function"?(x--,P):t,M&&qr(m[0],m[1],M)&&(P=x<3?t:P,x=1),u=ze(u);++b<x;){var U=m[b];U&&a(u,U,b,P)}return u})}function Gx(a,u){return function(m,b){if(m==null)return m;if(!jr(m))return a(m,b);for(var x=m.length,P=u?x:-1,M=ze(m);(u?P--:++P<x)&&b(M[P],P,M)!==!1;);return m}}function Yx(a){return function(u,m,b){for(var x=-1,P=ze(u),M=b(u),U=M.length;U--;){var W=M[a?U:++x];if(m(P[W],W,P)===!1)break}return u}}function BN(a,u,m){var b=u&w,x=Dc(a);function P(){var M=this&&this!==Ut&&this instanceof P?x:a;return M.apply(b?m:this,arguments)}return P}function Kx(a){return function(u){u=ct(u);var m=Ts(u)?Er(u):t,b=m?m[0]:u.charAt(0),x=m?Bs(m,1).join(""):u.slice(1);return b[a]()+x}}function jl(a){return function(u){return wc(YE(GE(u).replace(Xy,"")),a,"")}}function Dc(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 m=Fs(a.prototype),b=a.apply(m,u);return Pt(b)?b:m}}function VN(a,u,m){var b=Dc(a);function x(){for(var P=arguments.length,M=z(P),U=P,W=Ul(x);U--;)M[U]=arguments[U];var Z=P<3&&M[0]!==W&&M[P-1]!==W?[]:vn(M,W);if(P-=Z.length,P<m)return tE(a,u,lh,x.placeholder,t,M,Z,t,t,m-P);var X=this&&this!==Ut&&this instanceof x?b:a;return Rr(X,this,M)}return x}function Qx(a){return function(u,m,b){var x=ze(u);if(!jr(u)){var P=Se(m,3);u=tr(u),m=function(U){return P(x[U],U,x)}}var M=a(u,m,b);return M>-1?x[P?u[M]:M]:t}}function Zx(a){return Qi(function(u){var m=u.length,b=m,x=fr.prototype.thru;for(a&&u.reverse();b--;){var P=u[b];if(typeof P!="function")throw new Ir(i);if(x&&!M&&dh(P)=="wrapper")var M=new fr([],!0)}for(b=M?b:m;++b<m;){P=u[b];var U=dh(P),W=U=="wrapper"?Ib(P):t;W&&Pb(W[0])&&W[1]==(G|T|$|q)&&!W[4].length&&W[9]==1?M=M[dh(W[0])].apply(M,W[3]):M=P.length==1&&Pb(P)?M[U]():M.thru(P)}return function(){var Z=arguments,X=Z[0];if(M&&Z.length==1&&Ee(X))return M.plant(X).value();for(var te=0,oe=m?u[te].apply(this,Z):X;++te<m;)oe=u[te].call(this,oe);return oe}})}function lh(a,u,m,b,x,P,M,U,W,Z){var X=u&G,te=u&w,oe=u&E,he=u&(T|N),we=u&C,Pe=oe?t:Dc(a);function be(){for(var Be=arguments.length,Je=z(Be),an=Be;an--;)Je[an]=arguments[an];if(he)var kr=Ul(be),ln=$p(Je,kr);if(b&&(Je=zx(Je,b,x,he)),P&&(Je=Jx(Je,P,M,he)),Be-=ln,he&&Be<Z){var Lt=vn(Je,kr);return tE(a,u,lh,be.placeholder,m,Je,Lt,U,W,Z-Be)}var Yn=te?m:this,ts=oe?Yn[a]:a;return Be=Je.length,U?Je=cM(Je,U):we&&Be>1&&Je.reverse(),X&&W<Be&&(Je.length=W),this&&this!==Ut&&this instanceof be&&(ts=Pe||Dc(ts)),ts.apply(Yn,Je)}return be}function Xx(a,u){return function(m,b){return Ds(m,a,u(b),{})}}function uh(a,u){return function(m,b){var x;if(m===t&&b===t)return u;if(m!==t&&(x=m),b!==t){if(x===t)return b;typeof m=="string"||typeof b=="string"?(m=sn(m),b=sn(b)):(m=Dx(m),b=Dx(b)),x=a(m,b)}return x}}function Rb(a){return Qi(function(u){return u=yt(u,xr(Se())),Ne(function(m){var b=this;return a(u,function(x){return Rr(x,b,m)})})})}function ch(a,u){u=u===t?" ":sn(u);var m=u.length;if(m<2)return m?gb(u,a):u;var b=gb(u,Jo(a/Si(u)));return Ts(u)?Bs(Er(b),0,a).join(""):b.slice(0,a)}function WN(a,u,m,b){var x=u&w,P=Dc(a);function M(){for(var U=-1,W=arguments.length,Z=-1,X=b.length,te=z(X+W),oe=this&&this!==Ut&&this instanceof M?P:a;++Z<X;)te[Z]=b[Z];for(;W--;)te[Z++]=arguments[++U];return Rr(oe,x?m:this,te)}return M}function eE(a){return function(u,m,b){return b&&typeof b!="number"&&qr(u,m,b)&&(m=b=t),u=es(u),m===t?(m=u,u=0):m=es(m),b=b===t?u<m?1:-1:es(b),kN(u,m,b,a)}}function fh(a){return function(u,m){return typeof u=="string"&&typeof m=="string"||(u=Cn(u),m=Cn(m)),a(u,m)}}function tE(a,u,m,b,x,P,M,U,W,Z){var X=u&T,te=X?M:t,oe=X?t:M,he=X?P:t,we=X?t:P;u|=X?$:j,u&=~(X?j:$),u&k||(u&=~(w|E));var Pe=[a,u,x,he,te,we,oe,U,W,Z],be=m.apply(t,Pe);return Pb(a)&&pE(be,Pe),be.placeholder=b,hE(be,a,u)}function Cb(a){var u=ut[a];return function(m,b){if(m=Cn(m),b=b==null?0:Jt(Oe(b),292),b&&Ji(m)){var x=(ct(m)+"e").split("e"),P=u(x[0]+"e"+(+x[1]+b));return x=(ct(P)+"e").split("e"),+(x[0]+"e"+(+x[1]-b))}return u(m)}}var zN=Ns&&1/Sl(new Ns([,-0]))[1]==pe?function(a){return new Ns(a)}:Jb;function rE(a){return function(u){var m=pr(u);return m==Zt?As(u):m==_r?Np(u):mv(u,a(u))}}function Ki(a,u,m,b,x,P,M,U){var W=u&E;if(!W&&typeof a!="function")throw new Ir(i);var Z=b?b.length:0;if(Z||(u&=~($|j),b=x=t),M=M===t?M:Ct(Oe(M),0),U=U===t?U:Oe(U),Z-=x?x.length:0,u&j){var X=b,te=x;b=x=t}var oe=W?t:Ib(a),he=[a,u,m,b,x,X,te,P,M,U];if(oe&&aM(he,oe),a=he[0],u=he[1],m=he[2],b=he[3],x=he[4],U=he[9]=he[9]===t?W?0:a.length:Ct(he[9]-Z,0),!U&&u&(T|N)&&(u&=~(T|N)),!u||u==w)var we=BN(a,u,m);else u==T||u==N?we=VN(a,u,U):(u==$||u==(w|$))&&!x.length?we=WN(a,u,m,b):we=lh.apply(t,he);var Pe=oe?Mx:pE;return hE(Pe(we,he),a,u)}function nE(a,u,m,b){return a===t||Gn(a,$s[m])&&!ot.call(b,m)?u:a}function iE(a,u,m,b,x,P){return Pt(a)&&Pt(u)&&(P.set(u,a),Ht(a,u,t,iE,P),P.delete(u)),a}function JN(a){return Uc(a)?t:a}function sE(a,u,m,b,x,P){var M=m&v,U=a.length,W=u.length;if(U!=W&&!(M&&W>U))return!1;var Z=P.get(a),X=P.get(u);if(Z&&X)return Z==u&&X==a;var te=-1,oe=!0,he=m&_?new Gi:t;for(P.set(a,u),P.set(u,a);++te<U;){var we=a[te],Pe=u[te];if(b)var be=M?b(Pe,we,te,u,a,P):b(we,Pe,te,a,u,P);if(be!==t){if(be)continue;oe=!1;break}if(he){if(!gl(u,function(Be,Je){if(!lt(he,Je)&&(we===Be||x(we,Be,m,b,P)))return he.push(Je)})){oe=!1;break}}else if(!(we===Pe||x(we,Pe,m,b,P))){oe=!1;break}}return P.delete(a),P.delete(u),oe}function GN(a,u,m,b,x,P,M){switch(m){case Fn:if(a.byteLength!=u.byteLength||a.byteOffset!=u.byteOffset)return!1;a=a.buffer,u=u.buffer;case ji:return!(a.byteLength!=u.byteLength||!P(new xl(a),new xl(u)));case en:case Nr:case qo:return Gn(+a,+u);case Rt:return a.name==u.name&&a.message==u.message;case Xt:case ko:return a==u+"";case Zt:var U=As;case _r:var W=b&v;if(U||(U=Sl),a.size!=u.size&&!W)return!1;var Z=M.get(a);if(Z)return Z==u;b|=_,M.set(a,u);var X=sE(U(a),U(u),b,x,P,M);return M.delete(a),X;case tl:if(Zo)return Zo.call(a)==Zo.call(u)}return!1}function YN(a,u,m,b,x,P){var M=m&v,U=xb(a),W=U.length,Z=xb(u),X=Z.length;if(W!=X&&!M)return!1;for(var te=W;te--;){var oe=U[te];if(!(M?oe in u:ot.call(u,oe)))return!1}var he=P.get(a),we=P.get(u);if(he&&we)return he==u&&we==a;var Pe=!0;P.set(a,u),P.set(u,a);for(var be=M;++te<W;){oe=U[te];var Be=a[oe],Je=u[oe];if(b)var an=M?b(Je,Be,oe,u,a,P):b(Be,Je,oe,a,u,P);if(!(an===t?Be===Je||x(Be,Je,m,b,P):an)){Pe=!1;break}be||(be=oe=="constructor")}if(Pe&&!be){var kr=a.constructor,ln=u.constructor;kr!=ln&&"constructor"in a&&"constructor"in u&&!(typeof kr=="function"&&kr instanceof kr&&typeof ln=="function"&&ln instanceof ln)&&(Pe=!1)}return P.delete(a),P.delete(u),Pe}function Qi(a){return Ab(fE(a,t,SE),a+"")}function xb(a){return nh(a,tr,qb)}function Eb(a){return nh(a,Ur,oE)}var Ib=Tl?function(a){return Tl.get(a)}:Jb;function dh(a){for(var u=a.name+"",m=Ms[u],b=ot.call(Ms,u)?m.length:0;b--;){var x=m[b],P=x.func;if(P==null||P==a)return x.name}return u}function Ul(a){var u=ot.call(O,"placeholder")?O:a;return u.placeholder}function Se(){var a=O.iteratee||Wb;return a=a===Wb?R:a,arguments.length?a(arguments[0],arguments[1]):a}function ph(a,u){var m=a.__data__;return nM(u)?m[typeof u=="string"?"string":"hash"]:m.map}function Ob(a){for(var u=tr(a),m=u.length;m--;){var b=u[m],x=a[b];u[m]=[b,x,uE(x)]}return u}function ra(a,u){var m=Uo(a,u);return He(m)?m:t}function KN(a){var u=ot.call(a,zi),m=a[zi];try{a[zi]=t;var b=!0}catch{}var x=Rl.call(a);return b&&(u?a[zi]=m:delete a[zi]),x}var qb=ql?function(a){return a==null?[]:(a=ze(a),vi(ql(a),function(u){return Wo.call(a,u)}))}:Gb,oE=ql?function(a){for(var u=[];a;)bi(u,qb(a)),a=El(a);return u}:Gb,pr=nr;(Ic&&pr(new Ic(new ArrayBuffer(1)))!=Fn||Yo&&pr(new Yo)!=Zt||Oc&&pr(Oc.resolve())!=ap||Ns&&pr(new Ns)!=_r||Ko&&pr(new Ko)!=zt)&&(pr=function(a){var u=nr(a),m=u==Mn?a.constructor:t,b=m?na(m):"";if(b)switch(b){case Dv:return Fn;case Lv:return Zt;case jv:return ap;case Uv:return _r;case Hv:return zt}return u});function QN(a,u,m){for(var b=-1,x=m.length;++b<x;){var P=m[b],M=P.size;switch(P.type){case"drop":a+=M;break;case"dropRight":u-=M;break;case"take":u=Jt(u,a+M);break;case"takeRight":a=Ct(a,u-M);break}}return{start:a,end:u}}function ZN(a){var u=a.match(Dn);return u?u[1].split(gn):[]}function aE(a,u,m){u=Hs(u,a);for(var b=-1,x=u.length,P=!1;++b<x;){var M=Jn(u[b]);if(!(P=a!=null&&m(a,M)))break;a=a[M]}return P||++b!=x?P:(x=a==null?0:a.length,!!x&&Sh(x)&&Zi(M,x)&&(Ee(a)||ia(a)))}function XN(a){var u=a.length,m=new a.constructor(u);return u&&typeof a[0]=="string"&&ot.call(a,"index")&&(m.index=a.index,m.input=a.input),m}function lE(a){return typeof a.constructor=="function"&&!Lc(a)?Fs(El(a)):{}}function eM(a,u,m){var b=a.constructor;switch(u){case ji:return _b(a);case en:case Nr:return new b(+a);case Fn:return FN(a,m);case pt:case rl:case nl:case Cs:case Po:case xs:case yi:case Es:case oc:return Vx(a,m);case Zt:return new b;case qo:case ko:return new b(a);case Xt:return DN(a);case _r:return new b;case tl:return LN(a)}}function tM(a,u){var m=u.length;if(!m)return a;var b=m-1;return u[b]=(m>1?"& ":"")+u[b],u=u.join(m>2?", ":" "),a.replace(er,`{
1
+ var Rj=Object.create;var _h=Object.defineProperty;var Cj=Object.getOwnPropertyDescriptor;var xj=Object.getOwnPropertyNames;var Ej=Object.getPrototypeOf,Ij=Object.prototype.hasOwnProperty;var ft=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var se=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var H=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Ws=(t,e)=>{for(var r in e)_h(t,r,{get:e[r],enumerable:!0})},XE=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of xj(e))!Ij.call(t,i)&&i!==r&&_h(t,i,{get:()=>e[i],enumerable:!(n=Cj(e,i))||n.enumerable});return t};var Hc=(t,e,r)=>(r=t!=null?Rj(Ej(t)):{},XE(e||!t||!t.__esModule?_h(r,"default",{value:t,enumerable:!0}):r,t)),Vl=t=>XE(_h({},"__esModule",{value:!0}),t);function $t(t){return t.replace(/[^a-zA-Z0-9-_]/g,"_").replace(/\s+/g,"-").toLowerCase().substring(0,100)}function St(t){let e=Date.now().toString(36)+(Oj++).toString(36)+Math.random().toString(36).slice(2,7);return t?`${$t(t)}_${e}`:e}function Kb(){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 Bc(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 qj(t){return JSON.parse(JSON.stringify(t))}function kj(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Pj(t,e){try{return JSON.parse(t)}catch{return e}}function Tj(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 Aj(t){return t<1e3?`${t} ms`:`${(t/1e3).toFixed(2)} s`}var Oj,xn=se(()=>{"use strict";Oj=0});import*as at from"fs";import*as un from"path";function Ch(t){if(!at.existsSync(t))return;let e={},r=un.join(t,Rh.preRequest);at.existsSync(r)&&(e.preRequest=at.readFileSync(r,"utf-8"));let n=un.join(t,Rh.postResponse);return at.existsSync(n)&&(e.postResponse=at.readFileSync(n,"utf-8")),Object.keys(e).length>0?e:void 0}async function xh(t,e){await at.promises.mkdir(t,{recursive:!0});let r=un.join(t,Rh.preRequest);e.preRequest?await at.promises.writeFile(r,e.preRequest,"utf-8"):at.existsSync(r)&&await at.promises.unlink(r);let n=un.join(t,Rh.postResponse);e.postResponse?await at.promises.writeFile(n,e.postResponse,"utf-8"):at.existsSync(n)&&await at.promises.unlink(n)}function tI(t){for(let[e,r]of Object.entries(eI)){let n=un.join(t,e);if(at.existsSync(n))try{let i=at.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 rI(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 nI(t,e){for(let r of Object.keys(eI))if(r!==e){let n=un.join(t,r);if(at.existsSync(n))try{await at.promises.unlink(n)}catch{}}}function iI(t){if(at.existsSync(t))try{let e=at.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){console.error(`[FolderIO] Failed to load schema file ${t}:`,e);return}}async function sI(t,e,r){let n=un.join(t,Vc.responseSchema),i=un.join(t,Vc.bodySchema);e?await at.promises.writeFile(n,JSON.stringify(e,null,2),"utf-8"):at.existsSync(n)&&await at.promises.unlink(n),r?await at.promises.writeFile(i,JSON.stringify(r,null,2),"utf-8"):at.existsSync(i)&&await at.promises.unlink(i)}function Qb(t,e){for(let r of t){if(r.id===e)return r;if(r.type==="folder"&&r.items){let n=Qb(r.items,e);if(n)return n}}}function Zb(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&&Zb(n.items,e))return!0}return!1}function oI(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 Xb(t,e){let r;try{r=at.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===cn)continue;if(n.name===e)return un.join(t,n.name);let i=Xb(un.join(t,n.name),e);if(i)return i}}function $j(t){for(let e of[Pr.request,Pr.folder]){let r=un.join(t,e);if(at.existsSync(r))try{let n=at.readFileSync(r,"utf-8");return JSON.parse(n).id}catch{return}}}function eS(t,e){let r;try{r=at.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===cn)continue;let i=un.join(t,n.name);if($j(i)===e)return i;let s=eS(i,e);if(s)return s}}function En(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 g of s){let v=parseInt(g.substring(1));v>o&&(o=v)}let l="";if(o>0)l=`t${o}`;else{let g=r.match(/[_\s-](\d+\.\d+)[_\s-]/);g&&(l=`v${g[1].replace(".","_")}`)}let f=r;n&&(f=f.substring(n[0].length)),f=f.replace(/[_\s-]?t\d+(?:\.\d+)?[_\s-]?/gi,"-"),f=f.replace(/[_\s-]?\d+\.\d+[_\s-]?/g,"-"),f=f.replace(/\([^)]+\)/g,""),f=f.replace(/:[a-z_][a-z0-9_]*/gi,""),f=f.replace(/\{[^}]+\}/g,""),f=f.replace(/\?$/g,"").replace(/[_/\\ ]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"");let c=f.split("-").filter(g=>g.length>0),p=[];i&&p.push(i),p.push(...c),l&&p.push(l);let h=p.join("-");if(h||(h="item"),e.includes(h)){let g=2;for(;e.includes(`${h}-${g}`);)g++;h=`${h}-${g}`}return h}var Rh,Pr,eI,Vc,cn,oa=se(()=>{"use strict";Rh={preRequest:"pre-request.js",postResponse:"post-response.js"},Pr={collection:"collection.json",folder:"folder.json",request:"request.json"},eI={"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"}},Vc={responseSchema:"response.schema.json",bodySchema:"body.schema.json"},cn="scripts"});import*as Ie from"fs";import*as Te from"path";var zs,Eh=se(()=>{"use strict";xn();oa();zs=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(){Ie.existsSync(this.collectionsDir)||Ie.mkdirSync(this.collectionsDir,{recursive:!0})}readJsonFileSafe(e,r){let n;try{n=Ie.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(),!Ie.existsSync(this.collectionsDir))return[];let e=Ie.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=Te.join(this.collectionsDir,e),n=Te.join(r,Pr.collection);if(!Ie.existsSync(n))return;let i=this.readJsonFileSafe(n,"collection");if(i)try{let s=this.loadScriptsFromDir(Te.join(r,cn)),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=Ie.readdirSync(e,{withFileTypes:!0});for(let l of o){if(!l.isDirectory()||l.name===cn)continue;let f=Te.join(e,l.name);if(Ie.existsSync(Te.join(f,Pr.folder))){let c=this.loadFolderFromDir(f,l.name);c&&s.set(l.name,c)}else if(Ie.existsSync(Te.join(f,Pr.request))){let c=this.loadRequestFromDir(f,l.name);c&&s.set(l.name,c)}}if(n&&n.length>0){for(let l of n){let f=s.get(l);f&&(i.push(f),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=Te.join(e,Pr.folder),i=this.readJsonFileSafe(n,"folder");if(i)try{let s=this.loadScriptsFromDir(Te.join(e,cn)),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=Te.join(e,Pr.request),i=this.readJsonFileSafe(n,"request");if(i)try{let s=this.loadScriptsFromDir(Te.join(e,cn)),o=i.body,l=this.loadBodyFromDir(e);l&&(o=l);let f=this.loadSchemaFile(Te.join(e,Vc.responseSchema)),c=this.loadSchemaFile(Te.join(e,Vc.bodySchema)),p=Te.join(e,"doc.md"),h=Ie.existsSync(p)?Ie.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,auth:i.auth,settings:i.settings,scripts:s,deprecated:i.deprecated,operationId:i.operationId,summary:i.summary,tags:i.tags,examples:i.examples,responses:i.responses,security:i.security,...h&&{doc:h},...f&&{responseSchema:f},...c&&{bodySchema:c}}}catch(s){console.error(`[FolderCollectionStore] Failed to load request ${e}:`,s);return}}loadScriptsFromDir(e){return Ch(e)}loadBodyFromDir(e){return tI(e)}loadSchemaFile(e){return iI(e)}async saveSchemaFiles(e,r){return sI(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=St(e.name));let r=this.idToSlugMap.get(e.id);if(!r){let l=Ie.readdirSync(this.collectionsDir);r=En(e.name,l),this.idToSlugMap.set(e.id,r),this.slugToIdMap.set(r,e.id)}let n=Te.join(this.collectionsDir,r),i=!Ie.existsSync(n);await Ie.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(Te.join(n,cn),e.scripts):Promise.resolve()]);o.length>0&&(s.order=o),await Ie.promises.writeFile(Te.join(n,Pr.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=En(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 f=Te.join(e,l);await Ie.promises.mkdir(f,{recursive:!0}),o.type==="folder"?await this.saveFolderToDir(f,o,n):await this.saveRequestToDir(f,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(Te.join(e,cn),r.scripts):Promise.resolve()]);s.length>0&&(i.order=s),await Ie.promises.writeFile(Te.join(e,Pr.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,auth:r.auth,settings:r.settings,...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=[Ie.promises.writeFile(Te.join(e,Pr.request),JSON.stringify(o,null,2),"utf-8")];s&&l.push(Ie.promises.writeFile(Te.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(Ie.promises.writeFile(Te.join(e,"doc.md"),r.doc,"utf-8")),r.scripts&&l.push(this.saveScriptsToDir(Te.join(e,cn),r.scripts)),await Promise.all(l)}prepareBodyForSave(e){return rI(e)}async cleanupOldBodyFiles(e,r){return nI(e,r)}async saveScriptsToDir(e,r){return xh(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=Te.join(this.collectionsDir,r);if(!Ie.existsSync(n))return!1;try{return await Ie.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?Ie.existsSync(Te.join(this.collectionsDir,r,Pr.collection)):!1}getCollectionPath(e){let r=this.idToSlugMap.get(e)||e;return Te.join(this.collectionsDir,r)}getItemPath(e,r){return this.findItemPath(e,r)}async create(e,r){let n={id:r||St(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(Te.join(s,cn),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(Te.join(n,cn))}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=Te.join(this.collectionsDir,i),o=Te.join(s,Pr.collection),l=Ie.readFileSync(o,"utf-8"),c={...JSON.parse(l),...r,id:e};await Ie.promises.writeFile(o,JSON.stringify(c,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=Te.join(this.collectionsDir,s);let l=this.idToSlugMap.get(r.id);if(!l){let p=Ie.readdirSync(o).filter(h=>Ie.statSync(Te.join(o,h)).isDirectory()&&h!==cn);l=En(r.name,p),this.idToSlugMap.set(r.id,l),this.slugToIdMap.set(l,r.id)}let f=Te.join(o,l);await Ie.promises.mkdir(f,{recursive:!0}),r.type==="folder"?await this.saveFolderToDir(f,r):await this.saveRequestToDir(f,r);let c=this.findItemById(i.items,r.id);if(c)Object.assign(c,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||!Ie.existsSync(i))return!1;try{await Ie.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:f,items:c,...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||!Ie.existsSync(o))return!1;let l;if(n){let p=this.findItemPath(e,n);if(!p)return!1;l=p}else l=Te.join(this.collectionsDir,s);let f=this.idToSlugMap.get(r);if(!f)return!1;let c=Te.join(l,f);if(Ie.existsSync(c))return!1;try{await Ie.promises.rename(o,c);let p=this.findItemById(i.items,r);if(p){let h=p.type==="folder"?{...p,items:p.items?[...p.items]:[]}:{...p};if(this.deleteItemFromTree(i.items,r),n){let g=this.findItemById(i.items,n);g&&g.type==="folder"&&(g.items=g.items||[],g.items.push(h))}else i.items.push(h)}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 f=this.idToSlugMap.get(l);f&&o.push(f)}try{if(r){let l=this.findItemPath(e,r);if(!l)return!1;let f=Te.join(l,Pr.folder),c=Ie.readFileSync(f,"utf-8"),p=JSON.parse(c);p.order=o,await Ie.promises.writeFile(f,JSON.stringify(p,null,2),"utf-8");let h=this.findItemById(i.items,r);h&&h.type==="folder"&&h.items&&(h.items=this.sortItemsByOrder(h.items,n))}else{let l=Te.join(this.collectionsDir,s,Pr.collection),f=Ie.readFileSync(l,"utf-8"),c=JSON.parse(f);c.order=o,await Ie.promises.writeFile(l,JSON.stringify(c,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 oI(e,r)}findItemPath(e,r){let n=this.idToSlugMap.get(e);if(!n)return;let i=Te.join(this.collectionsDir,n),s=eS(i,r);if(s)return s;let o=this.load(e);if(o){let f=this.buildSlugPath(o.items,r);if(f)return Te.join(i,...f)}let l=this.idToSlugMap.get(r);if(l)return Xb(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 Qb(e,r)}deleteItemFromTree(e,r){return Zb(e,r)}}});var ht,aa=se(()=>{"use strict";ht=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(),f=i.substring(o+1).trim(),c={name:l,value:f,domain:r};for(let p of s){let h=p.indexOf("="),g=(h===-1?p:p.substring(0,h)).toLowerCase(),v=h===-1?"":p.substring(h+1);switch(g){case"domain":c.domain=v.startsWith(".")?v.substring(1):v;break;case"path":c.path=v;break;case"expires":c.expires=v;break;case"max-age":c.maxAge=parseInt(v,10);break;case"httponly":c.httpOnly=!0;break;case"secure":c.secure=!0;break;case"samesite":c.sameSite=v;break}}return c}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"/"}}}});import*as Js from"fs";import*as la from"path";function Oh(t){let e=t.toLowerCase();return e==="_global.json"||e==="_global.local.json"||e.endsWith(".local.json")}function Gc(t){if(!Js.existsSync(t))return Mj();let e=Ih(la.join(t,"_global.json"))||{},r=e.variables||{},n=e.defaultHeaders||{},i=Js.readdirSync(t).filter(c=>c.endsWith(".json")).filter(c=>!c.endsWith(".local.json")).filter(c=>!Oh(c)),s={};for(let c of i){let p=Ih(la.join(t,c))||{},h=la.basename(c,".json");s[h]={description:p.description,requiresConfirmation:p.requiresConfirmation,variables:p.variables||{},secretVariables:p.secretVariables}}let l=(Ih(la.join(t,"_global.local.json"))||{}).variables||{},f={};for(let c of Object.keys(s)){let p=la.join(t,`${c}.local.json`);if(Js.existsSync(p)){let h=Ih(p)||{};f[c]={variables:h.variables||{}}}}return{globalVariables:r,defaultHeaders:n,environments:s,localVariables:l,localCredentials:f}}function Mj(){return{globalVariables:{},defaultHeaders:{},environments:{},localVariables:{},localCredentials:{}}}function Ih(t){try{if(!Js.existsSync(t))return null;let e=Js.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 qh=se(()=>{"use strict"});var Kn,zl=se(()=>{"use strict";Kn=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 f=s.match(/^(https?:\/\/)([^\/]*)(\/.*)?$/);f&&(n=f[1],i=f[2],s=f[3]||"/");let c=/:(\w+)(?:\([^)]*\))?(\?)?/g,p=s.replace(c,(h,g,v)=>{let _=r[g];return _!==void 0&&_!==""?encodeURIComponent(_):v?"":(console.warn(`[UrlBuilder] Missing required path parameter: ${g}`),h)});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[f,c]=e.split("?");n=f,c&&new URLSearchParams(c).forEach((h,g)=>{i[g]=h})}let s={...i,...r},o=new URLSearchParams;for(let[f,c]of Object.entries(s))c!=null&&o.append(f,c);let l=o.toString();return l?`${n}?${l}`:n}}});function lI(t,e=0){return(or[t[e+0]]+or[t[e+1]]+or[t[e+2]]+or[t[e+3]]+"-"+or[t[e+4]]+or[t[e+5]]+"-"+or[t[e+6]]+or[t[e+7]]+"-"+or[t[e+8]]+or[t[e+9]]+"-"+or[t[e+10]]+or[t[e+11]]+or[t[e+12]]+or[t[e+13]]+or[t[e+14]]+or[t[e+15]]).toLowerCase()}var or,uI=se(()=>{or=[];for(let t=0;t<256;++t)or.push((t+256).toString(16).slice(1))});function nS(){return crypto.getRandomValues(Fj)}var Fj,cI=se(()=>{Fj=new Uint8Array(16)});function Dj(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():Lj(t,e,r)}function Lj(t,e,r){t=t||{};let n=t.random??t.rng?.()??nS();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 lI(n)}var Jl,fI=se(()=>{cI();uI();Jl=Dj});var iS=se(()=>{fI()});function jj(t=0,e=999){return Math.floor(Math.random()*(e-t+1))+t}function Uj(){return Date.now()}function dI(){return Jl()}function Hj(){return Jl()}function pI(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 Bj(){let t=pI(8).toLowerCase(),e=["example.com","test.org","mail.dev","sample.net"];return`${t}@${e[Math.floor(Math.random()*e.length)]}`}function Vj(){return Math.random()<.5}function Wj(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 zj(){return Math.floor(Date.now()/1e3)}function Jj(){return new Date().toISOString()}function Gj(){return new Date().toISOString().split("T")[0]}function Yj(){return new Date().toISOString().split("T")[1].split(".")[0]}function Kj(){return new Date().toISOString()}function Qj(t=""){return Buffer.from(String(t)).toString("base64")}function Zj(t=""){return Buffer.from(String(t),"base64").toString("utf-8")}function Xj(t=""){return encodeURIComponent(String(t))}function e2(t=""){return decodeURIComponent(String(t))}function t2(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 ns(t,e){let r=hI[t];return r?e&&e.length>0?r(...e):r():null}function r2(t){return!t||typeof t!="string"?t:t.replace(/\{\{\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?\}\}/g,(e,r,n)=>{try{let i=n?t2(n):void 0,s=ns(r,i);return s===null?e:String(s)}catch{return e}})}function ua(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=ns(o);l!==null&&(n||(n={...e}),n[s]=l)}}return n??e}var hI,kh=se(()=>{"use strict";iS();hI={randomInt:jj,timestamp:Uj,guid:Hj,uuid:dI,randomUUID:dI,randomString:pI,randomHexadecimal:Wj,randomEmail:Bj,randomBoolean:Vj,isoTimestamp:Kj,timestamp_s:zj,datetime:Jj,date:Gj,time:Yj,base64Encode:Qj,base64Decode:Zj,urlEncode:Xj,urlDecode:e2}});import*as Ph from"vm";function ca(t){let e=t.trim();return!e||/^(\$?)[a-zA-Z_][a-zA-Z0-9_]*(\([^)]*\))?$/.test(e)||/(?<!\|)\|(?!\|)/.test(e)?!1:/[+\-*/%<>=!&|?:~^()[\]{}.,`]/.test(e)}function fa(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=Ph.createContext(r);return Ph.runInContext(t,n,{timeout:n2,displayErrors:!1})}catch{return}}var n2,Th=se(()=>{"use strict";n2=100});import*as Ah from"crypto";function i2(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function Kc(t){if(!t||!t.includes("|"))return null;let e=s2(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=o2(s);o&&n.push(o)}return n.length===0?null:{input:r,filters:n}}function s2(t){let e=[],r="",n=0,i=!1,s=!1;for(let o=0;o<t.length;o++){let l=t[o],f=o>0?t[o-1]:"",c=o<t.length-1?t[o+1]:"";if(f==="\\"){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(c==="|"){r+="||",o++;continue}e.push(r),r="";continue}r+=l}return r&&e.push(r),e}function o2(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:a2(n)}}function a2(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 Nt(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=i2(e[t]),i=Number(n);return!isNaN(i)&&n!==""?i:n}return t}function Qc(t,e,r={}){let n=t;for(let i of e)n=l2(n,i.name,i.args,r);return n}function l2(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=Nt(r[0],n),s=r[1]!==void 0?Nt(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(Nt(r[0],n)):"",s=r[1]!==void 0?String(Nt(r[1],n)):"";return String(t).replace(new RegExp(c2(i),"g"),s)}case"split":{let i=r[0]!==void 0?String(Nt(r[0],n)):",";return String(t).split(i)}case"join":{let i=r[0]!==void 0?String(Nt(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(Nt(r[0],n)):"{0}";i=i.replace("{0}",String(t));for(let s=1;s<r.length;s++){let o=Nt(r[s],n);i=i.replace(`{${s}}`,String(o))}return i}case"add":{let i=Nt(r[0],n);return Number(t)+i}case"subtract":{let i=Nt(r[0],n);return Number(t)-i}case"multiply":{let i=Nt(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?Nt(r[0],n):"md5").toLowerCase(),s=String(r[1]!==void 0?Nt(r[1],n):"base64"),l={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[i]||"md5";return Ah.createHash(l).update(String(t)).digest(s)}case"hmac":{let i=r[0]?String(Nt(r[0],n)):"",s=String(r[1]!==void 0?Nt(r[1],n):"sha256").toLowerCase(),o=String(r[2]!==void 0?Nt(r[2],n):"base64"),f={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[s]||"sha256";return Ah.createHmac(f,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=Nt(r[0],n);return Array.isArray(t)?t.at(i):t}case"slice":{let i=Nt(r[0],n),s=r[1]!==void 0?Nt(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:u2(t,r[0],n);case"map":{if(!Array.isArray(t))return t;let i=r.map(s=>String(Nt(s,n)));return i.length===1?t.map(s=>Yc(s,i[0])):t.map(s=>{let o={};for(let l of i){let f=Yc(s,l);f!==void 0&&(o[l]=f)}return o})}case"prop":{let i=r[0]!==void 0?String(Nt(r[0],n)):"";if(Array.isArray(t)){let s=t.map(o=>Yc(o,i)).filter(o=>o!==void 0);return s.length===1?s[0]:s.join(",")}return t&&typeof t=="object"?Yc(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 u2(t,e,r){let n=e.match(/^([\w.]+)\s*(>=|<=|!=|\*=|\^=|\$=|>|<|=)\s*(.+)$/);if(!n)return t;let[,i,s,o]=n,l=Nt(o,r);return t.filter(f=>{let c=Yc(f,i);if(c===void 0)return!1;switch(s){case">":return Number(c)>Number(l);case">=":return Number(c)>=Number(l);case"<":return Number(c)<Number(l);case"<=":return Number(c)<=Number(l);case"=":return String(c)===String(l);case"!=":return String(c)!==String(l);case"*=":return String(c).includes(String(l));case"^=":return String(c).startsWith(String(l));case"$=":return String(c).endsWith(String(l));default:return!0}})}function Yc(t,e){if(!(!t||typeof t!="object"))return e in t?t[e]:e.split(".").reduce((r,n)=>r?.[n],t)}function c2(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var $h=se(()=>{"use strict"});function mI(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 f2(t){return new da(t)}var da,pa,Zc=se(()=>{"use strict";kh();Th();$h();da=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,(f,c)=>this.resolveTemplateContent(c.trim(),r,f));let i="",s=0,o=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,l;for(;(l=o.exec(e))!==null;){let f=l[1].trim(),c=this.resolveTemplateContent(f,r,l[0]);if(c!==l[0]){i+=e.slice(s,l.index);let p=this.getStringContext(e,l.index);i+=p?this.escapeForString(String(c),p):String(c)}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=mI(i[2],r),f=ns(i[1],l);return f!==null?String(f):n}let s=Kc(e);if(s){let l=this.resolveFilterInput(s.input,r);if(l!==void 0){let f=Qc(l,s.filters,r);return f!==void 0?String(f):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 f=this.deserializeValue(r[l]),c=o[2],p=this.resolvePropertyAccess(f,c);if(p!==void 0)return typeof p=="object"?JSON.stringify(p):String(p)}}if(r[e]!==void 0){let l=r[e];return typeof l=="string"&&l.charCodeAt(0)===30?l.slice(1):String(l)}if(ca(e)){let l=this.deserializeVariables(r),f=ua(e,l),c=fa(e,f);if(c!==void 0)return String(c)}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=mI(n[2],r),o=ns(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(ca(e)){let s=this.deserializeVariables(r),o=ua(e,s),l=fa(e,o);if(l!==void 0)return l}}deserializeValue(e){if(typeof e=="string"&&e.charCodeAt(0)===30)try{return JSON.parse(e.slice(1))}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}},pa=class{interpolate(e,r){return!e||typeof e!="string"?e:new da({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}}});import*as d2 from"http";import*as Xc from"https";import{URL as gI}from"url";import*as Nh from"zlib";var Qn,ha,ef=se(()=>{"use strict";Qn={timeout:3e4,followRedirects:!0,followOriginalMethod:!1,followAuthHeader:!1,maxRedirects:10,strictSSL:!0,decompress:!0,includeCookies:!1},ha=class{settings;version;constructor(e){this.settings={...Qn,...e};try{this.version=ft("../../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}}async executeInternal(e,r,n,i){let s=Date.now(),o=new gI(e.url),l=o.protocol==="https:",f=this.sanitizeHeaders(e.headers||{});Object.keys(f).some(h=>h.toLowerCase()==="user-agent")||(f["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:{...f},timeout:r.timeout||void 0};return r.decompress&&!f["accept-encoding"]&&!f["Accept-Encoding"]&&(p.headers["Accept-Encoding"]="gzip, deflate"),l&&(p.rejectUnauthorized=r.strictSSL,r.strictSSL?p.agent=Xc.globalAgent:p.agent=new Xc.Agent({rejectUnauthorized:!1})),new Promise((h,g)=>{if(i?.aborted){let w=new Error("Request cancelled");w.name="AbortError",g(w);return}let _=(l?Xc:d2).request(p,async w=>{let E=w.statusCode||0;if(r.followRedirects&&[301,302,303,307,308].includes(E)){if(n>=r.maxRedirects){g(new Error(`Maximum redirects (${r.maxRedirects}) exceeded`));return}let T=w.headers.location;if(!T){g(new Error("Redirect response missing Location header"));return}let N=new gI(T,e.url).toString(),$=e.method;!r.followOriginalMethod&&[301,302,303].includes(E)&&($="GET");let j={...e.headers};r.followAuthHeader||(delete j.authorization,delete j.Authorization);try{let G=await this.executeInternal({...e,url:N,method:$,headers:j,body:$==="GET"?void 0:e.body},r,n+1,i),q=Date.now();G.time=q-s,h(G)}catch(G){g(G)}return}let k=[];w.on("data",T=>k.push(T)),w.on("end",()=>{let T=Date.now(),N=Buffer.concat(k),$=w.headers["content-encoding"];if(r.decompress&&$)try{$==="gzip"?N=Nh.gunzipSync(N):$==="deflate"&&(N=Nh.inflateSync(N))}catch(C){console.warn("[NodeHttpClient] Decompression failed:",C)}let j=N.toString("utf-8"),G={};for(let[C,A]of Object.entries(w.headers))(typeof A=="string"||Array.isArray(A))&&(G[C]=A);let q=this.parseCookies(w.headers["set-cookie"],o.hostname);h({status:w.statusCode||0,statusText:w.statusMessage||"",headers:G,cookies:q,body:j,time:T-s,size:N.length})})});if(i&&i.addEventListener("abort",()=>{_.destroy();let w=new Error("Request cancelled");w.name="AbortError",g(w)}),_.on("error",w=>{g(w)}),_.on("timeout",()=>{_.destroy(),g(new Error("Request timeout"))}),e.body!==void 0&&e.body!==null){let w=typeof e.body=="string"?e.body:JSON.stringify(e.body);_.write(w)}_.end()})}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,f]=s.split("="),c={name:l.trim(),value:f?.trim()||"",domain:r};for(let p of o){let[h,g]=p.split("=");switch(h.toLowerCase().trim()){case"domain":c.domain=g?.trim();break;case"path":c.path=g?.trim();break;case"expires":c.expires=g?.trim();break;case"httponly":c.httpOnly=!0;break;case"secure":c.secure=!0;break}}return c}):[]}}});function sS(t){return{timeout:t?.timeout??Qn.timeout,followRedirects:t?.followRedirects??Qn.followRedirects,followOriginalMethod:t?.followOriginalMethod??Qn.followOriginalMethod,followAuthHeader:t?.followAuthHeader??Qn.followAuthHeader,maxRedirects:t?.maxRedirects??Qn.maxRedirects,strictSSL:t?.strictSSL??Qn.strictSSL,decompress:t?.decompress??Qn.decompress,includeCookies:t?.includeCookies??Qn.includeCookies}}var oS=se(()=>{"use strict";ef()});var is,tf=se(()=>{"use strict";oS();is=class{constructor(e,r,n){this.urlBuilder=e;this.interceptors=r;this.httpClient=n}urlBuilder;interceptors;httpClient;async execute(e){let r=sS(e.settings),n={},i;try{i=await this.interceptors.executeRequestInterceptors(e,n)}catch(s){let o=await this.interceptors.executeErrorInterceptors(s,e,n);if(o)return o;throw s}try{let s=await this.httpClient.send({...i,settings:r});return await this.interceptors.executeResponseInterceptors(s,i,n)}catch(s){let o=await this.interceptors.executeErrorInterceptors(s,i,n);if(o)return o;throw s}}buildUrl(e,r={},n={}){return this.urlBuilder.buildUrl(e,r,n)}}});var ss,aS,lS,uS,rf=se(()=>{"use strict";ss=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))}},aS=class{name="logging";priority=1e3;intercept(e,r){return e}},lS=class{name="timing";priority=1;intercept(e,r,n){return e}},uS=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 yI=H((Gl,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__",f=500,c="__lodash_placeholder__",p=1,h=2,g=4,v=1,_=2,w=1,E=2,k=4,T=8,N=16,$=32,j=64,G=128,q=256,C=512,A=30,D="...",B=800,F=16,K=1,ee=2,ie=3,pe=1/0,ke=9007199254740991,de=17976931348623157e292,le=NaN,ve=4294967295,We=ve-1,mt=ve>>>1,ce=[["ary",G],["bind",w],["bindKey",E],["curry",T],["curryRight",N],["flip",C],["partial",$],["partialRight",j],["rearg",q]],ir="[object Arguments]",$e="[object Array]",nt="[object AsyncFunction]",en="[object Boolean]",Nr="[object Date]",_t="[object DOMException]",Rt="[object Error]",hn="[object Function]",qo="[object GeneratorFunction]",er="[object Map]",ko="[object Number]",$y="[object Null]",Mn="[object Object]",ap="[object Promise]",lp="[object Proxy]",tr="[object RegExp]",_r="[object Set]",Po="[object String]",tl="[object Symbol]",up="[object Undefined]",Gt="[object WeakMap]",cp="[object WeakSet]",ji="[object ArrayBuffer]",Fn="[object DataView]",pt="[object Float32Array]",rl="[object Float64Array]",nl="[object Int8Array]",Cs="[object Int16Array]",To="[object Int32Array]",xs="[object Uint8Array]",yi="[object Uint8ClampedArray]",Es="[object Uint16Array]",oc="[object Uint32Array]",il=/\b__p \+= '';/g,Ny=/\b(__p \+=) '' \+/g,Ao=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ui=/&(?:amp|lt|gt|quot|#39);/g,sl=/[&<>"']/g,ol=RegExp(Ui.source),fe=RegExp(sl.source),My=/<%-([\s\S]+?)%>/g,Fy=/<%([\s\S]+?)%>/g,mn=/<%=([\s\S]+?)%>/g,Mr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fe=/^\w*$/,ac=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,it=/[\\^$.*+?()[\]{}|]/g,$o=RegExp(it.source),lc=/^\s+/,al=/\s/,rr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Dn=/\{\n\/\* \[wrapped with (.+)\] \*/,gn=/,? & /,Lt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Fr=/[()=,{}\[\]\/\s]/,Ln=/\\(\\)?/g,Hi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fp=/\w*$/,Dy=/^[-+]0x[0-9a-f]+$/i,No=/^0b[01]+$/i,dp=/^\[object .+?Constructor\]$/,Ly=/^0o[0-7]+$/i,Is=/^(?:0|[1-9]\d*)$/,Mo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Fo=/($^)/,jy=/['\n\r\u2028\u2029\\]/g,ll="\\ud800-\\udfff",Uy="\\u0300-\\u036f",kt="\\ufe20-\\ufe2f",uc="\\u20d0-\\u20ff",pp=Uy+kt+uc,cc="\\u2700-\\u27bf",fc="a-z\\xdf-\\xf6\\xf8-\\xff",Hy="\\xac\\xb1\\xd7\\xf7",By="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Vy="\\u2000-\\u206f",Wy=" \\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",hp="A-Z\\xc0-\\xd6\\xd8-\\xde",mp="\\ufe0e\\ufe0f",dc=Hy+By+Vy+Wy,ul="['\u2019]",zy="["+ll+"]",gp="["+dc+"]",cl="["+pp+"]",pc="\\d+",Jy="["+cc+"]",Os="["+fc+"]",Do="[^"+ll+dc+pc+cc+fc+hp+"]",fl="\\ud83c[\\udffb-\\udfff]",Lo="(?:"+cl+"|"+fl+")",yn="[^"+ll+"]",hc="(?:\\ud83c[\\udde6-\\uddff]){2}",mc="[\\ud800-\\udbff][\\udc00-\\udfff]",qs="["+hp+"]",yp="\\u200d",vp="(?:"+Os+"|"+Do+")",Gy="(?:"+qs+"|"+Do+")",bp="(?:"+ul+"(?:d|ll|m|re|s|t|ve))?",Sp="(?:"+ul+"(?:D|LL|M|RE|S|T|VE))?",dl=Lo+"?",wp="["+mp+"]?",_p="(?:"+yp+"(?:"+[yn,hc,mc].join("|")+")"+wp+dl+")*",Yy="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ky="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Rp=wp+dl+_p,Qy="(?:"+[Jy,hc,mc].join("|")+")"+Rp,Zy="(?:"+[yn+cl+"?",cl,hc,mc,zy].join("|")+")",Xy=RegExp(ul,"g"),ev=RegExp(cl,"g"),gc=RegExp(fl+"(?="+fl+")|"+Zy+Rp,"g"),tv=RegExp([qs+"?"+Os+"+"+bp+"(?="+[gp,qs,"$"].join("|")+")",Gy+"+"+Sp+"(?="+[gp,qs+vp,"$"].join("|")+")",qs+"?"+vp+"+"+bp,qs+"+"+Sp,Ky,Yy,pc,Qy].join("|"),"g"),rv=RegExp("["+yp+ll+pp+mp+"]"),nv=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,iv=["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"],sv=-1,bt={};bt[pt]=bt[rl]=bt[nl]=bt[Cs]=bt[To]=bt[xs]=bt[yi]=bt[Es]=bt[oc]=!0,bt[ir]=bt[$e]=bt[ji]=bt[en]=bt[Fn]=bt[Nr]=bt[Rt]=bt[hn]=bt[er]=bt[ko]=bt[Mn]=bt[tr]=bt[_r]=bt[Po]=bt[Gt]=!1;var gt={};gt[ir]=gt[$e]=gt[ji]=gt[Fn]=gt[en]=gt[Nr]=gt[pt]=gt[rl]=gt[nl]=gt[Cs]=gt[To]=gt[er]=gt[ko]=gt[Mn]=gt[tr]=gt[_r]=gt[Po]=gt[tl]=gt[xs]=gt[yi]=gt[Es]=gt[oc]=!0,gt[Rt]=gt[hn]=gt[Gt]=!1;var yc={\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"},vc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ov={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Cp={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},xp=parseFloat,av=parseInt,Ep=typeof global=="object"&&global&&global.Object===Object&&global,lv=typeof self=="object"&&self&&self.Object===Object&&self,Bt=Ep||lv||Function("return this")(),pl=typeof Gl=="object"&&Gl&&!Gl.nodeType&&Gl,st=pl&&typeof nf=="object"&&nf&&!nf.nodeType&&nf,ks=st&&st.exports===pl,Bi=ks&&Ep.process,Dr=(function(){try{var V=st&&st.require&&st.require("util").types;return V||Bi&&Bi.binding&&Bi.binding("util")}catch{}})(),bc=Dr&&Dr.isArrayBuffer,Ip=Dr&&Dr.isDate,Op=Dr&&Dr.isMap,jo=Dr&&Dr.isRegExp,jn=Dr&&Dr.isSet,hl=Dr&&Dr.isTypedArray;function Rr(V,Q,z){switch(z.length){case 0:return V.call(Q);case 1:return V.call(Q,z[0]);case 2:return V.call(Q,z[0],z[1]);case 3:return V.call(Q,z[0],z[1],z[2])}return V.apply(Q,z)}function Un(V,Q,z,ue){for(var Re=-1,tt=V==null?0:V.length;++Re<tt;){var ut=V[Re];Q(ue,ut,z(ut),V)}return ue}function Cr(V,Q){for(var z=-1,ue=V==null?0:V.length;++z<ue&&Q(V[z],z,V)!==!1;);return V}function Sc(V,Q){for(var z=V==null?0:V.length;z--&&Q(V[z],z,V)!==!1;);return V}function qp(V,Q){for(var z=-1,ue=V==null?0:V.length;++z<ue;)if(!Q(V[z],z,V))return!1;return!0}function vi(V,Q){for(var z=-1,ue=V==null?0:V.length,Re=0,tt=[];++z<ue;){var ut=V[z];Q(ut,z,V)&&(tt[Re++]=ut)}return tt}function ml(V,Q){var z=V==null?0:V.length;return!!z&&Vi(V,Q,0)>-1}function Ps(V,Q,z){for(var ue=-1,Re=V==null?0:V.length;++ue<Re;)if(z(Q,V[ue]))return!0;return!1}function yt(V,Q){for(var z=-1,ue=V==null?0:V.length,Re=Array(ue);++z<ue;)Re[z]=Q(V[z],z,V);return Re}function bi(V,Q){for(var z=-1,ue=Q.length,Re=V.length;++z<ue;)V[Re+z]=Q[z];return V}function wc(V,Q,z,ue){var Re=-1,tt=V==null?0:V.length;for(ue&&tt&&(z=V[++Re]);++Re<tt;)z=Q(z,V[Re],Re,V);return z}function uv(V,Q,z,ue){var Re=V==null?0:V.length;for(ue&&Re&&(z=V[--Re]);Re--;)z=Q(z,V[Re],Re,V);return z}function gl(V,Q){for(var z=-1,ue=V==null?0:V.length;++z<ue;)if(Q(V[z],z,V))return!0;return!1}var cv=Uo("length");function fv(V){return V.split("")}function dv(V){return V.match(Lt)||[]}function kp(V,Q,z){var ue;return z(V,function(Re,tt,ut){if(Q(Re,tt,ut))return ue=tt,!1}),ue}function yl(V,Q,z,ue){for(var Re=V.length,tt=z+(ue?1:-1);ue?tt--:++tt<Re;)if(Q(V[tt],tt,V))return tt;return-1}function Vi(V,Q,z){return Q===Q?wv(V,Q,z):yl(V,Wi,z)}function pv(V,Q,z,ue){for(var Re=z-1,tt=V.length;++Re<tt;)if(ue(V[Re],Q))return Re;return-1}function Wi(V){return V!==V}function Pp(V,Q){var z=V==null?0:V.length;return z?Rc(V,Q)/z:le}function Uo(V){return function(Q){return Q==null?t:Q[V]}}function _c(V){return function(Q){return V==null?t:V[Q]}}function vl(V,Q,z,ue,Re){return Re(V,function(tt,ut,ze){z=ue?(ue=!1,tt):Q(z,tt,ut,ze)}),z}function hv(V,Q){var z=V.length;for(V.sort(Q);z--;)V[z]=V[z].value;return V}function Rc(V,Q){for(var z,ue=-1,Re=V.length;++ue<Re;){var tt=Q(V[ue]);tt!==t&&(z=z===t?tt:z+tt)}return z}function Cc(V,Q){for(var z=-1,ue=Array(V);++z<V;)ue[z]=Q(z);return ue}function mv(V,Q){return yt(Q,function(z){return[z,V[z]]})}function xc(V){return V&&V.slice(0,Mp(V)+1).replace(lc,"")}function xr(V){return function(Q){return V(Q)}}function bl(V,Q){return yt(Q,function(z){return V[z]})}function lt(V,Q){return V.has(Q)}function Tp(V,Q){for(var z=-1,ue=V.length;++z<ue&&Vi(Q,V[z],0)>-1;);return z}function Ap(V,Q){for(var z=V.length;z--&&Vi(Q,V[z],0)>-1;);return z}function $p(V,Q){for(var z=V.length,ue=0;z--;)V[z]===Q&&++ue;return ue}var gv=_c(yc),yv=_c(vc);function vv(V){return"\\"+Cp[V]}function Ho(V,Q){return V==null?t:V[Q]}function Ts(V){return rv.test(V)}function bv(V){return nv.test(V)}function Sv(V){for(var Q,z=[];!(Q=V.next()).done;)z.push(Q.value);return z}function As(V){var Q=-1,z=Array(V.size);return V.forEach(function(ue,Re){z[++Q]=[Re,ue]}),z}function Bo(V,Q){return function(z){return V(Q(z))}}function vn(V,Q){for(var z=-1,ue=V.length,Re=0,tt=[];++z<ue;){var ut=V[z];(ut===Q||ut===c)&&(V[z]=c,tt[Re++]=z)}return tt}function Sl(V){var Q=-1,z=Array(V.size);return V.forEach(function(ue){z[++Q]=ue}),z}function Np(V){var Q=-1,z=Array(V.size);return V.forEach(function(ue){z[++Q]=[ue,ue]}),z}function wv(V,Q,z){for(var ue=z-1,Re=V.length;++ue<Re;)if(V[ue]===Q)return ue;return-1}function Ec(V,Q,z){for(var ue=z+1;ue--;)if(V[ue]===Q)return ue;return ue}function Si(V){return Ts(V)?Rv(V):cv(V)}function Er(V){return Ts(V)?Cv(V):fv(V)}function Mp(V){for(var Q=V.length;Q--&&al.test(V.charAt(Q)););return Q}var _v=_c(ov);function Rv(V){for(var Q=gc.lastIndex=0;gc.test(V);)++Q;return Q}function Cv(V){return V.match(gc)||[]}function xv(V){return V.match(tv)||[]}var Ev=(function V(Q){Q=Q==null?Bt:wi.defaults(Bt.Object(),Q,wi.pick(Bt,iv));var z=Q.Array,ue=Q.Date,Re=Q.Error,tt=Q.Function,ut=Q.Math,ze=Q.Object,wl=Q.RegExp,Iv=Q.String,Ir=Q.TypeError,Vo=z.prototype,Ov=tt.prototype,$s=ze.prototype,Wo=Q["__core-js_shared__"],_l=Ov.toString,ot=$s.hasOwnProperty,qv=0,Fp=(function(){var a=/[^.]+$/.exec(Wo&&Wo.keys&&Wo.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""})(),Rl=$s.toString,kv=_l.call(ze),Pv=Bt._,Tv=wl("^"+_l.call(ot).replace(it,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Cl=ks?Q.Buffer:t,_i=Q.Symbol,xl=Q.Uint8Array,Dp=Cl?Cl.allocUnsafe:t,El=Bo(ze.getPrototypeOf,ze),Lp=ze.create,zo=$s.propertyIsEnumerable,Il=Vo.splice,jp=_i?_i.isConcatSpreadable:t,Jo=_i?_i.iterator:t,zi=_i?_i.toStringTag:t,Ol=(function(){try{var a=na(ze,"defineProperty");return a({},"",{}),a}catch{}})(),Av=Q.clearTimeout!==Bt.clearTimeout&&Q.clearTimeout,$v=ue&&ue.now!==Bt.Date.now&&ue.now,Nv=Q.setTimeout!==Bt.setTimeout&&Q.setTimeout,Go=ut.ceil,Yo=ut.floor,ql=ze.getOwnPropertySymbols,kl=Cl?Cl.isBuffer:t,Ji=Q.isFinite,Pl=Vo.join,Up=Bo(ze.keys,ze),Ct=ut.max,Yt=ut.min,Hp=ue.now,Mv=Q.parseInt,Bp=ut.random,Fv=Vo.reverse,Ic=na(Q,"DataView"),Ko=na(Q,"Map"),Oc=na(Q,"Promise"),Ns=na(Q,"Set"),Qo=na(Q,"WeakMap"),Zo=na(ze,"create"),Tl=Qo&&new Qo,Ms={},Dv=ia(Ic),Lv=ia(Ko),jv=ia(Oc),Uv=ia(Ns),Hv=ia(Qo),Al=_i?_i.prototype:t,Xo=Al?Al.valueOf:t,Vp=Al?Al.toString:t;function O(a){if(At(a)&&!Ee(a)&&!(a instanceof De)){if(a instanceof fr)return a;if(ot.call(a,"__wrapped__"))return yE(a)}return new fr(a)}var Fs=(function(){function a(){}return function(u){if(!Pt(u))return{};if(Lp)return Lp(u);a.prototype=u;var m=new a;return a.prototype=t,m}})();function $l(){}function fr(a,u){this.__wrapped__=a,this.__actions__=[],this.__chain__=!!u,this.__index__=0,this.__values__=t}O.templateSettings={escape:My,evaluate:Fy,interpolate:mn,variable:"",imports:{_:O}},O.prototype=$l.prototype,O.prototype.constructor=O,fr.prototype=Fs($l.prototype),fr.prototype.constructor=fr;function De(a){this.__wrapped__=a,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ve,this.__views__=[]}function Bv(){var a=new De(this.__wrapped__);return a.__actions__=Lr(this.__actions__),a.__dir__=this.__dir__,a.__filtered__=this.__filtered__,a.__iteratees__=Lr(this.__iteratees__),a.__takeCount__=this.__takeCount__,a.__views__=Lr(this.__views__),a}function Vv(){if(this.__filtered__){var a=new De(this);a.__dir__=-1,a.__filtered__=!0}else a=this.clone(),a.__dir__*=-1;return a}function qc(){var a=this.__wrapped__.value(),u=this.__dir__,m=Ee(a),b=u<0,x=m?a.length:0,P=QN(0,x,this.__views__),M=P.start,U=P.end,W=U-M,Z=b?U:M-1,X=this.__iteratees__,te=X.length,oe=0,he=Yt(W,this.__takeCount__);if(!m||!b&&x==W&&he==W)return jx(a,this.__actions__);var we=[];e:for(;W--&&oe<he;){Z+=u;for(var Pe=-1,be=a[Z];++Pe<te;){var Be=X[Pe],Je=Be.iteratee,an=Be.type,kr=Je(be);if(an==ee)be=kr;else if(!kr){if(an==K)continue e;break e}}we[oe++]=be}return we}De.prototype=Fs($l.prototype),De.prototype.constructor=De;function bn(a){var u=-1,m=a==null?0:a.length;for(this.clear();++u<m;){var b=a[u];this.set(b[0],b[1])}}function Wv(){this.__data__=Zo?Zo(null):{},this.size=0}function zv(a){var u=this.has(a)&&delete this.__data__[a];return this.size-=u?1:0,u}function Jv(a){var u=this.__data__;if(Zo){var m=u[a];return m===l?t:m}return ot.call(u,a)?u[a]:t}function Gv(a){var u=this.__data__;return Zo?u[a]!==t:ot.call(u,a)}function Yv(a,u){var m=this.__data__;return this.size+=this.has(a)?0:1,m[a]=Zo&&u===t?l:u,this}bn.prototype.clear=Wv,bn.prototype.delete=zv,bn.prototype.get=Jv,bn.prototype.has=Gv,bn.prototype.set=Yv;function Hn(a){var u=-1,m=a==null?0:a.length;for(this.clear();++u<m;){var b=a[u];this.set(b[0],b[1])}}function Wp(){this.__data__=[],this.size=0}function Kv(a){var u=this.__data__,m=Ml(u,a);if(m<0)return!1;var b=u.length-1;return m==b?u.pop():Il.call(u,m,1),--this.size,!0}function Qv(a){var u=this.__data__,m=Ml(u,a);return m<0?t:u[m][1]}function zp(a){return Ml(this.__data__,a)>-1}function Zv(a,u){var m=this.__data__,b=Ml(m,a);return b<0?(++this.size,m.push([a,u])):m[b][1]=u,this}Hn.prototype.clear=Wp,Hn.prototype.delete=Kv,Hn.prototype.get=Qv,Hn.prototype.has=zp,Hn.prototype.set=Zv;function Bn(a){var u=-1,m=a==null?0:a.length;for(this.clear();++u<m;){var b=a[u];this.set(b[0],b[1])}}function Xv(){this.size=0,this.__data__={hash:new bn,map:new(Ko||Hn),string:new bn}}function Ri(a){var u=ph(this,a).delete(a);return this.size-=u?1:0,u}function Jp(a){return ph(this,a).get(a)}function eb(a){return ph(this,a).has(a)}function tb(a,u){var m=ph(this,a),b=m.size;return m.set(a,u),this.size+=m.size==b?0:1,this}Bn.prototype.clear=Xv,Bn.prototype.delete=Ri,Bn.prototype.get=Jp,Bn.prototype.has=eb,Bn.prototype.set=tb;function Gi(a){var u=-1,m=a==null?0:a.length;for(this.__data__=new Bn;++u<m;)this.add(a[u])}function re(a){return this.__data__.set(a,l),this}function rb(a){return this.__data__.has(a)}Gi.prototype.add=Gi.prototype.push=re,Gi.prototype.has=rb;function tn(a){var u=this.__data__=new Hn(a);this.size=u.size}function Gp(){this.__data__=new Hn,this.size=0}function Ye(a){var u=this.__data__,m=u.delete(a);return this.size=u.size,m}function Nl(a){return this.__data__.get(a)}function Yp(a){return this.__data__.has(a)}function kc(a,u){var m=this.__data__;if(m instanceof Hn){var b=m.__data__;if(!Ko||b.length<r-1)return b.push([a,u]),this.size=++m.size,this;m=this.__data__=new Bn(b)}return m.set(a,u),this.size=m.size,this}tn.prototype.clear=Gp,tn.prototype.delete=Ye,tn.prototype.get=Nl,tn.prototype.has=Yp,tn.prototype.set=kc;function Kp(a,u){var m=Ee(a),b=!m&&sa(a),x=!m&&!b&&Vs(a),P=!m&&!b&&!x&&Hl(a),M=m||b||x||P,U=M?Cc(a.length,Iv):[],W=U.length;for(var Z in a)(u||ot.call(a,Z))&&!(M&&(Z=="length"||x&&(Z=="offset"||Z=="parent")||P&&(Z=="buffer"||Z=="byteLength"||Z=="byteOffset")||Zi(Z,W)))&&U.push(Z);return U}function Qp(a){var u=a.length;return u?a[mb(0,u-1)]:t}function nb(a,u){return hh(Lr(a),Ci(u,0,a.length))}function ib(a){return hh(Lr(a))}function Pc(a,u,m){(m!==t&&!Gn(a[u],m)||m===t&&!(u in a))&&rn(a,u,m)}function Or(a,u,m){var b=a[u];(!(ot.call(a,u)&&Gn(b,m))||m===t&&!(u in a))&&rn(a,u,m)}function Ml(a,u){for(var m=a.length;m--;)if(Gn(a[m][0],u))return m;return-1}function Zp(a,u,m,b){return xi(a,function(x,P,M){u(b,x,m(x),M)}),b}function Xp(a,u){return a&&Ei(u,nr(u),a)}function sb(a,u){return a&&Ei(u,Ur(u),a)}function rn(a,u,m){u=="__proto__"&&Ol?Ol(a,u,{configurable:!0,enumerable:!0,value:m,writable:!0}):a[u]=m}function Tc(a,u){for(var m=-1,b=u.length,x=z(b),P=a==null;++m<b;)x[m]=P?t:Ub(a,u[m]);return x}function Ci(a,u,m){return a===a&&(m!==t&&(a=a<=m?a:m),u!==t&&(a=a>=u?a:u)),a}function dr(a,u,m,b,x,P){var M,U=u&p,W=u&h,Z=u&g;if(m&&(M=x?m(a,b,x,P):m(a)),M!==t)return M;if(!Pt(a))return a;var X=Ee(a);if(X){if(M=XN(a),!U)return Lr(a,M)}else{var te=pr(a),oe=te==hn||te==qo;if(Vs(a))return Bx(a,U);if(te==Mn||te==ir||oe&&!x){if(M=W||oe?{}:lE(a),!U)return W?HN(a,sb(M,a)):UN(a,Xp(M,a))}else{if(!gt[te])return x?a:{};M=eM(a,te,U)}}P||(P=new tn);var he=P.get(a);if(he)return he;P.set(a,M),FE(a)?a.forEach(function(be){M.add(dr(be,u,m,be,a,P))}):NE(a)&&a.forEach(function(be,Be){M.set(Be,dr(be,u,m,Be,a,P))});var we=Z?W?Eb:xb:W?Ur:nr,Pe=X?t:we(a);return Cr(Pe||a,function(be,Be){Pe&&(Be=be,be=a[Be]),Or(M,Be,dr(be,u,m,Be,a,P))}),M}function ob(a){var u=nr(a);return function(m){return Sn(m,a,u)}}function Sn(a,u,m){var b=m.length;if(a==null)return!b;for(a=ze(a);b--;){var x=m[b],P=u[x],M=a[x];if(M===t&&!(x in a)||!P(M))return!1}return!0}function Ac(a,u,m){if(typeof a!="function")throw new Ir(i);return jc(function(){a.apply(t,m)},u)}function ea(a,u,m,b){var x=-1,P=ml,M=!0,U=a.length,W=[],Z=u.length;if(!U)return W;m&&(u=yt(u,xr(m))),b?(P=Ps,M=!1):u.length>=r&&(P=lt,M=!1,u=new Gi(u));e:for(;++x<U;){var X=a[x],te=m==null?X:m(X);if(X=b||X!==0?X:0,M&&te===te){for(var oe=Z;oe--;)if(u[oe]===te)continue e;W.push(X)}else P(u,te,b)||W.push(X)}return W}var xi=Gx(wn),eh=Gx(Vn,!0);function ab(a,u){var m=!0;return xi(a,function(b,x,P){return m=!!u(b,x,P),m}),m}function Fl(a,u,m){for(var b=-1,x=a.length;++b<x;){var P=a[b],M=u(P);if(M!=null&&(U===t?M===M&&!on(M):m(M,U)))var U=M,W=P}return W}function lb(a,u,m,b){var x=a.length;for(m=Oe(m),m<0&&(m=-m>x?0:x+m),b=b===t||b>x?x:Oe(b),b<0&&(b+=x),b=m>b?0:LE(b);m<b;)a[m++]=u;return a}function th(a,u){var m=[];return xi(a,function(b,x,P){u(b,x,P)&&m.push(b)}),m}function Kt(a,u,m,b,x){var P=-1,M=a.length;for(m||(m=rM),x||(x=[]);++P<M;){var U=a[P];u>0&&m(U)?u>1?Kt(U,u-1,m,b,x):bi(x,U):b||(x[x.length]=U)}return x}var $c=Yx(),rh=Yx(!0);function wn(a,u){return a&&$c(a,u,nr)}function Vn(a,u){return a&&rh(a,u,nr)}function Dl(a,u){return vi(u,function(m){return Xi(a[m])})}function Yi(a,u){u=Hs(u,a);for(var m=0,b=u.length;a!=null&&m<b;)a=a[Jn(u[m++])];return m&&m==b?a:t}function nh(a,u,m){var b=u(a);return Ee(a)?b:bi(b,m(a))}function sr(a){return a==null?a===t?up:$y:zi&&zi in ze(a)?KN(a):uM(a)}function Nc(a,u){return a>u}function ub(a,u){return a!=null&&ot.call(a,u)}function cb(a,u){return a!=null&&u in ze(a)}function fb(a,u,m){return a>=Yt(u,m)&&a<Ct(u,m)}function nn(a,u,m){for(var b=m?Ps:ml,x=a[0].length,P=a.length,M=P,U=z(P),W=1/0,Z=[];M--;){var X=a[M];M&&u&&(X=yt(X,xr(u))),W=Yt(X.length,W),U[M]=!m&&(u||x>=120&&X.length>=120)?new Gi(M&&X):t}X=a[0];var te=-1,oe=U[0];e:for(;++te<x&&Z.length<W;){var he=X[te],we=u?u(he):he;if(he=m||he!==0?he:0,!(oe?lt(oe,we):b(Z,we,m))){for(M=P;--M;){var Pe=U[M];if(!(Pe?lt(Pe,we):b(a[M],we,m)))continue e}oe&&oe.push(we),Z.push(he)}}return Z}function Ds(a,u,m,b){return wn(a,function(x,P,M){u(b,m(x),P,M)}),b}function ta(a,u,m){u=Hs(u,a),a=dE(a,u);var b=a==null?a:a[Jn(Rn(u))];return b==null?t:Rr(b,a,m)}function ih(a){return At(a)&&sr(a)==ir}function db(a){return At(a)&&sr(a)==ji}function pb(a){return At(a)&&sr(a)==Nr}function ra(a,u,m,b,x){return a===u?!0:a==null||u==null||!At(a)&&!At(u)?a!==a&&u!==u:Mc(a,u,m,b,ra,x)}function Mc(a,u,m,b,x,P){var M=Ee(a),U=Ee(u),W=M?$e:pr(a),Z=U?$e:pr(u);W=W==ir?Mn:W,Z=Z==ir?Mn:Z;var X=W==Mn,te=Z==Mn,oe=W==Z;if(oe&&Vs(a)){if(!Vs(u))return!1;M=!0,X=!1}if(oe&&!X)return P||(P=new tn),M||Hl(a)?sE(a,u,m,b,x,P):GN(a,u,W,m,b,x,P);if(!(m&v)){var he=X&&ot.call(a,"__wrapped__"),we=te&&ot.call(u,"__wrapped__");if(he||we){var Pe=he?a.value():a,be=we?u.value():u;return P||(P=new tn),x(Pe,be,m,b,P)}}return oe?(P||(P=new tn),YN(a,u,m,b,x,P)):!1}function Ls(a){return At(a)&&pr(a)==er}function js(a,u,m,b){var x=m.length,P=x,M=!b;if(a==null)return!P;for(a=ze(a);x--;){var U=m[x];if(M&&U[2]?U[1]!==a[U[0]]:!(U[0]in a))return!1}for(;++x<P;){U=m[x];var W=U[0],Z=a[W],X=U[1];if(M&&U[2]){if(Z===t&&!(W in a))return!1}else{var te=new tn;if(b)var oe=b(Z,X,W,a,u,te);if(!(oe===t?ra(X,Z,v|_,b,te):oe))return!1}}return!0}function He(a){if(!Pt(a)||iM(a))return!1;var u=Xi(a)?Tv:dp;return u.test(ia(a))}function d(a){return At(a)&&sr(a)==tr}function y(a){return At(a)&&pr(a)==_r}function S(a){return At(a)&&Sh(a.length)&&!!bt[sr(a)]}function R(a){return typeof a=="function"?a:a==null?Hr:typeof a=="object"?Ee(a)?Le(a[0],a[1]):_e(a):QE(a)}function I(a){if(!Lc(a))return Up(a);var u=[];for(var m in ze(a))ot.call(a,m)&&m!="constructor"&&u.push(m);return u}function L(a){if(!Pt(a))return lM(a);var u=Lc(a),m=[];for(var b in a)b=="constructor"&&(u||!ot.call(a,b))||m.push(b);return m}function Y(a,u){return a<u}function ae(a,u){var m=-1,b=jr(a)?z(a.length):[];return xi(a,function(x,P,M){b[++m]=u(x,P,M)}),b}function _e(a){var u=Ob(a);return u.length==1&&u[0][2]?cE(u[0][0],u[0][1]):function(m){return m===a||js(m,a,u)}}function Le(a,u){return kb(a)&&uE(u)?cE(Jn(a),u):function(m){var b=Ub(m,a);return b===t&&b===u?Hb(m,a):ra(u,b,v|_)}}function Vt(a,u,m,b,x){a!==u&&$c(u,function(P,M){if(x||(x=new tn),Pt(P))Wn(a,u,M,m,Vt,b,x);else{var U=b?b(Tb(a,M),P,M+"",a,u,x):t;U===t&&(U=P),Pc(a,M,U)}},Ur)}function Wn(a,u,m,b,x,P,M){var U=Tb(a,m),W=Tb(u,m),Z=M.get(W);if(Z){Pc(a,m,Z);return}var X=P?P(U,W,m+"",a,u,M):t,te=X===t;if(te){var oe=Ee(W),he=!oe&&Vs(W),we=!oe&&!he&&Hl(W);X=W,oe||he||we?Ee(U)?X=U:jt(U)?X=Lr(U):he?(te=!1,X=Bx(W,!0)):we?(te=!1,X=Vx(W,!0)):X=[]:Uc(W)||sa(W)?(X=U,sa(U)?X=jE(U):(!Pt(U)||Xi(U))&&(X=lE(W))):te=!1}te&&(M.set(W,X),x(X,W,b,P,M),M.delete(W)),Pc(a,m,X)}function zn(a,u){var m=a.length;if(m)return u+=u<0?m:0,Zi(u,m)?a[u]:t}function Ax(a,u,m){u.length?u=yt(u,function(P){return Ee(P)?function(M){return Yi(M,P.length===1?P[0]:P)}:P}):u=[Hr];var b=-1;u=yt(u,xr(Se()));var x=ae(a,function(P,M,U){var W=yt(u,function(Z){return Z(P)});return{criteria:W,index:++b,value:P}});return hv(x,function(P,M){return jN(P,M,m)})}function ON(a,u){return $x(a,u,function(m,b){return Hb(a,b)})}function $x(a,u,m){for(var b=-1,x=u.length,P={};++b<x;){var M=u[b],U=Yi(a,M);m(U,M)&&Fc(P,Hs(M,a),U)}return P}function qN(a){return function(u){return Yi(u,a)}}function hb(a,u,m,b){var x=b?pv:Vi,P=-1,M=u.length,U=a;for(a===u&&(u=Lr(u)),m&&(U=yt(a,xr(m)));++P<M;)for(var W=0,Z=u[P],X=m?m(Z):Z;(W=x(U,X,W,b))>-1;)U!==a&&Il.call(U,W,1),Il.call(a,W,1);return a}function Nx(a,u){for(var m=a?u.length:0,b=m-1;m--;){var x=u[m];if(m==b||x!==P){var P=x;Zi(x)?Il.call(a,x,1):vb(a,x)}}return a}function mb(a,u){return a+Yo(Bp()*(u-a+1))}function kN(a,u,m,b){for(var x=-1,P=Ct(Go((u-a)/(m||1)),0),M=z(P);P--;)M[b?P:++x]=a,a+=m;return M}function gb(a,u){var m="";if(!a||u<1||u>ke)return m;do u%2&&(m+=a),u=Yo(u/2),u&&(a+=a);while(u);return m}function Ne(a,u){return Ab(fE(a,u,Hr),a+"")}function PN(a){return Qp(Bl(a))}function TN(a,u){var m=Bl(a);return hh(m,Ci(u,0,m.length))}function Fc(a,u,m,b){if(!Pt(a))return a;u=Hs(u,a);for(var x=-1,P=u.length,M=P-1,U=a;U!=null&&++x<P;){var W=Jn(u[x]),Z=m;if(W==="__proto__"||W==="constructor"||W==="prototype")return a;if(x!=M){var X=U[W];Z=b?b(X,W,U):t,Z===t&&(Z=Pt(X)?X:Zi(u[x+1])?[]:{})}Or(U,W,Z),U=U[W]}return a}var Mx=Tl?function(a,u){return Tl.set(a,u),a}:Hr,AN=Ol?function(a,u){return Ol(a,"toString",{configurable:!0,enumerable:!1,value:Vb(u),writable:!0})}:Hr;function $N(a){return hh(Bl(a))}function _n(a,u,m){var b=-1,x=a.length;u<0&&(u=-u>x?0:x+u),m=m>x?x:m,m<0&&(m+=x),x=u>m?0:m-u>>>0,u>>>=0;for(var P=z(x);++b<x;)P[b]=a[b+u];return P}function NN(a,u){var m;return xi(a,function(b,x,P){return m=u(b,x,P),!m}),!!m}function sh(a,u,m){var b=0,x=a==null?b:a.length;if(typeof u=="number"&&u===u&&x<=mt){for(;b<x;){var P=b+x>>>1,M=a[P];M!==null&&!on(M)&&(m?M<=u:M<u)?b=P+1:x=P}return x}return yb(a,u,Hr,m)}function yb(a,u,m,b){var x=0,P=a==null?0:a.length;if(P===0)return 0;u=m(u);for(var M=u!==u,U=u===null,W=on(u),Z=u===t;x<P;){var X=Yo((x+P)/2),te=m(a[X]),oe=te!==t,he=te===null,we=te===te,Pe=on(te);if(M)var be=b||we;else Z?be=we&&(b||oe):U?be=we&&oe&&(b||!he):W?be=we&&oe&&!he&&(b||!Pe):he||Pe?be=!1:be=b?te<=u:te<u;be?x=X+1:P=X}return Yt(P,We)}function Fx(a,u){for(var m=-1,b=a.length,x=0,P=[];++m<b;){var M=a[m],U=u?u(M):M;if(!m||!Gn(U,W)){var W=U;P[x++]=M===0?0:M}}return P}function Dx(a){return typeof a=="number"?a:on(a)?le:+a}function sn(a){if(typeof a=="string")return a;if(Ee(a))return yt(a,sn)+"";if(on(a))return Vp?Vp.call(a):"";var u=a+"";return u=="0"&&1/a==-pe?"-0":u}function Us(a,u,m){var b=-1,x=ml,P=a.length,M=!0,U=[],W=U;if(m)M=!1,x=Ps;else if(P>=r){var Z=u?null:zN(a);if(Z)return Sl(Z);M=!1,x=lt,W=new Gi}else W=u?[]:U;e:for(;++b<P;){var X=a[b],te=u?u(X):X;if(X=m||X!==0?X:0,M&&te===te){for(var oe=W.length;oe--;)if(W[oe]===te)continue e;u&&W.push(te),U.push(X)}else x(W,te,m)||(W!==U&&W.push(te),U.push(X))}return U}function vb(a,u){u=Hs(u,a);var m=-1,b=u.length;if(!b)return!0;for(;++m<b;){var x=Jn(u[m]);if(x==="__proto__"&&!ot.call(a,"__proto__")||(x==="constructor"||x==="prototype")&&m<b-1)return!1}var P=dE(a,u);return P==null||delete P[Jn(Rn(u))]}function Lx(a,u,m,b){return Fc(a,u,m(Yi(a,u)),b)}function oh(a,u,m,b){for(var x=a.length,P=b?x:-1;(b?P--:++P<x)&&u(a[P],P,a););return m?_n(a,b?0:P,b?P+1:x):_n(a,b?P+1:0,b?x:P)}function jx(a,u){var m=a;return m instanceof De&&(m=m.value()),wc(u,function(b,x){return x.func.apply(x.thisArg,bi([b],x.args))},m)}function bb(a,u,m){var b=a.length;if(b<2)return b?Us(a[0]):[];for(var x=-1,P=z(b);++x<b;)for(var M=a[x],U=-1;++U<b;)U!=x&&(P[x]=ea(P[x]||M,a[U],u,m));return Us(Kt(P,1),u,m)}function Ux(a,u,m){for(var b=-1,x=a.length,P=u.length,M={};++b<x;){var U=b<P?u[b]:t;m(M,a[b],U)}return M}function Sb(a){return jt(a)?a:[]}function wb(a){return typeof a=="function"?a:Hr}function Hs(a,u){return Ee(a)?a:kb(a,u)?[a]:gE(ct(a))}var MN=Ne;function Bs(a,u,m){var b=a.length;return m=m===t?b:m,!u&&m>=b?a:_n(a,u,m)}var Hx=Av||function(a){return Bt.clearTimeout(a)};function Bx(a,u){if(u)return a.slice();var m=a.length,b=Dp?Dp(m):new a.constructor(m);return a.copy(b),b}function _b(a){var u=new a.constructor(a.byteLength);return new xl(u).set(new xl(a)),u}function FN(a,u){var m=u?_b(a.buffer):a.buffer;return new a.constructor(m,a.byteOffset,a.byteLength)}function DN(a){var u=new a.constructor(a.source,fp.exec(a));return u.lastIndex=a.lastIndex,u}function LN(a){return Xo?ze(Xo.call(a)):{}}function Vx(a,u){var m=u?_b(a.buffer):a.buffer;return new a.constructor(m,a.byteOffset,a.length)}function Wx(a,u){if(a!==u){var m=a!==t,b=a===null,x=a===a,P=on(a),M=u!==t,U=u===null,W=u===u,Z=on(u);if(!U&&!Z&&!P&&a>u||P&&M&&W&&!U&&!Z||b&&M&&W||!m&&W||!x)return 1;if(!b&&!P&&!Z&&a<u||Z&&m&&x&&!b&&!P||U&&m&&x||!M&&x||!W)return-1}return 0}function jN(a,u,m){for(var b=-1,x=a.criteria,P=u.criteria,M=x.length,U=m.length;++b<M;){var W=Wx(x[b],P[b]);if(W){if(b>=U)return W;var Z=m[b];return W*(Z=="desc"?-1:1)}}return a.index-u.index}function zx(a,u,m,b){for(var x=-1,P=a.length,M=m.length,U=-1,W=u.length,Z=Ct(P-M,0),X=z(W+Z),te=!b;++U<W;)X[U]=u[U];for(;++x<M;)(te||x<P)&&(X[m[x]]=a[x]);for(;Z--;)X[U++]=a[x++];return X}function Jx(a,u,m,b){for(var x=-1,P=a.length,M=-1,U=m.length,W=-1,Z=u.length,X=Ct(P-U,0),te=z(X+Z),oe=!b;++x<X;)te[x]=a[x];for(var he=x;++W<Z;)te[he+W]=u[W];for(;++M<U;)(oe||x<P)&&(te[he+m[M]]=a[x++]);return te}function Lr(a,u){var m=-1,b=a.length;for(u||(u=z(b));++m<b;)u[m]=a[m];return u}function Ei(a,u,m,b){var x=!m;m||(m={});for(var P=-1,M=u.length;++P<M;){var U=u[P],W=b?b(m[U],a[U],U,m,a):t;W===t&&(W=a[U]),x?rn(m,U,W):Or(m,U,W)}return m}function UN(a,u){return Ei(a,qb(a),u)}function HN(a,u){return Ei(a,oE(a),u)}function ah(a,u){return function(m,b){var x=Ee(m)?Un:Zp,P=u?u():{};return x(m,a,Se(b,2),P)}}function Ll(a){return Ne(function(u,m){var b=-1,x=m.length,P=x>1?m[x-1]:t,M=x>2?m[2]:t;for(P=a.length>3&&typeof P=="function"?(x--,P):t,M&&qr(m[0],m[1],M)&&(P=x<3?t:P,x=1),u=ze(u);++b<x;){var U=m[b];U&&a(u,U,b,P)}return u})}function Gx(a,u){return function(m,b){if(m==null)return m;if(!jr(m))return a(m,b);for(var x=m.length,P=u?x:-1,M=ze(m);(u?P--:++P<x)&&b(M[P],P,M)!==!1;);return m}}function Yx(a){return function(u,m,b){for(var x=-1,P=ze(u),M=b(u),U=M.length;U--;){var W=M[a?U:++x];if(m(P[W],W,P)===!1)break}return u}}function BN(a,u,m){var b=u&w,x=Dc(a);function P(){var M=this&&this!==Bt&&this instanceof P?x:a;return M.apply(b?m:this,arguments)}return P}function Kx(a){return function(u){u=ct(u);var m=Ts(u)?Er(u):t,b=m?m[0]:u.charAt(0),x=m?Bs(m,1).join(""):u.slice(1);return b[a]()+x}}function jl(a){return function(u){return wc(YE(GE(u).replace(Xy,"")),a,"")}}function Dc(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 m=Fs(a.prototype),b=a.apply(m,u);return Pt(b)?b:m}}function VN(a,u,m){var b=Dc(a);function x(){for(var P=arguments.length,M=z(P),U=P,W=Ul(x);U--;)M[U]=arguments[U];var Z=P<3&&M[0]!==W&&M[P-1]!==W?[]:vn(M,W);if(P-=Z.length,P<m)return tE(a,u,lh,x.placeholder,t,M,Z,t,t,m-P);var X=this&&this!==Bt&&this instanceof x?b:a;return Rr(X,this,M)}return x}function Qx(a){return function(u,m,b){var x=ze(u);if(!jr(u)){var P=Se(m,3);u=nr(u),m=function(U){return P(x[U],U,x)}}var M=a(u,m,b);return M>-1?x[P?u[M]:M]:t}}function Zx(a){return Qi(function(u){var m=u.length,b=m,x=fr.prototype.thru;for(a&&u.reverse();b--;){var P=u[b];if(typeof P!="function")throw new Ir(i);if(x&&!M&&dh(P)=="wrapper")var M=new fr([],!0)}for(b=M?b:m;++b<m;){P=u[b];var U=dh(P),W=U=="wrapper"?Ib(P):t;W&&Pb(W[0])&&W[1]==(G|T|$|q)&&!W[4].length&&W[9]==1?M=M[dh(W[0])].apply(M,W[3]):M=P.length==1&&Pb(P)?M[U]():M.thru(P)}return function(){var Z=arguments,X=Z[0];if(M&&Z.length==1&&Ee(X))return M.plant(X).value();for(var te=0,oe=m?u[te].apply(this,Z):X;++te<m;)oe=u[te].call(this,oe);return oe}})}function lh(a,u,m,b,x,P,M,U,W,Z){var X=u&G,te=u&w,oe=u&E,he=u&(T|N),we=u&C,Pe=oe?t:Dc(a);function be(){for(var Be=arguments.length,Je=z(Be),an=Be;an--;)Je[an]=arguments[an];if(he)var kr=Ul(be),ln=$p(Je,kr);if(b&&(Je=zx(Je,b,x,he)),P&&(Je=Jx(Je,P,M,he)),Be-=ln,he&&Be<Z){var Ut=vn(Je,kr);return tE(a,u,lh,be.placeholder,m,Je,Ut,U,W,Z-Be)}var Yn=te?m:this,ts=oe?Yn[a]:a;return Be=Je.length,U?Je=cM(Je,U):we&&Be>1&&Je.reverse(),X&&W<Be&&(Je.length=W),this&&this!==Bt&&this instanceof be&&(ts=Pe||Dc(ts)),ts.apply(Yn,Je)}return be}function Xx(a,u){return function(m,b){return Ds(m,a,u(b),{})}}function uh(a,u){return function(m,b){var x;if(m===t&&b===t)return u;if(m!==t&&(x=m),b!==t){if(x===t)return b;typeof m=="string"||typeof b=="string"?(m=sn(m),b=sn(b)):(m=Dx(m),b=Dx(b)),x=a(m,b)}return x}}function Rb(a){return Qi(function(u){return u=yt(u,xr(Se())),Ne(function(m){var b=this;return a(u,function(x){return Rr(x,b,m)})})})}function ch(a,u){u=u===t?" ":sn(u);var m=u.length;if(m<2)return m?gb(u,a):u;var b=gb(u,Go(a/Si(u)));return Ts(u)?Bs(Er(b),0,a).join(""):b.slice(0,a)}function WN(a,u,m,b){var x=u&w,P=Dc(a);function M(){for(var U=-1,W=arguments.length,Z=-1,X=b.length,te=z(X+W),oe=this&&this!==Bt&&this instanceof M?P:a;++Z<X;)te[Z]=b[Z];for(;W--;)te[Z++]=arguments[++U];return Rr(oe,x?m:this,te)}return M}function eE(a){return function(u,m,b){return b&&typeof b!="number"&&qr(u,m,b)&&(m=b=t),u=es(u),m===t?(m=u,u=0):m=es(m),b=b===t?u<m?1:-1:es(b),kN(u,m,b,a)}}function fh(a){return function(u,m){return typeof u=="string"&&typeof m=="string"||(u=Cn(u),m=Cn(m)),a(u,m)}}function tE(a,u,m,b,x,P,M,U,W,Z){var X=u&T,te=X?M:t,oe=X?t:M,he=X?P:t,we=X?t:P;u|=X?$:j,u&=~(X?j:$),u&k||(u&=~(w|E));var Pe=[a,u,x,he,te,we,oe,U,W,Z],be=m.apply(t,Pe);return Pb(a)&&pE(be,Pe),be.placeholder=b,hE(be,a,u)}function Cb(a){var u=ut[a];return function(m,b){if(m=Cn(m),b=b==null?0:Yt(Oe(b),292),b&&Ji(m)){var x=(ct(m)+"e").split("e"),P=u(x[0]+"e"+(+x[1]+b));return x=(ct(P)+"e").split("e"),+(x[0]+"e"+(+x[1]-b))}return u(m)}}var zN=Ns&&1/Sl(new Ns([,-0]))[1]==pe?function(a){return new Ns(a)}:Jb;function rE(a){return function(u){var m=pr(u);return m==er?As(u):m==_r?Np(u):mv(u,a(u))}}function Ki(a,u,m,b,x,P,M,U){var W=u&E;if(!W&&typeof a!="function")throw new Ir(i);var Z=b?b.length:0;if(Z||(u&=~($|j),b=x=t),M=M===t?M:Ct(Oe(M),0),U=U===t?U:Oe(U),Z-=x?x.length:0,u&j){var X=b,te=x;b=x=t}var oe=W?t:Ib(a),he=[a,u,m,b,x,X,te,P,M,U];if(oe&&aM(he,oe),a=he[0],u=he[1],m=he[2],b=he[3],x=he[4],U=he[9]=he[9]===t?W?0:a.length:Ct(he[9]-Z,0),!U&&u&(T|N)&&(u&=~(T|N)),!u||u==w)var we=BN(a,u,m);else u==T||u==N?we=VN(a,u,U):(u==$||u==(w|$))&&!x.length?we=WN(a,u,m,b):we=lh.apply(t,he);var Pe=oe?Mx:pE;return hE(Pe(we,he),a,u)}function nE(a,u,m,b){return a===t||Gn(a,$s[m])&&!ot.call(b,m)?u:a}function iE(a,u,m,b,x,P){return Pt(a)&&Pt(u)&&(P.set(u,a),Vt(a,u,t,iE,P),P.delete(u)),a}function JN(a){return Uc(a)?t:a}function sE(a,u,m,b,x,P){var M=m&v,U=a.length,W=u.length;if(U!=W&&!(M&&W>U))return!1;var Z=P.get(a),X=P.get(u);if(Z&&X)return Z==u&&X==a;var te=-1,oe=!0,he=m&_?new Gi:t;for(P.set(a,u),P.set(u,a);++te<U;){var we=a[te],Pe=u[te];if(b)var be=M?b(Pe,we,te,u,a,P):b(we,Pe,te,a,u,P);if(be!==t){if(be)continue;oe=!1;break}if(he){if(!gl(u,function(Be,Je){if(!lt(he,Je)&&(we===Be||x(we,Be,m,b,P)))return he.push(Je)})){oe=!1;break}}else if(!(we===Pe||x(we,Pe,m,b,P))){oe=!1;break}}return P.delete(a),P.delete(u),oe}function GN(a,u,m,b,x,P,M){switch(m){case Fn:if(a.byteLength!=u.byteLength||a.byteOffset!=u.byteOffset)return!1;a=a.buffer,u=u.buffer;case ji:return!(a.byteLength!=u.byteLength||!P(new xl(a),new xl(u)));case en:case Nr:case ko:return Gn(+a,+u);case Rt:return a.name==u.name&&a.message==u.message;case tr:case Po:return a==u+"";case er:var U=As;case _r:var W=b&v;if(U||(U=Sl),a.size!=u.size&&!W)return!1;var Z=M.get(a);if(Z)return Z==u;b|=_,M.set(a,u);var X=sE(U(a),U(u),b,x,P,M);return M.delete(a),X;case tl:if(Xo)return Xo.call(a)==Xo.call(u)}return!1}function YN(a,u,m,b,x,P){var M=m&v,U=xb(a),W=U.length,Z=xb(u),X=Z.length;if(W!=X&&!M)return!1;for(var te=W;te--;){var oe=U[te];if(!(M?oe in u:ot.call(u,oe)))return!1}var he=P.get(a),we=P.get(u);if(he&&we)return he==u&&we==a;var Pe=!0;P.set(a,u),P.set(u,a);for(var be=M;++te<W;){oe=U[te];var Be=a[oe],Je=u[oe];if(b)var an=M?b(Je,Be,oe,u,a,P):b(Be,Je,oe,a,u,P);if(!(an===t?Be===Je||x(Be,Je,m,b,P):an)){Pe=!1;break}be||(be=oe=="constructor")}if(Pe&&!be){var kr=a.constructor,ln=u.constructor;kr!=ln&&"constructor"in a&&"constructor"in u&&!(typeof kr=="function"&&kr instanceof kr&&typeof ln=="function"&&ln instanceof ln)&&(Pe=!1)}return P.delete(a),P.delete(u),Pe}function Qi(a){return Ab(fE(a,t,SE),a+"")}function xb(a){return nh(a,nr,qb)}function Eb(a){return nh(a,Ur,oE)}var Ib=Tl?function(a){return Tl.get(a)}:Jb;function dh(a){for(var u=a.name+"",m=Ms[u],b=ot.call(Ms,u)?m.length:0;b--;){var x=m[b],P=x.func;if(P==null||P==a)return x.name}return u}function Ul(a){var u=ot.call(O,"placeholder")?O:a;return u.placeholder}function Se(){var a=O.iteratee||Wb;return a=a===Wb?R:a,arguments.length?a(arguments[0],arguments[1]):a}function ph(a,u){var m=a.__data__;return nM(u)?m[typeof u=="string"?"string":"hash"]:m.map}function Ob(a){for(var u=nr(a),m=u.length;m--;){var b=u[m],x=a[b];u[m]=[b,x,uE(x)]}return u}function na(a,u){var m=Ho(a,u);return He(m)?m:t}function KN(a){var u=ot.call(a,zi),m=a[zi];try{a[zi]=t;var b=!0}catch{}var x=Rl.call(a);return b&&(u?a[zi]=m:delete a[zi]),x}var qb=ql?function(a){return a==null?[]:(a=ze(a),vi(ql(a),function(u){return zo.call(a,u)}))}:Gb,oE=ql?function(a){for(var u=[];a;)bi(u,qb(a)),a=El(a);return u}:Gb,pr=sr;(Ic&&pr(new Ic(new ArrayBuffer(1)))!=Fn||Ko&&pr(new Ko)!=er||Oc&&pr(Oc.resolve())!=ap||Ns&&pr(new Ns)!=_r||Qo&&pr(new Qo)!=Gt)&&(pr=function(a){var u=sr(a),m=u==Mn?a.constructor:t,b=m?ia(m):"";if(b)switch(b){case Dv:return Fn;case Lv:return er;case jv:return ap;case Uv:return _r;case Hv:return Gt}return u});function QN(a,u,m){for(var b=-1,x=m.length;++b<x;){var P=m[b],M=P.size;switch(P.type){case"drop":a+=M;break;case"dropRight":u-=M;break;case"take":u=Yt(u,a+M);break;case"takeRight":a=Ct(a,u-M);break}}return{start:a,end:u}}function ZN(a){var u=a.match(Dn);return u?u[1].split(gn):[]}function aE(a,u,m){u=Hs(u,a);for(var b=-1,x=u.length,P=!1;++b<x;){var M=Jn(u[b]);if(!(P=a!=null&&m(a,M)))break;a=a[M]}return P||++b!=x?P:(x=a==null?0:a.length,!!x&&Sh(x)&&Zi(M,x)&&(Ee(a)||sa(a)))}function XN(a){var u=a.length,m=new a.constructor(u);return u&&typeof a[0]=="string"&&ot.call(a,"index")&&(m.index=a.index,m.input=a.input),m}function lE(a){return typeof a.constructor=="function"&&!Lc(a)?Fs(El(a)):{}}function eM(a,u,m){var b=a.constructor;switch(u){case ji:return _b(a);case en:case Nr:return new b(+a);case Fn:return FN(a,m);case pt:case rl:case nl:case Cs:case To:case xs:case yi:case Es:case oc:return Vx(a,m);case er:return new b;case ko:case Po:return new b(a);case tr:return DN(a);case _r:return new b;case tl:return LN(a)}}function tM(a,u){var m=u.length;if(!m)return a;var b=m-1;return u[b]=(m>1?"& ":"")+u[b],u=u.join(m>2?", ":" "),a.replace(rr,`{
2
2
  /* [wrapped with `+u+`] */
3
- `)}function rM(a){return Ee(a)||ia(a)||!!(jp&&a&&a[jp])}function Zi(a,u){var m=typeof a;return u=u??ke,!!u&&(m=="number"||m!="symbol"&&Is.test(a))&&a>-1&&a%1==0&&a<u}function qr(a,u,m){if(!Pt(m))return!1;var b=typeof u;return(b=="number"?jr(m)&&Zi(u,m.length):b=="string"&&u in m)?Gn(m[u],a):!1}function kb(a,u){if(Ee(a))return!1;var m=typeof a;return m=="number"||m=="symbol"||m=="boolean"||a==null||on(a)?!0:Fe.test(a)||!Mr.test(a)||u!=null&&a in ze(u)}function nM(a){var u=typeof a;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?a!=="__proto__":a===null}function Pb(a){var u=dh(a),m=O[u];if(typeof m!="function"||!(u in De.prototype))return!1;if(a===m)return!0;var b=Ib(m);return!!b&&a===b[0]}function iM(a){return!!Fp&&Fp in a}var sM=Vo?Xi:Yb;function Lc(a){var u=a&&a.constructor,m=typeof u=="function"&&u.prototype||$s;return a===m}function uE(a){return a===a&&!Pt(a)}function cE(a,u){return function(m){return m==null?!1:m[a]===u&&(u!==t||a in ze(m))}}function oM(a){var u=vh(a,function(b){return m.size===f&&m.clear(),b}),m=u.cache;return u}function aM(a,u){var m=a[1],b=u[1],x=m|b,P=x<(w|E|G),M=b==G&&m==T||b==G&&m==q&&a[7].length<=u[8]||b==(G|q)&&u[7].length<=u[8]&&m==T;if(!(P||M))return a;b&w&&(a[2]=u[2],x|=m&w?0:k);var U=u[3];if(U){var W=a[3];a[3]=W?zx(W,U,u[4]):U,a[4]=W?vn(a[3],c):u[4]}return U=u[5],U&&(W=a[5],a[5]=W?Jx(W,U,u[6]):U,a[6]=W?vn(a[5],c):u[6]),U=u[7],U&&(a[7]=U),b&G&&(a[8]=a[8]==null?u[8]:Jt(a[8],u[8])),a[9]==null&&(a[9]=u[9]),a[0]=u[0],a[1]=x,a}function lM(a){var u=[];if(a!=null)for(var m in ze(a))u.push(m);return u}function uM(a){return Rl.call(a)}function fE(a,u,m){return u=Ct(u===t?a.length-1:u,0),function(){for(var b=arguments,x=-1,P=Ct(b.length-u,0),M=z(P);++x<P;)M[x]=b[u+x];x=-1;for(var U=z(u+1);++x<u;)U[x]=b[x];return U[u]=m(M),Rr(a,this,U)}}function dE(a,u){return u.length<2?a:Yi(a,_n(u,0,-1))}function cM(a,u){for(var m=a.length,b=Jt(u.length,m),x=Lr(a);b--;){var P=u[b];a[b]=Zi(P,m)?x[P]:t}return a}function Tb(a,u){if(!(u==="constructor"&&typeof a[u]=="function")&&u!="__proto__")return a[u]}var pE=mE(Mx),jc=Nv||function(a,u){return Ut.setTimeout(a,u)},Ab=mE(AN);function hE(a,u,m){var b=u+"";return Ab(a,tM(b,fM(ZN(b),m)))}function mE(a){var u=0,m=0;return function(){var b=Hp(),x=F-(b-m);if(m=b,x>0){if(++u>=B)return arguments[0]}else u=0;return a.apply(t,arguments)}}function hh(a,u){var m=-1,b=a.length,x=b-1;for(u=u===t?b:u;++m<u;){var P=mb(m,x),M=a[P];a[P]=a[m],a[m]=M}return a.length=u,a}var gE=oM(function(a){var u=[];return a.charCodeAt(0)===46&&u.push(""),a.replace(ac,function(m,b,x,P){u.push(x?P.replace(Ln,"$1"):b||m)}),u});function Jn(a){if(typeof a=="string"||on(a))return a;var u=a+"";return u=="0"&&1/a==-pe?"-0":u}function na(a){if(a!=null){try{return _l.call(a)}catch{}try{return a+""}catch{}}return""}function fM(a,u){return Cr(ce,function(m){var b="_."+m[0];u&m[1]&&!ml(a,b)&&a.push(b)}),a.sort()}function yE(a){if(a instanceof De)return a.clone();var u=new fr(a.__wrapped__,a.__chain__);return u.__actions__=Lr(a.__actions__),u.__index__=a.__index__,u.__values__=a.__values__,u}function dM(a,u,m){(m?qr(a,u,m):u===t)?u=1:u=Ct(Oe(u),0);var b=a==null?0:a.length;if(!b||u<1)return[];for(var x=0,P=0,M=z(Jo(b/u));x<b;)M[P++]=_n(a,x,x+=u);return M}function pM(a){for(var u=-1,m=a==null?0:a.length,b=0,x=[];++u<m;){var P=a[u];P&&(x[b++]=P)}return x}function hM(){var a=arguments.length;if(!a)return[];for(var u=z(a-1),m=arguments[0],b=a;b--;)u[b-1]=arguments[b];return bi(Ee(m)?Lr(m):[m],Gt(u,1))}var mM=Ne(function(a,u){return Dt(a)?Xo(a,Gt(u,1,Dt,!0)):[]}),gM=Ne(function(a,u){var m=Rn(u);return Dt(m)&&(m=t),Dt(a)?Xo(a,Gt(u,1,Dt,!0),Se(m,2)):[]}),yM=Ne(function(a,u){var m=Rn(u);return Dt(m)&&(m=t),Dt(a)?Xo(a,Gt(u,1,Dt,!0),t,m):[]});function vM(a,u,m){var b=a==null?0:a.length;return b?(u=m||u===t?1:Oe(u),_n(a,u<0?0:u,b)):[]}function bM(a,u,m){var b=a==null?0:a.length;return b?(u=m||u===t?1:Oe(u),u=b-u,_n(a,0,u<0?0:u)):[]}function SM(a,u){return a&&a.length?oh(a,Se(u,3),!0,!0):[]}function wM(a,u){return a&&a.length?oh(a,Se(u,3),!0):[]}function _M(a,u,m,b){var x=a==null?0:a.length;return x?(m&&typeof m!="number"&&qr(a,u,m)&&(m=0,b=x),lb(a,u,m,b)):[]}function vE(a,u,m){var b=a==null?0:a.length;if(!b)return-1;var x=m==null?0:Oe(m);return x<0&&(x=Ct(b+x,0)),yl(a,Se(u,3),x)}function bE(a,u,m){var b=a==null?0:a.length;if(!b)return-1;var x=b-1;return m!==t&&(x=Oe(m),x=m<0?Ct(b+x,0):Jt(x,b-1)),yl(a,Se(u,3),x,!0)}function SE(a){var u=a==null?0:a.length;return u?Gt(a,1):[]}function RM(a){var u=a==null?0:a.length;return u?Gt(a,pe):[]}function CM(a,u){var m=a==null?0:a.length;return m?(u=u===t?1:Oe(u),Gt(a,u)):[]}function xM(a){for(var u=-1,m=a==null?0:a.length,b={};++u<m;){var x=a[u];rn(b,x[0],x[1])}return b}function wE(a){return a&&a.length?a[0]:t}function EM(a,u,m){var b=a==null?0:a.length;if(!b)return-1;var x=m==null?0:Oe(m);return x<0&&(x=Ct(b+x,0)),Vi(a,u,x)}function IM(a){var u=a==null?0:a.length;return u?_n(a,0,-1):[]}var OM=Ne(function(a){var u=yt(a,Sb);return u.length&&u[0]===a[0]?nn(u):[]}),qM=Ne(function(a){var u=Rn(a),m=yt(a,Sb);return u===Rn(m)?u=t:m.pop(),m.length&&m[0]===a[0]?nn(m,Se(u,2)):[]}),kM=Ne(function(a){var u=Rn(a),m=yt(a,Sb);return u=typeof u=="function"?u:t,u&&m.pop(),m.length&&m[0]===a[0]?nn(m,t,u):[]});function PM(a,u){return a==null?"":Pl.call(a,u)}function Rn(a){var u=a==null?0:a.length;return u?a[u-1]:t}function TM(a,u,m){var b=a==null?0:a.length;if(!b)return-1;var x=b;return m!==t&&(x=Oe(m),x=x<0?Ct(b+x,0):Jt(x,b-1)),u===u?Ec(a,u,x):yl(a,Wi,x,!0)}function AM(a,u){return a&&a.length?zn(a,Oe(u)):t}var $M=Ne(_E);function _E(a,u){return a&&a.length&&u&&u.length?hb(a,u):a}function NM(a,u,m){return a&&a.length&&u&&u.length?hb(a,u,Se(m,2)):a}function MM(a,u,m){return a&&a.length&&u&&u.length?hb(a,u,t,m):a}var FM=Qi(function(a,u){var m=a==null?0:a.length,b=Tc(a,u);return Nx(a,yt(u,function(x){return Zi(x,m)?+x:x}).sort(Wx)),b});function DM(a,u){var m=[];if(!(a&&a.length))return m;var b=-1,x=[],P=a.length;for(u=Se(u,3);++b<P;){var M=a[b];u(M,b,a)&&(m.push(M),x.push(b))}return Nx(a,x),m}function $b(a){return a==null?a:Fv.call(a)}function LM(a,u,m){var b=a==null?0:a.length;return b?(m&&typeof m!="number"&&qr(a,u,m)?(u=0,m=b):(u=u==null?0:Oe(u),m=m===t?b:Oe(m)),_n(a,u,m)):[]}function jM(a,u){return sh(a,u)}function UM(a,u,m){return yb(a,u,Se(m,2))}function HM(a,u){var m=a==null?0:a.length;if(m){var b=sh(a,u);if(b<m&&Gn(a[b],u))return b}return-1}function BM(a,u){return sh(a,u,!0)}function VM(a,u,m){return yb(a,u,Se(m,2),!0)}function WM(a,u){var m=a==null?0:a.length;if(m){var b=sh(a,u,!0)-1;if(Gn(a[b],u))return b}return-1}function zM(a){return a&&a.length?Fx(a):[]}function JM(a,u){return a&&a.length?Fx(a,Se(u,2)):[]}function GM(a){var u=a==null?0:a.length;return u?_n(a,1,u):[]}function YM(a,u,m){return a&&a.length?(u=m||u===t?1:Oe(u),_n(a,0,u<0?0:u)):[]}function KM(a,u,m){var b=a==null?0:a.length;return b?(u=m||u===t?1:Oe(u),u=b-u,_n(a,u<0?0:u,b)):[]}function QM(a,u){return a&&a.length?oh(a,Se(u,3),!1,!0):[]}function ZM(a,u){return a&&a.length?oh(a,Se(u,3)):[]}var XM=Ne(function(a){return Us(Gt(a,1,Dt,!0))}),eF=Ne(function(a){var u=Rn(a);return Dt(u)&&(u=t),Us(Gt(a,1,Dt,!0),Se(u,2))}),tF=Ne(function(a){var u=Rn(a);return u=typeof u=="function"?u:t,Us(Gt(a,1,Dt,!0),t,u)});function rF(a){return a&&a.length?Us(a):[]}function nF(a,u){return a&&a.length?Us(a,Se(u,2)):[]}function iF(a,u){return u=typeof u=="function"?u:t,a&&a.length?Us(a,t,u):[]}function Nb(a){if(!(a&&a.length))return[];var u=0;return a=vi(a,function(m){if(Dt(m))return u=Ct(m.length,u),!0}),Cc(u,function(m){return yt(a,jo(m))})}function RE(a,u){if(!(a&&a.length))return[];var m=Nb(a);return u==null?m:yt(m,function(b){return Rr(u,t,b)})}var sF=Ne(function(a,u){return Dt(a)?Xo(a,u):[]}),oF=Ne(function(a){return bb(vi(a,Dt))}),aF=Ne(function(a){var u=Rn(a);return Dt(u)&&(u=t),bb(vi(a,Dt),Se(u,2))}),lF=Ne(function(a){var u=Rn(a);return u=typeof u=="function"?u:t,bb(vi(a,Dt),t,u)}),uF=Ne(Nb);function cF(a,u){return Ux(a||[],u||[],Or)}function fF(a,u){return Ux(a||[],u||[],Fc)}var dF=Ne(function(a){var u=a.length,m=u>1?a[u-1]:t;return m=typeof m=="function"?(a.pop(),m):t,RE(a,m)});function CE(a){var u=O(a);return u.__chain__=!0,u}function pF(a,u){return u(a),a}function mh(a,u){return u(a)}var hF=Qi(function(a){var u=a.length,m=u?a[0]:0,b=this.__wrapped__,x=function(P){return Tc(P,a)};return u>1||this.__actions__.length||!(b instanceof De)||!Zi(m)?this.thru(x):(b=b.slice(m,+m+(u?1:0)),b.__actions__.push({func:mh,args:[x],thisArg:t}),new fr(b,this.__chain__).thru(function(P){return u&&!P.length&&P.push(t),P}))});function mF(){return CE(this)}function gF(){return new fr(this.value(),this.__chain__)}function yF(){this.__values__===t&&(this.__values__=DE(this.value()));var a=this.__index__>=this.__values__.length,u=a?t:this.__values__[this.__index__++];return{done:a,value:u}}function vF(){return this}function bF(a){for(var u,m=this;m instanceof $l;){var b=yE(m);b.__index__=0,b.__values__=t,u?x.__wrapped__=b:u=b;var x=b;m=m.__wrapped__}return x.__wrapped__=a,u}function SF(){var a=this.__wrapped__;if(a instanceof De){var u=a;return this.__actions__.length&&(u=new De(this)),u=u.reverse(),u.__actions__.push({func:mh,args:[$b],thisArg:t}),new fr(u,this.__chain__)}return this.thru($b)}function wF(){return jx(this.__wrapped__,this.__actions__)}var _F=ah(function(a,u,m){ot.call(a,m)?++a[m]:rn(a,m,1)});function RF(a,u,m){var b=Ee(a)?qp:ab;return m&&qr(a,u,m)&&(u=t),b(a,Se(u,3))}function CF(a,u){var m=Ee(a)?vi:th;return m(a,Se(u,3))}var xF=Qx(vE),EF=Qx(bE);function IF(a,u){return Gt(gh(a,u),1)}function OF(a,u){return Gt(gh(a,u),pe)}function qF(a,u,m){return m=m===t?1:Oe(m),Gt(gh(a,u),m)}function xE(a,u){var m=Ee(a)?Cr:xi;return m(a,Se(u,3))}function EE(a,u){var m=Ee(a)?Sc:eh;return m(a,Se(u,3))}var kF=ah(function(a,u,m){ot.call(a,m)?a[m].push(u):rn(a,m,[u])});function PF(a,u,m,b){a=jr(a)?a:Bl(a),m=m&&!b?Oe(m):0;var x=a.length;return m<0&&(m=Ct(x+m,0)),wh(a)?m<=x&&a.indexOf(u,m)>-1:!!x&&Vi(a,u,m)>-1}var TF=Ne(function(a,u,m){var b=-1,x=typeof u=="function",P=jr(a)?z(a.length):[];return xi(a,function(M){P[++b]=x?Rr(u,M,m):ea(M,u,m)}),P}),AF=ah(function(a,u,m){rn(a,m,u)});function gh(a,u){var m=Ee(a)?yt:ae;return m(a,Se(u,3))}function $F(a,u,m,b){return a==null?[]:(Ee(u)||(u=u==null?[]:[u]),m=b?t:m,Ee(m)||(m=m==null?[]:[m]),Ax(a,u,m))}var NF=ah(function(a,u,m){a[m?0:1].push(u)},function(){return[[],[]]});function MF(a,u,m){var b=Ee(a)?wc:vl,x=arguments.length<3;return b(a,Se(u,4),m,x,xi)}function FF(a,u,m){var b=Ee(a)?uv:vl,x=arguments.length<3;return b(a,Se(u,4),m,x,eh)}function DF(a,u){var m=Ee(a)?vi:th;return m(a,bh(Se(u,3)))}function LF(a){var u=Ee(a)?Qp:PN;return u(a)}function jF(a,u,m){(m?qr(a,u,m):u===t)?u=1:u=Oe(u);var b=Ee(a)?nb:TN;return b(a,u)}function UF(a){var u=Ee(a)?ib:$N;return u(a)}function HF(a){if(a==null)return 0;if(jr(a))return wh(a)?Si(a):a.length;var u=pr(a);return u==Zt||u==_r?a.size:I(a).length}function BF(a,u,m){var b=Ee(a)?gl:NN;return m&&qr(a,u,m)&&(u=t),b(a,Se(u,3))}var VF=Ne(function(a,u){if(a==null)return[];var m=u.length;return m>1&&qr(a,u[0],u[1])?u=[]:m>2&&qr(u[0],u[1],u[2])&&(u=[u[0]]),Ax(a,Gt(u,1),[])}),yh=$v||function(){return Ut.Date.now()};function WF(a,u){if(typeof u!="function")throw new Ir(i);return a=Oe(a),function(){if(--a<1)return u.apply(this,arguments)}}function IE(a,u,m){return u=m?t:u,u=a&&u==null?a.length:u,Ki(a,G,t,t,t,t,u)}function OE(a,u){var m;if(typeof u!="function")throw new Ir(i);return a=Oe(a),function(){return--a>0&&(m=u.apply(this,arguments)),a<=1&&(u=t),m}}var Mb=Ne(function(a,u,m){var b=w;if(m.length){var x=vn(m,Ul(Mb));b|=$}return Ki(a,b,u,m,x)}),qE=Ne(function(a,u,m){var b=w|E;if(m.length){var x=vn(m,Ul(qE));b|=$}return Ki(u,b,a,m,x)});function kE(a,u,m){u=m?t:u;var b=Ki(a,T,t,t,t,t,t,u);return b.placeholder=kE.placeholder,b}function PE(a,u,m){u=m?t:u;var b=Ki(a,N,t,t,t,t,t,u);return b.placeholder=PE.placeholder,b}function TE(a,u,m){var b,x,P,M,U,W,Z=0,X=!1,te=!1,oe=!0;if(typeof a!="function")throw new Ir(i);u=Cn(u)||0,Pt(m)&&(X=!!m.leading,te="maxWait"in m,P=te?Ct(Cn(m.maxWait)||0,u):P,oe="trailing"in m?!!m.trailing:oe);function he(Lt){var Yn=b,ts=x;return b=x=t,Z=Lt,M=a.apply(ts,Yn),M}function we(Lt){return Z=Lt,U=jc(Be,u),X?he(Lt):M}function Pe(Lt){var Yn=Lt-W,ts=Lt-Z,ZE=u-Yn;return te?Jt(ZE,P-ts):ZE}function be(Lt){var Yn=Lt-W,ts=Lt-Z;return W===t||Yn>=u||Yn<0||te&&ts>=P}function Be(){var Lt=yh();if(be(Lt))return Je(Lt);U=jc(Be,Pe(Lt))}function Je(Lt){return U=t,oe&&b?he(Lt):(b=x=t,M)}function an(){U!==t&&Hx(U),Z=0,b=W=x=U=t}function kr(){return U===t?M:Je(yh())}function ln(){var Lt=yh(),Yn=be(Lt);if(b=arguments,x=this,W=Lt,Yn){if(U===t)return we(W);if(te)return Hx(U),U=jc(Be,u),he(W)}return U===t&&(U=jc(Be,u)),M}return ln.cancel=an,ln.flush=kr,ln}var zF=Ne(function(a,u){return Ac(a,1,u)}),JF=Ne(function(a,u,m){return Ac(a,Cn(u)||0,m)});function GF(a){return Ki(a,C)}function vh(a,u){if(typeof a!="function"||u!=null&&typeof u!="function")throw new Ir(i);var m=function(){var b=arguments,x=u?u.apply(this,b):b[0],P=m.cache;if(P.has(x))return P.get(x);var M=a.apply(this,b);return m.cache=P.set(x,M)||P,M};return m.cache=new(vh.Cache||Bn),m}vh.Cache=Bn;function bh(a){if(typeof a!="function")throw new Ir(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 YF(a){return OE(2,a)}var KF=MN(function(a,u){u=u.length==1&&Ee(u[0])?yt(u[0],xr(Se())):yt(Gt(u,1),xr(Se()));var m=u.length;return Ne(function(b){for(var x=-1,P=Jt(b.length,m);++x<P;)b[x]=u[x].call(this,b[x]);return Rr(a,this,b)})}),Fb=Ne(function(a,u){var m=vn(u,Ul(Fb));return Ki(a,$,t,u,m)}),AE=Ne(function(a,u){var m=vn(u,Ul(AE));return Ki(a,j,t,u,m)}),QF=Qi(function(a,u){return Ki(a,q,t,t,t,u)});function ZF(a,u){if(typeof a!="function")throw new Ir(i);return u=u===t?u:Oe(u),Ne(a,u)}function XF(a,u){if(typeof a!="function")throw new Ir(i);return u=u==null?0:Ct(Oe(u),0),Ne(function(m){var b=m[u],x=Bs(m,0,u);return b&&bi(x,b),Rr(a,this,x)})}function eD(a,u,m){var b=!0,x=!0;if(typeof a!="function")throw new Ir(i);return Pt(m)&&(b="leading"in m?!!m.leading:b,x="trailing"in m?!!m.trailing:x),TE(a,u,{leading:b,maxWait:u,trailing:x})}function tD(a){return IE(a,1)}function rD(a,u){return Fb(wb(u),a)}function nD(){if(!arguments.length)return[];var a=arguments[0];return Ee(a)?a:[a]}function iD(a){return dr(a,g)}function sD(a,u){return u=typeof u=="function"?u:t,dr(a,g,u)}function oD(a){return dr(a,p|g)}function aD(a,u){return u=typeof u=="function"?u:t,dr(a,p|g,u)}function lD(a,u){return u==null||Sn(a,u,tr(u))}function Gn(a,u){return a===u||a!==a&&u!==u}var uD=fh(Nc),cD=fh(function(a,u){return a>=u}),ia=ih((function(){return arguments})())?ih:function(a){return Tt(a)&&ot.call(a,"callee")&&!Wo.call(a,"callee")},Ee=z.isArray,fD=bc?xr(bc):db;function jr(a){return a!=null&&Sh(a.length)&&!Xi(a)}function Dt(a){return Tt(a)&&jr(a)}function dD(a){return a===!0||a===!1||Tt(a)&&nr(a)==en}var Vs=kl||Yb,pD=Ip?xr(Ip):pb;function hD(a){return Tt(a)&&a.nodeType===1&&!Uc(a)}function mD(a){if(a==null)return!0;if(jr(a)&&(Ee(a)||typeof a=="string"||typeof a.splice=="function"||Vs(a)||Hl(a)||ia(a)))return!a.length;var u=pr(a);if(u==Zt||u==_r)return!a.size;if(Lc(a))return!I(a).length;for(var m in a)if(ot.call(a,m))return!1;return!0}function gD(a,u){return ta(a,u)}function yD(a,u,m){m=typeof m=="function"?m:t;var b=m?m(a,u):t;return b===t?ta(a,u,t,m):!!b}function Db(a){if(!Tt(a))return!1;var u=nr(a);return u==Rt||u==_t||typeof a.message=="string"&&typeof a.name=="string"&&!Uc(a)}function vD(a){return typeof a=="number"&&Ji(a)}function Xi(a){if(!Pt(a))return!1;var u=nr(a);return u==hn||u==Oo||u==nt||u==lp}function $E(a){return typeof a=="number"&&a==Oe(a)}function Sh(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=ke}function Pt(a){var u=typeof a;return a!=null&&(u=="object"||u=="function")}function Tt(a){return a!=null&&typeof a=="object"}var NE=Op?xr(Op):Ls;function bD(a,u){return a===u||js(a,u,Ob(u))}function SD(a,u,m){return m=typeof m=="function"?m:t,js(a,u,Ob(u),m)}function wD(a){return ME(a)&&a!=+a}function _D(a){if(sM(a))throw new Re(n);return He(a)}function RD(a){return a===null}function CD(a){return a==null}function ME(a){return typeof a=="number"||Tt(a)&&nr(a)==qo}function Uc(a){if(!Tt(a)||nr(a)!=Mn)return!1;var u=El(a);if(u===null)return!0;var m=ot.call(u,"constructor")&&u.constructor;return typeof m=="function"&&m instanceof m&&_l.call(m)==kv}var Lb=Lo?xr(Lo):d;function xD(a){return $E(a)&&a>=-ke&&a<=ke}var FE=jn?xr(jn):y;function wh(a){return typeof a=="string"||!Ee(a)&&Tt(a)&&nr(a)==ko}function on(a){return typeof a=="symbol"||Tt(a)&&nr(a)==tl}var Hl=hl?xr(hl):S;function ED(a){return a===t}function ID(a){return Tt(a)&&pr(a)==zt}function OD(a){return Tt(a)&&nr(a)==cp}var qD=fh(Y),kD=fh(function(a,u){return a<=u});function DE(a){if(!a)return[];if(jr(a))return wh(a)?Er(a):Lr(a);if(zo&&a[zo])return Sv(a[zo]());var u=pr(a),m=u==Zt?As:u==_r?Sl:Bl;return m(a)}function es(a){if(!a)return a===0?a:0;if(a=Cn(a),a===pe||a===-pe){var u=a<0?-1:1;return u*de}return a===a?a:0}function Oe(a){var u=es(a),m=u%1;return u===u?m?u-m:u:0}function LE(a){return a?Ci(Oe(a),0,ve):0}function Cn(a){if(typeof a=="number")return a;if(on(a))return le;if(Pt(a)){var u=typeof a.valueOf=="function"?a.valueOf():a;a=Pt(u)?u+"":u}if(typeof a!="string")return a===0?a:+a;a=xc(a);var m=$o.test(a);return m||Ly.test(a)?av(a.slice(2),m?2:8):Dy.test(a)?le:+a}function jE(a){return Ei(a,Ur(a))}function PD(a){return a?Ci(Oe(a),-ke,ke):a===0?a:0}function ct(a){return a==null?"":sn(a)}var TD=Ll(function(a,u){if(Lc(u)||jr(u)){Ei(u,tr(u),a);return}for(var m in u)ot.call(u,m)&&Or(a,m,u[m])}),UE=Ll(function(a,u){Ei(u,Ur(u),a)}),HE=Ll(function(a,u,m,b){Ei(u,Ur(u),a,b)}),jb=Ll(function(a,u,m,b){Ei(u,tr(u),a,b)}),AD=Qi(Tc);function $D(a,u){var m=Fs(a);return u==null?m:Xp(m,u)}var ND=Ne(function(a,u){a=ze(a);var m=-1,b=u.length,x=b>2?u[2]:t;for(x&&qr(u[0],u[1],x)&&(b=1);++m<b;)for(var P=u[m],M=Ur(P),U=-1,W=M.length;++U<W;){var Z=M[U],X=a[Z];(X===t||Gn(X,$s[Z])&&!ot.call(a,Z))&&(a[Z]=P[Z])}return a}),MD=Ne(function(a){return a.push(t,iE),Rr(BE,t,a)});function FD(a,u){return kp(a,Se(u,3),wn)}function DD(a,u){return kp(a,Se(u,3),Vn)}function LD(a,u){return a==null?a:$c(a,Se(u,3),Ur)}function jD(a,u){return a==null?a:rh(a,Se(u,3),Ur)}function UD(a,u){return a&&wn(a,Se(u,3))}function HD(a,u){return a&&Vn(a,Se(u,3))}function BD(a){return a==null?[]:Dl(a,tr(a))}function VD(a){return a==null?[]:Dl(a,Ur(a))}function Ub(a,u,m){var b=a==null?t:Yi(a,u);return b===t?m:b}function WD(a,u){return a!=null&&aE(a,u,ub)}function Hb(a,u){return a!=null&&aE(a,u,cb)}var zD=Xx(function(a,u,m){u!=null&&typeof u.toString!="function"&&(u=Rl.call(u)),a[u]=m},Vb(Hr)),JD=Xx(function(a,u,m){u!=null&&typeof u.toString!="function"&&(u=Rl.call(u)),ot.call(a,u)?a[u].push(m):a[u]=[m]},Se),GD=Ne(ea);function tr(a){return jr(a)?Kp(a):I(a)}function Ur(a){return jr(a)?Kp(a,!0):L(a)}function YD(a,u){var m={};return u=Se(u,3),wn(a,function(b,x,P){rn(m,u(b,x,P),b)}),m}function KD(a,u){var m={};return u=Se(u,3),wn(a,function(b,x,P){rn(m,x,u(b,x,P))}),m}var QD=Ll(function(a,u,m){Ht(a,u,m)}),BE=Ll(function(a,u,m,b){Ht(a,u,m,b)}),ZD=Qi(function(a,u){var m={};if(a==null)return m;var b=!1;u=yt(u,function(P){return P=Hs(P,a),b||(b=P.length>1),P}),Ei(a,Eb(a),m),b&&(m=dr(m,p|h|g,JN));for(var x=u.length;x--;)vb(m,u[x]);return m});function XD(a,u){return VE(a,bh(Se(u)))}var eL=Qi(function(a,u){return a==null?{}:ON(a,u)});function VE(a,u){if(a==null)return{};var m=yt(Eb(a),function(b){return[b]});return u=Se(u),$x(a,m,function(b,x){return u(b,x[0])})}function tL(a,u,m){u=Hs(u,a);var b=-1,x=u.length;for(x||(x=1,a=t);++b<x;){var P=a==null?t:a[Jn(u[b])];P===t&&(b=x,P=m),a=Xi(P)?P.call(a):P}return a}function rL(a,u,m){return a==null?a:Fc(a,u,m)}function nL(a,u,m,b){return b=typeof b=="function"?b:t,a==null?a:Fc(a,u,m,b)}var WE=rE(tr),zE=rE(Ur);function iL(a,u,m){var b=Ee(a),x=b||Vs(a)||Hl(a);if(u=Se(u,4),m==null){var P=a&&a.constructor;x?m=b?new P:[]:Pt(a)?m=Xi(P)?Fs(El(a)):{}:m={}}return(x?Cr:wn)(a,function(M,U,W){return u(m,M,U,W)}),m}function sL(a,u){return a==null?!0:vb(a,u)}function oL(a,u,m){return a==null?a:Lx(a,u,wb(m))}function aL(a,u,m,b){return b=typeof b=="function"?b:t,a==null?a:Lx(a,u,wb(m),b)}function Bl(a){return a==null?[]:bl(a,tr(a))}function lL(a){return a==null?[]:bl(a,Ur(a))}function uL(a,u,m){return m===t&&(m=u,u=t),m!==t&&(m=Cn(m),m=m===m?m:0),u!==t&&(u=Cn(u),u=u===u?u:0),Ci(Cn(a),u,m)}function cL(a,u,m){return u=es(u),m===t?(m=u,u=0):m=es(m),a=Cn(a),fb(a,u,m)}function fL(a,u,m){if(m&&typeof m!="boolean"&&qr(a,u,m)&&(u=m=t),m===t&&(typeof u=="boolean"?(m=u,u=t):typeof a=="boolean"&&(m=a,a=t)),a===t&&u===t?(a=0,u=1):(a=es(a),u===t?(u=a,a=0):u=es(u)),a>u){var b=a;a=u,u=b}if(m||a%1||u%1){var x=Bp();return Jt(a+x*(u-a+xp("1e-"+((x+"").length-1))),u)}return mb(a,u)}var dL=jl(function(a,u,m){return u=u.toLowerCase(),a+(m?JE(u):u)});function JE(a){return Bb(ct(a).toLowerCase())}function GE(a){return a=ct(a),a&&a.replace(No,gv).replace(ev,"")}function pL(a,u,m){a=ct(a),u=sn(u);var b=a.length;m=m===t?b:Ci(Oe(m),0,b);var x=m;return m-=u.length,m>=0&&a.slice(m,x)==u}function hL(a){return a=ct(a),a&&fe.test(a)?a.replace(sl,yv):a}function mL(a){return a=ct(a),a&&Ao.test(a)?a.replace(it,"\\$&"):a}var gL=jl(function(a,u,m){return a+(m?"-":"")+u.toLowerCase()}),yL=jl(function(a,u,m){return a+(m?" ":"")+u.toLowerCase()}),vL=Kx("toLowerCase");function bL(a,u,m){a=ct(a),u=Oe(u);var b=u?Si(a):0;if(!u||b>=u)return a;var x=(u-b)/2;return ch(Go(x),m)+a+ch(Jo(x),m)}function SL(a,u,m){a=ct(a),u=Oe(u);var b=u?Si(a):0;return u&&b<u?a+ch(u-b,m):a}function wL(a,u,m){a=ct(a),u=Oe(u);var b=u?Si(a):0;return u&&b<u?ch(u-b,m)+a:a}function _L(a,u,m){return m||u==null?u=0:u&&(u=+u),Mv(ct(a).replace(lc,""),u||0)}function RL(a,u,m){return(m?qr(a,u,m):u===t)?u=1:u=Oe(u),gb(ct(a),u)}function CL(){var a=arguments,u=ct(a[0]);return a.length<3?u:u.replace(a[1],a[2])}var xL=jl(function(a,u,m){return a+(m?"_":"")+u.toLowerCase()});function EL(a,u,m){return m&&typeof m!="number"&&qr(a,u,m)&&(u=m=t),m=m===t?ve:m>>>0,m?(a=ct(a),a&&(typeof u=="string"||u!=null&&!Lb(u))&&(u=sn(u),!u&&Ts(a))?Bs(Er(a),0,m):a.split(u,m)):[]}var IL=jl(function(a,u,m){return a+(m?" ":"")+Bb(u)});function OL(a,u,m){return a=ct(a),m=m==null?0:Ci(Oe(m),0,a.length),u=sn(u),a.slice(m,m+u.length)==u}function qL(a,u,m){var b=O.templateSettings;m&&qr(a,u,m)&&(u=t),a=ct(a),u=jb({},u,b,nE);var x=jb({},u.imports,b.imports,nE),P=tr(x),M=bl(x,P);Cr(P,function(be){if(Fr.test(be))throw new Re(o)});var U,W,Z=0,X=u.interpolate||Mo,te="__p += '",oe=wl((u.escape||Mo).source+"|"+X.source+"|"+(X===mn?Hi:Mo).source+"|"+(u.evaluate||Mo).source+"|$","g"),he="//# sourceURL="+(ot.call(u,"sourceURL")?(u.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++sv+"]")+`
3
+ `)}function rM(a){return Ee(a)||sa(a)||!!(jp&&a&&a[jp])}function Zi(a,u){var m=typeof a;return u=u??ke,!!u&&(m=="number"||m!="symbol"&&Is.test(a))&&a>-1&&a%1==0&&a<u}function qr(a,u,m){if(!Pt(m))return!1;var b=typeof u;return(b=="number"?jr(m)&&Zi(u,m.length):b=="string"&&u in m)?Gn(m[u],a):!1}function kb(a,u){if(Ee(a))return!1;var m=typeof a;return m=="number"||m=="symbol"||m=="boolean"||a==null||on(a)?!0:Fe.test(a)||!Mr.test(a)||u!=null&&a in ze(u)}function nM(a){var u=typeof a;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?a!=="__proto__":a===null}function Pb(a){var u=dh(a),m=O[u];if(typeof m!="function"||!(u in De.prototype))return!1;if(a===m)return!0;var b=Ib(m);return!!b&&a===b[0]}function iM(a){return!!Fp&&Fp in a}var sM=Wo?Xi:Yb;function Lc(a){var u=a&&a.constructor,m=typeof u=="function"&&u.prototype||$s;return a===m}function uE(a){return a===a&&!Pt(a)}function cE(a,u){return function(m){return m==null?!1:m[a]===u&&(u!==t||a in ze(m))}}function oM(a){var u=vh(a,function(b){return m.size===f&&m.clear(),b}),m=u.cache;return u}function aM(a,u){var m=a[1],b=u[1],x=m|b,P=x<(w|E|G),M=b==G&&m==T||b==G&&m==q&&a[7].length<=u[8]||b==(G|q)&&u[7].length<=u[8]&&m==T;if(!(P||M))return a;b&w&&(a[2]=u[2],x|=m&w?0:k);var U=u[3];if(U){var W=a[3];a[3]=W?zx(W,U,u[4]):U,a[4]=W?vn(a[3],c):u[4]}return U=u[5],U&&(W=a[5],a[5]=W?Jx(W,U,u[6]):U,a[6]=W?vn(a[5],c):u[6]),U=u[7],U&&(a[7]=U),b&G&&(a[8]=a[8]==null?u[8]:Yt(a[8],u[8])),a[9]==null&&(a[9]=u[9]),a[0]=u[0],a[1]=x,a}function lM(a){var u=[];if(a!=null)for(var m in ze(a))u.push(m);return u}function uM(a){return Rl.call(a)}function fE(a,u,m){return u=Ct(u===t?a.length-1:u,0),function(){for(var b=arguments,x=-1,P=Ct(b.length-u,0),M=z(P);++x<P;)M[x]=b[u+x];x=-1;for(var U=z(u+1);++x<u;)U[x]=b[x];return U[u]=m(M),Rr(a,this,U)}}function dE(a,u){return u.length<2?a:Yi(a,_n(u,0,-1))}function cM(a,u){for(var m=a.length,b=Yt(u.length,m),x=Lr(a);b--;){var P=u[b];a[b]=Zi(P,m)?x[P]:t}return a}function Tb(a,u){if(!(u==="constructor"&&typeof a[u]=="function")&&u!="__proto__")return a[u]}var pE=mE(Mx),jc=Nv||function(a,u){return Bt.setTimeout(a,u)},Ab=mE(AN);function hE(a,u,m){var b=u+"";return Ab(a,tM(b,fM(ZN(b),m)))}function mE(a){var u=0,m=0;return function(){var b=Hp(),x=F-(b-m);if(m=b,x>0){if(++u>=B)return arguments[0]}else u=0;return a.apply(t,arguments)}}function hh(a,u){var m=-1,b=a.length,x=b-1;for(u=u===t?b:u;++m<u;){var P=mb(m,x),M=a[P];a[P]=a[m],a[m]=M}return a.length=u,a}var gE=oM(function(a){var u=[];return a.charCodeAt(0)===46&&u.push(""),a.replace(ac,function(m,b,x,P){u.push(x?P.replace(Ln,"$1"):b||m)}),u});function Jn(a){if(typeof a=="string"||on(a))return a;var u=a+"";return u=="0"&&1/a==-pe?"-0":u}function ia(a){if(a!=null){try{return _l.call(a)}catch{}try{return a+""}catch{}}return""}function fM(a,u){return Cr(ce,function(m){var b="_."+m[0];u&m[1]&&!ml(a,b)&&a.push(b)}),a.sort()}function yE(a){if(a instanceof De)return a.clone();var u=new fr(a.__wrapped__,a.__chain__);return u.__actions__=Lr(a.__actions__),u.__index__=a.__index__,u.__values__=a.__values__,u}function dM(a,u,m){(m?qr(a,u,m):u===t)?u=1:u=Ct(Oe(u),0);var b=a==null?0:a.length;if(!b||u<1)return[];for(var x=0,P=0,M=z(Go(b/u));x<b;)M[P++]=_n(a,x,x+=u);return M}function pM(a){for(var u=-1,m=a==null?0:a.length,b=0,x=[];++u<m;){var P=a[u];P&&(x[b++]=P)}return x}function hM(){var a=arguments.length;if(!a)return[];for(var u=z(a-1),m=arguments[0],b=a;b--;)u[b-1]=arguments[b];return bi(Ee(m)?Lr(m):[m],Kt(u,1))}var mM=Ne(function(a,u){return jt(a)?ea(a,Kt(u,1,jt,!0)):[]}),gM=Ne(function(a,u){var m=Rn(u);return jt(m)&&(m=t),jt(a)?ea(a,Kt(u,1,jt,!0),Se(m,2)):[]}),yM=Ne(function(a,u){var m=Rn(u);return jt(m)&&(m=t),jt(a)?ea(a,Kt(u,1,jt,!0),t,m):[]});function vM(a,u,m){var b=a==null?0:a.length;return b?(u=m||u===t?1:Oe(u),_n(a,u<0?0:u,b)):[]}function bM(a,u,m){var b=a==null?0:a.length;return b?(u=m||u===t?1:Oe(u),u=b-u,_n(a,0,u<0?0:u)):[]}function SM(a,u){return a&&a.length?oh(a,Se(u,3),!0,!0):[]}function wM(a,u){return a&&a.length?oh(a,Se(u,3),!0):[]}function _M(a,u,m,b){var x=a==null?0:a.length;return x?(m&&typeof m!="number"&&qr(a,u,m)&&(m=0,b=x),lb(a,u,m,b)):[]}function vE(a,u,m){var b=a==null?0:a.length;if(!b)return-1;var x=m==null?0:Oe(m);return x<0&&(x=Ct(b+x,0)),yl(a,Se(u,3),x)}function bE(a,u,m){var b=a==null?0:a.length;if(!b)return-1;var x=b-1;return m!==t&&(x=Oe(m),x=m<0?Ct(b+x,0):Yt(x,b-1)),yl(a,Se(u,3),x,!0)}function SE(a){var u=a==null?0:a.length;return u?Kt(a,1):[]}function RM(a){var u=a==null?0:a.length;return u?Kt(a,pe):[]}function CM(a,u){var m=a==null?0:a.length;return m?(u=u===t?1:Oe(u),Kt(a,u)):[]}function xM(a){for(var u=-1,m=a==null?0:a.length,b={};++u<m;){var x=a[u];rn(b,x[0],x[1])}return b}function wE(a){return a&&a.length?a[0]:t}function EM(a,u,m){var b=a==null?0:a.length;if(!b)return-1;var x=m==null?0:Oe(m);return x<0&&(x=Ct(b+x,0)),Vi(a,u,x)}function IM(a){var u=a==null?0:a.length;return u?_n(a,0,-1):[]}var OM=Ne(function(a){var u=yt(a,Sb);return u.length&&u[0]===a[0]?nn(u):[]}),qM=Ne(function(a){var u=Rn(a),m=yt(a,Sb);return u===Rn(m)?u=t:m.pop(),m.length&&m[0]===a[0]?nn(m,Se(u,2)):[]}),kM=Ne(function(a){var u=Rn(a),m=yt(a,Sb);return u=typeof u=="function"?u:t,u&&m.pop(),m.length&&m[0]===a[0]?nn(m,t,u):[]});function PM(a,u){return a==null?"":Pl.call(a,u)}function Rn(a){var u=a==null?0:a.length;return u?a[u-1]:t}function TM(a,u,m){var b=a==null?0:a.length;if(!b)return-1;var x=b;return m!==t&&(x=Oe(m),x=x<0?Ct(b+x,0):Yt(x,b-1)),u===u?Ec(a,u,x):yl(a,Wi,x,!0)}function AM(a,u){return a&&a.length?zn(a,Oe(u)):t}var $M=Ne(_E);function _E(a,u){return a&&a.length&&u&&u.length?hb(a,u):a}function NM(a,u,m){return a&&a.length&&u&&u.length?hb(a,u,Se(m,2)):a}function MM(a,u,m){return a&&a.length&&u&&u.length?hb(a,u,t,m):a}var FM=Qi(function(a,u){var m=a==null?0:a.length,b=Tc(a,u);return Nx(a,yt(u,function(x){return Zi(x,m)?+x:x}).sort(Wx)),b});function DM(a,u){var m=[];if(!(a&&a.length))return m;var b=-1,x=[],P=a.length;for(u=Se(u,3);++b<P;){var M=a[b];u(M,b,a)&&(m.push(M),x.push(b))}return Nx(a,x),m}function $b(a){return a==null?a:Fv.call(a)}function LM(a,u,m){var b=a==null?0:a.length;return b?(m&&typeof m!="number"&&qr(a,u,m)?(u=0,m=b):(u=u==null?0:Oe(u),m=m===t?b:Oe(m)),_n(a,u,m)):[]}function jM(a,u){return sh(a,u)}function UM(a,u,m){return yb(a,u,Se(m,2))}function HM(a,u){var m=a==null?0:a.length;if(m){var b=sh(a,u);if(b<m&&Gn(a[b],u))return b}return-1}function BM(a,u){return sh(a,u,!0)}function VM(a,u,m){return yb(a,u,Se(m,2),!0)}function WM(a,u){var m=a==null?0:a.length;if(m){var b=sh(a,u,!0)-1;if(Gn(a[b],u))return b}return-1}function zM(a){return a&&a.length?Fx(a):[]}function JM(a,u){return a&&a.length?Fx(a,Se(u,2)):[]}function GM(a){var u=a==null?0:a.length;return u?_n(a,1,u):[]}function YM(a,u,m){return a&&a.length?(u=m||u===t?1:Oe(u),_n(a,0,u<0?0:u)):[]}function KM(a,u,m){var b=a==null?0:a.length;return b?(u=m||u===t?1:Oe(u),u=b-u,_n(a,u<0?0:u,b)):[]}function QM(a,u){return a&&a.length?oh(a,Se(u,3),!1,!0):[]}function ZM(a,u){return a&&a.length?oh(a,Se(u,3)):[]}var XM=Ne(function(a){return Us(Kt(a,1,jt,!0))}),eF=Ne(function(a){var u=Rn(a);return jt(u)&&(u=t),Us(Kt(a,1,jt,!0),Se(u,2))}),tF=Ne(function(a){var u=Rn(a);return u=typeof u=="function"?u:t,Us(Kt(a,1,jt,!0),t,u)});function rF(a){return a&&a.length?Us(a):[]}function nF(a,u){return a&&a.length?Us(a,Se(u,2)):[]}function iF(a,u){return u=typeof u=="function"?u:t,a&&a.length?Us(a,t,u):[]}function Nb(a){if(!(a&&a.length))return[];var u=0;return a=vi(a,function(m){if(jt(m))return u=Ct(m.length,u),!0}),Cc(u,function(m){return yt(a,Uo(m))})}function RE(a,u){if(!(a&&a.length))return[];var m=Nb(a);return u==null?m:yt(m,function(b){return Rr(u,t,b)})}var sF=Ne(function(a,u){return jt(a)?ea(a,u):[]}),oF=Ne(function(a){return bb(vi(a,jt))}),aF=Ne(function(a){var u=Rn(a);return jt(u)&&(u=t),bb(vi(a,jt),Se(u,2))}),lF=Ne(function(a){var u=Rn(a);return u=typeof u=="function"?u:t,bb(vi(a,jt),t,u)}),uF=Ne(Nb);function cF(a,u){return Ux(a||[],u||[],Or)}function fF(a,u){return Ux(a||[],u||[],Fc)}var dF=Ne(function(a){var u=a.length,m=u>1?a[u-1]:t;return m=typeof m=="function"?(a.pop(),m):t,RE(a,m)});function CE(a){var u=O(a);return u.__chain__=!0,u}function pF(a,u){return u(a),a}function mh(a,u){return u(a)}var hF=Qi(function(a){var u=a.length,m=u?a[0]:0,b=this.__wrapped__,x=function(P){return Tc(P,a)};return u>1||this.__actions__.length||!(b instanceof De)||!Zi(m)?this.thru(x):(b=b.slice(m,+m+(u?1:0)),b.__actions__.push({func:mh,args:[x],thisArg:t}),new fr(b,this.__chain__).thru(function(P){return u&&!P.length&&P.push(t),P}))});function mF(){return CE(this)}function gF(){return new fr(this.value(),this.__chain__)}function yF(){this.__values__===t&&(this.__values__=DE(this.value()));var a=this.__index__>=this.__values__.length,u=a?t:this.__values__[this.__index__++];return{done:a,value:u}}function vF(){return this}function bF(a){for(var u,m=this;m instanceof $l;){var b=yE(m);b.__index__=0,b.__values__=t,u?x.__wrapped__=b:u=b;var x=b;m=m.__wrapped__}return x.__wrapped__=a,u}function SF(){var a=this.__wrapped__;if(a instanceof De){var u=a;return this.__actions__.length&&(u=new De(this)),u=u.reverse(),u.__actions__.push({func:mh,args:[$b],thisArg:t}),new fr(u,this.__chain__)}return this.thru($b)}function wF(){return jx(this.__wrapped__,this.__actions__)}var _F=ah(function(a,u,m){ot.call(a,m)?++a[m]:rn(a,m,1)});function RF(a,u,m){var b=Ee(a)?qp:ab;return m&&qr(a,u,m)&&(u=t),b(a,Se(u,3))}function CF(a,u){var m=Ee(a)?vi:th;return m(a,Se(u,3))}var xF=Qx(vE),EF=Qx(bE);function IF(a,u){return Kt(gh(a,u),1)}function OF(a,u){return Kt(gh(a,u),pe)}function qF(a,u,m){return m=m===t?1:Oe(m),Kt(gh(a,u),m)}function xE(a,u){var m=Ee(a)?Cr:xi;return m(a,Se(u,3))}function EE(a,u){var m=Ee(a)?Sc:eh;return m(a,Se(u,3))}var kF=ah(function(a,u,m){ot.call(a,m)?a[m].push(u):rn(a,m,[u])});function PF(a,u,m,b){a=jr(a)?a:Bl(a),m=m&&!b?Oe(m):0;var x=a.length;return m<0&&(m=Ct(x+m,0)),wh(a)?m<=x&&a.indexOf(u,m)>-1:!!x&&Vi(a,u,m)>-1}var TF=Ne(function(a,u,m){var b=-1,x=typeof u=="function",P=jr(a)?z(a.length):[];return xi(a,function(M){P[++b]=x?Rr(u,M,m):ta(M,u,m)}),P}),AF=ah(function(a,u,m){rn(a,m,u)});function gh(a,u){var m=Ee(a)?yt:ae;return m(a,Se(u,3))}function $F(a,u,m,b){return a==null?[]:(Ee(u)||(u=u==null?[]:[u]),m=b?t:m,Ee(m)||(m=m==null?[]:[m]),Ax(a,u,m))}var NF=ah(function(a,u,m){a[m?0:1].push(u)},function(){return[[],[]]});function MF(a,u,m){var b=Ee(a)?wc:vl,x=arguments.length<3;return b(a,Se(u,4),m,x,xi)}function FF(a,u,m){var b=Ee(a)?uv:vl,x=arguments.length<3;return b(a,Se(u,4),m,x,eh)}function DF(a,u){var m=Ee(a)?vi:th;return m(a,bh(Se(u,3)))}function LF(a){var u=Ee(a)?Qp:PN;return u(a)}function jF(a,u,m){(m?qr(a,u,m):u===t)?u=1:u=Oe(u);var b=Ee(a)?nb:TN;return b(a,u)}function UF(a){var u=Ee(a)?ib:$N;return u(a)}function HF(a){if(a==null)return 0;if(jr(a))return wh(a)?Si(a):a.length;var u=pr(a);return u==er||u==_r?a.size:I(a).length}function BF(a,u,m){var b=Ee(a)?gl:NN;return m&&qr(a,u,m)&&(u=t),b(a,Se(u,3))}var VF=Ne(function(a,u){if(a==null)return[];var m=u.length;return m>1&&qr(a,u[0],u[1])?u=[]:m>2&&qr(u[0],u[1],u[2])&&(u=[u[0]]),Ax(a,Kt(u,1),[])}),yh=$v||function(){return Bt.Date.now()};function WF(a,u){if(typeof u!="function")throw new Ir(i);return a=Oe(a),function(){if(--a<1)return u.apply(this,arguments)}}function IE(a,u,m){return u=m?t:u,u=a&&u==null?a.length:u,Ki(a,G,t,t,t,t,u)}function OE(a,u){var m;if(typeof u!="function")throw new Ir(i);return a=Oe(a),function(){return--a>0&&(m=u.apply(this,arguments)),a<=1&&(u=t),m}}var Mb=Ne(function(a,u,m){var b=w;if(m.length){var x=vn(m,Ul(Mb));b|=$}return Ki(a,b,u,m,x)}),qE=Ne(function(a,u,m){var b=w|E;if(m.length){var x=vn(m,Ul(qE));b|=$}return Ki(u,b,a,m,x)});function kE(a,u,m){u=m?t:u;var b=Ki(a,T,t,t,t,t,t,u);return b.placeholder=kE.placeholder,b}function PE(a,u,m){u=m?t:u;var b=Ki(a,N,t,t,t,t,t,u);return b.placeholder=PE.placeholder,b}function TE(a,u,m){var b,x,P,M,U,W,Z=0,X=!1,te=!1,oe=!0;if(typeof a!="function")throw new Ir(i);u=Cn(u)||0,Pt(m)&&(X=!!m.leading,te="maxWait"in m,P=te?Ct(Cn(m.maxWait)||0,u):P,oe="trailing"in m?!!m.trailing:oe);function he(Ut){var Yn=b,ts=x;return b=x=t,Z=Ut,M=a.apply(ts,Yn),M}function we(Ut){return Z=Ut,U=jc(Be,u),X?he(Ut):M}function Pe(Ut){var Yn=Ut-W,ts=Ut-Z,ZE=u-Yn;return te?Yt(ZE,P-ts):ZE}function be(Ut){var Yn=Ut-W,ts=Ut-Z;return W===t||Yn>=u||Yn<0||te&&ts>=P}function Be(){var Ut=yh();if(be(Ut))return Je(Ut);U=jc(Be,Pe(Ut))}function Je(Ut){return U=t,oe&&b?he(Ut):(b=x=t,M)}function an(){U!==t&&Hx(U),Z=0,b=W=x=U=t}function kr(){return U===t?M:Je(yh())}function ln(){var Ut=yh(),Yn=be(Ut);if(b=arguments,x=this,W=Ut,Yn){if(U===t)return we(W);if(te)return Hx(U),U=jc(Be,u),he(W)}return U===t&&(U=jc(Be,u)),M}return ln.cancel=an,ln.flush=kr,ln}var zF=Ne(function(a,u){return Ac(a,1,u)}),JF=Ne(function(a,u,m){return Ac(a,Cn(u)||0,m)});function GF(a){return Ki(a,C)}function vh(a,u){if(typeof a!="function"||u!=null&&typeof u!="function")throw new Ir(i);var m=function(){var b=arguments,x=u?u.apply(this,b):b[0],P=m.cache;if(P.has(x))return P.get(x);var M=a.apply(this,b);return m.cache=P.set(x,M)||P,M};return m.cache=new(vh.Cache||Bn),m}vh.Cache=Bn;function bh(a){if(typeof a!="function")throw new Ir(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 YF(a){return OE(2,a)}var KF=MN(function(a,u){u=u.length==1&&Ee(u[0])?yt(u[0],xr(Se())):yt(Kt(u,1),xr(Se()));var m=u.length;return Ne(function(b){for(var x=-1,P=Yt(b.length,m);++x<P;)b[x]=u[x].call(this,b[x]);return Rr(a,this,b)})}),Fb=Ne(function(a,u){var m=vn(u,Ul(Fb));return Ki(a,$,t,u,m)}),AE=Ne(function(a,u){var m=vn(u,Ul(AE));return Ki(a,j,t,u,m)}),QF=Qi(function(a,u){return Ki(a,q,t,t,t,u)});function ZF(a,u){if(typeof a!="function")throw new Ir(i);return u=u===t?u:Oe(u),Ne(a,u)}function XF(a,u){if(typeof a!="function")throw new Ir(i);return u=u==null?0:Ct(Oe(u),0),Ne(function(m){var b=m[u],x=Bs(m,0,u);return b&&bi(x,b),Rr(a,this,x)})}function eD(a,u,m){var b=!0,x=!0;if(typeof a!="function")throw new Ir(i);return Pt(m)&&(b="leading"in m?!!m.leading:b,x="trailing"in m?!!m.trailing:x),TE(a,u,{leading:b,maxWait:u,trailing:x})}function tD(a){return IE(a,1)}function rD(a,u){return Fb(wb(u),a)}function nD(){if(!arguments.length)return[];var a=arguments[0];return Ee(a)?a:[a]}function iD(a){return dr(a,g)}function sD(a,u){return u=typeof u=="function"?u:t,dr(a,g,u)}function oD(a){return dr(a,p|g)}function aD(a,u){return u=typeof u=="function"?u:t,dr(a,p|g,u)}function lD(a,u){return u==null||Sn(a,u,nr(u))}function Gn(a,u){return a===u||a!==a&&u!==u}var uD=fh(Nc),cD=fh(function(a,u){return a>=u}),sa=ih((function(){return arguments})())?ih:function(a){return At(a)&&ot.call(a,"callee")&&!zo.call(a,"callee")},Ee=z.isArray,fD=bc?xr(bc):db;function jr(a){return a!=null&&Sh(a.length)&&!Xi(a)}function jt(a){return At(a)&&jr(a)}function dD(a){return a===!0||a===!1||At(a)&&sr(a)==en}var Vs=kl||Yb,pD=Ip?xr(Ip):pb;function hD(a){return At(a)&&a.nodeType===1&&!Uc(a)}function mD(a){if(a==null)return!0;if(jr(a)&&(Ee(a)||typeof a=="string"||typeof a.splice=="function"||Vs(a)||Hl(a)||sa(a)))return!a.length;var u=pr(a);if(u==er||u==_r)return!a.size;if(Lc(a))return!I(a).length;for(var m in a)if(ot.call(a,m))return!1;return!0}function gD(a,u){return ra(a,u)}function yD(a,u,m){m=typeof m=="function"?m:t;var b=m?m(a,u):t;return b===t?ra(a,u,t,m):!!b}function Db(a){if(!At(a))return!1;var u=sr(a);return u==Rt||u==_t||typeof a.message=="string"&&typeof a.name=="string"&&!Uc(a)}function vD(a){return typeof a=="number"&&Ji(a)}function Xi(a){if(!Pt(a))return!1;var u=sr(a);return u==hn||u==qo||u==nt||u==lp}function $E(a){return typeof a=="number"&&a==Oe(a)}function Sh(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=ke}function Pt(a){var u=typeof a;return a!=null&&(u=="object"||u=="function")}function At(a){return a!=null&&typeof a=="object"}var NE=Op?xr(Op):Ls;function bD(a,u){return a===u||js(a,u,Ob(u))}function SD(a,u,m){return m=typeof m=="function"?m:t,js(a,u,Ob(u),m)}function wD(a){return ME(a)&&a!=+a}function _D(a){if(sM(a))throw new Re(n);return He(a)}function RD(a){return a===null}function CD(a){return a==null}function ME(a){return typeof a=="number"||At(a)&&sr(a)==ko}function Uc(a){if(!At(a)||sr(a)!=Mn)return!1;var u=El(a);if(u===null)return!0;var m=ot.call(u,"constructor")&&u.constructor;return typeof m=="function"&&m instanceof m&&_l.call(m)==kv}var Lb=jo?xr(jo):d;function xD(a){return $E(a)&&a>=-ke&&a<=ke}var FE=jn?xr(jn):y;function wh(a){return typeof a=="string"||!Ee(a)&&At(a)&&sr(a)==Po}function on(a){return typeof a=="symbol"||At(a)&&sr(a)==tl}var Hl=hl?xr(hl):S;function ED(a){return a===t}function ID(a){return At(a)&&pr(a)==Gt}function OD(a){return At(a)&&sr(a)==cp}var qD=fh(Y),kD=fh(function(a,u){return a<=u});function DE(a){if(!a)return[];if(jr(a))return wh(a)?Er(a):Lr(a);if(Jo&&a[Jo])return Sv(a[Jo]());var u=pr(a),m=u==er?As:u==_r?Sl:Bl;return m(a)}function es(a){if(!a)return a===0?a:0;if(a=Cn(a),a===pe||a===-pe){var u=a<0?-1:1;return u*de}return a===a?a:0}function Oe(a){var u=es(a),m=u%1;return u===u?m?u-m:u:0}function LE(a){return a?Ci(Oe(a),0,ve):0}function Cn(a){if(typeof a=="number")return a;if(on(a))return le;if(Pt(a)){var u=typeof a.valueOf=="function"?a.valueOf():a;a=Pt(u)?u+"":u}if(typeof a!="string")return a===0?a:+a;a=xc(a);var m=No.test(a);return m||Ly.test(a)?av(a.slice(2),m?2:8):Dy.test(a)?le:+a}function jE(a){return Ei(a,Ur(a))}function PD(a){return a?Ci(Oe(a),-ke,ke):a===0?a:0}function ct(a){return a==null?"":sn(a)}var TD=Ll(function(a,u){if(Lc(u)||jr(u)){Ei(u,nr(u),a);return}for(var m in u)ot.call(u,m)&&Or(a,m,u[m])}),UE=Ll(function(a,u){Ei(u,Ur(u),a)}),HE=Ll(function(a,u,m,b){Ei(u,Ur(u),a,b)}),jb=Ll(function(a,u,m,b){Ei(u,nr(u),a,b)}),AD=Qi(Tc);function $D(a,u){var m=Fs(a);return u==null?m:Xp(m,u)}var ND=Ne(function(a,u){a=ze(a);var m=-1,b=u.length,x=b>2?u[2]:t;for(x&&qr(u[0],u[1],x)&&(b=1);++m<b;)for(var P=u[m],M=Ur(P),U=-1,W=M.length;++U<W;){var Z=M[U],X=a[Z];(X===t||Gn(X,$s[Z])&&!ot.call(a,Z))&&(a[Z]=P[Z])}return a}),MD=Ne(function(a){return a.push(t,iE),Rr(BE,t,a)});function FD(a,u){return kp(a,Se(u,3),wn)}function DD(a,u){return kp(a,Se(u,3),Vn)}function LD(a,u){return a==null?a:$c(a,Se(u,3),Ur)}function jD(a,u){return a==null?a:rh(a,Se(u,3),Ur)}function UD(a,u){return a&&wn(a,Se(u,3))}function HD(a,u){return a&&Vn(a,Se(u,3))}function BD(a){return a==null?[]:Dl(a,nr(a))}function VD(a){return a==null?[]:Dl(a,Ur(a))}function Ub(a,u,m){var b=a==null?t:Yi(a,u);return b===t?m:b}function WD(a,u){return a!=null&&aE(a,u,ub)}function Hb(a,u){return a!=null&&aE(a,u,cb)}var zD=Xx(function(a,u,m){u!=null&&typeof u.toString!="function"&&(u=Rl.call(u)),a[u]=m},Vb(Hr)),JD=Xx(function(a,u,m){u!=null&&typeof u.toString!="function"&&(u=Rl.call(u)),ot.call(a,u)?a[u].push(m):a[u]=[m]},Se),GD=Ne(ta);function nr(a){return jr(a)?Kp(a):I(a)}function Ur(a){return jr(a)?Kp(a,!0):L(a)}function YD(a,u){var m={};return u=Se(u,3),wn(a,function(b,x,P){rn(m,u(b,x,P),b)}),m}function KD(a,u){var m={};return u=Se(u,3),wn(a,function(b,x,P){rn(m,x,u(b,x,P))}),m}var QD=Ll(function(a,u,m){Vt(a,u,m)}),BE=Ll(function(a,u,m,b){Vt(a,u,m,b)}),ZD=Qi(function(a,u){var m={};if(a==null)return m;var b=!1;u=yt(u,function(P){return P=Hs(P,a),b||(b=P.length>1),P}),Ei(a,Eb(a),m),b&&(m=dr(m,p|h|g,JN));for(var x=u.length;x--;)vb(m,u[x]);return m});function XD(a,u){return VE(a,bh(Se(u)))}var eL=Qi(function(a,u){return a==null?{}:ON(a,u)});function VE(a,u){if(a==null)return{};var m=yt(Eb(a),function(b){return[b]});return u=Se(u),$x(a,m,function(b,x){return u(b,x[0])})}function tL(a,u,m){u=Hs(u,a);var b=-1,x=u.length;for(x||(x=1,a=t);++b<x;){var P=a==null?t:a[Jn(u[b])];P===t&&(b=x,P=m),a=Xi(P)?P.call(a):P}return a}function rL(a,u,m){return a==null?a:Fc(a,u,m)}function nL(a,u,m,b){return b=typeof b=="function"?b:t,a==null?a:Fc(a,u,m,b)}var WE=rE(nr),zE=rE(Ur);function iL(a,u,m){var b=Ee(a),x=b||Vs(a)||Hl(a);if(u=Se(u,4),m==null){var P=a&&a.constructor;x?m=b?new P:[]:Pt(a)?m=Xi(P)?Fs(El(a)):{}:m={}}return(x?Cr:wn)(a,function(M,U,W){return u(m,M,U,W)}),m}function sL(a,u){return a==null?!0:vb(a,u)}function oL(a,u,m){return a==null?a:Lx(a,u,wb(m))}function aL(a,u,m,b){return b=typeof b=="function"?b:t,a==null?a:Lx(a,u,wb(m),b)}function Bl(a){return a==null?[]:bl(a,nr(a))}function lL(a){return a==null?[]:bl(a,Ur(a))}function uL(a,u,m){return m===t&&(m=u,u=t),m!==t&&(m=Cn(m),m=m===m?m:0),u!==t&&(u=Cn(u),u=u===u?u:0),Ci(Cn(a),u,m)}function cL(a,u,m){return u=es(u),m===t?(m=u,u=0):m=es(m),a=Cn(a),fb(a,u,m)}function fL(a,u,m){if(m&&typeof m!="boolean"&&qr(a,u,m)&&(u=m=t),m===t&&(typeof u=="boolean"?(m=u,u=t):typeof a=="boolean"&&(m=a,a=t)),a===t&&u===t?(a=0,u=1):(a=es(a),u===t?(u=a,a=0):u=es(u)),a>u){var b=a;a=u,u=b}if(m||a%1||u%1){var x=Bp();return Yt(a+x*(u-a+xp("1e-"+((x+"").length-1))),u)}return mb(a,u)}var dL=jl(function(a,u,m){return u=u.toLowerCase(),a+(m?JE(u):u)});function JE(a){return Bb(ct(a).toLowerCase())}function GE(a){return a=ct(a),a&&a.replace(Mo,gv).replace(ev,"")}function pL(a,u,m){a=ct(a),u=sn(u);var b=a.length;m=m===t?b:Ci(Oe(m),0,b);var x=m;return m-=u.length,m>=0&&a.slice(m,x)==u}function hL(a){return a=ct(a),a&&fe.test(a)?a.replace(sl,yv):a}function mL(a){return a=ct(a),a&&$o.test(a)?a.replace(it,"\\$&"):a}var gL=jl(function(a,u,m){return a+(m?"-":"")+u.toLowerCase()}),yL=jl(function(a,u,m){return a+(m?" ":"")+u.toLowerCase()}),vL=Kx("toLowerCase");function bL(a,u,m){a=ct(a),u=Oe(u);var b=u?Si(a):0;if(!u||b>=u)return a;var x=(u-b)/2;return ch(Yo(x),m)+a+ch(Go(x),m)}function SL(a,u,m){a=ct(a),u=Oe(u);var b=u?Si(a):0;return u&&b<u?a+ch(u-b,m):a}function wL(a,u,m){a=ct(a),u=Oe(u);var b=u?Si(a):0;return u&&b<u?ch(u-b,m)+a:a}function _L(a,u,m){return m||u==null?u=0:u&&(u=+u),Mv(ct(a).replace(lc,""),u||0)}function RL(a,u,m){return(m?qr(a,u,m):u===t)?u=1:u=Oe(u),gb(ct(a),u)}function CL(){var a=arguments,u=ct(a[0]);return a.length<3?u:u.replace(a[1],a[2])}var xL=jl(function(a,u,m){return a+(m?"_":"")+u.toLowerCase()});function EL(a,u,m){return m&&typeof m!="number"&&qr(a,u,m)&&(u=m=t),m=m===t?ve:m>>>0,m?(a=ct(a),a&&(typeof u=="string"||u!=null&&!Lb(u))&&(u=sn(u),!u&&Ts(a))?Bs(Er(a),0,m):a.split(u,m)):[]}var IL=jl(function(a,u,m){return a+(m?" ":"")+Bb(u)});function OL(a,u,m){return a=ct(a),m=m==null?0:Ci(Oe(m),0,a.length),u=sn(u),a.slice(m,m+u.length)==u}function qL(a,u,m){var b=O.templateSettings;m&&qr(a,u,m)&&(u=t),a=ct(a),u=jb({},u,b,nE);var x=jb({},u.imports,b.imports,nE),P=nr(x),M=bl(x,P);Cr(P,function(be){if(Fr.test(be))throw new Re(o)});var U,W,Z=0,X=u.interpolate||Fo,te="__p += '",oe=wl((u.escape||Fo).source+"|"+X.source+"|"+(X===mn?Hi:Fo).source+"|"+(u.evaluate||Fo).source+"|$","g"),he="//# sourceURL="+(ot.call(u,"sourceURL")?(u.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++sv+"]")+`
4
4
  `;a.replace(oe,function(be,Be,Je,an,kr,ln){return Je||(Je=an),te+=a.slice(Z,ln).replace(jy,vv),Be&&(U=!0,te+=`' +
5
5
  __e(`+Be+`) +
6
6
  '`),kr&&(W=!0,te+=`';
@@ -11,30 +11,30 @@ __p += '`),Je&&(te+=`' +
11
11
  `;var we=ot.call(u,"variable")&&u.variable;if(!we)te=`with (obj) {
12
12
  `+te+`
13
13
  }
14
- `;else if(Fr.test(we))throw new Re(s);te=(W?te.replace(il,""):te).replace(Ny,"$1").replace(To,"$1;"),te="function("+(we||"obj")+`) {
14
+ `;else if(Fr.test(we))throw new Re(s);te=(W?te.replace(il,""):te).replace(Ny,"$1").replace(Ao,"$1;"),te="function("+(we||"obj")+`) {
15
15
  `+(we?"":`obj || (obj = {});
16
16
  `)+"var __t, __p = ''"+(U?", __e = _.escape":"")+(W?`, __j = Array.prototype.join;
17
17
  function print() { __p += __j.call(arguments, '') }
18
18
  `:`;
19
19
  `)+te+`return __p
20
- }`;var Pe=KE(function(){return tt(P,he+"return "+te).apply(t,M)});if(Pe.source=te,Db(Pe))throw Pe;return Pe}function kL(a){return ct(a).toLowerCase()}function PL(a){return ct(a).toUpperCase()}function TL(a,u,m){if(a=ct(a),a&&(m||u===t))return xc(a);if(!a||!(u=sn(u)))return a;var b=Er(a),x=Er(u),P=Tp(b,x),M=Ap(b,x)+1;return Bs(b,P,M).join("")}function AL(a,u,m){if(a=ct(a),a&&(m||u===t))return a.slice(0,Mp(a)+1);if(!a||!(u=sn(u)))return a;var b=Er(a),x=Ap(b,Er(u))+1;return Bs(b,0,x).join("")}function $L(a,u,m){if(a=ct(a),a&&(m||u===t))return a.replace(lc,"");if(!a||!(u=sn(u)))return a;var b=Er(a),x=Tp(b,Er(u));return Bs(b,x).join("")}function NL(a,u){var m=A,b=D;if(Pt(u)){var x="separator"in u?u.separator:x;m="length"in u?Oe(u.length):m,b="omission"in u?sn(u.omission):b}a=ct(a);var P=a.length;if(Ts(a)){var M=Er(a);P=M.length}if(m>=P)return a;var U=m-Si(b);if(U<1)return b;var W=M?Bs(M,0,U).join(""):a.slice(0,U);if(x===t)return W+b;if(M&&(U+=W.length-U),Lb(x)){if(a.slice(U).search(x)){var Z,X=W;for(x.global||(x=wl(x.source,ct(fp.exec(x))+"g")),x.lastIndex=0;Z=x.exec(X);)var te=Z.index;W=W.slice(0,te===t?U:te)}}else if(a.indexOf(sn(x),U)!=U){var oe=W.lastIndexOf(x);oe>-1&&(W=W.slice(0,oe))}return W+b}function ML(a){return a=ct(a),a&&ol.test(a)?a.replace(Ui,_v):a}var FL=jl(function(a,u,m){return a+(m?" ":"")+u.toUpperCase()}),Bb=Kx("toUpperCase");function YE(a,u,m){return a=ct(a),u=m?t:u,u===t?bv(a)?xv(a):dv(a):a.match(u)||[]}var KE=Ne(function(a,u){try{return Rr(a,t,u)}catch(m){return Db(m)?m:new Re(m)}}),DL=Qi(function(a,u){return Cr(u,function(m){m=Jn(m),rn(a,m,Mb(a[m],a))}),a});function LL(a){var u=a==null?0:a.length,m=Se();return a=u?yt(a,function(b){if(typeof b[1]!="function")throw new Ir(i);return[m(b[0]),b[1]]}):[],Ne(function(b){for(var x=-1;++x<u;){var P=a[x];if(Rr(P[0],this,b))return Rr(P[1],this,b)}})}function jL(a){return ob(dr(a,p))}function Vb(a){return function(){return a}}function UL(a,u){return a==null||a!==a?u:a}var HL=Zx(),BL=Zx(!0);function Hr(a){return a}function Wb(a){return R(typeof a=="function"?a:dr(a,p))}function VL(a){return _e(dr(a,p))}function WL(a,u){return Le(a,dr(u,p))}var zL=Ne(function(a,u){return function(m){return ea(m,a,u)}}),JL=Ne(function(a,u){return function(m){return ea(a,m,u)}});function zb(a,u,m){var b=tr(u),x=Dl(u,b);m==null&&!(Pt(u)&&(x.length||!b.length))&&(m=u,u=a,a=this,x=Dl(u,tr(u)));var P=!(Pt(m)&&"chain"in m)||!!m.chain,M=Xi(a);return Cr(x,function(U){var W=u[U];a[U]=W,M&&(a.prototype[U]=function(){var Z=this.__chain__;if(P||Z){var X=a(this.__wrapped__),te=X.__actions__=Lr(this.__actions__);return te.push({func:W,args:arguments,thisArg:a}),X.__chain__=Z,X}return W.apply(a,bi([this.value()],arguments))})}),a}function GL(){return Ut._===this&&(Ut._=Pv),this}function Jb(){}function YL(a){return a=Oe(a),Ne(function(u){return zn(u,a)})}var KL=Rb(yt),QL=Rb(qp),ZL=Rb(gl);function QE(a){return kb(a)?jo(Jn(a)):qN(a)}function XL(a){return function(u){return a==null?t:Yi(a,u)}}var ej=eE(),tj=eE(!0);function Gb(){return[]}function Yb(){return!1}function rj(){return{}}function nj(){return""}function ij(){return!0}function sj(a,u){if(a=Oe(a),a<1||a>ke)return[];var m=ve,b=Jt(a,ve);u=Se(u),a-=ve;for(var x=Cc(b,u);++m<a;)u(m);return x}function oj(a){return Ee(a)?yt(a,Jn):on(a)?[a]:Lr(gE(ct(a)))}function aj(a){var u=++qv;return ct(a)+u}var lj=uh(function(a,u){return a+u},0),uj=Cb("ceil"),cj=uh(function(a,u){return a/u},1),fj=Cb("floor");function dj(a){return a&&a.length?Fl(a,Hr,Nc):t}function pj(a,u){return a&&a.length?Fl(a,Se(u,2),Nc):t}function hj(a){return Pp(a,Hr)}function mj(a,u){return Pp(a,Se(u,2))}function gj(a){return a&&a.length?Fl(a,Hr,Y):t}function yj(a,u){return a&&a.length?Fl(a,Se(u,2),Y):t}var vj=uh(function(a,u){return a*u},1),bj=Cb("round"),Sj=uh(function(a,u){return a-u},0);function wj(a){return a&&a.length?Rc(a,Hr):0}function _j(a,u){return a&&a.length?Rc(a,Se(u,2)):0}return O.after=WF,O.ary=IE,O.assign=TD,O.assignIn=UE,O.assignInWith=HE,O.assignWith=jb,O.at=AD,O.before=OE,O.bind=Mb,O.bindAll=DL,O.bindKey=qE,O.castArray=nD,O.chain=CE,O.chunk=dM,O.compact=pM,O.concat=hM,O.cond=LL,O.conforms=jL,O.constant=Vb,O.countBy=_F,O.create=$D,O.curry=kE,O.curryRight=PE,O.debounce=TE,O.defaults=ND,O.defaultsDeep=MD,O.defer=zF,O.delay=JF,O.difference=mM,O.differenceBy=gM,O.differenceWith=yM,O.drop=vM,O.dropRight=bM,O.dropRightWhile=SM,O.dropWhile=wM,O.fill=_M,O.filter=CF,O.flatMap=IF,O.flatMapDeep=OF,O.flatMapDepth=qF,O.flatten=SE,O.flattenDeep=RM,O.flattenDepth=CM,O.flip=GF,O.flow=HL,O.flowRight=BL,O.fromPairs=xM,O.functions=BD,O.functionsIn=VD,O.groupBy=kF,O.initial=IM,O.intersection=OM,O.intersectionBy=qM,O.intersectionWith=kM,O.invert=zD,O.invertBy=JD,O.invokeMap=TF,O.iteratee=Wb,O.keyBy=AF,O.keys=tr,O.keysIn=Ur,O.map=gh,O.mapKeys=YD,O.mapValues=KD,O.matches=VL,O.matchesProperty=WL,O.memoize=vh,O.merge=QD,O.mergeWith=BE,O.method=zL,O.methodOf=JL,O.mixin=zb,O.negate=bh,O.nthArg=YL,O.omit=ZD,O.omitBy=XD,O.once=YF,O.orderBy=$F,O.over=KL,O.overArgs=KF,O.overEvery=QL,O.overSome=ZL,O.partial=Fb,O.partialRight=AE,O.partition=NF,O.pick=eL,O.pickBy=VE,O.property=QE,O.propertyOf=XL,O.pull=$M,O.pullAll=_E,O.pullAllBy=NM,O.pullAllWith=MM,O.pullAt=FM,O.range=ej,O.rangeRight=tj,O.rearg=QF,O.reject=DF,O.remove=DM,O.rest=ZF,O.reverse=$b,O.sampleSize=jF,O.set=rL,O.setWith=nL,O.shuffle=UF,O.slice=LM,O.sortBy=VF,O.sortedUniq=zM,O.sortedUniqBy=JM,O.split=EL,O.spread=XF,O.tail=GM,O.take=YM,O.takeRight=KM,O.takeRightWhile=QM,O.takeWhile=ZM,O.tap=pF,O.throttle=eD,O.thru=mh,O.toArray=DE,O.toPairs=WE,O.toPairsIn=zE,O.toPath=oj,O.toPlainObject=jE,O.transform=iL,O.unary=tD,O.union=XM,O.unionBy=eF,O.unionWith=tF,O.uniq=rF,O.uniqBy=nF,O.uniqWith=iF,O.unset=sL,O.unzip=Nb,O.unzipWith=RE,O.update=oL,O.updateWith=aL,O.values=Bl,O.valuesIn=lL,O.without=sF,O.words=YE,O.wrap=rD,O.xor=oF,O.xorBy=aF,O.xorWith=lF,O.zip=uF,O.zipObject=cF,O.zipObjectDeep=fF,O.zipWith=dF,O.entries=WE,O.entriesIn=zE,O.extend=UE,O.extendWith=HE,zb(O,O),O.add=lj,O.attempt=KE,O.camelCase=dL,O.capitalize=JE,O.ceil=uj,O.clamp=uL,O.clone=iD,O.cloneDeep=oD,O.cloneDeepWith=aD,O.cloneWith=sD,O.conformsTo=lD,O.deburr=GE,O.defaultTo=UL,O.divide=cj,O.endsWith=pL,O.eq=Gn,O.escape=hL,O.escapeRegExp=mL,O.every=RF,O.find=xF,O.findIndex=vE,O.findKey=FD,O.findLast=EF,O.findLastIndex=bE,O.findLastKey=DD,O.floor=fj,O.forEach=xE,O.forEachRight=EE,O.forIn=LD,O.forInRight=jD,O.forOwn=UD,O.forOwnRight=HD,O.get=Ub,O.gt=uD,O.gte=cD,O.has=WD,O.hasIn=Hb,O.head=wE,O.identity=Hr,O.includes=PF,O.indexOf=EM,O.inRange=cL,O.invoke=GD,O.isArguments=ia,O.isArray=Ee,O.isArrayBuffer=fD,O.isArrayLike=jr,O.isArrayLikeObject=Dt,O.isBoolean=dD,O.isBuffer=Vs,O.isDate=pD,O.isElement=hD,O.isEmpty=mD,O.isEqual=gD,O.isEqualWith=yD,O.isError=Db,O.isFinite=vD,O.isFunction=Xi,O.isInteger=$E,O.isLength=Sh,O.isMap=NE,O.isMatch=bD,O.isMatchWith=SD,O.isNaN=wD,O.isNative=_D,O.isNil=CD,O.isNull=RD,O.isNumber=ME,O.isObject=Pt,O.isObjectLike=Tt,O.isPlainObject=Uc,O.isRegExp=Lb,O.isSafeInteger=xD,O.isSet=FE,O.isString=wh,O.isSymbol=on,O.isTypedArray=Hl,O.isUndefined=ED,O.isWeakMap=ID,O.isWeakSet=OD,O.join=PM,O.kebabCase=gL,O.last=Rn,O.lastIndexOf=TM,O.lowerCase=yL,O.lowerFirst=vL,O.lt=qD,O.lte=kD,O.max=dj,O.maxBy=pj,O.mean=hj,O.meanBy=mj,O.min=gj,O.minBy=yj,O.stubArray=Gb,O.stubFalse=Yb,O.stubObject=rj,O.stubString=nj,O.stubTrue=ij,O.multiply=vj,O.nth=AM,O.noConflict=GL,O.noop=Jb,O.now=yh,O.pad=bL,O.padEnd=SL,O.padStart=wL,O.parseInt=_L,O.random=fL,O.reduce=MF,O.reduceRight=FF,O.repeat=RL,O.replace=CL,O.result=tL,O.round=bj,O.runInContext=V,O.sample=LF,O.size=HF,O.snakeCase=xL,O.some=BF,O.sortedIndex=jM,O.sortedIndexBy=UM,O.sortedIndexOf=HM,O.sortedLastIndex=BM,O.sortedLastIndexBy=VM,O.sortedLastIndexOf=WM,O.startCase=IL,O.startsWith=OL,O.subtract=Sj,O.sum=wj,O.sumBy=_j,O.template=qL,O.times=sj,O.toFinite=es,O.toInteger=Oe,O.toLength=LE,O.toLower=kL,O.toNumber=Cn,O.toSafeInteger=PD,O.toString=ct,O.toUpper=PL,O.trim=TL,O.trimEnd=AL,O.trimStart=$L,O.truncate=NL,O.unescape=ML,O.uniqueId=aj,O.upperCase=FL,O.upperFirst=Bb,O.each=xE,O.eachRight=EE,O.first=wE,zb(O,(function(){var a={};return wn(O,function(u,m){ot.call(O.prototype,m)||(a[m]=u)}),a})(),{chain:!1}),O.VERSION=e,Cr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){O[a].placeholder=O}),Cr(["drop","take"],function(a,u){De.prototype[a]=function(m){m=m===t?1:Ct(Oe(m),0);var b=this.__filtered__&&!u?new De(this):this.clone();return b.__filtered__?b.__takeCount__=Jt(m,b.__takeCount__):b.__views__.push({size:Jt(m,ve),type:a+(b.__dir__<0?"Right":"")}),b},De.prototype[a+"Right"]=function(m){return this.reverse()[a](m).reverse()}}),Cr(["filter","map","takeWhile"],function(a,u){var m=u+1,b=m==K||m==ie;De.prototype[a]=function(x){var P=this.clone();return P.__iteratees__.push({iteratee:Se(x,3),type:m}),P.__filtered__=P.__filtered__||b,P}}),Cr(["head","last"],function(a,u){var m="take"+(u?"Right":"");De.prototype[a]=function(){return this[m](1).value()[0]}}),Cr(["initial","tail"],function(a,u){var m="drop"+(u?"":"Right");De.prototype[a]=function(){return this.__filtered__?new De(this):this[m](1)}}),De.prototype.compact=function(){return this.filter(Hr)},De.prototype.find=function(a){return this.filter(a).head()},De.prototype.findLast=function(a){return this.reverse().find(a)},De.prototype.invokeMap=Ne(function(a,u){return typeof a=="function"?new De(this):this.map(function(m){return ea(m,a,u)})}),De.prototype.reject=function(a){return this.filter(bh(Se(a)))},De.prototype.slice=function(a,u){a=Oe(a);var m=this;return m.__filtered__&&(a>0||u<0)?new De(m):(a<0?m=m.takeRight(-a):a&&(m=m.drop(a)),u!==t&&(u=Oe(u),m=u<0?m.dropRight(-u):m.take(u-a)),m)},De.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},De.prototype.toArray=function(){return this.take(ve)},wn(De.prototype,function(a,u){var m=/^(?:filter|find|map|reject)|While$/.test(u),b=/^(?:head|last)$/.test(u),x=O[b?"take"+(u=="last"?"Right":""):u],P=b||/^find/.test(u);x&&(O.prototype[u]=function(){var M=this.__wrapped__,U=b?[1]:arguments,W=M instanceof De,Z=U[0],X=W||Ee(M),te=function(Be){var Je=x.apply(O,bi([Be],U));return b&&oe?Je[0]:Je};X&&m&&typeof Z=="function"&&Z.length!=1&&(W=X=!1);var oe=this.__chain__,he=!!this.__actions__.length,we=P&&!oe,Pe=W&&!he;if(!P&&X){M=Pe?M:new De(this);var be=a.apply(M,U);return be.__actions__.push({func:mh,args:[te],thisArg:t}),new fr(be,oe)}return we&&Pe?a.apply(this,U):(be=this.thru(te),we?b?be.value()[0]:be.value():be)})}),Cr(["pop","push","shift","sort","splice","unshift"],function(a){var u=Bo[a],m=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",b=/^(?:pop|shift)$/.test(a);O.prototype[a]=function(){var x=arguments;if(b&&!this.__chain__){var P=this.value();return u.apply(Ee(P)?P:[],x)}return this[m](function(M){return u.apply(Ee(M)?M:[],x)})}}),wn(De.prototype,function(a,u){var m=O[u];if(m){var b=m.name+"";ot.call(Ms,b)||(Ms[b]=[]),Ms[b].push({name:u,func:m})}}),Ms[lh(t,E).name]=[{name:"wrapper",func:t}],De.prototype.clone=Bv,De.prototype.reverse=Vv,De.prototype.value=qc,O.prototype.at=hF,O.prototype.chain=mF,O.prototype.commit=gF,O.prototype.next=yF,O.prototype.plant=bF,O.prototype.reverse=SF,O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=wF,O.prototype.first=O.prototype.head,zo&&(O.prototype[zo]=vF),O}),wi=Ev();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Ut._=wi,define(function(){return wi})):st?((st.exports=wi)._=wi,pl._=wi):Ut._=wi}).call(Gl)});var vI=H((cS,Yl)=>{(function(t,e){typeof cS=="object"&&typeof Yl<"u"?Yl.exports=e():typeof define=="function"&&define.amd?define(e):t.moment=e()})(cS,(function(){"use strict";var t;function e(){return t.apply(null,arguments)}function r(d){t=d}function n(d){return d instanceof Array||Object.prototype.toString.call(d)==="[object Array]"}function i(d){return d!=null&&Object.prototype.toString.call(d)==="[object Object]"}function s(d,y){return Object.prototype.hasOwnProperty.call(d,y)}function o(d){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(d).length===0;var y;for(y in d)if(s(d,y))return!1;return!0}function l(d){return d===void 0}function f(d){return typeof d=="number"||Object.prototype.toString.call(d)==="[object Number]"}function c(d){return d instanceof Date||Object.prototype.toString.call(d)==="[object Date]"}function p(d,y){var S=[],R,I=d.length;for(R=0;R<I;++R)S.push(y(d[R],R));return S}function h(d,y){for(var S in y)s(y,S)&&(d[S]=y[S]);return s(y,"toString")&&(d.toString=y.toString),s(y,"valueOf")&&(d.valueOf=y.valueOf),d}function g(d,y,S,R){return bl(d,y,S,R,!0).utc()}function v(){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 _(d){return d._pf==null&&(d._pf=v()),d._pf}var w;Array.prototype.some?w=Array.prototype.some:w=function(d){var y=Object(this),S=y.length>>>0,R;for(R=0;R<S;R++)if(R in y&&d.call(this,y[R],R,y))return!0;return!1};function E(d){var y=null,S=!1,R=d._d&&!isNaN(d._d.getTime());if(R&&(y=_(d),S=w.call(y.parsedDateParts,function(I){return I!=null}),R=y.overflow<0&&!y.empty&&!y.invalidEra&&!y.invalidMonth&&!y.invalidWeekday&&!y.weekdayMismatch&&!y.nullInput&&!y.invalidFormat&&!y.userInvalidated&&(!y.meridiem||y.meridiem&&S),d._strict&&(R=R&&y.charsLeftOver===0&&y.unusedTokens.length===0&&y.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(d))d._isValid=R;else return R;return d._isValid}function k(d){var y=g(NaN);return d!=null?h(_(y),d):_(y).userInvalidated=!0,y}var T=e.momentProperties=[],N=!1;function $(d,y){var S,R,I,L=T.length;if(l(y._isAMomentObject)||(d._isAMomentObject=y._isAMomentObject),l(y._i)||(d._i=y._i),l(y._f)||(d._f=y._f),l(y._l)||(d._l=y._l),l(y._strict)||(d._strict=y._strict),l(y._tzm)||(d._tzm=y._tzm),l(y._isUTC)||(d._isUTC=y._isUTC),l(y._offset)||(d._offset=y._offset),l(y._pf)||(d._pf=_(y)),l(y._locale)||(d._locale=y._locale),L>0)for(S=0;S<L;S++)R=T[S],I=y[R],l(I)||(d[R]=I);return d}function j(d){$(this,d),this._d=new Date(d._d!=null?d._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),N===!1&&(N=!0,e.updateOffset(this),N=!1)}function G(d){return d instanceof j||d!=null&&d._isAMomentObject!=null}function q(d){e.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+d)}function C(d,y){var S=!0;return h(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,d),S){var R=[],I,L,Y,ae=arguments.length;for(L=0;L<ae;L++){if(I="",typeof arguments[L]=="object"){I+=`
20
+ }`;var Pe=KE(function(){return tt(P,he+"return "+te).apply(t,M)});if(Pe.source=te,Db(Pe))throw Pe;return Pe}function kL(a){return ct(a).toLowerCase()}function PL(a){return ct(a).toUpperCase()}function TL(a,u,m){if(a=ct(a),a&&(m||u===t))return xc(a);if(!a||!(u=sn(u)))return a;var b=Er(a),x=Er(u),P=Tp(b,x),M=Ap(b,x)+1;return Bs(b,P,M).join("")}function AL(a,u,m){if(a=ct(a),a&&(m||u===t))return a.slice(0,Mp(a)+1);if(!a||!(u=sn(u)))return a;var b=Er(a),x=Ap(b,Er(u))+1;return Bs(b,0,x).join("")}function $L(a,u,m){if(a=ct(a),a&&(m||u===t))return a.replace(lc,"");if(!a||!(u=sn(u)))return a;var b=Er(a),x=Tp(b,Er(u));return Bs(b,x).join("")}function NL(a,u){var m=A,b=D;if(Pt(u)){var x="separator"in u?u.separator:x;m="length"in u?Oe(u.length):m,b="omission"in u?sn(u.omission):b}a=ct(a);var P=a.length;if(Ts(a)){var M=Er(a);P=M.length}if(m>=P)return a;var U=m-Si(b);if(U<1)return b;var W=M?Bs(M,0,U).join(""):a.slice(0,U);if(x===t)return W+b;if(M&&(U+=W.length-U),Lb(x)){if(a.slice(U).search(x)){var Z,X=W;for(x.global||(x=wl(x.source,ct(fp.exec(x))+"g")),x.lastIndex=0;Z=x.exec(X);)var te=Z.index;W=W.slice(0,te===t?U:te)}}else if(a.indexOf(sn(x),U)!=U){var oe=W.lastIndexOf(x);oe>-1&&(W=W.slice(0,oe))}return W+b}function ML(a){return a=ct(a),a&&ol.test(a)?a.replace(Ui,_v):a}var FL=jl(function(a,u,m){return a+(m?" ":"")+u.toUpperCase()}),Bb=Kx("toUpperCase");function YE(a,u,m){return a=ct(a),u=m?t:u,u===t?bv(a)?xv(a):dv(a):a.match(u)||[]}var KE=Ne(function(a,u){try{return Rr(a,t,u)}catch(m){return Db(m)?m:new Re(m)}}),DL=Qi(function(a,u){return Cr(u,function(m){m=Jn(m),rn(a,m,Mb(a[m],a))}),a});function LL(a){var u=a==null?0:a.length,m=Se();return a=u?yt(a,function(b){if(typeof b[1]!="function")throw new Ir(i);return[m(b[0]),b[1]]}):[],Ne(function(b){for(var x=-1;++x<u;){var P=a[x];if(Rr(P[0],this,b))return Rr(P[1],this,b)}})}function jL(a){return ob(dr(a,p))}function Vb(a){return function(){return a}}function UL(a,u){return a==null||a!==a?u:a}var HL=Zx(),BL=Zx(!0);function Hr(a){return a}function Wb(a){return R(typeof a=="function"?a:dr(a,p))}function VL(a){return _e(dr(a,p))}function WL(a,u){return Le(a,dr(u,p))}var zL=Ne(function(a,u){return function(m){return ta(m,a,u)}}),JL=Ne(function(a,u){return function(m){return ta(a,m,u)}});function zb(a,u,m){var b=nr(u),x=Dl(u,b);m==null&&!(Pt(u)&&(x.length||!b.length))&&(m=u,u=a,a=this,x=Dl(u,nr(u)));var P=!(Pt(m)&&"chain"in m)||!!m.chain,M=Xi(a);return Cr(x,function(U){var W=u[U];a[U]=W,M&&(a.prototype[U]=function(){var Z=this.__chain__;if(P||Z){var X=a(this.__wrapped__),te=X.__actions__=Lr(this.__actions__);return te.push({func:W,args:arguments,thisArg:a}),X.__chain__=Z,X}return W.apply(a,bi([this.value()],arguments))})}),a}function GL(){return Bt._===this&&(Bt._=Pv),this}function Jb(){}function YL(a){return a=Oe(a),Ne(function(u){return zn(u,a)})}var KL=Rb(yt),QL=Rb(qp),ZL=Rb(gl);function QE(a){return kb(a)?Uo(Jn(a)):qN(a)}function XL(a){return function(u){return a==null?t:Yi(a,u)}}var ej=eE(),tj=eE(!0);function Gb(){return[]}function Yb(){return!1}function rj(){return{}}function nj(){return""}function ij(){return!0}function sj(a,u){if(a=Oe(a),a<1||a>ke)return[];var m=ve,b=Yt(a,ve);u=Se(u),a-=ve;for(var x=Cc(b,u);++m<a;)u(m);return x}function oj(a){return Ee(a)?yt(a,Jn):on(a)?[a]:Lr(gE(ct(a)))}function aj(a){var u=++qv;return ct(a)+u}var lj=uh(function(a,u){return a+u},0),uj=Cb("ceil"),cj=uh(function(a,u){return a/u},1),fj=Cb("floor");function dj(a){return a&&a.length?Fl(a,Hr,Nc):t}function pj(a,u){return a&&a.length?Fl(a,Se(u,2),Nc):t}function hj(a){return Pp(a,Hr)}function mj(a,u){return Pp(a,Se(u,2))}function gj(a){return a&&a.length?Fl(a,Hr,Y):t}function yj(a,u){return a&&a.length?Fl(a,Se(u,2),Y):t}var vj=uh(function(a,u){return a*u},1),bj=Cb("round"),Sj=uh(function(a,u){return a-u},0);function wj(a){return a&&a.length?Rc(a,Hr):0}function _j(a,u){return a&&a.length?Rc(a,Se(u,2)):0}return O.after=WF,O.ary=IE,O.assign=TD,O.assignIn=UE,O.assignInWith=HE,O.assignWith=jb,O.at=AD,O.before=OE,O.bind=Mb,O.bindAll=DL,O.bindKey=qE,O.castArray=nD,O.chain=CE,O.chunk=dM,O.compact=pM,O.concat=hM,O.cond=LL,O.conforms=jL,O.constant=Vb,O.countBy=_F,O.create=$D,O.curry=kE,O.curryRight=PE,O.debounce=TE,O.defaults=ND,O.defaultsDeep=MD,O.defer=zF,O.delay=JF,O.difference=mM,O.differenceBy=gM,O.differenceWith=yM,O.drop=vM,O.dropRight=bM,O.dropRightWhile=SM,O.dropWhile=wM,O.fill=_M,O.filter=CF,O.flatMap=IF,O.flatMapDeep=OF,O.flatMapDepth=qF,O.flatten=SE,O.flattenDeep=RM,O.flattenDepth=CM,O.flip=GF,O.flow=HL,O.flowRight=BL,O.fromPairs=xM,O.functions=BD,O.functionsIn=VD,O.groupBy=kF,O.initial=IM,O.intersection=OM,O.intersectionBy=qM,O.intersectionWith=kM,O.invert=zD,O.invertBy=JD,O.invokeMap=TF,O.iteratee=Wb,O.keyBy=AF,O.keys=nr,O.keysIn=Ur,O.map=gh,O.mapKeys=YD,O.mapValues=KD,O.matches=VL,O.matchesProperty=WL,O.memoize=vh,O.merge=QD,O.mergeWith=BE,O.method=zL,O.methodOf=JL,O.mixin=zb,O.negate=bh,O.nthArg=YL,O.omit=ZD,O.omitBy=XD,O.once=YF,O.orderBy=$F,O.over=KL,O.overArgs=KF,O.overEvery=QL,O.overSome=ZL,O.partial=Fb,O.partialRight=AE,O.partition=NF,O.pick=eL,O.pickBy=VE,O.property=QE,O.propertyOf=XL,O.pull=$M,O.pullAll=_E,O.pullAllBy=NM,O.pullAllWith=MM,O.pullAt=FM,O.range=ej,O.rangeRight=tj,O.rearg=QF,O.reject=DF,O.remove=DM,O.rest=ZF,O.reverse=$b,O.sampleSize=jF,O.set=rL,O.setWith=nL,O.shuffle=UF,O.slice=LM,O.sortBy=VF,O.sortedUniq=zM,O.sortedUniqBy=JM,O.split=EL,O.spread=XF,O.tail=GM,O.take=YM,O.takeRight=KM,O.takeRightWhile=QM,O.takeWhile=ZM,O.tap=pF,O.throttle=eD,O.thru=mh,O.toArray=DE,O.toPairs=WE,O.toPairsIn=zE,O.toPath=oj,O.toPlainObject=jE,O.transform=iL,O.unary=tD,O.union=XM,O.unionBy=eF,O.unionWith=tF,O.uniq=rF,O.uniqBy=nF,O.uniqWith=iF,O.unset=sL,O.unzip=Nb,O.unzipWith=RE,O.update=oL,O.updateWith=aL,O.values=Bl,O.valuesIn=lL,O.without=sF,O.words=YE,O.wrap=rD,O.xor=oF,O.xorBy=aF,O.xorWith=lF,O.zip=uF,O.zipObject=cF,O.zipObjectDeep=fF,O.zipWith=dF,O.entries=WE,O.entriesIn=zE,O.extend=UE,O.extendWith=HE,zb(O,O),O.add=lj,O.attempt=KE,O.camelCase=dL,O.capitalize=JE,O.ceil=uj,O.clamp=uL,O.clone=iD,O.cloneDeep=oD,O.cloneDeepWith=aD,O.cloneWith=sD,O.conformsTo=lD,O.deburr=GE,O.defaultTo=UL,O.divide=cj,O.endsWith=pL,O.eq=Gn,O.escape=hL,O.escapeRegExp=mL,O.every=RF,O.find=xF,O.findIndex=vE,O.findKey=FD,O.findLast=EF,O.findLastIndex=bE,O.findLastKey=DD,O.floor=fj,O.forEach=xE,O.forEachRight=EE,O.forIn=LD,O.forInRight=jD,O.forOwn=UD,O.forOwnRight=HD,O.get=Ub,O.gt=uD,O.gte=cD,O.has=WD,O.hasIn=Hb,O.head=wE,O.identity=Hr,O.includes=PF,O.indexOf=EM,O.inRange=cL,O.invoke=GD,O.isArguments=sa,O.isArray=Ee,O.isArrayBuffer=fD,O.isArrayLike=jr,O.isArrayLikeObject=jt,O.isBoolean=dD,O.isBuffer=Vs,O.isDate=pD,O.isElement=hD,O.isEmpty=mD,O.isEqual=gD,O.isEqualWith=yD,O.isError=Db,O.isFinite=vD,O.isFunction=Xi,O.isInteger=$E,O.isLength=Sh,O.isMap=NE,O.isMatch=bD,O.isMatchWith=SD,O.isNaN=wD,O.isNative=_D,O.isNil=CD,O.isNull=RD,O.isNumber=ME,O.isObject=Pt,O.isObjectLike=At,O.isPlainObject=Uc,O.isRegExp=Lb,O.isSafeInteger=xD,O.isSet=FE,O.isString=wh,O.isSymbol=on,O.isTypedArray=Hl,O.isUndefined=ED,O.isWeakMap=ID,O.isWeakSet=OD,O.join=PM,O.kebabCase=gL,O.last=Rn,O.lastIndexOf=TM,O.lowerCase=yL,O.lowerFirst=vL,O.lt=qD,O.lte=kD,O.max=dj,O.maxBy=pj,O.mean=hj,O.meanBy=mj,O.min=gj,O.minBy=yj,O.stubArray=Gb,O.stubFalse=Yb,O.stubObject=rj,O.stubString=nj,O.stubTrue=ij,O.multiply=vj,O.nth=AM,O.noConflict=GL,O.noop=Jb,O.now=yh,O.pad=bL,O.padEnd=SL,O.padStart=wL,O.parseInt=_L,O.random=fL,O.reduce=MF,O.reduceRight=FF,O.repeat=RL,O.replace=CL,O.result=tL,O.round=bj,O.runInContext=V,O.sample=LF,O.size=HF,O.snakeCase=xL,O.some=BF,O.sortedIndex=jM,O.sortedIndexBy=UM,O.sortedIndexOf=HM,O.sortedLastIndex=BM,O.sortedLastIndexBy=VM,O.sortedLastIndexOf=WM,O.startCase=IL,O.startsWith=OL,O.subtract=Sj,O.sum=wj,O.sumBy=_j,O.template=qL,O.times=sj,O.toFinite=es,O.toInteger=Oe,O.toLength=LE,O.toLower=kL,O.toNumber=Cn,O.toSafeInteger=PD,O.toString=ct,O.toUpper=PL,O.trim=TL,O.trimEnd=AL,O.trimStart=$L,O.truncate=NL,O.unescape=ML,O.uniqueId=aj,O.upperCase=FL,O.upperFirst=Bb,O.each=xE,O.eachRight=EE,O.first=wE,zb(O,(function(){var a={};return wn(O,function(u,m){ot.call(O.prototype,m)||(a[m]=u)}),a})(),{chain:!1}),O.VERSION=e,Cr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){O[a].placeholder=O}),Cr(["drop","take"],function(a,u){De.prototype[a]=function(m){m=m===t?1:Ct(Oe(m),0);var b=this.__filtered__&&!u?new De(this):this.clone();return b.__filtered__?b.__takeCount__=Yt(m,b.__takeCount__):b.__views__.push({size:Yt(m,ve),type:a+(b.__dir__<0?"Right":"")}),b},De.prototype[a+"Right"]=function(m){return this.reverse()[a](m).reverse()}}),Cr(["filter","map","takeWhile"],function(a,u){var m=u+1,b=m==K||m==ie;De.prototype[a]=function(x){var P=this.clone();return P.__iteratees__.push({iteratee:Se(x,3),type:m}),P.__filtered__=P.__filtered__||b,P}}),Cr(["head","last"],function(a,u){var m="take"+(u?"Right":"");De.prototype[a]=function(){return this[m](1).value()[0]}}),Cr(["initial","tail"],function(a,u){var m="drop"+(u?"":"Right");De.prototype[a]=function(){return this.__filtered__?new De(this):this[m](1)}}),De.prototype.compact=function(){return this.filter(Hr)},De.prototype.find=function(a){return this.filter(a).head()},De.prototype.findLast=function(a){return this.reverse().find(a)},De.prototype.invokeMap=Ne(function(a,u){return typeof a=="function"?new De(this):this.map(function(m){return ta(m,a,u)})}),De.prototype.reject=function(a){return this.filter(bh(Se(a)))},De.prototype.slice=function(a,u){a=Oe(a);var m=this;return m.__filtered__&&(a>0||u<0)?new De(m):(a<0?m=m.takeRight(-a):a&&(m=m.drop(a)),u!==t&&(u=Oe(u),m=u<0?m.dropRight(-u):m.take(u-a)),m)},De.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},De.prototype.toArray=function(){return this.take(ve)},wn(De.prototype,function(a,u){var m=/^(?:filter|find|map|reject)|While$/.test(u),b=/^(?:head|last)$/.test(u),x=O[b?"take"+(u=="last"?"Right":""):u],P=b||/^find/.test(u);x&&(O.prototype[u]=function(){var M=this.__wrapped__,U=b?[1]:arguments,W=M instanceof De,Z=U[0],X=W||Ee(M),te=function(Be){var Je=x.apply(O,bi([Be],U));return b&&oe?Je[0]:Je};X&&m&&typeof Z=="function"&&Z.length!=1&&(W=X=!1);var oe=this.__chain__,he=!!this.__actions__.length,we=P&&!oe,Pe=W&&!he;if(!P&&X){M=Pe?M:new De(this);var be=a.apply(M,U);return be.__actions__.push({func:mh,args:[te],thisArg:t}),new fr(be,oe)}return we&&Pe?a.apply(this,U):(be=this.thru(te),we?b?be.value()[0]:be.value():be)})}),Cr(["pop","push","shift","sort","splice","unshift"],function(a){var u=Vo[a],m=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",b=/^(?:pop|shift)$/.test(a);O.prototype[a]=function(){var x=arguments;if(b&&!this.__chain__){var P=this.value();return u.apply(Ee(P)?P:[],x)}return this[m](function(M){return u.apply(Ee(M)?M:[],x)})}}),wn(De.prototype,function(a,u){var m=O[u];if(m){var b=m.name+"";ot.call(Ms,b)||(Ms[b]=[]),Ms[b].push({name:u,func:m})}}),Ms[lh(t,E).name]=[{name:"wrapper",func:t}],De.prototype.clone=Bv,De.prototype.reverse=Vv,De.prototype.value=qc,O.prototype.at=hF,O.prototype.chain=mF,O.prototype.commit=gF,O.prototype.next=yF,O.prototype.plant=bF,O.prototype.reverse=SF,O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=wF,O.prototype.first=O.prototype.head,Jo&&(O.prototype[Jo]=vF),O}),wi=Ev();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Bt._=wi,define(function(){return wi})):st?((st.exports=wi)._=wi,pl._=wi):Bt._=wi}).call(Gl)});var vI=H((cS,Yl)=>{(function(t,e){typeof cS=="object"&&typeof Yl<"u"?Yl.exports=e():typeof define=="function"&&define.amd?define(e):t.moment=e()})(cS,(function(){"use strict";var t;function e(){return t.apply(null,arguments)}function r(d){t=d}function n(d){return d instanceof Array||Object.prototype.toString.call(d)==="[object Array]"}function i(d){return d!=null&&Object.prototype.toString.call(d)==="[object Object]"}function s(d,y){return Object.prototype.hasOwnProperty.call(d,y)}function o(d){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(d).length===0;var y;for(y in d)if(s(d,y))return!1;return!0}function l(d){return d===void 0}function f(d){return typeof d=="number"||Object.prototype.toString.call(d)==="[object Number]"}function c(d){return d instanceof Date||Object.prototype.toString.call(d)==="[object Date]"}function p(d,y){var S=[],R,I=d.length;for(R=0;R<I;++R)S.push(y(d[R],R));return S}function h(d,y){for(var S in y)s(y,S)&&(d[S]=y[S]);return s(y,"toString")&&(d.toString=y.toString),s(y,"valueOf")&&(d.valueOf=y.valueOf),d}function g(d,y,S,R){return bl(d,y,S,R,!0).utc()}function v(){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 _(d){return d._pf==null&&(d._pf=v()),d._pf}var w;Array.prototype.some?w=Array.prototype.some:w=function(d){var y=Object(this),S=y.length>>>0,R;for(R=0;R<S;R++)if(R in y&&d.call(this,y[R],R,y))return!0;return!1};function E(d){var y=null,S=!1,R=d._d&&!isNaN(d._d.getTime());if(R&&(y=_(d),S=w.call(y.parsedDateParts,function(I){return I!=null}),R=y.overflow<0&&!y.empty&&!y.invalidEra&&!y.invalidMonth&&!y.invalidWeekday&&!y.weekdayMismatch&&!y.nullInput&&!y.invalidFormat&&!y.userInvalidated&&(!y.meridiem||y.meridiem&&S),d._strict&&(R=R&&y.charsLeftOver===0&&y.unusedTokens.length===0&&y.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(d))d._isValid=R;else return R;return d._isValid}function k(d){var y=g(NaN);return d!=null?h(_(y),d):_(y).userInvalidated=!0,y}var T=e.momentProperties=[],N=!1;function $(d,y){var S,R,I,L=T.length;if(l(y._isAMomentObject)||(d._isAMomentObject=y._isAMomentObject),l(y._i)||(d._i=y._i),l(y._f)||(d._f=y._f),l(y._l)||(d._l=y._l),l(y._strict)||(d._strict=y._strict),l(y._tzm)||(d._tzm=y._tzm),l(y._isUTC)||(d._isUTC=y._isUTC),l(y._offset)||(d._offset=y._offset),l(y._pf)||(d._pf=_(y)),l(y._locale)||(d._locale=y._locale),L>0)for(S=0;S<L;S++)R=T[S],I=y[R],l(I)||(d[R]=I);return d}function j(d){$(this,d),this._d=new Date(d._d!=null?d._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),N===!1&&(N=!0,e.updateOffset(this),N=!1)}function G(d){return d instanceof j||d!=null&&d._isAMomentObject!=null}function q(d){e.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+d)}function C(d,y){var S=!0;return h(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,d),S){var R=[],I,L,Y,ae=arguments.length;for(L=0;L<ae;L++){if(I="",typeof arguments[L]=="object"){I+=`
21
21
  [`+L+"] ";for(Y in arguments[0])s(arguments[0],Y)&&(I+=Y+": "+arguments[0][Y]+", ");I=I.slice(0,-2)}else I=arguments[L];R.push(I)}q(d+`
22
22
  Arguments: `+Array.prototype.slice.call(R).join("")+`
23
- `+new Error().stack),S=!1}return y.apply(this,arguments)},y)}var A={};function D(d,y){e.deprecationHandler!=null&&e.deprecationHandler(d,y),A[d]||(q(y),A[d]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function B(d){return typeof Function<"u"&&d instanceof Function||Object.prototype.toString.call(d)==="[object Function]"}function F(d){var y,S;for(S in d)s(d,S)&&(y=d[S],B(y)?this[S]=y:this["_"+S]=y);this._config=d,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function K(d,y){var S=h({},d),R;for(R in y)s(y,R)&&(i(d[R])&&i(y[R])?(S[R]={},h(S[R],d[R]),h(S[R],y[R])):y[R]!=null?S[R]=y[R]:delete S[R]);for(R in d)s(d,R)&&!s(y,R)&&i(d[R])&&(S[R]=h({},S[R]));return S}function ee(d){d!=null&&this.set(d)}var ie;Object.keys?ie=Object.keys:ie=function(d){var y,S=[];for(y in d)s(d,y)&&S.push(y);return S};var pe={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function ke(d,y,S){var R=this._calendar[d]||this._calendar.sameElse;return B(R)?R.call(y,S):R}function de(d,y,S){var R=""+Math.abs(d),I=y-R.length,L=d>=0;return(L?S?"+":"":"-")+Math.pow(10,Math.max(0,I)).toString().substr(1)+R}var le=/(\[[^\[]*\])|(\\)?([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,ve=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,We={},mt={};function ce(d,y,S,R){var I=R;typeof R=="string"&&(I=function(){return this[R]()}),d&&(mt[d]=I),y&&(mt[y[0]]=function(){return de(I.apply(this,arguments),y[1],y[2])}),S&&(mt[S]=function(){return this.localeData().ordinal(I.apply(this,arguments),d)})}function rr(d){return d.match(/\[[\s\S]/)?d.replace(/^\[|\]$/g,""):d.replace(/\\/g,"")}function $e(d){var y=d.match(le),S,R;for(S=0,R=y.length;S<R;S++)mt[y[S]]?y[S]=mt[y[S]]:y[S]=rr(y[S]);return function(I){var L="",Y;for(Y=0;Y<R;Y++)L+=B(y[Y])?y[Y].call(I,d):y[Y];return L}}function nt(d,y){return d.isValid()?(y=en(y,d.localeData()),We[y]=We[y]||$e(y),We[y](d)):d.localeData().invalidDate()}function en(d,y){var S=5;function R(I){return y.longDateFormat(I)||I}for(ve.lastIndex=0;S>=0&&ve.test(d);)d=d.replace(ve,R),ve.lastIndex=0,S-=1;return d}var Nr={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 _t(d){var y=this._longDateFormat[d],S=this._longDateFormat[d.toUpperCase()];return y||!S?y:(this._longDateFormat[d]=S.match(le).map(function(R){return R==="MMMM"||R==="MM"||R==="DD"||R==="dddd"?R.slice(1):R}).join(""),this._longDateFormat[d])}var Rt="Invalid date";function hn(){return this._invalidDate}var Oo="%d",Zt=/\d{1,2}/;function qo(d){return this._ordinal.replace("%d",d)}var $y={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 Mn(d,y,S,R){var I=this._relativeTime[S];return B(I)?I(d,y,S,R):I.replace(/%d/i,d)}function ap(d,y){var S=this._relativeTime[d>0?"future":"past"];return B(S)?S(y):S.replace(/%s/i,y)}var lp={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 Xt(d){return typeof d=="string"?lp[d]||lp[d.toLowerCase()]:void 0}function _r(d){var y={},S,R;for(R in d)s(d,R)&&(S=Xt(R),S&&(y[S]=d[R]));return y}var ko={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 tl(d){var y=[],S;for(S in d)s(d,S)&&y.push({unit:S,priority:ko[S]});return y.sort(function(R,I){return R.priority-I.priority}),y}var up=/\d/,zt=/\d\d/,cp=/\d{3}/,ji=/\d{4}/,Fn=/[+-]?\d{6}/,pt=/\d\d?/,rl=/\d\d\d\d?/,nl=/\d\d\d\d\d\d?/,Cs=/\d{1,3}/,Po=/\d{1,4}/,xs=/[+-]?\d{1,6}/,yi=/\d+/,Es=/[+-]?\d+/,oc=/Z|[+-]\d\d:?\d\d/gi,il=/Z|[+-]\d\d(?::?\d\d)?/gi,Ny=/[+-]?\d+(\.\d{1,3})?/,To=/[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,Ui=/^[1-9]\d?/,sl=/^([1-9]\d|\d)/,ol;ol={};function fe(d,y,S){ol[d]=B(y)?y:function(R,I){return R&&S?S:y}}function My(d,y){return s(ol,d)?ol[d](y._strict,y._locale):new RegExp(Fy(d))}function Fy(d){return mn(d.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(y,S,R,I,L){return S||R||I||L}))}function mn(d){return d.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Mr(d){return d<0?Math.ceil(d)||0:Math.floor(d)}function Fe(d){var y=+d,S=0;return y!==0&&isFinite(y)&&(S=Mr(y)),S}var ac={};function it(d,y){var S,R=y,I;for(typeof d=="string"&&(d=[d]),f(y)&&(R=function(L,Y){Y[y]=Fe(L)}),I=d.length,S=0;S<I;S++)ac[d[S]]=R}function Ao(d,y){it(d,function(S,R,I,L){I._w=I._w||{},y(S,I._w,I,L)})}function lc(d,y,S){y!=null&&s(ac,d)&&ac[d](y,S._a,S,d)}function al(d){return d%4===0&&d%100!==0||d%400===0}var er=0,Dn=1,gn=2,Ft=3,Fr=4,Ln=5,Hi=6,fp=7,Dy=8;ce("Y",0,0,function(){var d=this.year();return d<=9999?de(d,4):"+"+d}),ce(0,["YY",2],0,function(){return this.year()%100}),ce(0,["YYYY",4],0,"year"),ce(0,["YYYYY",5],0,"year"),ce(0,["YYYYYY",6,!0],0,"year"),fe("Y",Es),fe("YY",pt,zt),fe("YYYY",Po,ji),fe("YYYYY",xs,Fn),fe("YYYYYY",xs,Fn),it(["YYYYY","YYYYYY"],er),it("YYYY",function(d,y){y[er]=d.length===2?e.parseTwoDigitYear(d):Fe(d)}),it("YY",function(d,y){y[er]=e.parseTwoDigitYear(d)}),it("Y",function(d,y){y[er]=parseInt(d,10)});function $o(d){return al(d)?366:365}e.parseTwoDigitYear=function(d){return Fe(d)+(Fe(d)>68?1900:2e3)};var dp=Is("FullYear",!0);function Ly(){return al(this.year())}function Is(d,y){return function(S){return S!=null?(Mo(this,d,S),e.updateOffset(this,y),this):No(this,d)}}function No(d,y){if(!d.isValid())return NaN;var S=d._d,R=d._isUTC;switch(y){case"Milliseconds":return R?S.getUTCMilliseconds():S.getMilliseconds();case"Seconds":return R?S.getUTCSeconds():S.getSeconds();case"Minutes":return R?S.getUTCMinutes():S.getMinutes();case"Hours":return R?S.getUTCHours():S.getHours();case"Date":return R?S.getUTCDate():S.getDate();case"Day":return R?S.getUTCDay():S.getDay();case"Month":return R?S.getUTCMonth():S.getMonth();case"FullYear":return R?S.getUTCFullYear():S.getFullYear();default:return NaN}}function Mo(d,y,S){var R,I,L,Y,ae;if(!(!d.isValid()||isNaN(S))){switch(R=d._d,I=d._isUTC,y){case"Milliseconds":return void(I?R.setUTCMilliseconds(S):R.setMilliseconds(S));case"Seconds":return void(I?R.setUTCSeconds(S):R.setSeconds(S));case"Minutes":return void(I?R.setUTCMinutes(S):R.setMinutes(S));case"Hours":return void(I?R.setUTCHours(S):R.setHours(S));case"Date":return void(I?R.setUTCDate(S):R.setDate(S));case"FullYear":break;default:return}L=S,Y=d.month(),ae=d.date(),ae=ae===29&&Y===1&&!al(L)?28:ae,I?R.setUTCFullYear(L,Y,ae):R.setFullYear(L,Y,ae)}}function jy(d){return d=Xt(d),B(this[d])?this[d]():this}function ll(d,y){if(typeof d=="object"){d=_r(d);var S=tl(d),R,I=S.length;for(R=0;R<I;R++)this[S[R].unit](d[S[R].unit])}else if(d=Xt(d),B(this[d]))return this[d](y);return this}function Uy(d,y){return(d%y+y)%y}var kt;Array.prototype.indexOf?kt=Array.prototype.indexOf:kt=function(d){var y;for(y=0;y<this.length;++y)if(this[y]===d)return y;return-1};function uc(d,y){if(isNaN(d)||isNaN(y))return NaN;var S=Uy(y,12);return d+=(y-S)/12,S===1?al(d)?29:28:31-S%7%2}ce("M",["MM",2],"Mo",function(){return this.month()+1}),ce("MMM",0,0,function(d){return this.localeData().monthsShort(this,d)}),ce("MMMM",0,0,function(d){return this.localeData().months(this,d)}),fe("M",pt,Ui),fe("MM",pt,zt),fe("MMM",function(d,y){return y.monthsShortRegex(d)}),fe("MMMM",function(d,y){return y.monthsRegex(d)}),it(["M","MM"],function(d,y){y[Dn]=Fe(d)-1}),it(["MMM","MMMM"],function(d,y,S,R){var I=S._locale.monthsParse(d,R,S._strict);I!=null?y[Dn]=I:_(S).invalidMonth=d});var pp="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),cc="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),fc=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Hy=To,By=To;function Vy(d,y){return d?n(this._months)?this._months[d.month()]:this._months[(this._months.isFormat||fc).test(y)?"format":"standalone"][d.month()]:n(this._months)?this._months:this._months.standalone}function Wy(d,y){return d?n(this._monthsShort)?this._monthsShort[d.month()]:this._monthsShort[fc.test(y)?"format":"standalone"][d.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function hp(d,y,S){var R,I,L,Y=d.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],R=0;R<12;++R)L=g([2e3,R]),this._shortMonthsParse[R]=this.monthsShort(L,"").toLocaleLowerCase(),this._longMonthsParse[R]=this.months(L,"").toLocaleLowerCase();return S?y==="MMM"?(I=kt.call(this._shortMonthsParse,Y),I!==-1?I:null):(I=kt.call(this._longMonthsParse,Y),I!==-1?I:null):y==="MMM"?(I=kt.call(this._shortMonthsParse,Y),I!==-1?I:(I=kt.call(this._longMonthsParse,Y),I!==-1?I:null)):(I=kt.call(this._longMonthsParse,Y),I!==-1?I:(I=kt.call(this._shortMonthsParse,Y),I!==-1?I:null))}function mp(d,y,S){var R,I,L;if(this._monthsParseExact)return hp.call(this,d,y,S);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),R=0;R<12;R++){if(I=g([2e3,R]),S&&!this._longMonthsParse[R]&&(this._longMonthsParse[R]=new RegExp("^"+this.months(I,"").replace(".","")+"$","i"),this._shortMonthsParse[R]=new RegExp("^"+this.monthsShort(I,"").replace(".","")+"$","i")),!S&&!this._monthsParse[R]&&(L="^"+this.months(I,"")+"|^"+this.monthsShort(I,""),this._monthsParse[R]=new RegExp(L.replace(".",""),"i")),S&&y==="MMMM"&&this._longMonthsParse[R].test(d))return R;if(S&&y==="MMM"&&this._shortMonthsParse[R].test(d))return R;if(!S&&this._monthsParse[R].test(d))return R}}function dc(d,y){if(!d.isValid())return d;if(typeof y=="string"){if(/^\d+$/.test(y))y=Fe(y);else if(y=d.localeData().monthsParse(y),!f(y))return d}var S=y,R=d.date();return R=R<29?R:Math.min(R,uc(d.year(),S)),d._isUTC?d._d.setUTCMonth(S,R):d._d.setMonth(S,R),d}function ul(d){return d!=null?(dc(this,d),e.updateOffset(this,!0),this):No(this,"Month")}function zy(){return uc(this.year(),this.month())}function gp(d){return this._monthsParseExact?(s(this,"_monthsRegex")||pc.call(this),d?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=Hy),this._monthsShortStrictRegex&&d?this._monthsShortStrictRegex:this._monthsShortRegex)}function cl(d){return this._monthsParseExact?(s(this,"_monthsRegex")||pc.call(this),d?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=By),this._monthsStrictRegex&&d?this._monthsStrictRegex:this._monthsRegex)}function pc(){function d(_e,Le){return Le.length-_e.length}var y=[],S=[],R=[],I,L,Y,ae;for(I=0;I<12;I++)L=g([2e3,I]),Y=mn(this.monthsShort(L,"")),ae=mn(this.months(L,"")),y.push(Y),S.push(ae),R.push(ae),R.push(Y);y.sort(d),S.sort(d),R.sort(d),this._monthsRegex=new RegExp("^("+R.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+S.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+y.join("|")+")","i")}function Jy(d,y,S,R,I,L,Y){var ae;return d<100&&d>=0?(ae=new Date(d+400,y,S,R,I,L,Y),isFinite(ae.getFullYear())&&ae.setFullYear(d)):ae=new Date(d,y,S,R,I,L,Y),ae}function Os(d){var y,S;return d<100&&d>=0?(S=Array.prototype.slice.call(arguments),S[0]=d+400,y=new Date(Date.UTC.apply(null,S)),isFinite(y.getUTCFullYear())&&y.setUTCFullYear(d)):y=new Date(Date.UTC.apply(null,arguments)),y}function Fo(d,y,S){var R=7+y-S,I=(7+Os(d,0,R).getUTCDay()-y)%7;return-I+R-1}function fl(d,y,S,R,I){var L=(7+S-R)%7,Y=Fo(d,R,I),ae=1+7*(y-1)+L+Y,_e,Le;return ae<=0?(_e=d-1,Le=$o(_e)+ae):ae>$o(d)?(_e=d+1,Le=ae-$o(d)):(_e=d,Le=ae),{year:_e,dayOfYear:Le}}function Do(d,y,S){var R=Fo(d.year(),y,S),I=Math.floor((d.dayOfYear()-R-1)/7)+1,L,Y;return I<1?(Y=d.year()-1,L=I+yn(Y,y,S)):I>yn(d.year(),y,S)?(L=I-yn(d.year(),y,S),Y=d.year()+1):(Y=d.year(),L=I),{week:L,year:Y}}function yn(d,y,S){var R=Fo(d,y,S),I=Fo(d+1,y,S);return($o(d)-R+I)/7}ce("w",["ww",2],"wo","week"),ce("W",["WW",2],"Wo","isoWeek"),fe("w",pt,Ui),fe("ww",pt,zt),fe("W",pt,Ui),fe("WW",pt,zt),Ao(["w","ww","W","WW"],function(d,y,S,R){y[R.substr(0,1)]=Fe(d)});function hc(d){return Do(d,this._week.dow,this._week.doy).week}var mc={dow:0,doy:6};function qs(){return this._week.dow}function yp(){return this._week.doy}function vp(d){var y=this.localeData().week(this);return d==null?y:this.add((d-y)*7,"d")}function Gy(d){var y=Do(this,1,4).week;return d==null?y:this.add((d-y)*7,"d")}ce("d",0,"do","day"),ce("dd",0,0,function(d){return this.localeData().weekdaysMin(this,d)}),ce("ddd",0,0,function(d){return this.localeData().weekdaysShort(this,d)}),ce("dddd",0,0,function(d){return this.localeData().weekdays(this,d)}),ce("e",0,0,"weekday"),ce("E",0,0,"isoWeekday"),fe("d",pt),fe("e",pt),fe("E",pt),fe("dd",function(d,y){return y.weekdaysMinRegex(d)}),fe("ddd",function(d,y){return y.weekdaysShortRegex(d)}),fe("dddd",function(d,y){return y.weekdaysRegex(d)}),Ao(["dd","ddd","dddd"],function(d,y,S,R){var I=S._locale.weekdaysParse(d,R,S._strict);I!=null?y.d=I:_(S).invalidWeekday=d}),Ao(["d","e","E"],function(d,y,S,R){y[R]=Fe(d)});function bp(d,y){return typeof d!="string"?d:isNaN(d)?(d=y.weekdaysParse(d),typeof d=="number"?d:null):parseInt(d,10)}function Sp(d,y){return typeof d=="string"?y.weekdaysParse(d)%7||7:isNaN(d)?null:d}function dl(d,y){return d.slice(y,7).concat(d.slice(0,y))}var wp="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),_p="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Yy="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ky=To,Rp=To,Qy=To;function Zy(d,y){var S=n(this._weekdays)?this._weekdays:this._weekdays[d&&d!==!0&&this._weekdays.isFormat.test(y)?"format":"standalone"];return d===!0?dl(S,this._week.dow):d?S[d.day()]:S}function Xy(d){return d===!0?dl(this._weekdaysShort,this._week.dow):d?this._weekdaysShort[d.day()]:this._weekdaysShort}function ev(d){return d===!0?dl(this._weekdaysMin,this._week.dow):d?this._weekdaysMin[d.day()]:this._weekdaysMin}function gc(d,y,S){var R,I,L,Y=d.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],R=0;R<7;++R)L=g([2e3,1]).day(R),this._minWeekdaysParse[R]=this.weekdaysMin(L,"").toLocaleLowerCase(),this._shortWeekdaysParse[R]=this.weekdaysShort(L,"").toLocaleLowerCase(),this._weekdaysParse[R]=this.weekdays(L,"").toLocaleLowerCase();return S?y==="dddd"?(I=kt.call(this._weekdaysParse,Y),I!==-1?I:null):y==="ddd"?(I=kt.call(this._shortWeekdaysParse,Y),I!==-1?I:null):(I=kt.call(this._minWeekdaysParse,Y),I!==-1?I:null):y==="dddd"?(I=kt.call(this._weekdaysParse,Y),I!==-1||(I=kt.call(this._shortWeekdaysParse,Y),I!==-1)?I:(I=kt.call(this._minWeekdaysParse,Y),I!==-1?I:null)):y==="ddd"?(I=kt.call(this._shortWeekdaysParse,Y),I!==-1||(I=kt.call(this._weekdaysParse,Y),I!==-1)?I:(I=kt.call(this._minWeekdaysParse,Y),I!==-1?I:null)):(I=kt.call(this._minWeekdaysParse,Y),I!==-1||(I=kt.call(this._weekdaysParse,Y),I!==-1)?I:(I=kt.call(this._shortWeekdaysParse,Y),I!==-1?I:null))}function tv(d,y,S){var R,I,L;if(this._weekdaysParseExact)return gc.call(this,d,y,S);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),R=0;R<7;R++){if(I=g([2e3,1]).day(R),S&&!this._fullWeekdaysParse[R]&&(this._fullWeekdaysParse[R]=new RegExp("^"+this.weekdays(I,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[R]=new RegExp("^"+this.weekdaysShort(I,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[R]=new RegExp("^"+this.weekdaysMin(I,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[R]||(L="^"+this.weekdays(I,"")+"|^"+this.weekdaysShort(I,"")+"|^"+this.weekdaysMin(I,""),this._weekdaysParse[R]=new RegExp(L.replace(".",""),"i")),S&&y==="dddd"&&this._fullWeekdaysParse[R].test(d))return R;if(S&&y==="ddd"&&this._shortWeekdaysParse[R].test(d))return R;if(S&&y==="dd"&&this._minWeekdaysParse[R].test(d))return R;if(!S&&this._weekdaysParse[R].test(d))return R}}function rv(d){if(!this.isValid())return d!=null?this:NaN;var y=No(this,"Day");return d!=null?(d=bp(d,this.localeData()),this.add(d-y,"d")):y}function nv(d){if(!this.isValid())return d!=null?this:NaN;var y=(this.day()+7-this.localeData()._week.dow)%7;return d==null?y:this.add(d-y,"d")}function iv(d){if(!this.isValid())return d!=null?this:NaN;if(d!=null){var y=Sp(d,this.localeData());return this.day(this.day()%7?y:y-7)}else return this.day()||7}function sv(d){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||yc.call(this),d?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=Ky),this._weekdaysStrictRegex&&d?this._weekdaysStrictRegex:this._weekdaysRegex)}function bt(d){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||yc.call(this),d?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Rp),this._weekdaysShortStrictRegex&&d?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function gt(d){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||yc.call(this),d?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Qy),this._weekdaysMinStrictRegex&&d?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function yc(){function d(Ht,Wn){return Wn.length-Ht.length}var y=[],S=[],R=[],I=[],L,Y,ae,_e,Le;for(L=0;L<7;L++)Y=g([2e3,1]).day(L),ae=mn(this.weekdaysMin(Y,"")),_e=mn(this.weekdaysShort(Y,"")),Le=mn(this.weekdays(Y,"")),y.push(ae),S.push(_e),R.push(Le),I.push(ae),I.push(_e),I.push(Le);y.sort(d),S.sort(d),R.sort(d),I.sort(d),this._weekdaysRegex=new RegExp("^("+I.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+R.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+S.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+y.join("|")+")","i")}function vc(){return this.hours()%12||12}function ov(){return this.hours()||24}ce("H",["HH",2],0,"hour"),ce("h",["hh",2],0,vc),ce("k",["kk",2],0,ov),ce("hmm",0,0,function(){return""+vc.apply(this)+de(this.minutes(),2)}),ce("hmmss",0,0,function(){return""+vc.apply(this)+de(this.minutes(),2)+de(this.seconds(),2)}),ce("Hmm",0,0,function(){return""+this.hours()+de(this.minutes(),2)}),ce("Hmmss",0,0,function(){return""+this.hours()+de(this.minutes(),2)+de(this.seconds(),2)});function Cp(d,y){ce(d,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),y)})}Cp("a",!0),Cp("A",!1);function xp(d,y){return y._meridiemParse}fe("a",xp),fe("A",xp),fe("H",pt,sl),fe("h",pt,Ui),fe("k",pt,Ui),fe("HH",pt,zt),fe("hh",pt,zt),fe("kk",pt,zt),fe("hmm",rl),fe("hmmss",nl),fe("Hmm",rl),fe("Hmmss",nl),it(["H","HH"],Ft),it(["k","kk"],function(d,y,S){var R=Fe(d);y[Ft]=R===24?0:R}),it(["a","A"],function(d,y,S){S._isPm=S._locale.isPM(d),S._meridiem=d}),it(["h","hh"],function(d,y,S){y[Ft]=Fe(d),_(S).bigHour=!0}),it("hmm",function(d,y,S){var R=d.length-2;y[Ft]=Fe(d.substr(0,R)),y[Fr]=Fe(d.substr(R)),_(S).bigHour=!0}),it("hmmss",function(d,y,S){var R=d.length-4,I=d.length-2;y[Ft]=Fe(d.substr(0,R)),y[Fr]=Fe(d.substr(R,2)),y[Ln]=Fe(d.substr(I)),_(S).bigHour=!0}),it("Hmm",function(d,y,S){var R=d.length-2;y[Ft]=Fe(d.substr(0,R)),y[Fr]=Fe(d.substr(R))}),it("Hmmss",function(d,y,S){var R=d.length-4,I=d.length-2;y[Ft]=Fe(d.substr(0,R)),y[Fr]=Fe(d.substr(R,2)),y[Ln]=Fe(d.substr(I))});function av(d){return(d+"").toLowerCase().charAt(0)==="p"}var Ep=/[ap]\.?m?\.?/i,lv=Is("Hours",!0);function Ut(d,y,S){return d>11?S?"pm":"PM":S?"am":"AM"}var pl={calendar:pe,longDateFormat:Nr,invalidDate:Rt,ordinal:Oo,dayOfMonthOrdinalParse:Zt,relativeTime:$y,months:pp,monthsShort:cc,week:mc,weekdays:wp,weekdaysMin:Yy,weekdaysShort:_p,meridiemParse:Ep},st={},ks={},Bi;function Dr(d,y){var S,R=Math.min(d.length,y.length);for(S=0;S<R;S+=1)if(d[S]!==y[S])return S;return R}function bc(d){return d&&d.toLowerCase().replace("_","-")}function Ip(d){for(var y=0,S,R,I,L;y<d.length;){for(L=bc(d[y]).split("-"),S=L.length,R=bc(d[y+1]),R=R?R.split("-"):null;S>0;){if(I=Lo(L.slice(0,S).join("-")),I)return I;if(R&&R.length>=S&&Dr(L,R)>=S-1)break;S--}y++}return Bi}function Op(d){return!!(d&&d.match("^[^/\\\\]*$"))}function Lo(d){var y=null,S;if(st[d]===void 0&&typeof Yl<"u"&&Yl&&Yl.exports&&Op(d))try{y=Bi._abbr,S=ft,S("./locale/"+d),jn(y)}catch{st[d]=null}return st[d]}function jn(d,y){var S;return d&&(l(y)?S=Un(d):S=hl(d,y),S?Bi=S:typeof console<"u"&&console.warn&&console.warn("Locale "+d+" not found. Did you forget to load it?")),Bi._abbr}function hl(d,y){if(y!==null){var S,R=pl;if(y.abbr=d,st[d]!=null)D("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."),R=st[d]._config;else if(y.parentLocale!=null)if(st[y.parentLocale]!=null)R=st[y.parentLocale]._config;else if(S=Lo(y.parentLocale),S!=null)R=S._config;else return ks[y.parentLocale]||(ks[y.parentLocale]=[]),ks[y.parentLocale].push({name:d,config:y}),null;return st[d]=new ee(K(R,y)),ks[d]&&ks[d].forEach(function(I){hl(I.name,I.config)}),jn(d),st[d]}else return delete st[d],null}function Rr(d,y){if(y!=null){var S,R,I=pl;st[d]!=null&&st[d].parentLocale!=null?st[d].set(K(st[d]._config,y)):(R=Lo(d),R!=null&&(I=R._config),y=K(I,y),R==null&&(y.abbr=d),S=new ee(y),S.parentLocale=st[d],st[d]=S),jn(d)}else st[d]!=null&&(st[d].parentLocale!=null?(st[d]=st[d].parentLocale,d===jn()&&jn(d)):st[d]!=null&&delete st[d]);return st[d]}function Un(d){var y;if(d&&d._locale&&d._locale._abbr&&(d=d._locale._abbr),!d)return Bi;if(!n(d)){if(y=Lo(d),y)return y;d=[d]}return Ip(d)}function Cr(){return ie(st)}function Sc(d){var y,S=d._a;return S&&_(d).overflow===-2&&(y=S[Dn]<0||S[Dn]>11?Dn:S[gn]<1||S[gn]>uc(S[er],S[Dn])?gn:S[Ft]<0||S[Ft]>24||S[Ft]===24&&(S[Fr]!==0||S[Ln]!==0||S[Hi]!==0)?Ft:S[Fr]<0||S[Fr]>59?Fr:S[Ln]<0||S[Ln]>59?Ln:S[Hi]<0||S[Hi]>999?Hi:-1,_(d)._overflowDayOfYear&&(y<er||y>gn)&&(y=gn),_(d)._overflowWeeks&&y===-1&&(y=fp),_(d)._overflowWeekday&&y===-1&&(y=Dy),_(d).overflow=y),d}var qp=/^\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)?)?$/,vi=/^\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)?)?$/,ml=/Z|[+-]\d\d(?::?\d\d)?/,Ps=[["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]],yt=[["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/]],bi=/^\/?Date\((-?\d+)/i,wc=/^(?:(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}))$/,uv={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function gl(d){var y,S,R=d._i,I=qp.exec(R)||vi.exec(R),L,Y,ae,_e,Le=Ps.length,Ht=yt.length;if(I){for(_(d).iso=!0,y=0,S=Le;y<S;y++)if(Ps[y][1].exec(I[1])){Y=Ps[y][0],L=Ps[y][2]!==!1;break}if(Y==null){d._isValid=!1;return}if(I[3]){for(y=0,S=Ht;y<S;y++)if(yt[y][1].exec(I[3])){ae=(I[2]||" ")+yt[y][0];break}if(ae==null){d._isValid=!1;return}}if(!L&&ae!=null){d._isValid=!1;return}if(I[4])if(ml.exec(I[4]))_e="Z";else{d._isValid=!1;return}d._f=Y+(ae||"")+(_e||""),vl(d)}else d._isValid=!1}function cv(d,y,S,R,I,L){var Y=[fv(d),cc.indexOf(y),parseInt(S,10),parseInt(R,10),parseInt(I,10)];return L&&Y.push(parseInt(L,10)),Y}function fv(d){var y=parseInt(d,10);return y<=49?2e3+y:y<=999?1900+y:y}function dv(d){return d.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function kp(d,y,S){if(d){var R=_p.indexOf(d),I=new Date(y[0],y[1],y[2]).getDay();if(R!==I)return _(S).weekdayMismatch=!0,S._isValid=!1,!1}return!0}function yl(d,y,S){if(d)return uv[d];if(y)return 0;var R=parseInt(S,10),I=R%100,L=(R-I)/100;return L*60+I}function Vi(d){var y=wc.exec(dv(d._i)),S;if(y){if(S=cv(y[4],y[3],y[2],y[5],y[6],y[7]),!kp(y[1],S,d))return;d._a=S,d._tzm=yl(y[8],y[9],y[10]),d._d=Os.apply(null,d._a),d._d.setUTCMinutes(d._d.getUTCMinutes()-d._tzm),_(d).rfc2822=!0}else d._isValid=!1}function pv(d){var y=bi.exec(d._i);if(y!==null){d._d=new Date(+y[1]);return}if(gl(d),d._isValid===!1)delete d._isValid;else return;if(Vi(d),d._isValid===!1)delete d._isValid;else return;d._strict?d._isValid=!1:e.createFromInputFallback(d)}e.createFromInputFallback=C("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(d){d._d=new Date(d._i+(d._useUTC?" UTC":""))});function Wi(d,y,S){return d??y??S}function Pp(d){var y=new Date(e.now());return d._useUTC?[y.getUTCFullYear(),y.getUTCMonth(),y.getUTCDate()]:[y.getFullYear(),y.getMonth(),y.getDate()]}function jo(d){var y,S,R=[],I,L,Y;if(!d._d){for(I=Pp(d),d._w&&d._a[gn]==null&&d._a[Dn]==null&&_c(d),d._dayOfYear!=null&&(Y=Wi(d._a[er],I[er]),(d._dayOfYear>$o(Y)||d._dayOfYear===0)&&(_(d)._overflowDayOfYear=!0),S=Os(Y,0,d._dayOfYear),d._a[Dn]=S.getUTCMonth(),d._a[gn]=S.getUTCDate()),y=0;y<3&&d._a[y]==null;++y)d._a[y]=R[y]=I[y];for(;y<7;y++)d._a[y]=R[y]=d._a[y]==null?y===2?1:0:d._a[y];d._a[Ft]===24&&d._a[Fr]===0&&d._a[Ln]===0&&d._a[Hi]===0&&(d._nextDay=!0,d._a[Ft]=0),d._d=(d._useUTC?Os:Jy).apply(null,R),L=d._useUTC?d._d.getUTCDay():d._d.getDay(),d._tzm!=null&&d._d.setUTCMinutes(d._d.getUTCMinutes()-d._tzm),d._nextDay&&(d._a[Ft]=24),d._w&&typeof d._w.d<"u"&&d._w.d!==L&&(_(d).weekdayMismatch=!0)}}function _c(d){var y,S,R,I,L,Y,ae,_e,Le;y=d._w,y.GG!=null||y.W!=null||y.E!=null?(L=1,Y=4,S=Wi(y.GG,d._a[er],Do(lt(),1,4).year),R=Wi(y.W,1),I=Wi(y.E,1),(I<1||I>7)&&(_e=!0)):(L=d._locale._week.dow,Y=d._locale._week.doy,Le=Do(lt(),L,Y),S=Wi(y.gg,d._a[er],Le.year),R=Wi(y.w,Le.week),y.d!=null?(I=y.d,(I<0||I>6)&&(_e=!0)):y.e!=null?(I=y.e+L,(y.e<0||y.e>6)&&(_e=!0)):I=L),R<1||R>yn(S,L,Y)?_(d)._overflowWeeks=!0:_e!=null?_(d)._overflowWeekday=!0:(ae=fl(S,R,I,L,Y),d._a[er]=ae.year,d._dayOfYear=ae.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function vl(d){if(d._f===e.ISO_8601){gl(d);return}if(d._f===e.RFC_2822){Vi(d);return}d._a=[],_(d).empty=!0;var y=""+d._i,S,R,I,L,Y,ae=y.length,_e=0,Le,Ht;for(I=en(d._f,d._locale).match(le)||[],Ht=I.length,S=0;S<Ht;S++)L=I[S],R=(y.match(My(L,d))||[])[0],R&&(Y=y.substr(0,y.indexOf(R)),Y.length>0&&_(d).unusedInput.push(Y),y=y.slice(y.indexOf(R)+R.length),_e+=R.length),mt[L]?(R?_(d).empty=!1:_(d).unusedTokens.push(L),lc(L,R,d)):d._strict&&!R&&_(d).unusedTokens.push(L);_(d).charsLeftOver=ae-_e,y.length>0&&_(d).unusedInput.push(y),d._a[Ft]<=12&&_(d).bigHour===!0&&d._a[Ft]>0&&(_(d).bigHour=void 0),_(d).parsedDateParts=d._a.slice(0),_(d).meridiem=d._meridiem,d._a[Ft]=hv(d._locale,d._a[Ft],d._meridiem),Le=_(d).era,Le!==null&&(d._a[er]=d._locale.erasConvertYear(Le,d._a[er])),jo(d),Sc(d)}function hv(d,y,S){var R;return S==null?y:d.meridiemHour!=null?d.meridiemHour(y,S):(d.isPM!=null&&(R=d.isPM(S),R&&y<12&&(y+=12),!R&&y===12&&(y=0)),y)}function Rc(d){var y,S,R,I,L,Y,ae=!1,_e=d._f.length;if(_e===0){_(d).invalidFormat=!0,d._d=new Date(NaN);return}for(I=0;I<_e;I++)L=0,Y=!1,y=$({},d),d._useUTC!=null&&(y._useUTC=d._useUTC),y._f=d._f[I],vl(y),E(y)&&(Y=!0),L+=_(y).charsLeftOver,L+=_(y).unusedTokens.length*10,_(y).score=L,ae?L<R&&(R=L,S=y):(R==null||L<R||Y)&&(R=L,S=y,Y&&(ae=!0));h(d,S||y)}function Cc(d){if(!d._d){var y=_r(d._i),S=y.day===void 0?y.date:y.day;d._a=p([y.year,y.month,S,y.hour,y.minute,y.second,y.millisecond],function(R){return R&&parseInt(R,10)}),jo(d)}}function mv(d){var y=new j(Sc(xc(d)));return y._nextDay&&(y.add(1,"d"),y._nextDay=void 0),y}function xc(d){var y=d._i,S=d._f;return d._locale=d._locale||Un(d._l),y===null||S===void 0&&y===""?k({nullInput:!0}):(typeof y=="string"&&(d._i=y=d._locale.preparse(y)),G(y)?new j(Sc(y)):(c(y)?d._d=y:n(S)?Rc(d):S?vl(d):xr(d),E(d)||(d._d=null),d))}function xr(d){var y=d._i;l(y)?d._d=new Date(e.now()):c(y)?d._d=new Date(y.valueOf()):typeof y=="string"?pv(d):n(y)?(d._a=p(y.slice(0),function(S){return parseInt(S,10)}),jo(d)):i(y)?Cc(d):f(y)?d._d=new Date(y):e.createFromInputFallback(d)}function bl(d,y,S,R,I){var L={};return(y===!0||y===!1)&&(R=y,y=void 0),(S===!0||S===!1)&&(R=S,S=void 0),(i(d)&&o(d)||n(d)&&d.length===0)&&(d=void 0),L._isAMomentObject=!0,L._useUTC=L._isUTC=I,L._l=S,L._i=d,L._f=y,L._strict=R,mv(L)}function lt(d,y,S,R){return bl(d,y,S,R,!1)}var Tp=C("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var d=lt.apply(null,arguments);return this.isValid()&&d.isValid()?d<this?this:d:k()}),Ap=C("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var d=lt.apply(null,arguments);return this.isValid()&&d.isValid()?d>this?this:d:k()});function $p(d,y){var S,R;if(y.length===1&&n(y[0])&&(y=y[0]),!y.length)return lt();for(S=y[0],R=1;R<y.length;++R)(!y[R].isValid()||y[R][d](S))&&(S=y[R]);return S}function gv(){var d=[].slice.call(arguments,0);return $p("isBefore",d)}function yv(){var d=[].slice.call(arguments,0);return $p("isAfter",d)}var vv=function(){return Date.now?Date.now():+new Date},Uo=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ts(d){var y,S=!1,R,I=Uo.length;for(y in d)if(s(d,y)&&!(kt.call(Uo,y)!==-1&&(d[y]==null||!isNaN(d[y]))))return!1;for(R=0;R<I;++R)if(d[Uo[R]]){if(S)return!1;parseFloat(d[Uo[R]])!==Fe(d[Uo[R]])&&(S=!0)}return!0}function bv(){return this._isValid}function Sv(){return ut(NaN)}function As(d){var y=_r(d),S=y.year||0,R=y.quarter||0,I=y.month||0,L=y.week||y.isoWeek||0,Y=y.day||0,ae=y.hour||0,_e=y.minute||0,Le=y.second||0,Ht=y.millisecond||0;this._isValid=Ts(y),this._milliseconds=+Ht+Le*1e3+_e*6e4+ae*1e3*60*60,this._days=+Y+L*7,this._months=+I+R*3+S*12,this._data={},this._locale=Un(),this._bubble()}function Ho(d){return d instanceof As}function vn(d){return d<0?Math.round(-1*d)*-1:Math.round(d)}function Sl(d,y,S){var R=Math.min(d.length,y.length),I=Math.abs(d.length-y.length),L=0,Y;for(Y=0;Y<R;Y++)(S&&d[Y]!==y[Y]||!S&&Fe(d[Y])!==Fe(y[Y]))&&L++;return L+I}function Np(d,y){ce(d,0,0,function(){var S=this.utcOffset(),R="+";return S<0&&(S=-S,R="-"),R+de(~~(S/60),2)+y+de(~~S%60,2)})}Np("Z",":"),Np("ZZ",""),fe("Z",il),fe("ZZ",il),it(["Z","ZZ"],function(d,y,S){S._useUTC=!0,S._tzm=Ec(il,d)});var wv=/([\+\-]|\d\d)/gi;function Ec(d,y){var S=(y||"").match(d),R,I,L;return S===null?null:(R=S[S.length-1]||[],I=(R+"").match(wv)||["-",0,0],L=+(I[1]*60)+Fe(I[2]),L===0?0:I[0]==="+"?L:-L)}function Si(d,y){var S,R;return y._isUTC?(S=y.clone(),R=(G(d)||c(d)?d.valueOf():lt(d).valueOf())-S.valueOf(),S._d.setTime(S._d.valueOf()+R),e.updateOffset(S,!1),S):lt(d).local()}function Er(d){return-Math.round(d._d.getTimezoneOffset())}e.updateOffset=function(){};function Mp(d,y,S){var R=this._offset||0,I;if(!this.isValid())return d!=null?this:NaN;if(d!=null){if(typeof d=="string"){if(d=Ec(il,d),d===null)return this}else Math.abs(d)<16&&!S&&(d=d*60);return!this._isUTC&&y&&(I=Er(this)),this._offset=d,this._isUTC=!0,I!=null&&this.add(I,"m"),R!==d&&(!y||this._changeInProgress?Bo(this,ut(d-R,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?R:Er(this)}function _v(d,y){return d!=null?(typeof d!="string"&&(d=-d),this.utcOffset(d,y),this):-this.utcOffset()}function Rv(d){return this.utcOffset(0,d)}function Cv(d){return this._isUTC&&(this.utcOffset(0,d),this._isUTC=!1,d&&this.subtract(Er(this),"m")),this}function xv(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var d=Ec(oc,this._i);d!=null?this.utcOffset(d):this.utcOffset(0,!0)}return this}function Ev(d){return this.isValid()?(d=d?lt(d).utcOffset():0,(this.utcOffset()-d)%60===0):!1}function wi(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function V(){if(!l(this._isDSTShifted))return this._isDSTShifted;var d={},y;return $(d,this),d=xc(d),d._a?(y=d._isUTC?g(d._a):lt(d._a),this._isDSTShifted=this.isValid()&&Sl(d._a,y.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Q(){return this.isValid()?!this._isUTC:!1}function z(){return this.isValid()?this._isUTC:!1}function ue(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Re=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,tt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function ut(d,y){var S=d,R=null,I,L,Y;return Ho(d)?S={ms:d._milliseconds,d:d._days,M:d._months}:f(d)||!isNaN(+d)?(S={},y?S[y]=+d:S.milliseconds=+d):(R=Re.exec(d))?(I=R[1]==="-"?-1:1,S={y:0,d:Fe(R[gn])*I,h:Fe(R[Ft])*I,m:Fe(R[Fr])*I,s:Fe(R[Ln])*I,ms:Fe(vn(R[Hi]*1e3))*I}):(R=tt.exec(d))?(I=R[1]==="-"?-1:1,S={y:ze(R[2],I),M:ze(R[3],I),w:ze(R[4],I),d:ze(R[5],I),h:ze(R[6],I),m:ze(R[7],I),s:ze(R[8],I)}):S==null?S={}:typeof S=="object"&&("from"in S||"to"in S)&&(Y=Iv(lt(S.from),lt(S.to)),S={},S.ms=Y.milliseconds,S.M=Y.months),L=new As(S),Ho(d)&&s(d,"_locale")&&(L._locale=d._locale),Ho(d)&&s(d,"_isValid")&&(L._isValid=d._isValid),L}ut.fn=As.prototype,ut.invalid=Sv;function ze(d,y){var S=d&&parseFloat(d.replace(",","."));return(isNaN(S)?0:S)*y}function wl(d,y){var S={};return S.months=y.month()-d.month()+(y.year()-d.year())*12,d.clone().add(S.months,"M").isAfter(y)&&--S.months,S.milliseconds=+y-+d.clone().add(S.months,"M"),S}function Iv(d,y){var S;return d.isValid()&&y.isValid()?(y=Si(y,d),d.isBefore(y)?S=wl(d,y):(S=wl(y,d),S.milliseconds=-S.milliseconds,S.months=-S.months),S):{milliseconds:0,months:0}}function Ir(d,y){return function(S,R){var I,L;return R!==null&&!isNaN(+R)&&(D(y,"moment()."+y+"(period, number) is deprecated. Please use moment()."+y+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),L=S,S=R,R=L),I=ut(S,R),Bo(this,I,d),this}}function Bo(d,y,S,R){var I=y._milliseconds,L=vn(y._days),Y=vn(y._months);d.isValid()&&(R=R??!0,Y&&dc(d,No(d,"Month")+Y*S),L&&Mo(d,"Date",No(d,"Date")+L*S),I&&d._d.setTime(d._d.valueOf()+I*S),R&&e.updateOffset(d,L||Y))}var Ov=Ir(1,"add"),$s=Ir(-1,"subtract");function Vo(d){return typeof d=="string"||d instanceof String}function _l(d){return G(d)||c(d)||Vo(d)||f(d)||qv(d)||ot(d)||d===null||d===void 0}function ot(d){var y=i(d)&&!o(d),S=!1,R=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],I,L,Y=R.length;for(I=0;I<Y;I+=1)L=R[I],S=S||s(d,L);return y&&S}function qv(d){var y=n(d),S=!1;return y&&(S=d.filter(function(R){return!f(R)&&Vo(d)}).length===0),y&&S}function Fp(d){var y=i(d)&&!o(d),S=!1,R=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],I,L;for(I=0;I<R.length;I+=1)L=R[I],S=S||s(d,L);return y&&S}function Rl(d,y){var S=d.diff(y,"days",!0);return S<-6?"sameElse":S<-1?"lastWeek":S<0?"lastDay":S<1?"sameDay":S<2?"nextDay":S<7?"nextWeek":"sameElse"}function kv(d,y){arguments.length===1&&(arguments[0]?_l(arguments[0])?(d=arguments[0],y=void 0):Fp(arguments[0])&&(y=arguments[0],d=void 0):(d=void 0,y=void 0));var S=d||lt(),R=Si(S,this).startOf("day"),I=e.calendarFormat(this,R)||"sameElse",L=y&&(B(y[I])?y[I].call(this,S):y[I]);return this.format(L||this.localeData().calendar(I,this,lt(S)))}function Pv(){return new j(this)}function Tv(d,y){var S=G(d)?d:lt(d);return this.isValid()&&S.isValid()?(y=Xt(y)||"millisecond",y==="millisecond"?this.valueOf()>S.valueOf():S.valueOf()<this.clone().startOf(y).valueOf()):!1}function Cl(d,y){var S=G(d)?d:lt(d);return this.isValid()&&S.isValid()?(y=Xt(y)||"millisecond",y==="millisecond"?this.valueOf()<S.valueOf():this.clone().endOf(y).valueOf()<S.valueOf()):!1}function _i(d,y,S,R){var I=G(d)?d:lt(d),L=G(y)?y:lt(y);return this.isValid()&&I.isValid()&&L.isValid()?(R=R||"()",(R[0]==="("?this.isAfter(I,S):!this.isBefore(I,S))&&(R[1]===")"?this.isBefore(L,S):!this.isAfter(L,S))):!1}function xl(d,y){var S=G(d)?d:lt(d),R;return this.isValid()&&S.isValid()?(y=Xt(y)||"millisecond",y==="millisecond"?this.valueOf()===S.valueOf():(R=S.valueOf(),this.clone().startOf(y).valueOf()<=R&&R<=this.clone().endOf(y).valueOf())):!1}function Dp(d,y){return this.isSame(d,y)||this.isAfter(d,y)}function El(d,y){return this.isSame(d,y)||this.isBefore(d,y)}function Lp(d,y,S){var R,I,L;if(!this.isValid())return NaN;if(R=Si(d,this),!R.isValid())return NaN;switch(I=(R.utcOffset()-this.utcOffset())*6e4,y=Xt(y),y){case"year":L=Wo(this,R)/12;break;case"month":L=Wo(this,R);break;case"quarter":L=Wo(this,R)/3;break;case"second":L=(this-R)/1e3;break;case"minute":L=(this-R)/6e4;break;case"hour":L=(this-R)/36e5;break;case"day":L=(this-R-I)/864e5;break;case"week":L=(this-R-I)/6048e5;break;default:L=this-R}return S?L:Mr(L)}function Wo(d,y){if(d.date()<y.date())return-Wo(y,d);var S=(y.year()-d.year())*12+(y.month()-d.month()),R=d.clone().add(S,"months"),I,L;return y-R<0?(I=d.clone().add(S-1,"months"),L=(y-R)/(R-I)):(I=d.clone().add(S+1,"months"),L=(y-R)/(I-R)),-(S+L)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Il(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function jp(d){if(!this.isValid())return null;var y=d!==!0,S=y?this.clone().utc():this;return S.year()<0||S.year()>9999?nt(S,y?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):B(Date.prototype.toISOString)?y?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",nt(S,"Z")):nt(S,y?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function zo(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var d="moment",y="",S,R,I,L;return this.isLocal()||(d=this.utcOffset()===0?"moment.utc":"moment.parseZone",y="Z"),S="["+d+'("]',R=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",I="-MM-DD[T]HH:mm:ss.SSS",L=y+'[")]',this.format(S+R+I+L)}function zi(d){d||(d=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var y=nt(this,d);return this.localeData().postformat(y)}function Ol(d,y){return this.isValid()&&(G(d)&&d.isValid()||lt(d).isValid())?ut({to:this,from:d}).locale(this.locale()).humanize(!y):this.localeData().invalidDate()}function Av(d){return this.from(lt(),d)}function $v(d,y){return this.isValid()&&(G(d)&&d.isValid()||lt(d).isValid())?ut({from:this,to:d}).locale(this.locale()).humanize(!y):this.localeData().invalidDate()}function Nv(d){return this.to(lt(),d)}function Jo(d){var y;return d===void 0?this._locale._abbr:(y=Un(d),y!=null&&(this._locale=y),this)}var Go=C("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(d){return d===void 0?this.localeData():this.locale(d)});function ql(){return this._locale}var kl=1e3,Ji=60*kl,Pl=60*Ji,Up=(365*400+97)*24*Pl;function Ct(d,y){return(d%y+y)%y}function Jt(d,y,S){return d<100&&d>=0?new Date(d+400,y,S)-Up:new Date(d,y,S).valueOf()}function Hp(d,y,S){return d<100&&d>=0?Date.UTC(d+400,y,S)-Up:Date.UTC(d,y,S)}function Mv(d){var y,S;if(d=Xt(d),d===void 0||d==="millisecond"||!this.isValid())return this;switch(S=this._isUTC?Hp:Jt,d){case"year":y=S(this.year(),0,1);break;case"quarter":y=S(this.year(),this.month()-this.month()%3,1);break;case"month":y=S(this.year(),this.month(),1);break;case"week":y=S(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":y=S(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":y=S(this.year(),this.month(),this.date());break;case"hour":y=this._d.valueOf(),y-=Ct(y+(this._isUTC?0:this.utcOffset()*Ji),Pl);break;case"minute":y=this._d.valueOf(),y-=Ct(y,Ji);break;case"second":y=this._d.valueOf(),y-=Ct(y,kl);break}return this._d.setTime(y),e.updateOffset(this,!0),this}function Bp(d){var y,S;if(d=Xt(d),d===void 0||d==="millisecond"||!this.isValid())return this;switch(S=this._isUTC?Hp:Jt,d){case"year":y=S(this.year()+1,0,1)-1;break;case"quarter":y=S(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":y=S(this.year(),this.month()+1,1)-1;break;case"week":y=S(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":y=S(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":y=S(this.year(),this.month(),this.date()+1)-1;break;case"hour":y=this._d.valueOf(),y+=Pl-Ct(y+(this._isUTC?0:this.utcOffset()*Ji),Pl)-1;break;case"minute":y=this._d.valueOf(),y+=Ji-Ct(y,Ji)-1;break;case"second":y=this._d.valueOf(),y+=kl-Ct(y,kl)-1;break}return this._d.setTime(y),e.updateOffset(this,!0),this}function Fv(){return this._d.valueOf()-(this._offset||0)*6e4}function Ic(){return Math.floor(this.valueOf()/1e3)}function Yo(){return new Date(this.valueOf())}function Oc(){var d=this;return[d.year(),d.month(),d.date(),d.hour(),d.minute(),d.second(),d.millisecond()]}function Ns(){var d=this;return{years:d.year(),months:d.month(),date:d.date(),hours:d.hours(),minutes:d.minutes(),seconds:d.seconds(),milliseconds:d.milliseconds()}}function Ko(){return this.isValid()?this.toISOString():null}function Qo(){return E(this)}function Tl(){return h({},_(this))}function Ms(){return _(this).overflow}function Dv(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}ce("N",0,0,"eraAbbr"),ce("NN",0,0,"eraAbbr"),ce("NNN",0,0,"eraAbbr"),ce("NNNN",0,0,"eraName"),ce("NNNNN",0,0,"eraNarrow"),ce("y",["y",1],"yo","eraYear"),ce("y",["yy",2],0,"eraYear"),ce("y",["yyy",3],0,"eraYear"),ce("y",["yyyy",4],0,"eraYear"),fe("N",fr),fe("NN",fr),fe("NNN",fr),fe("NNNN",De),fe("NNNNN",Bv),it(["N","NN","NNN","NNNN","NNNNN"],function(d,y,S,R){var I=S._locale.erasParse(d,R,S._strict);I?_(S).era=I:_(S).invalidEra=d}),fe("y",yi),fe("yy",yi),fe("yyy",yi),fe("yyyy",yi),fe("yo",Vv),it(["y","yy","yyy","yyyy"],er),it(["yo"],function(d,y,S,R){var I;S._locale._eraYearOrdinalRegex&&(I=d.match(S._locale._eraYearOrdinalRegex)),S._locale.eraYearOrdinalParse?y[er]=S._locale.eraYearOrdinalParse(d,I):y[er]=parseInt(d,10)});function Lv(d,y){var S,R,I,L=this._eras||Un("en")._eras;for(S=0,R=L.length;S<R;++S)switch(typeof L[S].since==="string"&&(I=e(L[S].since).startOf("day"),L[S].since=I.valueOf()),typeof L[S].until){case"undefined":L[S].until=1/0;break;case"string":I=e(L[S].until).startOf("day").valueOf(),L[S].until=I.valueOf();break}return L}function jv(d,y,S){var R,I,L=this.eras(),Y,ae,_e;for(d=d.toUpperCase(),R=0,I=L.length;R<I;++R)if(Y=L[R].name.toUpperCase(),ae=L[R].abbr.toUpperCase(),_e=L[R].narrow.toUpperCase(),S)switch(y){case"N":case"NN":case"NNN":if(ae===d)return L[R];break;case"NNNN":if(Y===d)return L[R];break;case"NNNNN":if(_e===d)return L[R];break}else if([Y,ae,_e].indexOf(d)>=0)return L[R]}function Uv(d,y){var S=d.since<=d.until?1:-1;return y===void 0?e(d.since).year():e(d.since).year()+(y-d.offset)*S}function Hv(){var d,y,S,R=this.localeData().eras();for(d=0,y=R.length;d<y;++d)if(S=this.clone().startOf("day").valueOf(),R[d].since<=S&&S<=R[d].until||R[d].until<=S&&S<=R[d].since)return R[d].name;return""}function Al(){var d,y,S,R=this.localeData().eras();for(d=0,y=R.length;d<y;++d)if(S=this.clone().startOf("day").valueOf(),R[d].since<=S&&S<=R[d].until||R[d].until<=S&&S<=R[d].since)return R[d].narrow;return""}function Zo(){var d,y,S,R=this.localeData().eras();for(d=0,y=R.length;d<y;++d)if(S=this.clone().startOf("day").valueOf(),R[d].since<=S&&S<=R[d].until||R[d].until<=S&&S<=R[d].since)return R[d].abbr;return""}function Vp(){var d,y,S,R,I=this.localeData().eras();for(d=0,y=I.length;d<y;++d)if(S=I[d].since<=I[d].until?1:-1,R=this.clone().startOf("day").valueOf(),I[d].since<=R&&R<=I[d].until||I[d].until<=R&&R<=I[d].since)return(this.year()-e(I[d].since).year())*S+I[d].offset;return this.year()}function O(d){return s(this,"_erasNameRegex")||qc.call(this),d?this._erasNameRegex:this._erasRegex}function Fs(d){return s(this,"_erasAbbrRegex")||qc.call(this),d?this._erasAbbrRegex:this._erasRegex}function $l(d){return s(this,"_erasNarrowRegex")||qc.call(this),d?this._erasNarrowRegex:this._erasRegex}function fr(d,y){return y.erasAbbrRegex(d)}function De(d,y){return y.erasNameRegex(d)}function Bv(d,y){return y.erasNarrowRegex(d)}function Vv(d,y){return y._eraYearOrdinalRegex||yi}function qc(){var d=[],y=[],S=[],R=[],I,L,Y,ae,_e,Le=this.eras();for(I=0,L=Le.length;I<L;++I)Y=mn(Le[I].name),ae=mn(Le[I].abbr),_e=mn(Le[I].narrow),y.push(Y),d.push(ae),S.push(_e),R.push(Y),R.push(ae),R.push(_e);this._erasRegex=new RegExp("^("+R.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+y.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+d.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+S.join("|")+")","i")}ce(0,["gg",2],0,function(){return this.weekYear()%100}),ce(0,["GG",2],0,function(){return this.isoWeekYear()%100});function bn(d,y){ce(0,[d,d.length],0,y)}bn("gggg","weekYear"),bn("ggggg","weekYear"),bn("GGGG","isoWeekYear"),bn("GGGGG","isoWeekYear"),fe("G",Es),fe("g",Es),fe("GG",pt,zt),fe("gg",pt,zt),fe("GGGG",Po,ji),fe("gggg",Po,ji),fe("GGGGG",xs,Fn),fe("ggggg",xs,Fn),Ao(["gggg","ggggg","GGGG","GGGGG"],function(d,y,S,R){y[R.substr(0,2)]=Fe(d)}),Ao(["gg","GG"],function(d,y,S,R){y[R]=e.parseTwoDigitYear(d)});function Wv(d){return Wp.call(this,d,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function zv(d){return Wp.call(this,d,this.isoWeek(),this.isoWeekday(),1,4)}function Jv(){return yn(this.year(),1,4)}function Gv(){return yn(this.isoWeekYear(),1,4)}function Yv(){var d=this.localeData()._week;return yn(this.year(),d.dow,d.doy)}function Hn(){var d=this.localeData()._week;return yn(this.weekYear(),d.dow,d.doy)}function Wp(d,y,S,R,I){var L;return d==null?Do(this,R,I).year:(L=yn(d,R,I),y>L&&(y=L),Kv.call(this,d,y,S,R,I))}function Kv(d,y,S,R,I){var L=fl(d,y,S,R,I),Y=Os(L.year,0,L.dayOfYear);return this.year(Y.getUTCFullYear()),this.month(Y.getUTCMonth()),this.date(Y.getUTCDate()),this}ce("Q",0,"Qo","quarter"),fe("Q",up),it("Q",function(d,y){y[Dn]=(Fe(d)-1)*3});function Qv(d){return d==null?Math.ceil((this.month()+1)/3):this.month((d-1)*3+this.month()%3)}ce("D",["DD",2],"Do","date"),fe("D",pt,Ui),fe("DD",pt,zt),fe("Do",function(d,y){return d?y._dayOfMonthOrdinalParse||y._ordinalParse:y._dayOfMonthOrdinalParseLenient}),it(["D","DD"],gn),it("Do",function(d,y){y[gn]=Fe(d.match(pt)[0])});var zp=Is("Date",!0);ce("DDD",["DDDD",3],"DDDo","dayOfYear"),fe("DDD",Cs),fe("DDDD",cp),it(["DDD","DDDD"],function(d,y,S){S._dayOfYear=Fe(d)});function Zv(d){var y=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return d==null?y:this.add(d-y,"d")}ce("m",["mm",2],0,"minute"),fe("m",pt,sl),fe("mm",pt,zt),it(["m","mm"],Fr);var Bn=Is("Minutes",!1);ce("s",["ss",2],0,"second"),fe("s",pt,sl),fe("ss",pt,zt),it(["s","ss"],Ln);var Xv=Is("Seconds",!1);ce("S",0,0,function(){return~~(this.millisecond()/100)}),ce(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),ce(0,["SSS",3],0,"millisecond"),ce(0,["SSSS",4],0,function(){return this.millisecond()*10}),ce(0,["SSSSS",5],0,function(){return this.millisecond()*100}),ce(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),ce(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),ce(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),ce(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),fe("S",Cs,up),fe("SS",Cs,zt),fe("SSS",Cs,cp);var Ri,Jp;for(Ri="SSSS";Ri.length<=9;Ri+="S")fe(Ri,yi);function eb(d,y){y[Hi]=Fe(("0."+d)*1e3)}for(Ri="S";Ri.length<=9;Ri+="S")it(Ri,eb);Jp=Is("Milliseconds",!1),ce("z",0,0,"zoneAbbr"),ce("zz",0,0,"zoneName");function tb(){return this._isUTC?"UTC":""}function Gi(){return this._isUTC?"Coordinated Universal Time":""}var re=j.prototype;re.add=Ov,re.calendar=kv,re.clone=Pv,re.diff=Lp,re.endOf=Bp,re.format=zi,re.from=Ol,re.fromNow=Av,re.to=$v,re.toNow=Nv,re.get=jy,re.invalidAt=Ms,re.isAfter=Tv,re.isBefore=Cl,re.isBetween=_i,re.isSame=xl,re.isSameOrAfter=Dp,re.isSameOrBefore=El,re.isValid=Qo,re.lang=Go,re.locale=Jo,re.localeData=ql,re.max=Ap,re.min=Tp,re.parsingFlags=Tl,re.set=ll,re.startOf=Mv,re.subtract=$s,re.toArray=Oc,re.toObject=Ns,re.toDate=Yo,re.toISOString=jp,re.inspect=zo,typeof Symbol<"u"&&Symbol.for!=null&&(re[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),re.toJSON=Ko,re.toString=Il,re.unix=Ic,re.valueOf=Fv,re.creationData=Dv,re.eraName=Hv,re.eraNarrow=Al,re.eraAbbr=Zo,re.eraYear=Vp,re.year=dp,re.isLeapYear=Ly,re.weekYear=Wv,re.isoWeekYear=zv,re.quarter=re.quarters=Qv,re.month=ul,re.daysInMonth=zy,re.week=re.weeks=vp,re.isoWeek=re.isoWeeks=Gy,re.weeksInYear=Yv,re.weeksInWeekYear=Hn,re.isoWeeksInYear=Jv,re.isoWeeksInISOWeekYear=Gv,re.date=zp,re.day=re.days=rv,re.weekday=nv,re.isoWeekday=iv,re.dayOfYear=Zv,re.hour=re.hours=lv,re.minute=re.minutes=Bn,re.second=re.seconds=Xv,re.millisecond=re.milliseconds=Jp,re.utcOffset=Mp,re.utc=Rv,re.local=Cv,re.parseZone=xv,re.hasAlignedHourOffset=Ev,re.isDST=wi,re.isLocal=Q,re.isUtcOffset=z,re.isUtc=ue,re.isUTC=ue,re.zoneAbbr=tb,re.zoneName=Gi,re.dates=C("dates accessor is deprecated. Use date instead.",zp),re.months=C("months accessor is deprecated. Use month instead",ul),re.years=C("years accessor is deprecated. Use year instead",dp),re.zone=C("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",_v),re.isDSTShifted=C("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",V);function rb(d){return lt(d*1e3)}function tn(){return lt.apply(null,arguments).parseZone()}function Gp(d){return d}var Ye=ee.prototype;Ye.calendar=ke,Ye.longDateFormat=_t,Ye.invalidDate=hn,Ye.ordinal=qo,Ye.preparse=Gp,Ye.postformat=Gp,Ye.relativeTime=Mn,Ye.pastFuture=ap,Ye.set=F,Ye.eras=Lv,Ye.erasParse=jv,Ye.erasConvertYear=Uv,Ye.erasAbbrRegex=Fs,Ye.erasNameRegex=O,Ye.erasNarrowRegex=$l,Ye.months=Vy,Ye.monthsShort=Wy,Ye.monthsParse=mp,Ye.monthsRegex=cl,Ye.monthsShortRegex=gp,Ye.week=hc,Ye.firstDayOfYear=yp,Ye.firstDayOfWeek=qs,Ye.weekdays=Zy,Ye.weekdaysMin=ev,Ye.weekdaysShort=Xy,Ye.weekdaysParse=tv,Ye.weekdaysRegex=sv,Ye.weekdaysShortRegex=bt,Ye.weekdaysMinRegex=gt,Ye.isPM=av,Ye.meridiem=Ut;function Nl(d,y,S,R){var I=Un(),L=g().set(R,y);return I[S](L,d)}function Yp(d,y,S){if(f(d)&&(y=d,d=void 0),d=d||"",y!=null)return Nl(d,y,S,"month");var R,I=[];for(R=0;R<12;R++)I[R]=Nl(d,R,S,"month");return I}function kc(d,y,S,R){typeof d=="boolean"?(f(y)&&(S=y,y=void 0),y=y||""):(y=d,S=y,d=!1,f(y)&&(S=y,y=void 0),y=y||"");var I=Un(),L=d?I._week.dow:0,Y,ae=[];if(S!=null)return Nl(y,(S+L)%7,R,"day");for(Y=0;Y<7;Y++)ae[Y]=Nl(y,(Y+L)%7,R,"day");return ae}function Kp(d,y){return Yp(d,y,"months")}function Qp(d,y){return Yp(d,y,"monthsShort")}function nb(d,y,S){return kc(d,y,S,"weekdays")}function ib(d,y,S){return kc(d,y,S,"weekdaysShort")}function Pc(d,y,S){return kc(d,y,S,"weekdaysMin")}jn("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(d){var y=d%10,S=Fe(d%100/10)===1?"th":y===1?"st":y===2?"nd":y===3?"rd":"th";return d+S}}),e.lang=C("moment.lang is deprecated. Use moment.locale instead.",jn),e.langData=C("moment.langData is deprecated. Use moment.localeData instead.",Un);var Or=Math.abs;function Ml(){var d=this._data;return this._milliseconds=Or(this._milliseconds),this._days=Or(this._days),this._months=Or(this._months),d.milliseconds=Or(d.milliseconds),d.seconds=Or(d.seconds),d.minutes=Or(d.minutes),d.hours=Or(d.hours),d.months=Or(d.months),d.years=Or(d.years),this}function Zp(d,y,S,R){var I=ut(y,S);return d._milliseconds+=R*I._milliseconds,d._days+=R*I._days,d._months+=R*I._months,d._bubble()}function Xp(d,y){return Zp(this,d,y,1)}function sb(d,y){return Zp(this,d,y,-1)}function rn(d){return d<0?Math.floor(d):Math.ceil(d)}function Tc(){var d=this._milliseconds,y=this._days,S=this._months,R=this._data,I,L,Y,ae,_e;return d>=0&&y>=0&&S>=0||d<=0&&y<=0&&S<=0||(d+=rn(dr(S)+y)*864e5,y=0,S=0),R.milliseconds=d%1e3,I=Mr(d/1e3),R.seconds=I%60,L=Mr(I/60),R.minutes=L%60,Y=Mr(L/60),R.hours=Y%24,y+=Mr(Y/24),_e=Mr(Ci(y)),S+=_e,y-=rn(dr(_e)),ae=Mr(S/12),S%=12,R.days=y,R.months=S,R.years=ae,this}function Ci(d){return d*4800/146097}function dr(d){return d*146097/4800}function ob(d){if(!this.isValid())return NaN;var y,S,R=this._milliseconds;if(d=Xt(d),d==="month"||d==="quarter"||d==="year")switch(y=this._days+R/864e5,S=this._months+Ci(y),d){case"month":return S;case"quarter":return S/3;case"year":return S/12}else switch(y=this._days+Math.round(dr(this._months)),d){case"week":return y/7+R/6048e5;case"day":return y+R/864e5;case"hour":return y*24+R/36e5;case"minute":return y*1440+R/6e4;case"second":return y*86400+R/1e3;case"millisecond":return Math.floor(y*864e5)+R;default:throw new Error("Unknown unit "+d)}}function Sn(d){return function(){return this.as(d)}}var Ac=Sn("ms"),Xo=Sn("s"),xi=Sn("m"),eh=Sn("h"),ab=Sn("d"),Fl=Sn("w"),lb=Sn("M"),th=Sn("Q"),Gt=Sn("y"),$c=Ac;function rh(){return ut(this)}function wn(d){return d=Xt(d),this.isValid()?this[d+"s"]():NaN}function Vn(d){return function(){return this.isValid()?this._data[d]:NaN}}var Dl=Vn("milliseconds"),Yi=Vn("seconds"),nh=Vn("minutes"),nr=Vn("hours"),Nc=Vn("days"),ub=Vn("months"),cb=Vn("years");function fb(){return Mr(this.days()/7)}var nn=Math.round,Ds={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function ea(d,y,S,R,I){return I.relativeTime(y||1,!!S,d,R)}function ih(d,y,S,R){var I=ut(d).abs(),L=nn(I.as("s")),Y=nn(I.as("m")),ae=nn(I.as("h")),_e=nn(I.as("d")),Le=nn(I.as("M")),Ht=nn(I.as("w")),Wn=nn(I.as("y")),zn=L<=S.ss&&["s",L]||L<S.s&&["ss",L]||Y<=1&&["m"]||Y<S.m&&["mm",Y]||ae<=1&&["h"]||ae<S.h&&["hh",ae]||_e<=1&&["d"]||_e<S.d&&["dd",_e];return S.w!=null&&(zn=zn||Ht<=1&&["w"]||Ht<S.w&&["ww",Ht]),zn=zn||Le<=1&&["M"]||Le<S.M&&["MM",Le]||Wn<=1&&["y"]||["yy",Wn],zn[2]=y,zn[3]=+d>0,zn[4]=R,ea.apply(null,zn)}function db(d){return d===void 0?nn:typeof d=="function"?(nn=d,!0):!1}function pb(d,y){return Ds[d]===void 0?!1:y===void 0?Ds[d]:(Ds[d]=y,d==="s"&&(Ds.ss=y-1),!0)}function ta(d,y){if(!this.isValid())return this.localeData().invalidDate();var S=!1,R=Ds,I,L;return typeof d=="object"&&(y=d,d=!1),typeof d=="boolean"&&(S=d),typeof y=="object"&&(R=Object.assign({},Ds,y),y.s!=null&&y.ss==null&&(R.ss=y.s-1)),I=this.localeData(),L=ih(this,!S,R,I),S&&(L=I.pastFuture(+this,L)),I.postformat(L)}var Mc=Math.abs;function Ls(d){return(d>0)-(d<0)||+d}function js(){if(!this.isValid())return this.localeData().invalidDate();var d=Mc(this._milliseconds)/1e3,y=Mc(this._days),S=Mc(this._months),R,I,L,Y,ae=this.asSeconds(),_e,Le,Ht,Wn;return ae?(R=Mr(d/60),I=Mr(R/60),d%=60,R%=60,L=Mr(S/12),S%=12,Y=d?d.toFixed(3).replace(/\.?0+$/,""):"",_e=ae<0?"-":"",Le=Ls(this._months)!==Ls(ae)?"-":"",Ht=Ls(this._days)!==Ls(ae)?"-":"",Wn=Ls(this._milliseconds)!==Ls(ae)?"-":"",_e+"P"+(L?Le+L+"Y":"")+(S?Le+S+"M":"")+(y?Ht+y+"D":"")+(I||R||d?"T":"")+(I?Wn+I+"H":"")+(R?Wn+R+"M":"")+(d?Wn+Y+"S":"")):"P0D"}var He=As.prototype;He.isValid=bv,He.abs=Ml,He.add=Xp,He.subtract=sb,He.as=ob,He.asMilliseconds=Ac,He.asSeconds=Xo,He.asMinutes=xi,He.asHours=eh,He.asDays=ab,He.asWeeks=Fl,He.asMonths=lb,He.asQuarters=th,He.asYears=Gt,He.valueOf=$c,He._bubble=Tc,He.clone=rh,He.get=wn,He.milliseconds=Dl,He.seconds=Yi,He.minutes=nh,He.hours=nr,He.days=Nc,He.weeks=fb,He.months=ub,He.years=cb,He.humanize=ta,He.toISOString=js,He.toString=js,He.toJSON=js,He.locale=Jo,He.localeData=ql,He.toIsoString=C("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",js),He.lang=Go,ce("X",0,0,"unix"),ce("x",0,0,"valueOf"),fe("x",Es),fe("X",Ny),it("X",function(d,y,S){S._d=new Date(parseFloat(d)*1e3)}),it("x",function(d,y,S){S._d=new Date(Fe(d))});return e.version="2.30.1",r(lt),e.fn=re,e.min=gv,e.max=yv,e.now=vv,e.utc=g,e.unix=rb,e.months=Kp,e.isDate=c,e.locale=jn,e.invalid=k,e.duration=ut,e.isMoment=G,e.weekdays=nb,e.parseZone=tn,e.localeData=Un,e.isDuration=Ho,e.monthsShort=Qp,e.weekdaysMin=Pc,e.defineLocale=hl,e.updateLocale=Rr,e.locales=Cr,e.weekdaysShort=ib,e.normalizeUnits=Xt,e.relativeTimeRounding=db,e.relativeTimeThreshold=pb,e.calendarFormat=Rl,e.prototype=re,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 SI=H((bI,Mh)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof Mh<"u"&&Mh.exports?Mh.exports=e():t.tv4=e()})(bI,function(){Object.keys||(Object.keys=(function(){var q=Object.prototype.hasOwnProperty,C=!{toString:null}.propertyIsEnumerable("toString"),A=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],D=A.length;return function(B){if(typeof B!="object"&&typeof B!="function"||B===null)throw new TypeError("Object.keys called on non-object");var F=[];for(var K in B)q.call(B,K)&&F.push(K);if(C)for(var ee=0;ee<D;ee++)q.call(B,A[ee])&&F.push(A[ee]);return F}})()),Object.create||(Object.create=(function(){function q(){}return function(C){if(arguments.length!==1)throw new Error("Object.create implementation only accepts one parameter.");return q.prototype=C,new q}})()),Array.isArray||(Array.isArray=function(q){return Object.prototype.toString.call(q)==="[object Array]"}),Array.prototype.indexOf||(Array.prototype.indexOf=function(q){if(this===null)throw new TypeError;var C=Object(this),A=C.length>>>0;if(A===0)return-1;var D=0;if(arguments.length>1&&(D=Number(arguments[1]),D!==D?D=0:D!==0&&D!==1/0&&D!==-1/0&&(D=(D>0||-1)*Math.floor(Math.abs(D)))),D>=A)return-1;for(var B=D>=0?D:Math.max(A-Math.abs(D),0);B<A;B++)if(B in C&&C[B]===q)return B;return-1}),Object.isFrozen||(Object.isFrozen=function(q){for(var C="tv4_test_frozen_key";q.hasOwnProperty(C);)C+=Math.random();try{return q[C]=!0,delete q[C],!1}catch{return!0}});var t={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},e={"*":!0};function r(q){return encodeURI(q).replace(/%25[0-9][0-9]/g,function(C){return"%"+C.substring(3)})}function n(q){var C="";t[q.charAt(0)]&&(C=q.charAt(0),q=q.substring(1));var A="",D="",B=!0,F=!1,K=!1;C==="+"?B=!1:C==="."?(D=".",A="."):C==="/"?(D="/",A="/"):C==="#"?(D="#",B=!1):C===";"?(D=";",A=";",F=!0,K=!0):C==="?"?(D="?",A="&",F=!0):C==="&"&&(D="&",A="&",F=!0);for(var ee=[],ie=q.split(","),pe=[],ke={},de=0;de<ie.length;de++){var le=ie[de],ve=null;if(le.indexOf(":")!==-1){var We=le.split(":");le=We[0],ve=parseInt(We[1],10)}for(var mt={};e[le.charAt(le.length-1)];)mt[le.charAt(le.length-1)]=!0,le=le.substring(0,le.length-1);var ce={truncate:ve,name:le,suffices:mt};pe.push(ce),ke[le]=ce,ee.push(le)}var rr=function($e){for(var nt="",en=0,Nr=0;Nr<pe.length;Nr++){var _t=pe[Nr],Rt=$e(_t.name);if(Rt==null||Array.isArray(Rt)&&Rt.length===0||typeof Rt=="object"&&Object.keys(Rt).length===0){en++;continue}if(Nr===en?nt+=D:nt+=A||",",Array.isArray(Rt)){F&&(nt+=_t.name+"=");for(var hn=0;hn<Rt.length;hn++)hn>0&&(nt+=_t.suffices["*"]&&A||",",_t.suffices["*"]&&F&&(nt+=_t.name+"=")),nt+=B?encodeURIComponent(Rt[hn]).replace(/!/g,"%21"):r(Rt[hn])}else if(typeof Rt=="object"){F&&!_t.suffices["*"]&&(nt+=_t.name+"=");var Oo=!0;for(var Zt in Rt)Oo||(nt+=_t.suffices["*"]&&A||","),Oo=!1,nt+=B?encodeURIComponent(Zt).replace(/!/g,"%21"):r(Zt),nt+=_t.suffices["*"]?"=":",",nt+=B?encodeURIComponent(Rt[Zt]).replace(/!/g,"%21"):r(Rt[Zt])}else F&&(nt+=_t.name,(!K||Rt!=="")&&(nt+="=")),_t.truncate!=null&&(Rt=Rt.substring(0,_t.truncate)),nt+=B?encodeURIComponent(Rt).replace(/!/g,"%21"):r(Rt)}return nt};return rr.varNames=ee,{prefix:D,substitution:rr}}function i(q){if(!(this instanceof i))return new i(q);for(var C=q.split("{"),A=[C.shift()],D=[],B=[],F=[];C.length>0;){var K=C.shift(),ee=K.split("}")[0],ie=K.substring(ee.length+1),pe=n(ee);B.push(pe.substitution),D.push(pe.prefix),A.push(ie),F=F.concat(pe.substitution.varNames)}this.fill=function(ke){for(var de=A[0],le=0;le<B.length;le++){var ve=B[le];de+=ve(ke),de+=A[le+1]}return de},this.varNames=F,this.template=q}i.prototype={toString:function(){return this.template},fillFromObject:function(q){return this.fill(function(C){return q[C]})}};var s=function(C,A,D,B,F){if(this.missing=[],this.missingMap={},this.formatValidators=C?Object.create(C.formatValidators):{},this.schemas=C?Object.create(C.schemas):{},this.collectMultiple=A,this.errors=[],this.handleError=A?this.collectError:this.returnError,B&&(this.checkRecursive=!0,this.scanned=[],this.scannedFrozen=[],this.scannedFrozenSchemas=[],this.scannedFrozenValidationErrors=[],this.validatedSchemasKey="tv4_validation_id",this.validationErrorsKey="tv4_validation_errors_id"),F&&(this.trackUnknownProperties=!0,this.knownPropertyPaths={},this.unknownPropertyPaths={}),this.errorReporter=D||v("en"),typeof this.errorReporter=="string")throw new Error("debug");if(this.definedKeywords={},C)for(var K in C.definedKeywords)this.definedKeywords[K]=C.definedKeywords[K].slice(0)};s.prototype.defineKeyword=function(q,C){this.definedKeywords[q]=this.definedKeywords[q]||[],this.definedKeywords[q].push(C)},s.prototype.createError=function(q,C,A,D,B,F,K){var ee=new T(q,C,A,D,B);return ee.message=this.errorReporter(ee,F,K),ee},s.prototype.returnError=function(q){return q},s.prototype.collectError=function(q){return q&&this.errors.push(q),null},s.prototype.prefixErrors=function(q,C,A){for(var D=q;D<this.errors.length;D++)this.errors[D]=this.errors[D].prefixWith(C,A);return this},s.prototype.banUnknownProperties=function(q,C){for(var A in this.unknownPropertyPaths){var D=this.createError(_.UNKNOWN_PROPERTY,{path:A},A,"",null,q,C),B=this.handleError(D);if(B)return B}return null},s.prototype.addFormat=function(q,C){if(typeof q=="object"){for(var A in q)this.addFormat(A,q[A]);return this}this.formatValidators[q]=C},s.prototype.resolveRefs=function(q,C){if(q.$ref!==void 0){if(C=C||{},C[q.$ref])return this.createError(_.CIRCULAR_REFERENCE,{urls:Object.keys(C).join(", ")},"","",null,void 0,q);C[q.$ref]=!0,q=this.getSchema(q.$ref,C)}return q},s.prototype.getSchema=function(q,C){var A;if(this.schemas[q]!==void 0)return A=this.schemas[q],this.resolveRefs(A,C);var D=q,B="";if(q.indexOf("#")!==-1&&(B=q.substring(q.indexOf("#")+1),D=q.substring(0,q.indexOf("#"))),typeof this.schemas[D]=="object"){A=this.schemas[D];var F=decodeURIComponent(B);if(F==="")return this.resolveRefs(A,C);if(F.charAt(0)!=="/")return;for(var K=F.split("/").slice(1),ee=0;ee<K.length;ee++){var ie=K[ee].replace(/~1/g,"/").replace(/~0/g,"~");if(A[ie]===void 0){A=void 0;break}A=A[ie]}if(A!==void 0)return this.resolveRefs(A,C)}this.missing[D]===void 0&&(this.missing.push(D),this.missing[D]=D,this.missingMap[D]=D)},s.prototype.searchSchemas=function(q,C){if(Array.isArray(q))for(var A=0;A<q.length;A++)this.searchSchemas(q[A],C);else if(q&&typeof q=="object"){typeof q.id=="string"&&N(C,q.id)&&this.schemas[q.id]===void 0&&(this.schemas[q.id]=q);for(var D in q)if(D!=="enum"){if(typeof q[D]=="object")this.searchSchemas(q[D],C);else if(D==="$ref"){var B=h(q[D]);B&&this.schemas[B]===void 0&&this.missingMap[B]===void 0&&(this.missingMap[B]=B)}}}},s.prototype.addSchema=function(q,C){if(typeof q!="string"||typeof C>"u")if(typeof q=="object"&&typeof q.id=="string")C=q,q=C.id;else return;q===h(q)+"#"&&(q=h(q)),this.schemas[q]=C,delete this.missingMap[q],g(C,q),this.searchSchemas(C,q)},s.prototype.getSchemaMap=function(){var q={};for(var C in this.schemas)q[C]=this.schemas[C];return q},s.prototype.getSchemaUris=function(q){var C=[];for(var A in this.schemas)(!q||q.test(A))&&C.push(A);return C},s.prototype.getMissingUris=function(q){var C=[];for(var A in this.missingMap)(!q||q.test(A))&&C.push(A);return C},s.prototype.dropSchemas=function(){this.schemas={},this.reset()},s.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},s.prototype.validateAll=function(q,C,A,D,B){var F;if(C=this.resolveRefs(C),C){if(C instanceof T)return this.errors.push(C),C}else return null;var K=this.errors.length,ee,ie=null,pe=null;if(this.checkRecursive&&q&&typeof q=="object"){if(F=!this.scanned.length,q[this.validatedSchemasKey]){var ke=q[this.validatedSchemasKey].indexOf(C);if(ke!==-1)return this.errors=this.errors.concat(q[this.validationErrorsKey][ke]),null}if(Object.isFrozen(q)&&(ee=this.scannedFrozen.indexOf(q),ee!==-1)){var de=this.scannedFrozenSchemas[ee].indexOf(C);if(de!==-1)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[ee][de]),null}if(this.scanned.push(q),Object.isFrozen(q))ee===-1&&(ee=this.scannedFrozen.length,this.scannedFrozen.push(q),this.scannedFrozenSchemas.push([])),ie=this.scannedFrozenSchemas[ee].length,this.scannedFrozenSchemas[ee][ie]=C,this.scannedFrozenValidationErrors[ee][ie]=[];else{if(!q[this.validatedSchemasKey])try{Object.defineProperty(q,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(q,this.validationErrorsKey,{value:[],configurable:!0})}catch{q[this.validatedSchemasKey]=[],q[this.validationErrorsKey]=[]}pe=q[this.validatedSchemasKey].length,q[this.validatedSchemasKey][pe]=C,q[this.validationErrorsKey][pe]=[]}}var le=this.errors.length,ve=this.validateBasic(q,C,B)||this.validateNumeric(q,C,B)||this.validateString(q,C,B)||this.validateArray(q,C,B)||this.validateObject(q,C,B)||this.validateCombinations(q,C,B)||this.validateHypermedia(q,C,B)||this.validateFormat(q,C,B)||this.validateDefinedKeywords(q,C,B)||null;if(F){for(;this.scanned.length;){var We=this.scanned.pop();delete We[this.validatedSchemasKey]}this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(ve||le!==this.errors.length)for(;A&&A.length||D&&D.length;){var mt=A&&A.length?""+A.pop():null,ce=D&&D.length?""+D.pop():null;ve&&(ve=ve.prefixWith(mt,ce)),this.prefixErrors(le,mt,ce)}return ie!==null?this.scannedFrozenValidationErrors[ee][ie]=this.errors.slice(K):pe!==null&&(q[this.validationErrorsKey][pe]=this.errors.slice(K)),this.handleError(ve)},s.prototype.validateFormat=function(q,C){if(typeof C.format!="string"||!this.formatValidators[C.format])return null;var A=this.formatValidators[C.format].call(null,q,C);return typeof A=="string"||typeof A=="number"?this.createError(_.FORMAT_CUSTOM,{message:A},"","/format",null,q,C):A&&typeof A=="object"?this.createError(_.FORMAT_CUSTOM,{message:A.message||"?"},A.dataPath||"",A.schemaPath||"/format",null,q,C):null},s.prototype.validateDefinedKeywords=function(q,C,A){for(var D in this.definedKeywords)if(!(typeof C[D]>"u"))for(var B=this.definedKeywords[D],F=0;F<B.length;F++){var K=B[F],ee=K(q,C[D],C,A);if(typeof ee=="string"||typeof ee=="number")return this.createError(_.KEYWORD_CUSTOM,{key:D,message:ee},"","",null,q,C).prefixWith(null,D);if(ee&&typeof ee=="object"){var ie=ee.code;if(typeof ie=="string"){if(!_[ie])throw new Error("Undefined error code (use defineError): "+ie);ie=_[ie]}else typeof ie!="number"&&(ie=_.KEYWORD_CUSTOM);var pe=typeof ee.message=="object"?ee.message:{key:D,message:ee.message||"?"},ke=ee.schemaPath||"/"+D.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(ie,pe,ee.dataPath||null,ke,null,q,C)}}return null};function o(q,C){if(q===C)return!0;if(q&&C&&typeof q=="object"&&typeof C=="object"){if(Array.isArray(q)!==Array.isArray(C))return!1;if(Array.isArray(q)){if(q.length!==C.length)return!1;for(var A=0;A<q.length;A++)if(!o(q[A],C[A]))return!1}else{var D;for(D in q)if(C[D]===void 0&&q[D]!==void 0)return!1;for(D in C)if(q[D]===void 0&&C[D]!==void 0)return!1;for(D in q)if(!o(q[D],C[D]))return!1}return!0}return!1}s.prototype.validateBasic=function(C,A,D){var B;return(B=this.validateType(C,A,D))||(B=this.validateEnum(C,A,D))?B.prefixWith(null,"type"):null},s.prototype.validateType=function(C,A){if(A.type===void 0)return null;var D=typeof C;C===null?D="null":Array.isArray(C)&&(D="array");var B=A.type;Array.isArray(B)||(B=[B]);for(var F=0;F<B.length;F++){var K=B[F];if(K===D||K==="integer"&&D==="number"&&C%1===0)return null}return this.createError(_.INVALID_TYPE,{type:D,expected:B.join("/")},"","",null,C,A)},s.prototype.validateEnum=function(C,A){if(A.enum===void 0)return null;for(var D=0;D<A.enum.length;D++){var B=A.enum[D];if(o(C,B))return null}return this.createError(_.ENUM_MISMATCH,{value:typeof JSON<"u"?JSON.stringify(C):C},"","",null,C,A)},s.prototype.validateNumeric=function(C,A,D){return this.validateMultipleOf(C,A,D)||this.validateMinMax(C,A,D)||this.validateNaN(C,A,D)||null};var l=Math.pow(2,-51),f=1-l;s.prototype.validateMultipleOf=function(C,A){var D=A.multipleOf||A.divisibleBy;if(D===void 0)return null;if(typeof C=="number"){var B=C/D%1;if(B>=l&&B<f)return this.createError(_.NUMBER_MULTIPLE_OF,{value:C,multipleOf:D},"","",null,C,A)}return null},s.prototype.validateMinMax=function(C,A){if(typeof C!="number")return null;if(A.minimum!==void 0){if(C<A.minimum)return this.createError(_.NUMBER_MINIMUM,{value:C,minimum:A.minimum},"","/minimum",null,C,A);if(A.exclusiveMinimum&&C===A.minimum)return this.createError(_.NUMBER_MINIMUM_EXCLUSIVE,{value:C,minimum:A.minimum},"","/exclusiveMinimum",null,C,A)}if(A.maximum!==void 0){if(C>A.maximum)return this.createError(_.NUMBER_MAXIMUM,{value:C,maximum:A.maximum},"","/maximum",null,C,A);if(A.exclusiveMaximum&&C===A.maximum)return this.createError(_.NUMBER_MAXIMUM_EXCLUSIVE,{value:C,maximum:A.maximum},"","/exclusiveMaximum",null,C,A)}return null},s.prototype.validateNaN=function(C,A){return typeof C!="number"?null:isNaN(C)===!0||C===1/0||C===-1/0?this.createError(_.NUMBER_NOT_A_NUMBER,{value:C},"","/type",null,C,A):null},s.prototype.validateString=function(C,A,D){return this.validateStringLength(C,A,D)||this.validateStringPattern(C,A,D)||null},s.prototype.validateStringLength=function(C,A){return typeof C!="string"?null:A.minLength!==void 0&&C.length<A.minLength?this.createError(_.STRING_LENGTH_SHORT,{length:C.length,minimum:A.minLength},"","/minLength",null,C,A):A.maxLength!==void 0&&C.length>A.maxLength?this.createError(_.STRING_LENGTH_LONG,{length:C.length,maximum:A.maxLength},"","/maxLength",null,C,A):null},s.prototype.validateStringPattern=function(C,A){if(typeof C!="string"||typeof A.pattern!="string"&&!(A.pattern instanceof RegExp))return null;var D;if(A.pattern instanceof RegExp)D=A.pattern;else{var B,F="",K=A.pattern.match(/^\/(.+)\/([img]*)$/);K?(B=K[1],F=K[2]):B=A.pattern,D=new RegExp(B,F)}return D.test(C)?null:this.createError(_.STRING_PATTERN,{pattern:A.pattern},"","/pattern",null,C,A)},s.prototype.validateArray=function(C,A,D){return Array.isArray(C)&&(this.validateArrayLength(C,A,D)||this.validateArrayUniqueItems(C,A,D)||this.validateArrayItems(C,A,D))||null},s.prototype.validateArrayLength=function(C,A){var D;return A.minItems!==void 0&&C.length<A.minItems&&(D=this.createError(_.ARRAY_LENGTH_SHORT,{length:C.length,minimum:A.minItems},"","/minItems",null,C,A),this.handleError(D))||A.maxItems!==void 0&&C.length>A.maxItems&&(D=this.createError(_.ARRAY_LENGTH_LONG,{length:C.length,maximum:A.maxItems},"","/maxItems",null,C,A),this.handleError(D))?D:null},s.prototype.validateArrayUniqueItems=function(C,A){if(A.uniqueItems){for(var D=0;D<C.length;D++)for(var B=D+1;B<C.length;B++)if(o(C[D],C[B])){var F=this.createError(_.ARRAY_UNIQUE,{match1:D,match2:B},"","/uniqueItems",null,C,A);if(this.handleError(F))return F}}return null},s.prototype.validateArrayItems=function(C,A,D){if(A.items===void 0)return null;var B,F;if(Array.isArray(A.items)){for(F=0;F<C.length;F++)if(F<A.items.length){if(B=this.validateAll(C[F],A.items[F],[F],["items",F],D+"/"+F))return B}else if(A.additionalItems!==void 0){if(typeof A.additionalItems=="boolean"){if(!A.additionalItems&&(B=this.createError(_.ARRAY_ADDITIONAL_ITEMS,{},"/"+F,"/additionalItems",null,C,A),this.handleError(B)))return B}else if(B=this.validateAll(C[F],A.additionalItems,[F],["additionalItems"],D+"/"+F))return B}}else for(F=0;F<C.length;F++)if(B=this.validateAll(C[F],A.items,[F],["items"],D+"/"+F))return B;return null},s.prototype.validateObject=function(C,A,D){return typeof C!="object"||C===null||Array.isArray(C)?null:this.validateObjectMinMaxProperties(C,A,D)||this.validateObjectRequiredProperties(C,A,D)||this.validateObjectProperties(C,A,D)||this.validateObjectDependencies(C,A,D)||null},s.prototype.validateObjectMinMaxProperties=function(C,A){var D=Object.keys(C),B;return A.minProperties!==void 0&&D.length<A.minProperties&&(B=this.createError(_.OBJECT_PROPERTIES_MINIMUM,{propertyCount:D.length,minimum:A.minProperties},"","/minProperties",null,C,A),this.handleError(B))||A.maxProperties!==void 0&&D.length>A.maxProperties&&(B=this.createError(_.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:D.length,maximum:A.maxProperties},"","/maxProperties",null,C,A),this.handleError(B))?B:null},s.prototype.validateObjectRequiredProperties=function(C,A){if(A.required!==void 0)for(var D=0;D<A.required.length;D++){var B=A.required[D];if(C[B]===void 0){var F=this.createError(_.OBJECT_REQUIRED,{key:B},"","/required/"+D,null,C,A);if(this.handleError(F))return F}}return null},s.prototype.validateObjectProperties=function(C,A,D){var B;for(var F in C){var K=D+"/"+F.replace(/~/g,"~0").replace(/\//g,"~1"),ee=!1;if(A.properties!==void 0&&A.properties[F]!==void 0&&(ee=!0,B=this.validateAll(C[F],A.properties[F],[F],["properties",F],K)))return B;if(A.patternProperties!==void 0)for(var ie in A.patternProperties){var pe=new RegExp(ie);if(pe.test(F)&&(ee=!0,B=this.validateAll(C[F],A.patternProperties[ie],[F],["patternProperties",ie],K)))return B}if(ee)this.trackUnknownProperties&&(this.knownPropertyPaths[K]=!0,delete this.unknownPropertyPaths[K]);else if(A.additionalProperties!==void 0){if(this.trackUnknownProperties&&(this.knownPropertyPaths[K]=!0,delete this.unknownPropertyPaths[K]),typeof A.additionalProperties=="boolean"){if(!A.additionalProperties&&(B=this.createError(_.OBJECT_ADDITIONAL_PROPERTIES,{key:F},"","/additionalProperties",null,C,A).prefixWith(F,null),this.handleError(B)))return B}else if(B=this.validateAll(C[F],A.additionalProperties,[F],["additionalProperties"],K))return B}else this.trackUnknownProperties&&!this.knownPropertyPaths[K]&&(this.unknownPropertyPaths[K]=!0)}return null},s.prototype.validateObjectDependencies=function(C,A,D){var B;if(A.dependencies!==void 0){for(var F in A.dependencies)if(C[F]!==void 0){var K=A.dependencies[F];if(typeof K=="string"){if(C[K]===void 0&&(B=this.createError(_.OBJECT_DEPENDENCY_KEY,{key:F,missing:K},"","",null,C,A).prefixWith(null,F).prefixWith(null,"dependencies"),this.handleError(B)))return B}else if(Array.isArray(K))for(var ee=0;ee<K.length;ee++){var ie=K[ee];if(C[ie]===void 0&&(B=this.createError(_.OBJECT_DEPENDENCY_KEY,{key:F,missing:ie},"","/"+ee,null,C,A).prefixWith(null,F).prefixWith(null,"dependencies"),this.handleError(B)))return B}else if(B=this.validateAll(C,K,[],["dependencies",F],D))return B}}return null},s.prototype.validateCombinations=function(C,A,D){return this.validateAllOf(C,A,D)||this.validateAnyOf(C,A,D)||this.validateOneOf(C,A,D)||this.validateNot(C,A,D)||null},s.prototype.validateAllOf=function(C,A,D){if(A.allOf===void 0)return null;for(var B,F=0;F<A.allOf.length;F++){var K=A.allOf[F];if(B=this.validateAll(C,K,[],["allOf",F],D))return B}return null},s.prototype.validateAnyOf=function(C,A,D){if(A.anyOf===void 0)return null;var B=[],F=this.errors.length,K,ee;this.trackUnknownProperties&&(K=this.unknownPropertyPaths,ee=this.knownPropertyPaths);for(var ie=!0,pe=0;pe<A.anyOf.length;pe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var ke=A.anyOf[pe],de=this.errors.length,le=this.validateAll(C,ke,[],["anyOf",pe],D);if(le===null&&de===this.errors.length){if(this.errors=this.errors.slice(0,F),this.trackUnknownProperties){for(var ve in this.knownPropertyPaths)ee[ve]=!0,delete K[ve];for(var We in this.unknownPropertyPaths)ee[We]||(K[We]=!0);ie=!1;continue}return null}le&&B.push(le.prefixWith(null,""+pe).prefixWith(null,"anyOf"))}if(this.trackUnknownProperties&&(this.unknownPropertyPaths=K,this.knownPropertyPaths=ee),ie)return B=B.concat(this.errors.slice(F)),this.errors=this.errors.slice(0,F),this.createError(_.ANY_OF_MISSING,{},"","/anyOf",B,C,A)},s.prototype.validateOneOf=function(C,A,D){if(A.oneOf===void 0)return null;var B=null,F=[],K=this.errors.length,ee,ie;this.trackUnknownProperties&&(ee=this.unknownPropertyPaths,ie=this.knownPropertyPaths);for(var pe=0;pe<A.oneOf.length;pe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var ke=A.oneOf[pe],de=this.errors.length,le=this.validateAll(C,ke,[],["oneOf",pe],D);if(le===null&&de===this.errors.length){if(B===null)B=pe;else return this.errors=this.errors.slice(0,K),this.createError(_.ONE_OF_MULTIPLE,{index1:B,index2:pe},"","/oneOf",null,C,A);if(this.trackUnknownProperties){for(var ve in this.knownPropertyPaths)ie[ve]=!0,delete ee[ve];for(var We in this.unknownPropertyPaths)ie[We]||(ee[We]=!0)}}else le&&F.push(le)}return this.trackUnknownProperties&&(this.unknownPropertyPaths=ee,this.knownPropertyPaths=ie),B===null?(F=F.concat(this.errors.slice(K)),this.errors=this.errors.slice(0,K),this.createError(_.ONE_OF_MISSING,{},"","/oneOf",F,C,A)):(this.errors=this.errors.slice(0,K),null)},s.prototype.validateNot=function(C,A,D){if(A.not===void 0)return null;var B=this.errors.length,F,K;this.trackUnknownProperties&&(F=this.unknownPropertyPaths,K=this.knownPropertyPaths,this.unknownPropertyPaths={},this.knownPropertyPaths={});var ee=this.validateAll(C,A.not,null,null,D),ie=this.errors.slice(B);return this.errors=this.errors.slice(0,B),this.trackUnknownProperties&&(this.unknownPropertyPaths=F,this.knownPropertyPaths=K),ee===null&&ie.length===0?this.createError(_.NOT_PASSED,{},"","/not",null,C,A):null},s.prototype.validateHypermedia=function(C,A,D){if(!A.links)return null;for(var B,F=0;F<A.links.length;F++){var K=A.links[F];if(K.rel==="describedby"){for(var ee=new i(K.href),ie=!0,pe=0;pe<ee.varNames.length;pe++)if(!(ee.varNames[pe]in C)){ie=!1;break}if(ie){var ke=ee.fillFromObject(C),de={$ref:ke};if(B=this.validateAll(C,de,[],["links",F],D))return B}}}};function c(q){var C=String(q).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return C?{href:C[0]||"",protocol:C[1]||"",authority:C[2]||"",host:C[3]||"",hostname:C[4]||"",port:C[5]||"",pathname:C[6]||"",search:C[7]||"",hash:C[8]||""}:null}function p(q,C){function A(D){var B=[];return D.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(F){F==="/.."?B.pop():B.push(F)}),B.join("").replace(/^\//,D.charAt(0)==="/"?"/":"")}return C=c(C||""),q=c(q||""),!C||!q?null:(C.protocol||q.protocol)+(C.protocol||C.authority?C.authority:q.authority)+A(C.protocol||C.authority||C.pathname.charAt(0)==="/"?C.pathname:C.pathname?(q.authority&&!q.pathname?"/":"")+q.pathname.slice(0,q.pathname.lastIndexOf("/")+1)+C.pathname:q.pathname)+(C.protocol||C.authority||C.pathname?C.search:C.search||q.search)+C.hash}function h(q){return q.split("#")[0]}function g(q,C){if(q&&typeof q=="object")if(C===void 0?C=q.id:typeof q.id=="string"&&(C=p(C,q.id),q.id=C),Array.isArray(q))for(var A=0;A<q.length;A++)g(q[A],C);else{typeof q.$ref=="string"&&(q.$ref=p(C,q.$ref));for(var D in q)D!=="enum"&&g(q[D],C)}}function v(q){q=q||"en";var C=$[q];return function(A){var D=C[A.code]||k[A.code];if(typeof D!="string")return"Unknown error code "+A.code+": "+JSON.stringify(A.messageParams);var B=A.params;return D.replace(/\{([^{}]*)\}/g,function(F,K){var ee=B[K];return typeof ee=="string"||typeof ee=="number"?ee:F})}}var _={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},w={};for(var E in _)w[_[E]]=E;var k={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 T(q,C,A,D,B){if(Error.call(this),q===void 0)throw new Error("No error code supplied: "+D);this.message="",this.params=C,this.code=q,this.dataPath=A||"",this.schemaPath=D||"",this.subErrors=B||null;var F=new Error(this.message);if(this.stack=F.stack||F.stacktrace,!this.stack)try{throw F}catch(K){this.stack=K.stack||K.stacktrace}}T.prototype=Object.create(Error.prototype),T.prototype.constructor=T,T.prototype.name="ValidationError",T.prototype.prefixWith=function(q,C){if(q!==null&&(q=q.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+q+this.dataPath),C!==null&&(C=C.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+C+this.schemaPath),this.subErrors!==null)for(var A=0;A<this.subErrors.length;A++)this.subErrors[A].prefixWith(q,C);return this};function N(q,C){if(C.substring(0,q.length)===q){var A=C.substring(q.length);if(C.length>0&&C.charAt(q.length-1)==="/"||A.charAt(0)==="#"||A.charAt(0)==="?")return!0}return!1}var $={};function j(q){var C=new s,A,D,B={setErrorReporter:function(F){return typeof F=="string"?this.language(F):(D=F,!0)},addFormat:function(){C.addFormat.apply(C,arguments)},language:function(F){return F?($[F]||(F=F.split("-")[0]),$[F]?(A=F,F):!1):A},addLanguage:function(F,K){var ee;for(ee in _)K[ee]&&!K[_[ee]]&&(K[_[ee]]=K[ee]);var ie=F.split("-")[0];if(!$[ie])$[F]=K,$[ie]=K;else{$[F]=Object.create($[ie]);for(ee in K)typeof $[ie][ee]>"u"&&($[ie][ee]=K[ee]),$[F][ee]=K[ee]}return this},freshApi:function(F){var K=j();return F&&K.language(F),K},validate:function(F,K,ee,ie){var pe=v(A),ke=D?function(ve,We,mt){return D(ve,We,mt)||pe(ve,We,mt)}:pe,de=new s(C,!1,ke,ee,ie);typeof K=="string"&&(K={$ref:K}),de.addSchema("",K);var le=de.validateAll(F,K,null,null,"");return!le&&ie&&(le=de.banUnknownProperties(F,K)),this.error=le,this.missing=de.missing,this.valid=le===null,this.valid},validateResult:function(){var F={toString:function(){return this.valid?"valid":this.error.message}};return this.validate.apply(F,arguments),F},validateMultiple:function(F,K,ee,ie){var pe=v(A),ke=D?function(ve,We,mt){return D(ve,We,mt)||pe(ve,We,mt)}:pe,de=new s(C,!0,ke,ee,ie);typeof K=="string"&&(K={$ref:K}),de.addSchema("",K),de.validateAll(F,K,null,null,""),ie&&de.banUnknownProperties(F,K);var le={toString:function(){return this.valid?"valid":this.error.message}};return le.errors=de.errors,le.missing=de.missing,le.valid=le.errors.length===0,le},addSchema:function(){return C.addSchema.apply(C,arguments)},getSchema:function(){return C.getSchema.apply(C,arguments)},getSchemaMap:function(){return C.getSchemaMap.apply(C,arguments)},getSchemaUris:function(){return C.getSchemaUris.apply(C,arguments)},getMissingUris:function(){return C.getMissingUris.apply(C,arguments)},dropSchemas:function(){C.dropSchemas.apply(C,arguments)},defineKeyword:function(){C.defineKeyword.apply(C,arguments)},defineError:function(F,K,ee){if(typeof F!="string"||!/^[A-Z]+(_[A-Z]+)*$/.test(F))throw new Error("Code name must be a string in UPPER_CASE_WITH_UNDERSCORES");if(typeof K!="number"||K%1!==0||K<1e4)throw new Error("Code number must be an integer > 10000");if(typeof _[F]<"u")throw new Error("Error already defined: "+F+" as "+_[F]);if(typeof w[K]<"u")throw new Error("Error code already used: "+w[K]+" as "+K);_[F]=K,w[K]=F,k[F]=k[K]=ee;for(var ie in $){var pe=$[ie];pe[F]&&(pe[K]=pe[K]||pe[F])}},reset:function(){C.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:g,resolveUrl:p,getDocumentUri:h,errorCodes:_};return B.language(q||"en"),B}var G=j();return G.addLanguage("en-gb",k),G.tv4=G,G})});var af=H(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.regexpCode=rt.getEsmExportName=rt.getProperty=rt.safeStringify=rt.stringify=rt.strConcat=rt.addCodeArg=rt.str=rt._=rt.nil=rt._Code=rt.Name=rt.IDENTIFIER=rt._CodeOrName=void 0;var sf=class{};rt._CodeOrName=sf;rt.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var ha=class extends sf{constructor(e){if(super(),!rt.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}}};rt.Name=ha;var In=class extends sf{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 ha&&(r[n.str]=(r[n.str]||0)+1),r),{})}};rt._Code=In;rt.nil=new In("");function wI(t,...e){let r=[t[0]],n=0;for(;n<e.length;)dS(r,e[n]),r.push(t[++n]);return new In(r)}rt._=wI;var fS=new In("+");function _I(t,...e){let r=[of(t[0])],n=0;for(;n<e.length;)r.push(fS),dS(r,e[n]),r.push(fS,of(t[++n]));return p2(r),new In(r)}rt.str=_I;function dS(t,e){e instanceof In?t.push(...e._items):e instanceof ha?t.push(e):t.push(g2(e))}rt.addCodeArg=dS;function p2(t){let e=1;for(;e<t.length-1;){if(t[e]===fS){let r=h2(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function h2(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof ha||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 ha))return`"${t}${e.slice(1)}`}function m2(t,e){return e.emptyStr()?t:t.emptyStr()?e:_I`${t}${e}`}rt.strConcat=m2;function g2(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:of(Array.isArray(t)?t.join(","):t)}function y2(t){return new In(of(t))}rt.stringify=y2;function of(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}rt.safeStringify=of;function v2(t){return typeof t=="string"&&rt.IDENTIFIER.test(t)?new In(`.${t}`):wI`[${t}]`}rt.getProperty=v2;function b2(t){if(typeof t=="string"&&rt.IDENTIFIER.test(t))return new In(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}rt.getEsmExportName=b2;function S2(t){return new In(t.toString())}rt.regexpCode=S2});var mS=H(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.ValueScope=Vr.ValueScopeName=Vr.Scope=Vr.varKinds=Vr.UsedValueState=void 0;var Br=af(),pS=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Fh;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Fh||(Vr.UsedValueState=Fh={}));Vr.varKinds={const:new Br.Name("const"),let:new Br.Name("let"),var:new Br.Name("var")};var Dh=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Br.Name?e:this.name(e)}name(e){return new Br.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}}};Vr.Scope=Dh;var Lh=class extends Br.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Br._)`.${new Br.Name(r)}[${n}]`}};Vr.ValueScopeName=Lh;var w2=(0,Br._)`\n`,hS=class extends Dh{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?w2:Br.nil}}get(){return this._scope}name(e){return new Lh(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 f=this._scope[s]||(this._scope[s]=[]),c=f.length;return f[c]=r.ref,i.setValue(r,{property:s,itemIndex:c}),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,Br._)`${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=Br.nil;for(let o in e){let l=e[o];if(!l)continue;let f=n[o]=n[o]||new Map;l.forEach(c=>{if(f.has(c))return;f.set(c,Fh.Started);let p=r(c);if(p){let h=this.opts.es5?Vr.varKinds.var:Vr.varKinds.const;s=(0,Br._)`${s}${h} ${c} = ${p};${this.opts._n}`}else if(p=i?.(c))s=(0,Br._)`${s}${p}${this.opts._n}`;else throw new pS(c);f.set(c,Fh.Completed)})}return s}};Vr.ValueScope=hS});var je=H(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.or=Me.and=Me.not=Me.CodeGen=Me.operators=Me.varKinds=Me.ValueScopeName=Me.ValueScope=Me.Scope=Me.Name=Me.regexpCode=Me.stringify=Me.getProperty=Me.nil=Me.strConcat=Me.str=Me._=void 0;var Ge=af(),Zn=mS(),Ys=af();Object.defineProperty(Me,"_",{enumerable:!0,get:function(){return Ys._}});Object.defineProperty(Me,"str",{enumerable:!0,get:function(){return Ys.str}});Object.defineProperty(Me,"strConcat",{enumerable:!0,get:function(){return Ys.strConcat}});Object.defineProperty(Me,"nil",{enumerable:!0,get:function(){return Ys.nil}});Object.defineProperty(Me,"getProperty",{enumerable:!0,get:function(){return Ys.getProperty}});Object.defineProperty(Me,"stringify",{enumerable:!0,get:function(){return Ys.stringify}});Object.defineProperty(Me,"regexpCode",{enumerable:!0,get:function(){return Ys.regexpCode}});Object.defineProperty(Me,"Name",{enumerable:!0,get:function(){return Ys.Name}});var Bh=mS();Object.defineProperty(Me,"Scope",{enumerable:!0,get:function(){return Bh.Scope}});Object.defineProperty(Me,"ValueScope",{enumerable:!0,get:function(){return Bh.ValueScope}});Object.defineProperty(Me,"ValueScopeName",{enumerable:!0,get:function(){return Bh.ValueScopeName}});Object.defineProperty(Me,"varKinds",{enumerable:!0,get:function(){return Bh.varKinds}});Me.operators={GT:new Ge._Code(">"),GTE:new Ge._Code(">="),LT:new Ge._Code("<"),LTE:new Ge._Code("<="),EQ:new Ge._Code("==="),NEQ:new Ge._Code("!=="),NOT:new Ge._Code("!"),OR:new Ge._Code("||"),AND:new Ge._Code("&&"),ADD:new Ge._Code("+")};var os=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},gS=class extends os{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Zn.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=Ql(this.rhs,e,r)),this}get names(){return this.rhs instanceof Ge._CodeOrName?this.rhs.names:{}}},jh=class extends os{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 Ge.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Ql(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Ge.Name?{}:{...this.lhs.names};return Hh(e,this.rhs)}},yS=class extends jh{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},vS=class extends os{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},bS=class extends os{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},SS=class extends os{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},wS=class extends os{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=Ql(this.code,e,r),this}get names(){return this.code instanceof Ge._CodeOrName?this.code.names:{}}},lf=class extends os{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)||(_2(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>ya(e,r.names),{})}},as=class extends lf{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},_S=class extends lf{},Kl=class extends as{};Kl.kind="else";var ma=class t extends as{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 Kl(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(RI(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=Ql(this.condition,e,r),this}get names(){let e=super.names;return Hh(e,this.condition),this.else&&ya(e,this.else.names),e}};ma.kind="if";var ga=class extends as{};ga.kind="for";var RS=class extends ga{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=Ql(this.iteration,e,r),this}get names(){return ya(super.names,this.iteration.names)}},CS=class extends ga{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?Zn.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=Hh(super.names,this.from);return Hh(e,this.to)}},Uh=class extends ga{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=Ql(this.iterable,e,r),this}get names(){return ya(super.names,this.iterable.names)}},uf=class extends as{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)}};uf.kind="func";var cf=class extends lf{render(e){return"return "+super.render(e)}};cf.kind="return";var xS=class extends as{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&&ya(e,this.catch.names),this.finally&&ya(e,this.finally.names),e}},ff=class extends as{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};ff.kind="catch";var df=class extends as{render(e){return"finally"+super.render(e)}};df.kind="finally";var ES=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
24
- `:""},this._extScope=e,this._scope=new Zn.Scope({parent:e}),this._nodes=[new _S]}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 gS(e,s,n)),s}const(e,r,n){return this._def(Zn.varKinds.const,e,r,n)}let(e,r,n){return this._def(Zn.varKinds.let,e,r,n)}var(e,r,n){return this._def(Zn.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new jh(e,r,n))}add(e,r){return this._leafNode(new yS(e,Me.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Ge.nil&&this._leafNode(new wS(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,Ge.addCodeArg)(r,i));return r.push("}"),new Ge._Code(r)}if(e,r,n){if(this._blockNode(new ma(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 ma(e))}else(){return this._elseNode(new Kl)}endIf(){return this._endBlockNode(ma,Kl)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new RS(e),r)}forRange(e,r,n,i,s=this.opts.es5?Zn.varKinds.var:Zn.varKinds.let){let o=this._scope.toName(e);return this._for(new CS(s,o,r,n),()=>i(o))}forOf(e,r,n,i=Zn.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=r instanceof Ge.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Ge._)`${o}.length`,l=>{this.var(s,(0,Ge._)`${o}[${l}]`),n(s)})}return this._for(new Uh("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?Zn.varKinds.var:Zn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Ge._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new Uh("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(ga)}label(e){return this._leafNode(new vS(e))}break(e){return this._leafNode(new bS(e))}return(e){let r=new cf;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(cf)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new xS;if(this._blockNode(i),this.code(e),r){let s=this.name("e");this._currNode=i.catch=new ff(s),r(s)}return n&&(this._currNode=i.finally=new df,this.code(n)),this._endBlockNode(ff,df)}throw(e){return this._leafNode(new SS(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=Ge.nil,n,i){return this._blockNode(new uf(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(uf)}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 ma))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}};Me.CodeGen=ES;function ya(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Hh(t,e){return e instanceof Ge._CodeOrName?ya(t,e.names):t}function Ql(t,e,r){if(t instanceof Ge.Name)return n(t);if(!i(t))return t;return new Ge._Code(t._items.reduce((s,o)=>(o instanceof Ge.Name&&(o=n(o)),o instanceof Ge._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 Ge._Code&&s._items.some(o=>o instanceof Ge.Name&&e[o.str]===1&&r[o.str]!==void 0)}}function _2(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function RI(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Ge._)`!${IS(t)}`}Me.not=RI;var R2=CI(Me.operators.AND);function C2(...t){return t.reduce(R2)}Me.and=C2;var x2=CI(Me.operators.OR);function E2(...t){return t.reduce(x2)}Me.or=E2;function CI(t){return(e,r)=>e===Ge.nil?r:r===Ge.nil?e:(0,Ge._)`${IS(e)} ${t} ${IS(r)}`}function IS(t){return t instanceof Ge.Name?t:(0,Ge._)`(${t})`}});var Ke=H(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.checkStrictMode=Ue.getErrorPath=Ue.Type=Ue.useFunc=Ue.setEvaluated=Ue.evaluatedPropsToName=Ue.mergeEvaluated=Ue.eachItem=Ue.unescapeJsonPointer=Ue.escapeJsonPointer=Ue.escapeFragment=Ue.unescapeFragment=Ue.schemaRefOrVal=Ue.schemaHasRulesButRef=Ue.schemaHasRules=Ue.checkUnknownRules=Ue.alwaysValidSchema=Ue.toHash=void 0;var wt=je(),I2=af();function O2(t){let e={};for(let r of t)e[r]=!0;return e}Ue.toHash=O2;function q2(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(II(t,e),!OI(e,t.self.RULES.all))}Ue.alwaysValidSchema=q2;function II(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]||PI(t,`unknown keyword: "${s}"`)}Ue.checkUnknownRules=II;function OI(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}Ue.schemaHasRules=OI;function k2(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}Ue.schemaHasRulesButRef=k2;function P2({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,wt._)`${r}`}return(0,wt._)`${t}${e}${(0,wt.getProperty)(n)}`}Ue.schemaRefOrVal=P2;function T2(t){return qI(decodeURIComponent(t))}Ue.unescapeFragment=T2;function A2(t){return encodeURIComponent(qS(t))}Ue.escapeFragment=A2;function qS(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}Ue.escapeJsonPointer=qS;function qI(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}Ue.unescapeJsonPointer=qI;function $2(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}Ue.eachItem=$2;function xI({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,s,o,l)=>{let f=o===void 0?s:o instanceof wt.Name?(s instanceof wt.Name?t(i,s,o):e(i,s,o),o):s instanceof wt.Name?(e(i,o,s),s):r(s,o);return l===wt.Name&&!(f instanceof wt.Name)?n(i,f):f}}Ue.mergeEvaluated={props:xI({mergeNames:(t,e,r)=>t.if((0,wt._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,wt._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,wt._)`${r} || {}`).code((0,wt._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,wt._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,wt._)`${r} || {}`),kS(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:kI}),items:xI({mergeNames:(t,e,r)=>t.if((0,wt._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,wt._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,wt._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,wt._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function kI(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,wt._)`{}`);return e!==void 0&&kS(t,r,e),r}Ue.evaluatedPropsToName=kI;function kS(t,e,r){Object.keys(r).forEach(n=>t.assign((0,wt._)`${e}${(0,wt.getProperty)(n)}`,!0))}Ue.setEvaluated=kS;var EI={};function N2(t,e){return t.scopeValue("func",{ref:e,code:EI[e.code]||(EI[e.code]=new I2._Code(e.code))})}Ue.useFunc=N2;var OS;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(OS||(Ue.Type=OS={}));function M2(t,e,r){if(t instanceof wt.Name){let n=e===OS.Num;return r?n?(0,wt._)`"[" + ${t} + "]"`:(0,wt._)`"['" + ${t} + "']"`:n?(0,wt._)`"/" + ${t}`:(0,wt._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,wt.getProperty)(t).toString():"/"+qS(t)}Ue.getErrorPath=M2;function PI(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}Ue.checkStrictMode=PI});var ls=H(PS=>{"use strict";Object.defineProperty(PS,"__esModule",{value:!0});var hr=je(),F2={data:new hr.Name("data"),valCxt:new hr.Name("valCxt"),instancePath:new hr.Name("instancePath"),parentData:new hr.Name("parentData"),parentDataProperty:new hr.Name("parentDataProperty"),rootData:new hr.Name("rootData"),dynamicAnchors:new hr.Name("dynamicAnchors"),vErrors:new hr.Name("vErrors"),errors:new hr.Name("errors"),this:new hr.Name("this"),self:new hr.Name("self"),scope:new hr.Name("scope"),json:new hr.Name("json"),jsonPos:new hr.Name("jsonPos"),jsonLen:new hr.Name("jsonLen"),jsonPart:new hr.Name("jsonPart")};PS.default=F2});var pf=H(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.extendErrors=mr.resetErrorsCount=mr.reportExtraError=mr.reportError=mr.keyword$DataError=mr.keywordError=void 0;var Qe=je(),Vh=Ke(),Tr=ls();mr.keywordError={message:({keyword:t})=>(0,Qe.str)`must pass "${t}" keyword validation`};mr.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,Qe.str)`"${t}" keyword must be ${e} ($data)`:(0,Qe.str)`"${t}" keyword is invalid ($data)`};function D2(t,e=mr.keywordError,r,n){let{it:i}=t,{gen:s,compositeRule:o,allErrors:l}=i,f=$I(t,e,r);n??(o||l)?TI(s,f):AI(i,(0,Qe._)`[${f}]`)}mr.reportError=D2;function L2(t,e=mr.keywordError,r){let{it:n}=t,{gen:i,compositeRule:s,allErrors:o}=n,l=$I(t,e,r);TI(i,l),s||o||AI(n,Tr.default.vErrors)}mr.reportExtraError=L2;function j2(t,e){t.assign(Tr.default.errors,e),t.if((0,Qe._)`${Tr.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Qe._)`${Tr.default.vErrors}.length`,e),()=>t.assign(Tr.default.vErrors,null)))}mr.resetErrorsCount=j2;function U2({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,Tr.default.errors,l=>{t.const(o,(0,Qe._)`${Tr.default.vErrors}[${l}]`),t.if((0,Qe._)`${o}.instancePath === undefined`,()=>t.assign((0,Qe._)`${o}.instancePath`,(0,Qe.strConcat)(Tr.default.instancePath,s.errorPath))),t.assign((0,Qe._)`${o}.schemaPath`,(0,Qe.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,Qe._)`${o}.schema`,r),t.assign((0,Qe._)`${o}.data`,n))})}mr.extendErrors=U2;function TI(t,e){let r=t.const("err",e);t.if((0,Qe._)`${Tr.default.vErrors} === null`,()=>t.assign(Tr.default.vErrors,(0,Qe._)`[${r}]`),(0,Qe._)`${Tr.default.vErrors}.push(${r})`),t.code((0,Qe._)`${Tr.default.errors}++`)}function AI(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,Qe._)`new ${t.ValidationError}(${e})`):(r.assign((0,Qe._)`${n}.errors`,e),r.return(!1))}var va={keyword:new Qe.Name("keyword"),schemaPath:new Qe.Name("schemaPath"),params:new Qe.Name("params"),propertyName:new Qe.Name("propertyName"),message:new Qe.Name("message"),schema:new Qe.Name("schema"),parentSchema:new Qe.Name("parentSchema")};function $I(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,Qe._)`{}`:H2(t,e,r)}function H2(t,e,r={}){let{gen:n,it:i}=t,s=[B2(i,r),V2(t,r)];return W2(t,e,s),n.object(...s)}function B2({errorPath:t},{instancePath:e}){let r=e?(0,Qe.str)`${t}${(0,Vh.getErrorPath)(e,Vh.Type.Str)}`:t;return[Tr.default.instancePath,(0,Qe.strConcat)(Tr.default.instancePath,r)]}function V2({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,Qe.str)`${e}/${t}`;return r&&(i=(0,Qe.str)`${i}${(0,Vh.getErrorPath)(r,Vh.Type.Str)}`),[va.schemaPath,i]}function W2(t,{params:e,message:r},n){let{keyword:i,data:s,schemaValue:o,it:l}=t,{opts:f,propertyName:c,topSchemaRef:p,schemaPath:h}=l;n.push([va.keyword,i],[va.params,typeof e=="function"?e(t):e||(0,Qe._)`{}`]),f.messages&&n.push([va.message,typeof r=="function"?r(t):r]),f.verbose&&n.push([va.schema,o],[va.parentSchema,(0,Qe._)`${p}${h}`],[Tr.default.data,s]),c&&n.push([va.propertyName,c])}});var MI=H(Zl=>{"use strict";Object.defineProperty(Zl,"__esModule",{value:!0});Zl.boolOrEmptySchema=Zl.topBoolOrEmptySchema=void 0;var z2=pf(),J2=je(),G2=ls(),Y2={message:"boolean schema is false"};function K2(t){let{gen:e,schema:r,validateName:n}=t;r===!1?NI(t,!1):typeof r=="object"&&r.$async===!0?e.return(G2.default.data):(e.assign((0,J2._)`${n}.errors`,null),e.return(!0))}Zl.topBoolOrEmptySchema=K2;function Q2(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),NI(t)):r.var(e,!0)}Zl.boolOrEmptySchema=Q2;function NI(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,z2.reportError)(i,Y2,void 0,e)}});var TS=H(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});Xl.getRules=Xl.isJSONType=void 0;var Z2=["string","number","integer","boolean","null","object","array"],X2=new Set(Z2);function eU(t){return typeof t=="string"&&X2.has(t)}Xl.isJSONType=eU;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:{}}}Xl.getRules=tU});var AS=H(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.shouldUseRule=Ks.shouldUseGroup=Ks.schemaHasRulesForType=void 0;function rU({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&FI(t,n)}Ks.schemaHasRulesForType=rU;function FI(t,e){return e.rules.some(r=>DI(t,r))}Ks.shouldUseGroup=FI;function DI(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))}Ks.shouldUseRule=DI});var hf=H(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.reportTypeError=gr.checkDataTypes=gr.checkDataType=gr.coerceAndCheckDataType=gr.getJSONTypes=gr.getSchemaTypes=gr.DataType=void 0;var nU=TS(),iU=AS(),sU=pf(),qe=je(),LI=Ke(),eu;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(eu||(gr.DataType=eu={}));function oU(t){let e=jI(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}gr.getSchemaTypes=oU;function jI(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(","))}gr.getJSONTypes=jI;function aU(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,iU.schemaHasRulesForType)(t,e[0]));if(o){let l=NS(e,n,i.strictNumbers,eu.Wrong);r.if(l,()=>{s.length?uU(t,e,s):MS(t)})}return o}gr.coerceAndCheckDataType=aU;var UI=new Set(["string","number","integer","boolean","null"]);function lU(t,e){return e?t.filter(r=>UI.has(r)||e==="array"&&r==="array"):[]}function uU(t,e,r){let{gen:n,data:i,opts:s}=t,o=n.let("dataType",(0,qe._)`typeof ${i}`),l=n.let("coerced",(0,qe._)`undefined`);s.coerceTypes==="array"&&n.if((0,qe._)`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,qe._)`${i}[0]`).assign(o,(0,qe._)`typeof ${i}`).if(NS(e,i,s.strictNumbers),()=>n.assign(l,i))),n.if((0,qe._)`${l} !== undefined`);for(let c of r)(UI.has(c)||c==="array"&&s.coerceTypes==="array")&&f(c);n.else(),MS(t),n.endIf(),n.if((0,qe._)`${l} !== undefined`,()=>{n.assign(i,l),cU(t,l)});function f(c){switch(c){case"string":n.elseIf((0,qe._)`${o} == "number" || ${o} == "boolean"`).assign(l,(0,qe._)`"" + ${i}`).elseIf((0,qe._)`${i} === null`).assign(l,(0,qe._)`""`);return;case"number":n.elseIf((0,qe._)`${o} == "boolean" || ${i} === null
23
+ `+new Error().stack),S=!1}return y.apply(this,arguments)},y)}var A={};function D(d,y){e.deprecationHandler!=null&&e.deprecationHandler(d,y),A[d]||(q(y),A[d]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function B(d){return typeof Function<"u"&&d instanceof Function||Object.prototype.toString.call(d)==="[object Function]"}function F(d){var y,S;for(S in d)s(d,S)&&(y=d[S],B(y)?this[S]=y:this["_"+S]=y);this._config=d,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function K(d,y){var S=h({},d),R;for(R in y)s(y,R)&&(i(d[R])&&i(y[R])?(S[R]={},h(S[R],d[R]),h(S[R],y[R])):y[R]!=null?S[R]=y[R]:delete S[R]);for(R in d)s(d,R)&&!s(y,R)&&i(d[R])&&(S[R]=h({},S[R]));return S}function ee(d){d!=null&&this.set(d)}var ie;Object.keys?ie=Object.keys:ie=function(d){var y,S=[];for(y in d)s(d,y)&&S.push(y);return S};var pe={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function ke(d,y,S){var R=this._calendar[d]||this._calendar.sameElse;return B(R)?R.call(y,S):R}function de(d,y,S){var R=""+Math.abs(d),I=y-R.length,L=d>=0;return(L?S?"+":"":"-")+Math.pow(10,Math.max(0,I)).toString().substr(1)+R}var le=/(\[[^\[]*\])|(\\)?([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,ve=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,We={},mt={};function ce(d,y,S,R){var I=R;typeof R=="string"&&(I=function(){return this[R]()}),d&&(mt[d]=I),y&&(mt[y[0]]=function(){return de(I.apply(this,arguments),y[1],y[2])}),S&&(mt[S]=function(){return this.localeData().ordinal(I.apply(this,arguments),d)})}function ir(d){return d.match(/\[[\s\S]/)?d.replace(/^\[|\]$/g,""):d.replace(/\\/g,"")}function $e(d){var y=d.match(le),S,R;for(S=0,R=y.length;S<R;S++)mt[y[S]]?y[S]=mt[y[S]]:y[S]=ir(y[S]);return function(I){var L="",Y;for(Y=0;Y<R;Y++)L+=B(y[Y])?y[Y].call(I,d):y[Y];return L}}function nt(d,y){return d.isValid()?(y=en(y,d.localeData()),We[y]=We[y]||$e(y),We[y](d)):d.localeData().invalidDate()}function en(d,y){var S=5;function R(I){return y.longDateFormat(I)||I}for(ve.lastIndex=0;S>=0&&ve.test(d);)d=d.replace(ve,R),ve.lastIndex=0,S-=1;return d}var Nr={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 _t(d){var y=this._longDateFormat[d],S=this._longDateFormat[d.toUpperCase()];return y||!S?y:(this._longDateFormat[d]=S.match(le).map(function(R){return R==="MMMM"||R==="MM"||R==="DD"||R==="dddd"?R.slice(1):R}).join(""),this._longDateFormat[d])}var Rt="Invalid date";function hn(){return this._invalidDate}var qo="%d",er=/\d{1,2}/;function ko(d){return this._ordinal.replace("%d",d)}var $y={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 Mn(d,y,S,R){var I=this._relativeTime[S];return B(I)?I(d,y,S,R):I.replace(/%d/i,d)}function ap(d,y){var S=this._relativeTime[d>0?"future":"past"];return B(S)?S(y):S.replace(/%s/i,y)}var lp={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 tr(d){return typeof d=="string"?lp[d]||lp[d.toLowerCase()]:void 0}function _r(d){var y={},S,R;for(R in d)s(d,R)&&(S=tr(R),S&&(y[S]=d[R]));return y}var Po={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 tl(d){var y=[],S;for(S in d)s(d,S)&&y.push({unit:S,priority:Po[S]});return y.sort(function(R,I){return R.priority-I.priority}),y}var up=/\d/,Gt=/\d\d/,cp=/\d{3}/,ji=/\d{4}/,Fn=/[+-]?\d{6}/,pt=/\d\d?/,rl=/\d\d\d\d?/,nl=/\d\d\d\d\d\d?/,Cs=/\d{1,3}/,To=/\d{1,4}/,xs=/[+-]?\d{1,6}/,yi=/\d+/,Es=/[+-]?\d+/,oc=/Z|[+-]\d\d:?\d\d/gi,il=/Z|[+-]\d\d(?::?\d\d)?/gi,Ny=/[+-]?\d+(\.\d{1,3})?/,Ao=/[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,Ui=/^[1-9]\d?/,sl=/^([1-9]\d|\d)/,ol;ol={};function fe(d,y,S){ol[d]=B(y)?y:function(R,I){return R&&S?S:y}}function My(d,y){return s(ol,d)?ol[d](y._strict,y._locale):new RegExp(Fy(d))}function Fy(d){return mn(d.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(y,S,R,I,L){return S||R||I||L}))}function mn(d){return d.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Mr(d){return d<0?Math.ceil(d)||0:Math.floor(d)}function Fe(d){var y=+d,S=0;return y!==0&&isFinite(y)&&(S=Mr(y)),S}var ac={};function it(d,y){var S,R=y,I;for(typeof d=="string"&&(d=[d]),f(y)&&(R=function(L,Y){Y[y]=Fe(L)}),I=d.length,S=0;S<I;S++)ac[d[S]]=R}function $o(d,y){it(d,function(S,R,I,L){I._w=I._w||{},y(S,I._w,I,L)})}function lc(d,y,S){y!=null&&s(ac,d)&&ac[d](y,S._a,S,d)}function al(d){return d%4===0&&d%100!==0||d%400===0}var rr=0,Dn=1,gn=2,Lt=3,Fr=4,Ln=5,Hi=6,fp=7,Dy=8;ce("Y",0,0,function(){var d=this.year();return d<=9999?de(d,4):"+"+d}),ce(0,["YY",2],0,function(){return this.year()%100}),ce(0,["YYYY",4],0,"year"),ce(0,["YYYYY",5],0,"year"),ce(0,["YYYYYY",6,!0],0,"year"),fe("Y",Es),fe("YY",pt,Gt),fe("YYYY",To,ji),fe("YYYYY",xs,Fn),fe("YYYYYY",xs,Fn),it(["YYYYY","YYYYYY"],rr),it("YYYY",function(d,y){y[rr]=d.length===2?e.parseTwoDigitYear(d):Fe(d)}),it("YY",function(d,y){y[rr]=e.parseTwoDigitYear(d)}),it("Y",function(d,y){y[rr]=parseInt(d,10)});function No(d){return al(d)?366:365}e.parseTwoDigitYear=function(d){return Fe(d)+(Fe(d)>68?1900:2e3)};var dp=Is("FullYear",!0);function Ly(){return al(this.year())}function Is(d,y){return function(S){return S!=null?(Fo(this,d,S),e.updateOffset(this,y),this):Mo(this,d)}}function Mo(d,y){if(!d.isValid())return NaN;var S=d._d,R=d._isUTC;switch(y){case"Milliseconds":return R?S.getUTCMilliseconds():S.getMilliseconds();case"Seconds":return R?S.getUTCSeconds():S.getSeconds();case"Minutes":return R?S.getUTCMinutes():S.getMinutes();case"Hours":return R?S.getUTCHours():S.getHours();case"Date":return R?S.getUTCDate():S.getDate();case"Day":return R?S.getUTCDay():S.getDay();case"Month":return R?S.getUTCMonth():S.getMonth();case"FullYear":return R?S.getUTCFullYear():S.getFullYear();default:return NaN}}function Fo(d,y,S){var R,I,L,Y,ae;if(!(!d.isValid()||isNaN(S))){switch(R=d._d,I=d._isUTC,y){case"Milliseconds":return void(I?R.setUTCMilliseconds(S):R.setMilliseconds(S));case"Seconds":return void(I?R.setUTCSeconds(S):R.setSeconds(S));case"Minutes":return void(I?R.setUTCMinutes(S):R.setMinutes(S));case"Hours":return void(I?R.setUTCHours(S):R.setHours(S));case"Date":return void(I?R.setUTCDate(S):R.setDate(S));case"FullYear":break;default:return}L=S,Y=d.month(),ae=d.date(),ae=ae===29&&Y===1&&!al(L)?28:ae,I?R.setUTCFullYear(L,Y,ae):R.setFullYear(L,Y,ae)}}function jy(d){return d=tr(d),B(this[d])?this[d]():this}function ll(d,y){if(typeof d=="object"){d=_r(d);var S=tl(d),R,I=S.length;for(R=0;R<I;R++)this[S[R].unit](d[S[R].unit])}else if(d=tr(d),B(this[d]))return this[d](y);return this}function Uy(d,y){return(d%y+y)%y}var kt;Array.prototype.indexOf?kt=Array.prototype.indexOf:kt=function(d){var y;for(y=0;y<this.length;++y)if(this[y]===d)return y;return-1};function uc(d,y){if(isNaN(d)||isNaN(y))return NaN;var S=Uy(y,12);return d+=(y-S)/12,S===1?al(d)?29:28:31-S%7%2}ce("M",["MM",2],"Mo",function(){return this.month()+1}),ce("MMM",0,0,function(d){return this.localeData().monthsShort(this,d)}),ce("MMMM",0,0,function(d){return this.localeData().months(this,d)}),fe("M",pt,Ui),fe("MM",pt,Gt),fe("MMM",function(d,y){return y.monthsShortRegex(d)}),fe("MMMM",function(d,y){return y.monthsRegex(d)}),it(["M","MM"],function(d,y){y[Dn]=Fe(d)-1}),it(["MMM","MMMM"],function(d,y,S,R){var I=S._locale.monthsParse(d,R,S._strict);I!=null?y[Dn]=I:_(S).invalidMonth=d});var pp="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),cc="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),fc=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Hy=Ao,By=Ao;function Vy(d,y){return d?n(this._months)?this._months[d.month()]:this._months[(this._months.isFormat||fc).test(y)?"format":"standalone"][d.month()]:n(this._months)?this._months:this._months.standalone}function Wy(d,y){return d?n(this._monthsShort)?this._monthsShort[d.month()]:this._monthsShort[fc.test(y)?"format":"standalone"][d.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function hp(d,y,S){var R,I,L,Y=d.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],R=0;R<12;++R)L=g([2e3,R]),this._shortMonthsParse[R]=this.monthsShort(L,"").toLocaleLowerCase(),this._longMonthsParse[R]=this.months(L,"").toLocaleLowerCase();return S?y==="MMM"?(I=kt.call(this._shortMonthsParse,Y),I!==-1?I:null):(I=kt.call(this._longMonthsParse,Y),I!==-1?I:null):y==="MMM"?(I=kt.call(this._shortMonthsParse,Y),I!==-1?I:(I=kt.call(this._longMonthsParse,Y),I!==-1?I:null)):(I=kt.call(this._longMonthsParse,Y),I!==-1?I:(I=kt.call(this._shortMonthsParse,Y),I!==-1?I:null))}function mp(d,y,S){var R,I,L;if(this._monthsParseExact)return hp.call(this,d,y,S);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),R=0;R<12;R++){if(I=g([2e3,R]),S&&!this._longMonthsParse[R]&&(this._longMonthsParse[R]=new RegExp("^"+this.months(I,"").replace(".","")+"$","i"),this._shortMonthsParse[R]=new RegExp("^"+this.monthsShort(I,"").replace(".","")+"$","i")),!S&&!this._monthsParse[R]&&(L="^"+this.months(I,"")+"|^"+this.monthsShort(I,""),this._monthsParse[R]=new RegExp(L.replace(".",""),"i")),S&&y==="MMMM"&&this._longMonthsParse[R].test(d))return R;if(S&&y==="MMM"&&this._shortMonthsParse[R].test(d))return R;if(!S&&this._monthsParse[R].test(d))return R}}function dc(d,y){if(!d.isValid())return d;if(typeof y=="string"){if(/^\d+$/.test(y))y=Fe(y);else if(y=d.localeData().monthsParse(y),!f(y))return d}var S=y,R=d.date();return R=R<29?R:Math.min(R,uc(d.year(),S)),d._isUTC?d._d.setUTCMonth(S,R):d._d.setMonth(S,R),d}function ul(d){return d!=null?(dc(this,d),e.updateOffset(this,!0),this):Mo(this,"Month")}function zy(){return uc(this.year(),this.month())}function gp(d){return this._monthsParseExact?(s(this,"_monthsRegex")||pc.call(this),d?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=Hy),this._monthsShortStrictRegex&&d?this._monthsShortStrictRegex:this._monthsShortRegex)}function cl(d){return this._monthsParseExact?(s(this,"_monthsRegex")||pc.call(this),d?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=By),this._monthsStrictRegex&&d?this._monthsStrictRegex:this._monthsRegex)}function pc(){function d(_e,Le){return Le.length-_e.length}var y=[],S=[],R=[],I,L,Y,ae;for(I=0;I<12;I++)L=g([2e3,I]),Y=mn(this.monthsShort(L,"")),ae=mn(this.months(L,"")),y.push(Y),S.push(ae),R.push(ae),R.push(Y);y.sort(d),S.sort(d),R.sort(d),this._monthsRegex=new RegExp("^("+R.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+S.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+y.join("|")+")","i")}function Jy(d,y,S,R,I,L,Y){var ae;return d<100&&d>=0?(ae=new Date(d+400,y,S,R,I,L,Y),isFinite(ae.getFullYear())&&ae.setFullYear(d)):ae=new Date(d,y,S,R,I,L,Y),ae}function Os(d){var y,S;return d<100&&d>=0?(S=Array.prototype.slice.call(arguments),S[0]=d+400,y=new Date(Date.UTC.apply(null,S)),isFinite(y.getUTCFullYear())&&y.setUTCFullYear(d)):y=new Date(Date.UTC.apply(null,arguments)),y}function Do(d,y,S){var R=7+y-S,I=(7+Os(d,0,R).getUTCDay()-y)%7;return-I+R-1}function fl(d,y,S,R,I){var L=(7+S-R)%7,Y=Do(d,R,I),ae=1+7*(y-1)+L+Y,_e,Le;return ae<=0?(_e=d-1,Le=No(_e)+ae):ae>No(d)?(_e=d+1,Le=ae-No(d)):(_e=d,Le=ae),{year:_e,dayOfYear:Le}}function Lo(d,y,S){var R=Do(d.year(),y,S),I=Math.floor((d.dayOfYear()-R-1)/7)+1,L,Y;return I<1?(Y=d.year()-1,L=I+yn(Y,y,S)):I>yn(d.year(),y,S)?(L=I-yn(d.year(),y,S),Y=d.year()+1):(Y=d.year(),L=I),{week:L,year:Y}}function yn(d,y,S){var R=Do(d,y,S),I=Do(d+1,y,S);return(No(d)-R+I)/7}ce("w",["ww",2],"wo","week"),ce("W",["WW",2],"Wo","isoWeek"),fe("w",pt,Ui),fe("ww",pt,Gt),fe("W",pt,Ui),fe("WW",pt,Gt),$o(["w","ww","W","WW"],function(d,y,S,R){y[R.substr(0,1)]=Fe(d)});function hc(d){return Lo(d,this._week.dow,this._week.doy).week}var mc={dow:0,doy:6};function qs(){return this._week.dow}function yp(){return this._week.doy}function vp(d){var y=this.localeData().week(this);return d==null?y:this.add((d-y)*7,"d")}function Gy(d){var y=Lo(this,1,4).week;return d==null?y:this.add((d-y)*7,"d")}ce("d",0,"do","day"),ce("dd",0,0,function(d){return this.localeData().weekdaysMin(this,d)}),ce("ddd",0,0,function(d){return this.localeData().weekdaysShort(this,d)}),ce("dddd",0,0,function(d){return this.localeData().weekdays(this,d)}),ce("e",0,0,"weekday"),ce("E",0,0,"isoWeekday"),fe("d",pt),fe("e",pt),fe("E",pt),fe("dd",function(d,y){return y.weekdaysMinRegex(d)}),fe("ddd",function(d,y){return y.weekdaysShortRegex(d)}),fe("dddd",function(d,y){return y.weekdaysRegex(d)}),$o(["dd","ddd","dddd"],function(d,y,S,R){var I=S._locale.weekdaysParse(d,R,S._strict);I!=null?y.d=I:_(S).invalidWeekday=d}),$o(["d","e","E"],function(d,y,S,R){y[R]=Fe(d)});function bp(d,y){return typeof d!="string"?d:isNaN(d)?(d=y.weekdaysParse(d),typeof d=="number"?d:null):parseInt(d,10)}function Sp(d,y){return typeof d=="string"?y.weekdaysParse(d)%7||7:isNaN(d)?null:d}function dl(d,y){return d.slice(y,7).concat(d.slice(0,y))}var wp="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),_p="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Yy="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ky=Ao,Rp=Ao,Qy=Ao;function Zy(d,y){var S=n(this._weekdays)?this._weekdays:this._weekdays[d&&d!==!0&&this._weekdays.isFormat.test(y)?"format":"standalone"];return d===!0?dl(S,this._week.dow):d?S[d.day()]:S}function Xy(d){return d===!0?dl(this._weekdaysShort,this._week.dow):d?this._weekdaysShort[d.day()]:this._weekdaysShort}function ev(d){return d===!0?dl(this._weekdaysMin,this._week.dow):d?this._weekdaysMin[d.day()]:this._weekdaysMin}function gc(d,y,S){var R,I,L,Y=d.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],R=0;R<7;++R)L=g([2e3,1]).day(R),this._minWeekdaysParse[R]=this.weekdaysMin(L,"").toLocaleLowerCase(),this._shortWeekdaysParse[R]=this.weekdaysShort(L,"").toLocaleLowerCase(),this._weekdaysParse[R]=this.weekdays(L,"").toLocaleLowerCase();return S?y==="dddd"?(I=kt.call(this._weekdaysParse,Y),I!==-1?I:null):y==="ddd"?(I=kt.call(this._shortWeekdaysParse,Y),I!==-1?I:null):(I=kt.call(this._minWeekdaysParse,Y),I!==-1?I:null):y==="dddd"?(I=kt.call(this._weekdaysParse,Y),I!==-1||(I=kt.call(this._shortWeekdaysParse,Y),I!==-1)?I:(I=kt.call(this._minWeekdaysParse,Y),I!==-1?I:null)):y==="ddd"?(I=kt.call(this._shortWeekdaysParse,Y),I!==-1||(I=kt.call(this._weekdaysParse,Y),I!==-1)?I:(I=kt.call(this._minWeekdaysParse,Y),I!==-1?I:null)):(I=kt.call(this._minWeekdaysParse,Y),I!==-1||(I=kt.call(this._weekdaysParse,Y),I!==-1)?I:(I=kt.call(this._shortWeekdaysParse,Y),I!==-1?I:null))}function tv(d,y,S){var R,I,L;if(this._weekdaysParseExact)return gc.call(this,d,y,S);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),R=0;R<7;R++){if(I=g([2e3,1]).day(R),S&&!this._fullWeekdaysParse[R]&&(this._fullWeekdaysParse[R]=new RegExp("^"+this.weekdays(I,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[R]=new RegExp("^"+this.weekdaysShort(I,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[R]=new RegExp("^"+this.weekdaysMin(I,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[R]||(L="^"+this.weekdays(I,"")+"|^"+this.weekdaysShort(I,"")+"|^"+this.weekdaysMin(I,""),this._weekdaysParse[R]=new RegExp(L.replace(".",""),"i")),S&&y==="dddd"&&this._fullWeekdaysParse[R].test(d))return R;if(S&&y==="ddd"&&this._shortWeekdaysParse[R].test(d))return R;if(S&&y==="dd"&&this._minWeekdaysParse[R].test(d))return R;if(!S&&this._weekdaysParse[R].test(d))return R}}function rv(d){if(!this.isValid())return d!=null?this:NaN;var y=Mo(this,"Day");return d!=null?(d=bp(d,this.localeData()),this.add(d-y,"d")):y}function nv(d){if(!this.isValid())return d!=null?this:NaN;var y=(this.day()+7-this.localeData()._week.dow)%7;return d==null?y:this.add(d-y,"d")}function iv(d){if(!this.isValid())return d!=null?this:NaN;if(d!=null){var y=Sp(d,this.localeData());return this.day(this.day()%7?y:y-7)}else return this.day()||7}function sv(d){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||yc.call(this),d?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=Ky),this._weekdaysStrictRegex&&d?this._weekdaysStrictRegex:this._weekdaysRegex)}function bt(d){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||yc.call(this),d?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Rp),this._weekdaysShortStrictRegex&&d?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function gt(d){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||yc.call(this),d?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Qy),this._weekdaysMinStrictRegex&&d?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function yc(){function d(Vt,Wn){return Wn.length-Vt.length}var y=[],S=[],R=[],I=[],L,Y,ae,_e,Le;for(L=0;L<7;L++)Y=g([2e3,1]).day(L),ae=mn(this.weekdaysMin(Y,"")),_e=mn(this.weekdaysShort(Y,"")),Le=mn(this.weekdays(Y,"")),y.push(ae),S.push(_e),R.push(Le),I.push(ae),I.push(_e),I.push(Le);y.sort(d),S.sort(d),R.sort(d),I.sort(d),this._weekdaysRegex=new RegExp("^("+I.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+R.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+S.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+y.join("|")+")","i")}function vc(){return this.hours()%12||12}function ov(){return this.hours()||24}ce("H",["HH",2],0,"hour"),ce("h",["hh",2],0,vc),ce("k",["kk",2],0,ov),ce("hmm",0,0,function(){return""+vc.apply(this)+de(this.minutes(),2)}),ce("hmmss",0,0,function(){return""+vc.apply(this)+de(this.minutes(),2)+de(this.seconds(),2)}),ce("Hmm",0,0,function(){return""+this.hours()+de(this.minutes(),2)}),ce("Hmmss",0,0,function(){return""+this.hours()+de(this.minutes(),2)+de(this.seconds(),2)});function Cp(d,y){ce(d,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),y)})}Cp("a",!0),Cp("A",!1);function xp(d,y){return y._meridiemParse}fe("a",xp),fe("A",xp),fe("H",pt,sl),fe("h",pt,Ui),fe("k",pt,Ui),fe("HH",pt,Gt),fe("hh",pt,Gt),fe("kk",pt,Gt),fe("hmm",rl),fe("hmmss",nl),fe("Hmm",rl),fe("Hmmss",nl),it(["H","HH"],Lt),it(["k","kk"],function(d,y,S){var R=Fe(d);y[Lt]=R===24?0:R}),it(["a","A"],function(d,y,S){S._isPm=S._locale.isPM(d),S._meridiem=d}),it(["h","hh"],function(d,y,S){y[Lt]=Fe(d),_(S).bigHour=!0}),it("hmm",function(d,y,S){var R=d.length-2;y[Lt]=Fe(d.substr(0,R)),y[Fr]=Fe(d.substr(R)),_(S).bigHour=!0}),it("hmmss",function(d,y,S){var R=d.length-4,I=d.length-2;y[Lt]=Fe(d.substr(0,R)),y[Fr]=Fe(d.substr(R,2)),y[Ln]=Fe(d.substr(I)),_(S).bigHour=!0}),it("Hmm",function(d,y,S){var R=d.length-2;y[Lt]=Fe(d.substr(0,R)),y[Fr]=Fe(d.substr(R))}),it("Hmmss",function(d,y,S){var R=d.length-4,I=d.length-2;y[Lt]=Fe(d.substr(0,R)),y[Fr]=Fe(d.substr(R,2)),y[Ln]=Fe(d.substr(I))});function av(d){return(d+"").toLowerCase().charAt(0)==="p"}var Ep=/[ap]\.?m?\.?/i,lv=Is("Hours",!0);function Bt(d,y,S){return d>11?S?"pm":"PM":S?"am":"AM"}var pl={calendar:pe,longDateFormat:Nr,invalidDate:Rt,ordinal:qo,dayOfMonthOrdinalParse:er,relativeTime:$y,months:pp,monthsShort:cc,week:mc,weekdays:wp,weekdaysMin:Yy,weekdaysShort:_p,meridiemParse:Ep},st={},ks={},Bi;function Dr(d,y){var S,R=Math.min(d.length,y.length);for(S=0;S<R;S+=1)if(d[S]!==y[S])return S;return R}function bc(d){return d&&d.toLowerCase().replace("_","-")}function Ip(d){for(var y=0,S,R,I,L;y<d.length;){for(L=bc(d[y]).split("-"),S=L.length,R=bc(d[y+1]),R=R?R.split("-"):null;S>0;){if(I=jo(L.slice(0,S).join("-")),I)return I;if(R&&R.length>=S&&Dr(L,R)>=S-1)break;S--}y++}return Bi}function Op(d){return!!(d&&d.match("^[^/\\\\]*$"))}function jo(d){var y=null,S;if(st[d]===void 0&&typeof Yl<"u"&&Yl&&Yl.exports&&Op(d))try{y=Bi._abbr,S=ft,S("./locale/"+d),jn(y)}catch{st[d]=null}return st[d]}function jn(d,y){var S;return d&&(l(y)?S=Un(d):S=hl(d,y),S?Bi=S:typeof console<"u"&&console.warn&&console.warn("Locale "+d+" not found. Did you forget to load it?")),Bi._abbr}function hl(d,y){if(y!==null){var S,R=pl;if(y.abbr=d,st[d]!=null)D("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."),R=st[d]._config;else if(y.parentLocale!=null)if(st[y.parentLocale]!=null)R=st[y.parentLocale]._config;else if(S=jo(y.parentLocale),S!=null)R=S._config;else return ks[y.parentLocale]||(ks[y.parentLocale]=[]),ks[y.parentLocale].push({name:d,config:y}),null;return st[d]=new ee(K(R,y)),ks[d]&&ks[d].forEach(function(I){hl(I.name,I.config)}),jn(d),st[d]}else return delete st[d],null}function Rr(d,y){if(y!=null){var S,R,I=pl;st[d]!=null&&st[d].parentLocale!=null?st[d].set(K(st[d]._config,y)):(R=jo(d),R!=null&&(I=R._config),y=K(I,y),R==null&&(y.abbr=d),S=new ee(y),S.parentLocale=st[d],st[d]=S),jn(d)}else st[d]!=null&&(st[d].parentLocale!=null?(st[d]=st[d].parentLocale,d===jn()&&jn(d)):st[d]!=null&&delete st[d]);return st[d]}function Un(d){var y;if(d&&d._locale&&d._locale._abbr&&(d=d._locale._abbr),!d)return Bi;if(!n(d)){if(y=jo(d),y)return y;d=[d]}return Ip(d)}function Cr(){return ie(st)}function Sc(d){var y,S=d._a;return S&&_(d).overflow===-2&&(y=S[Dn]<0||S[Dn]>11?Dn:S[gn]<1||S[gn]>uc(S[rr],S[Dn])?gn:S[Lt]<0||S[Lt]>24||S[Lt]===24&&(S[Fr]!==0||S[Ln]!==0||S[Hi]!==0)?Lt:S[Fr]<0||S[Fr]>59?Fr:S[Ln]<0||S[Ln]>59?Ln:S[Hi]<0||S[Hi]>999?Hi:-1,_(d)._overflowDayOfYear&&(y<rr||y>gn)&&(y=gn),_(d)._overflowWeeks&&y===-1&&(y=fp),_(d)._overflowWeekday&&y===-1&&(y=Dy),_(d).overflow=y),d}var qp=/^\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)?)?$/,vi=/^\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)?)?$/,ml=/Z|[+-]\d\d(?::?\d\d)?/,Ps=[["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]],yt=[["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/]],bi=/^\/?Date\((-?\d+)/i,wc=/^(?:(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}))$/,uv={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function gl(d){var y,S,R=d._i,I=qp.exec(R)||vi.exec(R),L,Y,ae,_e,Le=Ps.length,Vt=yt.length;if(I){for(_(d).iso=!0,y=0,S=Le;y<S;y++)if(Ps[y][1].exec(I[1])){Y=Ps[y][0],L=Ps[y][2]!==!1;break}if(Y==null){d._isValid=!1;return}if(I[3]){for(y=0,S=Vt;y<S;y++)if(yt[y][1].exec(I[3])){ae=(I[2]||" ")+yt[y][0];break}if(ae==null){d._isValid=!1;return}}if(!L&&ae!=null){d._isValid=!1;return}if(I[4])if(ml.exec(I[4]))_e="Z";else{d._isValid=!1;return}d._f=Y+(ae||"")+(_e||""),vl(d)}else d._isValid=!1}function cv(d,y,S,R,I,L){var Y=[fv(d),cc.indexOf(y),parseInt(S,10),parseInt(R,10),parseInt(I,10)];return L&&Y.push(parseInt(L,10)),Y}function fv(d){var y=parseInt(d,10);return y<=49?2e3+y:y<=999?1900+y:y}function dv(d){return d.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function kp(d,y,S){if(d){var R=_p.indexOf(d),I=new Date(y[0],y[1],y[2]).getDay();if(R!==I)return _(S).weekdayMismatch=!0,S._isValid=!1,!1}return!0}function yl(d,y,S){if(d)return uv[d];if(y)return 0;var R=parseInt(S,10),I=R%100,L=(R-I)/100;return L*60+I}function Vi(d){var y=wc.exec(dv(d._i)),S;if(y){if(S=cv(y[4],y[3],y[2],y[5],y[6],y[7]),!kp(y[1],S,d))return;d._a=S,d._tzm=yl(y[8],y[9],y[10]),d._d=Os.apply(null,d._a),d._d.setUTCMinutes(d._d.getUTCMinutes()-d._tzm),_(d).rfc2822=!0}else d._isValid=!1}function pv(d){var y=bi.exec(d._i);if(y!==null){d._d=new Date(+y[1]);return}if(gl(d),d._isValid===!1)delete d._isValid;else return;if(Vi(d),d._isValid===!1)delete d._isValid;else return;d._strict?d._isValid=!1:e.createFromInputFallback(d)}e.createFromInputFallback=C("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(d){d._d=new Date(d._i+(d._useUTC?" UTC":""))});function Wi(d,y,S){return d??y??S}function Pp(d){var y=new Date(e.now());return d._useUTC?[y.getUTCFullYear(),y.getUTCMonth(),y.getUTCDate()]:[y.getFullYear(),y.getMonth(),y.getDate()]}function Uo(d){var y,S,R=[],I,L,Y;if(!d._d){for(I=Pp(d),d._w&&d._a[gn]==null&&d._a[Dn]==null&&_c(d),d._dayOfYear!=null&&(Y=Wi(d._a[rr],I[rr]),(d._dayOfYear>No(Y)||d._dayOfYear===0)&&(_(d)._overflowDayOfYear=!0),S=Os(Y,0,d._dayOfYear),d._a[Dn]=S.getUTCMonth(),d._a[gn]=S.getUTCDate()),y=0;y<3&&d._a[y]==null;++y)d._a[y]=R[y]=I[y];for(;y<7;y++)d._a[y]=R[y]=d._a[y]==null?y===2?1:0:d._a[y];d._a[Lt]===24&&d._a[Fr]===0&&d._a[Ln]===0&&d._a[Hi]===0&&(d._nextDay=!0,d._a[Lt]=0),d._d=(d._useUTC?Os:Jy).apply(null,R),L=d._useUTC?d._d.getUTCDay():d._d.getDay(),d._tzm!=null&&d._d.setUTCMinutes(d._d.getUTCMinutes()-d._tzm),d._nextDay&&(d._a[Lt]=24),d._w&&typeof d._w.d<"u"&&d._w.d!==L&&(_(d).weekdayMismatch=!0)}}function _c(d){var y,S,R,I,L,Y,ae,_e,Le;y=d._w,y.GG!=null||y.W!=null||y.E!=null?(L=1,Y=4,S=Wi(y.GG,d._a[rr],Lo(lt(),1,4).year),R=Wi(y.W,1),I=Wi(y.E,1),(I<1||I>7)&&(_e=!0)):(L=d._locale._week.dow,Y=d._locale._week.doy,Le=Lo(lt(),L,Y),S=Wi(y.gg,d._a[rr],Le.year),R=Wi(y.w,Le.week),y.d!=null?(I=y.d,(I<0||I>6)&&(_e=!0)):y.e!=null?(I=y.e+L,(y.e<0||y.e>6)&&(_e=!0)):I=L),R<1||R>yn(S,L,Y)?_(d)._overflowWeeks=!0:_e!=null?_(d)._overflowWeekday=!0:(ae=fl(S,R,I,L,Y),d._a[rr]=ae.year,d._dayOfYear=ae.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function vl(d){if(d._f===e.ISO_8601){gl(d);return}if(d._f===e.RFC_2822){Vi(d);return}d._a=[],_(d).empty=!0;var y=""+d._i,S,R,I,L,Y,ae=y.length,_e=0,Le,Vt;for(I=en(d._f,d._locale).match(le)||[],Vt=I.length,S=0;S<Vt;S++)L=I[S],R=(y.match(My(L,d))||[])[0],R&&(Y=y.substr(0,y.indexOf(R)),Y.length>0&&_(d).unusedInput.push(Y),y=y.slice(y.indexOf(R)+R.length),_e+=R.length),mt[L]?(R?_(d).empty=!1:_(d).unusedTokens.push(L),lc(L,R,d)):d._strict&&!R&&_(d).unusedTokens.push(L);_(d).charsLeftOver=ae-_e,y.length>0&&_(d).unusedInput.push(y),d._a[Lt]<=12&&_(d).bigHour===!0&&d._a[Lt]>0&&(_(d).bigHour=void 0),_(d).parsedDateParts=d._a.slice(0),_(d).meridiem=d._meridiem,d._a[Lt]=hv(d._locale,d._a[Lt],d._meridiem),Le=_(d).era,Le!==null&&(d._a[rr]=d._locale.erasConvertYear(Le,d._a[rr])),Uo(d),Sc(d)}function hv(d,y,S){var R;return S==null?y:d.meridiemHour!=null?d.meridiemHour(y,S):(d.isPM!=null&&(R=d.isPM(S),R&&y<12&&(y+=12),!R&&y===12&&(y=0)),y)}function Rc(d){var y,S,R,I,L,Y,ae=!1,_e=d._f.length;if(_e===0){_(d).invalidFormat=!0,d._d=new Date(NaN);return}for(I=0;I<_e;I++)L=0,Y=!1,y=$({},d),d._useUTC!=null&&(y._useUTC=d._useUTC),y._f=d._f[I],vl(y),E(y)&&(Y=!0),L+=_(y).charsLeftOver,L+=_(y).unusedTokens.length*10,_(y).score=L,ae?L<R&&(R=L,S=y):(R==null||L<R||Y)&&(R=L,S=y,Y&&(ae=!0));h(d,S||y)}function Cc(d){if(!d._d){var y=_r(d._i),S=y.day===void 0?y.date:y.day;d._a=p([y.year,y.month,S,y.hour,y.minute,y.second,y.millisecond],function(R){return R&&parseInt(R,10)}),Uo(d)}}function mv(d){var y=new j(Sc(xc(d)));return y._nextDay&&(y.add(1,"d"),y._nextDay=void 0),y}function xc(d){var y=d._i,S=d._f;return d._locale=d._locale||Un(d._l),y===null||S===void 0&&y===""?k({nullInput:!0}):(typeof y=="string"&&(d._i=y=d._locale.preparse(y)),G(y)?new j(Sc(y)):(c(y)?d._d=y:n(S)?Rc(d):S?vl(d):xr(d),E(d)||(d._d=null),d))}function xr(d){var y=d._i;l(y)?d._d=new Date(e.now()):c(y)?d._d=new Date(y.valueOf()):typeof y=="string"?pv(d):n(y)?(d._a=p(y.slice(0),function(S){return parseInt(S,10)}),Uo(d)):i(y)?Cc(d):f(y)?d._d=new Date(y):e.createFromInputFallback(d)}function bl(d,y,S,R,I){var L={};return(y===!0||y===!1)&&(R=y,y=void 0),(S===!0||S===!1)&&(R=S,S=void 0),(i(d)&&o(d)||n(d)&&d.length===0)&&(d=void 0),L._isAMomentObject=!0,L._useUTC=L._isUTC=I,L._l=S,L._i=d,L._f=y,L._strict=R,mv(L)}function lt(d,y,S,R){return bl(d,y,S,R,!1)}var Tp=C("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var d=lt.apply(null,arguments);return this.isValid()&&d.isValid()?d<this?this:d:k()}),Ap=C("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var d=lt.apply(null,arguments);return this.isValid()&&d.isValid()?d>this?this:d:k()});function $p(d,y){var S,R;if(y.length===1&&n(y[0])&&(y=y[0]),!y.length)return lt();for(S=y[0],R=1;R<y.length;++R)(!y[R].isValid()||y[R][d](S))&&(S=y[R]);return S}function gv(){var d=[].slice.call(arguments,0);return $p("isBefore",d)}function yv(){var d=[].slice.call(arguments,0);return $p("isAfter",d)}var vv=function(){return Date.now?Date.now():+new Date},Ho=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ts(d){var y,S=!1,R,I=Ho.length;for(y in d)if(s(d,y)&&!(kt.call(Ho,y)!==-1&&(d[y]==null||!isNaN(d[y]))))return!1;for(R=0;R<I;++R)if(d[Ho[R]]){if(S)return!1;parseFloat(d[Ho[R]])!==Fe(d[Ho[R]])&&(S=!0)}return!0}function bv(){return this._isValid}function Sv(){return ut(NaN)}function As(d){var y=_r(d),S=y.year||0,R=y.quarter||0,I=y.month||0,L=y.week||y.isoWeek||0,Y=y.day||0,ae=y.hour||0,_e=y.minute||0,Le=y.second||0,Vt=y.millisecond||0;this._isValid=Ts(y),this._milliseconds=+Vt+Le*1e3+_e*6e4+ae*1e3*60*60,this._days=+Y+L*7,this._months=+I+R*3+S*12,this._data={},this._locale=Un(),this._bubble()}function Bo(d){return d instanceof As}function vn(d){return d<0?Math.round(-1*d)*-1:Math.round(d)}function Sl(d,y,S){var R=Math.min(d.length,y.length),I=Math.abs(d.length-y.length),L=0,Y;for(Y=0;Y<R;Y++)(S&&d[Y]!==y[Y]||!S&&Fe(d[Y])!==Fe(y[Y]))&&L++;return L+I}function Np(d,y){ce(d,0,0,function(){var S=this.utcOffset(),R="+";return S<0&&(S=-S,R="-"),R+de(~~(S/60),2)+y+de(~~S%60,2)})}Np("Z",":"),Np("ZZ",""),fe("Z",il),fe("ZZ",il),it(["Z","ZZ"],function(d,y,S){S._useUTC=!0,S._tzm=Ec(il,d)});var wv=/([\+\-]|\d\d)/gi;function Ec(d,y){var S=(y||"").match(d),R,I,L;return S===null?null:(R=S[S.length-1]||[],I=(R+"").match(wv)||["-",0,0],L=+(I[1]*60)+Fe(I[2]),L===0?0:I[0]==="+"?L:-L)}function Si(d,y){var S,R;return y._isUTC?(S=y.clone(),R=(G(d)||c(d)?d.valueOf():lt(d).valueOf())-S.valueOf(),S._d.setTime(S._d.valueOf()+R),e.updateOffset(S,!1),S):lt(d).local()}function Er(d){return-Math.round(d._d.getTimezoneOffset())}e.updateOffset=function(){};function Mp(d,y,S){var R=this._offset||0,I;if(!this.isValid())return d!=null?this:NaN;if(d!=null){if(typeof d=="string"){if(d=Ec(il,d),d===null)return this}else Math.abs(d)<16&&!S&&(d=d*60);return!this._isUTC&&y&&(I=Er(this)),this._offset=d,this._isUTC=!0,I!=null&&this.add(I,"m"),R!==d&&(!y||this._changeInProgress?Vo(this,ut(d-R,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?R:Er(this)}function _v(d,y){return d!=null?(typeof d!="string"&&(d=-d),this.utcOffset(d,y),this):-this.utcOffset()}function Rv(d){return this.utcOffset(0,d)}function Cv(d){return this._isUTC&&(this.utcOffset(0,d),this._isUTC=!1,d&&this.subtract(Er(this),"m")),this}function xv(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var d=Ec(oc,this._i);d!=null?this.utcOffset(d):this.utcOffset(0,!0)}return this}function Ev(d){return this.isValid()?(d=d?lt(d).utcOffset():0,(this.utcOffset()-d)%60===0):!1}function wi(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function V(){if(!l(this._isDSTShifted))return this._isDSTShifted;var d={},y;return $(d,this),d=xc(d),d._a?(y=d._isUTC?g(d._a):lt(d._a),this._isDSTShifted=this.isValid()&&Sl(d._a,y.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Q(){return this.isValid()?!this._isUTC:!1}function z(){return this.isValid()?this._isUTC:!1}function ue(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Re=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,tt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function ut(d,y){var S=d,R=null,I,L,Y;return Bo(d)?S={ms:d._milliseconds,d:d._days,M:d._months}:f(d)||!isNaN(+d)?(S={},y?S[y]=+d:S.milliseconds=+d):(R=Re.exec(d))?(I=R[1]==="-"?-1:1,S={y:0,d:Fe(R[gn])*I,h:Fe(R[Lt])*I,m:Fe(R[Fr])*I,s:Fe(R[Ln])*I,ms:Fe(vn(R[Hi]*1e3))*I}):(R=tt.exec(d))?(I=R[1]==="-"?-1:1,S={y:ze(R[2],I),M:ze(R[3],I),w:ze(R[4],I),d:ze(R[5],I),h:ze(R[6],I),m:ze(R[7],I),s:ze(R[8],I)}):S==null?S={}:typeof S=="object"&&("from"in S||"to"in S)&&(Y=Iv(lt(S.from),lt(S.to)),S={},S.ms=Y.milliseconds,S.M=Y.months),L=new As(S),Bo(d)&&s(d,"_locale")&&(L._locale=d._locale),Bo(d)&&s(d,"_isValid")&&(L._isValid=d._isValid),L}ut.fn=As.prototype,ut.invalid=Sv;function ze(d,y){var S=d&&parseFloat(d.replace(",","."));return(isNaN(S)?0:S)*y}function wl(d,y){var S={};return S.months=y.month()-d.month()+(y.year()-d.year())*12,d.clone().add(S.months,"M").isAfter(y)&&--S.months,S.milliseconds=+y-+d.clone().add(S.months,"M"),S}function Iv(d,y){var S;return d.isValid()&&y.isValid()?(y=Si(y,d),d.isBefore(y)?S=wl(d,y):(S=wl(y,d),S.milliseconds=-S.milliseconds,S.months=-S.months),S):{milliseconds:0,months:0}}function Ir(d,y){return function(S,R){var I,L;return R!==null&&!isNaN(+R)&&(D(y,"moment()."+y+"(period, number) is deprecated. Please use moment()."+y+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),L=S,S=R,R=L),I=ut(S,R),Vo(this,I,d),this}}function Vo(d,y,S,R){var I=y._milliseconds,L=vn(y._days),Y=vn(y._months);d.isValid()&&(R=R??!0,Y&&dc(d,Mo(d,"Month")+Y*S),L&&Fo(d,"Date",Mo(d,"Date")+L*S),I&&d._d.setTime(d._d.valueOf()+I*S),R&&e.updateOffset(d,L||Y))}var Ov=Ir(1,"add"),$s=Ir(-1,"subtract");function Wo(d){return typeof d=="string"||d instanceof String}function _l(d){return G(d)||c(d)||Wo(d)||f(d)||qv(d)||ot(d)||d===null||d===void 0}function ot(d){var y=i(d)&&!o(d),S=!1,R=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],I,L,Y=R.length;for(I=0;I<Y;I+=1)L=R[I],S=S||s(d,L);return y&&S}function qv(d){var y=n(d),S=!1;return y&&(S=d.filter(function(R){return!f(R)&&Wo(d)}).length===0),y&&S}function Fp(d){var y=i(d)&&!o(d),S=!1,R=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],I,L;for(I=0;I<R.length;I+=1)L=R[I],S=S||s(d,L);return y&&S}function Rl(d,y){var S=d.diff(y,"days",!0);return S<-6?"sameElse":S<-1?"lastWeek":S<0?"lastDay":S<1?"sameDay":S<2?"nextDay":S<7?"nextWeek":"sameElse"}function kv(d,y){arguments.length===1&&(arguments[0]?_l(arguments[0])?(d=arguments[0],y=void 0):Fp(arguments[0])&&(y=arguments[0],d=void 0):(d=void 0,y=void 0));var S=d||lt(),R=Si(S,this).startOf("day"),I=e.calendarFormat(this,R)||"sameElse",L=y&&(B(y[I])?y[I].call(this,S):y[I]);return this.format(L||this.localeData().calendar(I,this,lt(S)))}function Pv(){return new j(this)}function Tv(d,y){var S=G(d)?d:lt(d);return this.isValid()&&S.isValid()?(y=tr(y)||"millisecond",y==="millisecond"?this.valueOf()>S.valueOf():S.valueOf()<this.clone().startOf(y).valueOf()):!1}function Cl(d,y){var S=G(d)?d:lt(d);return this.isValid()&&S.isValid()?(y=tr(y)||"millisecond",y==="millisecond"?this.valueOf()<S.valueOf():this.clone().endOf(y).valueOf()<S.valueOf()):!1}function _i(d,y,S,R){var I=G(d)?d:lt(d),L=G(y)?y:lt(y);return this.isValid()&&I.isValid()&&L.isValid()?(R=R||"()",(R[0]==="("?this.isAfter(I,S):!this.isBefore(I,S))&&(R[1]===")"?this.isBefore(L,S):!this.isAfter(L,S))):!1}function xl(d,y){var S=G(d)?d:lt(d),R;return this.isValid()&&S.isValid()?(y=tr(y)||"millisecond",y==="millisecond"?this.valueOf()===S.valueOf():(R=S.valueOf(),this.clone().startOf(y).valueOf()<=R&&R<=this.clone().endOf(y).valueOf())):!1}function Dp(d,y){return this.isSame(d,y)||this.isAfter(d,y)}function El(d,y){return this.isSame(d,y)||this.isBefore(d,y)}function Lp(d,y,S){var R,I,L;if(!this.isValid())return NaN;if(R=Si(d,this),!R.isValid())return NaN;switch(I=(R.utcOffset()-this.utcOffset())*6e4,y=tr(y),y){case"year":L=zo(this,R)/12;break;case"month":L=zo(this,R);break;case"quarter":L=zo(this,R)/3;break;case"second":L=(this-R)/1e3;break;case"minute":L=(this-R)/6e4;break;case"hour":L=(this-R)/36e5;break;case"day":L=(this-R-I)/864e5;break;case"week":L=(this-R-I)/6048e5;break;default:L=this-R}return S?L:Mr(L)}function zo(d,y){if(d.date()<y.date())return-zo(y,d);var S=(y.year()-d.year())*12+(y.month()-d.month()),R=d.clone().add(S,"months"),I,L;return y-R<0?(I=d.clone().add(S-1,"months"),L=(y-R)/(R-I)):(I=d.clone().add(S+1,"months"),L=(y-R)/(I-R)),-(S+L)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Il(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function jp(d){if(!this.isValid())return null;var y=d!==!0,S=y?this.clone().utc():this;return S.year()<0||S.year()>9999?nt(S,y?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):B(Date.prototype.toISOString)?y?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",nt(S,"Z")):nt(S,y?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Jo(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var d="moment",y="",S,R,I,L;return this.isLocal()||(d=this.utcOffset()===0?"moment.utc":"moment.parseZone",y="Z"),S="["+d+'("]',R=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",I="-MM-DD[T]HH:mm:ss.SSS",L=y+'[")]',this.format(S+R+I+L)}function zi(d){d||(d=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var y=nt(this,d);return this.localeData().postformat(y)}function Ol(d,y){return this.isValid()&&(G(d)&&d.isValid()||lt(d).isValid())?ut({to:this,from:d}).locale(this.locale()).humanize(!y):this.localeData().invalidDate()}function Av(d){return this.from(lt(),d)}function $v(d,y){return this.isValid()&&(G(d)&&d.isValid()||lt(d).isValid())?ut({from:this,to:d}).locale(this.locale()).humanize(!y):this.localeData().invalidDate()}function Nv(d){return this.to(lt(),d)}function Go(d){var y;return d===void 0?this._locale._abbr:(y=Un(d),y!=null&&(this._locale=y),this)}var Yo=C("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(d){return d===void 0?this.localeData():this.locale(d)});function ql(){return this._locale}var kl=1e3,Ji=60*kl,Pl=60*Ji,Up=(365*400+97)*24*Pl;function Ct(d,y){return(d%y+y)%y}function Yt(d,y,S){return d<100&&d>=0?new Date(d+400,y,S)-Up:new Date(d,y,S).valueOf()}function Hp(d,y,S){return d<100&&d>=0?Date.UTC(d+400,y,S)-Up:Date.UTC(d,y,S)}function Mv(d){var y,S;if(d=tr(d),d===void 0||d==="millisecond"||!this.isValid())return this;switch(S=this._isUTC?Hp:Yt,d){case"year":y=S(this.year(),0,1);break;case"quarter":y=S(this.year(),this.month()-this.month()%3,1);break;case"month":y=S(this.year(),this.month(),1);break;case"week":y=S(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":y=S(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":y=S(this.year(),this.month(),this.date());break;case"hour":y=this._d.valueOf(),y-=Ct(y+(this._isUTC?0:this.utcOffset()*Ji),Pl);break;case"minute":y=this._d.valueOf(),y-=Ct(y,Ji);break;case"second":y=this._d.valueOf(),y-=Ct(y,kl);break}return this._d.setTime(y),e.updateOffset(this,!0),this}function Bp(d){var y,S;if(d=tr(d),d===void 0||d==="millisecond"||!this.isValid())return this;switch(S=this._isUTC?Hp:Yt,d){case"year":y=S(this.year()+1,0,1)-1;break;case"quarter":y=S(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":y=S(this.year(),this.month()+1,1)-1;break;case"week":y=S(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":y=S(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":y=S(this.year(),this.month(),this.date()+1)-1;break;case"hour":y=this._d.valueOf(),y+=Pl-Ct(y+(this._isUTC?0:this.utcOffset()*Ji),Pl)-1;break;case"minute":y=this._d.valueOf(),y+=Ji-Ct(y,Ji)-1;break;case"second":y=this._d.valueOf(),y+=kl-Ct(y,kl)-1;break}return this._d.setTime(y),e.updateOffset(this,!0),this}function Fv(){return this._d.valueOf()-(this._offset||0)*6e4}function Ic(){return Math.floor(this.valueOf()/1e3)}function Ko(){return new Date(this.valueOf())}function Oc(){var d=this;return[d.year(),d.month(),d.date(),d.hour(),d.minute(),d.second(),d.millisecond()]}function Ns(){var d=this;return{years:d.year(),months:d.month(),date:d.date(),hours:d.hours(),minutes:d.minutes(),seconds:d.seconds(),milliseconds:d.milliseconds()}}function Qo(){return this.isValid()?this.toISOString():null}function Zo(){return E(this)}function Tl(){return h({},_(this))}function Ms(){return _(this).overflow}function Dv(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}ce("N",0,0,"eraAbbr"),ce("NN",0,0,"eraAbbr"),ce("NNN",0,0,"eraAbbr"),ce("NNNN",0,0,"eraName"),ce("NNNNN",0,0,"eraNarrow"),ce("y",["y",1],"yo","eraYear"),ce("y",["yy",2],0,"eraYear"),ce("y",["yyy",3],0,"eraYear"),ce("y",["yyyy",4],0,"eraYear"),fe("N",fr),fe("NN",fr),fe("NNN",fr),fe("NNNN",De),fe("NNNNN",Bv),it(["N","NN","NNN","NNNN","NNNNN"],function(d,y,S,R){var I=S._locale.erasParse(d,R,S._strict);I?_(S).era=I:_(S).invalidEra=d}),fe("y",yi),fe("yy",yi),fe("yyy",yi),fe("yyyy",yi),fe("yo",Vv),it(["y","yy","yyy","yyyy"],rr),it(["yo"],function(d,y,S,R){var I;S._locale._eraYearOrdinalRegex&&(I=d.match(S._locale._eraYearOrdinalRegex)),S._locale.eraYearOrdinalParse?y[rr]=S._locale.eraYearOrdinalParse(d,I):y[rr]=parseInt(d,10)});function Lv(d,y){var S,R,I,L=this._eras||Un("en")._eras;for(S=0,R=L.length;S<R;++S)switch(typeof L[S].since==="string"&&(I=e(L[S].since).startOf("day"),L[S].since=I.valueOf()),typeof L[S].until){case"undefined":L[S].until=1/0;break;case"string":I=e(L[S].until).startOf("day").valueOf(),L[S].until=I.valueOf();break}return L}function jv(d,y,S){var R,I,L=this.eras(),Y,ae,_e;for(d=d.toUpperCase(),R=0,I=L.length;R<I;++R)if(Y=L[R].name.toUpperCase(),ae=L[R].abbr.toUpperCase(),_e=L[R].narrow.toUpperCase(),S)switch(y){case"N":case"NN":case"NNN":if(ae===d)return L[R];break;case"NNNN":if(Y===d)return L[R];break;case"NNNNN":if(_e===d)return L[R];break}else if([Y,ae,_e].indexOf(d)>=0)return L[R]}function Uv(d,y){var S=d.since<=d.until?1:-1;return y===void 0?e(d.since).year():e(d.since).year()+(y-d.offset)*S}function Hv(){var d,y,S,R=this.localeData().eras();for(d=0,y=R.length;d<y;++d)if(S=this.clone().startOf("day").valueOf(),R[d].since<=S&&S<=R[d].until||R[d].until<=S&&S<=R[d].since)return R[d].name;return""}function Al(){var d,y,S,R=this.localeData().eras();for(d=0,y=R.length;d<y;++d)if(S=this.clone().startOf("day").valueOf(),R[d].since<=S&&S<=R[d].until||R[d].until<=S&&S<=R[d].since)return R[d].narrow;return""}function Xo(){var d,y,S,R=this.localeData().eras();for(d=0,y=R.length;d<y;++d)if(S=this.clone().startOf("day").valueOf(),R[d].since<=S&&S<=R[d].until||R[d].until<=S&&S<=R[d].since)return R[d].abbr;return""}function Vp(){var d,y,S,R,I=this.localeData().eras();for(d=0,y=I.length;d<y;++d)if(S=I[d].since<=I[d].until?1:-1,R=this.clone().startOf("day").valueOf(),I[d].since<=R&&R<=I[d].until||I[d].until<=R&&R<=I[d].since)return(this.year()-e(I[d].since).year())*S+I[d].offset;return this.year()}function O(d){return s(this,"_erasNameRegex")||qc.call(this),d?this._erasNameRegex:this._erasRegex}function Fs(d){return s(this,"_erasAbbrRegex")||qc.call(this),d?this._erasAbbrRegex:this._erasRegex}function $l(d){return s(this,"_erasNarrowRegex")||qc.call(this),d?this._erasNarrowRegex:this._erasRegex}function fr(d,y){return y.erasAbbrRegex(d)}function De(d,y){return y.erasNameRegex(d)}function Bv(d,y){return y.erasNarrowRegex(d)}function Vv(d,y){return y._eraYearOrdinalRegex||yi}function qc(){var d=[],y=[],S=[],R=[],I,L,Y,ae,_e,Le=this.eras();for(I=0,L=Le.length;I<L;++I)Y=mn(Le[I].name),ae=mn(Le[I].abbr),_e=mn(Le[I].narrow),y.push(Y),d.push(ae),S.push(_e),R.push(Y),R.push(ae),R.push(_e);this._erasRegex=new RegExp("^("+R.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+y.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+d.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+S.join("|")+")","i")}ce(0,["gg",2],0,function(){return this.weekYear()%100}),ce(0,["GG",2],0,function(){return this.isoWeekYear()%100});function bn(d,y){ce(0,[d,d.length],0,y)}bn("gggg","weekYear"),bn("ggggg","weekYear"),bn("GGGG","isoWeekYear"),bn("GGGGG","isoWeekYear"),fe("G",Es),fe("g",Es),fe("GG",pt,Gt),fe("gg",pt,Gt),fe("GGGG",To,ji),fe("gggg",To,ji),fe("GGGGG",xs,Fn),fe("ggggg",xs,Fn),$o(["gggg","ggggg","GGGG","GGGGG"],function(d,y,S,R){y[R.substr(0,2)]=Fe(d)}),$o(["gg","GG"],function(d,y,S,R){y[R]=e.parseTwoDigitYear(d)});function Wv(d){return Wp.call(this,d,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function zv(d){return Wp.call(this,d,this.isoWeek(),this.isoWeekday(),1,4)}function Jv(){return yn(this.year(),1,4)}function Gv(){return yn(this.isoWeekYear(),1,4)}function Yv(){var d=this.localeData()._week;return yn(this.year(),d.dow,d.doy)}function Hn(){var d=this.localeData()._week;return yn(this.weekYear(),d.dow,d.doy)}function Wp(d,y,S,R,I){var L;return d==null?Lo(this,R,I).year:(L=yn(d,R,I),y>L&&(y=L),Kv.call(this,d,y,S,R,I))}function Kv(d,y,S,R,I){var L=fl(d,y,S,R,I),Y=Os(L.year,0,L.dayOfYear);return this.year(Y.getUTCFullYear()),this.month(Y.getUTCMonth()),this.date(Y.getUTCDate()),this}ce("Q",0,"Qo","quarter"),fe("Q",up),it("Q",function(d,y){y[Dn]=(Fe(d)-1)*3});function Qv(d){return d==null?Math.ceil((this.month()+1)/3):this.month((d-1)*3+this.month()%3)}ce("D",["DD",2],"Do","date"),fe("D",pt,Ui),fe("DD",pt,Gt),fe("Do",function(d,y){return d?y._dayOfMonthOrdinalParse||y._ordinalParse:y._dayOfMonthOrdinalParseLenient}),it(["D","DD"],gn),it("Do",function(d,y){y[gn]=Fe(d.match(pt)[0])});var zp=Is("Date",!0);ce("DDD",["DDDD",3],"DDDo","dayOfYear"),fe("DDD",Cs),fe("DDDD",cp),it(["DDD","DDDD"],function(d,y,S){S._dayOfYear=Fe(d)});function Zv(d){var y=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return d==null?y:this.add(d-y,"d")}ce("m",["mm",2],0,"minute"),fe("m",pt,sl),fe("mm",pt,Gt),it(["m","mm"],Fr);var Bn=Is("Minutes",!1);ce("s",["ss",2],0,"second"),fe("s",pt,sl),fe("ss",pt,Gt),it(["s","ss"],Ln);var Xv=Is("Seconds",!1);ce("S",0,0,function(){return~~(this.millisecond()/100)}),ce(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),ce(0,["SSS",3],0,"millisecond"),ce(0,["SSSS",4],0,function(){return this.millisecond()*10}),ce(0,["SSSSS",5],0,function(){return this.millisecond()*100}),ce(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),ce(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),ce(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),ce(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),fe("S",Cs,up),fe("SS",Cs,Gt),fe("SSS",Cs,cp);var Ri,Jp;for(Ri="SSSS";Ri.length<=9;Ri+="S")fe(Ri,yi);function eb(d,y){y[Hi]=Fe(("0."+d)*1e3)}for(Ri="S";Ri.length<=9;Ri+="S")it(Ri,eb);Jp=Is("Milliseconds",!1),ce("z",0,0,"zoneAbbr"),ce("zz",0,0,"zoneName");function tb(){return this._isUTC?"UTC":""}function Gi(){return this._isUTC?"Coordinated Universal Time":""}var re=j.prototype;re.add=Ov,re.calendar=kv,re.clone=Pv,re.diff=Lp,re.endOf=Bp,re.format=zi,re.from=Ol,re.fromNow=Av,re.to=$v,re.toNow=Nv,re.get=jy,re.invalidAt=Ms,re.isAfter=Tv,re.isBefore=Cl,re.isBetween=_i,re.isSame=xl,re.isSameOrAfter=Dp,re.isSameOrBefore=El,re.isValid=Zo,re.lang=Yo,re.locale=Go,re.localeData=ql,re.max=Ap,re.min=Tp,re.parsingFlags=Tl,re.set=ll,re.startOf=Mv,re.subtract=$s,re.toArray=Oc,re.toObject=Ns,re.toDate=Ko,re.toISOString=jp,re.inspect=Jo,typeof Symbol<"u"&&Symbol.for!=null&&(re[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),re.toJSON=Qo,re.toString=Il,re.unix=Ic,re.valueOf=Fv,re.creationData=Dv,re.eraName=Hv,re.eraNarrow=Al,re.eraAbbr=Xo,re.eraYear=Vp,re.year=dp,re.isLeapYear=Ly,re.weekYear=Wv,re.isoWeekYear=zv,re.quarter=re.quarters=Qv,re.month=ul,re.daysInMonth=zy,re.week=re.weeks=vp,re.isoWeek=re.isoWeeks=Gy,re.weeksInYear=Yv,re.weeksInWeekYear=Hn,re.isoWeeksInYear=Jv,re.isoWeeksInISOWeekYear=Gv,re.date=zp,re.day=re.days=rv,re.weekday=nv,re.isoWeekday=iv,re.dayOfYear=Zv,re.hour=re.hours=lv,re.minute=re.minutes=Bn,re.second=re.seconds=Xv,re.millisecond=re.milliseconds=Jp,re.utcOffset=Mp,re.utc=Rv,re.local=Cv,re.parseZone=xv,re.hasAlignedHourOffset=Ev,re.isDST=wi,re.isLocal=Q,re.isUtcOffset=z,re.isUtc=ue,re.isUTC=ue,re.zoneAbbr=tb,re.zoneName=Gi,re.dates=C("dates accessor is deprecated. Use date instead.",zp),re.months=C("months accessor is deprecated. Use month instead",ul),re.years=C("years accessor is deprecated. Use year instead",dp),re.zone=C("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",_v),re.isDSTShifted=C("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",V);function rb(d){return lt(d*1e3)}function tn(){return lt.apply(null,arguments).parseZone()}function Gp(d){return d}var Ye=ee.prototype;Ye.calendar=ke,Ye.longDateFormat=_t,Ye.invalidDate=hn,Ye.ordinal=ko,Ye.preparse=Gp,Ye.postformat=Gp,Ye.relativeTime=Mn,Ye.pastFuture=ap,Ye.set=F,Ye.eras=Lv,Ye.erasParse=jv,Ye.erasConvertYear=Uv,Ye.erasAbbrRegex=Fs,Ye.erasNameRegex=O,Ye.erasNarrowRegex=$l,Ye.months=Vy,Ye.monthsShort=Wy,Ye.monthsParse=mp,Ye.monthsRegex=cl,Ye.monthsShortRegex=gp,Ye.week=hc,Ye.firstDayOfYear=yp,Ye.firstDayOfWeek=qs,Ye.weekdays=Zy,Ye.weekdaysMin=ev,Ye.weekdaysShort=Xy,Ye.weekdaysParse=tv,Ye.weekdaysRegex=sv,Ye.weekdaysShortRegex=bt,Ye.weekdaysMinRegex=gt,Ye.isPM=av,Ye.meridiem=Bt;function Nl(d,y,S,R){var I=Un(),L=g().set(R,y);return I[S](L,d)}function Yp(d,y,S){if(f(d)&&(y=d,d=void 0),d=d||"",y!=null)return Nl(d,y,S,"month");var R,I=[];for(R=0;R<12;R++)I[R]=Nl(d,R,S,"month");return I}function kc(d,y,S,R){typeof d=="boolean"?(f(y)&&(S=y,y=void 0),y=y||""):(y=d,S=y,d=!1,f(y)&&(S=y,y=void 0),y=y||"");var I=Un(),L=d?I._week.dow:0,Y,ae=[];if(S!=null)return Nl(y,(S+L)%7,R,"day");for(Y=0;Y<7;Y++)ae[Y]=Nl(y,(Y+L)%7,R,"day");return ae}function Kp(d,y){return Yp(d,y,"months")}function Qp(d,y){return Yp(d,y,"monthsShort")}function nb(d,y,S){return kc(d,y,S,"weekdays")}function ib(d,y,S){return kc(d,y,S,"weekdaysShort")}function Pc(d,y,S){return kc(d,y,S,"weekdaysMin")}jn("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(d){var y=d%10,S=Fe(d%100/10)===1?"th":y===1?"st":y===2?"nd":y===3?"rd":"th";return d+S}}),e.lang=C("moment.lang is deprecated. Use moment.locale instead.",jn),e.langData=C("moment.langData is deprecated. Use moment.localeData instead.",Un);var Or=Math.abs;function Ml(){var d=this._data;return this._milliseconds=Or(this._milliseconds),this._days=Or(this._days),this._months=Or(this._months),d.milliseconds=Or(d.milliseconds),d.seconds=Or(d.seconds),d.minutes=Or(d.minutes),d.hours=Or(d.hours),d.months=Or(d.months),d.years=Or(d.years),this}function Zp(d,y,S,R){var I=ut(y,S);return d._milliseconds+=R*I._milliseconds,d._days+=R*I._days,d._months+=R*I._months,d._bubble()}function Xp(d,y){return Zp(this,d,y,1)}function sb(d,y){return Zp(this,d,y,-1)}function rn(d){return d<0?Math.floor(d):Math.ceil(d)}function Tc(){var d=this._milliseconds,y=this._days,S=this._months,R=this._data,I,L,Y,ae,_e;return d>=0&&y>=0&&S>=0||d<=0&&y<=0&&S<=0||(d+=rn(dr(S)+y)*864e5,y=0,S=0),R.milliseconds=d%1e3,I=Mr(d/1e3),R.seconds=I%60,L=Mr(I/60),R.minutes=L%60,Y=Mr(L/60),R.hours=Y%24,y+=Mr(Y/24),_e=Mr(Ci(y)),S+=_e,y-=rn(dr(_e)),ae=Mr(S/12),S%=12,R.days=y,R.months=S,R.years=ae,this}function Ci(d){return d*4800/146097}function dr(d){return d*146097/4800}function ob(d){if(!this.isValid())return NaN;var y,S,R=this._milliseconds;if(d=tr(d),d==="month"||d==="quarter"||d==="year")switch(y=this._days+R/864e5,S=this._months+Ci(y),d){case"month":return S;case"quarter":return S/3;case"year":return S/12}else switch(y=this._days+Math.round(dr(this._months)),d){case"week":return y/7+R/6048e5;case"day":return y+R/864e5;case"hour":return y*24+R/36e5;case"minute":return y*1440+R/6e4;case"second":return y*86400+R/1e3;case"millisecond":return Math.floor(y*864e5)+R;default:throw new Error("Unknown unit "+d)}}function Sn(d){return function(){return this.as(d)}}var Ac=Sn("ms"),ea=Sn("s"),xi=Sn("m"),eh=Sn("h"),ab=Sn("d"),Fl=Sn("w"),lb=Sn("M"),th=Sn("Q"),Kt=Sn("y"),$c=Ac;function rh(){return ut(this)}function wn(d){return d=tr(d),this.isValid()?this[d+"s"]():NaN}function Vn(d){return function(){return this.isValid()?this._data[d]:NaN}}var Dl=Vn("milliseconds"),Yi=Vn("seconds"),nh=Vn("minutes"),sr=Vn("hours"),Nc=Vn("days"),ub=Vn("months"),cb=Vn("years");function fb(){return Mr(this.days()/7)}var nn=Math.round,Ds={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function ta(d,y,S,R,I){return I.relativeTime(y||1,!!S,d,R)}function ih(d,y,S,R){var I=ut(d).abs(),L=nn(I.as("s")),Y=nn(I.as("m")),ae=nn(I.as("h")),_e=nn(I.as("d")),Le=nn(I.as("M")),Vt=nn(I.as("w")),Wn=nn(I.as("y")),zn=L<=S.ss&&["s",L]||L<S.s&&["ss",L]||Y<=1&&["m"]||Y<S.m&&["mm",Y]||ae<=1&&["h"]||ae<S.h&&["hh",ae]||_e<=1&&["d"]||_e<S.d&&["dd",_e];return S.w!=null&&(zn=zn||Vt<=1&&["w"]||Vt<S.w&&["ww",Vt]),zn=zn||Le<=1&&["M"]||Le<S.M&&["MM",Le]||Wn<=1&&["y"]||["yy",Wn],zn[2]=y,zn[3]=+d>0,zn[4]=R,ta.apply(null,zn)}function db(d){return d===void 0?nn:typeof d=="function"?(nn=d,!0):!1}function pb(d,y){return Ds[d]===void 0?!1:y===void 0?Ds[d]:(Ds[d]=y,d==="s"&&(Ds.ss=y-1),!0)}function ra(d,y){if(!this.isValid())return this.localeData().invalidDate();var S=!1,R=Ds,I,L;return typeof d=="object"&&(y=d,d=!1),typeof d=="boolean"&&(S=d),typeof y=="object"&&(R=Object.assign({},Ds,y),y.s!=null&&y.ss==null&&(R.ss=y.s-1)),I=this.localeData(),L=ih(this,!S,R,I),S&&(L=I.pastFuture(+this,L)),I.postformat(L)}var Mc=Math.abs;function Ls(d){return(d>0)-(d<0)||+d}function js(){if(!this.isValid())return this.localeData().invalidDate();var d=Mc(this._milliseconds)/1e3,y=Mc(this._days),S=Mc(this._months),R,I,L,Y,ae=this.asSeconds(),_e,Le,Vt,Wn;return ae?(R=Mr(d/60),I=Mr(R/60),d%=60,R%=60,L=Mr(S/12),S%=12,Y=d?d.toFixed(3).replace(/\.?0+$/,""):"",_e=ae<0?"-":"",Le=Ls(this._months)!==Ls(ae)?"-":"",Vt=Ls(this._days)!==Ls(ae)?"-":"",Wn=Ls(this._milliseconds)!==Ls(ae)?"-":"",_e+"P"+(L?Le+L+"Y":"")+(S?Le+S+"M":"")+(y?Vt+y+"D":"")+(I||R||d?"T":"")+(I?Wn+I+"H":"")+(R?Wn+R+"M":"")+(d?Wn+Y+"S":"")):"P0D"}var He=As.prototype;He.isValid=bv,He.abs=Ml,He.add=Xp,He.subtract=sb,He.as=ob,He.asMilliseconds=Ac,He.asSeconds=ea,He.asMinutes=xi,He.asHours=eh,He.asDays=ab,He.asWeeks=Fl,He.asMonths=lb,He.asQuarters=th,He.asYears=Kt,He.valueOf=$c,He._bubble=Tc,He.clone=rh,He.get=wn,He.milliseconds=Dl,He.seconds=Yi,He.minutes=nh,He.hours=sr,He.days=Nc,He.weeks=fb,He.months=ub,He.years=cb,He.humanize=ra,He.toISOString=js,He.toString=js,He.toJSON=js,He.locale=Go,He.localeData=ql,He.toIsoString=C("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",js),He.lang=Yo,ce("X",0,0,"unix"),ce("x",0,0,"valueOf"),fe("x",Es),fe("X",Ny),it("X",function(d,y,S){S._d=new Date(parseFloat(d)*1e3)}),it("x",function(d,y,S){S._d=new Date(Fe(d))});return e.version="2.30.1",r(lt),e.fn=re,e.min=gv,e.max=yv,e.now=vv,e.utc=g,e.unix=rb,e.months=Kp,e.isDate=c,e.locale=jn,e.invalid=k,e.duration=ut,e.isMoment=G,e.weekdays=nb,e.parseZone=tn,e.localeData=Un,e.isDuration=Bo,e.monthsShort=Qp,e.weekdaysMin=Pc,e.defineLocale=hl,e.updateLocale=Rr,e.locales=Cr,e.weekdaysShort=ib,e.normalizeUnits=tr,e.relativeTimeRounding=db,e.relativeTimeThreshold=pb,e.calendarFormat=Rl,e.prototype=re,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 SI=H((bI,Mh)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof Mh<"u"&&Mh.exports?Mh.exports=e():t.tv4=e()})(bI,function(){Object.keys||(Object.keys=(function(){var q=Object.prototype.hasOwnProperty,C=!{toString:null}.propertyIsEnumerable("toString"),A=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],D=A.length;return function(B){if(typeof B!="object"&&typeof B!="function"||B===null)throw new TypeError("Object.keys called on non-object");var F=[];for(var K in B)q.call(B,K)&&F.push(K);if(C)for(var ee=0;ee<D;ee++)q.call(B,A[ee])&&F.push(A[ee]);return F}})()),Object.create||(Object.create=(function(){function q(){}return function(C){if(arguments.length!==1)throw new Error("Object.create implementation only accepts one parameter.");return q.prototype=C,new q}})()),Array.isArray||(Array.isArray=function(q){return Object.prototype.toString.call(q)==="[object Array]"}),Array.prototype.indexOf||(Array.prototype.indexOf=function(q){if(this===null)throw new TypeError;var C=Object(this),A=C.length>>>0;if(A===0)return-1;var D=0;if(arguments.length>1&&(D=Number(arguments[1]),D!==D?D=0:D!==0&&D!==1/0&&D!==-1/0&&(D=(D>0||-1)*Math.floor(Math.abs(D)))),D>=A)return-1;for(var B=D>=0?D:Math.max(A-Math.abs(D),0);B<A;B++)if(B in C&&C[B]===q)return B;return-1}),Object.isFrozen||(Object.isFrozen=function(q){for(var C="tv4_test_frozen_key";q.hasOwnProperty(C);)C+=Math.random();try{return q[C]=!0,delete q[C],!1}catch{return!0}});var t={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},e={"*":!0};function r(q){return encodeURI(q).replace(/%25[0-9][0-9]/g,function(C){return"%"+C.substring(3)})}function n(q){var C="";t[q.charAt(0)]&&(C=q.charAt(0),q=q.substring(1));var A="",D="",B=!0,F=!1,K=!1;C==="+"?B=!1:C==="."?(D=".",A="."):C==="/"?(D="/",A="/"):C==="#"?(D="#",B=!1):C===";"?(D=";",A=";",F=!0,K=!0):C==="?"?(D="?",A="&",F=!0):C==="&"&&(D="&",A="&",F=!0);for(var ee=[],ie=q.split(","),pe=[],ke={},de=0;de<ie.length;de++){var le=ie[de],ve=null;if(le.indexOf(":")!==-1){var We=le.split(":");le=We[0],ve=parseInt(We[1],10)}for(var mt={};e[le.charAt(le.length-1)];)mt[le.charAt(le.length-1)]=!0,le=le.substring(0,le.length-1);var ce={truncate:ve,name:le,suffices:mt};pe.push(ce),ke[le]=ce,ee.push(le)}var ir=function($e){for(var nt="",en=0,Nr=0;Nr<pe.length;Nr++){var _t=pe[Nr],Rt=$e(_t.name);if(Rt==null||Array.isArray(Rt)&&Rt.length===0||typeof Rt=="object"&&Object.keys(Rt).length===0){en++;continue}if(Nr===en?nt+=D:nt+=A||",",Array.isArray(Rt)){F&&(nt+=_t.name+"=");for(var hn=0;hn<Rt.length;hn++)hn>0&&(nt+=_t.suffices["*"]&&A||",",_t.suffices["*"]&&F&&(nt+=_t.name+"=")),nt+=B?encodeURIComponent(Rt[hn]).replace(/!/g,"%21"):r(Rt[hn])}else if(typeof Rt=="object"){F&&!_t.suffices["*"]&&(nt+=_t.name+"=");var qo=!0;for(var er in Rt)qo||(nt+=_t.suffices["*"]&&A||","),qo=!1,nt+=B?encodeURIComponent(er).replace(/!/g,"%21"):r(er),nt+=_t.suffices["*"]?"=":",",nt+=B?encodeURIComponent(Rt[er]).replace(/!/g,"%21"):r(Rt[er])}else F&&(nt+=_t.name,(!K||Rt!=="")&&(nt+="=")),_t.truncate!=null&&(Rt=Rt.substring(0,_t.truncate)),nt+=B?encodeURIComponent(Rt).replace(/!/g,"%21"):r(Rt)}return nt};return ir.varNames=ee,{prefix:D,substitution:ir}}function i(q){if(!(this instanceof i))return new i(q);for(var C=q.split("{"),A=[C.shift()],D=[],B=[],F=[];C.length>0;){var K=C.shift(),ee=K.split("}")[0],ie=K.substring(ee.length+1),pe=n(ee);B.push(pe.substitution),D.push(pe.prefix),A.push(ie),F=F.concat(pe.substitution.varNames)}this.fill=function(ke){for(var de=A[0],le=0;le<B.length;le++){var ve=B[le];de+=ve(ke),de+=A[le+1]}return de},this.varNames=F,this.template=q}i.prototype={toString:function(){return this.template},fillFromObject:function(q){return this.fill(function(C){return q[C]})}};var s=function(C,A,D,B,F){if(this.missing=[],this.missingMap={},this.formatValidators=C?Object.create(C.formatValidators):{},this.schemas=C?Object.create(C.schemas):{},this.collectMultiple=A,this.errors=[],this.handleError=A?this.collectError:this.returnError,B&&(this.checkRecursive=!0,this.scanned=[],this.scannedFrozen=[],this.scannedFrozenSchemas=[],this.scannedFrozenValidationErrors=[],this.validatedSchemasKey="tv4_validation_id",this.validationErrorsKey="tv4_validation_errors_id"),F&&(this.trackUnknownProperties=!0,this.knownPropertyPaths={},this.unknownPropertyPaths={}),this.errorReporter=D||v("en"),typeof this.errorReporter=="string")throw new Error("debug");if(this.definedKeywords={},C)for(var K in C.definedKeywords)this.definedKeywords[K]=C.definedKeywords[K].slice(0)};s.prototype.defineKeyword=function(q,C){this.definedKeywords[q]=this.definedKeywords[q]||[],this.definedKeywords[q].push(C)},s.prototype.createError=function(q,C,A,D,B,F,K){var ee=new T(q,C,A,D,B);return ee.message=this.errorReporter(ee,F,K),ee},s.prototype.returnError=function(q){return q},s.prototype.collectError=function(q){return q&&this.errors.push(q),null},s.prototype.prefixErrors=function(q,C,A){for(var D=q;D<this.errors.length;D++)this.errors[D]=this.errors[D].prefixWith(C,A);return this},s.prototype.banUnknownProperties=function(q,C){for(var A in this.unknownPropertyPaths){var D=this.createError(_.UNKNOWN_PROPERTY,{path:A},A,"",null,q,C),B=this.handleError(D);if(B)return B}return null},s.prototype.addFormat=function(q,C){if(typeof q=="object"){for(var A in q)this.addFormat(A,q[A]);return this}this.formatValidators[q]=C},s.prototype.resolveRefs=function(q,C){if(q.$ref!==void 0){if(C=C||{},C[q.$ref])return this.createError(_.CIRCULAR_REFERENCE,{urls:Object.keys(C).join(", ")},"","",null,void 0,q);C[q.$ref]=!0,q=this.getSchema(q.$ref,C)}return q},s.prototype.getSchema=function(q,C){var A;if(this.schemas[q]!==void 0)return A=this.schemas[q],this.resolveRefs(A,C);var D=q,B="";if(q.indexOf("#")!==-1&&(B=q.substring(q.indexOf("#")+1),D=q.substring(0,q.indexOf("#"))),typeof this.schemas[D]=="object"){A=this.schemas[D];var F=decodeURIComponent(B);if(F==="")return this.resolveRefs(A,C);if(F.charAt(0)!=="/")return;for(var K=F.split("/").slice(1),ee=0;ee<K.length;ee++){var ie=K[ee].replace(/~1/g,"/").replace(/~0/g,"~");if(A[ie]===void 0){A=void 0;break}A=A[ie]}if(A!==void 0)return this.resolveRefs(A,C)}this.missing[D]===void 0&&(this.missing.push(D),this.missing[D]=D,this.missingMap[D]=D)},s.prototype.searchSchemas=function(q,C){if(Array.isArray(q))for(var A=0;A<q.length;A++)this.searchSchemas(q[A],C);else if(q&&typeof q=="object"){typeof q.id=="string"&&N(C,q.id)&&this.schemas[q.id]===void 0&&(this.schemas[q.id]=q);for(var D in q)if(D!=="enum"){if(typeof q[D]=="object")this.searchSchemas(q[D],C);else if(D==="$ref"){var B=h(q[D]);B&&this.schemas[B]===void 0&&this.missingMap[B]===void 0&&(this.missingMap[B]=B)}}}},s.prototype.addSchema=function(q,C){if(typeof q!="string"||typeof C>"u")if(typeof q=="object"&&typeof q.id=="string")C=q,q=C.id;else return;q===h(q)+"#"&&(q=h(q)),this.schemas[q]=C,delete this.missingMap[q],g(C,q),this.searchSchemas(C,q)},s.prototype.getSchemaMap=function(){var q={};for(var C in this.schemas)q[C]=this.schemas[C];return q},s.prototype.getSchemaUris=function(q){var C=[];for(var A in this.schemas)(!q||q.test(A))&&C.push(A);return C},s.prototype.getMissingUris=function(q){var C=[];for(var A in this.missingMap)(!q||q.test(A))&&C.push(A);return C},s.prototype.dropSchemas=function(){this.schemas={},this.reset()},s.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},s.prototype.validateAll=function(q,C,A,D,B){var F;if(C=this.resolveRefs(C),C){if(C instanceof T)return this.errors.push(C),C}else return null;var K=this.errors.length,ee,ie=null,pe=null;if(this.checkRecursive&&q&&typeof q=="object"){if(F=!this.scanned.length,q[this.validatedSchemasKey]){var ke=q[this.validatedSchemasKey].indexOf(C);if(ke!==-1)return this.errors=this.errors.concat(q[this.validationErrorsKey][ke]),null}if(Object.isFrozen(q)&&(ee=this.scannedFrozen.indexOf(q),ee!==-1)){var de=this.scannedFrozenSchemas[ee].indexOf(C);if(de!==-1)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[ee][de]),null}if(this.scanned.push(q),Object.isFrozen(q))ee===-1&&(ee=this.scannedFrozen.length,this.scannedFrozen.push(q),this.scannedFrozenSchemas.push([])),ie=this.scannedFrozenSchemas[ee].length,this.scannedFrozenSchemas[ee][ie]=C,this.scannedFrozenValidationErrors[ee][ie]=[];else{if(!q[this.validatedSchemasKey])try{Object.defineProperty(q,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(q,this.validationErrorsKey,{value:[],configurable:!0})}catch{q[this.validatedSchemasKey]=[],q[this.validationErrorsKey]=[]}pe=q[this.validatedSchemasKey].length,q[this.validatedSchemasKey][pe]=C,q[this.validationErrorsKey][pe]=[]}}var le=this.errors.length,ve=this.validateBasic(q,C,B)||this.validateNumeric(q,C,B)||this.validateString(q,C,B)||this.validateArray(q,C,B)||this.validateObject(q,C,B)||this.validateCombinations(q,C,B)||this.validateHypermedia(q,C,B)||this.validateFormat(q,C,B)||this.validateDefinedKeywords(q,C,B)||null;if(F){for(;this.scanned.length;){var We=this.scanned.pop();delete We[this.validatedSchemasKey]}this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(ve||le!==this.errors.length)for(;A&&A.length||D&&D.length;){var mt=A&&A.length?""+A.pop():null,ce=D&&D.length?""+D.pop():null;ve&&(ve=ve.prefixWith(mt,ce)),this.prefixErrors(le,mt,ce)}return ie!==null?this.scannedFrozenValidationErrors[ee][ie]=this.errors.slice(K):pe!==null&&(q[this.validationErrorsKey][pe]=this.errors.slice(K)),this.handleError(ve)},s.prototype.validateFormat=function(q,C){if(typeof C.format!="string"||!this.formatValidators[C.format])return null;var A=this.formatValidators[C.format].call(null,q,C);return typeof A=="string"||typeof A=="number"?this.createError(_.FORMAT_CUSTOM,{message:A},"","/format",null,q,C):A&&typeof A=="object"?this.createError(_.FORMAT_CUSTOM,{message:A.message||"?"},A.dataPath||"",A.schemaPath||"/format",null,q,C):null},s.prototype.validateDefinedKeywords=function(q,C,A){for(var D in this.definedKeywords)if(!(typeof C[D]>"u"))for(var B=this.definedKeywords[D],F=0;F<B.length;F++){var K=B[F],ee=K(q,C[D],C,A);if(typeof ee=="string"||typeof ee=="number")return this.createError(_.KEYWORD_CUSTOM,{key:D,message:ee},"","",null,q,C).prefixWith(null,D);if(ee&&typeof ee=="object"){var ie=ee.code;if(typeof ie=="string"){if(!_[ie])throw new Error("Undefined error code (use defineError): "+ie);ie=_[ie]}else typeof ie!="number"&&(ie=_.KEYWORD_CUSTOM);var pe=typeof ee.message=="object"?ee.message:{key:D,message:ee.message||"?"},ke=ee.schemaPath||"/"+D.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(ie,pe,ee.dataPath||null,ke,null,q,C)}}return null};function o(q,C){if(q===C)return!0;if(q&&C&&typeof q=="object"&&typeof C=="object"){if(Array.isArray(q)!==Array.isArray(C))return!1;if(Array.isArray(q)){if(q.length!==C.length)return!1;for(var A=0;A<q.length;A++)if(!o(q[A],C[A]))return!1}else{var D;for(D in q)if(C[D]===void 0&&q[D]!==void 0)return!1;for(D in C)if(q[D]===void 0&&C[D]!==void 0)return!1;for(D in q)if(!o(q[D],C[D]))return!1}return!0}return!1}s.prototype.validateBasic=function(C,A,D){var B;return(B=this.validateType(C,A,D))||(B=this.validateEnum(C,A,D))?B.prefixWith(null,"type"):null},s.prototype.validateType=function(C,A){if(A.type===void 0)return null;var D=typeof C;C===null?D="null":Array.isArray(C)&&(D="array");var B=A.type;Array.isArray(B)||(B=[B]);for(var F=0;F<B.length;F++){var K=B[F];if(K===D||K==="integer"&&D==="number"&&C%1===0)return null}return this.createError(_.INVALID_TYPE,{type:D,expected:B.join("/")},"","",null,C,A)},s.prototype.validateEnum=function(C,A){if(A.enum===void 0)return null;for(var D=0;D<A.enum.length;D++){var B=A.enum[D];if(o(C,B))return null}return this.createError(_.ENUM_MISMATCH,{value:typeof JSON<"u"?JSON.stringify(C):C},"","",null,C,A)},s.prototype.validateNumeric=function(C,A,D){return this.validateMultipleOf(C,A,D)||this.validateMinMax(C,A,D)||this.validateNaN(C,A,D)||null};var l=Math.pow(2,-51),f=1-l;s.prototype.validateMultipleOf=function(C,A){var D=A.multipleOf||A.divisibleBy;if(D===void 0)return null;if(typeof C=="number"){var B=C/D%1;if(B>=l&&B<f)return this.createError(_.NUMBER_MULTIPLE_OF,{value:C,multipleOf:D},"","",null,C,A)}return null},s.prototype.validateMinMax=function(C,A){if(typeof C!="number")return null;if(A.minimum!==void 0){if(C<A.minimum)return this.createError(_.NUMBER_MINIMUM,{value:C,minimum:A.minimum},"","/minimum",null,C,A);if(A.exclusiveMinimum&&C===A.minimum)return this.createError(_.NUMBER_MINIMUM_EXCLUSIVE,{value:C,minimum:A.minimum},"","/exclusiveMinimum",null,C,A)}if(A.maximum!==void 0){if(C>A.maximum)return this.createError(_.NUMBER_MAXIMUM,{value:C,maximum:A.maximum},"","/maximum",null,C,A);if(A.exclusiveMaximum&&C===A.maximum)return this.createError(_.NUMBER_MAXIMUM_EXCLUSIVE,{value:C,maximum:A.maximum},"","/exclusiveMaximum",null,C,A)}return null},s.prototype.validateNaN=function(C,A){return typeof C!="number"?null:isNaN(C)===!0||C===1/0||C===-1/0?this.createError(_.NUMBER_NOT_A_NUMBER,{value:C},"","/type",null,C,A):null},s.prototype.validateString=function(C,A,D){return this.validateStringLength(C,A,D)||this.validateStringPattern(C,A,D)||null},s.prototype.validateStringLength=function(C,A){return typeof C!="string"?null:A.minLength!==void 0&&C.length<A.minLength?this.createError(_.STRING_LENGTH_SHORT,{length:C.length,minimum:A.minLength},"","/minLength",null,C,A):A.maxLength!==void 0&&C.length>A.maxLength?this.createError(_.STRING_LENGTH_LONG,{length:C.length,maximum:A.maxLength},"","/maxLength",null,C,A):null},s.prototype.validateStringPattern=function(C,A){if(typeof C!="string"||typeof A.pattern!="string"&&!(A.pattern instanceof RegExp))return null;var D;if(A.pattern instanceof RegExp)D=A.pattern;else{var B,F="",K=A.pattern.match(/^\/(.+)\/([img]*)$/);K?(B=K[1],F=K[2]):B=A.pattern,D=new RegExp(B,F)}return D.test(C)?null:this.createError(_.STRING_PATTERN,{pattern:A.pattern},"","/pattern",null,C,A)},s.prototype.validateArray=function(C,A,D){return Array.isArray(C)&&(this.validateArrayLength(C,A,D)||this.validateArrayUniqueItems(C,A,D)||this.validateArrayItems(C,A,D))||null},s.prototype.validateArrayLength=function(C,A){var D;return A.minItems!==void 0&&C.length<A.minItems&&(D=this.createError(_.ARRAY_LENGTH_SHORT,{length:C.length,minimum:A.minItems},"","/minItems",null,C,A),this.handleError(D))||A.maxItems!==void 0&&C.length>A.maxItems&&(D=this.createError(_.ARRAY_LENGTH_LONG,{length:C.length,maximum:A.maxItems},"","/maxItems",null,C,A),this.handleError(D))?D:null},s.prototype.validateArrayUniqueItems=function(C,A){if(A.uniqueItems){for(var D=0;D<C.length;D++)for(var B=D+1;B<C.length;B++)if(o(C[D],C[B])){var F=this.createError(_.ARRAY_UNIQUE,{match1:D,match2:B},"","/uniqueItems",null,C,A);if(this.handleError(F))return F}}return null},s.prototype.validateArrayItems=function(C,A,D){if(A.items===void 0)return null;var B,F;if(Array.isArray(A.items)){for(F=0;F<C.length;F++)if(F<A.items.length){if(B=this.validateAll(C[F],A.items[F],[F],["items",F],D+"/"+F))return B}else if(A.additionalItems!==void 0){if(typeof A.additionalItems=="boolean"){if(!A.additionalItems&&(B=this.createError(_.ARRAY_ADDITIONAL_ITEMS,{},"/"+F,"/additionalItems",null,C,A),this.handleError(B)))return B}else if(B=this.validateAll(C[F],A.additionalItems,[F],["additionalItems"],D+"/"+F))return B}}else for(F=0;F<C.length;F++)if(B=this.validateAll(C[F],A.items,[F],["items"],D+"/"+F))return B;return null},s.prototype.validateObject=function(C,A,D){return typeof C!="object"||C===null||Array.isArray(C)?null:this.validateObjectMinMaxProperties(C,A,D)||this.validateObjectRequiredProperties(C,A,D)||this.validateObjectProperties(C,A,D)||this.validateObjectDependencies(C,A,D)||null},s.prototype.validateObjectMinMaxProperties=function(C,A){var D=Object.keys(C),B;return A.minProperties!==void 0&&D.length<A.minProperties&&(B=this.createError(_.OBJECT_PROPERTIES_MINIMUM,{propertyCount:D.length,minimum:A.minProperties},"","/minProperties",null,C,A),this.handleError(B))||A.maxProperties!==void 0&&D.length>A.maxProperties&&(B=this.createError(_.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:D.length,maximum:A.maxProperties},"","/maxProperties",null,C,A),this.handleError(B))?B:null},s.prototype.validateObjectRequiredProperties=function(C,A){if(A.required!==void 0)for(var D=0;D<A.required.length;D++){var B=A.required[D];if(C[B]===void 0){var F=this.createError(_.OBJECT_REQUIRED,{key:B},"","/required/"+D,null,C,A);if(this.handleError(F))return F}}return null},s.prototype.validateObjectProperties=function(C,A,D){var B;for(var F in C){var K=D+"/"+F.replace(/~/g,"~0").replace(/\//g,"~1"),ee=!1;if(A.properties!==void 0&&A.properties[F]!==void 0&&(ee=!0,B=this.validateAll(C[F],A.properties[F],[F],["properties",F],K)))return B;if(A.patternProperties!==void 0)for(var ie in A.patternProperties){var pe=new RegExp(ie);if(pe.test(F)&&(ee=!0,B=this.validateAll(C[F],A.patternProperties[ie],[F],["patternProperties",ie],K)))return B}if(ee)this.trackUnknownProperties&&(this.knownPropertyPaths[K]=!0,delete this.unknownPropertyPaths[K]);else if(A.additionalProperties!==void 0){if(this.trackUnknownProperties&&(this.knownPropertyPaths[K]=!0,delete this.unknownPropertyPaths[K]),typeof A.additionalProperties=="boolean"){if(!A.additionalProperties&&(B=this.createError(_.OBJECT_ADDITIONAL_PROPERTIES,{key:F},"","/additionalProperties",null,C,A).prefixWith(F,null),this.handleError(B)))return B}else if(B=this.validateAll(C[F],A.additionalProperties,[F],["additionalProperties"],K))return B}else this.trackUnknownProperties&&!this.knownPropertyPaths[K]&&(this.unknownPropertyPaths[K]=!0)}return null},s.prototype.validateObjectDependencies=function(C,A,D){var B;if(A.dependencies!==void 0){for(var F in A.dependencies)if(C[F]!==void 0){var K=A.dependencies[F];if(typeof K=="string"){if(C[K]===void 0&&(B=this.createError(_.OBJECT_DEPENDENCY_KEY,{key:F,missing:K},"","",null,C,A).prefixWith(null,F).prefixWith(null,"dependencies"),this.handleError(B)))return B}else if(Array.isArray(K))for(var ee=0;ee<K.length;ee++){var ie=K[ee];if(C[ie]===void 0&&(B=this.createError(_.OBJECT_DEPENDENCY_KEY,{key:F,missing:ie},"","/"+ee,null,C,A).prefixWith(null,F).prefixWith(null,"dependencies"),this.handleError(B)))return B}else if(B=this.validateAll(C,K,[],["dependencies",F],D))return B}}return null},s.prototype.validateCombinations=function(C,A,D){return this.validateAllOf(C,A,D)||this.validateAnyOf(C,A,D)||this.validateOneOf(C,A,D)||this.validateNot(C,A,D)||null},s.prototype.validateAllOf=function(C,A,D){if(A.allOf===void 0)return null;for(var B,F=0;F<A.allOf.length;F++){var K=A.allOf[F];if(B=this.validateAll(C,K,[],["allOf",F],D))return B}return null},s.prototype.validateAnyOf=function(C,A,D){if(A.anyOf===void 0)return null;var B=[],F=this.errors.length,K,ee;this.trackUnknownProperties&&(K=this.unknownPropertyPaths,ee=this.knownPropertyPaths);for(var ie=!0,pe=0;pe<A.anyOf.length;pe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var ke=A.anyOf[pe],de=this.errors.length,le=this.validateAll(C,ke,[],["anyOf",pe],D);if(le===null&&de===this.errors.length){if(this.errors=this.errors.slice(0,F),this.trackUnknownProperties){for(var ve in this.knownPropertyPaths)ee[ve]=!0,delete K[ve];for(var We in this.unknownPropertyPaths)ee[We]||(K[We]=!0);ie=!1;continue}return null}le&&B.push(le.prefixWith(null,""+pe).prefixWith(null,"anyOf"))}if(this.trackUnknownProperties&&(this.unknownPropertyPaths=K,this.knownPropertyPaths=ee),ie)return B=B.concat(this.errors.slice(F)),this.errors=this.errors.slice(0,F),this.createError(_.ANY_OF_MISSING,{},"","/anyOf",B,C,A)},s.prototype.validateOneOf=function(C,A,D){if(A.oneOf===void 0)return null;var B=null,F=[],K=this.errors.length,ee,ie;this.trackUnknownProperties&&(ee=this.unknownPropertyPaths,ie=this.knownPropertyPaths);for(var pe=0;pe<A.oneOf.length;pe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var ke=A.oneOf[pe],de=this.errors.length,le=this.validateAll(C,ke,[],["oneOf",pe],D);if(le===null&&de===this.errors.length){if(B===null)B=pe;else return this.errors=this.errors.slice(0,K),this.createError(_.ONE_OF_MULTIPLE,{index1:B,index2:pe},"","/oneOf",null,C,A);if(this.trackUnknownProperties){for(var ve in this.knownPropertyPaths)ie[ve]=!0,delete ee[ve];for(var We in this.unknownPropertyPaths)ie[We]||(ee[We]=!0)}}else le&&F.push(le)}return this.trackUnknownProperties&&(this.unknownPropertyPaths=ee,this.knownPropertyPaths=ie),B===null?(F=F.concat(this.errors.slice(K)),this.errors=this.errors.slice(0,K),this.createError(_.ONE_OF_MISSING,{},"","/oneOf",F,C,A)):(this.errors=this.errors.slice(0,K),null)},s.prototype.validateNot=function(C,A,D){if(A.not===void 0)return null;var B=this.errors.length,F,K;this.trackUnknownProperties&&(F=this.unknownPropertyPaths,K=this.knownPropertyPaths,this.unknownPropertyPaths={},this.knownPropertyPaths={});var ee=this.validateAll(C,A.not,null,null,D),ie=this.errors.slice(B);return this.errors=this.errors.slice(0,B),this.trackUnknownProperties&&(this.unknownPropertyPaths=F,this.knownPropertyPaths=K),ee===null&&ie.length===0?this.createError(_.NOT_PASSED,{},"","/not",null,C,A):null},s.prototype.validateHypermedia=function(C,A,D){if(!A.links)return null;for(var B,F=0;F<A.links.length;F++){var K=A.links[F];if(K.rel==="describedby"){for(var ee=new i(K.href),ie=!0,pe=0;pe<ee.varNames.length;pe++)if(!(ee.varNames[pe]in C)){ie=!1;break}if(ie){var ke=ee.fillFromObject(C),de={$ref:ke};if(B=this.validateAll(C,de,[],["links",F],D))return B}}}};function c(q){var C=String(q).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return C?{href:C[0]||"",protocol:C[1]||"",authority:C[2]||"",host:C[3]||"",hostname:C[4]||"",port:C[5]||"",pathname:C[6]||"",search:C[7]||"",hash:C[8]||""}:null}function p(q,C){function A(D){var B=[];return D.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(F){F==="/.."?B.pop():B.push(F)}),B.join("").replace(/^\//,D.charAt(0)==="/"?"/":"")}return C=c(C||""),q=c(q||""),!C||!q?null:(C.protocol||q.protocol)+(C.protocol||C.authority?C.authority:q.authority)+A(C.protocol||C.authority||C.pathname.charAt(0)==="/"?C.pathname:C.pathname?(q.authority&&!q.pathname?"/":"")+q.pathname.slice(0,q.pathname.lastIndexOf("/")+1)+C.pathname:q.pathname)+(C.protocol||C.authority||C.pathname?C.search:C.search||q.search)+C.hash}function h(q){return q.split("#")[0]}function g(q,C){if(q&&typeof q=="object")if(C===void 0?C=q.id:typeof q.id=="string"&&(C=p(C,q.id),q.id=C),Array.isArray(q))for(var A=0;A<q.length;A++)g(q[A],C);else{typeof q.$ref=="string"&&(q.$ref=p(C,q.$ref));for(var D in q)D!=="enum"&&g(q[D],C)}}function v(q){q=q||"en";var C=$[q];return function(A){var D=C[A.code]||k[A.code];if(typeof D!="string")return"Unknown error code "+A.code+": "+JSON.stringify(A.messageParams);var B=A.params;return D.replace(/\{([^{}]*)\}/g,function(F,K){var ee=B[K];return typeof ee=="string"||typeof ee=="number"?ee:F})}}var _={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},w={};for(var E in _)w[_[E]]=E;var k={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 T(q,C,A,D,B){if(Error.call(this),q===void 0)throw new Error("No error code supplied: "+D);this.message="",this.params=C,this.code=q,this.dataPath=A||"",this.schemaPath=D||"",this.subErrors=B||null;var F=new Error(this.message);if(this.stack=F.stack||F.stacktrace,!this.stack)try{throw F}catch(K){this.stack=K.stack||K.stacktrace}}T.prototype=Object.create(Error.prototype),T.prototype.constructor=T,T.prototype.name="ValidationError",T.prototype.prefixWith=function(q,C){if(q!==null&&(q=q.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+q+this.dataPath),C!==null&&(C=C.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+C+this.schemaPath),this.subErrors!==null)for(var A=0;A<this.subErrors.length;A++)this.subErrors[A].prefixWith(q,C);return this};function N(q,C){if(C.substring(0,q.length)===q){var A=C.substring(q.length);if(C.length>0&&C.charAt(q.length-1)==="/"||A.charAt(0)==="#"||A.charAt(0)==="?")return!0}return!1}var $={};function j(q){var C=new s,A,D,B={setErrorReporter:function(F){return typeof F=="string"?this.language(F):(D=F,!0)},addFormat:function(){C.addFormat.apply(C,arguments)},language:function(F){return F?($[F]||(F=F.split("-")[0]),$[F]?(A=F,F):!1):A},addLanguage:function(F,K){var ee;for(ee in _)K[ee]&&!K[_[ee]]&&(K[_[ee]]=K[ee]);var ie=F.split("-")[0];if(!$[ie])$[F]=K,$[ie]=K;else{$[F]=Object.create($[ie]);for(ee in K)typeof $[ie][ee]>"u"&&($[ie][ee]=K[ee]),$[F][ee]=K[ee]}return this},freshApi:function(F){var K=j();return F&&K.language(F),K},validate:function(F,K,ee,ie){var pe=v(A),ke=D?function(ve,We,mt){return D(ve,We,mt)||pe(ve,We,mt)}:pe,de=new s(C,!1,ke,ee,ie);typeof K=="string"&&(K={$ref:K}),de.addSchema("",K);var le=de.validateAll(F,K,null,null,"");return!le&&ie&&(le=de.banUnknownProperties(F,K)),this.error=le,this.missing=de.missing,this.valid=le===null,this.valid},validateResult:function(){var F={toString:function(){return this.valid?"valid":this.error.message}};return this.validate.apply(F,arguments),F},validateMultiple:function(F,K,ee,ie){var pe=v(A),ke=D?function(ve,We,mt){return D(ve,We,mt)||pe(ve,We,mt)}:pe,de=new s(C,!0,ke,ee,ie);typeof K=="string"&&(K={$ref:K}),de.addSchema("",K),de.validateAll(F,K,null,null,""),ie&&de.banUnknownProperties(F,K);var le={toString:function(){return this.valid?"valid":this.error.message}};return le.errors=de.errors,le.missing=de.missing,le.valid=le.errors.length===0,le},addSchema:function(){return C.addSchema.apply(C,arguments)},getSchema:function(){return C.getSchema.apply(C,arguments)},getSchemaMap:function(){return C.getSchemaMap.apply(C,arguments)},getSchemaUris:function(){return C.getSchemaUris.apply(C,arguments)},getMissingUris:function(){return C.getMissingUris.apply(C,arguments)},dropSchemas:function(){C.dropSchemas.apply(C,arguments)},defineKeyword:function(){C.defineKeyword.apply(C,arguments)},defineError:function(F,K,ee){if(typeof F!="string"||!/^[A-Z]+(_[A-Z]+)*$/.test(F))throw new Error("Code name must be a string in UPPER_CASE_WITH_UNDERSCORES");if(typeof K!="number"||K%1!==0||K<1e4)throw new Error("Code number must be an integer > 10000");if(typeof _[F]<"u")throw new Error("Error already defined: "+F+" as "+_[F]);if(typeof w[K]<"u")throw new Error("Error code already used: "+w[K]+" as "+K);_[F]=K,w[K]=F,k[F]=k[K]=ee;for(var ie in $){var pe=$[ie];pe[F]&&(pe[K]=pe[K]||pe[F])}},reset:function(){C.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:g,resolveUrl:p,getDocumentUri:h,errorCodes:_};return B.language(q||"en"),B}var G=j();return G.addLanguage("en-gb",k),G.tv4=G,G})});var af=H(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.regexpCode=rt.getEsmExportName=rt.getProperty=rt.safeStringify=rt.stringify=rt.strConcat=rt.addCodeArg=rt.str=rt._=rt.nil=rt._Code=rt.Name=rt.IDENTIFIER=rt._CodeOrName=void 0;var sf=class{};rt._CodeOrName=sf;rt.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var ma=class extends sf{constructor(e){if(super(),!rt.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}}};rt.Name=ma;var In=class extends sf{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 ma&&(r[n.str]=(r[n.str]||0)+1),r),{})}};rt._Code=In;rt.nil=new In("");function wI(t,...e){let r=[t[0]],n=0;for(;n<e.length;)dS(r,e[n]),r.push(t[++n]);return new In(r)}rt._=wI;var fS=new In("+");function _I(t,...e){let r=[of(t[0])],n=0;for(;n<e.length;)r.push(fS),dS(r,e[n]),r.push(fS,of(t[++n]));return p2(r),new In(r)}rt.str=_I;function dS(t,e){e instanceof In?t.push(...e._items):e instanceof ma?t.push(e):t.push(g2(e))}rt.addCodeArg=dS;function p2(t){let e=1;for(;e<t.length-1;){if(t[e]===fS){let r=h2(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function h2(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof ma||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 ma))return`"${t}${e.slice(1)}`}function m2(t,e){return e.emptyStr()?t:t.emptyStr()?e:_I`${t}${e}`}rt.strConcat=m2;function g2(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:of(Array.isArray(t)?t.join(","):t)}function y2(t){return new In(of(t))}rt.stringify=y2;function of(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}rt.safeStringify=of;function v2(t){return typeof t=="string"&&rt.IDENTIFIER.test(t)?new In(`.${t}`):wI`[${t}]`}rt.getProperty=v2;function b2(t){if(typeof t=="string"&&rt.IDENTIFIER.test(t))return new In(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}rt.getEsmExportName=b2;function S2(t){return new In(t.toString())}rt.regexpCode=S2});var mS=H(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.ValueScope=Vr.ValueScopeName=Vr.Scope=Vr.varKinds=Vr.UsedValueState=void 0;var Br=af(),pS=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Fh;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Fh||(Vr.UsedValueState=Fh={}));Vr.varKinds={const:new Br.Name("const"),let:new Br.Name("let"),var:new Br.Name("var")};var Dh=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Br.Name?e:this.name(e)}name(e){return new Br.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}}};Vr.Scope=Dh;var Lh=class extends Br.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Br._)`.${new Br.Name(r)}[${n}]`}};Vr.ValueScopeName=Lh;var w2=(0,Br._)`\n`,hS=class extends Dh{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?w2:Br.nil}}get(){return this._scope}name(e){return new Lh(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 f=this._scope[s]||(this._scope[s]=[]),c=f.length;return f[c]=r.ref,i.setValue(r,{property:s,itemIndex:c}),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,Br._)`${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=Br.nil;for(let o in e){let l=e[o];if(!l)continue;let f=n[o]=n[o]||new Map;l.forEach(c=>{if(f.has(c))return;f.set(c,Fh.Started);let p=r(c);if(p){let h=this.opts.es5?Vr.varKinds.var:Vr.varKinds.const;s=(0,Br._)`${s}${h} ${c} = ${p};${this.opts._n}`}else if(p=i?.(c))s=(0,Br._)`${s}${p}${this.opts._n}`;else throw new pS(c);f.set(c,Fh.Completed)})}return s}};Vr.ValueScope=hS});var je=H(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.or=Me.and=Me.not=Me.CodeGen=Me.operators=Me.varKinds=Me.ValueScopeName=Me.ValueScope=Me.Scope=Me.Name=Me.regexpCode=Me.stringify=Me.getProperty=Me.nil=Me.strConcat=Me.str=Me._=void 0;var Ge=af(),Zn=mS(),Ys=af();Object.defineProperty(Me,"_",{enumerable:!0,get:function(){return Ys._}});Object.defineProperty(Me,"str",{enumerable:!0,get:function(){return Ys.str}});Object.defineProperty(Me,"strConcat",{enumerable:!0,get:function(){return Ys.strConcat}});Object.defineProperty(Me,"nil",{enumerable:!0,get:function(){return Ys.nil}});Object.defineProperty(Me,"getProperty",{enumerable:!0,get:function(){return Ys.getProperty}});Object.defineProperty(Me,"stringify",{enumerable:!0,get:function(){return Ys.stringify}});Object.defineProperty(Me,"regexpCode",{enumerable:!0,get:function(){return Ys.regexpCode}});Object.defineProperty(Me,"Name",{enumerable:!0,get:function(){return Ys.Name}});var Bh=mS();Object.defineProperty(Me,"Scope",{enumerable:!0,get:function(){return Bh.Scope}});Object.defineProperty(Me,"ValueScope",{enumerable:!0,get:function(){return Bh.ValueScope}});Object.defineProperty(Me,"ValueScopeName",{enumerable:!0,get:function(){return Bh.ValueScopeName}});Object.defineProperty(Me,"varKinds",{enumerable:!0,get:function(){return Bh.varKinds}});Me.operators={GT:new Ge._Code(">"),GTE:new Ge._Code(">="),LT:new Ge._Code("<"),LTE:new Ge._Code("<="),EQ:new Ge._Code("==="),NEQ:new Ge._Code("!=="),NOT:new Ge._Code("!"),OR:new Ge._Code("||"),AND:new Ge._Code("&&"),ADD:new Ge._Code("+")};var os=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},gS=class extends os{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Zn.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=Ql(this.rhs,e,r)),this}get names(){return this.rhs instanceof Ge._CodeOrName?this.rhs.names:{}}},jh=class extends os{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 Ge.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Ql(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Ge.Name?{}:{...this.lhs.names};return Hh(e,this.rhs)}},yS=class extends jh{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},vS=class extends os{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},bS=class extends os{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},SS=class extends os{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},wS=class extends os{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=Ql(this.code,e,r),this}get names(){return this.code instanceof Ge._CodeOrName?this.code.names:{}}},lf=class extends os{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)||(_2(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>va(e,r.names),{})}},as=class extends lf{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},_S=class extends lf{},Kl=class extends as{};Kl.kind="else";var ga=class t extends as{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 Kl(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(RI(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=Ql(this.condition,e,r),this}get names(){let e=super.names;return Hh(e,this.condition),this.else&&va(e,this.else.names),e}};ga.kind="if";var ya=class extends as{};ya.kind="for";var RS=class extends ya{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=Ql(this.iteration,e,r),this}get names(){return va(super.names,this.iteration.names)}},CS=class extends ya{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?Zn.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=Hh(super.names,this.from);return Hh(e,this.to)}},Uh=class extends ya{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=Ql(this.iterable,e,r),this}get names(){return va(super.names,this.iterable.names)}},uf=class extends as{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)}};uf.kind="func";var cf=class extends lf{render(e){return"return "+super.render(e)}};cf.kind="return";var xS=class extends as{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&&va(e,this.catch.names),this.finally&&va(e,this.finally.names),e}},ff=class extends as{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};ff.kind="catch";var df=class extends as{render(e){return"finally"+super.render(e)}};df.kind="finally";var ES=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
24
+ `:""},this._extScope=e,this._scope=new Zn.Scope({parent:e}),this._nodes=[new _S]}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 gS(e,s,n)),s}const(e,r,n){return this._def(Zn.varKinds.const,e,r,n)}let(e,r,n){return this._def(Zn.varKinds.let,e,r,n)}var(e,r,n){return this._def(Zn.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new jh(e,r,n))}add(e,r){return this._leafNode(new yS(e,Me.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Ge.nil&&this._leafNode(new wS(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,Ge.addCodeArg)(r,i));return r.push("}"),new Ge._Code(r)}if(e,r,n){if(this._blockNode(new ga(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 ga(e))}else(){return this._elseNode(new Kl)}endIf(){return this._endBlockNode(ga,Kl)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new RS(e),r)}forRange(e,r,n,i,s=this.opts.es5?Zn.varKinds.var:Zn.varKinds.let){let o=this._scope.toName(e);return this._for(new CS(s,o,r,n),()=>i(o))}forOf(e,r,n,i=Zn.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=r instanceof Ge.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Ge._)`${o}.length`,l=>{this.var(s,(0,Ge._)`${o}[${l}]`),n(s)})}return this._for(new Uh("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?Zn.varKinds.var:Zn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Ge._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new Uh("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(ya)}label(e){return this._leafNode(new vS(e))}break(e){return this._leafNode(new bS(e))}return(e){let r=new cf;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(cf)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new xS;if(this._blockNode(i),this.code(e),r){let s=this.name("e");this._currNode=i.catch=new ff(s),r(s)}return n&&(this._currNode=i.finally=new df,this.code(n)),this._endBlockNode(ff,df)}throw(e){return this._leafNode(new SS(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=Ge.nil,n,i){return this._blockNode(new uf(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(uf)}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 ga))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}};Me.CodeGen=ES;function va(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Hh(t,e){return e instanceof Ge._CodeOrName?va(t,e.names):t}function Ql(t,e,r){if(t instanceof Ge.Name)return n(t);if(!i(t))return t;return new Ge._Code(t._items.reduce((s,o)=>(o instanceof Ge.Name&&(o=n(o)),o instanceof Ge._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 Ge._Code&&s._items.some(o=>o instanceof Ge.Name&&e[o.str]===1&&r[o.str]!==void 0)}}function _2(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function RI(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Ge._)`!${IS(t)}`}Me.not=RI;var R2=CI(Me.operators.AND);function C2(...t){return t.reduce(R2)}Me.and=C2;var x2=CI(Me.operators.OR);function E2(...t){return t.reduce(x2)}Me.or=E2;function CI(t){return(e,r)=>e===Ge.nil?r:r===Ge.nil?e:(0,Ge._)`${IS(e)} ${t} ${IS(r)}`}function IS(t){return t instanceof Ge.Name?t:(0,Ge._)`(${t})`}});var Ke=H(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.checkStrictMode=Ue.getErrorPath=Ue.Type=Ue.useFunc=Ue.setEvaluated=Ue.evaluatedPropsToName=Ue.mergeEvaluated=Ue.eachItem=Ue.unescapeJsonPointer=Ue.escapeJsonPointer=Ue.escapeFragment=Ue.unescapeFragment=Ue.schemaRefOrVal=Ue.schemaHasRulesButRef=Ue.schemaHasRules=Ue.checkUnknownRules=Ue.alwaysValidSchema=Ue.toHash=void 0;var wt=je(),I2=af();function O2(t){let e={};for(let r of t)e[r]=!0;return e}Ue.toHash=O2;function q2(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(II(t,e),!OI(e,t.self.RULES.all))}Ue.alwaysValidSchema=q2;function II(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]||PI(t,`unknown keyword: "${s}"`)}Ue.checkUnknownRules=II;function OI(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}Ue.schemaHasRules=OI;function k2(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}Ue.schemaHasRulesButRef=k2;function P2({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,wt._)`${r}`}return(0,wt._)`${t}${e}${(0,wt.getProperty)(n)}`}Ue.schemaRefOrVal=P2;function T2(t){return qI(decodeURIComponent(t))}Ue.unescapeFragment=T2;function A2(t){return encodeURIComponent(qS(t))}Ue.escapeFragment=A2;function qS(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}Ue.escapeJsonPointer=qS;function qI(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}Ue.unescapeJsonPointer=qI;function $2(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}Ue.eachItem=$2;function xI({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,s,o,l)=>{let f=o===void 0?s:o instanceof wt.Name?(s instanceof wt.Name?t(i,s,o):e(i,s,o),o):s instanceof wt.Name?(e(i,o,s),s):r(s,o);return l===wt.Name&&!(f instanceof wt.Name)?n(i,f):f}}Ue.mergeEvaluated={props:xI({mergeNames:(t,e,r)=>t.if((0,wt._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,wt._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,wt._)`${r} || {}`).code((0,wt._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,wt._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,wt._)`${r} || {}`),kS(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:kI}),items:xI({mergeNames:(t,e,r)=>t.if((0,wt._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,wt._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,wt._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,wt._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function kI(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,wt._)`{}`);return e!==void 0&&kS(t,r,e),r}Ue.evaluatedPropsToName=kI;function kS(t,e,r){Object.keys(r).forEach(n=>t.assign((0,wt._)`${e}${(0,wt.getProperty)(n)}`,!0))}Ue.setEvaluated=kS;var EI={};function N2(t,e){return t.scopeValue("func",{ref:e,code:EI[e.code]||(EI[e.code]=new I2._Code(e.code))})}Ue.useFunc=N2;var OS;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(OS||(Ue.Type=OS={}));function M2(t,e,r){if(t instanceof wt.Name){let n=e===OS.Num;return r?n?(0,wt._)`"[" + ${t} + "]"`:(0,wt._)`"['" + ${t} + "']"`:n?(0,wt._)`"/" + ${t}`:(0,wt._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,wt.getProperty)(t).toString():"/"+qS(t)}Ue.getErrorPath=M2;function PI(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}Ue.checkStrictMode=PI});var ls=H(PS=>{"use strict";Object.defineProperty(PS,"__esModule",{value:!0});var hr=je(),F2={data:new hr.Name("data"),valCxt:new hr.Name("valCxt"),instancePath:new hr.Name("instancePath"),parentData:new hr.Name("parentData"),parentDataProperty:new hr.Name("parentDataProperty"),rootData:new hr.Name("rootData"),dynamicAnchors:new hr.Name("dynamicAnchors"),vErrors:new hr.Name("vErrors"),errors:new hr.Name("errors"),this:new hr.Name("this"),self:new hr.Name("self"),scope:new hr.Name("scope"),json:new hr.Name("json"),jsonPos:new hr.Name("jsonPos"),jsonLen:new hr.Name("jsonLen"),jsonPart:new hr.Name("jsonPart")};PS.default=F2});var pf=H(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.extendErrors=mr.resetErrorsCount=mr.reportExtraError=mr.reportError=mr.keyword$DataError=mr.keywordError=void 0;var Qe=je(),Vh=Ke(),Tr=ls();mr.keywordError={message:({keyword:t})=>(0,Qe.str)`must pass "${t}" keyword validation`};mr.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,Qe.str)`"${t}" keyword must be ${e} ($data)`:(0,Qe.str)`"${t}" keyword is invalid ($data)`};function D2(t,e=mr.keywordError,r,n){let{it:i}=t,{gen:s,compositeRule:o,allErrors:l}=i,f=$I(t,e,r);n??(o||l)?TI(s,f):AI(i,(0,Qe._)`[${f}]`)}mr.reportError=D2;function L2(t,e=mr.keywordError,r){let{it:n}=t,{gen:i,compositeRule:s,allErrors:o}=n,l=$I(t,e,r);TI(i,l),s||o||AI(n,Tr.default.vErrors)}mr.reportExtraError=L2;function j2(t,e){t.assign(Tr.default.errors,e),t.if((0,Qe._)`${Tr.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Qe._)`${Tr.default.vErrors}.length`,e),()=>t.assign(Tr.default.vErrors,null)))}mr.resetErrorsCount=j2;function U2({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,Tr.default.errors,l=>{t.const(o,(0,Qe._)`${Tr.default.vErrors}[${l}]`),t.if((0,Qe._)`${o}.instancePath === undefined`,()=>t.assign((0,Qe._)`${o}.instancePath`,(0,Qe.strConcat)(Tr.default.instancePath,s.errorPath))),t.assign((0,Qe._)`${o}.schemaPath`,(0,Qe.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,Qe._)`${o}.schema`,r),t.assign((0,Qe._)`${o}.data`,n))})}mr.extendErrors=U2;function TI(t,e){let r=t.const("err",e);t.if((0,Qe._)`${Tr.default.vErrors} === null`,()=>t.assign(Tr.default.vErrors,(0,Qe._)`[${r}]`),(0,Qe._)`${Tr.default.vErrors}.push(${r})`),t.code((0,Qe._)`${Tr.default.errors}++`)}function AI(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,Qe._)`new ${t.ValidationError}(${e})`):(r.assign((0,Qe._)`${n}.errors`,e),r.return(!1))}var ba={keyword:new Qe.Name("keyword"),schemaPath:new Qe.Name("schemaPath"),params:new Qe.Name("params"),propertyName:new Qe.Name("propertyName"),message:new Qe.Name("message"),schema:new Qe.Name("schema"),parentSchema:new Qe.Name("parentSchema")};function $I(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,Qe._)`{}`:H2(t,e,r)}function H2(t,e,r={}){let{gen:n,it:i}=t,s=[B2(i,r),V2(t,r)];return W2(t,e,s),n.object(...s)}function B2({errorPath:t},{instancePath:e}){let r=e?(0,Qe.str)`${t}${(0,Vh.getErrorPath)(e,Vh.Type.Str)}`:t;return[Tr.default.instancePath,(0,Qe.strConcat)(Tr.default.instancePath,r)]}function V2({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,Qe.str)`${e}/${t}`;return r&&(i=(0,Qe.str)`${i}${(0,Vh.getErrorPath)(r,Vh.Type.Str)}`),[ba.schemaPath,i]}function W2(t,{params:e,message:r},n){let{keyword:i,data:s,schemaValue:o,it:l}=t,{opts:f,propertyName:c,topSchemaRef:p,schemaPath:h}=l;n.push([ba.keyword,i],[ba.params,typeof e=="function"?e(t):e||(0,Qe._)`{}`]),f.messages&&n.push([ba.message,typeof r=="function"?r(t):r]),f.verbose&&n.push([ba.schema,o],[ba.parentSchema,(0,Qe._)`${p}${h}`],[Tr.default.data,s]),c&&n.push([ba.propertyName,c])}});var MI=H(Zl=>{"use strict";Object.defineProperty(Zl,"__esModule",{value:!0});Zl.boolOrEmptySchema=Zl.topBoolOrEmptySchema=void 0;var z2=pf(),J2=je(),G2=ls(),Y2={message:"boolean schema is false"};function K2(t){let{gen:e,schema:r,validateName:n}=t;r===!1?NI(t,!1):typeof r=="object"&&r.$async===!0?e.return(G2.default.data):(e.assign((0,J2._)`${n}.errors`,null),e.return(!0))}Zl.topBoolOrEmptySchema=K2;function Q2(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),NI(t)):r.var(e,!0)}Zl.boolOrEmptySchema=Q2;function NI(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,z2.reportError)(i,Y2,void 0,e)}});var TS=H(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});Xl.getRules=Xl.isJSONType=void 0;var Z2=["string","number","integer","boolean","null","object","array"],X2=new Set(Z2);function eU(t){return typeof t=="string"&&X2.has(t)}Xl.isJSONType=eU;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:{}}}Xl.getRules=tU});var AS=H(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.shouldUseRule=Ks.shouldUseGroup=Ks.schemaHasRulesForType=void 0;function rU({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&FI(t,n)}Ks.schemaHasRulesForType=rU;function FI(t,e){return e.rules.some(r=>DI(t,r))}Ks.shouldUseGroup=FI;function DI(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))}Ks.shouldUseRule=DI});var hf=H(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.reportTypeError=gr.checkDataTypes=gr.checkDataType=gr.coerceAndCheckDataType=gr.getJSONTypes=gr.getSchemaTypes=gr.DataType=void 0;var nU=TS(),iU=AS(),sU=pf(),qe=je(),LI=Ke(),eu;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(eu||(gr.DataType=eu={}));function oU(t){let e=jI(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}gr.getSchemaTypes=oU;function jI(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(","))}gr.getJSONTypes=jI;function aU(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,iU.schemaHasRulesForType)(t,e[0]));if(o){let l=NS(e,n,i.strictNumbers,eu.Wrong);r.if(l,()=>{s.length?uU(t,e,s):MS(t)})}return o}gr.coerceAndCheckDataType=aU;var UI=new Set(["string","number","integer","boolean","null"]);function lU(t,e){return e?t.filter(r=>UI.has(r)||e==="array"&&r==="array"):[]}function uU(t,e,r){let{gen:n,data:i,opts:s}=t,o=n.let("dataType",(0,qe._)`typeof ${i}`),l=n.let("coerced",(0,qe._)`undefined`);s.coerceTypes==="array"&&n.if((0,qe._)`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,qe._)`${i}[0]`).assign(o,(0,qe._)`typeof ${i}`).if(NS(e,i,s.strictNumbers),()=>n.assign(l,i))),n.if((0,qe._)`${l} !== undefined`);for(let c of r)(UI.has(c)||c==="array"&&s.coerceTypes==="array")&&f(c);n.else(),MS(t),n.endIf(),n.if((0,qe._)`${l} !== undefined`,()=>{n.assign(i,l),cU(t,l)});function f(c){switch(c){case"string":n.elseIf((0,qe._)`${o} == "number" || ${o} == "boolean"`).assign(l,(0,qe._)`"" + ${i}`).elseIf((0,qe._)`${i} === null`).assign(l,(0,qe._)`""`);return;case"number":n.elseIf((0,qe._)`${o} == "boolean" || ${i} === null
25
25
  || (${o} == "string" && ${i} && ${i} == +${i})`).assign(l,(0,qe._)`+${i}`);return;case"integer":n.elseIf((0,qe._)`${o} === "boolean" || ${i} === null
26
26
  || (${o} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(l,(0,qe._)`+${i}`);return;case"boolean":n.elseIf((0,qe._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(l,!1).elseIf((0,qe._)`${i} === "true" || ${i} === 1`).assign(l,!0);return;case"null":n.elseIf((0,qe._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(l,null);return;case"array":n.elseIf((0,qe._)`${o} === "string" || ${o} === "number"
27
- || ${o} === "boolean" || ${i} === null`).assign(l,(0,qe._)`[${i}]`)}}}function cU({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,qe._)`${e} !== undefined`,()=>t.assign((0,qe._)`${e}[${r}]`,n))}function $S(t,e,r,n=eu.Correct){let i=n===eu.Correct?qe.operators.EQ:qe.operators.NEQ,s;switch(t){case"null":return(0,qe._)`${e} ${i} null`;case"array":s=(0,qe._)`Array.isArray(${e})`;break;case"object":s=(0,qe._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=o((0,qe._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=o();break;default:return(0,qe._)`typeof ${e} ${i} ${t}`}return n===eu.Correct?s:(0,qe.not)(s);function o(l=qe.nil){return(0,qe.and)((0,qe._)`typeof ${e} == "number"`,l,r?(0,qe._)`isFinite(${e})`:qe.nil)}}gr.checkDataType=$S;function NS(t,e,r,n){if(t.length===1)return $S(t[0],e,r,n);let i,s=(0,LI.toHash)(t);if(s.array&&s.object){let o=(0,qe._)`typeof ${e} != "object"`;i=s.null?o:(0,qe._)`!${e} || ${o}`,delete s.null,delete s.array,delete s.object}else i=qe.nil;s.number&&delete s.integer;for(let o in s)i=(0,qe.and)(i,$S(o,e,r,n));return i}gr.checkDataTypes=NS;var fU={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,qe._)`{type: ${t}}`:(0,qe._)`{type: ${e}}`};function MS(t){let e=dU(t);(0,sU.reportError)(e,fU)}gr.reportTypeError=MS;function dU(t){let{gen:e,data:r,schema:n}=t,i=(0,LI.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var BI=H(Wh=>{"use strict";Object.defineProperty(Wh,"__esModule",{value:!0});Wh.assignDefaults=void 0;var tu=je(),pU=Ke();function hU(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)HI(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>HI(t,s,i.default))}Wh.assignDefaults=hU;function HI(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,pU.checkStrictMode)(t,`default is ignored for: ${l}`);return}let f=(0,tu._)`${l} === undefined`;o.useDefaults==="empty"&&(f=(0,tu._)`${f} || ${l} === null || ${l} === ""`),n.if(f,(0,tu._)`${l} = ${(0,tu.stringify)(r)}`)}});var On=H(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.validateUnion=vt.validateArray=vt.usePattern=vt.callValidateCode=vt.schemaProperties=vt.allSchemaProperties=vt.noPropertyInData=vt.propertyInData=vt.isOwnProperty=vt.hasPropFunc=vt.reportMissingProp=vt.checkMissingProp=vt.checkReportMissingProp=void 0;var Et=je(),FS=Ke(),Qs=ls(),mU=Ke();function gU(t,e){let{gen:r,data:n,it:i}=t;r.if(LS(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Et._)`${e}`},!0),t.error()})}vt.checkReportMissingProp=gU;function yU({gen:t,data:e,it:{opts:r}},n,i){return(0,Et.or)(...n.map(s=>(0,Et.and)(LS(t,e,s,r.ownProperties),(0,Et._)`${i} = ${s}`)))}vt.checkMissingProp=yU;function vU(t,e){t.setParams({missingProperty:e},!0),t.error()}vt.reportMissingProp=vU;function VI(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Et._)`Object.prototype.hasOwnProperty`})}vt.hasPropFunc=VI;function DS(t,e,r){return(0,Et._)`${VI(t)}.call(${e}, ${r})`}vt.isOwnProperty=DS;function bU(t,e,r,n){let i=(0,Et._)`${e}${(0,Et.getProperty)(r)} !== undefined`;return n?(0,Et._)`${i} && ${DS(t,e,r)}`:i}vt.propertyInData=bU;function LS(t,e,r,n){let i=(0,Et._)`${e}${(0,Et.getProperty)(r)} === undefined`;return n?(0,Et.or)(i,(0,Et.not)(DS(t,e,r))):i}vt.noPropertyInData=LS;function WI(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}vt.allSchemaProperties=WI;function SU(t,e){return WI(e).filter(r=>!(0,FS.alwaysValidSchema)(t,e[r]))}vt.schemaProperties=SU;function wU({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:o},l,f,c){let p=c?(0,Et._)`${t}, ${e}, ${n}${i}`:e,h=[[Qs.default.instancePath,(0,Et.strConcat)(Qs.default.instancePath,s)],[Qs.default.parentData,o.parentData],[Qs.default.parentDataProperty,o.parentDataProperty],[Qs.default.rootData,Qs.default.rootData]];o.opts.dynamicRef&&h.push([Qs.default.dynamicAnchors,Qs.default.dynamicAnchors]);let g=(0,Et._)`${p}, ${r.object(...h)}`;return f!==Et.nil?(0,Et._)`${l}.call(${f}, ${g})`:(0,Et._)`${l}(${g})`}vt.callValidateCode=wU;var _U=(0,Et._)`new RegExp`;function RU({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,Et._)`${i.code==="new RegExp"?_U:(0,mU.useFunc)(t,i)}(${r}, ${n})`})}vt.usePattern=RU;function CU(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 f=e.const("len",(0,Et._)`${r}.length`);e.forRange("i",0,f,c=>{t.subschema({keyword:n,dataProp:c,dataPropType:FS.Type.Num},s),e.if((0,Et.not)(s),l)})}}vt.validateArray=CU;function xU(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(f=>(0,FS.alwaysValidSchema)(i,f))&&!i.opts.unevaluated)return;let o=e.let("valid",!1),l=e.name("_valid");e.block(()=>r.forEach((f,c)=>{let p=t.subschema({keyword:n,schemaProp:c,compositeRule:!0},l);e.assign(o,(0,Et._)`${o} || ${l}`),t.mergeValidEvaluated(p,l)||e.if((0,Et.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}vt.validateUnion=xU});var GI=H(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.validateKeywordUsage=Ii.validSchemaType=Ii.funcKeywordCode=Ii.macroKeywordCode=void 0;var Ar=je(),ba=ls(),EU=On(),IU=pf();function OU(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:o}=t,l=e.macro.call(o.self,i,s,o),f=JI(r,n,l);o.opts.validateSchema!==!1&&o.self.validateSchema(l,!0);let c=r.name("valid");t.subschema({schema:l,schemaPath:Ar.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:f,compositeRule:!0},c),t.pass(c,()=>t.error(!0))}Ii.macroKeywordCode=OU;function qU(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:o,$data:l,it:f}=t;PU(f,e);let c=!l&&e.compile?e.compile.call(f.self,s,o,f):e.validate,p=JI(n,i,c),h=n.let("valid");t.block$data(h,g),t.ok((r=e.valid)!==null&&r!==void 0?r:h);function g(){if(e.errors===!1)w(),e.modifying&&zI(t),E(()=>t.error());else{let k=e.async?v():_();e.modifying&&zI(t),E(()=>kU(t,k))}}function v(){let k=n.let("ruleErrs",null);return n.try(()=>w((0,Ar._)`await `),T=>n.assign(h,!1).if((0,Ar._)`${T} instanceof ${f.ValidationError}`,()=>n.assign(k,(0,Ar._)`${T}.errors`),()=>n.throw(T))),k}function _(){let k=(0,Ar._)`${p}.errors`;return n.assign(k,null),w(Ar.nil),k}function w(k=e.async?(0,Ar._)`await `:Ar.nil){let T=f.opts.passContext?ba.default.this:ba.default.self,N=!("compile"in e&&!l||e.schema===!1);n.assign(h,(0,Ar._)`${k}${(0,EU.callValidateCode)(t,p,T,N)}`,e.modifying)}function E(k){var T;n.if((0,Ar.not)((T=e.valid)!==null&&T!==void 0?T:h),k)}}Ii.funcKeywordCode=qU;function zI(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Ar._)`${n.parentData}[${n.parentDataProperty}]`))}function kU(t,e){let{gen:r}=t;r.if((0,Ar._)`Array.isArray(${e})`,()=>{r.assign(ba.default.vErrors,(0,Ar._)`${ba.default.vErrors} === null ? ${e} : ${ba.default.vErrors}.concat(${e})`).assign(ba.default.errors,(0,Ar._)`${ba.default.vErrors}.length`),(0,IU.extendErrors)(t)},()=>t.error())}function PU({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function JI(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,Ar.stringify)(r)})}function TU(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")}Ii.validSchemaType=TU;function AU({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 f=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(f);else throw new Error(f)}}Ii.validateKeywordUsage=AU});var KI=H(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.extendSubschemaMode=Zs.extendSubschemaData=Zs.getSubschema=void 0;var Oi=je(),YI=Ke();function $U(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,Oi._)`${t.schemaPath}${(0,Oi.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,Oi._)`${t.schemaPath}${(0,Oi.getProperty)(e)}${(0,Oi.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,YI.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')}Zs.getSubschema=$U;function NU(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:c,dataPathArr:p,opts:h}=e,g=l.let("data",(0,Oi._)`${e.data}${(0,Oi.getProperty)(r)}`,!0);f(g),t.errorPath=(0,Oi.str)`${c}${(0,YI.getErrorPath)(r,n,h.jsPropertySyntax)}`,t.parentDataProperty=(0,Oi._)`${r}`,t.dataPathArr=[...p,t.parentDataProperty]}if(i!==void 0){let c=i instanceof Oi.Name?i:l.let("data",i,!0);f(c),o!==void 0&&(t.propertyName=o)}s&&(t.dataTypes=s);function f(c){t.data=c,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,c]}}Zs.extendSubschemaData=NU;function MU(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}Zs.extendSubschemaMode=MU});var jS=H((xQ,QI)=>{"use strict";QI.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 XI=H((EQ,ZI)=>{"use strict";var Xs=ZI.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(){};zh(e,n,i,t,"",t)};Xs.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Xs.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Xs.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Xs.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 zh(t,e,r,n,i,s,o,l,f,c){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,o,l,f,c);for(var p in n){var h=n[p];if(Array.isArray(h)){if(p in Xs.arrayKeywords)for(var g=0;g<h.length;g++)zh(t,e,r,h[g],i+"/"+p+"/"+g,s,i,p,n,g)}else if(p in Xs.propsKeywords){if(h&&typeof h=="object")for(var v in h)zh(t,e,r,h[v],i+"/"+p+"/"+FU(v),s,i,p,n,v)}else(p in Xs.keywords||t.allKeys&&!(p in Xs.skipKeywords))&&zh(t,e,r,h,i+"/"+p,s,i,p,n)}r(n,i,s,o,l,f,c)}}function FU(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var mf=H(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.getSchemaRefs=Wr.resolveUrl=Wr.normalizeId=Wr._getFullPath=Wr.getFullPath=Wr.inlineRef=void 0;var DU=Ke(),LU=jS(),jU=XI(),UU=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function HU(t,e=!0){return typeof t=="boolean"?!0:e===!0?!US(t):e?eO(t)<=e:!1}Wr.inlineRef=HU;var BU=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function US(t){for(let e in t){if(BU.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(US)||typeof r=="object"&&US(r))return!0}return!1}function eO(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!UU.has(r)&&(typeof t[r]=="object"&&(0,DU.eachItem)(t[r],n=>e+=eO(n)),e===1/0))return 1/0}return e}function tO(t,e="",r){r!==!1&&(e=ru(e));let n=t.parse(e);return rO(t,n)}Wr.getFullPath=tO;function rO(t,e){return t.serialize(e).split("#")[0]+"#"}Wr._getFullPath=rO;var VU=/#\/?$/;function ru(t){return t?t.replace(VU,""):""}Wr.normalizeId=ru;function WU(t,e,r){return r=ru(r),t.resolve(e,r)}Wr.resolveUrl=WU;var zU=/^[a-z_][-a-z0-9._]*$/i;function JU(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=ru(t[r]||e),s={"":i},o=tO(n,i,!1),l={},f=new Set;return jU(t,{allKeys:!0},(h,g,v,_)=>{if(_===void 0)return;let w=o+g,E=s[_];typeof h[r]=="string"&&(E=k.call(this,h[r])),T.call(this,h.$anchor),T.call(this,h.$dynamicAnchor),s[g]=E;function k(N){let $=this.opts.uriResolver.resolve;if(N=ru(E?$(E,N):N),f.has(N))throw p(N);f.add(N);let j=this.refs[N];return typeof j=="string"&&(j=this.refs[j]),typeof j=="object"?c(h,j.schema,N):N!==ru(w)&&(N[0]==="#"?(c(h,l[N],N),l[N]=h):this.refs[N]=w),N}function T(N){if(typeof N=="string"){if(!zU.test(N))throw new Error(`invalid anchor "${N}"`);k.call(this,`#${N}`)}}}),l;function c(h,g,v){if(g!==void 0&&!LU(h,g))throw p(v)}function p(h){return new Error(`reference "${h}" resolves to more than one schema`)}}Wr.getSchemaRefs=JU});var vf=H(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.getData=eo.KeywordCxt=eo.validateFunctionCode=void 0;var aO=MI(),nO=hf(),BS=AS(),Jh=hf(),GU=BI(),yf=GI(),HS=KI(),ye=je(),Ce=ls(),YU=mf(),us=Ke(),gf=pf();function KU(t){if(cO(t)&&(fO(t),uO(t))){XU(t);return}lO(t,()=>(0,aO.topBoolOrEmptySchema)(t))}eo.validateFunctionCode=KU;function lO({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,ye._)`${Ce.default.data}, ${Ce.default.valCxt}`,n.$async,()=>{t.code((0,ye._)`"use strict"; ${iO(r,i)}`),ZU(t,i),t.code(s)}):t.func(e,(0,ye._)`${Ce.default.data}, ${QU(i)}`,n.$async,()=>t.code(iO(r,i)).code(s))}function QU(t){return(0,ye._)`{${Ce.default.instancePath}="", ${Ce.default.parentData}, ${Ce.default.parentDataProperty}, ${Ce.default.rootData}=${Ce.default.data}${t.dynamicRef?(0,ye._)`, ${Ce.default.dynamicAnchors}={}`:ye.nil}}={}`}function ZU(t,e){t.if(Ce.default.valCxt,()=>{t.var(Ce.default.instancePath,(0,ye._)`${Ce.default.valCxt}.${Ce.default.instancePath}`),t.var(Ce.default.parentData,(0,ye._)`${Ce.default.valCxt}.${Ce.default.parentData}`),t.var(Ce.default.parentDataProperty,(0,ye._)`${Ce.default.valCxt}.${Ce.default.parentDataProperty}`),t.var(Ce.default.rootData,(0,ye._)`${Ce.default.valCxt}.${Ce.default.rootData}`),e.dynamicRef&&t.var(Ce.default.dynamicAnchors,(0,ye._)`${Ce.default.valCxt}.${Ce.default.dynamicAnchors}`)},()=>{t.var(Ce.default.instancePath,(0,ye._)`""`),t.var(Ce.default.parentData,(0,ye._)`undefined`),t.var(Ce.default.parentDataProperty,(0,ye._)`undefined`),t.var(Ce.default.rootData,Ce.default.data),e.dynamicRef&&t.var(Ce.default.dynamicAnchors,(0,ye._)`{}`)})}function XU(t){let{schema:e,opts:r,gen:n}=t;lO(t,()=>{r.$comment&&e.$comment&&pO(t),iH(t),n.let(Ce.default.vErrors,null),n.let(Ce.default.errors,0),r.unevaluated&&eH(t),dO(t),aH(t)})}function eH(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,ye._)`${r}.evaluated`),e.if((0,ye._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,ye._)`${t.evaluated}.props`,(0,ye._)`undefined`)),e.if((0,ye._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,ye._)`${t.evaluated}.items`,(0,ye._)`undefined`))}function iO(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,ye._)`/*# sourceURL=${r} */`:ye.nil}function tH(t,e){if(cO(t)&&(fO(t),uO(t))){rH(t,e);return}(0,aO.boolOrEmptySchema)(t,e)}function uO({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 cO(t){return typeof t.schema!="boolean"}function rH(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&pO(t),sH(t),oH(t);let s=n.const("_errs",Ce.default.errors);dO(t,s),n.var(e,(0,ye._)`${s} === ${Ce.default.errors}`)}function fO(t){(0,us.checkUnknownRules)(t),nH(t)}function dO(t,e){if(t.opts.jtd)return sO(t,[],!1,e);let r=(0,nO.getSchemaTypes)(t.schema),n=(0,nO.coerceAndCheckDataType)(t,r);sO(t,r,!n,e)}function nH(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,us.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function iH(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,us.checkStrictMode)(t,"default is ignored in the schema root")}function sH(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,YU.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function oH(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function pO({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,ye._)`${Ce.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let o=(0,ye.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,ye._)`${Ce.default.self}.opts.$comment(${s}, ${o}, ${l}.schema)`)}}function aH(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,ye._)`${Ce.default.errors} === 0`,()=>e.return(Ce.default.data),()=>e.throw((0,ye._)`new ${i}(${Ce.default.vErrors})`)):(e.assign((0,ye._)`${n}.errors`,Ce.default.vErrors),s.unevaluated&&lH(t),e.return((0,ye._)`${Ce.default.errors} === 0`))}function lH({gen:t,evaluated:e,props:r,items:n}){r instanceof ye.Name&&t.assign((0,ye._)`${e}.props`,r),n instanceof ye.Name&&t.assign((0,ye._)`${e}.items`,n)}function sO(t,e,r,n){let{gen:i,schema:s,data:o,allErrors:l,opts:f,self:c}=t,{RULES:p}=c;if(s.$ref&&(f.ignoreKeywordsWithRef||!(0,us.schemaHasRulesButRef)(s,p))){i.block(()=>mO(t,"$ref",p.all.$ref.definition));return}f.jtd||uH(t,e),i.block(()=>{for(let g of p.rules)h(g);h(p.post)});function h(g){(0,BS.shouldUseGroup)(s,g)&&(g.type?(i.if((0,Jh.checkDataType)(g.type,o,f.strictNumbers)),oO(t,g),e.length===1&&e[0]===g.type&&r&&(i.else(),(0,Jh.reportTypeError)(t)),i.endIf()):oO(t,g),l||i.if((0,ye._)`${Ce.default.errors} === ${n||0}`))}}function oO(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,GU.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,BS.shouldUseRule)(n,s)&&mO(t,s.keyword,s.definition,e.type)})}function uH(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(cH(t,e),t.opts.allowUnionTypes||fH(t,e),dH(t,t.dataTypes))}function cH(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{hO(t.dataTypes,r)||VS(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),hH(t,e)}}function fH(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&VS(t,"use allowUnionTypes to allow union type keyword")}function dH(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,BS.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(o=>pH(e,o))&&VS(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function pH(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function hO(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function hH(t,e){let r=[];for(let n of t.dataTypes)hO(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function VS(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,us.checkStrictMode)(t,e,t.opts.strictTypes)}var Gh=class{constructor(e,r,n){if((0,yf.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,us.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",gO(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,yf.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",Ce.default.errors))}result(e,r,n){this.failResult((0,ye.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,ye.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,ye._)`${r} !== undefined && (${(0,ye.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?gf.reportExtraError:gf.reportError)(this,this.def.error,r)}$dataError(){(0,gf.reportError)(this,this.def.$dataError||gf.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,gf.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=ye.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=ye.nil,r=ye.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:o}=this;n.if((0,ye.or)((0,ye._)`${i} === undefined`,r)),e!==ye.nil&&n.assign(e,!0),(s.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==ye.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,ye.or)(o(),l());function o(){if(n.length){if(!(r instanceof ye.Name))throw new Error("ajv implementation error");let f=Array.isArray(n)?n:[n];return(0,ye._)`${(0,Jh.checkDataTypes)(f,r,s.opts.strictNumbers,Jh.DataType.Wrong)}`}return ye.nil}function l(){if(i.validateSchema){let f=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,ye._)`!${f}(${r})`}return ye.nil}}subschema(e,r){let n=(0,HS.getSubschema)(this.it,e);(0,HS.extendSubschemaData)(n,this.it,e),(0,HS.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=us.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=us.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,ye.Name)),!0}};eo.KeywordCxt=Gh;function mO(t,e,r,n){let i=new Gh(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,yf.funcKeywordCode)(i,r):"macro"in r?(0,yf.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,yf.funcKeywordCode)(i,r)}var mH=/^\/(?:[^~]|~0|~1)*$/,gH=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function gO(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return Ce.default.rootData;if(t[0]==="/"){if(!mH.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=Ce.default.rootData}else{let c=gH.exec(t);if(!c)throw new Error(`Invalid JSON-pointer: ${t}`);let p=+c[1];if(i=c[2],i==="#"){if(p>=e)throw new Error(f("property/index",p));return n[e-p]}if(p>e)throw new Error(f("data",p));if(s=r[e-p],!i)return s}let o=s,l=i.split("/");for(let c of l)c&&(s=(0,ye._)`${s}${(0,ye.getProperty)((0,us.unescapeJsonPointer)(c))}`,o=(0,ye._)`${o} && ${s}`);return o;function f(c,p){return`Cannot access ${c} ${p} levels up, current level is ${e}`}}eo.getData=gO});var Yh=H(zS=>{"use strict";Object.defineProperty(zS,"__esModule",{value:!0});var WS=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};zS.default=WS});var bf=H(YS=>{"use strict";Object.defineProperty(YS,"__esModule",{value:!0});var JS=mf(),GS=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,JS.resolveUrl)(e,r,n),this.missingSchema=(0,JS.normalizeId)((0,JS.getFullPath)(e,this.missingRef))}};YS.default=GS});var Qh=H(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.resolveSchema=qn.getCompilingSchema=qn.resolveRef=qn.compileSchema=qn.SchemaEnv=void 0;var Xn=je(),yH=Yh(),Sa=ls(),ei=mf(),yO=Ke(),vH=vf(),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,ei.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};qn.SchemaEnv=nu;function QS(t){let e=vO.call(this,t);if(e)return e;let r=(0,ei.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,o=new Xn.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),l;t.$async&&(l=o.scopeValue("Error",{ref:yH.default,code:(0,Xn._)`require("ajv/dist/runtime/validation_error").default`}));let f=o.scopeName("validate");t.validateName=f;let c={gen:o,allErrors:this.opts.allErrors,data:Sa.default.data,parentData:Sa.default.parentData,parentDataProperty:Sa.default.parentDataProperty,dataNames:[Sa.default.data],dataPathArr:[Xn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Xn.stringify)(t.schema)}:{ref:t.schema}),validateName:f,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Xn.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Xn._)`""`,opts:this.opts,self:this},p;try{this._compilations.add(t),(0,vH.validateFunctionCode)(c),o.optimize(this.opts.code.optimize);let h=o.toString();p=`${o.scopeRefs(Sa.default.scope)}return ${h}`,this.opts.code.process&&(p=this.opts.code.process(p,t));let v=new Function(`${Sa.default.self}`,`${Sa.default.scope}`,p)(this,this.scope.get());if(this.scope.value(f,{ref:v}),v.errors=null,v.schema=t.schema,v.schemaEnv=t,t.$async&&(v.$async=!0),this.opts.code.source===!0&&(v.source={validateName:f,validateCode:h,scopeValues:o._values}),this.opts.unevaluated){let{props:_,items:w}=c;v.evaluated={props:_ instanceof Xn.Name?void 0:_,items:w instanceof Xn.Name?void 0:w,dynamicProps:_ instanceof Xn.Name,dynamicItems:w instanceof Xn.Name},v.source&&(v.source.evaluated=(0,Xn.stringify)(v.evaluated))}return t.validate=v,t}catch(h){throw delete t.validate,delete t.validateName,p&&this.logger.error("Error compiling schema, function code:",p),h}finally{this._compilations.delete(t)}}qn.compileSchema=QS;function bH(t,e,r){var n;r=(0,ei.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=_H.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]=SH.call(this,s)}qn.resolveRef=bH;function SH(t){return(0,ei.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:QS.call(this,t)}function vO(t){for(let e of this._compilations)if(wH(e,t))return e}qn.getCompilingSchema=vO;function wH(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function _H(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Kh.call(this,t,e)}function Kh(t,e){let r=this.opts.uriResolver.parse(e),n=(0,ei._getFullPath)(this.opts.uriResolver,r),i=(0,ei.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return KS.call(this,r,t);let s=(0,ei.normalizeId)(n),o=this.refs[s]||this.schemas[s];if(typeof o=="string"){let l=Kh.call(this,t,o);return typeof l?.schema!="object"?void 0:KS.call(this,r,l)}if(typeof o?.schema=="object"){if(o.validate||QS.call(this,o),s===(0,ei.normalizeId)(e)){let{schema:l}=o,{schemaId:f}=this.opts,c=l[f];return c&&(i=(0,ei.resolveUrl)(this.opts.uriResolver,i,c)),new nu({schema:l,schemaId:f,root:t,baseId:i})}return KS.call(this,r,o)}}qn.resolveSchema=Kh;var RH=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function KS(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 f=r[(0,yO.unescapeFragment)(l)];if(f===void 0)return;r=f;let c=typeof r=="object"&&r[this.opts.schemaId];!RH.has(l)&&c&&(e=(0,ei.resolveUrl)(this.opts.uriResolver,e,c))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,yO.schemaHasRulesButRef)(r,this.RULES)){let l=(0,ei.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=Kh.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 bO=H((TQ,CH)=>{CH.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 ew=H((AQ,xO)=>{"use strict";var xH=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),wO=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),ZS=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),_O=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),EH=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function XS(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 IH=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function SO(t){return t.length=0,!0}function OH(t,e,r){if(t.length){let n=XS(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function qH(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,o=!1,l=OH;for(let f=0;f<t.length;f++){let c=t[f];if(!(c==="["||c==="]"))if(c===":"){if(s===!0&&(o=!0),!l(i,n,r))break;if(++e>7){r.error=!0;break}f>0&&t[f-1]===":"&&(s=!0),n.push(":");continue}else if(c==="%"){if(!l(i,n,r))break;l=SO}else{i.push(c);continue}}return i.length&&(l===SO?r.zone=i.join(""):o?n.push(i.join("")):n.push(XS(i))),r.address=n.join(""),r}function RO(t){if(kH(t,":")<2)return{host:t,isIPV6:!1};let e=qH(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 kH(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function PH(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 TH={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},AH=/[@/?#:]/g,$H=/[@/?#]/g;function CO(t,e){let r=e?$H:AH;return r.lastIndex=0,t.replace(r,n=>TH[n])}function NH(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(ZS(i)){let s=i.toUpperCase(),o=String.fromCharCode(parseInt(s,16));e&&_O(o)?r+=o:r+="%"+s,n+=2;continue}}r+=t[n]}return r}function MH(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(ZS(n)){let i=n.toUpperCase(),s=String.fromCharCode(parseInt(i,16));s!=="."&&_O(s)?e+=s:e+="%"+i,r+=2;continue}}EH(t[r])?e+=t[r]:e+=escape(t[r])}return e}function FH(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(ZS(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function DH(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!wO(r)){let n=RO(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=CO(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}xO.exports={nonSimpleDomain:IH,recomposeAuthority:DH,reescapeHostDelimiters:CO,normalizePercentEncoding:NH,normalizePathEncoding:MH,escapePreservingEscapes:FH,removeDotSegments:PH,isIPv4:wO,isUUID:xH,normalizeIPv6:RO,stringArrayToHexStripped:XS}});var kO=H(($Q,qO)=>{"use strict";var{isUUID:LH}=ew(),jH=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,UH=["http","https","ws","wss","urn","urn:uuid"];function HH(t){return UH.indexOf(t)!==-1}function tw(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 EO(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function IO(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 BH(t){return t.secure=tw(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function VH(t){if((t.port===(tw(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 WH(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(jH);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=rw(i);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function zH(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=rw(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 JH(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!LH(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function GH(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var OO={scheme:"http",domainHost:!0,parse:EO,serialize:IO},YH={scheme:"https",domainHost:OO.domainHost,parse:EO,serialize:IO},Zh={scheme:"ws",domainHost:!0,parse:BH,serialize:VH},KH={scheme:"wss",domainHost:Zh.domainHost,parse:Zh.parse,serialize:Zh.serialize},QH={scheme:"urn",parse:WH,serialize:zH,skipNormalize:!0},ZH={scheme:"urn:uuid",parse:JH,serialize:GH,skipNormalize:!0},Xh={http:OO,https:YH,ws:Zh,wss:KH,urn:QH,"urn:uuid":ZH};Object.setPrototypeOf(Xh,null);function rw(t){return t&&(Xh[t]||Xh[t.toLowerCase()])||void 0}qO.exports={wsIsSecure:tw,SCHEMES:Xh,isValidSchemeName:HH,getSchemeHandler:rw}});var MO=H((NQ,em)=>{"use strict";var{normalizeIPv6:XH,removeDotSegments:Sf,recomposeAuthority:eB,normalizePercentEncoding:tB,normalizePathEncoding:rB,escapePreservingEscapes:nB,reescapeHostDelimiters:iB,isIPv4:sB,nonSimpleDomain:oB}=ew(),{SCHEMES:aB,getSchemeHandler:TO}=kO();function lB(t,e){return typeof t=="string"?t=pB(t,e):typeof t=="object"&&(t=iu(wa(t,e),e)),t}function uB(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=AO(iu(t,n),iu(e,n),n,!0);return n.skipEscape=!0,wa(i,n)}function AO(t,e,r,n){let i={};return n||(t=iu(wa(t,r),r),e=iu(wa(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=Sf(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=Sf(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=Sf(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=Sf(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 cB(t,e,r){let n=PO(t,r),i=PO(e,r);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()}function wa(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=TO(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=eB(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=Sf(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 fB=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function dB(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 $O(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(fB);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=dB(n,o);if(l!==void 0&&(n.error=n.error||l,i=!0),n.host)if(sB(n.host)===!1){let p=XH(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 f=TO(r.scheme||n.scheme);if(!r.unicodeSupport&&(!f||!f.unicodeSupport)&&n.host&&(r.domainHost||f&&f.domainHost)&&s===!1&&oB(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(c){n.error=n.error||"Host's domain name can not be converted to ASCII: "+c}if((!f||f&&!f.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=iB(unescape(n.host),s))),n.path&&(n.path=rB(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}f&&f.parse&&f.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:i}}function iu(t,e){return $O(t,e).parsed}function pB(t,e){return NO(t,e).normalized}function NO(t,e){let{parsed:r,malformedAuthorityOrPort:n}=$O(t,e);return{normalized:n?t:wa(r,e),malformedAuthorityOrPort:n}}function PO(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=NO(t,e);return n?void 0:r}if(typeof t=="object")return wa(t,e)}var nw={SCHEMES:aB,normalize:lB,resolve:uB,resolveComponent:AO,equal:cB,serialize:wa,parse:iu};em.exports=nw;em.exports.default=nw;em.exports.fastUri=nw});var DO=H(iw=>{"use strict";Object.defineProperty(iw,"__esModule",{value:!0});var FO=MO();FO.code='require("ajv/dist/runtime/uri").default';iw.default=FO});var zO=H(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.CodeGen=sr.Name=sr.nil=sr.stringify=sr.str=sr._=sr.KeywordCxt=void 0;var hB=vf();Object.defineProperty(sr,"KeywordCxt",{enumerable:!0,get:function(){return hB.KeywordCxt}});var su=je();Object.defineProperty(sr,"_",{enumerable:!0,get:function(){return su._}});Object.defineProperty(sr,"str",{enumerable:!0,get:function(){return su.str}});Object.defineProperty(sr,"stringify",{enumerable:!0,get:function(){return su.stringify}});Object.defineProperty(sr,"nil",{enumerable:!0,get:function(){return su.nil}});Object.defineProperty(sr,"Name",{enumerable:!0,get:function(){return su.Name}});Object.defineProperty(sr,"CodeGen",{enumerable:!0,get:function(){return su.CodeGen}});var mB=Yh(),BO=bf(),gB=TS(),wf=Qh(),yB=je(),_f=mf(),tm=hf(),ow=Ke(),LO=bO(),vB=DO(),VO=(t,e)=>new RegExp(t,e);VO.code="new RegExp";var bB=["removeAdditional","useDefaults","coerceTypes"],SB=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),wB={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."},_B={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},jO=200;function RB(t){var e,r,n,i,s,o,l,f,c,p,h,g,v,_,w,E,k,T,N,$,j,G,q,C,A;let D=t.strict,B=(e=t.code)===null||e===void 0?void 0:e.optimize,F=B===!0||B===void 0?1:B||0,K=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:VO,ee=(i=t.uriResolver)!==null&&i!==void 0?i:vB.default;return{strictSchema:(o=(s=t.strictSchema)!==null&&s!==void 0?s:D)!==null&&o!==void 0?o:!0,strictNumbers:(f=(l=t.strictNumbers)!==null&&l!==void 0?l:D)!==null&&f!==void 0?f:!0,strictTypes:(p=(c=t.strictTypes)!==null&&c!==void 0?c:D)!==null&&p!==void 0?p:"log",strictTuples:(g=(h=t.strictTuples)!==null&&h!==void 0?h:D)!==null&&g!==void 0?g:"log",strictRequired:(_=(v=t.strictRequired)!==null&&v!==void 0?v:D)!==null&&_!==void 0?_:!1,code:t.code?{...t.code,optimize:F,regExp:K}:{optimize:F,regExp:K},loopRequired:(w=t.loopRequired)!==null&&w!==void 0?w:jO,loopEnum:(E=t.loopEnum)!==null&&E!==void 0?E:jO,meta:(k=t.meta)!==null&&k!==void 0?k:!0,messages:(T=t.messages)!==null&&T!==void 0?T:!0,inlineRefs:(N=t.inlineRefs)!==null&&N!==void 0?N:!0,schemaId:($=t.schemaId)!==null&&$!==void 0?$:"$id",addUsedSchema:(j=t.addUsedSchema)!==null&&j!==void 0?j:!0,validateSchema:(G=t.validateSchema)!==null&&G!==void 0?G:!0,validateFormats:(q=t.validateFormats)!==null&&q!==void 0?q:!0,unicodeRegExp:(C=t.unicodeRegExp)!==null&&C!==void 0?C:!0,int32range:(A=t.int32range)!==null&&A!==void 0?A:!0,uriResolver:ee}}var Rf=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,...RB(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new yB.ValueScope({scope:{},prefixes:SB,es5:r,lines:n}),this.logger=qB(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,gB.getRules)(),UO.call(this,wB,e,"NOT SUPPORTED"),UO.call(this,_B,e,"DEPRECATED","warn"),this._metaOpts=IB.call(this),e.formats&&xB.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&EB.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),CB.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=LO;n==="id"&&(i={...LO},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,h){await s.call(this,p.$schema);let g=this._addSchema(p,h);return g.validate||o.call(this,g)}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(h){if(!(h instanceof BO.default))throw h;return l.call(this,h),await f.call(this,h.missingSchema),o.call(this,p)}}function l({missingSchema:p,missingRef:h}){if(this.refs[p])throw new Error(`AnySchema ${p} is loaded but ${h} cannot be resolved`)}async function f(p){let h=await c.call(this,p);this.refs[p]||await s.call(this,h.$schema),this.refs[p]||this.addSchema(h,p,r)}async function c(p){let h=this._loading[p];if(h)return h;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,_f.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=HO.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new wf.SchemaEnv({schema:{},schemaId:n});if(r=wf.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=HO.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,_f.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(PB.call(this,n,r),!r)return(0,ow.eachItem)(n,s=>sw.call(this,s)),this;AB.call(this,r);let i={...r,type:(0,tm.getJSONTypes)(r.type),schemaType:(0,tm.getJSONTypes)(r.schemaType)};return(0,ow.eachItem)(n,i.type.length===0?s=>sw.call(this,s,i):s=>i.type.forEach(o=>sw.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 f=n[l];if(typeof f!="object")continue;let{$data:c}=f.definition,p=o[l];c&&p&&(o[l]=WO(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 f=this._cache.get(e);if(f!==void 0)return f;n=(0,_f.normalizeId)(o||n);let c=_f.getSchemaRefs.call(this,e,n);return f=new wf.SchemaEnv({schema:e,schemaId:l,meta:r,baseId:n,localRefs:c}),this._cache.set(f.schema,f),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=f),i&&this.validateSchema(e,!0),f}_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):wf.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{wf.compileSchema.call(this,e)}finally{this.opts=r}}};Rf.ValidationError=mB.default;Rf.MissingRefError=BO.default;sr.default=Rf;function UO(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 HO(t){return t=(0,_f.normalizeId)(t),this.schemas[t]||this.refs[t]}function CB(){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 xB(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function EB(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 IB(){let t={...this.opts};for(let e of bB)delete t[e];return t}var OB={log(){},warn(){},error(){}};function qB(t){if(t===!1)return OB;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 kB=/^[a-z_$][a-z0-9_$:-]*$/i;function PB(t,e){let{RULES:r}=this;if((0,ow.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!kB.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 sw(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:f})=>f===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,tm.getJSONTypes)(e.type),schemaType:(0,tm.getJSONTypes)(e.schemaType)}};e.before?TB.call(this,o,l,e.before):o.rules.push(l),s.all[t]=l,(n=e.implements)===null||n===void 0||n.forEach(f=>this.addKeyword(f))}function TB(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 AB(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=WO(e)),t.validateSchema=this.compile(e,!0))}var $B={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function WO(t){return{anyOf:[t,$B]}}});var JO=H(aw=>{"use strict";Object.defineProperty(aw,"__esModule",{value:!0});var NB={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};aw.default=NB});var QO=H(_a=>{"use strict";Object.defineProperty(_a,"__esModule",{value:!0});_a.callRef=_a.getValidate=void 0;var MB=bf(),GO=On(),zr=je(),ou=ls(),YO=Qh(),rm=Ke(),FB={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:s,validateName:o,opts:l,self:f}=n,{root:c}=s;if((r==="#"||r==="#/")&&i===c.baseId)return h();let p=YO.resolveRef.call(f,c,i,r);if(p===void 0)throw new MB.default(n.opts.uriResolver,i,r);if(p instanceof YO.SchemaEnv)return g(p);return v(p);function h(){if(s===c)return nm(t,o,s,s.$async);let _=e.scopeValue("root",{ref:c});return nm(t,(0,zr._)`${_}.validate`,c,c.$async)}function g(_){let w=KO(t,_);nm(t,w,_,_.$async)}function v(_){let w=e.scopeValue("schema",l.code.source===!0?{ref:_,code:(0,zr.stringify)(_)}:{ref:_}),E=e.name("valid"),k=t.subschema({schema:_,dataTypes:[],schemaPath:zr.nil,topSchemaRef:w,errSchemaPath:r},E);t.mergeEvaluated(k),t.ok(E)}}};function KO(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,zr._)`${r.scopeValue("wrapper",{ref:e})}.validate`}_a.getValidate=KO;function nm(t,e,r,n){let{gen:i,it:s}=t,{allErrors:o,schemaEnv:l,opts:f}=s,c=f.passContext?ou.default.this:zr.nil;n?p():h();function p(){if(!l.$async)throw new Error("async schema referenced by sync schema");let _=i.let("valid");i.try(()=>{i.code((0,zr._)`await ${(0,GO.callValidateCode)(t,e,c)}`),v(e),o||i.assign(_,!0)},w=>{i.if((0,zr._)`!(${w} instanceof ${s.ValidationError})`,()=>i.throw(w)),g(w),o||i.assign(_,!1)}),t.ok(_)}function h(){t.result((0,GO.callValidateCode)(t,e,c),()=>v(e),()=>g(e))}function g(_){let w=(0,zr._)`${_}.errors`;i.assign(ou.default.vErrors,(0,zr._)`${ou.default.vErrors} === null ? ${w} : ${ou.default.vErrors}.concat(${w})`),i.assign(ou.default.errors,(0,zr._)`${ou.default.vErrors}.length`)}function v(_){var w;if(!s.opts.unevaluated)return;let E=(w=r?.validate)===null||w===void 0?void 0:w.evaluated;if(s.props!==!0)if(E&&!E.dynamicProps)E.props!==void 0&&(s.props=rm.mergeEvaluated.props(i,E.props,s.props));else{let k=i.var("props",(0,zr._)`${_}.evaluated.props`);s.props=rm.mergeEvaluated.props(i,k,s.props,zr.Name)}if(s.items!==!0)if(E&&!E.dynamicItems)E.items!==void 0&&(s.items=rm.mergeEvaluated.items(i,E.items,s.items));else{let k=i.var("items",(0,zr._)`${_}.evaluated.items`);s.items=rm.mergeEvaluated.items(i,k,s.items,zr.Name)}}}_a.callRef=nm;_a.default=FB});var ZO=H(lw=>{"use strict";Object.defineProperty(lw,"__esModule",{value:!0});var DB=JO(),LB=QO(),jB=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",DB.default,LB.default];lw.default=jB});var XO=H(uw=>{"use strict";Object.defineProperty(uw,"__esModule",{value:!0});var im=je(),to=im.operators,sm={maximum:{okStr:"<=",ok:to.LTE,fail:to.GT},minimum:{okStr:">=",ok:to.GTE,fail:to.LT},exclusiveMaximum:{okStr:"<",ok:to.LT,fail:to.GTE},exclusiveMinimum:{okStr:">",ok:to.GT,fail:to.LTE}},UB={message:({keyword:t,schemaCode:e})=>(0,im.str)`must be ${sm[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,im._)`{comparison: ${sm[t].okStr}, limit: ${e}}`},HB={keyword:Object.keys(sm),type:"number",schemaType:"number",$data:!0,error:UB,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,im._)`${r} ${sm[e].fail} ${n} || isNaN(${r})`)}};uw.default=HB});var eq=H(cw=>{"use strict";Object.defineProperty(cw,"__esModule",{value:!0});var Cf=je(),BB={message:({schemaCode:t})=>(0,Cf.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Cf._)`{multipleOf: ${t}}`},VB={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:BB,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,o=e.let("res"),l=s?(0,Cf._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:(0,Cf._)`${o} !== parseInt(${o})`;t.fail$data((0,Cf._)`(${n} === 0 || (${o} = ${r}/${n}, ${l}))`)}};cw.default=VB});var rq=H(fw=>{"use strict";Object.defineProperty(fw,"__esModule",{value:!0});function tq(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}fw.default=tq;tq.code='require("ajv/dist/runtime/ucs2length").default'});var nq=H(dw=>{"use strict";Object.defineProperty(dw,"__esModule",{value:!0});var Ra=je(),WB=Ke(),zB=rq(),JB={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Ra.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Ra._)`{limit: ${t}}`},GB={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:JB,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?Ra.operators.GT:Ra.operators.LT,o=i.opts.unicode===!1?(0,Ra._)`${r}.length`:(0,Ra._)`${(0,WB.useFunc)(t.gen,zB.default)}(${r})`;t.fail$data((0,Ra._)`${o} ${s} ${n}`)}};dw.default=GB});var iq=H(pw=>{"use strict";Object.defineProperty(pw,"__esModule",{value:!0});var YB=On(),KB=Ke(),au=je(),QB={message:({schemaCode:t})=>(0,au.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,au._)`{pattern: ${t}}`},ZB={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:QB,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:f}=o.opts.code,c=f.code==="new RegExp"?(0,au._)`new RegExp`:(0,KB.useFunc)(e,f),p=e.let("valid");e.try(()=>e.assign(p,(0,au._)`${c}(${s}, ${l}).test(${r})`),()=>e.assign(p,!1)),t.fail$data((0,au._)`!${p}`)}else{let f=(0,YB.usePattern)(t,i);t.fail$data((0,au._)`!${f}.test(${r})`)}}};pw.default=ZB});var sq=H(hw=>{"use strict";Object.defineProperty(hw,"__esModule",{value:!0});var xf=je(),XB={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,xf.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,xf._)`{limit: ${t}}`},eV={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:XB,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?xf.operators.GT:xf.operators.LT;t.fail$data((0,xf._)`Object.keys(${r}).length ${i} ${n}`)}};hw.default=eV});var oq=H(mw=>{"use strict";Object.defineProperty(mw,"__esModule",{value:!0});var Ef=On(),If=je(),tV=Ke(),rV={message:({params:{missingProperty:t}})=>(0,If.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,If._)`{missingProperty: ${t}}`},nV={keyword:"required",type:"object",schemaType:"array",$data:!0,error:rV,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 f=r.length>=l.loopRequired;if(o.allErrors?c():p(),l.strictRequired){let v=t.parentSchema.properties,{definedProperties:_}=t.it;for(let w of r)if(v?.[w]===void 0&&!_.has(w)){let E=o.schemaEnv.baseId+o.errSchemaPath,k=`required property "${w}" is not defined at "${E}" (strictRequired)`;(0,tV.checkStrictMode)(o,k,o.opts.strictRequired)}}function c(){if(f||s)t.block$data(If.nil,h);else for(let v of r)(0,Ef.checkReportMissingProp)(t,v)}function p(){let v=e.let("missing");if(f||s){let _=e.let("valid",!0);t.block$data(_,()=>g(v,_)),t.ok(_)}else e.if((0,Ef.checkMissingProp)(t,r,v)),(0,Ef.reportMissingProp)(t,v),e.else()}function h(){e.forOf("prop",n,v=>{t.setParams({missingProperty:v}),e.if((0,Ef.noPropertyInData)(e,i,v,l.ownProperties),()=>t.error())})}function g(v,_){t.setParams({missingProperty:v}),e.forOf(v,n,()=>{e.assign(_,(0,Ef.propertyInData)(e,i,v,l.ownProperties)),e.if((0,If.not)(_),()=>{t.error(),e.break()})},If.nil)}}};mw.default=nV});var aq=H(gw=>{"use strict";Object.defineProperty(gw,"__esModule",{value:!0});var Of=je(),iV={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,Of.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,Of._)`{limit: ${t}}`},sV={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:iV,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?Of.operators.GT:Of.operators.LT;t.fail$data((0,Of._)`${r}.length ${i} ${n}`)}};gw.default=sV});var om=H(yw=>{"use strict";Object.defineProperty(yw,"__esModule",{value:!0});var lq=jS();lq.code='require("ajv/dist/runtime/equal").default';yw.default=lq});var uq=H(bw=>{"use strict";Object.defineProperty(bw,"__esModule",{value:!0});var vw=hf(),or=je(),oV=Ke(),aV=om(),lV={message:({params:{i:t,j:e}})=>(0,or.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,or._)`{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 f=e.let("valid"),c=s.items?(0,vw.getSchemaTypes)(s.items):[];t.block$data(f,p,(0,or._)`${o} === false`),t.ok(f);function p(){let _=e.let("i",(0,or._)`${r}.length`),w=e.let("j");t.setParams({i:_,j:w}),e.assign(f,!0),e.if((0,or._)`${_} > 1`,()=>(h()?g:v)(_,w))}function h(){return c.length>0&&!c.some(_=>_==="object"||_==="array")}function g(_,w){let E=e.name("item"),k=(0,vw.checkDataTypes)(c,E,l.opts.strictNumbers,vw.DataType.Wrong),T=e.const("indices",(0,or._)`{}`);e.for((0,or._)`;${_}--;`,()=>{e.let(E,(0,or._)`${r}[${_}]`),e.if(k,(0,or._)`continue`),c.length>1&&e.if((0,or._)`typeof ${E} == "string"`,(0,or._)`${E} += "_"`),e.if((0,or._)`typeof ${T}[${E}] == "number"`,()=>{e.assign(w,(0,or._)`${T}[${E}]`),t.error(),e.assign(f,!1).break()}).code((0,or._)`${T}[${E}] = ${_}`)})}function v(_,w){let E=(0,oV.useFunc)(e,aV.default),k=e.name("outer");e.label(k).for((0,or._)`;${_}--;`,()=>e.for((0,or._)`${w} = ${_}; ${w}--;`,()=>e.if((0,or._)`${E}(${r}[${_}], ${r}[${w}])`,()=>{t.error(),e.assign(f,!1).break(k)})))}}};bw.default=uV});var cq=H(ww=>{"use strict";Object.defineProperty(ww,"__esModule",{value:!0});var Sw=je(),cV=Ke(),fV=om(),dV={message:"must be equal to constant",params:({schemaCode:t})=>(0,Sw._)`{allowedValue: ${t}}`},pV={keyword:"const",$data:!0,error:dV,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,Sw._)`!${(0,cV.useFunc)(e,fV.default)}(${r}, ${i})`):t.fail((0,Sw._)`${s} !== ${r}`)}};ww.default=pV});var fq=H(_w=>{"use strict";Object.defineProperty(_w,"__esModule",{value:!0});var qf=je(),hV=Ke(),mV=om(),gV={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,qf._)`{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,f,c=()=>f??(f=(0,hV.useFunc)(e,mV.default)),p;if(l||n)p=e.let("valid"),t.block$data(p,h);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let v=e.const("vSchema",s);p=(0,qf.or)(...i.map((_,w)=>g(v,w)))}t.pass(p);function h(){e.assign(p,!1),e.forOf("v",s,v=>e.if((0,qf._)`${c()}(${r}, ${v})`,()=>e.assign(p,!0).break()))}function g(v,_){let w=i[_];return typeof w=="object"&&w!==null?(0,qf._)`${c()}(${r}, ${v}[${_}])`:(0,qf._)`${r} === ${w}`}}};_w.default=yV});var dq=H(Rw=>{"use strict";Object.defineProperty(Rw,"__esModule",{value:!0});var vV=XO(),bV=eq(),SV=nq(),wV=iq(),_V=sq(),RV=oq(),CV=aq(),xV=uq(),EV=cq(),IV=fq(),OV=[vV.default,bV.default,SV.default,wV.default,_V.default,RV.default,CV.default,xV.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},EV.default,IV.default];Rw.default=OV});var xw=H(kf=>{"use strict";Object.defineProperty(kf,"__esModule",{value:!0});kf.validateAdditionalItems=void 0;var Ca=je(),Cw=Ke(),qV={message:({params:{len:t}})=>(0,Ca.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Ca._)`{limit: ${t}}`},kV={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:qV,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,Cw.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}pq(t,n)}};function pq(t,e){let{gen:r,schema:n,data:i,keyword:s,it:o}=t;o.items=!0;let l=r.const("len",(0,Ca._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Ca._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,Cw.alwaysValidSchema)(o,n)){let c=r.var("valid",(0,Ca._)`${l} <= ${e.length}`);r.if((0,Ca.not)(c),()=>f(c)),t.ok(c)}function f(c){r.forRange("i",e.length,l,p=>{t.subschema({keyword:s,dataProp:p,dataPropType:Cw.Type.Num},c),o.allErrors||r.if((0,Ca.not)(c),()=>r.break())})}}kf.validateAdditionalItems=pq;kf.default=kV});var Ew=H(Pf=>{"use strict";Object.defineProperty(Pf,"__esModule",{value:!0});Pf.validateTuple=void 0;var hq=je(),am=Ke(),PV=On(),TV={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return mq(t,"additionalItems",e);r.items=!0,!(0,am.alwaysValidSchema)(r,e)&&t.ok((0,PV.validateArray)(t))}};function mq(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=am.mergeEvaluated.items(n,r.length,l.items));let f=n.name("valid"),c=n.const("len",(0,hq._)`${s}.length`);r.forEach((h,g)=>{(0,am.alwaysValidSchema)(l,h)||(n.if((0,hq._)`${c} > ${g}`,()=>t.subschema({keyword:o,schemaProp:g,dataProp:g},f)),t.ok(f))});function p(h){let{opts:g,errSchemaPath:v}=l,_=r.length,w=_===h.minItems&&(_===h.maxItems||h[e]===!1);if(g.strictTuples&&!w){let E=`"${o}" is ${_}-tuple, but minItems or maxItems/${e} are not specified or different at path "${v}"`;(0,am.checkStrictMode)(l,E,g.strictTuples)}}}Pf.validateTuple=mq;Pf.default=TV});var gq=H(Iw=>{"use strict";Object.defineProperty(Iw,"__esModule",{value:!0});var AV=Ew(),$V={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,AV.validateTuple)(t,"items")};Iw.default=$V});var vq=H(Ow=>{"use strict";Object.defineProperty(Ow,"__esModule",{value:!0});var yq=je(),NV=Ke(),MV=On(),FV=xw(),DV={message:({params:{len:t}})=>(0,yq.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,yq._)`{limit: ${t}}`},LV={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:DV,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,NV.alwaysValidSchema)(n,e)&&(i?(0,FV.validateAdditionalItems)(t,i):t.ok((0,MV.validateArray)(t)))}};Ow.default=LV});var bq=H(qw=>{"use strict";Object.defineProperty(qw,"__esModule",{value:!0});var kn=je(),lm=Ke(),jV={message:({params:{min:t,max:e}})=>e===void 0?(0,kn.str)`must contain at least ${t} valid item(s)`:(0,kn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,kn._)`{minContains: ${t}}`:(0,kn._)`{minContains: ${t}, maxContains: ${e}}`},UV={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:jV,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t,o,l,{minContains:f,maxContains:c}=n;s.opts.next?(o=f===void 0?1:f,l=c):o=1;let p=e.const("len",(0,kn._)`${i}.length`);if(t.setParams({min:o,max:l}),l===void 0&&o===0){(0,lm.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&o>l){(0,lm.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,lm.alwaysValidSchema)(s,r)){let w=(0,kn._)`${p} >= ${o}`;l!==void 0&&(w=(0,kn._)`${w} && ${p} <= ${l}`),t.pass(w);return}s.items=!0;let h=e.name("valid");l===void 0&&o===1?v(h,()=>e.if(h,()=>e.break())):o===0?(e.let(h,!0),l!==void 0&&e.if((0,kn._)`${i}.length > 0`,g)):(e.let(h,!1),g()),t.result(h,()=>t.reset());function g(){let w=e.name("_valid"),E=e.let("count",0);v(w,()=>e.if(w,()=>_(E)))}function v(w,E){e.forRange("i",0,p,k=>{t.subschema({keyword:"contains",dataProp:k,dataPropType:lm.Type.Num,compositeRule:!0},w),E()})}function _(w){e.code((0,kn._)`${w}++`),l===void 0?e.if((0,kn._)`${w} >= ${o}`,()=>e.assign(h,!0).break()):(e.if((0,kn._)`${w} > ${l}`,()=>e.assign(h,!1).break()),o===1?e.assign(h,!0):e.if((0,kn._)`${w} >= ${o}`,()=>e.assign(h,!0)))}}};qw.default=UV});var _q=H(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.validateSchemaDeps=qi.validatePropertyDeps=qi.error=void 0;var kw=je(),HV=Ke(),Tf=On();qi.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,kw.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,kw._)`{property: ${t},
27
+ || ${o} === "boolean" || ${i} === null`).assign(l,(0,qe._)`[${i}]`)}}}function cU({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,qe._)`${e} !== undefined`,()=>t.assign((0,qe._)`${e}[${r}]`,n))}function $S(t,e,r,n=eu.Correct){let i=n===eu.Correct?qe.operators.EQ:qe.operators.NEQ,s;switch(t){case"null":return(0,qe._)`${e} ${i} null`;case"array":s=(0,qe._)`Array.isArray(${e})`;break;case"object":s=(0,qe._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=o((0,qe._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=o();break;default:return(0,qe._)`typeof ${e} ${i} ${t}`}return n===eu.Correct?s:(0,qe.not)(s);function o(l=qe.nil){return(0,qe.and)((0,qe._)`typeof ${e} == "number"`,l,r?(0,qe._)`isFinite(${e})`:qe.nil)}}gr.checkDataType=$S;function NS(t,e,r,n){if(t.length===1)return $S(t[0],e,r,n);let i,s=(0,LI.toHash)(t);if(s.array&&s.object){let o=(0,qe._)`typeof ${e} != "object"`;i=s.null?o:(0,qe._)`!${e} || ${o}`,delete s.null,delete s.array,delete s.object}else i=qe.nil;s.number&&delete s.integer;for(let o in s)i=(0,qe.and)(i,$S(o,e,r,n));return i}gr.checkDataTypes=NS;var fU={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,qe._)`{type: ${t}}`:(0,qe._)`{type: ${e}}`};function MS(t){let e=dU(t);(0,sU.reportError)(e,fU)}gr.reportTypeError=MS;function dU(t){let{gen:e,data:r,schema:n}=t,i=(0,LI.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var BI=H(Wh=>{"use strict";Object.defineProperty(Wh,"__esModule",{value:!0});Wh.assignDefaults=void 0;var tu=je(),pU=Ke();function hU(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)HI(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>HI(t,s,i.default))}Wh.assignDefaults=hU;function HI(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,pU.checkStrictMode)(t,`default is ignored for: ${l}`);return}let f=(0,tu._)`${l} === undefined`;o.useDefaults==="empty"&&(f=(0,tu._)`${f} || ${l} === null || ${l} === ""`),n.if(f,(0,tu._)`${l} = ${(0,tu.stringify)(r)}`)}});var On=H(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.validateUnion=vt.validateArray=vt.usePattern=vt.callValidateCode=vt.schemaProperties=vt.allSchemaProperties=vt.noPropertyInData=vt.propertyInData=vt.isOwnProperty=vt.hasPropFunc=vt.reportMissingProp=vt.checkMissingProp=vt.checkReportMissingProp=void 0;var Et=je(),FS=Ke(),Qs=ls(),mU=Ke();function gU(t,e){let{gen:r,data:n,it:i}=t;r.if(LS(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Et._)`${e}`},!0),t.error()})}vt.checkReportMissingProp=gU;function yU({gen:t,data:e,it:{opts:r}},n,i){return(0,Et.or)(...n.map(s=>(0,Et.and)(LS(t,e,s,r.ownProperties),(0,Et._)`${i} = ${s}`)))}vt.checkMissingProp=yU;function vU(t,e){t.setParams({missingProperty:e},!0),t.error()}vt.reportMissingProp=vU;function VI(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Et._)`Object.prototype.hasOwnProperty`})}vt.hasPropFunc=VI;function DS(t,e,r){return(0,Et._)`${VI(t)}.call(${e}, ${r})`}vt.isOwnProperty=DS;function bU(t,e,r,n){let i=(0,Et._)`${e}${(0,Et.getProperty)(r)} !== undefined`;return n?(0,Et._)`${i} && ${DS(t,e,r)}`:i}vt.propertyInData=bU;function LS(t,e,r,n){let i=(0,Et._)`${e}${(0,Et.getProperty)(r)} === undefined`;return n?(0,Et.or)(i,(0,Et.not)(DS(t,e,r))):i}vt.noPropertyInData=LS;function WI(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}vt.allSchemaProperties=WI;function SU(t,e){return WI(e).filter(r=>!(0,FS.alwaysValidSchema)(t,e[r]))}vt.schemaProperties=SU;function wU({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:o},l,f,c){let p=c?(0,Et._)`${t}, ${e}, ${n}${i}`:e,h=[[Qs.default.instancePath,(0,Et.strConcat)(Qs.default.instancePath,s)],[Qs.default.parentData,o.parentData],[Qs.default.parentDataProperty,o.parentDataProperty],[Qs.default.rootData,Qs.default.rootData]];o.opts.dynamicRef&&h.push([Qs.default.dynamicAnchors,Qs.default.dynamicAnchors]);let g=(0,Et._)`${p}, ${r.object(...h)}`;return f!==Et.nil?(0,Et._)`${l}.call(${f}, ${g})`:(0,Et._)`${l}(${g})`}vt.callValidateCode=wU;var _U=(0,Et._)`new RegExp`;function RU({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,Et._)`${i.code==="new RegExp"?_U:(0,mU.useFunc)(t,i)}(${r}, ${n})`})}vt.usePattern=RU;function CU(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 f=e.const("len",(0,Et._)`${r}.length`);e.forRange("i",0,f,c=>{t.subschema({keyword:n,dataProp:c,dataPropType:FS.Type.Num},s),e.if((0,Et.not)(s),l)})}}vt.validateArray=CU;function xU(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(f=>(0,FS.alwaysValidSchema)(i,f))&&!i.opts.unevaluated)return;let o=e.let("valid",!1),l=e.name("_valid");e.block(()=>r.forEach((f,c)=>{let p=t.subschema({keyword:n,schemaProp:c,compositeRule:!0},l);e.assign(o,(0,Et._)`${o} || ${l}`),t.mergeValidEvaluated(p,l)||e.if((0,Et.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}vt.validateUnion=xU});var GI=H(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.validateKeywordUsage=Ii.validSchemaType=Ii.funcKeywordCode=Ii.macroKeywordCode=void 0;var Ar=je(),Sa=ls(),EU=On(),IU=pf();function OU(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:o}=t,l=e.macro.call(o.self,i,s,o),f=JI(r,n,l);o.opts.validateSchema!==!1&&o.self.validateSchema(l,!0);let c=r.name("valid");t.subschema({schema:l,schemaPath:Ar.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:f,compositeRule:!0},c),t.pass(c,()=>t.error(!0))}Ii.macroKeywordCode=OU;function qU(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:o,$data:l,it:f}=t;PU(f,e);let c=!l&&e.compile?e.compile.call(f.self,s,o,f):e.validate,p=JI(n,i,c),h=n.let("valid");t.block$data(h,g),t.ok((r=e.valid)!==null&&r!==void 0?r:h);function g(){if(e.errors===!1)w(),e.modifying&&zI(t),E(()=>t.error());else{let k=e.async?v():_();e.modifying&&zI(t),E(()=>kU(t,k))}}function v(){let k=n.let("ruleErrs",null);return n.try(()=>w((0,Ar._)`await `),T=>n.assign(h,!1).if((0,Ar._)`${T} instanceof ${f.ValidationError}`,()=>n.assign(k,(0,Ar._)`${T}.errors`),()=>n.throw(T))),k}function _(){let k=(0,Ar._)`${p}.errors`;return n.assign(k,null),w(Ar.nil),k}function w(k=e.async?(0,Ar._)`await `:Ar.nil){let T=f.opts.passContext?Sa.default.this:Sa.default.self,N=!("compile"in e&&!l||e.schema===!1);n.assign(h,(0,Ar._)`${k}${(0,EU.callValidateCode)(t,p,T,N)}`,e.modifying)}function E(k){var T;n.if((0,Ar.not)((T=e.valid)!==null&&T!==void 0?T:h),k)}}Ii.funcKeywordCode=qU;function zI(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Ar._)`${n.parentData}[${n.parentDataProperty}]`))}function kU(t,e){let{gen:r}=t;r.if((0,Ar._)`Array.isArray(${e})`,()=>{r.assign(Sa.default.vErrors,(0,Ar._)`${Sa.default.vErrors} === null ? ${e} : ${Sa.default.vErrors}.concat(${e})`).assign(Sa.default.errors,(0,Ar._)`${Sa.default.vErrors}.length`),(0,IU.extendErrors)(t)},()=>t.error())}function PU({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function JI(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,Ar.stringify)(r)})}function TU(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")}Ii.validSchemaType=TU;function AU({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 f=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(f);else throw new Error(f)}}Ii.validateKeywordUsage=AU});var KI=H(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.extendSubschemaMode=Zs.extendSubschemaData=Zs.getSubschema=void 0;var Oi=je(),YI=Ke();function $U(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,Oi._)`${t.schemaPath}${(0,Oi.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,Oi._)`${t.schemaPath}${(0,Oi.getProperty)(e)}${(0,Oi.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,YI.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')}Zs.getSubschema=$U;function NU(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:c,dataPathArr:p,opts:h}=e,g=l.let("data",(0,Oi._)`${e.data}${(0,Oi.getProperty)(r)}`,!0);f(g),t.errorPath=(0,Oi.str)`${c}${(0,YI.getErrorPath)(r,n,h.jsPropertySyntax)}`,t.parentDataProperty=(0,Oi._)`${r}`,t.dataPathArr=[...p,t.parentDataProperty]}if(i!==void 0){let c=i instanceof Oi.Name?i:l.let("data",i,!0);f(c),o!==void 0&&(t.propertyName=o)}s&&(t.dataTypes=s);function f(c){t.data=c,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,c]}}Zs.extendSubschemaData=NU;function MU(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}Zs.extendSubschemaMode=MU});var jS=H((xQ,QI)=>{"use strict";QI.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 XI=H((EQ,ZI)=>{"use strict";var Xs=ZI.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(){};zh(e,n,i,t,"",t)};Xs.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Xs.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Xs.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Xs.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 zh(t,e,r,n,i,s,o,l,f,c){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,o,l,f,c);for(var p in n){var h=n[p];if(Array.isArray(h)){if(p in Xs.arrayKeywords)for(var g=0;g<h.length;g++)zh(t,e,r,h[g],i+"/"+p+"/"+g,s,i,p,n,g)}else if(p in Xs.propsKeywords){if(h&&typeof h=="object")for(var v in h)zh(t,e,r,h[v],i+"/"+p+"/"+FU(v),s,i,p,n,v)}else(p in Xs.keywords||t.allKeys&&!(p in Xs.skipKeywords))&&zh(t,e,r,h,i+"/"+p,s,i,p,n)}r(n,i,s,o,l,f,c)}}function FU(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var mf=H(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.getSchemaRefs=Wr.resolveUrl=Wr.normalizeId=Wr._getFullPath=Wr.getFullPath=Wr.inlineRef=void 0;var DU=Ke(),LU=jS(),jU=XI(),UU=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function HU(t,e=!0){return typeof t=="boolean"?!0:e===!0?!US(t):e?eO(t)<=e:!1}Wr.inlineRef=HU;var BU=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function US(t){for(let e in t){if(BU.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(US)||typeof r=="object"&&US(r))return!0}return!1}function eO(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!UU.has(r)&&(typeof t[r]=="object"&&(0,DU.eachItem)(t[r],n=>e+=eO(n)),e===1/0))return 1/0}return e}function tO(t,e="",r){r!==!1&&(e=ru(e));let n=t.parse(e);return rO(t,n)}Wr.getFullPath=tO;function rO(t,e){return t.serialize(e).split("#")[0]+"#"}Wr._getFullPath=rO;var VU=/#\/?$/;function ru(t){return t?t.replace(VU,""):""}Wr.normalizeId=ru;function WU(t,e,r){return r=ru(r),t.resolve(e,r)}Wr.resolveUrl=WU;var zU=/^[a-z_][-a-z0-9._]*$/i;function JU(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=ru(t[r]||e),s={"":i},o=tO(n,i,!1),l={},f=new Set;return jU(t,{allKeys:!0},(h,g,v,_)=>{if(_===void 0)return;let w=o+g,E=s[_];typeof h[r]=="string"&&(E=k.call(this,h[r])),T.call(this,h.$anchor),T.call(this,h.$dynamicAnchor),s[g]=E;function k(N){let $=this.opts.uriResolver.resolve;if(N=ru(E?$(E,N):N),f.has(N))throw p(N);f.add(N);let j=this.refs[N];return typeof j=="string"&&(j=this.refs[j]),typeof j=="object"?c(h,j.schema,N):N!==ru(w)&&(N[0]==="#"?(c(h,l[N],N),l[N]=h):this.refs[N]=w),N}function T(N){if(typeof N=="string"){if(!zU.test(N))throw new Error(`invalid anchor "${N}"`);k.call(this,`#${N}`)}}}),l;function c(h,g,v){if(g!==void 0&&!LU(h,g))throw p(v)}function p(h){return new Error(`reference "${h}" resolves to more than one schema`)}}Wr.getSchemaRefs=JU});var vf=H(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.getData=eo.KeywordCxt=eo.validateFunctionCode=void 0;var aO=MI(),nO=hf(),BS=AS(),Jh=hf(),GU=BI(),yf=GI(),HS=KI(),ye=je(),Ce=ls(),YU=mf(),us=Ke(),gf=pf();function KU(t){if(cO(t)&&(fO(t),uO(t))){XU(t);return}lO(t,()=>(0,aO.topBoolOrEmptySchema)(t))}eo.validateFunctionCode=KU;function lO({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,ye._)`${Ce.default.data}, ${Ce.default.valCxt}`,n.$async,()=>{t.code((0,ye._)`"use strict"; ${iO(r,i)}`),ZU(t,i),t.code(s)}):t.func(e,(0,ye._)`${Ce.default.data}, ${QU(i)}`,n.$async,()=>t.code(iO(r,i)).code(s))}function QU(t){return(0,ye._)`{${Ce.default.instancePath}="", ${Ce.default.parentData}, ${Ce.default.parentDataProperty}, ${Ce.default.rootData}=${Ce.default.data}${t.dynamicRef?(0,ye._)`, ${Ce.default.dynamicAnchors}={}`:ye.nil}}={}`}function ZU(t,e){t.if(Ce.default.valCxt,()=>{t.var(Ce.default.instancePath,(0,ye._)`${Ce.default.valCxt}.${Ce.default.instancePath}`),t.var(Ce.default.parentData,(0,ye._)`${Ce.default.valCxt}.${Ce.default.parentData}`),t.var(Ce.default.parentDataProperty,(0,ye._)`${Ce.default.valCxt}.${Ce.default.parentDataProperty}`),t.var(Ce.default.rootData,(0,ye._)`${Ce.default.valCxt}.${Ce.default.rootData}`),e.dynamicRef&&t.var(Ce.default.dynamicAnchors,(0,ye._)`${Ce.default.valCxt}.${Ce.default.dynamicAnchors}`)},()=>{t.var(Ce.default.instancePath,(0,ye._)`""`),t.var(Ce.default.parentData,(0,ye._)`undefined`),t.var(Ce.default.parentDataProperty,(0,ye._)`undefined`),t.var(Ce.default.rootData,Ce.default.data),e.dynamicRef&&t.var(Ce.default.dynamicAnchors,(0,ye._)`{}`)})}function XU(t){let{schema:e,opts:r,gen:n}=t;lO(t,()=>{r.$comment&&e.$comment&&pO(t),iH(t),n.let(Ce.default.vErrors,null),n.let(Ce.default.errors,0),r.unevaluated&&eH(t),dO(t),aH(t)})}function eH(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,ye._)`${r}.evaluated`),e.if((0,ye._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,ye._)`${t.evaluated}.props`,(0,ye._)`undefined`)),e.if((0,ye._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,ye._)`${t.evaluated}.items`,(0,ye._)`undefined`))}function iO(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,ye._)`/*# sourceURL=${r} */`:ye.nil}function tH(t,e){if(cO(t)&&(fO(t),uO(t))){rH(t,e);return}(0,aO.boolOrEmptySchema)(t,e)}function uO({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 cO(t){return typeof t.schema!="boolean"}function rH(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&pO(t),sH(t),oH(t);let s=n.const("_errs",Ce.default.errors);dO(t,s),n.var(e,(0,ye._)`${s} === ${Ce.default.errors}`)}function fO(t){(0,us.checkUnknownRules)(t),nH(t)}function dO(t,e){if(t.opts.jtd)return sO(t,[],!1,e);let r=(0,nO.getSchemaTypes)(t.schema),n=(0,nO.coerceAndCheckDataType)(t,r);sO(t,r,!n,e)}function nH(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,us.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function iH(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,us.checkStrictMode)(t,"default is ignored in the schema root")}function sH(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,YU.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function oH(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function pO({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,ye._)`${Ce.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let o=(0,ye.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,ye._)`${Ce.default.self}.opts.$comment(${s}, ${o}, ${l}.schema)`)}}function aH(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,ye._)`${Ce.default.errors} === 0`,()=>e.return(Ce.default.data),()=>e.throw((0,ye._)`new ${i}(${Ce.default.vErrors})`)):(e.assign((0,ye._)`${n}.errors`,Ce.default.vErrors),s.unevaluated&&lH(t),e.return((0,ye._)`${Ce.default.errors} === 0`))}function lH({gen:t,evaluated:e,props:r,items:n}){r instanceof ye.Name&&t.assign((0,ye._)`${e}.props`,r),n instanceof ye.Name&&t.assign((0,ye._)`${e}.items`,n)}function sO(t,e,r,n){let{gen:i,schema:s,data:o,allErrors:l,opts:f,self:c}=t,{RULES:p}=c;if(s.$ref&&(f.ignoreKeywordsWithRef||!(0,us.schemaHasRulesButRef)(s,p))){i.block(()=>mO(t,"$ref",p.all.$ref.definition));return}f.jtd||uH(t,e),i.block(()=>{for(let g of p.rules)h(g);h(p.post)});function h(g){(0,BS.shouldUseGroup)(s,g)&&(g.type?(i.if((0,Jh.checkDataType)(g.type,o,f.strictNumbers)),oO(t,g),e.length===1&&e[0]===g.type&&r&&(i.else(),(0,Jh.reportTypeError)(t)),i.endIf()):oO(t,g),l||i.if((0,ye._)`${Ce.default.errors} === ${n||0}`))}}function oO(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,GU.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,BS.shouldUseRule)(n,s)&&mO(t,s.keyword,s.definition,e.type)})}function uH(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(cH(t,e),t.opts.allowUnionTypes||fH(t,e),dH(t,t.dataTypes))}function cH(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{hO(t.dataTypes,r)||VS(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),hH(t,e)}}function fH(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&VS(t,"use allowUnionTypes to allow union type keyword")}function dH(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,BS.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(o=>pH(e,o))&&VS(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function pH(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function hO(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function hH(t,e){let r=[];for(let n of t.dataTypes)hO(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function VS(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,us.checkStrictMode)(t,e,t.opts.strictTypes)}var Gh=class{constructor(e,r,n){if((0,yf.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,us.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",gO(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,yf.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",Ce.default.errors))}result(e,r,n){this.failResult((0,ye.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,ye.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,ye._)`${r} !== undefined && (${(0,ye.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?gf.reportExtraError:gf.reportError)(this,this.def.error,r)}$dataError(){(0,gf.reportError)(this,this.def.$dataError||gf.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,gf.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=ye.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=ye.nil,r=ye.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:o}=this;n.if((0,ye.or)((0,ye._)`${i} === undefined`,r)),e!==ye.nil&&n.assign(e,!0),(s.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==ye.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,ye.or)(o(),l());function o(){if(n.length){if(!(r instanceof ye.Name))throw new Error("ajv implementation error");let f=Array.isArray(n)?n:[n];return(0,ye._)`${(0,Jh.checkDataTypes)(f,r,s.opts.strictNumbers,Jh.DataType.Wrong)}`}return ye.nil}function l(){if(i.validateSchema){let f=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,ye._)`!${f}(${r})`}return ye.nil}}subschema(e,r){let n=(0,HS.getSubschema)(this.it,e);(0,HS.extendSubschemaData)(n,this.it,e),(0,HS.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=us.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=us.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,ye.Name)),!0}};eo.KeywordCxt=Gh;function mO(t,e,r,n){let i=new Gh(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,yf.funcKeywordCode)(i,r):"macro"in r?(0,yf.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,yf.funcKeywordCode)(i,r)}var mH=/^\/(?:[^~]|~0|~1)*$/,gH=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function gO(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return Ce.default.rootData;if(t[0]==="/"){if(!mH.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=Ce.default.rootData}else{let c=gH.exec(t);if(!c)throw new Error(`Invalid JSON-pointer: ${t}`);let p=+c[1];if(i=c[2],i==="#"){if(p>=e)throw new Error(f("property/index",p));return n[e-p]}if(p>e)throw new Error(f("data",p));if(s=r[e-p],!i)return s}let o=s,l=i.split("/");for(let c of l)c&&(s=(0,ye._)`${s}${(0,ye.getProperty)((0,us.unescapeJsonPointer)(c))}`,o=(0,ye._)`${o} && ${s}`);return o;function f(c,p){return`Cannot access ${c} ${p} levels up, current level is ${e}`}}eo.getData=gO});var Yh=H(zS=>{"use strict";Object.defineProperty(zS,"__esModule",{value:!0});var WS=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};zS.default=WS});var bf=H(YS=>{"use strict";Object.defineProperty(YS,"__esModule",{value:!0});var JS=mf(),GS=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,JS.resolveUrl)(e,r,n),this.missingSchema=(0,JS.normalizeId)((0,JS.getFullPath)(e,this.missingRef))}};YS.default=GS});var Qh=H(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});qn.resolveSchema=qn.getCompilingSchema=qn.resolveRef=qn.compileSchema=qn.SchemaEnv=void 0;var Xn=je(),yH=Yh(),wa=ls(),ei=mf(),yO=Ke(),vH=vf(),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,ei.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};qn.SchemaEnv=nu;function QS(t){let e=vO.call(this,t);if(e)return e;let r=(0,ei.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,o=new Xn.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),l;t.$async&&(l=o.scopeValue("Error",{ref:yH.default,code:(0,Xn._)`require("ajv/dist/runtime/validation_error").default`}));let f=o.scopeName("validate");t.validateName=f;let c={gen:o,allErrors:this.opts.allErrors,data:wa.default.data,parentData:wa.default.parentData,parentDataProperty:wa.default.parentDataProperty,dataNames:[wa.default.data],dataPathArr:[Xn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Xn.stringify)(t.schema)}:{ref:t.schema}),validateName:f,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Xn.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Xn._)`""`,opts:this.opts,self:this},p;try{this._compilations.add(t),(0,vH.validateFunctionCode)(c),o.optimize(this.opts.code.optimize);let h=o.toString();p=`${o.scopeRefs(wa.default.scope)}return ${h}`,this.opts.code.process&&(p=this.opts.code.process(p,t));let v=new Function(`${wa.default.self}`,`${wa.default.scope}`,p)(this,this.scope.get());if(this.scope.value(f,{ref:v}),v.errors=null,v.schema=t.schema,v.schemaEnv=t,t.$async&&(v.$async=!0),this.opts.code.source===!0&&(v.source={validateName:f,validateCode:h,scopeValues:o._values}),this.opts.unevaluated){let{props:_,items:w}=c;v.evaluated={props:_ instanceof Xn.Name?void 0:_,items:w instanceof Xn.Name?void 0:w,dynamicProps:_ instanceof Xn.Name,dynamicItems:w instanceof Xn.Name},v.source&&(v.source.evaluated=(0,Xn.stringify)(v.evaluated))}return t.validate=v,t}catch(h){throw delete t.validate,delete t.validateName,p&&this.logger.error("Error compiling schema, function code:",p),h}finally{this._compilations.delete(t)}}qn.compileSchema=QS;function bH(t,e,r){var n;r=(0,ei.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=_H.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]=SH.call(this,s)}qn.resolveRef=bH;function SH(t){return(0,ei.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:QS.call(this,t)}function vO(t){for(let e of this._compilations)if(wH(e,t))return e}qn.getCompilingSchema=vO;function wH(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function _H(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Kh.call(this,t,e)}function Kh(t,e){let r=this.opts.uriResolver.parse(e),n=(0,ei._getFullPath)(this.opts.uriResolver,r),i=(0,ei.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return KS.call(this,r,t);let s=(0,ei.normalizeId)(n),o=this.refs[s]||this.schemas[s];if(typeof o=="string"){let l=Kh.call(this,t,o);return typeof l?.schema!="object"?void 0:KS.call(this,r,l)}if(typeof o?.schema=="object"){if(o.validate||QS.call(this,o),s===(0,ei.normalizeId)(e)){let{schema:l}=o,{schemaId:f}=this.opts,c=l[f];return c&&(i=(0,ei.resolveUrl)(this.opts.uriResolver,i,c)),new nu({schema:l,schemaId:f,root:t,baseId:i})}return KS.call(this,r,o)}}qn.resolveSchema=Kh;var RH=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function KS(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 f=r[(0,yO.unescapeFragment)(l)];if(f===void 0)return;r=f;let c=typeof r=="object"&&r[this.opts.schemaId];!RH.has(l)&&c&&(e=(0,ei.resolveUrl)(this.opts.uriResolver,e,c))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,yO.schemaHasRulesButRef)(r,this.RULES)){let l=(0,ei.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=Kh.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 bO=H((TQ,CH)=>{CH.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 ew=H((AQ,xO)=>{"use strict";var xH=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),wO=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),ZS=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),_O=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),EH=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function XS(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 IH=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function SO(t){return t.length=0,!0}function OH(t,e,r){if(t.length){let n=XS(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function qH(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,o=!1,l=OH;for(let f=0;f<t.length;f++){let c=t[f];if(!(c==="["||c==="]"))if(c===":"){if(s===!0&&(o=!0),!l(i,n,r))break;if(++e>7){r.error=!0;break}f>0&&t[f-1]===":"&&(s=!0),n.push(":");continue}else if(c==="%"){if(!l(i,n,r))break;l=SO}else{i.push(c);continue}}return i.length&&(l===SO?r.zone=i.join(""):o?n.push(i.join("")):n.push(XS(i))),r.address=n.join(""),r}function RO(t){if(kH(t,":")<2)return{host:t,isIPV6:!1};let e=qH(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 kH(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function PH(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 TH={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},AH=/[@/?#:]/g,$H=/[@/?#]/g;function CO(t,e){let r=e?$H:AH;return r.lastIndex=0,t.replace(r,n=>TH[n])}function NH(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(ZS(i)){let s=i.toUpperCase(),o=String.fromCharCode(parseInt(s,16));e&&_O(o)?r+=o:r+="%"+s,n+=2;continue}}r+=t[n]}return r}function MH(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(ZS(n)){let i=n.toUpperCase(),s=String.fromCharCode(parseInt(i,16));s!=="."&&_O(s)?e+=s:e+="%"+i,r+=2;continue}}EH(t[r])?e+=t[r]:e+=escape(t[r])}return e}function FH(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(ZS(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function DH(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!wO(r)){let n=RO(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=CO(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}xO.exports={nonSimpleDomain:IH,recomposeAuthority:DH,reescapeHostDelimiters:CO,normalizePercentEncoding:NH,normalizePathEncoding:MH,escapePreservingEscapes:FH,removeDotSegments:PH,isIPv4:wO,isUUID:xH,normalizeIPv6:RO,stringArrayToHexStripped:XS}});var kO=H(($Q,qO)=>{"use strict";var{isUUID:LH}=ew(),jH=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,UH=["http","https","ws","wss","urn","urn:uuid"];function HH(t){return UH.indexOf(t)!==-1}function tw(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 EO(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function IO(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 BH(t){return t.secure=tw(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function VH(t){if((t.port===(tw(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 WH(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(jH);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=rw(i);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function zH(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=rw(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 JH(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!LH(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function GH(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var OO={scheme:"http",domainHost:!0,parse:EO,serialize:IO},YH={scheme:"https",domainHost:OO.domainHost,parse:EO,serialize:IO},Zh={scheme:"ws",domainHost:!0,parse:BH,serialize:VH},KH={scheme:"wss",domainHost:Zh.domainHost,parse:Zh.parse,serialize:Zh.serialize},QH={scheme:"urn",parse:WH,serialize:zH,skipNormalize:!0},ZH={scheme:"urn:uuid",parse:JH,serialize:GH,skipNormalize:!0},Xh={http:OO,https:YH,ws:Zh,wss:KH,urn:QH,"urn:uuid":ZH};Object.setPrototypeOf(Xh,null);function rw(t){return t&&(Xh[t]||Xh[t.toLowerCase()])||void 0}qO.exports={wsIsSecure:tw,SCHEMES:Xh,isValidSchemeName:HH,getSchemeHandler:rw}});var MO=H((NQ,em)=>{"use strict";var{normalizeIPv6:XH,removeDotSegments:Sf,recomposeAuthority:eB,normalizePercentEncoding:tB,normalizePathEncoding:rB,escapePreservingEscapes:nB,reescapeHostDelimiters:iB,isIPv4:sB,nonSimpleDomain:oB}=ew(),{SCHEMES:aB,getSchemeHandler:TO}=kO();function lB(t,e){return typeof t=="string"?t=pB(t,e):typeof t=="object"&&(t=iu(_a(t,e),e)),t}function uB(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=AO(iu(t,n),iu(e,n),n,!0);return n.skipEscape=!0,_a(i,n)}function AO(t,e,r,n){let i={};return n||(t=iu(_a(t,r),r),e=iu(_a(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=Sf(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=Sf(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=Sf(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=Sf(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 cB(t,e,r){let n=PO(t,r),i=PO(e,r);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()}function _a(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=TO(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=eB(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=Sf(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 fB=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function dB(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 $O(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(fB);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=dB(n,o);if(l!==void 0&&(n.error=n.error||l,i=!0),n.host)if(sB(n.host)===!1){let p=XH(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 f=TO(r.scheme||n.scheme);if(!r.unicodeSupport&&(!f||!f.unicodeSupport)&&n.host&&(r.domainHost||f&&f.domainHost)&&s===!1&&oB(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(c){n.error=n.error||"Host's domain name can not be converted to ASCII: "+c}if((!f||f&&!f.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=iB(unescape(n.host),s))),n.path&&(n.path=rB(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}f&&f.parse&&f.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:i}}function iu(t,e){return $O(t,e).parsed}function pB(t,e){return NO(t,e).normalized}function NO(t,e){let{parsed:r,malformedAuthorityOrPort:n}=$O(t,e);return{normalized:n?t:_a(r,e),malformedAuthorityOrPort:n}}function PO(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=NO(t,e);return n?void 0:r}if(typeof t=="object")return _a(t,e)}var nw={SCHEMES:aB,normalize:lB,resolve:uB,resolveComponent:AO,equal:cB,serialize:_a,parse:iu};em.exports=nw;em.exports.default=nw;em.exports.fastUri=nw});var DO=H(iw=>{"use strict";Object.defineProperty(iw,"__esModule",{value:!0});var FO=MO();FO.code='require("ajv/dist/runtime/uri").default';iw.default=FO});var zO=H(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.CodeGen=ar.Name=ar.nil=ar.stringify=ar.str=ar._=ar.KeywordCxt=void 0;var hB=vf();Object.defineProperty(ar,"KeywordCxt",{enumerable:!0,get:function(){return hB.KeywordCxt}});var su=je();Object.defineProperty(ar,"_",{enumerable:!0,get:function(){return su._}});Object.defineProperty(ar,"str",{enumerable:!0,get:function(){return su.str}});Object.defineProperty(ar,"stringify",{enumerable:!0,get:function(){return su.stringify}});Object.defineProperty(ar,"nil",{enumerable:!0,get:function(){return su.nil}});Object.defineProperty(ar,"Name",{enumerable:!0,get:function(){return su.Name}});Object.defineProperty(ar,"CodeGen",{enumerable:!0,get:function(){return su.CodeGen}});var mB=Yh(),BO=bf(),gB=TS(),wf=Qh(),yB=je(),_f=mf(),tm=hf(),ow=Ke(),LO=bO(),vB=DO(),VO=(t,e)=>new RegExp(t,e);VO.code="new RegExp";var bB=["removeAdditional","useDefaults","coerceTypes"],SB=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),wB={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."},_B={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},jO=200;function RB(t){var e,r,n,i,s,o,l,f,c,p,h,g,v,_,w,E,k,T,N,$,j,G,q,C,A;let D=t.strict,B=(e=t.code)===null||e===void 0?void 0:e.optimize,F=B===!0||B===void 0?1:B||0,K=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:VO,ee=(i=t.uriResolver)!==null&&i!==void 0?i:vB.default;return{strictSchema:(o=(s=t.strictSchema)!==null&&s!==void 0?s:D)!==null&&o!==void 0?o:!0,strictNumbers:(f=(l=t.strictNumbers)!==null&&l!==void 0?l:D)!==null&&f!==void 0?f:!0,strictTypes:(p=(c=t.strictTypes)!==null&&c!==void 0?c:D)!==null&&p!==void 0?p:"log",strictTuples:(g=(h=t.strictTuples)!==null&&h!==void 0?h:D)!==null&&g!==void 0?g:"log",strictRequired:(_=(v=t.strictRequired)!==null&&v!==void 0?v:D)!==null&&_!==void 0?_:!1,code:t.code?{...t.code,optimize:F,regExp:K}:{optimize:F,regExp:K},loopRequired:(w=t.loopRequired)!==null&&w!==void 0?w:jO,loopEnum:(E=t.loopEnum)!==null&&E!==void 0?E:jO,meta:(k=t.meta)!==null&&k!==void 0?k:!0,messages:(T=t.messages)!==null&&T!==void 0?T:!0,inlineRefs:(N=t.inlineRefs)!==null&&N!==void 0?N:!0,schemaId:($=t.schemaId)!==null&&$!==void 0?$:"$id",addUsedSchema:(j=t.addUsedSchema)!==null&&j!==void 0?j:!0,validateSchema:(G=t.validateSchema)!==null&&G!==void 0?G:!0,validateFormats:(q=t.validateFormats)!==null&&q!==void 0?q:!0,unicodeRegExp:(C=t.unicodeRegExp)!==null&&C!==void 0?C:!0,int32range:(A=t.int32range)!==null&&A!==void 0?A:!0,uriResolver:ee}}var Rf=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,...RB(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new yB.ValueScope({scope:{},prefixes:SB,es5:r,lines:n}),this.logger=qB(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,gB.getRules)(),UO.call(this,wB,e,"NOT SUPPORTED"),UO.call(this,_B,e,"DEPRECATED","warn"),this._metaOpts=IB.call(this),e.formats&&xB.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&EB.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),CB.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=LO;n==="id"&&(i={...LO},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,h){await s.call(this,p.$schema);let g=this._addSchema(p,h);return g.validate||o.call(this,g)}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(h){if(!(h instanceof BO.default))throw h;return l.call(this,h),await f.call(this,h.missingSchema),o.call(this,p)}}function l({missingSchema:p,missingRef:h}){if(this.refs[p])throw new Error(`AnySchema ${p} is loaded but ${h} cannot be resolved`)}async function f(p){let h=await c.call(this,p);this.refs[p]||await s.call(this,h.$schema),this.refs[p]||this.addSchema(h,p,r)}async function c(p){let h=this._loading[p];if(h)return h;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,_f.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=HO.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new wf.SchemaEnv({schema:{},schemaId:n});if(r=wf.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=HO.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,_f.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(PB.call(this,n,r),!r)return(0,ow.eachItem)(n,s=>sw.call(this,s)),this;AB.call(this,r);let i={...r,type:(0,tm.getJSONTypes)(r.type),schemaType:(0,tm.getJSONTypes)(r.schemaType)};return(0,ow.eachItem)(n,i.type.length===0?s=>sw.call(this,s,i):s=>i.type.forEach(o=>sw.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 f=n[l];if(typeof f!="object")continue;let{$data:c}=f.definition,p=o[l];c&&p&&(o[l]=WO(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 f=this._cache.get(e);if(f!==void 0)return f;n=(0,_f.normalizeId)(o||n);let c=_f.getSchemaRefs.call(this,e,n);return f=new wf.SchemaEnv({schema:e,schemaId:l,meta:r,baseId:n,localRefs:c}),this._cache.set(f.schema,f),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=f),i&&this.validateSchema(e,!0),f}_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):wf.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{wf.compileSchema.call(this,e)}finally{this.opts=r}}};Rf.ValidationError=mB.default;Rf.MissingRefError=BO.default;ar.default=Rf;function UO(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 HO(t){return t=(0,_f.normalizeId)(t),this.schemas[t]||this.refs[t]}function CB(){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 xB(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function EB(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 IB(){let t={...this.opts};for(let e of bB)delete t[e];return t}var OB={log(){},warn(){},error(){}};function qB(t){if(t===!1)return OB;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 kB=/^[a-z_$][a-z0-9_$:-]*$/i;function PB(t,e){let{RULES:r}=this;if((0,ow.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!kB.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 sw(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:f})=>f===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,tm.getJSONTypes)(e.type),schemaType:(0,tm.getJSONTypes)(e.schemaType)}};e.before?TB.call(this,o,l,e.before):o.rules.push(l),s.all[t]=l,(n=e.implements)===null||n===void 0||n.forEach(f=>this.addKeyword(f))}function TB(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 AB(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=WO(e)),t.validateSchema=this.compile(e,!0))}var $B={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function WO(t){return{anyOf:[t,$B]}}});var JO=H(aw=>{"use strict";Object.defineProperty(aw,"__esModule",{value:!0});var NB={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};aw.default=NB});var QO=H(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});Ra.callRef=Ra.getValidate=void 0;var MB=bf(),GO=On(),zr=je(),ou=ls(),YO=Qh(),rm=Ke(),FB={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:s,validateName:o,opts:l,self:f}=n,{root:c}=s;if((r==="#"||r==="#/")&&i===c.baseId)return h();let p=YO.resolveRef.call(f,c,i,r);if(p===void 0)throw new MB.default(n.opts.uriResolver,i,r);if(p instanceof YO.SchemaEnv)return g(p);return v(p);function h(){if(s===c)return nm(t,o,s,s.$async);let _=e.scopeValue("root",{ref:c});return nm(t,(0,zr._)`${_}.validate`,c,c.$async)}function g(_){let w=KO(t,_);nm(t,w,_,_.$async)}function v(_){let w=e.scopeValue("schema",l.code.source===!0?{ref:_,code:(0,zr.stringify)(_)}:{ref:_}),E=e.name("valid"),k=t.subschema({schema:_,dataTypes:[],schemaPath:zr.nil,topSchemaRef:w,errSchemaPath:r},E);t.mergeEvaluated(k),t.ok(E)}}};function KO(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,zr._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Ra.getValidate=KO;function nm(t,e,r,n){let{gen:i,it:s}=t,{allErrors:o,schemaEnv:l,opts:f}=s,c=f.passContext?ou.default.this:zr.nil;n?p():h();function p(){if(!l.$async)throw new Error("async schema referenced by sync schema");let _=i.let("valid");i.try(()=>{i.code((0,zr._)`await ${(0,GO.callValidateCode)(t,e,c)}`),v(e),o||i.assign(_,!0)},w=>{i.if((0,zr._)`!(${w} instanceof ${s.ValidationError})`,()=>i.throw(w)),g(w),o||i.assign(_,!1)}),t.ok(_)}function h(){t.result((0,GO.callValidateCode)(t,e,c),()=>v(e),()=>g(e))}function g(_){let w=(0,zr._)`${_}.errors`;i.assign(ou.default.vErrors,(0,zr._)`${ou.default.vErrors} === null ? ${w} : ${ou.default.vErrors}.concat(${w})`),i.assign(ou.default.errors,(0,zr._)`${ou.default.vErrors}.length`)}function v(_){var w;if(!s.opts.unevaluated)return;let E=(w=r?.validate)===null||w===void 0?void 0:w.evaluated;if(s.props!==!0)if(E&&!E.dynamicProps)E.props!==void 0&&(s.props=rm.mergeEvaluated.props(i,E.props,s.props));else{let k=i.var("props",(0,zr._)`${_}.evaluated.props`);s.props=rm.mergeEvaluated.props(i,k,s.props,zr.Name)}if(s.items!==!0)if(E&&!E.dynamicItems)E.items!==void 0&&(s.items=rm.mergeEvaluated.items(i,E.items,s.items));else{let k=i.var("items",(0,zr._)`${_}.evaluated.items`);s.items=rm.mergeEvaluated.items(i,k,s.items,zr.Name)}}}Ra.callRef=nm;Ra.default=FB});var ZO=H(lw=>{"use strict";Object.defineProperty(lw,"__esModule",{value:!0});var DB=JO(),LB=QO(),jB=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",DB.default,LB.default];lw.default=jB});var XO=H(uw=>{"use strict";Object.defineProperty(uw,"__esModule",{value:!0});var im=je(),to=im.operators,sm={maximum:{okStr:"<=",ok:to.LTE,fail:to.GT},minimum:{okStr:">=",ok:to.GTE,fail:to.LT},exclusiveMaximum:{okStr:"<",ok:to.LT,fail:to.GTE},exclusiveMinimum:{okStr:">",ok:to.GT,fail:to.LTE}},UB={message:({keyword:t,schemaCode:e})=>(0,im.str)`must be ${sm[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,im._)`{comparison: ${sm[t].okStr}, limit: ${e}}`},HB={keyword:Object.keys(sm),type:"number",schemaType:"number",$data:!0,error:UB,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,im._)`${r} ${sm[e].fail} ${n} || isNaN(${r})`)}};uw.default=HB});var eq=H(cw=>{"use strict";Object.defineProperty(cw,"__esModule",{value:!0});var Cf=je(),BB={message:({schemaCode:t})=>(0,Cf.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Cf._)`{multipleOf: ${t}}`},VB={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:BB,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,o=e.let("res"),l=s?(0,Cf._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:(0,Cf._)`${o} !== parseInt(${o})`;t.fail$data((0,Cf._)`(${n} === 0 || (${o} = ${r}/${n}, ${l}))`)}};cw.default=VB});var rq=H(fw=>{"use strict";Object.defineProperty(fw,"__esModule",{value:!0});function tq(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}fw.default=tq;tq.code='require("ajv/dist/runtime/ucs2length").default'});var nq=H(dw=>{"use strict";Object.defineProperty(dw,"__esModule",{value:!0});var Ca=je(),WB=Ke(),zB=rq(),JB={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Ca.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Ca._)`{limit: ${t}}`},GB={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:JB,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?Ca.operators.GT:Ca.operators.LT,o=i.opts.unicode===!1?(0,Ca._)`${r}.length`:(0,Ca._)`${(0,WB.useFunc)(t.gen,zB.default)}(${r})`;t.fail$data((0,Ca._)`${o} ${s} ${n}`)}};dw.default=GB});var iq=H(pw=>{"use strict";Object.defineProperty(pw,"__esModule",{value:!0});var YB=On(),KB=Ke(),au=je(),QB={message:({schemaCode:t})=>(0,au.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,au._)`{pattern: ${t}}`},ZB={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:QB,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:f}=o.opts.code,c=f.code==="new RegExp"?(0,au._)`new RegExp`:(0,KB.useFunc)(e,f),p=e.let("valid");e.try(()=>e.assign(p,(0,au._)`${c}(${s}, ${l}).test(${r})`),()=>e.assign(p,!1)),t.fail$data((0,au._)`!${p}`)}else{let f=(0,YB.usePattern)(t,i);t.fail$data((0,au._)`!${f}.test(${r})`)}}};pw.default=ZB});var sq=H(hw=>{"use strict";Object.defineProperty(hw,"__esModule",{value:!0});var xf=je(),XB={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,xf.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,xf._)`{limit: ${t}}`},eV={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:XB,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?xf.operators.GT:xf.operators.LT;t.fail$data((0,xf._)`Object.keys(${r}).length ${i} ${n}`)}};hw.default=eV});var oq=H(mw=>{"use strict";Object.defineProperty(mw,"__esModule",{value:!0});var Ef=On(),If=je(),tV=Ke(),rV={message:({params:{missingProperty:t}})=>(0,If.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,If._)`{missingProperty: ${t}}`},nV={keyword:"required",type:"object",schemaType:"array",$data:!0,error:rV,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 f=r.length>=l.loopRequired;if(o.allErrors?c():p(),l.strictRequired){let v=t.parentSchema.properties,{definedProperties:_}=t.it;for(let w of r)if(v?.[w]===void 0&&!_.has(w)){let E=o.schemaEnv.baseId+o.errSchemaPath,k=`required property "${w}" is not defined at "${E}" (strictRequired)`;(0,tV.checkStrictMode)(o,k,o.opts.strictRequired)}}function c(){if(f||s)t.block$data(If.nil,h);else for(let v of r)(0,Ef.checkReportMissingProp)(t,v)}function p(){let v=e.let("missing");if(f||s){let _=e.let("valid",!0);t.block$data(_,()=>g(v,_)),t.ok(_)}else e.if((0,Ef.checkMissingProp)(t,r,v)),(0,Ef.reportMissingProp)(t,v),e.else()}function h(){e.forOf("prop",n,v=>{t.setParams({missingProperty:v}),e.if((0,Ef.noPropertyInData)(e,i,v,l.ownProperties),()=>t.error())})}function g(v,_){t.setParams({missingProperty:v}),e.forOf(v,n,()=>{e.assign(_,(0,Ef.propertyInData)(e,i,v,l.ownProperties)),e.if((0,If.not)(_),()=>{t.error(),e.break()})},If.nil)}}};mw.default=nV});var aq=H(gw=>{"use strict";Object.defineProperty(gw,"__esModule",{value:!0});var Of=je(),iV={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,Of.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,Of._)`{limit: ${t}}`},sV={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:iV,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?Of.operators.GT:Of.operators.LT;t.fail$data((0,Of._)`${r}.length ${i} ${n}`)}};gw.default=sV});var om=H(yw=>{"use strict";Object.defineProperty(yw,"__esModule",{value:!0});var lq=jS();lq.code='require("ajv/dist/runtime/equal").default';yw.default=lq});var uq=H(bw=>{"use strict";Object.defineProperty(bw,"__esModule",{value:!0});var vw=hf(),lr=je(),oV=Ke(),aV=om(),lV={message:({params:{i:t,j:e}})=>(0,lr.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,lr._)`{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 f=e.let("valid"),c=s.items?(0,vw.getSchemaTypes)(s.items):[];t.block$data(f,p,(0,lr._)`${o} === false`),t.ok(f);function p(){let _=e.let("i",(0,lr._)`${r}.length`),w=e.let("j");t.setParams({i:_,j:w}),e.assign(f,!0),e.if((0,lr._)`${_} > 1`,()=>(h()?g:v)(_,w))}function h(){return c.length>0&&!c.some(_=>_==="object"||_==="array")}function g(_,w){let E=e.name("item"),k=(0,vw.checkDataTypes)(c,E,l.opts.strictNumbers,vw.DataType.Wrong),T=e.const("indices",(0,lr._)`{}`);e.for((0,lr._)`;${_}--;`,()=>{e.let(E,(0,lr._)`${r}[${_}]`),e.if(k,(0,lr._)`continue`),c.length>1&&e.if((0,lr._)`typeof ${E} == "string"`,(0,lr._)`${E} += "_"`),e.if((0,lr._)`typeof ${T}[${E}] == "number"`,()=>{e.assign(w,(0,lr._)`${T}[${E}]`),t.error(),e.assign(f,!1).break()}).code((0,lr._)`${T}[${E}] = ${_}`)})}function v(_,w){let E=(0,oV.useFunc)(e,aV.default),k=e.name("outer");e.label(k).for((0,lr._)`;${_}--;`,()=>e.for((0,lr._)`${w} = ${_}; ${w}--;`,()=>e.if((0,lr._)`${E}(${r}[${_}], ${r}[${w}])`,()=>{t.error(),e.assign(f,!1).break(k)})))}}};bw.default=uV});var cq=H(ww=>{"use strict";Object.defineProperty(ww,"__esModule",{value:!0});var Sw=je(),cV=Ke(),fV=om(),dV={message:"must be equal to constant",params:({schemaCode:t})=>(0,Sw._)`{allowedValue: ${t}}`},pV={keyword:"const",$data:!0,error:dV,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,Sw._)`!${(0,cV.useFunc)(e,fV.default)}(${r}, ${i})`):t.fail((0,Sw._)`${s} !== ${r}`)}};ww.default=pV});var fq=H(_w=>{"use strict";Object.defineProperty(_w,"__esModule",{value:!0});var qf=je(),hV=Ke(),mV=om(),gV={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,qf._)`{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,f,c=()=>f??(f=(0,hV.useFunc)(e,mV.default)),p;if(l||n)p=e.let("valid"),t.block$data(p,h);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let v=e.const("vSchema",s);p=(0,qf.or)(...i.map((_,w)=>g(v,w)))}t.pass(p);function h(){e.assign(p,!1),e.forOf("v",s,v=>e.if((0,qf._)`${c()}(${r}, ${v})`,()=>e.assign(p,!0).break()))}function g(v,_){let w=i[_];return typeof w=="object"&&w!==null?(0,qf._)`${c()}(${r}, ${v}[${_}])`:(0,qf._)`${r} === ${w}`}}};_w.default=yV});var dq=H(Rw=>{"use strict";Object.defineProperty(Rw,"__esModule",{value:!0});var vV=XO(),bV=eq(),SV=nq(),wV=iq(),_V=sq(),RV=oq(),CV=aq(),xV=uq(),EV=cq(),IV=fq(),OV=[vV.default,bV.default,SV.default,wV.default,_V.default,RV.default,CV.default,xV.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},EV.default,IV.default];Rw.default=OV});var xw=H(kf=>{"use strict";Object.defineProperty(kf,"__esModule",{value:!0});kf.validateAdditionalItems=void 0;var xa=je(),Cw=Ke(),qV={message:({params:{len:t}})=>(0,xa.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,xa._)`{limit: ${t}}`},kV={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:qV,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,Cw.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}pq(t,n)}};function pq(t,e){let{gen:r,schema:n,data:i,keyword:s,it:o}=t;o.items=!0;let l=r.const("len",(0,xa._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,xa._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,Cw.alwaysValidSchema)(o,n)){let c=r.var("valid",(0,xa._)`${l} <= ${e.length}`);r.if((0,xa.not)(c),()=>f(c)),t.ok(c)}function f(c){r.forRange("i",e.length,l,p=>{t.subschema({keyword:s,dataProp:p,dataPropType:Cw.Type.Num},c),o.allErrors||r.if((0,xa.not)(c),()=>r.break())})}}kf.validateAdditionalItems=pq;kf.default=kV});var Ew=H(Pf=>{"use strict";Object.defineProperty(Pf,"__esModule",{value:!0});Pf.validateTuple=void 0;var hq=je(),am=Ke(),PV=On(),TV={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return mq(t,"additionalItems",e);r.items=!0,!(0,am.alwaysValidSchema)(r,e)&&t.ok((0,PV.validateArray)(t))}};function mq(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=am.mergeEvaluated.items(n,r.length,l.items));let f=n.name("valid"),c=n.const("len",(0,hq._)`${s}.length`);r.forEach((h,g)=>{(0,am.alwaysValidSchema)(l,h)||(n.if((0,hq._)`${c} > ${g}`,()=>t.subschema({keyword:o,schemaProp:g,dataProp:g},f)),t.ok(f))});function p(h){let{opts:g,errSchemaPath:v}=l,_=r.length,w=_===h.minItems&&(_===h.maxItems||h[e]===!1);if(g.strictTuples&&!w){let E=`"${o}" is ${_}-tuple, but minItems or maxItems/${e} are not specified or different at path "${v}"`;(0,am.checkStrictMode)(l,E,g.strictTuples)}}}Pf.validateTuple=mq;Pf.default=TV});var gq=H(Iw=>{"use strict";Object.defineProperty(Iw,"__esModule",{value:!0});var AV=Ew(),$V={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,AV.validateTuple)(t,"items")};Iw.default=$V});var vq=H(Ow=>{"use strict";Object.defineProperty(Ow,"__esModule",{value:!0});var yq=je(),NV=Ke(),MV=On(),FV=xw(),DV={message:({params:{len:t}})=>(0,yq.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,yq._)`{limit: ${t}}`},LV={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:DV,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,NV.alwaysValidSchema)(n,e)&&(i?(0,FV.validateAdditionalItems)(t,i):t.ok((0,MV.validateArray)(t)))}};Ow.default=LV});var bq=H(qw=>{"use strict";Object.defineProperty(qw,"__esModule",{value:!0});var kn=je(),lm=Ke(),jV={message:({params:{min:t,max:e}})=>e===void 0?(0,kn.str)`must contain at least ${t} valid item(s)`:(0,kn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,kn._)`{minContains: ${t}}`:(0,kn._)`{minContains: ${t}, maxContains: ${e}}`},UV={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:jV,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t,o,l,{minContains:f,maxContains:c}=n;s.opts.next?(o=f===void 0?1:f,l=c):o=1;let p=e.const("len",(0,kn._)`${i}.length`);if(t.setParams({min:o,max:l}),l===void 0&&o===0){(0,lm.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&o>l){(0,lm.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,lm.alwaysValidSchema)(s,r)){let w=(0,kn._)`${p} >= ${o}`;l!==void 0&&(w=(0,kn._)`${w} && ${p} <= ${l}`),t.pass(w);return}s.items=!0;let h=e.name("valid");l===void 0&&o===1?v(h,()=>e.if(h,()=>e.break())):o===0?(e.let(h,!0),l!==void 0&&e.if((0,kn._)`${i}.length > 0`,g)):(e.let(h,!1),g()),t.result(h,()=>t.reset());function g(){let w=e.name("_valid"),E=e.let("count",0);v(w,()=>e.if(w,()=>_(E)))}function v(w,E){e.forRange("i",0,p,k=>{t.subschema({keyword:"contains",dataProp:k,dataPropType:lm.Type.Num,compositeRule:!0},w),E()})}function _(w){e.code((0,kn._)`${w}++`),l===void 0?e.if((0,kn._)`${w} >= ${o}`,()=>e.assign(h,!0).break()):(e.if((0,kn._)`${w} > ${l}`,()=>e.assign(h,!1).break()),o===1?e.assign(h,!0):e.if((0,kn._)`${w} >= ${o}`,()=>e.assign(h,!0)))}}};qw.default=UV});var _q=H(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.validateSchemaDeps=qi.validatePropertyDeps=qi.error=void 0;var kw=je(),HV=Ke(),Tf=On();qi.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,kw.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,kw._)`{property: ${t},
28
28
  missingProperty: ${n},
29
29
  depsCount: ${e},
30
- deps: ${r}}`};var BV={keyword:"dependencies",type:"object",schemaType:"object",error:qi.error,code(t){let[e,r]=VV(t);Sq(t,e),wq(t,r)}};function VV({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 Sq(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 f=(0,Tf.propertyInData)(r,n,o,i.opts.ownProperties);t.setParams({property:o,depsCount:l.length,deps:l.join(", ")}),i.allErrors?r.if(f,()=>{for(let c of l)(0,Tf.checkReportMissingProp)(t,c)}):(r.if((0,kw._)`${f} && (${(0,Tf.checkMissingProp)(t,l,s)})`),(0,Tf.reportMissingProp)(t,s),r.else())}}qi.validatePropertyDeps=Sq;function wq(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,o=r.name("valid");for(let l in e)(0,HV.alwaysValidSchema)(s,e[l])||(r.if((0,Tf.propertyInData)(r,n,l,s.opts.ownProperties),()=>{let f=t.subschema({keyword:i,schemaProp:l},o);t.mergeValidEvaluated(f,o)},()=>r.var(o,!0)),t.ok(o))}qi.validateSchemaDeps=wq;qi.default=BV});var Cq=H(Pw=>{"use strict";Object.defineProperty(Pw,"__esModule",{value:!0});var Rq=je(),WV=Ke(),zV={message:"property name must be valid",params:({params:t})=>(0,Rq._)`{propertyName: ${t.propertyName}}`},JV={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:zV,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,WV.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,Rq.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};Pw.default=JV});var Aw=H(Tw=>{"use strict";Object.defineProperty(Tw,"__esModule",{value:!0});var um=On(),ti=je(),GV=ls(),cm=Ke(),YV={message:"must NOT have additional properties",params:({params:t})=>(0,ti._)`{additionalProperty: ${t.additionalProperty}}`},KV={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:YV,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:f}=o;if(o.props=!0,f.removeAdditional!=="all"&&(0,cm.alwaysValidSchema)(o,r))return;let c=(0,um.allSchemaProperties)(n.properties),p=(0,um.allSchemaProperties)(n.patternProperties);h(),t.ok((0,ti._)`${s} === ${GV.default.errors}`);function h(){e.forIn("key",i,E=>{!c.length&&!p.length?_(E):e.if(g(E),()=>_(E))})}function g(E){let k;if(c.length>8){let T=(0,cm.schemaRefOrVal)(o,n.properties,"properties");k=(0,um.isOwnProperty)(e,T,E)}else c.length?k=(0,ti.or)(...c.map(T=>(0,ti._)`${E} === ${T}`)):k=ti.nil;return p.length&&(k=(0,ti.or)(k,...p.map(T=>(0,ti._)`${(0,um.usePattern)(t,T)}.test(${E})`))),(0,ti.not)(k)}function v(E){e.code((0,ti._)`delete ${i}[${E}]`)}function _(E){if(f.removeAdditional==="all"||f.removeAdditional&&r===!1){v(E);return}if(r===!1){t.setParams({additionalProperty:E}),t.error(),l||e.break();return}if(typeof r=="object"&&!(0,cm.alwaysValidSchema)(o,r)){let k=e.name("valid");f.removeAdditional==="failing"?(w(E,k,!1),e.if((0,ti.not)(k),()=>{t.reset(),v(E)})):(w(E,k),l||e.if((0,ti.not)(k),()=>e.break()))}}function w(E,k,T){let N={keyword:"additionalProperties",dataProp:E,dataPropType:cm.Type.Str};T===!1&&Object.assign(N,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(N,k)}}};Tw.default=KV});var Iq=H(Nw=>{"use strict";Object.defineProperty(Nw,"__esModule",{value:!0});var QV=vf(),xq=On(),$w=Ke(),Eq=Aw(),ZV={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&&Eq.default.code(new QV.KeywordCxt(s,Eq.default,"additionalProperties"));let o=(0,xq.allSchemaProperties)(r);for(let h of o)s.definedProperties.add(h);s.opts.unevaluated&&o.length&&s.props!==!0&&(s.props=$w.mergeEvaluated.props(e,(0,$w.toHash)(o),s.props));let l=o.filter(h=>!(0,$w.alwaysValidSchema)(s,r[h]));if(l.length===0)return;let f=e.name("valid");for(let h of l)c(h)?p(h):(e.if((0,xq.propertyInData)(e,i,h,s.opts.ownProperties)),p(h),s.allErrors||e.else().var(f,!0),e.endIf()),t.it.definedProperties.add(h),t.ok(f);function c(h){return s.opts.useDefaults&&!s.compositeRule&&r[h].default!==void 0}function p(h){t.subschema({keyword:"properties",schemaProp:h,dataProp:h},f)}}};Nw.default=ZV});var Pq=H(Mw=>{"use strict";Object.defineProperty(Mw,"__esModule",{value:!0});var Oq=On(),fm=je(),qq=Ke(),kq=Ke(),XV={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,Oq.allSchemaProperties)(r),f=l.filter(w=>(0,qq.alwaysValidSchema)(s,r[w]));if(l.length===0||f.length===l.length&&(!s.opts.unevaluated||s.props===!0))return;let c=o.strictSchema&&!o.allowMatchingProperties&&i.properties,p=e.name("valid");s.props!==!0&&!(s.props instanceof fm.Name)&&(s.props=(0,kq.evaluatedPropsToName)(e,s.props));let{props:h}=s;g();function g(){for(let w of l)c&&v(w),s.allErrors?_(w):(e.var(p,!0),_(w),e.if(p))}function v(w){for(let E in c)new RegExp(w).test(E)&&(0,qq.checkStrictMode)(s,`property ${E} matches pattern ${w} (use allowMatchingProperties)`)}function _(w){e.forIn("key",n,E=>{e.if((0,fm._)`${(0,Oq.usePattern)(t,w)}.test(${E})`,()=>{let k=f.includes(w);k||t.subschema({keyword:"patternProperties",schemaProp:w,dataProp:E,dataPropType:kq.Type.Str},p),s.opts.unevaluated&&h!==!0?e.assign((0,fm._)`${h}[${E}]`,!0):!k&&!s.allErrors&&e.if((0,fm.not)(p),()=>e.break())})})}}};Mw.default=XV});var Tq=H(Fw=>{"use strict";Object.defineProperty(Fw,"__esModule",{value:!0});var eW=Ke(),tW={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,eW.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"}};Fw.default=tW});var Aq=H(Dw=>{"use strict";Object.defineProperty(Dw,"__esModule",{value:!0});var rW=On(),nW={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:rW.validateUnion,error:{message:"must match a schema in anyOf"}};Dw.default=nW});var $q=H(Lw=>{"use strict";Object.defineProperty(Lw,"__esModule",{value:!0});var dm=je(),iW=Ke(),sW={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,dm._)`{passingSchemas: ${t.passing}}`},oW={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:sW,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),f=e.name("_valid");t.setParams({passing:l}),e.block(c),t.result(o,()=>t.reset(),()=>t.error(!0));function c(){s.forEach((p,h)=>{let g;(0,iW.alwaysValidSchema)(i,p)?e.var(f,!0):g=t.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},f),h>0&&e.if((0,dm._)`${f} && ${o}`).assign(o,!1).assign(l,(0,dm._)`[${l}, ${h}]`).else(),e.if(f,()=>{e.assign(o,!0),e.assign(l,h),g&&t.mergeEvaluated(g,dm.Name)})})}}};Lw.default=oW});var Nq=H(jw=>{"use strict";Object.defineProperty(jw,"__esModule",{value:!0});var aW=Ke(),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,aW.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:o},i);t.ok(i),t.mergeEvaluated(l)})}};jw.default=lW});var Dq=H(Uw=>{"use strict";Object.defineProperty(Uw,"__esModule",{value:!0});var pm=je(),Fq=Ke(),uW={message:({params:t})=>(0,pm.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,pm._)`{failingKeyword: ${t.ifClause}}`},cW={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,Fq.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=Mq(n,"then"),s=Mq(n,"else");if(!i&&!s)return;let o=e.let("valid",!0),l=e.name("_valid");if(f(),t.reset(),i&&s){let p=e.let("ifClause");t.setParams({ifClause:p}),e.if(l,c("then",p),c("else",p))}else i?e.if(l,c("then")):e.if((0,pm.not)(l),c("else"));t.pass(o,()=>t.error(!0));function f(){let p=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);t.mergeEvaluated(p)}function c(p,h){return()=>{let g=t.subschema({keyword:p},l);e.assign(o,l),t.mergeValidEvaluated(g,o),h?e.assign(h,(0,pm._)`${p}`):t.setParams({ifClause:p})}}}};function Mq(t,e){let r=t.schema[e];return r!==void 0&&!(0,Fq.alwaysValidSchema)(t,r)}Uw.default=cW});var Lq=H(Hw=>{"use strict";Object.defineProperty(Hw,"__esModule",{value:!0});var fW=Ke(),dW={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,fW.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Hw.default=dW});var jq=H(Bw=>{"use strict";Object.defineProperty(Bw,"__esModule",{value:!0});var pW=xw(),hW=gq(),mW=Ew(),gW=vq(),yW=bq(),vW=_q(),bW=Cq(),SW=Aw(),wW=Iq(),_W=Pq(),RW=Tq(),CW=Aq(),xW=$q(),EW=Nq(),IW=Dq(),OW=Lq();function qW(t=!1){let e=[RW.default,CW.default,xW.default,EW.default,IW.default,OW.default,bW.default,SW.default,vW.default,wW.default,_W.default];return t?e.push(hW.default,gW.default):e.push(pW.default,mW.default),e.push(yW.default),e}Bw.default=qW});var Uq=H(Vw=>{"use strict";Object.defineProperty(Vw,"__esModule",{value:!0});var jt=je(),kW={message:({schemaCode:t})=>(0,jt.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,jt._)`{format: ${t}}`},PW={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:kW,code(t,e){let{gen:r,data:n,$data:i,schema:s,schemaCode:o,it:l}=t,{opts:f,errSchemaPath:c,schemaEnv:p,self:h}=l;if(!f.validateFormats)return;i?g():v();function g(){let _=r.scopeValue("formats",{ref:h.formats,code:f.code.formats}),w=r.const("fDef",(0,jt._)`${_}[${o}]`),E=r.let("fType"),k=r.let("format");r.if((0,jt._)`typeof ${w} == "object" && !(${w} instanceof RegExp)`,()=>r.assign(E,(0,jt._)`${w}.type || "string"`).assign(k,(0,jt._)`${w}.validate`),()=>r.assign(E,(0,jt._)`"string"`).assign(k,w)),t.fail$data((0,jt.or)(T(),N()));function T(){return f.strictSchema===!1?jt.nil:(0,jt._)`${o} && !${k}`}function N(){let $=p.$async?(0,jt._)`(${w}.async ? await ${k}(${n}) : ${k}(${n}))`:(0,jt._)`${k}(${n})`,j=(0,jt._)`(typeof ${k} == "function" ? ${$} : ${k}.test(${n}))`;return(0,jt._)`${k} && ${k} !== true && ${E} === ${e} && !${j}`}}function v(){let _=h.formats[s];if(!_){T();return}if(_===!0)return;let[w,E,k]=N(_);w===e&&t.pass($());function T(){if(f.strictSchema===!1){h.logger.warn(j());return}throw new Error(j());function j(){return`unknown format "${s}" ignored in schema at path "${c}"`}}function N(j){let G=j instanceof RegExp?(0,jt.regexpCode)(j):f.code.formats?(0,jt._)`${f.code.formats}${(0,jt.getProperty)(s)}`:void 0,q=r.scopeValue("formats",{key:s,ref:j,code:G});return typeof j=="object"&&!(j instanceof RegExp)?[j.type||"string",j.validate,(0,jt._)`${q}.validate`]:["string",j,q]}function $(){if(typeof _=="object"&&!(_ instanceof RegExp)&&_.async){if(!p.$async)throw new Error("async format in sync schema");return(0,jt._)`await ${k}(${n})`}return typeof E=="function"?(0,jt._)`${k}(${n})`:(0,jt._)`${k}.test(${n})`}}}};Vw.default=PW});var Hq=H(Ww=>{"use strict";Object.defineProperty(Ww,"__esModule",{value:!0});var TW=Uq(),AW=[TW.default];Ww.default=AW});var Bq=H(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 Wq=H(zw=>{"use strict";Object.defineProperty(zw,"__esModule",{value:!0});var $W=ZO(),NW=dq(),MW=jq(),FW=Hq(),Vq=Bq(),DW=[$W.default,NW.default,(0,MW.default)(),FW.default,Vq.metadataVocabulary,Vq.contentVocabulary];zw.default=DW});var Jq=H(hm=>{"use strict";Object.defineProperty(hm,"__esModule",{value:!0});hm.DiscrError=void 0;var zq;(function(t){t.Tag="tag",t.Mapping="mapping"})(zq||(hm.DiscrError=zq={}))});var Yq=H(Gw=>{"use strict";Object.defineProperty(Gw,"__esModule",{value:!0});var uu=je(),Jw=Jq(),Gq=Qh(),LW=bf(),jW=Ke(),UW={message:({params:{discrError:t,tagName:e}})=>t===Jw.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}}`},HW={keyword:"discriminator",type:"object",schemaType:"object",error:UW,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 f=e.let("valid",!1),c=e.const("tag",(0,uu._)`${r}${(0,uu.getProperty)(l)}`);e.if((0,uu._)`typeof ${c} == "string"`,()=>p(),()=>t.error(!1,{discrError:Jw.DiscrError.Tag,tag:c,tagName:l})),t.ok(f);function p(){let v=g();e.if(!1);for(let _ in v)e.elseIf((0,uu._)`${c} === ${_}`),e.assign(f,h(v[_]));e.else(),t.error(!1,{discrError:Jw.DiscrError.Mapping,tag:c,tagName:l}),e.endIf()}function h(v){let _=e.name("valid"),w=t.subschema({keyword:"oneOf",schemaProp:v},_);return t.mergeEvaluated(w,uu.Name),_}function g(){var v;let _={},w=k(i),E=!0;for(let $=0;$<o.length;$++){let j=o[$];if(j?.$ref&&!(0,jW.schemaHasRulesButRef)(j,s.self.RULES)){let q=j.$ref;if(j=Gq.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,q),j instanceof Gq.SchemaEnv&&(j=j.schema),j===void 0)throw new LW.default(s.opts.uriResolver,s.baseId,q)}let G=(v=j?.properties)===null||v===void 0?void 0:v[l];if(typeof G!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);E=E&&(w||k(j)),T(G,$)}if(!E)throw new Error(`discriminator: "${l}" must be required`);return _;function k({required:$}){return Array.isArray($)&&$.includes(l)}function T($,j){if($.const)N($.const,j);else if($.enum)for(let G of $.enum)N(G,j);else throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`)}function N($,j){if(typeof $!="string"||$ in _)throw new Error(`discriminator: "${l}" values must be unique strings`);_[$]=j}}}};Gw.default=HW});var Kq=H((RZ,BW)=>{BW.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 Zq=H((It,Yw)=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.MissingRefError=It.ValidationError=It.CodeGen=It.Name=It.nil=It.stringify=It.str=It._=It.KeywordCxt=It.Ajv=void 0;var VW=zO(),WW=Wq(),zW=Yq(),Qq=Kq(),JW=["/properties"],mm="http://json-schema.org/draft-07/schema",cu=class extends VW.default{_addVocabularies(){super._addVocabularies(),WW.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(zW.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Qq,JW):Qq;this.addMetaSchema(e,mm,!1),this.refs["http://json-schema.org/schema"]=mm}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(mm)?mm:void 0)}};It.Ajv=cu;Yw.exports=It=cu;Yw.exports.Ajv=cu;Object.defineProperty(It,"__esModule",{value:!0});It.default=cu;var GW=vf();Object.defineProperty(It,"KeywordCxt",{enumerable:!0,get:function(){return GW.KeywordCxt}});var fu=je();Object.defineProperty(It,"_",{enumerable:!0,get:function(){return fu._}});Object.defineProperty(It,"str",{enumerable:!0,get:function(){return fu.str}});Object.defineProperty(It,"stringify",{enumerable:!0,get:function(){return fu.stringify}});Object.defineProperty(It,"nil",{enumerable:!0,get:function(){return fu.nil}});Object.defineProperty(It,"Name",{enumerable:!0,get:function(){return fu.Name}});Object.defineProperty(It,"CodeGen",{enumerable:!0,get:function(){return fu.CodeGen}});var YW=Yh();Object.defineProperty(It,"ValidationError",{enumerable:!0,get:function(){return YW.default}});var KW=bf();Object.defineProperty(It,"MissingRefError",{enumerable:!0,get:function(){return KW.default}})});import*as QW from"crypto";import*as xa from"fs";import{createRequire as ZW}from"module";import*as ri from"path";function ym(){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 Xq(){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 Kw(t,e){return new gm(t,e)}var gm,Qw=se(()=>{"use strict";iS();gm=class{availableModules=new Set;customModulesRequire;globalSetupExports;options;modulesPath=null;moduleCache=new Map;resolveStack=new Set;builtinModules={uuid:()=>({v4:Jl}),crypto:()=>QW,path:()=>ri,querystring:()=>ft("querystring"),lodash:()=>this.loadOptionalModule("lodash",()=>yI(),Xq),moment:()=>this.loadOptionalModule("moment",()=>vI(),ym),tv4:()=>this.loadOptionalModule("tv4",()=>SI()),ajv:()=>this.loadOptionalModule("ajv",()=>Zq()),"crypto-js":()=>this.loadOptionalModule("crypto-js",()=>ft("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=ri.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 BV={keyword:"dependencies",type:"object",schemaType:"object",error:qi.error,code(t){let[e,r]=VV(t);Sq(t,e),wq(t,r)}};function VV({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 Sq(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 f=(0,Tf.propertyInData)(r,n,o,i.opts.ownProperties);t.setParams({property:o,depsCount:l.length,deps:l.join(", ")}),i.allErrors?r.if(f,()=>{for(let c of l)(0,Tf.checkReportMissingProp)(t,c)}):(r.if((0,kw._)`${f} && (${(0,Tf.checkMissingProp)(t,l,s)})`),(0,Tf.reportMissingProp)(t,s),r.else())}}qi.validatePropertyDeps=Sq;function wq(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,o=r.name("valid");for(let l in e)(0,HV.alwaysValidSchema)(s,e[l])||(r.if((0,Tf.propertyInData)(r,n,l,s.opts.ownProperties),()=>{let f=t.subschema({keyword:i,schemaProp:l},o);t.mergeValidEvaluated(f,o)},()=>r.var(o,!0)),t.ok(o))}qi.validateSchemaDeps=wq;qi.default=BV});var Cq=H(Pw=>{"use strict";Object.defineProperty(Pw,"__esModule",{value:!0});var Rq=je(),WV=Ke(),zV={message:"property name must be valid",params:({params:t})=>(0,Rq._)`{propertyName: ${t.propertyName}}`},JV={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:zV,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,WV.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,Rq.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};Pw.default=JV});var Aw=H(Tw=>{"use strict";Object.defineProperty(Tw,"__esModule",{value:!0});var um=On(),ti=je(),GV=ls(),cm=Ke(),YV={message:"must NOT have additional properties",params:({params:t})=>(0,ti._)`{additionalProperty: ${t.additionalProperty}}`},KV={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:YV,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:f}=o;if(o.props=!0,f.removeAdditional!=="all"&&(0,cm.alwaysValidSchema)(o,r))return;let c=(0,um.allSchemaProperties)(n.properties),p=(0,um.allSchemaProperties)(n.patternProperties);h(),t.ok((0,ti._)`${s} === ${GV.default.errors}`);function h(){e.forIn("key",i,E=>{!c.length&&!p.length?_(E):e.if(g(E),()=>_(E))})}function g(E){let k;if(c.length>8){let T=(0,cm.schemaRefOrVal)(o,n.properties,"properties");k=(0,um.isOwnProperty)(e,T,E)}else c.length?k=(0,ti.or)(...c.map(T=>(0,ti._)`${E} === ${T}`)):k=ti.nil;return p.length&&(k=(0,ti.or)(k,...p.map(T=>(0,ti._)`${(0,um.usePattern)(t,T)}.test(${E})`))),(0,ti.not)(k)}function v(E){e.code((0,ti._)`delete ${i}[${E}]`)}function _(E){if(f.removeAdditional==="all"||f.removeAdditional&&r===!1){v(E);return}if(r===!1){t.setParams({additionalProperty:E}),t.error(),l||e.break();return}if(typeof r=="object"&&!(0,cm.alwaysValidSchema)(o,r)){let k=e.name("valid");f.removeAdditional==="failing"?(w(E,k,!1),e.if((0,ti.not)(k),()=>{t.reset(),v(E)})):(w(E,k),l||e.if((0,ti.not)(k),()=>e.break()))}}function w(E,k,T){let N={keyword:"additionalProperties",dataProp:E,dataPropType:cm.Type.Str};T===!1&&Object.assign(N,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(N,k)}}};Tw.default=KV});var Iq=H(Nw=>{"use strict";Object.defineProperty(Nw,"__esModule",{value:!0});var QV=vf(),xq=On(),$w=Ke(),Eq=Aw(),ZV={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&&Eq.default.code(new QV.KeywordCxt(s,Eq.default,"additionalProperties"));let o=(0,xq.allSchemaProperties)(r);for(let h of o)s.definedProperties.add(h);s.opts.unevaluated&&o.length&&s.props!==!0&&(s.props=$w.mergeEvaluated.props(e,(0,$w.toHash)(o),s.props));let l=o.filter(h=>!(0,$w.alwaysValidSchema)(s,r[h]));if(l.length===0)return;let f=e.name("valid");for(let h of l)c(h)?p(h):(e.if((0,xq.propertyInData)(e,i,h,s.opts.ownProperties)),p(h),s.allErrors||e.else().var(f,!0),e.endIf()),t.it.definedProperties.add(h),t.ok(f);function c(h){return s.opts.useDefaults&&!s.compositeRule&&r[h].default!==void 0}function p(h){t.subschema({keyword:"properties",schemaProp:h,dataProp:h},f)}}};Nw.default=ZV});var Pq=H(Mw=>{"use strict";Object.defineProperty(Mw,"__esModule",{value:!0});var Oq=On(),fm=je(),qq=Ke(),kq=Ke(),XV={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,Oq.allSchemaProperties)(r),f=l.filter(w=>(0,qq.alwaysValidSchema)(s,r[w]));if(l.length===0||f.length===l.length&&(!s.opts.unevaluated||s.props===!0))return;let c=o.strictSchema&&!o.allowMatchingProperties&&i.properties,p=e.name("valid");s.props!==!0&&!(s.props instanceof fm.Name)&&(s.props=(0,kq.evaluatedPropsToName)(e,s.props));let{props:h}=s;g();function g(){for(let w of l)c&&v(w),s.allErrors?_(w):(e.var(p,!0),_(w),e.if(p))}function v(w){for(let E in c)new RegExp(w).test(E)&&(0,qq.checkStrictMode)(s,`property ${E} matches pattern ${w} (use allowMatchingProperties)`)}function _(w){e.forIn("key",n,E=>{e.if((0,fm._)`${(0,Oq.usePattern)(t,w)}.test(${E})`,()=>{let k=f.includes(w);k||t.subschema({keyword:"patternProperties",schemaProp:w,dataProp:E,dataPropType:kq.Type.Str},p),s.opts.unevaluated&&h!==!0?e.assign((0,fm._)`${h}[${E}]`,!0):!k&&!s.allErrors&&e.if((0,fm.not)(p),()=>e.break())})})}}};Mw.default=XV});var Tq=H(Fw=>{"use strict";Object.defineProperty(Fw,"__esModule",{value:!0});var eW=Ke(),tW={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,eW.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"}};Fw.default=tW});var Aq=H(Dw=>{"use strict";Object.defineProperty(Dw,"__esModule",{value:!0});var rW=On(),nW={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:rW.validateUnion,error:{message:"must match a schema in anyOf"}};Dw.default=nW});var $q=H(Lw=>{"use strict";Object.defineProperty(Lw,"__esModule",{value:!0});var dm=je(),iW=Ke(),sW={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,dm._)`{passingSchemas: ${t.passing}}`},oW={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:sW,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),f=e.name("_valid");t.setParams({passing:l}),e.block(c),t.result(o,()=>t.reset(),()=>t.error(!0));function c(){s.forEach((p,h)=>{let g;(0,iW.alwaysValidSchema)(i,p)?e.var(f,!0):g=t.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},f),h>0&&e.if((0,dm._)`${f} && ${o}`).assign(o,!1).assign(l,(0,dm._)`[${l}, ${h}]`).else(),e.if(f,()=>{e.assign(o,!0),e.assign(l,h),g&&t.mergeEvaluated(g,dm.Name)})})}}};Lw.default=oW});var Nq=H(jw=>{"use strict";Object.defineProperty(jw,"__esModule",{value:!0});var aW=Ke(),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,aW.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:o},i);t.ok(i),t.mergeEvaluated(l)})}};jw.default=lW});var Dq=H(Uw=>{"use strict";Object.defineProperty(Uw,"__esModule",{value:!0});var pm=je(),Fq=Ke(),uW={message:({params:t})=>(0,pm.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,pm._)`{failingKeyword: ${t.ifClause}}`},cW={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,Fq.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=Mq(n,"then"),s=Mq(n,"else");if(!i&&!s)return;let o=e.let("valid",!0),l=e.name("_valid");if(f(),t.reset(),i&&s){let p=e.let("ifClause");t.setParams({ifClause:p}),e.if(l,c("then",p),c("else",p))}else i?e.if(l,c("then")):e.if((0,pm.not)(l),c("else"));t.pass(o,()=>t.error(!0));function f(){let p=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);t.mergeEvaluated(p)}function c(p,h){return()=>{let g=t.subschema({keyword:p},l);e.assign(o,l),t.mergeValidEvaluated(g,o),h?e.assign(h,(0,pm._)`${p}`):t.setParams({ifClause:p})}}}};function Mq(t,e){let r=t.schema[e];return r!==void 0&&!(0,Fq.alwaysValidSchema)(t,r)}Uw.default=cW});var Lq=H(Hw=>{"use strict";Object.defineProperty(Hw,"__esModule",{value:!0});var fW=Ke(),dW={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,fW.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Hw.default=dW});var jq=H(Bw=>{"use strict";Object.defineProperty(Bw,"__esModule",{value:!0});var pW=xw(),hW=gq(),mW=Ew(),gW=vq(),yW=bq(),vW=_q(),bW=Cq(),SW=Aw(),wW=Iq(),_W=Pq(),RW=Tq(),CW=Aq(),xW=$q(),EW=Nq(),IW=Dq(),OW=Lq();function qW(t=!1){let e=[RW.default,CW.default,xW.default,EW.default,IW.default,OW.default,bW.default,SW.default,vW.default,wW.default,_W.default];return t?e.push(hW.default,gW.default):e.push(pW.default,mW.default),e.push(yW.default),e}Bw.default=qW});var Uq=H(Vw=>{"use strict";Object.defineProperty(Vw,"__esModule",{value:!0});var Ht=je(),kW={message:({schemaCode:t})=>(0,Ht.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Ht._)`{format: ${t}}`},PW={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:kW,code(t,e){let{gen:r,data:n,$data:i,schema:s,schemaCode:o,it:l}=t,{opts:f,errSchemaPath:c,schemaEnv:p,self:h}=l;if(!f.validateFormats)return;i?g():v();function g(){let _=r.scopeValue("formats",{ref:h.formats,code:f.code.formats}),w=r.const("fDef",(0,Ht._)`${_}[${o}]`),E=r.let("fType"),k=r.let("format");r.if((0,Ht._)`typeof ${w} == "object" && !(${w} instanceof RegExp)`,()=>r.assign(E,(0,Ht._)`${w}.type || "string"`).assign(k,(0,Ht._)`${w}.validate`),()=>r.assign(E,(0,Ht._)`"string"`).assign(k,w)),t.fail$data((0,Ht.or)(T(),N()));function T(){return f.strictSchema===!1?Ht.nil:(0,Ht._)`${o} && !${k}`}function N(){let $=p.$async?(0,Ht._)`(${w}.async ? await ${k}(${n}) : ${k}(${n}))`:(0,Ht._)`${k}(${n})`,j=(0,Ht._)`(typeof ${k} == "function" ? ${$} : ${k}.test(${n}))`;return(0,Ht._)`${k} && ${k} !== true && ${E} === ${e} && !${j}`}}function v(){let _=h.formats[s];if(!_){T();return}if(_===!0)return;let[w,E,k]=N(_);w===e&&t.pass($());function T(){if(f.strictSchema===!1){h.logger.warn(j());return}throw new Error(j());function j(){return`unknown format "${s}" ignored in schema at path "${c}"`}}function N(j){let G=j instanceof RegExp?(0,Ht.regexpCode)(j):f.code.formats?(0,Ht._)`${f.code.formats}${(0,Ht.getProperty)(s)}`:void 0,q=r.scopeValue("formats",{key:s,ref:j,code:G});return typeof j=="object"&&!(j instanceof RegExp)?[j.type||"string",j.validate,(0,Ht._)`${q}.validate`]:["string",j,q]}function $(){if(typeof _=="object"&&!(_ instanceof RegExp)&&_.async){if(!p.$async)throw new Error("async format in sync schema");return(0,Ht._)`await ${k}(${n})`}return typeof E=="function"?(0,Ht._)`${k}(${n})`:(0,Ht._)`${k}.test(${n})`}}}};Vw.default=PW});var Hq=H(Ww=>{"use strict";Object.defineProperty(Ww,"__esModule",{value:!0});var TW=Uq(),AW=[TW.default];Ww.default=AW});var Bq=H(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 Wq=H(zw=>{"use strict";Object.defineProperty(zw,"__esModule",{value:!0});var $W=ZO(),NW=dq(),MW=jq(),FW=Hq(),Vq=Bq(),DW=[$W.default,NW.default,(0,MW.default)(),FW.default,Vq.metadataVocabulary,Vq.contentVocabulary];zw.default=DW});var Jq=H(hm=>{"use strict";Object.defineProperty(hm,"__esModule",{value:!0});hm.DiscrError=void 0;var zq;(function(t){t.Tag="tag",t.Mapping="mapping"})(zq||(hm.DiscrError=zq={}))});var Yq=H(Gw=>{"use strict";Object.defineProperty(Gw,"__esModule",{value:!0});var uu=je(),Jw=Jq(),Gq=Qh(),LW=bf(),jW=Ke(),UW={message:({params:{discrError:t,tagName:e}})=>t===Jw.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}}`},HW={keyword:"discriminator",type:"object",schemaType:"object",error:UW,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 f=e.let("valid",!1),c=e.const("tag",(0,uu._)`${r}${(0,uu.getProperty)(l)}`);e.if((0,uu._)`typeof ${c} == "string"`,()=>p(),()=>t.error(!1,{discrError:Jw.DiscrError.Tag,tag:c,tagName:l})),t.ok(f);function p(){let v=g();e.if(!1);for(let _ in v)e.elseIf((0,uu._)`${c} === ${_}`),e.assign(f,h(v[_]));e.else(),t.error(!1,{discrError:Jw.DiscrError.Mapping,tag:c,tagName:l}),e.endIf()}function h(v){let _=e.name("valid"),w=t.subschema({keyword:"oneOf",schemaProp:v},_);return t.mergeEvaluated(w,uu.Name),_}function g(){var v;let _={},w=k(i),E=!0;for(let $=0;$<o.length;$++){let j=o[$];if(j?.$ref&&!(0,jW.schemaHasRulesButRef)(j,s.self.RULES)){let q=j.$ref;if(j=Gq.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,q),j instanceof Gq.SchemaEnv&&(j=j.schema),j===void 0)throw new LW.default(s.opts.uriResolver,s.baseId,q)}let G=(v=j?.properties)===null||v===void 0?void 0:v[l];if(typeof G!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);E=E&&(w||k(j)),T(G,$)}if(!E)throw new Error(`discriminator: "${l}" must be required`);return _;function k({required:$}){return Array.isArray($)&&$.includes(l)}function T($,j){if($.const)N($.const,j);else if($.enum)for(let G of $.enum)N(G,j);else throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`)}function N($,j){if(typeof $!="string"||$ in _)throw new Error(`discriminator: "${l}" values must be unique strings`);_[$]=j}}}};Gw.default=HW});var Kq=H((RZ,BW)=>{BW.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 Zq=H((It,Yw)=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.MissingRefError=It.ValidationError=It.CodeGen=It.Name=It.nil=It.stringify=It.str=It._=It.KeywordCxt=It.Ajv=void 0;var VW=zO(),WW=Wq(),zW=Yq(),Qq=Kq(),JW=["/properties"],mm="http://json-schema.org/draft-07/schema",cu=class extends VW.default{_addVocabularies(){super._addVocabularies(),WW.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(zW.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Qq,JW):Qq;this.addMetaSchema(e,mm,!1),this.refs["http://json-schema.org/schema"]=mm}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(mm)?mm:void 0)}};It.Ajv=cu;Yw.exports=It=cu;Yw.exports.Ajv=cu;Object.defineProperty(It,"__esModule",{value:!0});It.default=cu;var GW=vf();Object.defineProperty(It,"KeywordCxt",{enumerable:!0,get:function(){return GW.KeywordCxt}});var fu=je();Object.defineProperty(It,"_",{enumerable:!0,get:function(){return fu._}});Object.defineProperty(It,"str",{enumerable:!0,get:function(){return fu.str}});Object.defineProperty(It,"stringify",{enumerable:!0,get:function(){return fu.stringify}});Object.defineProperty(It,"nil",{enumerable:!0,get:function(){return fu.nil}});Object.defineProperty(It,"Name",{enumerable:!0,get:function(){return fu.Name}});Object.defineProperty(It,"CodeGen",{enumerable:!0,get:function(){return fu.CodeGen}});var YW=Yh();Object.defineProperty(It,"ValidationError",{enumerable:!0,get:function(){return YW.default}});var KW=bf();Object.defineProperty(It,"MissingRefError",{enumerable:!0,get:function(){return KW.default}})});import*as QW from"crypto";import*as Ea from"fs";import{createRequire as ZW}from"module";import*as ri from"path";function ym(){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 Xq(){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 Kw(t,e){return new gm(t,e)}var gm,Qw=se(()=>{"use strict";iS();gm=class{availableModules=new Set;customModulesRequire;globalSetupExports;options;modulesPath=null;moduleCache=new Map;resolveStack=new Set;builtinModules={uuid:()=>({v4:Jl}),crypto:()=>QW,path:()=>ri,querystring:()=>ft("querystring"),lodash:()=>this.loadOptionalModule("lodash",()=>yI(),Xq),moment:()=>this.loadOptionalModule("moment",()=>vI(),ym),tv4:()=>this.loadOptionalModule("tv4",()=>SI()),ajv:()=>this.loadOptionalModule("ajv",()=>Zq()),"crypto-js":()=>this.loadOptionalModule("crypto-js",()=>ft("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=ri.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": {
34
34
  "${e}": "${n}"
35
35
  }
36
36
  }
37
- Then run: cd http-forge/modules && npm install`}initializeModules(e){if(this.logDebug("Initializing module loader..."),!this.options.allowCustomModules)return this.logDebug("Custom modules disabled by configuration"),!0;try{let r=ri.resolve(e,"package.json");if(!xa.existsSync(r))return this.logDebug(`No modules/package.json found at ${e}`),!1;let n=xa.realpathSync(r);return this.customModulesRequire=ZW(n),this.loadAvailableModules(e),this.loadGlobalSetup(e),this.logDebug(`Module loader initialized with ${this.availableModules.size} workspace modules`),!0}catch(r){return console.error("Failed to initialize modules:",r),!1}}loadAvailableModules(e){try{let r=ri.join(e,"package.json"),n=xa.readFileSync(r,"utf-8"),i=JSON.parse(n);if(typeof i!="object"||i===null)throw new Error("Invalid package.json: must be an object");let s=i.dependencies||{},o=i.devDependencies||{};if(typeof s!="object"||typeof o!="object")throw new Error("Invalid dependencies in package.json");Object.keys(s).forEach(l=>{typeof l=="string"&&l.trim()&&this.availableModules.add(l.trim())}),Object.keys(o).forEach(l=>{typeof l=="string"&&l.trim()&&this.availableModules.add(l.trim())}),this.logDebug(`Loaded ${this.availableModules.size} modules from package.json`)}catch(r){let n=`Failed to load workspace modules from package.json: ${r instanceof Error?r.message:r}`;this.logError(n)}}loadGlobalSetup(e){let r=ri.join(e,"global-setup.js");if(xa.existsSync(r))try{this.customModulesRequire&&(this.globalSetupExports=this.customModulesRequire("./global-setup.js"))}catch(n){console.error("Failed to load global-setup.js:",n),this.globalSetupExports=void 0}}createRequireFunction(){return e=>{let r=Date.now();try{if(this.resolveStack.has(e))throw new Error(`Circular dependency detected: ${Array.from(this.resolveStack).join(" -> ")} -> ${e}`);if(this.resolveStack.size>=this.options.maxResolveDepth)throw new Error(`Maximum module resolve depth (${this.options.maxResolveDepth}) exceeded`);this.resolveStack.add(e);let n=this.moduleCache.get(e);if(n)return this.logDebug(`Module cache hit: ${e}`),n.module;if(this.builtinModules[e]){this.logDebug(`Loading built-in module: ${e}`);let o=this.builtinModules[e]();return this.cacheModule(e,o,"builtin",Date.now()-r),o}if(!this.modulesPath)throw new Error("Module loading is not initialized. No valid modules/ directory found. Create .http-forge/assets/modules/package.json first.");if(e.startsWith("./")||e.startsWith("../")){if(!this.customModulesRequire)throw new Error(`Cannot load local module '${e}': No modules/ folder found. Create .http-forge/assets/modules/package.json first.`);let o=ri.resolve(this.modulesPath,e),l=ri.normalize(o),f=ri.normalize(this.modulesPath);if(!l.startsWith(f))throw new Error(`Security violation: Attempt to load module outside modules directory: ${e}`);try{this.logDebug(`Loading relative module: ${e}`);let c=this.customModulesRequire(e);return this.cacheModule(e,c,"relative",Date.now()-r),c}catch(c){throw new Error(`Failed to load local module '${e}': ${c.message}`)}}if(this.availableModules.has(e)&&this.customModulesRequire)try{this.logDebug(`Loading workspace module: ${e}`);let o=this.customModulesRequire(e);return this.cacheModule(e,o,"workspace",Date.now()-r),o}catch(o){throw new Error(`Module '${e}' is in package.json but failed to load: ${o.message}`)}let i=this.getModuleSuggestions(e),s=`Module '${e}' is not available.`;throw i.length>0&&(s+=` Did you mean: ${i.join(", ")}?`),s+=`
37
+ Then run: cd http-forge/modules && npm install`}initializeModules(e){if(this.logDebug("Initializing module loader..."),!this.options.allowCustomModules)return this.logDebug("Custom modules disabled by configuration"),!0;try{let r=ri.resolve(e,"package.json");if(!Ea.existsSync(r))return this.logDebug(`No modules/package.json found at ${e}`),!1;let n=Ea.realpathSync(r);return this.customModulesRequire=ZW(n),this.loadAvailableModules(e),this.loadGlobalSetup(e),this.logDebug(`Module loader initialized with ${this.availableModules.size} workspace modules`),!0}catch(r){return console.error("Failed to initialize modules:",r),!1}}loadAvailableModules(e){try{let r=ri.join(e,"package.json"),n=Ea.readFileSync(r,"utf-8"),i=JSON.parse(n);if(typeof i!="object"||i===null)throw new Error("Invalid package.json: must be an object");let s=i.dependencies||{},o=i.devDependencies||{};if(typeof s!="object"||typeof o!="object")throw new Error("Invalid dependencies in package.json");Object.keys(s).forEach(l=>{typeof l=="string"&&l.trim()&&this.availableModules.add(l.trim())}),Object.keys(o).forEach(l=>{typeof l=="string"&&l.trim()&&this.availableModules.add(l.trim())}),this.logDebug(`Loaded ${this.availableModules.size} modules from package.json`)}catch(r){let n=`Failed to load workspace modules from package.json: ${r instanceof Error?r.message:r}`;this.logError(n)}}loadGlobalSetup(e){let r=ri.join(e,"global-setup.js");if(Ea.existsSync(r))try{this.customModulesRequire&&(this.globalSetupExports=this.customModulesRequire("./global-setup.js"))}catch(n){console.error("Failed to load global-setup.js:",n),this.globalSetupExports=void 0}}createRequireFunction(){return e=>{let r=Date.now();try{if(this.resolveStack.has(e))throw new Error(`Circular dependency detected: ${Array.from(this.resolveStack).join(" -> ")} -> ${e}`);if(this.resolveStack.size>=this.options.maxResolveDepth)throw new Error(`Maximum module resolve depth (${this.options.maxResolveDepth}) exceeded`);this.resolveStack.add(e);let n=this.moduleCache.get(e);if(n)return this.logDebug(`Module cache hit: ${e}`),n.module;if(this.builtinModules[e]){this.logDebug(`Loading built-in module: ${e}`);let o=this.builtinModules[e]();return this.cacheModule(e,o,"builtin",Date.now()-r),o}if(!this.modulesPath)throw new Error("Module loading is not initialized. No valid modules/ directory found. Create .http-forge/assets/modules/package.json first.");if(e.startsWith("./")||e.startsWith("../")){if(!this.customModulesRequire)throw new Error(`Cannot load local module '${e}': No modules/ folder found. Create .http-forge/assets/modules/package.json first.`);let o=ri.resolve(this.modulesPath,e),l=ri.normalize(o),f=ri.normalize(this.modulesPath);if(!l.startsWith(f))throw new Error(`Security violation: Attempt to load module outside modules directory: ${e}`);try{this.logDebug(`Loading relative module: ${e}`);let c=this.customModulesRequire(e);return this.cacheModule(e,c,"relative",Date.now()-r),c}catch(c){throw new Error(`Failed to load local module '${e}': ${c.message}`)}}if(this.availableModules.has(e)&&this.customModulesRequire)try{this.logDebug(`Loading workspace module: ${e}`);let o=this.customModulesRequire(e);return this.cacheModule(e,o,"workspace",Date.now()-r),o}catch(o){throw new Error(`Module '${e}' is in package.json but failed to load: ${o.message}`)}let i=this.getModuleSuggestions(e),s=`Module '${e}' is not available.`;throw i.length>0&&(s+=` Did you mean: ${i.join(", ")}?`),s+=`
38
38
  Add it to http-forge/modules/package.json and run npm install.`,new Error(s)}finally{this.resolveStack.delete(e)}}}getModuleSuggestions(e){let r=this.getAvailableModules(),n=[];for(let i of r)if(i.startsWith(e.substring(0,3))&&(n.push(i),n.length>=3))break;return n}cacheModule(e,r,n,i){this.moduleCache.set(e,{module:r,source:n,resolveTime:i}),i>100&&this.logDebug(`Slow module load: ${e} took ${i}ms`)}getGlobalSetupExports(){return this.globalSetupExports}hasCustomModules(){return this.customModulesRequire!==void 0}getAvailableModules(){return[...Object.keys(this.builtinModules),...Array.from(this.availableModules)].sort()}clearCache(){this.moduleCache.clear(),this.logDebug("Module cache cleared")}getCacheStats(){return{size:this.moduleCache.size,hits:0}}logDebug(e){this.options.outputChannel&&this.options.outputChannel.appendLine(`[ModuleLoader] ${e}`)}logError(e){this.options.outputChannel&&this.options.outputChannel.appendLine(`[ModuleLoader ERROR] ${e}`),console.error(`[ModuleLoader ERROR] ${e}`)}}});function ek(t){let e=new Set,r=new Set,n=(p,h)=>{try{p(...h)}catch(g){try{t(g)}catch{}}},i={setTimeout:(p,h,...g)=>{if(typeof p!="function")return setTimeout(()=>{},h);let v=setTimeout(()=>{e.delete(v),n(p,g)},h);return e.add(v),v},clearTimeout:p=>{p!=null&&(e.delete(p),clearTimeout(p))},setInterval:(p,h,...g)=>{if(typeof p!="function")return setInterval(()=>{},h);let v=setInterval(()=>{n(p,g)},h);return r.add(v),v},clearInterval:p=>{p!=null&&(r.delete(p),clearInterval(p))}},s=()=>e.size+r.size,o=()=>{for(let p of e)clearTimeout(p);for(let p of r)clearInterval(p);e.clear(),r.clear()},l=p=>new Promise(h=>setTimeout(h,p)),f=async p=>{let h=Date.now();for(await l(0);s()>0;){let g=Date.now()-h;if(g>=p)return o(),{timedOut:!0,elapsedMs:Date.now()-h};let v=p-g;await l(Math.min(15,v))}return await l(0),s()>0?c(h,p):{timedOut:!1,elapsedMs:Date.now()-h}},c=async(p,h)=>{for(;s()>0;){let g=Date.now()-p;if(g>=h)return o(),{timedOut:!0,elapsedMs:Date.now()-p};let v=h-g;await l(Math.min(15,v))}return{timedOut:!1,elapsedMs:Date.now()-p}};return{timers:i,pendingCount:s,clearAll:o,drain:f}}var tk=se(()=>{"use strict"});function Zw(t,e,r="$"){let n=[];if(e===null||typeof e!="object")return n;let i=s=>s===null?"null":Array.isArray(s)?"array":Number.isInteger(s)?"integer":typeof s;if(e.type!==void 0){let s=Array.isArray(e.type)?e.type:[e.type],o=i(t);if(!s.some(f=>f===o||f==="number"&&o==="integer"))return n.push(`${r}: expected type ${s.join("|")} but got ${o}`),n}if(Array.isArray(e.enum)&&!e.enum.some(s=>JSON.stringify(s)===JSON.stringify(t))&&n.push(`${r}: value ${JSON.stringify(t)} is not in enum ${JSON.stringify(e.enum)}`),typeof t=="number"&&(typeof e.minimum=="number"&&t<e.minimum&&n.push(`${r}: ${t} is below minimum ${e.minimum}`),typeof e.maximum=="number"&&t>e.maximum&&n.push(`${r}: ${t} is above maximum ${e.maximum}`)),typeof t=="string"&&(typeof e.minLength=="number"&&t.length<e.minLength&&n.push(`${r}: string length ${t.length} is below minLength ${e.minLength}`),typeof e.maxLength=="number"&&t.length>e.maxLength&&n.push(`${r}: string length ${t.length} is above maxLength ${e.maxLength}`),typeof e.pattern=="string"&&!new RegExp(e.pattern).test(t)&&n.push(`${r}: string does not match pattern ${e.pattern}`)),i(t)==="object"){if(Array.isArray(e.required))for(let s of e.required)s in t||n.push(`${r}: missing required property "${s}"`);if(e.properties&&typeof e.properties=="object")for(let[s,o]of Object.entries(e.properties))s in t&&n.push(...Zw(t[s],o,`${r}.${s}`));if(e.additionalProperties===!1&&e.properties){let s=new Set(Object.keys(e.properties));for(let o of Object.keys(t))s.has(o)||n.push(`${r}: additional property "${o}" is not allowed`)}}return Array.isArray(t)&&e.items&&typeof e.items=="object"&&t.forEach((s,o)=>{n.push(...Zw(s,e.items,`${r}[${o}]`))}),n}function XW(t){let e=t.httpOnly??!1,r=t.secure??!1,n=t.expires==null&&t.maxAge==null;return{name:t.name,value:t.value,domain:t.domain,path:t.path,expires:t.expires,maxAge:t.maxAge,httpOnly:e,secure:r,session:n,hostOnly:!1,sameSite:t.sameSite,valueOf(){return t.value},toString(){let i=[`${t.name}=${t.value}`];return t.expires&&i.push(`Expires=${t.expires}`),t.maxAge!=null&&i.push(`Max-Age=${t.maxAge}`),t.domain&&i.push(`Domain=${t.domain}`),t.path&&i.push(`Path=${t.path}`),r&&i.push("Secure"),e&&i.push("HttpOnly"),t.sameSite&&i.push(`SameSite=${t.sameSite}`),i.join("; ")}}}function ez(t){let e=t.map(XW),r=n=>e.find(i=>i.name===n);return e.get=n=>r(n)?.value,e.one=n=>r(n),e.has=n=>e.some(i=>i.name===n),e.toObject=()=>{let n={};for(let i of e)n[i.name]=i.value;return n},e.all=()=>[...e],e.each=n=>{for(let i of e)n(i)},e.count=()=>e.length,e.idx=n=>e[n],e}function tz(t,e){if(t==null)return{exists:!1,value:void 0};if(!e)return{exists:!0,value:t};let n=e.replace(/\[(\d+)\]/g,".$1").replace(/\[("([^"]*)"|'([^']*)')\]/g,".$2").replace(/^\./,"").split(".").filter(Boolean),i=t;for(let s of n){if(i==null)return{exists:!1,value:void 0};let o=/^\d+$/.test(s)?Number(s):s;if(!(o in Object(i)))return{exists:!1,value:void 0};i=i[o]}return{exists:!0,value:i}}function rz(t){let e={...t};return e.get=r=>{let n=r.toLowerCase();for(let[i,s]of Object.entries(t))if(i.toLowerCase()===n)return s},e.has=r=>{let n=r.toLowerCase();return Object.keys(t).some(i=>i.toLowerCase()===n)},e.toObject=()=>({...t}),e.each=r=>{for(let[n,i]of Object.entries(t))r({key:n,value:i})},e}function vm(t){let e=rz(t.headers),r=ez(t.cookies||[]);return{status:t.statusText,code:t.status,statusText:t.statusText,headers:e,body:t.body,cookies:r,responseTime:t.responseTime,responseSize:t.responseSize,reason(){return this.statusText},json(){if(typeof this.body=="object")return this.body;try{return JSON.parse(this.body)}catch{return null}},text(){return typeof this.body=="string"?this.body:JSON.stringify(this.body)},to:{have:{status(n){if(t.status!==n)throw new Error(`Expected status ${n} but got ${t.status}`)},header(n,i){let s=t.headers[n]||t.headers[n.toLowerCase()];if(!s)throw new Error(`Expected header "${n}" to exist`);if(i!==void 0&&s!==i)throw new Error(`Expected header "${n}" to be "${i}" but got "${s}"`)},body(n){let i=typeof t.body=="string"?t.body:JSON.stringify(t.body);if(n!==void 0&&i!==n)throw new Error(`Expected body to be "${n}" but got "${i}"`)},jsonBody(n){let i=typeof t.body=="object"?t.body:JSON.parse(t.body);if(n!==void 0&&JSON.stringify(i)!==JSON.stringify(n))throw new Error("Expected JSON body to match")},jsonSchema(n){let i=typeof t.body=="object"?t.body:JSON.parse(t.body),s=Zw(i,n);if(s.length>0)throw new Error(`Expected response body to match JSON schema:
39
39
  - ${s.join(`
40
40
  - `)}`)}},be:{get ok(){if(t.status<200||t.status>=300)throw new Error(`Expected response to be OK (2xx) but got ${t.status}`);return(()=>{})},get success(){if(t.status<200||t.status>=300)throw new Error(`Expected response to be successful (2xx) but got ${t.status}`);return(()=>{})},get error(){if(t.status<400)throw new Error(`Expected response to be error (4xx/5xx) but got ${t.status}`);return(()=>{})},get clientError(){if(t.status<400||t.status>=500)throw new Error(`Expected response to be client error (4xx) but got ${t.status}`);return(()=>{})},get serverError(){if(t.status<500||t.status>=600)throw new Error(`Expected response to be server error (5xx) but got ${t.status}`);return(()=>{})}}}}}function Af(t){return{_value:t,_negated:!1,_deep:!1,get not(){return this._negated=!this._negated,this},get to(){return this},get be(){return this},get have(){return this},get deep(){return this._deep=!0,this},get and(){return this},get that(){return this},get which(){return this},get is(){return this},get been(){return this},get has(){return this},get with(){return this},get at(){return this},get of(){return this},get same(){return this},get but(){return this},get does(){return this},get still(){return this},get also(){return this},_assert(r,n){if(!(this._negated?!r:r))throw new Error(n)},equal(r){return this._deep?(this._deep=!1,this.eql(r)):(this._assert(this._value===r,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}equal ${JSON.stringify(r)}`),this)},eq(r){return this.equal(r)},equals(r){return this.equal(r)},eql(r){let n=JSON.stringify(this._value)===JSON.stringify(r);return this._assert(n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}deeply equal ${JSON.stringify(r)}`),this},eqls(r){return this.eql(r)},property(r,n){let i=this._deep;this._deep=!1;let s=i?tz(this._value,r):{exists:typeof this._value=="object"&&this._value!==null&&r in this._value,value:this._value?.[r]};return n!==void 0?this._assert(s.exists&&s.value===n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have property "${r}" with value ${JSON.stringify(n)}`):this._assert(s.exists,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have property "${r}"`),this},get ok(){return this._assert(!!this._value,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be truthy`),this},get exist(){return this._assert(this._value!==null&&this._value!==void 0,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}exist`),this},include(r){let n=!1;return typeof this._value=="string"?n=this._value.includes(r):Array.isArray(this._value)?n=this._value.includes(r):typeof this._value=="object"&&this._value!==null&&(n=r in this._value),this._assert(n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}include ${JSON.stringify(r)}`),this},includes(r){return this.include(r)},throw(r){if(typeof this._value!="function")throw new Error(`Expected ${JSON.stringify(this._value)} to be a function`);let n;try{this._value()}catch(o){n=o}let s=n!==void 0;if(s&&r!==void 0){let o=n?.message??String(n);typeof r=="string"?s=o.includes(r):r instanceof RegExp?s=r.test(o):typeof r=="function"&&(s=n instanceof r)}return this._assert(s,`Expected ${this._value} to ${this._negated?"not ":""}throw${r!==void 0?` ${r}`:""}`),this},throws(r){return this.throw(r)},instanceOf(r){return this._assert(this._value instanceof r,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be an instance of ${r?.name||"provided constructor"}`),this},instanceof(r){return this.instanceOf(r)},contain(r){return this.include(r)},contains(r){return this.include(r)},oneOf(r){let n=Array.isArray(r)&&r.includes(this._value);return this._assert(n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be one of ${JSON.stringify(r)}`),this},match(r){let n=r.test(String(this._value));return this._assert(n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}match ${r}`),this},above(r){return this._assert(Number(this._value)>r,`Expected ${this._value} to ${this._negated?"not ":""}be above ${r}`),this},below(r){return this._assert(Number(this._value)<r,`Expected ${this._value} to ${this._negated?"not ":""}be below ${r}`),this},gt(r){return this.above(r)},lt(r){return this.below(r)},least(r){return this._assert(Number(this._value)>=r,`Expected ${this._value} to ${this._negated?"not ":""}be at least ${r}`),this},most(r){return this._assert(Number(this._value)<=r,`Expected ${this._value} to ${this._negated?"not ":""}be at most ${r}`),this},gte(r){return this.least(r)},lte(r){return this.most(r)},greaterThan(r){return this.above(r)},lessThan(r){return this.below(r)},within(r,n){let i=Number(this._value);return this._assert(i>=r&&i<=n,`Expected ${this._value} to ${this._negated?"not ":""}be within ${r}..${n}`),this},closeTo(r,n){let i=Number(this._value);return this._assert(Math.abs(i-r)<=n,`Expected ${this._value} to ${this._negated?"not ":""}be within ${n} of ${r}`),this},approximately(r,n){return this.closeTo(r,n)},get true(){return this._assert(this._value===!0,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be true`),this},get false(){return this._assert(this._value===!1,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be false`),this},get null(){return this._assert(this._value===null,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be null`),this},get undefined(){return this._assert(this._value===void 0,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be undefined`),this},get empty(){let r=!1;return this._value===null||this._value===void 0?r=!0:typeof this._value=="string"||Array.isArray(this._value)?r=this._value.length===0:typeof this._value=="object"&&(r=Object.keys(this._value).length===0),this._assert(r,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be empty`),this},length(r){let n=Array.isArray(this._value)||typeof this._value=="string"?this._value.length:Object.keys(this._value||{}).length;return this._assert(n===r,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have length ${r}`),this},lengthOf(r){return this.length(r)},a(r){let n=Array.isArray(this._value)?"array":typeof this._value;return this._assert(n===r.toLowerCase(),`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be a(n) ${r} (got ${n})`),this},an(r){return this.a(r)},members(r){let n=this._value,i=Array.isArray(n)&&Array.isArray(r)&&r.every(s=>n.some(o=>JSON.stringify(o)===JSON.stringify(s)));return this._assert(i,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have members ${JSON.stringify(r)}`),this},keys(...r){let n=Array.isArray(r[0])?r[0]:r,i=Object.keys(this._value||{}),s=n.every(o=>i.includes(o));return this._assert(s,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have keys ${JSON.stringify(n)}`),this},string(r){return this._assert(typeof this._value=="string"&&this._value.includes(r),`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}contain string "${r}"`),this}}}var bm=se(()=>{"use strict"});function Sm(t,e=!1){let r=(typeof t=="string"?[t]:t).filter(i=>i&&i.trim());return r.length===0?"":e?`(async () => {
@@ -47,10 +47,10 @@ ${i}
47
47
 
48
48
  // --- Next Script ---
49
49
 
50
- `)}function $f(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function du(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 nz(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 Xw(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 e0(t){let e={};for(let[r,n]of Object.entries(t))e[r]=Array.isArray(n)?n.join(", "):n;return e}function wm(t,e,r){let n;if(r)try{n=new URL(r).hostname}catch{n=void 0}let i=ht.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 Nf=se(()=>{"use strict";oa()});import*as t0 from"vm";function iz(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 Mf,r0=se(()=>{"use strict";tk();bm();Nf();Mf=class{constructor(e,r){this.deps=e;this.initialContext=r;this.timerRegistry=ek(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,f)=>{e.cookieJar&&e.cookieJar.set({name:l,value:f,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),f={};for(let c of l)f[c.name]=c.value;return f},jar:()=>{let l=e.cookieJar;return{getAll(f,c){try{if(!l){c(null,[]);return}let p=l.getAll(f).map(h=>({name:h.name,value:h.value,domain:h.domain,path:h.path,httpOnly:h.httpOnly,secure:h.secure}));c(null,p)}catch(p){c(p,[])}},get(f,c,p){try{if(!l){p(null,void 0);return}let h=l.get(c,f);p(null,h?{name:h.name,value:h.value,domain:h.domain}:void 0)}catch(h){p(h,void 0)}},set(f,c,p,h){try{if(!l){(h||p)?.(null);return}typeof c=="string"&&typeof p=="string"?(l.set({name:c,value:p,domain:f}),h?.(null)):typeof c=="object"&&(l.set({...c,domain:f}),p?.(null))}catch(g){(h||p)?.(g)}},unset(f,c,p){try{if(!l){p?.(null);return}l.delete(c,f),p?.(null)}catch(h){p?.(h)}},clear(f){try{if(!l){f?.(null);return}l.clear(),f?.(null)}catch(c){f?.(c)}}}},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:Xw(this.assertions),expect:Af,cookies:s,execution:{setNextRequest(l){o._nextRequest=l},skipRequest(){o._skipRequest=!0},runRequest(l,f){let p=(async()=>{if(typeof n.sendRequest!="function")throw new Error("pm.execution.runRequest is not available \u2014 HTTP service not configured.");let h=typeof l=="string"?{url:l,method:"GET"}:l,g=await n.sendRequest(h),v=Array.isArray(g?.cookies)?g.cookies.filter(E=>E?.name):[],_=g?.body,w=0;if(typeof _=="string")w=Buffer.byteLength(_,"utf8");else if(Buffer.isBuffer(_))w=_.length;else if(_!=null)try{w=Buffer.byteLength(JSON.stringify(_),"utf8")}catch{}return vm({executedRequest:null,status:g?.status??0,statusText:g?.statusText??"",headers:g?.headers??{},body:_,cookies:v,responseTime:g?.time,responseSize:w})})();if(typeof f=="function"){p.then(h=>f(null,h),h=>f(h));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,f){o._visualizerData={template:l,data:f}},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[f,c]of Object.entries(e.headers))if(f.toLowerCase()===l.toLowerCase())return c},has:l=>{for(let f of Object.keys(e.headers))if(f.toLowerCase()===l.toLowerCase())return!0;return!1},remove:l=>{for(let f of Object.keys(e.headers))if(f.toLowerCase()===l.toLowerCase()){delete e.headers[f];break}},update:l=>{if(l&&l.key){for(let f of Object.keys(e.headers))if(f.toLowerCase()===l.key.toLowerCase()){e.headers[f]=l.value||"";return}}},upsert:l=>{if(l&&l.key){for(let f of Object.keys(e.headers))if(f.toLowerCase()===l.key.toLowerCase()){e.headers[f]=l.value||"";return}e.headers[l.key]=l.value||""}},toObject:()=>{let l={};for(let[f,c]of Object.entries(e.headers))typeof c=="string"&&(l[f]=c);return l},each:l=>{for(let[f,c]of Object.entries(e.headers))typeof c=="string"&&l({key:f,value:c})}},o={get mode(){return n(e.body?.type)},set mode(l){let f=i(l);e.body?e.body.type=f:e.body={type:f,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 iz(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 f=l.mode?i(l.mode):l.type||"raw";e.body={type:f,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 f={};for(let[c,p]of Object.entries(e.headers))typeof p=="string"&&(f[c]=p);return f},addQueryParams(l){if(typeof l=="string"){let f=new URLSearchParams(l);for(let[c,p]of f)e.query||(e.query={}),e.query[c]=p}else Array.isArray(l)&&(e.query||(e.query={}),l.forEach(f=>{f.key&&(e.query[f.key]=f.value||"")}))},removeQueryParams(l){e.query&&(typeof l=="string"?delete e.query[l]:Array.isArray(l)&&l.forEach(f=>{let c=typeof f=="string"?f:f.key;c&&delete e.query[c]}))},authorizeUsing(l,f){r.request&&(typeof l=="string"?(r.request.auth||(r.request.auth={}),r.request.auth.type=l,f&&(r.request.auth.parameters=f)):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,f){r.request&&(r.request.description={content:l,type:f||"text/plain"})},setHeader(l,f){e.headers[l]=f},addHeader(l,f){typeof l=="object"&&l!==null?e.headers[l.key]=l.value:e.headers[l]=f},removeHeader(l){delete e.headers[l]},setBody(l,f,c){e.body={type:f||e.body?.type||"raw",format:c||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[v,_]of Object.entries(s?.headers||{}))typeof _=="string"&&(o[v]=_);let l=s?.body,f=l==null?null:typeof l=="object"&&"content"in l?l.content:l,c=i.request;if(n.request={id:c?.id??"",name:c?.name??"",description:c?.description??"",url:typeof s?.url=="string"?s.url:String(s?.url??""),method:s?.method??"GET",headers:o,data:f},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 h=r.statusText||"";n.responseCode={code:r.status,name:h,detail:h},n.responseHeaders={...r.headers||{}},n.responseTime=r.responseTime??0,n.responseCookies=(r.cookies||[]).map(v=>({...v}));let g=this;n.tests=new Proxy({},{set(v,_,w){return g.assertions.push({name:String(_),passed:!!w,message:w?void 0:`"${String(_)}" was false`}),!0}})}async executePreRequest(e){let r=Sm(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=t0.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=du(this.consoleMessages),f=this.initialContext.request.body,c=!this.bodiesEqual(this.modifiedRequest.body,f);return{success:!0,modifiedRequest:{url:this.modifiedRequest.url!==this.initialContext.request.url?this.modifiedRequest.url:void 0,headers:$f(this.modifiedRequest.headers,this.initialContext.request.headers)?this.modifiedRequest.headers:void 0,body:c?this.modifiedRequest.body:void 0,params:$f(this.modifiedRequest.params,this.initialContext.request.params||{})?this.modifiedRequest.params:void 0,query:$f(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=[...du(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=Sm(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=vm(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=t0.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 f=du(this.consoleMessages);return{testResults:[...this.assertions],consoleOutput:f.length>0?f:void 0,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=[...du(this.consoleMessages),`[error] Script execution failed: ${i.message}`];return{testResults:[...this.assertions],consoleOutput:s,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=[]}}});import*as ar from"crypto";import*as sz from"querystring";import*as nk from"vm";function ik(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 sk(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function oz(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=ik(r[2],e),i=ns(r[1],n);return i!==null?i:void 0}if(e[t]!==void 0)return sk(e[t]);if(ua(t)){let n=la(t,e),i=ca(t,n);if(i!==void 0)return i}}function rk(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=ar.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 n0(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 Ve?i.toBuffer():Buffer.from(String(i),"utf8");if(typeof s=="string"){let f=ar.randomBytes(8),{key:c,iv:p}=rk(s,e,r,f),h=ar.createCipheriv(n(e),c,p),g=Buffer.concat([h.update(l),h.final()]),v=Buffer.concat([Buffer.from("Salted__"),f,g]);return{ciphertext:new Ve(g),salt:new Ve(f),toString:_=>_?_.stringify(new Ve(v)):v.toString("base64")}}else{let f=s.toBuffer(),c=o?.iv&&o.iv instanceof Ve?o.iv.toBuffer():Buffer.alloc(r),p=ar.createCipheriv(n(f.length),f,c);o?.padding===!1&&p.setAutoPadding(!1);let h=Buffer.concat([p.update(l),p.final()]);return{ciphertext:new Ve(h),toString:g=>g?g.stringify(new Ve(h)):h.toString("base64")}}},decrypt(i,s,o){if(typeof s=="string"){let l=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext.toBuffer(),f,c;l.subarray(0,8).toString()==="Salted__"?(c=l.subarray(8,16),f=l.subarray(16)):(c=Buffer.alloc(0),f=l);let{key:p,iv:h}=rk(s,e,r,c),g=ar.createDecipheriv(n(e),p,h);return new Ve(Buffer.concat([g.update(f),g.final()]))}else{let l=s.toBuffer(),f=o?.iv&&o.iv instanceof Ve?o.iv.toBuffer():Buffer.alloc(r),c=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext?i.ciphertext.toBuffer():Buffer.from(i),p=ar.createDecipheriv(n(l.length),l,f);return o?.padding===!1&&p.setAutoPadding(!1),new Ve(Buffer.concat([p.update(c),p.final()]))}}}}function az(){let t=r=>n=>{let i=n instanceof Ve?n.toBuffer():Buffer.from(String(n),"utf8");return new Ve(ar.createHash(r).update(i).digest())},e=r=>(n,i)=>{let s=n instanceof Ve?n.toBuffer():Buffer.from(String(n),"utf8"),o=i instanceof Ve?i.toBuffer():Buffer.from(String(i),"utf8");return new Ve(ar.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:n0("aes",32,16),DES:n0("des",8,8),TripleDES:n0("des-ede3",24,8),PBKDF2(r,n,i){let s=r instanceof Ve?r.toBuffer():Buffer.from(String(r),"utf8"),o=n instanceof Ve?n.toBuffer():Buffer.from(String(n),"utf8"),l=(i?.keySize||4)*4,f=i?.iterations||1;return new Ve(ar.pbkdf2Sync(s,o,f,l,"sha1"))},enc:{Base64:{stringify:r=>(r instanceof Ve?r.toBuffer():Buffer.from(String(r))).toString("base64"),parse:r=>Ve.fromBase64(r)},Utf8:{stringify:r=>(r instanceof Ve?r.toBuffer():Buffer.from(String(r))).toString("utf8"),parse:r=>Ve.fromUtf8(r)},Hex:{stringify:r=>(r instanceof Ve?r.toBuffer():Buffer.from(String(r))).toString("hex"),parse:r=>Ve.fromHex(r)},Latin1:{stringify:r=>(r instanceof Ve?r.toBuffer():Buffer.from(String(r))).toString("latin1"),parse:r=>new Ve(Buffer.from(r,"latin1"))},Utf16:{stringify:r=>(r instanceof Ve?r.toBuffer():Buffer.from(String(r))).toString("utf16le"),parse:r=>new Ve(Buffer.from(r,"utf16le"))},Utf16BE:{stringify:r=>(r instanceof Ve?r.toBuffer():Buffer.from(String(r))).swap16().toString("utf16le"),parse:r=>new Ve(Buffer.from(r,"utf16le").swap16())}},lib:{WordArray:{create:r=>r?typeof r=="string"?new Ve(Buffer.from(r,"utf8")):Buffer.isBuffer(r)?new Ve(r):new Ve(Buffer.from(String(r))):new Ve(Buffer.alloc(0)),random:r=>new Ve(ar.randomBytes(r))}},pad:{Pkcs7:{_name:"pkcs7"},NoPadding:{_name:"nopadding"},ZeroPadding:{_name:"zeropadding"}},mode:{CBC:{_name:"cbc"},ECB:{_name:"ecb"}}}}var Ve,cs,Ff=se(()=>{"use strict";kh();Th();$h();Qw();r0();bm();Ve=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"))}};cs=class t{constructor(e,r=[],n,i="shared",s=5e3){this.httpService=e;this.secretRegistry=n;this.scopeMode=i;this.scriptTimeoutMs=s;this.moduleLoader=Kw(r)}httpService;secretRegistry;scopeMode;scriptTimeoutMs;moduleLoader;createRequestSession(e){return new Mf({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:ar,_:s("lodash"),require:s,moment:ym(),querystring:sz,CryptoJS:az(),tv4:(()=>{try{return s("tv4")}catch{return}})(),postman:{setNextRequest:l=>e.setNextRequest?.(l),setGlobalVariable:(l,f)=>e.globals?.set(l,f),getGlobalVariable:l=>e.globals?.get(l),clearGlobalVariable:l=>e.globals?.unset(l),setEnvironmentVariable:(l,f)=>e.environment?.set(l,f),getEnvironmentVariable:l=>e.environment?.get(l),clearEnvironmentVariable:l=>e.environment?.unset(l),getResponseHeader:l=>{let f=e.response?.headers?.get?.(l);return f===void 0?null:f},getResponseCookie:l=>{let f=e.response?.cookies;if(f&&typeof f[Symbol.iterator]=="function"){for(let c of f)if(c?.name&&c.name.toLowerCase()===l.toLowerCase())return{...c}}return null}},jsonStringify:(l,f,c)=>JSON.stringify(l,f,c),jsonParse:l=>JSON.parse(l),xml2Json:l=>{try{let f=this.moduleLoader.createRequireFunction()("xml2js"),c;return f.parseString(l,{explicitArray:!1},(p,h)=>{if(p)throw p;c=h}),c}catch{throw new Error("xml2Json() requires the xml2js module. Add it to your modules/package.json and run npm install.")}}};return nk.createContext(o)}createCommonContext(e,r){let n={...e.variables},i={...e.collectionVariables||{}},s={...e.globals||{}},o={...e.environmentVariables||{}},l=e.iterationData||{},f=this.createMergedVariableScope(n,o,i,s,l),c=this.createGlobalsScope(s,e.onGlobalsChange),p=this.createVariableScope(i),h=this.createEnvironmentScope(o,e.environmentName,e.onEnvironmentChange,!0),g={...h,set:(_,w)=>{let E=this.serializeValue(w);h.set(_,E),n[_]=E},unset(_){h.unset(_),delete n[_]},clear(){let _=Object.keys(o);h.clear();for(let w of _)delete n[w]}};return c.replaceIn=f.replaceIn,p.replaceIn=f.replaceIn,g.replaceIn=f.replaceIn,{globals:c,collectionVariables:p,variables:f,environment:g,iterationData:{get:_=>l[_],has:_=>_ in l,toObject:()=>({...l}),toJSON:()=>JSON.stringify(l)},sendRequest:this.createSendRequest(),expect:Af,info:e.info||{eventName:r,requestName:void 0,requestId:void 0}}}static JSON_TYPE_MARKER="";serializeValue(e){return typeof e=="string"?e:t.JSON_TYPE_MARKER+JSON.stringify(e)}deserializeValue(e){if(e!==void 0){if(typeof e=="string"&&e.charCodeAt(0)===30)try{return JSON.parse(e.slice(1))}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,f)=>{e[l]=this.serializeValue(f)},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 f=o.toObject(),c=20,p=g=>g.replace(/\{\{([^}]+)\}\}/g,(v,_)=>{let w=_.trim(),E=w.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(E)try{let N=ik(E[2],f),$=ns(E[1],N);return $!==null?String($):v}catch{return v}let k=Kc(w);if(k){let N=oz(k.input,f);if(N!==void 0){let $=Qc(N,k.filters,f);return $!==void 0?String($):v}return v}let T=o.get(w);if(T!==void 0)return String(T);if(ua(w)){let N={};for(let[G,q]of Object.entries(f))N[G]=sk(q);let $=la(w,N),j=ca(w,$);if(j!==void 0)return String(j)}return v}),h=l;for(let g=0;g<c;g++){let v=p(h);if(v===h)break;h=v}return h}};return o}createEnvironmentScope(e,r,n,i){let s=(o,l,f)=>{n&&(i?n(o,l,f):n(l||"",o==="set"?f:void 0))};return{name:r||"",get:o=>this.deserializeValue(e[o]),set:(o,l)=>{let f=this.serializeValue(l);e[o]=f,s("set",o,f)},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 i0,Ea,_m=se(()=>{"use strict";i0={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"},Ea=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=i0["x-www-form-urlencoded"];break;case"raw":s=r.format?i0[r.format]:"text/plain",s||(s="text/plain");break;case"graphql":s=i0.graphql;break;case"binary":s="application/octet-stream";break}s&&(e["Content-Type"]=s)}}});var Oa,Rm=se(()=>{"use strict";Oa=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((f,c)=>{l[f]=o[c]||""}),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}}});import*as mu from"crypto";var uz,Uf,o0=se(()=>{"use strict";uz=3e4,Uf=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 f={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,f,l,s,o,n);let c=await this.httpService.execute({method:"POST",url:i,headers:f,body:l.toString()}),p=this.parseTokenResponse(c.body,e);p.refreshToken||(p.refreshToken=r);let h=this.buildCacheKeyString(e);return this.tokenCache.set(h,p),p.refreshToken&&await this.storeRefreshToken(h,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 f=e.usePkce!==!1,c,p,h;if(f){c=this.generateCodeVerifier();let G=e.pkceMethod||"S256";p=G==="S256"?this.generateCodeChallengeS256(c):c,h=G}let g=e.state||mu.randomBytes(16).toString("hex"),v=await this.getCallbackUri(),_=new URL(n);if(_.searchParams.set("response_type","code"),_.searchParams.set("client_id",s),_.searchParams.set("redirect_uri",v),l&&_.searchParams.set("scope",l),_.searchParams.set("state",g),p&&(_.searchParams.set("code_challenge",p),_.searchParams.set("code_challenge_method",h)),e.audience&&_.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&_.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[G,q]of Object.entries(e.extraParams))_.searchParams.set(G,this.resolve(q,r));this.pendingAuthCallback&&(this.pendingAuthCallback.reject(new Error("OAuth2 authorization superseded by a new request")),this.pendingAuthCallback=null);let w=new Promise((G,q)=>{this.pendingAuthCallback={resolve:G,reject:q,state:g}});await this.browserService.openExternal(_.toString());let E;try{E=await Promise.race([w,new Promise((G,q)=>setTimeout(()=>{this.pendingAuthCallback=null,q(new Error("OAuth2 authorization timed out after 2 minutes"))},12e4))])}finally{this.pendingAuthCallback=null}if(E.state&&E.state!==g)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let k=new URLSearchParams;k.append("grant_type","authorization_code"),k.append("code",E.code),k.append("redirect_uri",v),c&&k.append("code_verifier",c);let T={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,T,k,s,o,r);let N=await this.httpService.execute({method:"POST",url:i,headers:T,body:k.toString()}),$=this.parseTokenResponse(N.body,e),j=this.buildCacheKeyString(e);return this.tokenCache.set(j,$),$.refreshToken&&await this.storeRefreshToken(j,$.refreshToken),$}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||mu.randomBytes(16).toString("hex"),l=await this.getCallbackUri(),f=new URL(n);if(f.searchParams.set("response_type","token"),f.searchParams.set("client_id",i),f.searchParams.set("redirect_uri",l),s&&f.searchParams.set("scope",s),f.searchParams.set("state",o),e.audience&&f.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&f.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[v,_]of Object.entries(e.extraParams))f.searchParams.set(v,this.resolve(_,r));this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow superseded by a new request")),this.pendingImplicitCallback=null);let c=new Promise((v,_)=>{this.pendingImplicitCallback={resolve:v,reject:_,state:o}});await this.browserService.openExternal(f.toString());let p;try{p=await Promise.race([c,new Promise((v,_)=>setTimeout(()=>{this.pendingImplicitCallback=null,_(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 h={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}},g=this.buildCacheKeyString(e);return this.tokenCache.set(g,h),h}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,f=new URLSearchParams;if(f.append("grant_type",n),l&&f.append("scope",l),n==="password"){let h=this.resolve(e.username||"",r),g=this.resolve(e.password||"",r);if(!h)throw new Error("OAuth2 password grant requires username");f.append("username",h),f.append("password",g)}if(e.audience&&f.append("audience",this.resolve(e.audience,r)),e.resource&&f.append("resource",this.resolve(e.resource,r)),e.extraParams)for(let[h,g]of Object.entries(e.extraParams))f.append(h,this.resolve(g,r));let c={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,c,f,s,o,r);let p=await this.httpService.execute({method:"POST",url:i,headers:c,body:f.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-uz:!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 mu.randomBytes(32).toString("base64url")}generateCodeChallengeS256(e){return mu.createHash("sha256").update(e).digest("base64url")}async storeRefreshToken(e,r){try{await this.secretStore.store(`oauth2_refresh_${e}`,r)}catch{}}}});import*as qa from"fs";import*as ro from"path";function gu(t,e={}){let r=[];Object.entries(e).forEach(([n,i])=>{r.push(`${n}=${i}`)}),r.length&&qa.writeFileSync(t,r.join(`
51
- `),"utf-8")}function Hf(t,e,r){r&&(r.preRequest&&r.preRequest.trim()&&qa.writeFileSync(ro.join(t,`${e}.pre.js`),r.preRequest,"utf-8"),r.postResponse&&r.postResponse.trim()&&qa.writeFileSync(ro.join(t,`${e}.post.js`),r.postResponse,"utf-8"))}function cz(t,e){let n=e&&e.trim()?e.trim():"collections-rest-client";return ro.isAbsolute(n)?n:ro.join(t,n)}async function fz(t,e,r,n,i){await t.exportCollectionAsRestClientFolder(r,n),e.exportEnvironmentsToFolder(n,i)}function Cm(t,e,r){t.forEach(n=>{if(n.type==="folder"){let i=ro.join(e,At(n.name));qa.mkdirSync(i,{recursive:!0}),Hf(i,At(n.name),n.scripts),Cm(n.items||[],i,r)}else if(n.type==="request"){let i=n,s=At(i.name)+".http",o=ro.join(e,s),l=dz(i,r);qa.writeFileSync(o,l,"utf-8"),Hf(e,At(i.name),i.scripts)}})}function dz(t,e){let r=[];r.push(`### ${e.name} / ${t.name}`),r.push(`# collection env: ${At(e.name)}.env`),r.push(`# request scripts: ${At(t.name)}.pre.js and .post.js`);let n=pz(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(`
50
+ `)}function $f(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function du(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 nz(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 Xw(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 e0(t){let e={};for(let[r,n]of Object.entries(t))e[r]=Array.isArray(n)?n.join(", "):n;return e}function wm(t,e,r){let n;if(r)try{n=new URL(r).hostname}catch{n=void 0}let i=ht.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 Nf=se(()=>{"use strict";aa()});import*as t0 from"vm";function iz(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 Mf,r0=se(()=>{"use strict";tk();bm();Nf();Mf=class{constructor(e,r){this.deps=e;this.initialContext=r;this.timerRegistry=ek(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,f)=>{e.cookieJar&&e.cookieJar.set({name:l,value:f,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),f={};for(let c of l)f[c.name]=c.value;return f},jar:()=>{let l=e.cookieJar;return{getAll(f,c){try{if(!l){c(null,[]);return}let p=l.getAll(f).map(h=>({name:h.name,value:h.value,domain:h.domain,path:h.path,httpOnly:h.httpOnly,secure:h.secure}));c(null,p)}catch(p){c(p,[])}},get(f,c,p){try{if(!l){p(null,void 0);return}let h=l.get(c,f);p(null,h?{name:h.name,value:h.value,domain:h.domain}:void 0)}catch(h){p(h,void 0)}},set(f,c,p,h){try{if(!l){(h||p)?.(null);return}typeof c=="string"&&typeof p=="string"?(l.set({name:c,value:p,domain:f}),h?.(null)):typeof c=="object"&&(l.set({...c,domain:f}),p?.(null))}catch(g){(h||p)?.(g)}},unset(f,c,p){try{if(!l){p?.(null);return}l.delete(c,f),p?.(null)}catch(h){p?.(h)}},clear(f){try{if(!l){f?.(null);return}l.clear(),f?.(null)}catch(c){f?.(c)}}}},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:Xw(this.assertions),expect:Af,cookies:s,execution:{setNextRequest(l){o._nextRequest=l},skipRequest(){o._skipRequest=!0},runRequest(l,f){let p=(async()=>{if(typeof n.sendRequest!="function")throw new Error("pm.execution.runRequest is not available \u2014 HTTP service not configured.");let h=typeof l=="string"?{url:l,method:"GET"}:l,g=await n.sendRequest(h),v=Array.isArray(g?.cookies)?g.cookies.filter(E=>E?.name):[],_=g?.body,w=0;if(typeof _=="string")w=Buffer.byteLength(_,"utf8");else if(Buffer.isBuffer(_))w=_.length;else if(_!=null)try{w=Buffer.byteLength(JSON.stringify(_),"utf8")}catch{}return vm({executedRequest:null,status:g?.status??0,statusText:g?.statusText??"",headers:g?.headers??{},body:_,cookies:v,responseTime:g?.time,responseSize:w})})();if(typeof f=="function"){p.then(h=>f(null,h),h=>f(h));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,f){o._visualizerData={template:l,data:f}},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[f,c]of Object.entries(e.headers))if(f.toLowerCase()===l.toLowerCase())return c},has:l=>{for(let f of Object.keys(e.headers))if(f.toLowerCase()===l.toLowerCase())return!0;return!1},remove:l=>{for(let f of Object.keys(e.headers))if(f.toLowerCase()===l.toLowerCase()){delete e.headers[f];break}},update:l=>{if(l&&l.key){for(let f of Object.keys(e.headers))if(f.toLowerCase()===l.key.toLowerCase()){e.headers[f]=l.value||"";return}}},upsert:l=>{if(l&&l.key){for(let f of Object.keys(e.headers))if(f.toLowerCase()===l.key.toLowerCase()){e.headers[f]=l.value||"";return}e.headers[l.key]=l.value||""}},toObject:()=>{let l={};for(let[f,c]of Object.entries(e.headers))typeof c=="string"&&(l[f]=c);return l},each:l=>{for(let[f,c]of Object.entries(e.headers))typeof c=="string"&&l({key:f,value:c})}},o={get mode(){return n(e.body?.type)},set mode(l){let f=i(l);e.body?e.body.type=f:e.body={type:f,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 iz(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 f=l.mode?i(l.mode):l.type||"raw";e.body={type:f,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 f={};for(let[c,p]of Object.entries(e.headers))typeof p=="string"&&(f[c]=p);return f},addQueryParams(l){if(typeof l=="string"){let f=new URLSearchParams(l);for(let[c,p]of f)e.query||(e.query={}),e.query[c]=p}else Array.isArray(l)&&(e.query||(e.query={}),l.forEach(f=>{f.key&&(e.query[f.key]=f.value||"")}))},removeQueryParams(l){e.query&&(typeof l=="string"?delete e.query[l]:Array.isArray(l)&&l.forEach(f=>{let c=typeof f=="string"?f:f.key;c&&delete e.query[c]}))},authorizeUsing(l,f){r.request&&(typeof l=="string"?(r.request.auth||(r.request.auth={}),r.request.auth.type=l,f&&(r.request.auth.parameters=f)):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,f){r.request&&(r.request.description={content:l,type:f||"text/plain"})},setHeader(l,f){e.headers[l]=f},addHeader(l,f){typeof l=="object"&&l!==null?e.headers[l.key]=l.value:e.headers[l]=f},removeHeader(l){delete e.headers[l]},setBody(l,f,c){e.body={type:f||e.body?.type||"raw",format:c||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[v,_]of Object.entries(s?.headers||{}))typeof _=="string"&&(o[v]=_);let l=s?.body,f=l==null?null:typeof l=="object"&&"content"in l?l.content:l,c=i.request;if(n.request={id:c?.id??"",name:c?.name??"",description:c?.description??"",url:typeof s?.url=="string"?s.url:String(s?.url??""),method:s?.method??"GET",headers:o,data:f},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 h=r.statusText||"";n.responseCode={code:r.status,name:h,detail:h},n.responseHeaders={...r.headers||{}},n.responseTime=r.responseTime??0,n.responseCookies=(r.cookies||[]).map(v=>({...v}));let g=this;n.tests=new Proxy({},{set(v,_,w){return g.assertions.push({name:String(_),passed:!!w,message:w?void 0:`"${String(_)}" was false`}),!0}})}async executePreRequest(e){let r=Sm(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=t0.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=du(this.consoleMessages),f=this.initialContext.request.body,c=!this.bodiesEqual(this.modifiedRequest.body,f);return{success:!0,modifiedRequest:{url:this.modifiedRequest.url!==this.initialContext.request.url?this.modifiedRequest.url:void 0,headers:$f(this.modifiedRequest.headers,this.initialContext.request.headers)?this.modifiedRequest.headers:void 0,body:c?this.modifiedRequest.body:void 0,params:$f(this.modifiedRequest.params,this.initialContext.request.params||{})?this.modifiedRequest.params:void 0,query:$f(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=[...du(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=Sm(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=vm(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=t0.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 f=du(this.consoleMessages);return{testResults:[...this.assertions],consoleOutput:f.length>0?f:void 0,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=[...du(this.consoleMessages),`[error] Script execution failed: ${i.message}`];return{testResults:[...this.assertions],consoleOutput:s,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=[]}}});import*as ur from"crypto";import*as sz from"querystring";import*as nk from"vm";function ik(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 sk(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function oz(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=ik(r[2],e),i=ns(r[1],n);return i!==null?i:void 0}if(e[t]!==void 0)return sk(e[t]);if(ca(t)){let n=ua(t,e),i=fa(t,n);if(i!==void 0)return i}}function rk(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=ur.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 n0(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 Ve?i.toBuffer():Buffer.from(String(i),"utf8");if(typeof s=="string"){let f=ur.randomBytes(8),{key:c,iv:p}=rk(s,e,r,f),h=ur.createCipheriv(n(e),c,p),g=Buffer.concat([h.update(l),h.final()]),v=Buffer.concat([Buffer.from("Salted__"),f,g]);return{ciphertext:new Ve(g),salt:new Ve(f),toString:_=>_?_.stringify(new Ve(v)):v.toString("base64")}}else{let f=s.toBuffer(),c=o?.iv&&o.iv instanceof Ve?o.iv.toBuffer():Buffer.alloc(r),p=ur.createCipheriv(n(f.length),f,c);o?.padding===!1&&p.setAutoPadding(!1);let h=Buffer.concat([p.update(l),p.final()]);return{ciphertext:new Ve(h),toString:g=>g?g.stringify(new Ve(h)):h.toString("base64")}}},decrypt(i,s,o){if(typeof s=="string"){let l=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext.toBuffer(),f,c;l.subarray(0,8).toString()==="Salted__"?(c=l.subarray(8,16),f=l.subarray(16)):(c=Buffer.alloc(0),f=l);let{key:p,iv:h}=rk(s,e,r,c),g=ur.createDecipheriv(n(e),p,h);return new Ve(Buffer.concat([g.update(f),g.final()]))}else{let l=s.toBuffer(),f=o?.iv&&o.iv instanceof Ve?o.iv.toBuffer():Buffer.alloc(r),c=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext?i.ciphertext.toBuffer():Buffer.from(i),p=ur.createDecipheriv(n(l.length),l,f);return o?.padding===!1&&p.setAutoPadding(!1),new Ve(Buffer.concat([p.update(c),p.final()]))}}}}function az(){let t=r=>n=>{let i=n instanceof Ve?n.toBuffer():Buffer.from(String(n),"utf8");return new Ve(ur.createHash(r).update(i).digest())},e=r=>(n,i)=>{let s=n instanceof Ve?n.toBuffer():Buffer.from(String(n),"utf8"),o=i instanceof Ve?i.toBuffer():Buffer.from(String(i),"utf8");return new Ve(ur.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:n0("aes",32,16),DES:n0("des",8,8),TripleDES:n0("des-ede3",24,8),PBKDF2(r,n,i){let s=r instanceof Ve?r.toBuffer():Buffer.from(String(r),"utf8"),o=n instanceof Ve?n.toBuffer():Buffer.from(String(n),"utf8"),l=(i?.keySize||4)*4,f=i?.iterations||1;return new Ve(ur.pbkdf2Sync(s,o,f,l,"sha1"))},enc:{Base64:{stringify:r=>(r instanceof Ve?r.toBuffer():Buffer.from(String(r))).toString("base64"),parse:r=>Ve.fromBase64(r)},Utf8:{stringify:r=>(r instanceof Ve?r.toBuffer():Buffer.from(String(r))).toString("utf8"),parse:r=>Ve.fromUtf8(r)},Hex:{stringify:r=>(r instanceof Ve?r.toBuffer():Buffer.from(String(r))).toString("hex"),parse:r=>Ve.fromHex(r)},Latin1:{stringify:r=>(r instanceof Ve?r.toBuffer():Buffer.from(String(r))).toString("latin1"),parse:r=>new Ve(Buffer.from(r,"latin1"))},Utf16:{stringify:r=>(r instanceof Ve?r.toBuffer():Buffer.from(String(r))).toString("utf16le"),parse:r=>new Ve(Buffer.from(r,"utf16le"))},Utf16BE:{stringify:r=>(r instanceof Ve?r.toBuffer():Buffer.from(String(r))).swap16().toString("utf16le"),parse:r=>new Ve(Buffer.from(r,"utf16le").swap16())}},lib:{WordArray:{create:r=>r?typeof r=="string"?new Ve(Buffer.from(r,"utf8")):Buffer.isBuffer(r)?new Ve(r):new Ve(Buffer.from(String(r))):new Ve(Buffer.alloc(0)),random:r=>new Ve(ur.randomBytes(r))}},pad:{Pkcs7:{_name:"pkcs7"},NoPadding:{_name:"nopadding"},ZeroPadding:{_name:"zeropadding"}},mode:{CBC:{_name:"cbc"},ECB:{_name:"ecb"}}}}var Ve,cs,Ff=se(()=>{"use strict";kh();Th();$h();Qw();r0();bm();Ve=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"))}};cs=class t{constructor(e,r=[],n,i="shared",s=5e3){this.httpService=e;this.secretRegistry=n;this.scopeMode=i;this.scriptTimeoutMs=s;this.moduleLoader=Kw(r)}httpService;secretRegistry;scopeMode;scriptTimeoutMs;moduleLoader;createRequestSession(e){return new Mf({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:ur,_:s("lodash"),require:s,moment:ym(),querystring:sz,CryptoJS:az(),tv4:(()=>{try{return s("tv4")}catch{return}})(),postman:{setNextRequest:l=>e.setNextRequest?.(l),setGlobalVariable:(l,f)=>e.globals?.set(l,f),getGlobalVariable:l=>e.globals?.get(l),clearGlobalVariable:l=>e.globals?.unset(l),setEnvironmentVariable:(l,f)=>e.environment?.set(l,f),getEnvironmentVariable:l=>e.environment?.get(l),clearEnvironmentVariable:l=>e.environment?.unset(l),getResponseHeader:l=>{let f=e.response?.headers?.get?.(l);return f===void 0?null:f},getResponseCookie:l=>{let f=e.response?.cookies;if(f&&typeof f[Symbol.iterator]=="function"){for(let c of f)if(c?.name&&c.name.toLowerCase()===l.toLowerCase())return{...c}}return null}},jsonStringify:(l,f,c)=>JSON.stringify(l,f,c),jsonParse:l=>JSON.parse(l),xml2Json:l=>{try{let f=this.moduleLoader.createRequireFunction()("xml2js"),c;return f.parseString(l,{explicitArray:!1},(p,h)=>{if(p)throw p;c=h}),c}catch{throw new Error("xml2Json() requires the xml2js module. Add it to your modules/package.json and run npm install.")}}};return nk.createContext(o)}createCommonContext(e,r){let n={...e.variables},i={...e.collectionVariables||{}},s={...e.globals||{}},o={...e.environmentVariables||{}},l=e.iterationData||{},f=this.createMergedVariableScope(n,o,i,s,l),c=this.createGlobalsScope(s,e.onGlobalsChange),p=this.createVariableScope(i),h=this.createEnvironmentScope(o,e.environmentName,e.onEnvironmentChange,!0),g={...h,set:(_,w)=>{let E=this.serializeValue(w);h.set(_,E),n[_]=E},unset(_){h.unset(_),delete n[_]},clear(){let _=Object.keys(o);h.clear();for(let w of _)delete n[w]}};return c.replaceIn=f.replaceIn,p.replaceIn=f.replaceIn,g.replaceIn=f.replaceIn,{globals:c,collectionVariables:p,variables:f,environment:g,iterationData:{get:_=>l[_],has:_=>_ in l,toObject:()=>({...l}),toJSON:()=>JSON.stringify(l)},sendRequest:this.createSendRequest(),expect:Af,info:e.info||{eventName:r,requestName:void 0,requestId:void 0}}}static JSON_TYPE_MARKER="";serializeValue(e){return typeof e=="string"?e:t.JSON_TYPE_MARKER+JSON.stringify(e)}deserializeValue(e){if(e!==void 0){if(typeof e=="string"&&e.charCodeAt(0)===30)try{return JSON.parse(e.slice(1))}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,f)=>{e[l]=this.serializeValue(f)},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 f=o.toObject(),c=20,p=g=>g.replace(/\{\{([^}]+)\}\}/g,(v,_)=>{let w=_.trim(),E=w.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(E)try{let N=ik(E[2],f),$=ns(E[1],N);return $!==null?String($):v}catch{return v}let k=Kc(w);if(k){let N=oz(k.input,f);if(N!==void 0){let $=Qc(N,k.filters,f);return $!==void 0?String($):v}return v}let T=o.get(w);if(T!==void 0)return String(T);if(ca(w)){let N={};for(let[G,q]of Object.entries(f))N[G]=sk(q);let $=ua(w,N),j=fa(w,$);if(j!==void 0)return String(j)}return v}),h=l;for(let g=0;g<c;g++){let v=p(h);if(v===h)break;h=v}return h}};return o}createEnvironmentScope(e,r,n,i){let s=(o,l,f)=>{n&&(i?n(o,l,f):n(l||"",o==="set"?f:void 0))};return{name:r||"",get:o=>this.deserializeValue(e[o]),set:(o,l)=>{let f=this.serializeValue(l);e[o]=f,s("set",o,f)},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 i0,Ia,_m=se(()=>{"use strict";i0={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"},Ia=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=i0["x-www-form-urlencoded"];break;case"raw":s=r.format?i0[r.format]:"text/plain",s||(s="text/plain");break;case"graphql":s=i0.graphql;break;case"binary":s="application/octet-stream";break}s&&(e["Content-Type"]=s)}}});var qa,Rm=se(()=>{"use strict";qa=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((f,c)=>{l[f]=o[c]||""}),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}}});import*as mu from"crypto";var uz,Uf,o0=se(()=>{"use strict";uz=3e4,Uf=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 f={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,f,l,s,o,n);let c=await this.httpService.execute({method:"POST",url:i,headers:f,body:l.toString()}),p=this.parseTokenResponse(c.body,e);p.refreshToken||(p.refreshToken=r);let h=this.buildCacheKeyString(e);return this.tokenCache.set(h,p),p.refreshToken&&await this.storeRefreshToken(h,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 f=e.usePkce!==!1,c,p,h;if(f){c=this.generateCodeVerifier();let G=e.pkceMethod||"S256";p=G==="S256"?this.generateCodeChallengeS256(c):c,h=G}let g=e.state||mu.randomBytes(16).toString("hex"),v=await this.getCallbackUri(),_=new URL(n);if(_.searchParams.set("response_type","code"),_.searchParams.set("client_id",s),_.searchParams.set("redirect_uri",v),l&&_.searchParams.set("scope",l),_.searchParams.set("state",g),p&&(_.searchParams.set("code_challenge",p),_.searchParams.set("code_challenge_method",h)),e.audience&&_.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&_.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[G,q]of Object.entries(e.extraParams))_.searchParams.set(G,this.resolve(q,r));this.pendingAuthCallback&&(this.pendingAuthCallback.reject(new Error("OAuth2 authorization superseded by a new request")),this.pendingAuthCallback=null);let w=new Promise((G,q)=>{this.pendingAuthCallback={resolve:G,reject:q,state:g}});await this.browserService.openExternal(_.toString());let E;try{E=await Promise.race([w,new Promise((G,q)=>setTimeout(()=>{this.pendingAuthCallback=null,q(new Error("OAuth2 authorization timed out after 2 minutes"))},12e4))])}finally{this.pendingAuthCallback=null}if(E.state&&E.state!==g)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let k=new URLSearchParams;k.append("grant_type","authorization_code"),k.append("code",E.code),k.append("redirect_uri",v),c&&k.append("code_verifier",c);let T={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,T,k,s,o,r);let N=await this.httpService.execute({method:"POST",url:i,headers:T,body:k.toString()}),$=this.parseTokenResponse(N.body,e),j=this.buildCacheKeyString(e);return this.tokenCache.set(j,$),$.refreshToken&&await this.storeRefreshToken(j,$.refreshToken),$}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||mu.randomBytes(16).toString("hex"),l=await this.getCallbackUri(),f=new URL(n);if(f.searchParams.set("response_type","token"),f.searchParams.set("client_id",i),f.searchParams.set("redirect_uri",l),s&&f.searchParams.set("scope",s),f.searchParams.set("state",o),e.audience&&f.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&f.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[v,_]of Object.entries(e.extraParams))f.searchParams.set(v,this.resolve(_,r));this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow superseded by a new request")),this.pendingImplicitCallback=null);let c=new Promise((v,_)=>{this.pendingImplicitCallback={resolve:v,reject:_,state:o}});await this.browserService.openExternal(f.toString());let p;try{p=await Promise.race([c,new Promise((v,_)=>setTimeout(()=>{this.pendingImplicitCallback=null,_(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 h={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}},g=this.buildCacheKeyString(e);return this.tokenCache.set(g,h),h}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,f=new URLSearchParams;if(f.append("grant_type",n),l&&f.append("scope",l),n==="password"){let h=this.resolve(e.username||"",r),g=this.resolve(e.password||"",r);if(!h)throw new Error("OAuth2 password grant requires username");f.append("username",h),f.append("password",g)}if(e.audience&&f.append("audience",this.resolve(e.audience,r)),e.resource&&f.append("resource",this.resolve(e.resource,r)),e.extraParams)for(let[h,g]of Object.entries(e.extraParams))f.append(h,this.resolve(g,r));let c={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,c,f,s,o,r);let p=await this.httpService.execute({method:"POST",url:i,headers:c,body:f.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-uz:!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 mu.randomBytes(32).toString("base64url")}generateCodeChallengeS256(e){return mu.createHash("sha256").update(e).digest("base64url")}async storeRefreshToken(e,r){try{await this.secretStore.store(`oauth2_refresh_${e}`,r)}catch{}}}});import*as ka from"fs";import*as ro from"path";function gu(t,e={}){let r=[];Object.entries(e).forEach(([n,i])=>{r.push(`${n}=${i}`)}),r.length&&ka.writeFileSync(t,r.join(`
51
+ `),"utf-8")}function Hf(t,e,r){r&&(r.preRequest&&r.preRequest.trim()&&ka.writeFileSync(ro.join(t,`${e}.pre.js`),r.preRequest,"utf-8"),r.postResponse&&r.postResponse.trim()&&ka.writeFileSync(ro.join(t,`${e}.post.js`),r.postResponse,"utf-8"))}function cz(t,e){let n=e&&e.trim()?e.trim():"collections-rest-client";return ro.isAbsolute(n)?n:ro.join(t,n)}async function fz(t,e,r,n,i){await t.exportCollectionAsRestClientFolder(r,n),e.exportEnvironmentsToFolder(n,i)}function Cm(t,e,r){t.forEach(n=>{if(n.type==="folder"){let i=ro.join(e,$t(n.name));ka.mkdirSync(i,{recursive:!0}),Hf(i,$t(n.name),n.scripts),Cm(n.items||[],i,r)}else if(n.type==="request"){let i=n,s=$t(i.name)+".http",o=ro.join(e,s),l=dz(i,r);ka.writeFileSync(o,l,"utf-8"),Hf(e,$t(i.name),i.scripts)}})}function dz(t,e){let r=[];r.push(`### ${e.name} / ${t.name}`),r.push(`# collection env: ${$t(e.name)}.env`),r.push(`# request scripts: ${$t(t.name)}.pre.js and .post.js`);let n=pz(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(`
52
52
  `)}function pz(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 xm=se(()=>{"use strict";xn()});import*as yr from"fs";import*as a0 from"path";var yu,l0=se(()=>{"use strict";xn();yu=class{collectionsDir;cache=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}ensureDirectory(){yr.existsSync(this.collectionsDir)||yr.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),!yr.existsSync(this.collectionsDir))return[];let e=yr.readdirSync(this.collectionsDir),r=[];for(let n of e)if(n.endsWith(".json"))try{let i=a0.join(this.collectionsDir,n),s=yr.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(yr.existsSync(r))try{let n=yr.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=St(e.name));let r=this.getCollectionPath(e.id),n=JSON.stringify(e,null,2);await yr.promises.writeFile(r,n,"utf-8"),this.cache.set(e.id,e)}async delete(e){let r=this.getCollectionPath(e);if(!yr.existsSync(r))return!1;try{return await yr.promises.unlink(r),this.cache.delete(e),!0}catch(n){return console.error(`[JsonCollectionLoader] Failed to delete collection ${e}:`,n),!1}}exists(e){return yr.existsSync(this.getCollectionPath(e))}getCollectionPath(e){return a0.join(this.collectionsDir,`${e}.json`)}getItemPath(e,r){}async create(e,r){let n={id:r||St(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,...f}=n;return Object.assign(s,f),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 f=this.findItemById(i.items,r);if(!f||!f.items)return!1;s=f.items}else s=i.items;let o=new Map(s.map(f=>[f.id,f])),l=[];for(let f of n){let c=o.get(f);c&&(l.push(c),o.delete(f))}for(let f of o.values())l.push(f);if(r){let f=this.findItemById(i.items,r);f&&(f.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 Bf,u0=se(()=>{"use strict";Eh();l0();Bf=class{static create(e){let r=e.getStorageConfig(),n=e.getCollectionsPath();return r.format==="folder"?new zs(n):new yu(n)}static createForFormat(e,r){return e==="folder"?new zs(r):new yu(r)}}});import*as Ot from"fs";import*as ni from"path";function ok(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 hz(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=>ak(e)),event:c0(t.scripts),variable:t.variables?Object.entries(t.variables).map(([e,r])=>({key:e,value:r})):[]}}function ak(t){if(t.type==="folder")return{name:t.name,item:t.items?t.items.map(ak):[],event:c0(t.scripts)};if(t.type==="request"){let e=t;return{name:e.name,request:{method:e.method,header:(e.headers||[]).filter(r=>r.enabled!==!1).map(mz),url:gz(e),body:yz(e),auth:vz(e.auth),description:e.description},event:c0(e.scripts),protocolProfileBehavior:bz(e.settings)}}}function mz(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 gz(t){let e=t.url,r=t.url.replace(/^[a-zA-Z]+:\/\//,""),n=[],i=r.match(/^([^\/\?]+)/);if(i){let c=i[1];/^{{.*}}$/.test(c)?n=[c]:n=c.split(".")}let s=[],o=r.match(/^[^\/\?]+(\/[^\?]*)?/);if(o&&o[1]!==void 0){let c=o[1].replace(/^\//,"");c.endsWith("/")?(s=c.slice(0,-1).split("/"),s.push("")):s=c.length>0?c.split("/"):[]}let l;if(Array.isArray(t.query)&&t.query.length>0)l=t.query.map(c=>{let p={key:c.key,value:c.value};return c.enabled===!1&&(p.enabled=!1),c.description!==void 0&&(p.description=c.description),c.type!==void 0&&(p.type=c.type),c.required!==void 0&&(p.required=c.required),c.format!==void 0&&(p.format=c.format),c.enum!==void 0&&(p.enum=c.enum),c.deprecated!==void 0&&(p.deprecated=c.deprecated),c.pattern!==void 0&&(p.pattern=c.pattern),c.minLength!==void 0&&(p.minLength=c.minLength),c.maxLength!==void 0&&(p.maxLength=c.maxLength),c.minimum!==void 0&&(p.minimum=c.minimum),c.maximum!==void 0&&(p.maximum=c.maximum),c.exclusiveMinimum!==void 0&&(p.exclusiveMinimum=c.exclusiveMinimum),c.exclusiveMaximum!==void 0&&(p.exclusiveMaximum=c.exclusiveMaximum),c.multipleOf!==void 0&&(p.multipleOf=c.multipleOf),c.minItems!==void 0&&(p.minItems=c.minItems),c.maxItems!==void 0&&(p.maxItems=c.maxItems),c.uniqueItems!==void 0&&(p.uniqueItems=c.uniqueItems),c.nullable!==void 0&&(p.nullable=c.nullable),c.oneOf!==void 0&&(p.oneOf=c.oneOf),p});else{let c=r.indexOf("?");c!==-1&&(l=r.substring(c+1).split("&").map(h=>{let[g,...v]=h.split("=");return{key:g,value:v.join("=")}}))}let f;return t.params&&typeof t.params=="object"&&(f=Object.entries(t.params).map(([c,p])=>({key:c,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:f&&f.length>0?f:void 0}}function yz(t){if(!t.body)return;let e=t.body;if(typeof e=="string"){let s=ok(e);return{mode:"raw",raw:e,options:{raw:{language:s}}}}if(e.type==="raw"){let s=e.format||ok(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 vz(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 bz(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 c0(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 Vf,f0=se(()=>{"use strict";xn();xm();u0();Vf=class{constructor(e,r,n){this.workspaceRoot=e;this.configService=r;this.fileWatcherFactory=n;this.collectionsDir=r.getCollectionsPath(),this.loader=Bf.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(){Ot.existsSync(this.collectionsDir)||Ot.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=St(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:f,...c}=n;Object.assign(o,c)}}return s}async addRequest(e,r,n){if(!this.collections.get(e))return!1;r.id||(r.id=St(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:St(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=St(r),s=this.loader.getCollectionPath(e),o=ni.join(this.collectionsDir,i);if(!Ot.existsSync(s))throw new Error(`Collection directory not found: ${s}`);this.copyDirRecursive(s,o);let l=ni.join(o,"collection.json");if(Ot.existsSync(l)){let c=JSON.parse(Ot.readFileSync(l,"utf-8"));c.id=i,c.name=r,Ot.writeFileSync(l,JSON.stringify(c,null,2))}else Ot.writeFileSync(l,JSON.stringify({id:i,name:r},null,2));this.loadCollections();let f=this.collections.get(i);if(!f)throw new Error("Failed to load duplicated collection");return f}async createFolder(e){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");this.selfWritePending=!0;let n={id:St(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||!Ot.existsSync(s))throw new Error(`Folder not found on disk: ${r}`);let o=ni.dirname(s),l=St(n),f=ni.join(o,l);this.selfWritePending=!0,this.copyDirRecursive(s,f);let c=ni.join(f,"folder.json");if(Ot.existsSync(c)){let g=JSON.parse(Ot.readFileSync(c,"utf-8"));g.id=l,g.name=n,Ot.writeFileSync(c,JSON.stringify(g,null,2))}else Ot.writeFileSync(c,JSON.stringify({id:l,name:n,type:"folder"},null,2));this.loadCollections();let p=this.collections.get(e),h=p?this.findItemById(p.items,l):void 0;return h||{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||St(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,c={...l.scripts??{},...n==="pre-request"?{preRequest:i}:{postResponse:i}};l.scripts=c,this.selfWritePending=!0;try{return await this.loader.saveScripts(e,r,c),!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){Ot.existsSync(r)||Ot.mkdirSync(r,{recursive:!0});for(let n of Ot.readdirSync(e,{withFileTypes:!0})){let i=ni.join(e,n.name),s=ni.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):Ot.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=Ot.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||St(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(T=>T.key==="token")?.value||""};case"basic":let v=p.basic?.find(T=>T.key==="username"),_=p.basic?.find(T=>T.key==="password");return{type:"basic",basicAuth:{username:v?.value||"",password:_?.value||""}};case"apikey":let w=p.apikey?.find(T=>T.key==="key"),E=p.apikey?.find(T=>T.key==="value"),k=p.apikey?.find(T=>T.key==="in");return{type:"apikey",apikey:{key:w?.value||"",value:E?.value||"",in:k?.value||"header"}};case"noauth":return{type:"none"};default:return}},n=p=>{if(!Array.isArray(p)||p.length===0)return;let h={};for(let g of p){let v=g.script?.exec;if(!v)continue;let _=Array.isArray(v)?v.join(`
53
- `):v;g.listen==="prerequest"?h.preRequest=_:g.listen==="test"&&(h.postResponse=_)}return h.preRequest||h.postResponse?h:void 0},i=p=>{if(!p||typeof p!="object")return;let h={};return p.followRedirects===!1&&(h.followRedirects=!1),p.followOriginalHttpMethod===!0&&(h.followOriginalMethod=!0),p.followAuthorizationHeader===!1&&(h.followAuthHeader=!1),p.maxRedirects!==void 0&&(h.maxRedirects=p.maxRedirects),p.requestTimeout!==void 0&&(h.timeout=p.requestTimeout),Object.keys(h).length>0?h:void 0},s=p=>{if(!p||typeof p=="string")return;let h=p.query;if(!(!Array.isArray(h)||h.length===0))return h.map(g=>({key:g.key||"",value:g.value||"",enabled:g.disabled!==!0,...g.description!==void 0?{description:g.description}:{},...g.type!==void 0?{type:g.type}:{},...g.required!==void 0?{required:g.required}:{},...g.format!==void 0?{format:g.format}:{},...g.enum!==void 0?{enum:g.enum}:{},...g.deprecated!==void 0?{deprecated:g.deprecated}:{},...g.pattern!==void 0?{pattern:g.pattern}:{},...g.minLength!==void 0?{minLength:g.minLength}:{},...g.maxLength!==void 0?{maxLength:g.maxLength}:{},...g.minimum!==void 0?{minimum:g.minimum}:{},...g.maximum!==void 0?{maximum:g.maximum}:{},...g.exclusiveMinimum!==void 0?{exclusiveMinimum:g.exclusiveMinimum}:{},...g.exclusiveMaximum!==void 0?{exclusiveMaximum:g.exclusiveMaximum}:{},...g.multipleOf!==void 0?{multipleOf:g.multipleOf}:{},...g.minItems!==void 0?{minItems:g.minItems}:{},...g.maxItems!==void 0?{maxItems:g.maxItems}:{},...g.uniqueItems!==void 0?{uniqueItems:g.uniqueItems}:{},...g.nullable!==void 0?{nullable:g.nullable}:{},...g.oneOf!==void 0?{oneOf:g.oneOf}:{}}))},o=p=>{if(typeof p=="string")return p;if(!p)return"";let h=new Set;if(Array.isArray(p.variable))for(let v of p.variable)v.key&&h.add(v.key);if(h.size===0&&p.raw)return p.raw;let g="";if(p.protocol&&(g+=p.protocol+"://"),p.host&&(g+=Array.isArray(p.host)?p.host.join("."):p.host),p.port&&(g+=":"+p.port),p.path){let _=(Array.isArray(p.path)?p.path:[p.path]).map(w=>{let E=w.startsWith(":")?w.substring(1):w;return h.has(E)?":"+E:(w.startsWith(":"),w)});g+="/"+_.join("/")}return!g&&p.raw?p.raw:g},l=p=>{if(!Array.isArray(p)||p.length===0)return;let h={responses:{}};for(let g of p){let v=String(g.code||200),_,w={};if(Array.isArray(g.header))for(let $ of g.header)!$.key||$.disabled||($.key.toLowerCase()==="content-type"?_=$.value?.split(";")[0]?.trim():w[$.key]={description:String($.value??""),schema:{type:"string"}});let E=g.body;if(typeof g.body=="string"&&g.body)try{E=JSON.parse(g.body)}catch{}let k=g.originalRequest,T;if(k){let $=typeof k.url=="string"?k.url:k.url?.raw??"";T=`${k.method||""} ${$}`.trim()||void 0}let N=g.name?g.name.replace(/[^a-zA-Z0-9_-]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"").toLowerCase()||`example_${v}`:`example_${v}`;if(h.responses[v]){let $=h.responses[v];$.examples=$.examples??{},$.examples[N]={summary:T,value:E}}else h.responses[v]={description:g.name,contentType:_,examples:{[N]:{summary:T,value:E}},...Object.keys(w).length>0?{headers:w}:{}}}return Object.keys(h.responses).length>0?h:void 0},f=p=>p.map(h=>{if(h.item)return{id:St(h.name),type:"folder",name:h.name,description:h.description,auth:r(h.auth),scripts:n(h.event),items:f(h.item)};{let g=h.request||{};return{id:St(h.name),type:"request",name:h.name,description:h.description||g.description,method:typeof g.method=="string"?g.method:"GET",url:o(g.url),query:s(g.url),headers:Array.isArray(g.header)?g.header.map(v=>({key:v.key||v.name||"",value:v.value||v.value||"",enabled:v.disabled!==!0,...v.description!==void 0?{description:v.description}:{},...v.type!==void 0?{type:v.type}:{},...v.required!==void 0?{required:v.required}:{},...v.format!==void 0?{format:v.format}:{},...v.enum!==void 0?{enum:v.enum}:{},...v.deprecated!==void 0?{deprecated:v.deprecated}:{},...v.pattern!==void 0?{pattern:v.pattern}:{},...v.minLength!==void 0?{minLength:v.minLength}:{},...v.maxLength!==void 0?{maxLength:v.maxLength}:{},...v.minimum!==void 0?{minimum:v.minimum}:{},...v.maximum!==void 0?{maximum:v.maximum}:{},...v.exclusiveMinimum!==void 0?{exclusiveMinimum:v.exclusiveMinimum}:{},...v.exclusiveMaximum!==void 0?{exclusiveMaximum:v.exclusiveMaximum}:{},...v.multipleOf!==void 0?{multipleOf:v.multipleOf}:{},...v.minItems!==void 0?{minItems:v.minItems}:{},...v.maxItems!==void 0?{maxItems:v.maxItems}:{},...v.uniqueItems!==void 0?{uniqueItems:v.uniqueItems}:{},...v.nullable!==void 0?{nullable:v.nullable}:{},...v.oneOf!==void 0?{oneOf:v.oneOf}:{}})):[],body:(()=>{let v=g.body;if(v){if(v.mode==="raw"&&v.raw){let _=v.options?.raw?.language;return{type:"raw",format:_==="xml"?"xml":_==="html"?"html":_==="javascript"?"javascript":_==="text"?"text":"json",content:v.raw}}if(v.mode==="urlencoded"&&Array.isArray(v.urlencoded))return{type:"x-www-form-urlencoded",content:v.urlencoded.map(_=>({key:_.key||"",value:_.value||"",enabled:_.disabled!==!0}))};if(v.mode==="formdata"&&Array.isArray(v.formdata))return{type:"form-data",content:v.formdata.map(_=>({key:_.key||"",value:_.value||"",type:_.type||"text",enabled:_.disabled!==!0}))};if(v.mode==="graphql"&&v.graphql){let _;if(v.graphql.variables)try{_=JSON.parse(v.graphql.variables)}catch{_=void 0}return{type:"graphql",content:{query:v.graphql.query||"",variables:_}}}if(v.mode==="binary")return{type:"binary",content:""}}})(),auth:r(g.auth),scripts:n(h.event),settings:i(h.protocolProfileBehavior),responseSchema:l(h.response)}}}),c={id:St(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,h])=>[p,String(h??"")])):void 0,items:f(e.item||[])};return await this.saveCollection(c),c}async exportCollection(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=hz(n),s=JSON.stringify(i,null,2);Ot.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=ni.join(r,At(n.name));Ot.mkdirSync(i,{recursive:!0});let s=n.variables||{};gu(ni.join(i,`${At(n.name)}.env`),s),Hf(i,At(n.name),n.scripts),Cm(n.items,i,n)}dispose(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.fileWatcher?.dispose()}}});var Yt,ka,Pa,d0=se(()=>{"use strict";Yt={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},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"}}}},ka={preferred:".http-forge/http-forge.config.json",legacy:"http-forge.config.json"},Pa={collections:"collections",environments:"environments",flows:"flows",suites:"suites"}});import*as ur from"fs";import*as lr from"path";var no,Em=se(()=>{"use strict";d0();no=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=lr.join(this.workspacePath,ka.preferred);if(ur.existsSync(e))return e;let r=lr.join(this.workspacePath,ka.legacy);return ur.existsSync(r)?r:e}loadConfig(){if(this.configPath=this.resolveConfigPath(),!ur.existsSync(this.configPath))return{...Yt};try{let e=ur.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 ${lr.relative(this.workspacePath,this.configPath)}. Using default configuration.`),{...Yt}}}mergeWithDefaults(e){return{version:e.version??Yt.version,storage:{...Yt.storage,...e.storage},request:{...Yt.request,...e.request},scripts:{...Yt.scripts,...e.scripts},runner:{...Yt.runner,...e.runner},environments:{...Yt.environments,...e.environments},restClientExport:{...Yt.restClientExport,...e.restClientExport},proxy:e.proxy!==void 0?e.proxy:Yt.proxy,mcp:{...Yt.mcp,...e.mcp,cors:{...Yt.mcp.cors,...e.mcp?.cors}},secrets:{...Yt.secrets,...e.secrets,providers:{...Yt.secrets?.providers,...e.secrets?.providers}}}}setupFileWatcher(){if(!this.fileWatcherFactory)return;let e=()=>{this.reload()};for(let r of[ka.preferred,ka.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 lr.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??Yt.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 lr.join(this.workspacePath,...r.split("/"))}getRootPath(){return this.resolvePath(this.config.storage.root)}getCollectionsPath(){return lr.join(this.getRootPath(),Pa.collections)}getEnvironmentsPath(){return lr.join(this.getRootPath(),Pa.environments)}getFlowsPath(){return lr.join(this.getRootPath(),Pa.flows)}getHistoryPath(){return this.resolvePath(this.config.storage.history)}getResultsPath(){return this.resolvePath(this.config.storage.results)}getSuitesPath(){return lr.join(this.getRootPath(),Pa.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 ur.existsSync(this.resolveConfigPath())}async createDefaultConfig(){await ur.promises.mkdir(lr.dirname(this.configPath),{recursive:!0});let e=JSON.stringify(Yt,null,2);await ur.promises.writeFile(this.configPath,e,"utf-8");let r=[this.getCollectionsPath(),this.getEnvironmentsPath(),this.getFlowsPath(),this.getSuitesPath()];for(let i of r)ur.existsSync(i)||await ur.promises.mkdir(i,{recursive:!0});let n=[this.getHistoryPath(),this.getResultsPath()];for(let i of n)ur.existsSync(i)||await ur.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 ur.promises.writeFile(lr.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 ur.promises.writeFile(lr.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 ur.promises.writeFile(lr.join(e,"default-headers.json"),JSON.stringify(i,null,2),"utf-8")}dispose(){for(let e of this.fileWatchers)e.dispose();this.fileWatchers=[]}}});var Sz,Wf,p0=se(()=>{"use strict";oa();Sz="httpForge.cookies",Wf=class{constructor(e,r=Sz){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 ht.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 ht.parseCookieHeaders(e,r)}isExpired(e){return ht.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 ht.domainMatches(e,r)}get count(){return this.cookies.size}}});var zf,h0=se(()=>{"use strict";oa();zf=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=>!(ht.isExpired(s)||s.domain&&!ht.domainMatches(r,s.domain)||!s.domain||s.path&&!n.startsWith(s.path)));if(i.length!==0)return ht.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 Im(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 f=l.key??l.name,c=typeof l.enabled=="boolean"?l.enabled:!0;f&&c!==!1&&(s[f]=l.value??l.initial??"")}else if(typeof i=="object"&&i!==null)for(let[l,f]of Object.entries(i))s[l]=String(f??"");let o=r._postman_exported_at?"Imported from Postman export":r.description||"";return{name:n,variables:s,description:o}}catch{return null}}async function wz(t,e){try{let r=await e.readFile(t);return Im(r)}catch{return null}}var m0=se(()=>{"use strict"});import*as Kt from"fs";import*as dn from"path";var Jf,Gf,g0=se(()=>{"use strict";xn();m0();xm();qh();Zc();Jf={SELECTED_ENVIRONMENT:"httpForge.selectedEnvironment",ENV_OVERRIDES_PREFIX:"httpForge.envOverrides."},Gf=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=dn.join(l,"_global.json"),this.localConfigPath=dn.join(l,"_global.local.json"),this.historiesPath=n.getHistoryPath(),this.selectedEnvironment=r?.get(Jf.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||!Kt.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(!Kt.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(Jf.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`${Jf.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||{},f=o?.variables||{},c=o&&o.headers||{},p=Bc(n.defaultHeaders||{},c),h=this.localEnvironmentValues.get(r)||{},g=this.secretValuesCache.get(r)||{},v={...s.variables||{},...f,...h,...g};return{name:r,description:s.description,requiresConfirmation:s.requiresConfirmation,headers:p,variables:v}}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=dn.join(e,"globals.env");gu(o,s)}n.forEach(o=>{let l=i?.environments?.[o];if(!l)return;let f={...l.variables||{}};r&&(f={...s,...f});let c=dn.join(e,`${At(o)}.env`);gu(c,f)})}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 dn.join(this.environmentsPath,`${e}.json`)}localConfigExists(){return Kt.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=Kt.readFileSync(e,"utf-8"),n=Im(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 dn.join(this.environmentsPath,`${e}.local.json`)}loadFolderConfigs(){let e=Gc(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 s={...this.getResolvedEnvironment(e)?.variables||{},...r||{}},o=this.getGlobalVariables();return new fa({globals:o,collectionVariables:{},environmentVariables:s,variables:{}})}saveFolderSharedConfig(e){Kt.existsSync(this.environmentsPath)||Kt.mkdirSync(this.environmentsPath,{recursive:!0});let r={variables:e.globalVariables||{},defaultHeaders:e.defaultHeaders||{}};this.saveJsonFile(this.sharedConfigPath,r);let n=Kt.readdirSync(this.environmentsPath).filter(s=>s.endsWith(".json")).filter(s=>!Oh(s)),i=new Set(Object.keys(e.environments||{}));for(let s of n){let o=dn.basename(s,".json");if(!i.has(o))try{Kt.unlinkSync(dn.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(dn.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(Jf.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(Jf.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(!Kt.existsSync(e))return null;let r=Kt.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=dn.dirname(e);Kt.existsSync(n)||Kt.mkdirSync(n,{recursive:!0}),Kt.writeFileSync(e,JSON.stringify(r,null,2),"utf-8")}catch(n){throw console.error(`Failed to save JSON to ${e}:`,n),n}}}});var io,Om=se(()=>{"use strict";Nf();io=class t{constructor(e,r,n,i,s,o,l,f,c,p,h,g,v){this.httpService=e;this.scriptExecutor=r;this.envConfigService=n;this.requestPreparer=i;this.environment=s;this.cookieJar=o;this.collectionScripts=l;this.folderScriptsChain=f;this.onConsoleOutput=c;this.collectionName=p;this.collectionAuth=h;this.iteration=g;this.iterationCount=v}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 f=this.envConfigService.getGlobalVariables(),c={request:e,variables:{...r},environmentVariables:l.variables||{},globals:{...f},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(g,v,_)=>{g==="set"&&v&&_!==void 0?this.envConfigService.setEnvironmentVariable(v,_,this.environment):g==="unset"&&v?this.envConfigService.deleteEnvironmentVariable(v,this.environment):g==="clear"&&this.envConfigService.clearEnvironmentVariables(this.environment)},onGlobalsChange:(g,v,_)=>{g==="set"&&v&&_!==void 0?this.envConfigService.setGlobalVariable(v,_):g==="unset"&&v?this.envConfigService.deleteGlobalVariable(v):g==="clear"&&this.envConfigService.clearGlobalVariables()}},p=this.scriptExecutor.createRequestSession(c),h=null;try{let g={...r},v={...e},_;if((!v.auth||v.auth.type==="inherit")&&(v.auth=this.collectionAuth&&this.collectionAuth.type!=="inherit"?this.collectionAuth:void 0),s.length>0){let F=await p.executePreRequest(s);if(F.consoleOutput&&F.consoleOutput.length>0&&this.onConsoleOutput?.(F.consoleOutput,{requestName:e.name||"",phase:"pre-request"}),F.nextRequest!==void 0&&(_=F.nextRequest),F.skipRequest){let K={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:e.url||"",method:e.method||"GET",headers:{},body:K,params:{},query:{}},response:{status:0,statusText:"Skipped",headers:{},body:null,time:0,cookies:[]},duration:Date.now()-i,timestamp:Date.now(),passed:!0,assertions:[],modifiedVariables:g,nextRequest:_}}F.success&&(F.modifiedRequest&&(F.modifiedRequest.url&&(v.url=F.modifiedRequest.url),F.modifiedRequest.headers&&(v.headers=F.modifiedRequest.headers),F.modifiedRequest.params&&(v.params=F.modifiedRequest.params),F.modifiedRequest.query&&(v.query=F.modifiedRequest.query),F.modifiedRequest.body!==void 0&&(v.body=F.modifiedRequest.body)),(F.localVariables??F.modifiedVariables)&&(g=F.localVariables??F.modifiedVariables))}h=await this.requestPreparer.prepareRequest(v,this.environment,l,g);let{url:w,headers:E,body:k,method:T}=h,N={};for(let F in E)Object.prototype.hasOwnProperty.call(E,F)&&(N[F.toUpperCase()]=E[F]);if(!N.COOKIE&&v.settings?.includeCookies!==!1&&this.cookieJar){let K=this.cookieJar.getCookieHeader(w);K&&(N.COOKIE=K)}let $={method:T,url:w,headers:N,body:k.content,signal:n,settings:v.settings?{timeout:v.settings.timeout,followRedirects:v.settings.followRedirects,maxRedirects:v.settings.maxRedirects,strictSSL:v.settings.strictSSL}:void 0},j=await this.httpService.execute($);this.cookieJar&&j.headers&&await this.cookieJar.setCookiesFromResponse(w,j.headers);let G=Date.now()-i,q=[],C={},A;if(o.length>0){let F=0;if(j.body)if(typeof j.body=="string")F=Buffer.byteLength(j.body,"utf8");else if(Buffer.isBuffer(j.body))F=j.body.length;else try{F=Buffer.byteLength(JSON.stringify(j.body),"utf8")}catch{F=0}let K=wm(j.headers,j.cookies,h.url),ee={executedRequest:h,status:j.status,statusText:j.statusText,headers:e0(j.headers||{}),body:j.body,cookies:K,responseTime:j.time,responseSize:F},ie=await p.executePostResponse(o,ee);q=ie.testResults,C=ie.modifiedEnvironmentVariables||{},A=ie.visualizerData,ie.nextRequest!==void 0&&(_=ie.nextRequest),ie.consoleOutput&&ie.consoleOutput.length>0&&this.onConsoleOutput?.(ie.consoleOutput,{requestName:e.name||"",phase:"post-response"})}let D=q.length===0||q.every(F=>F.passed),B=q.length>0?D:j.status>=200&&j.status<=302;return{requestId:e.id,name:e.name,executedRequest:{...h,headers:N},response:{status:j.status,statusText:j.statusText,headers:j.headers||{},body:j.body,time:j.time||G,cookies:j.cookies||[]},duration:G,timestamp:Date.now(),passed:B,assertions:q,modifiedVariables:g,modifiedEnvironmentVariables:C,nextRequest:_,visualizerData:A}}catch(g){return this.handleError(e,h,g,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 f=String(n.name==="AbortError"?"Request was aborted":n.message||n),c=n?.stack?String(n.stack):"",p=this.errorBodyFormat,h,g;p==="html"||p==="both"?(h=t.formatErrorAsHtml(f,c),g={"content-type":"text/html; charset=utf-8"}):(h=f,g={});let v={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:l||"",method:o||"GET",headers:r?.headers||{},body:r?.body||v,params:r?.params||{},query:r?.query||{}},response:{status:0,statusText:n.name==="AbortError"?"Aborted":n.code||n.message||"Request Error",headers:g,cookies:[],body:h,time:0},duration:s,timestamp:Date.now(),passed:!1,assertions:[],error:f}}get errorBodyFormat(){return"text"}static formatErrorAsHtml(e,r){let n=i=>i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;");return`<!doctype html>
53
+ `):v;g.listen==="prerequest"?h.preRequest=_:g.listen==="test"&&(h.postResponse=_)}return h.preRequest||h.postResponse?h:void 0},i=p=>{if(!p||typeof p!="object")return;let h={};return p.followRedirects===!1&&(h.followRedirects=!1),p.followOriginalHttpMethod===!0&&(h.followOriginalMethod=!0),p.followAuthorizationHeader===!1&&(h.followAuthHeader=!1),p.maxRedirects!==void 0&&(h.maxRedirects=p.maxRedirects),p.requestTimeout!==void 0&&(h.timeout=p.requestTimeout),Object.keys(h).length>0?h:void 0},s=p=>{if(!p||typeof p=="string")return;let h=p.query;if(!(!Array.isArray(h)||h.length===0))return h.map(g=>({key:g.key||"",value:g.value||"",enabled:g.disabled!==!0,...g.description!==void 0?{description:g.description}:{},...g.type!==void 0?{type:g.type}:{},...g.required!==void 0?{required:g.required}:{},...g.format!==void 0?{format:g.format}:{},...g.enum!==void 0?{enum:g.enum}:{},...g.deprecated!==void 0?{deprecated:g.deprecated}:{},...g.pattern!==void 0?{pattern:g.pattern}:{},...g.minLength!==void 0?{minLength:g.minLength}:{},...g.maxLength!==void 0?{maxLength:g.maxLength}:{},...g.minimum!==void 0?{minimum:g.minimum}:{},...g.maximum!==void 0?{maximum:g.maximum}:{},...g.exclusiveMinimum!==void 0?{exclusiveMinimum:g.exclusiveMinimum}:{},...g.exclusiveMaximum!==void 0?{exclusiveMaximum:g.exclusiveMaximum}:{},...g.multipleOf!==void 0?{multipleOf:g.multipleOf}:{},...g.minItems!==void 0?{minItems:g.minItems}:{},...g.maxItems!==void 0?{maxItems:g.maxItems}:{},...g.uniqueItems!==void 0?{uniqueItems:g.uniqueItems}:{},...g.nullable!==void 0?{nullable:g.nullable}:{},...g.oneOf!==void 0?{oneOf:g.oneOf}:{}}))},o=p=>{if(typeof p=="string")return p;if(!p)return"";let h=new Set;if(Array.isArray(p.variable))for(let v of p.variable)v.key&&h.add(v.key);if(h.size===0&&p.raw)return p.raw;let g="";if(p.protocol&&(g+=p.protocol+"://"),p.host&&(g+=Array.isArray(p.host)?p.host.join("."):p.host),p.port&&(g+=":"+p.port),p.path){let _=(Array.isArray(p.path)?p.path:[p.path]).map(w=>{let E=w.startsWith(":")?w.substring(1):w;return h.has(E)?":"+E:(w.startsWith(":"),w)});g+="/"+_.join("/")}return!g&&p.raw?p.raw:g},l=p=>{if(!Array.isArray(p)||p.length===0)return;let h={responses:{}};for(let g of p){let v=String(g.code||200),_,w={};if(Array.isArray(g.header))for(let $ of g.header)!$.key||$.disabled||($.key.toLowerCase()==="content-type"?_=$.value?.split(";")[0]?.trim():w[$.key]={description:String($.value??""),schema:{type:"string"}});let E=g.body;if(typeof g.body=="string"&&g.body)try{E=JSON.parse(g.body)}catch{}let k=g.originalRequest,T;if(k){let $=typeof k.url=="string"?k.url:k.url?.raw??"";T=`${k.method||""} ${$}`.trim()||void 0}let N=g.name?g.name.replace(/[^a-zA-Z0-9_-]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"").toLowerCase()||`example_${v}`:`example_${v}`;if(h.responses[v]){let $=h.responses[v];$.examples=$.examples??{},$.examples[N]={summary:T,value:E}}else h.responses[v]={description:g.name,contentType:_,examples:{[N]:{summary:T,value:E}},...Object.keys(w).length>0?{headers:w}:{}}}return Object.keys(h.responses).length>0?h:void 0},f=p=>p.map(h=>{if(h.item)return{id:St(h.name),type:"folder",name:h.name,description:h.description,auth:r(h.auth),scripts:n(h.event),items:f(h.item)};{let g=h.request||{};return{id:St(h.name),type:"request",name:h.name,description:h.description||g.description,method:typeof g.method=="string"?g.method:"GET",url:o(g.url),query:s(g.url),headers:Array.isArray(g.header)?g.header.map(v=>({key:v.key||v.name||"",value:v.value||v.value||"",enabled:v.disabled!==!0,...v.description!==void 0?{description:v.description}:{},...v.type!==void 0?{type:v.type}:{},...v.required!==void 0?{required:v.required}:{},...v.format!==void 0?{format:v.format}:{},...v.enum!==void 0?{enum:v.enum}:{},...v.deprecated!==void 0?{deprecated:v.deprecated}:{},...v.pattern!==void 0?{pattern:v.pattern}:{},...v.minLength!==void 0?{minLength:v.minLength}:{},...v.maxLength!==void 0?{maxLength:v.maxLength}:{},...v.minimum!==void 0?{minimum:v.minimum}:{},...v.maximum!==void 0?{maximum:v.maximum}:{},...v.exclusiveMinimum!==void 0?{exclusiveMinimum:v.exclusiveMinimum}:{},...v.exclusiveMaximum!==void 0?{exclusiveMaximum:v.exclusiveMaximum}:{},...v.multipleOf!==void 0?{multipleOf:v.multipleOf}:{},...v.minItems!==void 0?{minItems:v.minItems}:{},...v.maxItems!==void 0?{maxItems:v.maxItems}:{},...v.uniqueItems!==void 0?{uniqueItems:v.uniqueItems}:{},...v.nullable!==void 0?{nullable:v.nullable}:{},...v.oneOf!==void 0?{oneOf:v.oneOf}:{}})):[],body:(()=>{let v=g.body;if(v){if(v.mode==="raw"&&v.raw){let _=v.options?.raw?.language;return{type:"raw",format:_==="xml"?"xml":_==="html"?"html":_==="javascript"?"javascript":_==="text"?"text":"json",content:v.raw}}if(v.mode==="urlencoded"&&Array.isArray(v.urlencoded))return{type:"x-www-form-urlencoded",content:v.urlencoded.map(_=>({key:_.key||"",value:_.value||"",enabled:_.disabled!==!0}))};if(v.mode==="formdata"&&Array.isArray(v.formdata))return{type:"form-data",content:v.formdata.map(_=>({key:_.key||"",value:_.value||"",type:_.type||"text",enabled:_.disabled!==!0}))};if(v.mode==="graphql"&&v.graphql){let _;if(v.graphql.variables)try{_=JSON.parse(v.graphql.variables)}catch{_=void 0}return{type:"graphql",content:{query:v.graphql.query||"",variables:_}}}if(v.mode==="binary")return{type:"binary",content:""}}})(),auth:r(g.auth),scripts:n(h.event),settings:i(h.protocolProfileBehavior),responseSchema:l(h.response)}}}),c={id:St(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,h])=>[p,String(h??"")])):void 0,items:f(e.item||[])};return await this.saveCollection(c),c}async exportCollection(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=hz(n),s=JSON.stringify(i,null,2);Ot.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=ni.join(r,$t(n.name));Ot.mkdirSync(i,{recursive:!0});let s=n.variables||{};gu(ni.join(i,`${$t(n.name)}.env`),s),Hf(i,$t(n.name),n.scripts),Cm(n.items,i,n)}dispose(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.fileWatcher?.dispose()}}});var Qt,Pa,no,d0=se(()=>{"use strict";Qt={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},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"}}}},Pa={preferred:".http-forge/http-forge.config.json",legacy:"http-forge.config.json"},no={collections:"collections",environments:"environments",flows:"flows",suites:"suites"}});import*as Tt from"fs";import*as Mt from"path";var io,Em=se(()=>{"use strict";d0();io=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=Mt.join(this.workspacePath,Pa.preferred);if(Tt.existsSync(e))return e;let r=Mt.join(this.workspacePath,Pa.legacy);return Tt.existsSync(r)?r:e}loadConfig(){if(this.configPath=this.resolveConfigPath(),!Tt.existsSync(this.configPath))return{...Qt};try{let e=Tt.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 ${Mt.relative(this.workspacePath,this.configPath)}. Using default configuration.`),{...Qt}}}mergeWithDefaults(e){return{version:e.version??Qt.version,storage:{...Qt.storage,...e.storage},request:{...Qt.request,...e.request},scripts:{...Qt.scripts,...e.scripts},runner:{...Qt.runner,...e.runner},environments:{...Qt.environments,...e.environments},restClientExport:{...Qt.restClientExport,...e.restClientExport},proxy:e.proxy!==void 0?e.proxy:Qt.proxy,mcp:{...Qt.mcp,...e.mcp,cors:{...Qt.mcp.cors,...e.mcp?.cors}},secrets:{...Qt.secrets,...e.secrets,providers:{...Qt.secrets?.providers,...e.secrets?.providers}}}}setupFileWatcher(){if(!this.fileWatcherFactory)return;let e=()=>{this.reload()};for(let r of[Pa.preferred,Pa.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 Mt.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??Qt.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 Mt.join(this.workspacePath,...r.split("/"))}hasFolderCollectionsAtRoot(e){let r=Mt.join(e,no.collections);if(!Tt.existsSync(r))return!1;let n;try{n=Tt.readdirSync(r,{withFileTypes:!0})}catch{return!1}return n.some(i=>{if(!i.isDirectory())return!1;let s=Mt.join(r,i.name,"collection.json");return Tt.existsSync(s)})}hasAnyEntries(e){if(!Tt.existsSync(e))return!1;try{return Tt.readdirSync(e).length>0}catch{return!1}}resolveStorageRootPath(){let e=this.resolvePath(this.config.storage.root);return this.configExists()||this.hasFolderCollectionsAtRoot(e)?e:[Mt.join(this.workspacePath,"http-forge-assets")].find(i=>this.hasFolderCollectionsAtRoot(i))||e}getRootPath(){return this.resolveStorageRootPath()}getCollectionsPath(){return Mt.join(this.getRootPath(),no.collections)}getEnvironmentsPath(){return Mt.join(this.getRootPath(),no.environments)}getFlowsPath(){return Mt.join(this.getRootPath(),no.flows)}getHistoryPath(){let e=this.resolvePath(this.config.storage.history);if(this.configExists()||this.hasAnyEntries(e))return e;let r=Mt.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=Mt.join(this.workspacePath,".http-forge-cache","results");return this.hasAnyEntries(r)?r:e}getSuitesPath(){return Mt.join(this.getRootPath(),no.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 Tt.existsSync(this.resolveConfigPath())}async createDefaultConfig(){await Tt.promises.mkdir(Mt.dirname(this.configPath),{recursive:!0});let e=JSON.stringify(Qt,null,2);await Tt.promises.writeFile(this.configPath,e,"utf-8");let r=[this.getCollectionsPath(),this.getEnvironmentsPath(),this.getFlowsPath(),this.getSuitesPath()];for(let i of r)Tt.existsSync(i)||await Tt.promises.mkdir(i,{recursive:!0});let n=[this.getHistoryPath(),this.getResultsPath()];for(let i of n)Tt.existsSync(i)||await Tt.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 Tt.promises.writeFile(Mt.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 Tt.promises.writeFile(Mt.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 Tt.promises.writeFile(Mt.join(e,"default-headers.json"),JSON.stringify(i,null,2),"utf-8")}dispose(){for(let e of this.fileWatchers)e.dispose();this.fileWatchers=[]}}});var Sz,Wf,p0=se(()=>{"use strict";aa();Sz="httpForge.cookies",Wf=class{constructor(e,r=Sz){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 ht.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 ht.parseCookieHeaders(e,r)}isExpired(e){return ht.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 ht.domainMatches(e,r)}get count(){return this.cookies.size}}});var zf,h0=se(()=>{"use strict";aa();zf=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=>!(ht.isExpired(s)||s.domain&&!ht.domainMatches(r,s.domain)||!s.domain||s.path&&!n.startsWith(s.path)));if(i.length!==0)return ht.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 Im(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 f=l.key??l.name,c=typeof l.enabled=="boolean"?l.enabled:!0;f&&c!==!1&&(s[f]=l.value??l.initial??"")}else if(typeof i=="object"&&i!==null)for(let[l,f]of Object.entries(i))s[l]=String(f??"");let o=r._postman_exported_at?"Imported from Postman export":r.description||"";return{name:n,variables:s,description:o}}catch{return null}}async function wz(t,e){try{let r=await e.readFile(t);return Im(r)}catch{return null}}var m0=se(()=>{"use strict"});import*as Zt from"fs";import*as dn from"path";var Jf,Gf,g0=se(()=>{"use strict";xn();m0();xm();qh();Zc();Jf={SELECTED_ENVIRONMENT:"httpForge.selectedEnvironment",ENV_OVERRIDES_PREFIX:"httpForge.envOverrides."},Gf=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=dn.join(l,"_global.json"),this.localConfigPath=dn.join(l,"_global.local.json"),this.historiesPath=n.getHistoryPath(),this.selectedEnvironment=r?.get(Jf.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||!Zt.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(!Zt.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(Jf.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`${Jf.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||{},f=o?.variables||{},c=o&&o.headers||{},p=Bc(n.defaultHeaders||{},c),h=this.localEnvironmentValues.get(r)||{},g=this.secretValuesCache.get(r)||{},v={...s.variables||{},...f,...h,...g};return{name:r,description:s.description,requiresConfirmation:s.requiresConfirmation,headers:p,variables:v}}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=dn.join(e,"globals.env");gu(o,s)}n.forEach(o=>{let l=i?.environments?.[o];if(!l)return;let f={...l.variables||{}};r&&(f={...s,...f});let c=dn.join(e,`${$t(o)}.env`);gu(c,f)})}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 dn.join(this.environmentsPath,`${e}.json`)}localConfigExists(){return Zt.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=Zt.readFileSync(e,"utf-8"),n=Im(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 dn.join(this.environmentsPath,`${e}.local.json`)}loadFolderConfigs(){let e=Gc(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 s={...this.getResolvedEnvironment(e)?.variables||{},...r||{}},o=this.getGlobalVariables();return new da({globals:o,collectionVariables:{},environmentVariables:s,variables:{}})}saveFolderSharedConfig(e){Zt.existsSync(this.environmentsPath)||Zt.mkdirSync(this.environmentsPath,{recursive:!0});let r={variables:e.globalVariables||{},defaultHeaders:e.defaultHeaders||{}};this.saveJsonFile(this.sharedConfigPath,r);let n=Zt.readdirSync(this.environmentsPath).filter(s=>s.endsWith(".json")).filter(s=>!Oh(s)),i=new Set(Object.keys(e.environments||{}));for(let s of n){let o=dn.basename(s,".json");if(!i.has(o))try{Zt.unlinkSync(dn.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(dn.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(Jf.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(Jf.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(!Zt.existsSync(e))return null;let r=Zt.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=dn.dirname(e);Zt.existsSync(n)||Zt.mkdirSync(n,{recursive:!0}),Zt.writeFileSync(e,JSON.stringify(r,null,2),"utf-8")}catch(n){throw console.error(`Failed to save JSON to ${e}:`,n),n}}}});var so,Om=se(()=>{"use strict";Nf();so=class t{constructor(e,r,n,i,s,o,l,f,c,p,h,g,v){this.httpService=e;this.scriptExecutor=r;this.envConfigService=n;this.requestPreparer=i;this.environment=s;this.cookieJar=o;this.collectionScripts=l;this.folderScriptsChain=f;this.onConsoleOutput=c;this.collectionName=p;this.collectionAuth=h;this.iteration=g;this.iterationCount=v}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 f=this.envConfigService.getGlobalVariables(),c={request:e,variables:{...r},environmentVariables:l.variables||{},globals:{...f},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(g,v,_)=>{g==="set"&&v&&_!==void 0?this.envConfigService.setEnvironmentVariable(v,_,this.environment):g==="unset"&&v?this.envConfigService.deleteEnvironmentVariable(v,this.environment):g==="clear"&&this.envConfigService.clearEnvironmentVariables(this.environment)},onGlobalsChange:(g,v,_)=>{g==="set"&&v&&_!==void 0?this.envConfigService.setGlobalVariable(v,_):g==="unset"&&v?this.envConfigService.deleteGlobalVariable(v):g==="clear"&&this.envConfigService.clearGlobalVariables()}},p=this.scriptExecutor.createRequestSession(c),h=null;try{let g={...r},v={...e},_;if((!v.auth||v.auth.type==="inherit")&&(v.auth=this.collectionAuth&&this.collectionAuth.type!=="inherit"?this.collectionAuth:void 0),s.length>0){let F=await p.executePreRequest(s);if(F.consoleOutput&&F.consoleOutput.length>0&&this.onConsoleOutput?.(F.consoleOutput,{requestName:e.name||"",phase:"pre-request"}),F.nextRequest!==void 0&&(_=F.nextRequest),F.skipRequest){let K={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:e.url||"",method:e.method||"GET",headers:{},body:K,params:{},query:{}},response:{status:0,statusText:"Skipped",headers:{},body:null,time:0,cookies:[]},duration:Date.now()-i,timestamp:Date.now(),passed:!0,assertions:[],modifiedVariables:g,nextRequest:_}}F.success&&(F.modifiedRequest&&(F.modifiedRequest.url&&(v.url=F.modifiedRequest.url),F.modifiedRequest.headers&&(v.headers=F.modifiedRequest.headers),F.modifiedRequest.params&&(v.params=F.modifiedRequest.params),F.modifiedRequest.query&&(v.query=F.modifiedRequest.query),F.modifiedRequest.body!==void 0&&(v.body=F.modifiedRequest.body)),(F.localVariables??F.modifiedVariables)&&(g=F.localVariables??F.modifiedVariables))}h=await this.requestPreparer.prepareRequest(v,this.environment,l,g);let{url:w,headers:E,body:k,method:T}=h,N={};for(let F in E)Object.prototype.hasOwnProperty.call(E,F)&&(N[F.toUpperCase()]=E[F]);if(!N.COOKIE&&v.settings?.includeCookies!==!1&&this.cookieJar){let K=this.cookieJar.getCookieHeader(w);K&&(N.COOKIE=K)}let $={method:T,url:w,headers:N,body:k.content,signal:n,settings:v.settings?{timeout:v.settings.timeout,followRedirects:v.settings.followRedirects,maxRedirects:v.settings.maxRedirects,strictSSL:v.settings.strictSSL}:void 0},j=await this.httpService.execute($);this.cookieJar&&j.headers&&await this.cookieJar.setCookiesFromResponse(w,j.headers);let G=Date.now()-i,q=[],C={},A;if(o.length>0){let F=0;if(j.body)if(typeof j.body=="string")F=Buffer.byteLength(j.body,"utf8");else if(Buffer.isBuffer(j.body))F=j.body.length;else try{F=Buffer.byteLength(JSON.stringify(j.body),"utf8")}catch{F=0}let K=wm(j.headers,j.cookies,h.url),ee={executedRequest:h,status:j.status,statusText:j.statusText,headers:e0(j.headers||{}),body:j.body,cookies:K,responseTime:j.time,responseSize:F},ie=await p.executePostResponse(o,ee);q=ie.testResults,C=ie.modifiedEnvironmentVariables||{},A=ie.visualizerData,ie.nextRequest!==void 0&&(_=ie.nextRequest),ie.consoleOutput&&ie.consoleOutput.length>0&&this.onConsoleOutput?.(ie.consoleOutput,{requestName:e.name||"",phase:"post-response"})}let D=q.length===0||q.every(F=>F.passed),B=q.length>0?D:j.status>=200&&j.status<=302;return{requestId:e.id,name:e.name,executedRequest:{...h,headers:N},response:{status:j.status,statusText:j.statusText,headers:j.headers||{},body:j.body,time:j.time||G,cookies:j.cookies||[]},duration:G,timestamp:Date.now(),passed:B,assertions:q,modifiedVariables:g,modifiedEnvironmentVariables:C,nextRequest:_,visualizerData:A}}catch(g){return this.handleError(e,h,g,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 f=String(n.name==="AbortError"?"Request was aborted":n.message||n),c=n?.stack?String(n.stack):"",p=this.errorBodyFormat,h,g;p==="html"||p==="both"?(h=t.formatErrorAsHtml(f,c),g={"content-type":"text/html; charset=utf-8"}):(h=f,g={});let v={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:l||"",method:o||"GET",headers:r?.headers||{},body:r?.body||v,params:r?.params||{},query:r?.query||{}},response:{status:0,statusText:n.name==="AbortError"?"Aborted":n.code||n.message||"Request Error",headers:g,cookies:[],body:h,time:0},duration:s,timestamp:Date.now(),passed:!1,assertions:[],error:f}}get errorBodyFormat(){return"text"}static formatErrorAsHtml(e,r){let n=i=>i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;");return`<!doctype html>
54
54
  <html>
55
55
  <body style="font-family:system-ui,Segoe UI,Roboto,-apple-system,Helvetica,Arial,sans-serif;padding:12px;color:#c7254e;">
56
56
  <h2 style="margin-top:0;color:#a94442">Request Error</h2>
@@ -88,12 +88,12 @@ fragment TypeRef on __Type {
88
88
  ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name } } } } } } }
89
89
  }
90
90
  `.trim(),Kf=class{constructor(e){this.httpClient=e}httpClient;schemaCache=new Map;async fetchSchema(e,r){let n={method:"POST",url:e,headers:{"Content-Type":"application/json",Accept:"application/json",...r||{}},body:JSON.stringify({query:_z,operationName:"IntrospectionQuery"})},i=await this.httpClient.send(n);if(i.status<200||i.status>=300)throw new Error(`Introspection query failed with status ${i.status}: ${i.statusText}`);let s=typeof i.body=="string"?JSON.parse(i.body):i.body;if(s.errors&&s.errors.length>0){let l=s.errors.map(f=>f.message).join("; ");throw new Error(`Introspection query returned errors: ${l}`)}if(!s.data?.__schema)throw new Error("Invalid introspection response: missing __schema");let o=this.parseSchema(s.data.__schema,e);return this.schemaCache.set(e,o),o}getCachedSchema(e){return this.schemaCache.get(e)}extractOperations(e){let r=[],n=e.split(`
91
- `),i=/^\s*(query|mutation|subscription)\s+(\w+)/;for(let s=0;s<n.length;s++){let o=n[s].match(i);o&&r.push({type:o[1],name:o[2],line:s+1})}return r.length===0&&e.trim().startsWith("{")&&r.push({type:"query",name:"(anonymous)",line:1}),r}clearCache(e){e?this.schemaCache.delete(e):this.schemaCache.clear()}schemaToSerializable(e){let r={};for(let[n,i]of e.types)r[n]=i;return{queryType:e.queryType,mutationType:e.mutationType,subscriptionType:e.subscriptionType,types:r,directives:e.directives,fetchedAt:e.fetchedAt,endpointUrl:e.endpointUrl}}parseSchema(e,r){let n=new Map;for(let s of e.types||[]){if(s.name.startsWith("__"))continue;let o={name:s.name,kind:s.kind,description:s.description||void 0,fields:(s.fields||[]).map(l=>this.parseField(l)),inputFields:(s.inputFields||[]).map(l=>this.parseArg(l)),enumValues:(s.enumValues||[]).map(l=>({name:l.name,description:l.description||void 0,isDeprecated:l.isDeprecated||!1,deprecationReason:l.deprecationReason||void 0})),interfaces:(s.interfaces||[]).map(l=>this.renderTypeRef(l)),possibleTypes:(s.possibleTypes||[]).map(l=>this.renderTypeRef(l))};n.set(o.name,o)}let i=(e.directives||[]).map(s=>({name:s.name,description:s.description||void 0,locations:s.locations||[],args:(s.args||[]).map(o=>this.parseArg(o))}));return{queryType:e.queryType?.name||"Query",mutationType:e.mutationType?.name||void 0,subscriptionType:e.subscriptionType?.name||void 0,types:n,directives:i,fetchedAt:Date.now(),endpointUrl:r}}parseField(e){return{name:e.name,type:this.renderTypeRef(e.type),args:(e.args||[]).map(r=>this.parseArg(r)),description:e.description||void 0,isDeprecated:e.isDeprecated||!1,deprecationReason:e.deprecationReason||void 0}}parseArg(e){return{name:e.name,type:this.renderTypeRef(e.type),defaultValue:e.defaultValue??void 0,description:e.description||void 0}}renderTypeRef(e){return e?e.kind==="NON_NULL"?`${this.renderTypeRef(e.ofType)}!`:e.kind==="LIST"?`[${this.renderTypeRef(e.ofType)}]`:e.name||"Unknown":"Unknown"}}});function ki(t){let e={};for(let[r,n]of Object.entries(t))b0.test(r)?e[r]=Array.isArray(n)?n.map(()=>so):so:e[r]=n;return e}function S0(t=[]){return t.map(e=>e&&typeof e=="object"&&e.name&&pn.test(e.name)?{...e,value:so}:e)}function Pm(t){try{let e=new URL(t),r=!1;for(let[n]of e.searchParams)pn.test(n)&&(e.searchParams.set(n,so),r=!0);return r?e.toString():t}catch{return t}}function Qf(t){if(t==null)return t;if(Array.isArray(t))return t.map(r=>Qf(r));if(typeof t!="object")return t;let e={};for(let[r,n]of Object.entries(t)){let i=pn.test(r);n===null||typeof n!="object"?e[r]=i?so:n:i&&Array.isArray(n)?e[r]=n.map(s=>s===null||typeof s!="object"?so:Qf(s)):e[r]=Qf(n)}return e}function Rz(t){try{let e=new URLSearchParams(t),r=!1;for(let[n]of e)pn.test(n)&&(e.set(n,so),r=!0);return r?e.toString():t}catch{return t}}function w0(t){if(t==null)return t;if(typeof t=="object"&&!Buffer.isBuffer(t))return Qf(t);if(typeof t=="string"){let e=t.trim();if(e.startsWith("{")||e.startsWith("["))try{let r=JSON.parse(e),n=Qf(r);return JSON.stringify(n)}catch{}if(e.includes("=")&&!e.includes(`
92
- `))return Rz(e)}return t}function _0(t){return{...t,sentRequest:{...t.sentRequest,url:Pm(t.sentRequest.url),headers:ki(t.sentRequest.headers),body:t.sentRequest.body!=null?w0(t.sentRequest.body):t.sentRequest.body}}}function R0(t){return{...t,headers:ki(t.headers),cookies:t.cookies.map(e=>e&&typeof e=="object"&&e.name&&pn.test(e.name)?{...e,value:so}:e)}}function C0(t){return{...t,url:Pm(t.url),request:{...t.request,url:Pm(t.request.url),headers:ki(t.request.headers),query:ki(t.request.query),params:ki(t.request.params),body:t.request.body!=null?w0(t.request.body):t.request.body},response:{headers:ki(t.response.headers),body:t.response.body,time:t.response.time,size:t.response.size,cookies:t.response.cookies?S0(t.response.cookies):t.response.cookies}}}function vr(t){return typeof t=="string"&&Cz.test(t)}function xz(t){let e=[];if(t.url)try{let r=new URL(t.url.includes("://")?t.url:`http://placeholder${t.url.startsWith("/")?"":"/"}${t.url}`);for(let[n,i]of r.searchParams)pn.test(n)&&i&&!vr(i)&&e.push({location:"url",field:n,message:`URL query parameter "${n}" contains a hardcoded value. Use a {{variable}} instead.`})}catch{}if(t.headers){let r=Array.isArray(t.headers)?t.headers.filter(n=>n.enabled!==!1).map(n=>[n.key,n.value]):Object.entries(t.headers);for(let[n,i]of r)b0.test(n)&&i&&!vr(i)&&e.push({location:"header",field:n,message:`Header "${n}" contains a hardcoded value. Use a {{variable}} instead (e.g. {{${n.toLowerCase().replace(/[^a-z0-9]/g,"_")}}})`})}if(t.query){let r=Array.isArray(t.query)?t.query.filter(n=>n.enabled!==!1).map(n=>[n.key,n.value]):Object.entries(t.query);for(let[n,i]of r)pn.test(n)&&i&&!vr(i)&&e.push({location:"query",field:n,message:`Query parameter "${n}" contains a hardcoded value. Use a {{variable}} instead.`})}if(t.auth){let r=t.auth;if(r.bearerToken&&!vr(r.bearerToken)&&e.push({location:"auth",field:"bearerToken",message:"Bearer token contains a hardcoded value. Store it in a {{variable}} in your .local.json environment file."}),r.basicAuth&&r.basicAuth.password&&!vr(r.basicAuth.password)&&e.push({location:"auth",field:"basicAuth.password",message:"Basic auth password contains a hardcoded value. Use a {{variable}} instead."}),r.apikey||r.apiKey){let n=r.apikey||r.apiKey;n.value&&!vr(n.value)&&e.push({location:"auth",field:"apiKey.value",message:"API key contains a hardcoded value. Use a {{variable}} instead."})}}if(t.body){let r=typeof t.body=="object"&&"content"in t.body?t.body.content:t.body;r&&qm(r,e)}return e}function qm(t,e){if(t!=null){if(typeof t=="string"){let r=t.trim();if(r.startsWith("{")||r.startsWith("[")){try{qm(JSON.parse(r),e)}catch{}return}if(r.includes("=")&&!r.includes(`
91
+ `),i=/^\s*(query|mutation|subscription)\s+(\w+)/;for(let s=0;s<n.length;s++){let o=n[s].match(i);o&&r.push({type:o[1],name:o[2],line:s+1})}return r.length===0&&e.trim().startsWith("{")&&r.push({type:"query",name:"(anonymous)",line:1}),r}clearCache(e){e?this.schemaCache.delete(e):this.schemaCache.clear()}schemaToSerializable(e){let r={};for(let[n,i]of e.types)r[n]=i;return{queryType:e.queryType,mutationType:e.mutationType,subscriptionType:e.subscriptionType,types:r,directives:e.directives,fetchedAt:e.fetchedAt,endpointUrl:e.endpointUrl}}parseSchema(e,r){let n=new Map;for(let s of e.types||[]){if(s.name.startsWith("__"))continue;let o={name:s.name,kind:s.kind,description:s.description||void 0,fields:(s.fields||[]).map(l=>this.parseField(l)),inputFields:(s.inputFields||[]).map(l=>this.parseArg(l)),enumValues:(s.enumValues||[]).map(l=>({name:l.name,description:l.description||void 0,isDeprecated:l.isDeprecated||!1,deprecationReason:l.deprecationReason||void 0})),interfaces:(s.interfaces||[]).map(l=>this.renderTypeRef(l)),possibleTypes:(s.possibleTypes||[]).map(l=>this.renderTypeRef(l))};n.set(o.name,o)}let i=(e.directives||[]).map(s=>({name:s.name,description:s.description||void 0,locations:s.locations||[],args:(s.args||[]).map(o=>this.parseArg(o))}));return{queryType:e.queryType?.name||"Query",mutationType:e.mutationType?.name||void 0,subscriptionType:e.subscriptionType?.name||void 0,types:n,directives:i,fetchedAt:Date.now(),endpointUrl:r}}parseField(e){return{name:e.name,type:this.renderTypeRef(e.type),args:(e.args||[]).map(r=>this.parseArg(r)),description:e.description||void 0,isDeprecated:e.isDeprecated||!1,deprecationReason:e.deprecationReason||void 0}}parseArg(e){return{name:e.name,type:this.renderTypeRef(e.type),defaultValue:e.defaultValue??void 0,description:e.description||void 0}}renderTypeRef(e){return e?e.kind==="NON_NULL"?`${this.renderTypeRef(e.ofType)}!`:e.kind==="LIST"?`[${this.renderTypeRef(e.ofType)}]`:e.name||"Unknown":"Unknown"}}});function ki(t){let e={};for(let[r,n]of Object.entries(t))b0.test(r)?e[r]=Array.isArray(n)?n.map(()=>oo):oo:e[r]=n;return e}function S0(t=[]){return t.map(e=>e&&typeof e=="object"&&e.name&&pn.test(e.name)?{...e,value:oo}:e)}function Pm(t){try{let e=new URL(t),r=!1;for(let[n]of e.searchParams)pn.test(n)&&(e.searchParams.set(n,oo),r=!0);return r?e.toString():t}catch{return t}}function Qf(t){if(t==null)return t;if(Array.isArray(t))return t.map(r=>Qf(r));if(typeof t!="object")return t;let e={};for(let[r,n]of Object.entries(t)){let i=pn.test(r);n===null||typeof n!="object"?e[r]=i?oo:n:i&&Array.isArray(n)?e[r]=n.map(s=>s===null||typeof s!="object"?oo:Qf(s)):e[r]=Qf(n)}return e}function Rz(t){try{let e=new URLSearchParams(t),r=!1;for(let[n]of e)pn.test(n)&&(e.set(n,oo),r=!0);return r?e.toString():t}catch{return t}}function w0(t){if(t==null)return t;if(typeof t=="object"&&!Buffer.isBuffer(t))return Qf(t);if(typeof t=="string"){let e=t.trim();if(e.startsWith("{")||e.startsWith("["))try{let r=JSON.parse(e),n=Qf(r);return JSON.stringify(n)}catch{}if(e.includes("=")&&!e.includes(`
92
+ `))return Rz(e)}return t}function _0(t){return{...t,sentRequest:{...t.sentRequest,url:Pm(t.sentRequest.url),headers:ki(t.sentRequest.headers),body:t.sentRequest.body!=null?w0(t.sentRequest.body):t.sentRequest.body}}}function R0(t){return{...t,headers:ki(t.headers),cookies:t.cookies.map(e=>e&&typeof e=="object"&&e.name&&pn.test(e.name)?{...e,value:oo}:e)}}function C0(t){return{...t,url:Pm(t.url),request:{...t.request,url:Pm(t.request.url),headers:ki(t.request.headers),query:ki(t.request.query),params:ki(t.request.params),body:t.request.body!=null?w0(t.request.body):t.request.body},response:{headers:ki(t.response.headers),body:t.response.body,time:t.response.time,size:t.response.size,cookies:t.response.cookies?S0(t.response.cookies):t.response.cookies}}}function vr(t){return typeof t=="string"&&Cz.test(t)}function xz(t){let e=[];if(t.url)try{let r=new URL(t.url.includes("://")?t.url:`http://placeholder${t.url.startsWith("/")?"":"/"}${t.url}`);for(let[n,i]of r.searchParams)pn.test(n)&&i&&!vr(i)&&e.push({location:"url",field:n,message:`URL query parameter "${n}" contains a hardcoded value. Use a {{variable}} instead.`})}catch{}if(t.headers){let r=Array.isArray(t.headers)?t.headers.filter(n=>n.enabled!==!1).map(n=>[n.key,n.value]):Object.entries(t.headers);for(let[n,i]of r)b0.test(n)&&i&&!vr(i)&&e.push({location:"header",field:n,message:`Header "${n}" contains a hardcoded value. Use a {{variable}} instead (e.g. {{${n.toLowerCase().replace(/[^a-z0-9]/g,"_")}}})`})}if(t.query){let r=Array.isArray(t.query)?t.query.filter(n=>n.enabled!==!1).map(n=>[n.key,n.value]):Object.entries(t.query);for(let[n,i]of r)pn.test(n)&&i&&!vr(i)&&e.push({location:"query",field:n,message:`Query parameter "${n}" contains a hardcoded value. Use a {{variable}} instead.`})}if(t.auth){let r=t.auth;if(r.bearerToken&&!vr(r.bearerToken)&&e.push({location:"auth",field:"bearerToken",message:"Bearer token contains a hardcoded value. Store it in a {{variable}} in your .local.json environment file."}),r.basicAuth&&r.basicAuth.password&&!vr(r.basicAuth.password)&&e.push({location:"auth",field:"basicAuth.password",message:"Basic auth password contains a hardcoded value. Use a {{variable}} instead."}),r.apikey||r.apiKey){let n=r.apikey||r.apiKey;n.value&&!vr(n.value)&&e.push({location:"auth",field:"apiKey.value",message:"API key contains a hardcoded value. Use a {{variable}} instead."})}}if(t.body){let r=typeof t.body=="object"&&"content"in t.body?t.body.content:t.body;r&&qm(r,e)}return e}function qm(t,e){if(t!=null){if(typeof t=="string"){let r=t.trim();if(r.startsWith("{")||r.startsWith("[")){try{qm(JSON.parse(r),e)}catch{}return}if(r.includes("=")&&!r.includes(`
93
93
  `)){try{let n=new URLSearchParams(r);for(let[i,s]of n)pn.test(i)&&s&&!vr(s)&&e.push({location:"body",field:i,message:`Form field "${i}" contains a hardcoded value. Use a {{variable}} instead.`})}catch{}return}return}if(Array.isArray(t)){t.forEach(r=>qm(r,e));return}if(typeof t=="object")for(let[r,n]of Object.entries(t))pn.test(r)&&n&&typeof n=="string"&&!vr(n)?e.push({location:"body",field:r,message:`Body field "${r}" contains a hardcoded value. Use a {{variable}} instead.`}):typeof n=="object"&&n!==null&&qm(n,e)}}function Ta(t){return t.replace(/\./g,"_").replace(/[^a-zA-Z0-9_]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"").toLowerCase()}function Ez(t){let e=[],r=new Set;function n(i){let s=i,o=2;for(;r.has(s);)s=`${i}_${o++}`;return r.add(s),s}if(t.url)try{let i=new URL(t.url.includes("://")?t.url:`http://placeholder${t.url.startsWith("/")?"":"/"}${t.url}`);for(let[s,o]of i.searchParams)pn.test(s)&&o&&!vr(o)&&e.push({location:"url",field:s,value:o,variableName:n(Ta(s))})}catch{}if(t.headers){let i=Array.isArray(t.headers)?t.headers.filter(s=>s.enabled!==!1).map(s=>[s.key,s.value]):Object.entries(t.headers);for(let[s,o]of i)b0.test(s)&&o&&!vr(o)&&e.push({location:"header",field:s,value:o,variableName:n(Ta(s))})}if(t.query){let i=Array.isArray(t.query)?t.query.filter(s=>s.enabled!==!1).map(s=>[s.key,s.value]):Object.entries(t.query);for(let[s,o]of i)pn.test(s)&&o&&!vr(o)&&e.push({location:"query",field:s,value:o,variableName:n(Ta(s))})}if(t.auth){let i=t.auth;if(i.bearerToken&&!vr(i.bearerToken)&&e.push({location:"auth",field:"bearerToken",value:i.bearerToken,variableName:n("bearer_token")}),i.basicAuth&&i.basicAuth.password&&!vr(i.basicAuth.password)&&e.push({location:"auth",field:"basicAuth.password",value:i.basicAuth.password,variableName:n("basic_auth_password")}),i.apikey||i.apiKey){let s=i.apikey||i.apiKey;s.value&&!vr(s.value)&&e.push({location:"auth",field:"apiKey.value",value:s.value,variableName:n("api_key")})}}if(t.body){let i=typeof t.body=="object"&&"content"in t.body?t.body.content:t.body;i&&km(i,e,r,"")}return e}function km(t,e,r,n){if(t!=null){if(typeof t=="string"){let i=t.trim();if(i.startsWith("{")||i.startsWith("[")){try{km(JSON.parse(i),e,r,n)}catch{}return}if(i.includes("=")&&!i.includes(`
94
94
  `)){try{let s=new URLSearchParams(i);for(let[o,l]of s)if(pn.test(o)&&l&&!vr(l)){let f=Ta(o),c=2;for(;r.has(f);)f=`${Ta(o)}_${c++}`;r.add(f),e.push({location:"body",field:o,path:n?`${n}.${o}`:o,value:l,variableName:f})}}catch{}return}return}if(Array.isArray(t)){t.forEach((i,s)=>km(i,e,r,`${n}[${s}]`));return}if(typeof t=="object")for(let[i,s]of Object.entries(t)){let o=n?`${n}.${i}`:i;if(pn.test(i)&&s&&typeof s=="string"&&!vr(s)){let l=Ta(i),f=2;for(;r.has(l);)l=`${Ta(i)}_${f++}`;r.add(l),e.push({location:"body",field:i,path:o,value:s,variableName:l})}else typeof s=="object"&&s!==null&&km(s,e,r,o)}}}function Iz(t,e){let r=JSON.parse(JSON.stringify(t));for(let n of e){let i=`{{${n.variableName}}}`;switch(n.location){case"url":r.url&&(r.url=r.url.replace(new RegExp(`([?&])${qz(n.field)}=[^&]*`),`$1${n.field}=${i}`));break;case"header":if(Array.isArray(r.headers)){let s=r.headers.find(o=>o.key===n.field&&o.value===n.value);s&&(s.value=i)}else r.headers&&r.headers[n.field]===n.value&&(r.headers[n.field]=i);break;case"query":if(Array.isArray(r.query)){let s=r.query.find(o=>o.key===n.field&&o.value===n.value);s&&(s.value=i)}else r.query&&r.query[n.field]===n.value&&(r.query[n.field]=i);break;case"auth":if(r.auth){if(n.field==="bearerToken")r.auth.bearerToken=i;else if(n.field==="basicAuth.password"&&r.auth.basicAuth)r.auth.basicAuth.password=i;else if(n.field==="apiKey.value"){let s=r.auth.apikey||r.auth.apiKey;s&&(s.value=i)}}break;case"body":Oz(r,n.field,n.path,n.value,i);break}}return r}function Oz(t,e,r,n,i){let s=typeof t.body=="object"&&t.body!==null&&"content"in t.body?t.body:null,o=s?s.content:t.body;if(o){if(typeof o=="string"){let l=o.trim();if(l.startsWith("{")||l.startsWith("[")){try{let f=JSON.parse(l);lk(f,e,r||e,n,i);let c=JSON.stringify(f,null,2);s?s.content=c:t.body=c}catch{}return}if(l.includes("=")&&!l.includes(`
95
- `)){let f=new URLSearchParams(l);if(f.get(e)===n){f.set(e,i);let c=f.toString();s?s.content=c:t.body=c}return}return}typeof o=="object"&&o!==null&&lk(o,e,r||e,n,i)}}function lk(t,e,r,n,i){let s=r.split("."),o=t;for(let f=0;f<s.length-1;f++){let c=s[f],p=c.match(/^(.+)\[(\d+)\]$/);if(p?o=o?.[p[1]]?.[parseInt(p[2])]:o=o?.[c],o==null)return}let l=s[s.length-1];o&&o[l]===n&&(o[l]=i)}function qz(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var so,b0,pn,Cz,Zf=se(()=>{"use strict";so="***",b0=/^(authorization|proxy-authorization|www-authenticate)$|(token|cookie|secret|credential|api[_\-]?key|bearer|session[_\-]?id)/i,pn=/(password|passwd|pwd|token|cookie|secret|credential|api[_\-]?key|apikey|access[_\-]?token|refresh[_\-]?token|client[_\-]?secret|private[_\-]?key|auth[_\-]?code|bearer|session[_\-]?id|jwt)/i;Cz=/\{\{[^}]+\}\}/});import*as Ae from"fs";import*as Jr from"path";var Xf,x0=se(()=>{"use strict";xn();Zf();Xf=class{historyPath;sharedHistoryPath;constructor(e,r){this.historyPath=e,this.sharedHistoryPath=r}getEnvironmentHistoryPath(e){return Jr.join(this.historyPath,At(e))}getCollectionHistoryPath(e,r){return Jr.join(this.getEnvironmentHistoryPath(e),r)}getRequestPath(e,r,n){return Jr.join(this.getCollectionHistoryPath(e,r),At(n))}getSharedEnvironmentHistoryPath(e){return Jr.join(this.sharedHistoryPath,At(e))}getSharedCollectionHistoryPath(e,r){return Jr.join(this.getSharedEnvironmentHistoryPath(e),r)}getSharedRequestPath(e,r,n){return Jr.join(this.getSharedCollectionHistoryPath(e,r),At(n))}getHistoryFilePath(e,r,n){return Jr.join(this.getRequestPath(e,r,n),"transactions.json")}getSharedHistoryFilePath(e,r,n){return Jr.join(this.getSharedRequestPath(e,r,n),"transactions.json")}getResponseFilePath(e,r,n,i){return Jr.join(this.getRequestPath(e,r,n),`${i}.json`)}getSharedResponseFilePath(e,r,n,i){return Jr.join(this.getSharedRequestPath(e,r,n),`${i}.json`)}loadHistory(e,r,n){let i=this.getHistoryFilePath(e,r,n);try{if(!Ae.existsSync(i))return null;let s=Ae.readFileSync(i,"utf-8"),o=JSON.parse(s);return{environment:e||o.environment,requestPath:r||o.requestPath,requestId:n||o.requestId,method:o.method,requests:o.requests}}catch(s){return console.error(`Failed to load history for ${n}:`,s),null}}loadSharedHistory(e,r,n){let i=this.getSharedHistoryFilePath(e,r,n);try{if(!Ae.existsSync(i))return null;let s=Ae.readFileSync(i,"utf-8"),o=JSON.parse(s);return{environment:e||o.environment,requestPath:r||o.requestPath,requestId:n||o.requestId,method:o.method,requests:o.requests}}catch(s){return console.error(`Failed to load shared history for ${n}:`,s),null}}getEntriesForEnvironment(e,r,n){let i=this.loadHistory(e,r,n);return i?i.requests:[]}getEntriesGroupedByTicket(e,r,n){let i=this.getEntriesForEnvironment(e,r,n),s=new Map;for(let o of i){let l=o.ticket||o.branch||"";s.has(l)||s.set(l,[]),s.get(l).push(o)}return s}getSharedEntriesGroupedByTicket(e,r,n){let i=this.loadSharedHistory(e,r,n)?.requests??[],s=new Map;for(let o of i){let l=o.ticket||o.branch||"";s.has(l)||s.set(l,[]),s.get(l).push(o)}return s}saveHistory(e){let r=this.getRequestPath(e.environment,e.requestPath,e.requestId),n=this.getHistoryFilePath(e.environment,e.requestPath,e.requestId);try{Ae.existsSync(r)||Ae.mkdirSync(r,{recursive:!0}),Ae.writeFileSync(n,JSON.stringify(e,null,2),"utf-8")}catch(i){throw console.error(`Failed to save history for ${e.requestId}:`,i),i}}saveSharedHistory(e){let r=this.getSharedRequestPath(e.environment,e.requestPath,e.requestId),n=this.getSharedHistoryFilePath(e.environment,e.requestPath,e.requestId);try{Ae.existsSync(r)||Ae.mkdirSync(r,{recursive:!0}),Ae.writeFileSync(n,JSON.stringify(e,null,2),"utf-8")}catch(i){throw console.error(`Failed to save shared history for ${e.requestId}:`,i),i}}addEntry(e,r,n,i,s){let o=this.loadHistory(e,r,n);o||(o={environment:e,requestPath:r,requestId:n,method:i,requests:[]});let l=_0({...s,method:i,id:Kb(),timestamp:Date.now()});return o.requests.unshift(l),o.requests.length>100&&(o.requests=o.requests.slice(0,100)),this.saveHistory(o),l}deleteEntry(e,r,n,i){let s=this.loadHistory(e,r,n);if(!s)return!1;let o=s.requests.length;if(s.requests=s.requests.filter(l=>l.id!==i),s.requests.length!==o){this.saveHistory(s);let l=this.getResponseFilePath(e,r,n,i);return Ae.existsSync(l)&&Ae.unlinkSync(l),!0}return!1}deleteSharedEntry(e,r,n,i){let s=this.loadSharedHistory(e,r,n);if(!s)return!1;let o=s.requests.length;if(s.requests=s.requests.filter(l=>l.id!==i),s.requests.length!==o){this.saveSharedHistory(s);let l=this.getSharedResponseFilePath(e,r,n,i);return Ae.existsSync(l)&&Ae.unlinkSync(l),!0}return!1}shareEntry(e,r,n,i,s){let o=(s||"").trim();if(!o)return!1;let l=this.loadHistory(e,r,n);if(!l)return!1;let f=l.requests.findIndex(v=>v.id===i);if(f===-1)return!1;let[c]=l.requests.splice(f,1);this.saveHistory(l);let p=this.loadSharedHistory(e,r,n)||{environment:e,requestPath:r,requestId:n,method:l.method,requests:[]};if(!p.requests.some(v=>v.id===i)){let v={...c,ticket:null,branch:o};p.requests.unshift(v),p.requests.length>100&&(p.requests=p.requests.slice(0,100)),this.saveSharedHistory(p)}let h=this.getResponseFilePath(e,r,n,i),g=this.getSharedResponseFilePath(e,r,n,i);if(Ae.existsSync(h)){let v=Jr.dirname(g);Ae.existsSync(v)||Ae.mkdirSync(v,{recursive:!0});try{Ae.renameSync(h,g)}catch{try{Ae.copyFileSync(h,g)}catch(w){return console.error(`Failed to copy full response from ${h} to ${g}:`,w),!0}try{Ae.unlinkSync(h)}catch(w){console.warn(`Failed to remove original full response after copy: ${h}`,w)}}}return!0}moveSharedEntry(e,r,n,i,s){let o=(s||"").trim();if(!o)return!1;let l=this.loadSharedHistory(e,r,n);if(!l)return!1;let f=!1;return l.requests=l.requests.map(c=>c.id===i?(f=!0,{...c,ticket:null,branch:o}):c),f?(this.saveSharedHistory(l),!0):!1}renameSharedGroup(e,r,n,i,s){let o=(i||"").trim(),l=(s||"").trim();if(!o||!l||o===l)return!1;let f=this.loadSharedHistory(e,r,n);if(!f)return!1;let c=!1;return f.requests=f.requests.map(p=>!p.ticket&&p.branch===o?(c=!0,{...p,branch:l}):p),c?(this.saveSharedHistory(f),!0):!1}clearHistory(e,r,n){let i=this.getRequestPath(e,r,n);if(Ae.existsSync(i)){let s=Ae.readdirSync(i);for(let o of s)Ae.unlinkSync(Jr.join(i,o));Ae.rmdirSync(i)}}saveFullResponse(e,r,n,i,s){let o=this.getRequestPath(e,r,n),l=this.getResponseFilePath(e,r,n,i);try{Ae.existsSync(o)||Ae.mkdirSync(o,{recursive:!0});let f=R0(s);Ae.writeFileSync(l,JSON.stringify(f,null,2),"utf-8")}catch(f){throw console.error(`Failed to save full response for ${i}:`,f),f}}loadFullResponse(e,r,n,i){let s=this.getResponseFilePath(e,r,n,i);try{if(!Ae.existsSync(s))return null;let o=Ae.readFileSync(s,"utf-8");return JSON.parse(o)}catch(o){return console.error(`Failed to load full response for ${i}:`,o),null}}loadSharedFullResponse(e,r,n,i){let s=this.getSharedResponseFilePath(e,r,n,i);try{if(!Ae.existsSync(s))return null;let o=Ae.readFileSync(s,"utf-8");return JSON.parse(o)}catch(o){return console.error(`Failed to load shared full response for ${i}:`,o),null}}}});var vu,E0=se(()=>{"use strict";vu=class{constructor(e,r){this.historyService=e;this.inferrer=r}historyService;inferrer;async analyze(e,r,n){let i=n?.environment||"default",s=n?.maxSamples||50,o=this.historyService.loadHistory(i,e,r),l=this.historyService.loadSharedHistory(i,e,r),f=[...o?.requests||[],...l?.requests||[]];if(f.length===0)return{responses:{}};let c=f.slice(0,s),p=new Map;for(let g of c){let v=this.historyService.loadFullResponse(i,e,r,g.id);if(v||(v=this.historyService.loadSharedFullResponse(i,e,r,g.id)),v){let _=v.status;p.has(_)||p.set(_,[]),p.get(_).push(v)}}let h={};for(let[g,v]of p){let _=this.buildResponseDefinition(v);h[String(g)]=_}return{responses:h}}buildResponseDefinition(e){let r={};if(e.length===0)return r;let n=e[0];r.description=n.statusText||`Status ${n.status}`;let i=this.extractContentType(n.headers);if(i&&(r.contentType=i),i&&this.isJsonContentType(i)){let o=this.inferBodySchema(n);for(let l=1;l<e.length;l++){let f=this.inferBodySchema(e[l]);f&&o?o=this.inferrer.mergeSchemas(o,f):f&&(o=f)}if(o&&(r.schema=o),n.body!==void 0&&n.body!==null){let l=typeof n.body=="string"?this.tryParseJson(n.body):n.body;l!==void 0&&(r.examples={default:{summary:"Captured from history",value:l}})}}let s=this.findConsistentHeaders(e);return Object.keys(s).length>0&&(r.headers=s),r}inferBodySchema(e){if(e.body===void 0||e.body===null)return;let r=e.body;if(!(typeof r=="string"&&(r=this.tryParseJson(r),r===void 0)))return this.inferrer.inferFromValue(r)}extractContentType(e){for(let[r,n]of Object.entries(e))if(r.toLowerCase()==="content-type")return(Array.isArray(n)?n[0]:n).split(";")[0].trim()}isJsonContentType(e){return e.includes("json")||e.includes("+json")||e==="application/json"}findConsistentHeaders(e){if(e.length===0)return{};let r=new Set(["content-type","content-length","content-encoding","transfer-encoding","connection","date","server","set-cookie","vary","cache-control","expires","pragma","etag","last-modified","age"]),n=new Map,i=new Map;for(let l of e)for(let[f,c]of Object.entries(l.headers)){let p=f.toLowerCase();r.has(p)||(n.set(p,(n.get(p)||0)+1),i.has(p)||i.set(p,Array.isArray(c)?c.join(", "):c))}let s=Math.ceil(e.length/2),o={};for(let[l,f]of n)if(f>=s){let c=i.get(l);o[l]={schema:this.inferHeaderSchema(c)}}return o}inferHeaderSchema(e){return e?/^\d+$/.test(e)?{type:"integer"}:{type:"string"}:{type:"string"}}tryParseJson(e){try{return JSON.parse(e)}catch{return}}}});var Ze=H(cr=>{"use strict";var I0=Symbol.for("yaml.alias"),uk=Symbol.for("yaml.document"),Tm=Symbol.for("yaml.map"),ck=Symbol.for("yaml.pair"),O0=Symbol.for("yaml.scalar"),Am=Symbol.for("yaml.seq"),fs=Symbol.for("yaml.node.type"),kz=t=>!!t&&typeof t=="object"&&t[fs]===I0,Pz=t=>!!t&&typeof t=="object"&&t[fs]===uk,Tz=t=>!!t&&typeof t=="object"&&t[fs]===Tm,Az=t=>!!t&&typeof t=="object"&&t[fs]===ck,fk=t=>!!t&&typeof t=="object"&&t[fs]===O0,$z=t=>!!t&&typeof t=="object"&&t[fs]===Am;function dk(t){if(t&&typeof t=="object")switch(t[fs]){case Tm:case Am:return!0}return!1}function Nz(t){if(t&&typeof t=="object")switch(t[fs]){case I0:case Tm:case O0:case Am:return!0}return!1}var Mz=t=>(fk(t)||dk(t))&&!!t.anchor;cr.ALIAS=I0;cr.DOC=uk;cr.MAP=Tm;cr.NODE_TYPE=fs;cr.PAIR=ck;cr.SCALAR=O0;cr.SEQ=Am;cr.hasAnchor=Mz;cr.isAlias=kz;cr.isCollection=dk;cr.isDocument=Pz;cr.isMap=Tz;cr.isNode=Nz;cr.isPair=Az;cr.isScalar=fk;cr.isSeq=$z});var ed=H(q0=>{"use strict";var Qt=Ze(),Gr=Symbol("break visit"),pk=Symbol("skip children"),Pi=Symbol("remove node");function $m(t,e){let r=hk(e);Qt.isDocument(t)?bu(null,t.contents,r,Object.freeze([t]))===Pi&&(t.contents=null):bu(null,t,r,Object.freeze([]))}$m.BREAK=Gr;$m.SKIP=pk;$m.REMOVE=Pi;function bu(t,e,r,n){let i=mk(t,e,r,n);if(Qt.isNode(i)||Qt.isPair(i))return gk(t,n,i),bu(t,i,r,n);if(typeof i!="symbol"){if(Qt.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let o=bu(s,e.items[s],r,n);if(typeof o=="number")s=o-1;else{if(o===Gr)return Gr;o===Pi&&(e.items.splice(s,1),s-=1)}}}else if(Qt.isPair(e)){n=Object.freeze(n.concat(e));let s=bu("key",e.key,r,n);if(s===Gr)return Gr;s===Pi&&(e.key=null);let o=bu("value",e.value,r,n);if(o===Gr)return Gr;o===Pi&&(e.value=null)}}return i}async function Nm(t,e){let r=hk(e);Qt.isDocument(t)?await Su(null,t.contents,r,Object.freeze([t]))===Pi&&(t.contents=null):await Su(null,t,r,Object.freeze([]))}Nm.BREAK=Gr;Nm.SKIP=pk;Nm.REMOVE=Pi;async function Su(t,e,r,n){let i=await mk(t,e,r,n);if(Qt.isNode(i)||Qt.isPair(i))return gk(t,n,i),Su(t,i,r,n);if(typeof i!="symbol"){if(Qt.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let o=await Su(s,e.items[s],r,n);if(typeof o=="number")s=o-1;else{if(o===Gr)return Gr;o===Pi&&(e.items.splice(s,1),s-=1)}}}else if(Qt.isPair(e)){n=Object.freeze(n.concat(e));let s=await Su("key",e.key,r,n);if(s===Gr)return Gr;s===Pi&&(e.key=null);let o=await Su("value",e.value,r,n);if(o===Gr)return Gr;o===Pi&&(e.value=null)}}return i}function hk(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function mk(t,e,r,n){if(typeof r=="function")return r(t,e,n);if(Qt.isMap(e))return r.Map?.(t,e,n);if(Qt.isSeq(e))return r.Seq?.(t,e,n);if(Qt.isPair(e))return r.Pair?.(t,e,n);if(Qt.isScalar(e))return r.Scalar?.(t,e,n);if(Qt.isAlias(e))return r.Alias?.(t,e,n)}function gk(t,e,r){let n=e[e.length-1];if(Qt.isCollection(n))n.items[t]=r;else if(Qt.isPair(n))t==="key"?n.key=r:n.value=r;else if(Qt.isDocument(n))n.contents=r;else{let i=Qt.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}q0.visit=$m;q0.visitAsync=Nm});var k0=H(vk=>{"use strict";var yk=Ze(),Fz=ed(),Dz={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Lz=t=>t.replace(/[!,[\]{}]/g,e=>Dz[e]),td=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[s,o]=n;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[s]=n;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let o=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,o),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),o)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let s=this.tags[n];if(s)try{return s+decodeURIComponent(i)}catch(o){return r(String(o)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+Lz(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&yk.isNode(e.contents)){let s={};Fz.visit(e.contents,(o,l)=>{yk.isNode(l)&&l.tag&&(s[l.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,o]of n)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(l=>l.startsWith(o)))&&r.push(`%TAG ${s} ${o}`);return r.join(`
96
- `)}};td.defaultYaml={explicit:!1,version:"1.2"};td.defaultTags={"!!":"tag:yaml.org,2002:"};vk.Directives=td});var Mm=H(rd=>{"use strict";var bk=Ze(),jz=ed();function Uz(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 Sk(t){let e=new Set;return jz.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function wk(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function Hz(t,e){let r=[],n=new Map,i=null;return{onAnchor:s=>{r.push(s),i??(i=Sk(t));let o=wk(e,i);return i.add(o),o},setAnchors:()=>{for(let s of r){let o=n.get(s);if(typeof o=="object"&&o.anchor&&(bk.isScalar(o.node)||bk.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}}rd.anchorIsValid=Uz;rd.anchorNames=Sk;rd.createNodeAnchors=Hz;rd.findNewAnchor=wk});var P0=H(_k=>{"use strict";function nd(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=nd(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=nd(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=nd(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=nd(t,n,i,s);o===void 0?delete n[i]:o!==s&&(n[i]=o)}return t.call(e,r,n)}_k.applyReviver=nd});var oo=H(Ck=>{"use strict";var Bz=Ze();function Rk(t,e,r){if(Array.isArray(t))return t.map((n,i)=>Rk(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!Bz.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}Ck.toJS=Rk});var Fm=H(Ek=>{"use strict";var Vz=P0(),xk=Ze(),Wz=oo(),T0=class{constructor(e){Object.defineProperty(this,xk.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(!xk.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=Wz.toJS(this,"",o);if(typeof i=="function")for(let{count:f,res:c}of o.anchors.values())i(c,f);return typeof s=="function"?Vz.applyReviver(s,{"":l},"",l):l}};Ek.NodeBase=T0});var id=H(Ik=>{"use strict";var zz=Mm(),Jz=ed(),wu=Ze(),Gz=Fm(),Yz=oo(),A0=class extends Gz.NodeBase{constructor(e){super(wu.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=[],Jz.visit(e,{Node:(s,o)=>{(wu.isAlias(o)||wu.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 f=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(f)}let l=n.get(o);if(l||(Yz.toJS(o,null,r),l=n.get(o)),l?.res===void 0){let f="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(f)}if(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=Dm(i,o,n)),l.count*l.aliasCount>s)){let f="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(f)}return l.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(zz.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 Dm(t,e,r){if(wu.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(wu.isCollection(e)){let n=0;for(let i of e.items){let s=Dm(t,i,r);s>n&&(n=s)}return n}else if(wu.isPair(e)){let n=Dm(t,e.key,r),i=Dm(t,e.value,r);return Math.max(n,i)}return 1}Ik.Alias=A0});var Bt=H($0=>{"use strict";var Kz=Ze(),Qz=Fm(),Zz=oo(),Xz=t=>!t||typeof t!="function"&&typeof t!="object",ao=class extends Qz.NodeBase{constructor(e){super(Kz.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:Zz.toJS(this.value,e,r)}toString(){return String(this.value)}};ao.BLOCK_FOLDED="BLOCK_FOLDED";ao.BLOCK_LITERAL="BLOCK_LITERAL";ao.PLAIN="PLAIN";ao.QUOTE_DOUBLE="QUOTE_DOUBLE";ao.QUOTE_SINGLE="QUOTE_SINGLE";$0.Scalar=ao;$0.isScalarValue=Xz});var sd=H(qk=>{"use strict";var eJ=id(),Aa=Ze(),Ok=Bt(),tJ="tag:yaml.org,2002:";function rJ(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 nJ(t,e,r){if(Aa.isDocument(t)&&(t=t.contents),Aa.isNode(t))return t;if(Aa.isPair(t)){let h=r.schema[Aa.MAP].createNode?.(r.schema,null,r);return h.items.push(t),h}(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,f;if(n&&t&&typeof t=="object"){if(f=l.get(t),f)return f.anchor??(f.anchor=i(t)),new eJ.Alias(f.anchor);f={anchor:null,node:null},l.set(t,f)}e?.startsWith("!!")&&(e=tJ+e.slice(2));let c=rJ(t,e,o.tags);if(!c){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let h=new Ok.Scalar(t);return f&&(f.node=h),h}c=t instanceof Map?o[Aa.MAP]:Symbol.iterator in Object(t)?o[Aa.SEQ]:o[Aa.MAP]}s&&(s(c),delete r.onTagObj);let p=c?.createNode?c.createNode(r.schema,t,r):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(r.schema,t,r):new Ok.Scalar(t);return e?p.tag=e:c.default||(p.tag=c.tag),f&&(f.node=p),p}qk.createNode=nJ});var jm=H(Lm=>{"use strict";var iJ=sd(),Ti=Ze(),sJ=Fm();function N0(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 iJ.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 kk=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,M0=class extends sJ.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=>Ti.isNode(n)||Ti.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(kk(e))this.add(r);else{let[n,...i]=e,s=this.get(n,!0);if(Ti.isCollection(s))s.addIn(i,r);else if(s===void 0&&this.schema)this.set(n,N0(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(Ti.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&&Ti.isScalar(s)?s.value:s:Ti.isCollection(s)?s.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!Ti.isPair(r))return!1;let n=r.value;return n==null||e&&Ti.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 Ti.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(Ti.isCollection(s))s.setIn(i,r);else if(s===void 0&&this.schema)this.set(n,N0(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};Lm.Collection=M0;Lm.collectionFromPath=N0;Lm.isEmptyPath=kk});var od=H(Um=>{"use strict";var oJ=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function F0(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var aJ=(t,e,r)=>t.endsWith(`
95
+ `)){let f=new URLSearchParams(l);if(f.get(e)===n){f.set(e,i);let c=f.toString();s?s.content=c:t.body=c}return}return}typeof o=="object"&&o!==null&&lk(o,e,r||e,n,i)}}function lk(t,e,r,n,i){let s=r.split("."),o=t;for(let f=0;f<s.length-1;f++){let c=s[f],p=c.match(/^(.+)\[(\d+)\]$/);if(p?o=o?.[p[1]]?.[parseInt(p[2])]:o=o?.[c],o==null)return}let l=s[s.length-1];o&&o[l]===n&&(o[l]=i)}function qz(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var oo,b0,pn,Cz,Zf=se(()=>{"use strict";oo="***",b0=/^(authorization|proxy-authorization|www-authenticate)$|(token|cookie|secret|credential|api[_\-]?key|bearer|session[_\-]?id)/i,pn=/(password|passwd|pwd|token|cookie|secret|credential|api[_\-]?key|apikey|access[_\-]?token|refresh[_\-]?token|client[_\-]?secret|private[_\-]?key|auth[_\-]?code|bearer|session[_\-]?id|jwt)/i;Cz=/\{\{[^}]+\}\}/});import*as Ae from"fs";import*as Jr from"path";var Xf,x0=se(()=>{"use strict";xn();Zf();Xf=class{historyPath;sharedHistoryPath;constructor(e,r){this.historyPath=e,this.sharedHistoryPath=r}getEnvironmentHistoryPath(e){return Jr.join(this.historyPath,$t(e))}getCollectionHistoryPath(e,r){return Jr.join(this.getEnvironmentHistoryPath(e),r)}getRequestPath(e,r,n){return Jr.join(this.getCollectionHistoryPath(e,r),$t(n))}getSharedEnvironmentHistoryPath(e){return Jr.join(this.sharedHistoryPath,$t(e))}getSharedCollectionHistoryPath(e,r){return Jr.join(this.getSharedEnvironmentHistoryPath(e),r)}getSharedRequestPath(e,r,n){return Jr.join(this.getSharedCollectionHistoryPath(e,r),$t(n))}getHistoryFilePath(e,r,n){return Jr.join(this.getRequestPath(e,r,n),"transactions.json")}getSharedHistoryFilePath(e,r,n){return Jr.join(this.getSharedRequestPath(e,r,n),"transactions.json")}getResponseFilePath(e,r,n,i){return Jr.join(this.getRequestPath(e,r,n),`${i}.json`)}getSharedResponseFilePath(e,r,n,i){return Jr.join(this.getSharedRequestPath(e,r,n),`${i}.json`)}loadHistory(e,r,n){let i=this.getHistoryFilePath(e,r,n);try{if(!Ae.existsSync(i))return null;let s=Ae.readFileSync(i,"utf-8"),o=JSON.parse(s);return{environment:e||o.environment,requestPath:r||o.requestPath,requestId:n||o.requestId,method:o.method,requests:o.requests}}catch(s){return console.error(`Failed to load history for ${n}:`,s),null}}loadSharedHistory(e,r,n){let i=this.getSharedHistoryFilePath(e,r,n);try{if(!Ae.existsSync(i))return null;let s=Ae.readFileSync(i,"utf-8"),o=JSON.parse(s);return{environment:e||o.environment,requestPath:r||o.requestPath,requestId:n||o.requestId,method:o.method,requests:o.requests}}catch(s){return console.error(`Failed to load shared history for ${n}:`,s),null}}getEntriesForEnvironment(e,r,n){let i=this.loadHistory(e,r,n);return i?i.requests:[]}getEntriesGroupedByTicket(e,r,n){let i=this.getEntriesForEnvironment(e,r,n),s=new Map;for(let o of i){let l=o.ticket||o.branch||"";s.has(l)||s.set(l,[]),s.get(l).push(o)}return s}getSharedEntriesGroupedByTicket(e,r,n){let i=this.loadSharedHistory(e,r,n)?.requests??[],s=new Map;for(let o of i){let l=o.ticket||o.branch||"";s.has(l)||s.set(l,[]),s.get(l).push(o)}return s}saveHistory(e){let r=this.getRequestPath(e.environment,e.requestPath,e.requestId),n=this.getHistoryFilePath(e.environment,e.requestPath,e.requestId);try{Ae.existsSync(r)||Ae.mkdirSync(r,{recursive:!0}),Ae.writeFileSync(n,JSON.stringify(e,null,2),"utf-8")}catch(i){throw console.error(`Failed to save history for ${e.requestId}:`,i),i}}saveSharedHistory(e){let r=this.getSharedRequestPath(e.environment,e.requestPath,e.requestId),n=this.getSharedHistoryFilePath(e.environment,e.requestPath,e.requestId);try{Ae.existsSync(r)||Ae.mkdirSync(r,{recursive:!0}),Ae.writeFileSync(n,JSON.stringify(e,null,2),"utf-8")}catch(i){throw console.error(`Failed to save shared history for ${e.requestId}:`,i),i}}addEntry(e,r,n,i,s){let o=this.loadHistory(e,r,n);o||(o={environment:e,requestPath:r,requestId:n,method:i,requests:[]});let l=_0({...s,method:i,id:Kb(),timestamp:Date.now()});return o.requests.unshift(l),o.requests.length>100&&(o.requests=o.requests.slice(0,100)),this.saveHistory(o),l}deleteEntry(e,r,n,i){let s=this.loadHistory(e,r,n);if(!s)return!1;let o=s.requests.length;if(s.requests=s.requests.filter(l=>l.id!==i),s.requests.length!==o){this.saveHistory(s);let l=this.getResponseFilePath(e,r,n,i);return Ae.existsSync(l)&&Ae.unlinkSync(l),!0}return!1}deleteSharedEntry(e,r,n,i){let s=this.loadSharedHistory(e,r,n);if(!s)return!1;let o=s.requests.length;if(s.requests=s.requests.filter(l=>l.id!==i),s.requests.length!==o){this.saveSharedHistory(s);let l=this.getSharedResponseFilePath(e,r,n,i);return Ae.existsSync(l)&&Ae.unlinkSync(l),!0}return!1}shareEntry(e,r,n,i,s){let o=(s||"").trim();if(!o)return!1;let l=this.loadHistory(e,r,n);if(!l)return!1;let f=l.requests.findIndex(v=>v.id===i);if(f===-1)return!1;let[c]=l.requests.splice(f,1);this.saveHistory(l);let p=this.loadSharedHistory(e,r,n)||{environment:e,requestPath:r,requestId:n,method:l.method,requests:[]};if(!p.requests.some(v=>v.id===i)){let v={...c,ticket:null,branch:o};p.requests.unshift(v),p.requests.length>100&&(p.requests=p.requests.slice(0,100)),this.saveSharedHistory(p)}let h=this.getResponseFilePath(e,r,n,i),g=this.getSharedResponseFilePath(e,r,n,i);if(Ae.existsSync(h)){let v=Jr.dirname(g);Ae.existsSync(v)||Ae.mkdirSync(v,{recursive:!0});try{Ae.renameSync(h,g)}catch{try{Ae.copyFileSync(h,g)}catch(w){return console.error(`Failed to copy full response from ${h} to ${g}:`,w),!0}try{Ae.unlinkSync(h)}catch(w){console.warn(`Failed to remove original full response after copy: ${h}`,w)}}}return!0}moveSharedEntry(e,r,n,i,s){let o=(s||"").trim();if(!o)return!1;let l=this.loadSharedHistory(e,r,n);if(!l)return!1;let f=!1;return l.requests=l.requests.map(c=>c.id===i?(f=!0,{...c,ticket:null,branch:o}):c),f?(this.saveSharedHistory(l),!0):!1}renameSharedGroup(e,r,n,i,s){let o=(i||"").trim(),l=(s||"").trim();if(!o||!l||o===l)return!1;let f=this.loadSharedHistory(e,r,n);if(!f)return!1;let c=!1;return f.requests=f.requests.map(p=>!p.ticket&&p.branch===o?(c=!0,{...p,branch:l}):p),c?(this.saveSharedHistory(f),!0):!1}clearHistory(e,r,n){let i=this.getRequestPath(e,r,n);if(Ae.existsSync(i)){let s=Ae.readdirSync(i);for(let o of s)Ae.unlinkSync(Jr.join(i,o));Ae.rmdirSync(i)}}saveFullResponse(e,r,n,i,s){let o=this.getRequestPath(e,r,n),l=this.getResponseFilePath(e,r,n,i);try{Ae.existsSync(o)||Ae.mkdirSync(o,{recursive:!0});let f=R0(s);Ae.writeFileSync(l,JSON.stringify(f,null,2),"utf-8")}catch(f){throw console.error(`Failed to save full response for ${i}:`,f),f}}loadFullResponse(e,r,n,i){let s=this.getResponseFilePath(e,r,n,i);try{if(!Ae.existsSync(s))return null;let o=Ae.readFileSync(s,"utf-8");return JSON.parse(o)}catch(o){return console.error(`Failed to load full response for ${i}:`,o),null}}loadSharedFullResponse(e,r,n,i){let s=this.getSharedResponseFilePath(e,r,n,i);try{if(!Ae.existsSync(s))return null;let o=Ae.readFileSync(s,"utf-8");return JSON.parse(o)}catch(o){return console.error(`Failed to load shared full response for ${i}:`,o),null}}}});var vu,E0=se(()=>{"use strict";vu=class{constructor(e,r){this.historyService=e;this.inferrer=r}historyService;inferrer;async analyze(e,r,n){let i=n?.environment||"default",s=n?.maxSamples||50,o=this.historyService.loadHistory(i,e,r),l=this.historyService.loadSharedHistory(i,e,r),f=[...o?.requests||[],...l?.requests||[]];if(f.length===0)return{responses:{}};let c=f.slice(0,s),p=new Map;for(let g of c){let v=this.historyService.loadFullResponse(i,e,r,g.id);if(v||(v=this.historyService.loadSharedFullResponse(i,e,r,g.id)),v){let _=v.status;p.has(_)||p.set(_,[]),p.get(_).push(v)}}let h={};for(let[g,v]of p){let _=this.buildResponseDefinition(v);h[String(g)]=_}return{responses:h}}buildResponseDefinition(e){let r={};if(e.length===0)return r;let n=e[0];r.description=n.statusText||`Status ${n.status}`;let i=this.extractContentType(n.headers);if(i&&(r.contentType=i),i&&this.isJsonContentType(i)){let o=this.inferBodySchema(n);for(let l=1;l<e.length;l++){let f=this.inferBodySchema(e[l]);f&&o?o=this.inferrer.mergeSchemas(o,f):f&&(o=f)}if(o&&(r.schema=o),n.body!==void 0&&n.body!==null){let l=typeof n.body=="string"?this.tryParseJson(n.body):n.body;l!==void 0&&(r.examples={default:{summary:"Captured from history",value:l}})}}let s=this.findConsistentHeaders(e);return Object.keys(s).length>0&&(r.headers=s),r}inferBodySchema(e){if(e.body===void 0||e.body===null)return;let r=e.body;if(!(typeof r=="string"&&(r=this.tryParseJson(r),r===void 0)))return this.inferrer.inferFromValue(r)}extractContentType(e){for(let[r,n]of Object.entries(e))if(r.toLowerCase()==="content-type")return(Array.isArray(n)?n[0]:n).split(";")[0].trim()}isJsonContentType(e){return e.includes("json")||e.includes("+json")||e==="application/json"}findConsistentHeaders(e){if(e.length===0)return{};let r=new Set(["content-type","content-length","content-encoding","transfer-encoding","connection","date","server","set-cookie","vary","cache-control","expires","pragma","etag","last-modified","age"]),n=new Map,i=new Map;for(let l of e)for(let[f,c]of Object.entries(l.headers)){let p=f.toLowerCase();r.has(p)||(n.set(p,(n.get(p)||0)+1),i.has(p)||i.set(p,Array.isArray(c)?c.join(", "):c))}let s=Math.ceil(e.length/2),o={};for(let[l,f]of n)if(f>=s){let c=i.get(l);o[l]={schema:this.inferHeaderSchema(c)}}return o}inferHeaderSchema(e){return e?/^\d+$/.test(e)?{type:"integer"}:{type:"string"}:{type:"string"}}tryParseJson(e){try{return JSON.parse(e)}catch{return}}}});var Ze=H(cr=>{"use strict";var I0=Symbol.for("yaml.alias"),uk=Symbol.for("yaml.document"),Tm=Symbol.for("yaml.map"),ck=Symbol.for("yaml.pair"),O0=Symbol.for("yaml.scalar"),Am=Symbol.for("yaml.seq"),fs=Symbol.for("yaml.node.type"),kz=t=>!!t&&typeof t=="object"&&t[fs]===I0,Pz=t=>!!t&&typeof t=="object"&&t[fs]===uk,Tz=t=>!!t&&typeof t=="object"&&t[fs]===Tm,Az=t=>!!t&&typeof t=="object"&&t[fs]===ck,fk=t=>!!t&&typeof t=="object"&&t[fs]===O0,$z=t=>!!t&&typeof t=="object"&&t[fs]===Am;function dk(t){if(t&&typeof t=="object")switch(t[fs]){case Tm:case Am:return!0}return!1}function Nz(t){if(t&&typeof t=="object")switch(t[fs]){case I0:case Tm:case O0:case Am:return!0}return!1}var Mz=t=>(fk(t)||dk(t))&&!!t.anchor;cr.ALIAS=I0;cr.DOC=uk;cr.MAP=Tm;cr.NODE_TYPE=fs;cr.PAIR=ck;cr.SCALAR=O0;cr.SEQ=Am;cr.hasAnchor=Mz;cr.isAlias=kz;cr.isCollection=dk;cr.isDocument=Pz;cr.isMap=Tz;cr.isNode=Nz;cr.isPair=Az;cr.isScalar=fk;cr.isSeq=$z});var ed=H(q0=>{"use strict";var Xt=Ze(),Gr=Symbol("break visit"),pk=Symbol("skip children"),Pi=Symbol("remove node");function $m(t,e){let r=hk(e);Xt.isDocument(t)?bu(null,t.contents,r,Object.freeze([t]))===Pi&&(t.contents=null):bu(null,t,r,Object.freeze([]))}$m.BREAK=Gr;$m.SKIP=pk;$m.REMOVE=Pi;function bu(t,e,r,n){let i=mk(t,e,r,n);if(Xt.isNode(i)||Xt.isPair(i))return gk(t,n,i),bu(t,i,r,n);if(typeof i!="symbol"){if(Xt.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let o=bu(s,e.items[s],r,n);if(typeof o=="number")s=o-1;else{if(o===Gr)return Gr;o===Pi&&(e.items.splice(s,1),s-=1)}}}else if(Xt.isPair(e)){n=Object.freeze(n.concat(e));let s=bu("key",e.key,r,n);if(s===Gr)return Gr;s===Pi&&(e.key=null);let o=bu("value",e.value,r,n);if(o===Gr)return Gr;o===Pi&&(e.value=null)}}return i}async function Nm(t,e){let r=hk(e);Xt.isDocument(t)?await Su(null,t.contents,r,Object.freeze([t]))===Pi&&(t.contents=null):await Su(null,t,r,Object.freeze([]))}Nm.BREAK=Gr;Nm.SKIP=pk;Nm.REMOVE=Pi;async function Su(t,e,r,n){let i=await mk(t,e,r,n);if(Xt.isNode(i)||Xt.isPair(i))return gk(t,n,i),Su(t,i,r,n);if(typeof i!="symbol"){if(Xt.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let o=await Su(s,e.items[s],r,n);if(typeof o=="number")s=o-1;else{if(o===Gr)return Gr;o===Pi&&(e.items.splice(s,1),s-=1)}}}else if(Xt.isPair(e)){n=Object.freeze(n.concat(e));let s=await Su("key",e.key,r,n);if(s===Gr)return Gr;s===Pi&&(e.key=null);let o=await Su("value",e.value,r,n);if(o===Gr)return Gr;o===Pi&&(e.value=null)}}return i}function hk(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function mk(t,e,r,n){if(typeof r=="function")return r(t,e,n);if(Xt.isMap(e))return r.Map?.(t,e,n);if(Xt.isSeq(e))return r.Seq?.(t,e,n);if(Xt.isPair(e))return r.Pair?.(t,e,n);if(Xt.isScalar(e))return r.Scalar?.(t,e,n);if(Xt.isAlias(e))return r.Alias?.(t,e,n)}function gk(t,e,r){let n=e[e.length-1];if(Xt.isCollection(n))n.items[t]=r;else if(Xt.isPair(n))t==="key"?n.key=r:n.value=r;else if(Xt.isDocument(n))n.contents=r;else{let i=Xt.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}q0.visit=$m;q0.visitAsync=Nm});var k0=H(vk=>{"use strict";var yk=Ze(),Fz=ed(),Dz={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Lz=t=>t.replace(/[!,[\]{}]/g,e=>Dz[e]),td=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[s,o]=n;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[s]=n;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let o=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,o),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),o)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let s=this.tags[n];if(s)try{return s+decodeURIComponent(i)}catch(o){return r(String(o)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+Lz(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&yk.isNode(e.contents)){let s={};Fz.visit(e.contents,(o,l)=>{yk.isNode(l)&&l.tag&&(s[l.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,o]of n)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(l=>l.startsWith(o)))&&r.push(`%TAG ${s} ${o}`);return r.join(`
96
+ `)}};td.defaultYaml={explicit:!1,version:"1.2"};td.defaultTags={"!!":"tag:yaml.org,2002:"};vk.Directives=td});var Mm=H(rd=>{"use strict";var bk=Ze(),jz=ed();function Uz(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 Sk(t){let e=new Set;return jz.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function wk(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function Hz(t,e){let r=[],n=new Map,i=null;return{onAnchor:s=>{r.push(s),i??(i=Sk(t));let o=wk(e,i);return i.add(o),o},setAnchors:()=>{for(let s of r){let o=n.get(s);if(typeof o=="object"&&o.anchor&&(bk.isScalar(o.node)||bk.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}}rd.anchorIsValid=Uz;rd.anchorNames=Sk;rd.createNodeAnchors=Hz;rd.findNewAnchor=wk});var P0=H(_k=>{"use strict";function nd(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=nd(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=nd(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=nd(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=nd(t,n,i,s);o===void 0?delete n[i]:o!==s&&(n[i]=o)}return t.call(e,r,n)}_k.applyReviver=nd});var ao=H(Ck=>{"use strict";var Bz=Ze();function Rk(t,e,r){if(Array.isArray(t))return t.map((n,i)=>Rk(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!Bz.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}Ck.toJS=Rk});var Fm=H(Ek=>{"use strict";var Vz=P0(),xk=Ze(),Wz=ao(),T0=class{constructor(e){Object.defineProperty(this,xk.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(!xk.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=Wz.toJS(this,"",o);if(typeof i=="function")for(let{count:f,res:c}of o.anchors.values())i(c,f);return typeof s=="function"?Vz.applyReviver(s,{"":l},"",l):l}};Ek.NodeBase=T0});var id=H(Ik=>{"use strict";var zz=Mm(),Jz=ed(),wu=Ze(),Gz=Fm(),Yz=ao(),A0=class extends Gz.NodeBase{constructor(e){super(wu.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=[],Jz.visit(e,{Node:(s,o)=>{(wu.isAlias(o)||wu.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 f=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(f)}let l=n.get(o);if(l||(Yz.toJS(o,null,r),l=n.get(o)),l?.res===void 0){let f="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(f)}if(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=Dm(i,o,n)),l.count*l.aliasCount>s)){let f="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(f)}return l.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(zz.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 Dm(t,e,r){if(wu.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(wu.isCollection(e)){let n=0;for(let i of e.items){let s=Dm(t,i,r);s>n&&(n=s)}return n}else if(wu.isPair(e)){let n=Dm(t,e.key,r),i=Dm(t,e.value,r);return Math.max(n,i)}return 1}Ik.Alias=A0});var Wt=H($0=>{"use strict";var Kz=Ze(),Qz=Fm(),Zz=ao(),Xz=t=>!t||typeof t!="function"&&typeof t!="object",lo=class extends Qz.NodeBase{constructor(e){super(Kz.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:Zz.toJS(this.value,e,r)}toString(){return String(this.value)}};lo.BLOCK_FOLDED="BLOCK_FOLDED";lo.BLOCK_LITERAL="BLOCK_LITERAL";lo.PLAIN="PLAIN";lo.QUOTE_DOUBLE="QUOTE_DOUBLE";lo.QUOTE_SINGLE="QUOTE_SINGLE";$0.Scalar=lo;$0.isScalarValue=Xz});var sd=H(qk=>{"use strict";var eJ=id(),Aa=Ze(),Ok=Wt(),tJ="tag:yaml.org,2002:";function rJ(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 nJ(t,e,r){if(Aa.isDocument(t)&&(t=t.contents),Aa.isNode(t))return t;if(Aa.isPair(t)){let h=r.schema[Aa.MAP].createNode?.(r.schema,null,r);return h.items.push(t),h}(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,f;if(n&&t&&typeof t=="object"){if(f=l.get(t),f)return f.anchor??(f.anchor=i(t)),new eJ.Alias(f.anchor);f={anchor:null,node:null},l.set(t,f)}e?.startsWith("!!")&&(e=tJ+e.slice(2));let c=rJ(t,e,o.tags);if(!c){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let h=new Ok.Scalar(t);return f&&(f.node=h),h}c=t instanceof Map?o[Aa.MAP]:Symbol.iterator in Object(t)?o[Aa.SEQ]:o[Aa.MAP]}s&&(s(c),delete r.onTagObj);let p=c?.createNode?c.createNode(r.schema,t,r):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(r.schema,t,r):new Ok.Scalar(t);return e?p.tag=e:c.default||(p.tag=c.tag),f&&(f.node=p),p}qk.createNode=nJ});var jm=H(Lm=>{"use strict";var iJ=sd(),Ti=Ze(),sJ=Fm();function N0(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 iJ.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 kk=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,M0=class extends sJ.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=>Ti.isNode(n)||Ti.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(kk(e))this.add(r);else{let[n,...i]=e,s=this.get(n,!0);if(Ti.isCollection(s))s.addIn(i,r);else if(s===void 0&&this.schema)this.set(n,N0(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(Ti.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&&Ti.isScalar(s)?s.value:s:Ti.isCollection(s)?s.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!Ti.isPair(r))return!1;let n=r.value;return n==null||e&&Ti.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 Ti.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(Ti.isCollection(s))s.setIn(i,r);else if(s===void 0&&this.schema)this.set(n,N0(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};Lm.Collection=M0;Lm.collectionFromPath=N0;Lm.isEmptyPath=kk});var od=H(Um=>{"use strict";var oJ=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function F0(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var aJ=(t,e,r)=>t.endsWith(`
97
97
  `)?F0(r,e):r.includes(`
98
98
  `)?`
99
99
  `+F0(r,e):(t.endsWith(" ")?"":" ")+r;Um.indentComment=F0;Um.lineComment=aJ;Um.stringifyComment=oJ});var Tk=H(ad=>{"use strict";var lJ="flow",D0="block",Hm="quoted";function uJ(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 f=Math.max(1+s,1+i-e.length);if(t.length<=f)return t;let c=[],p={},h=i-e.length;typeof n=="number"&&(n>i-Math.max(2,s)?c.push(0):h=i-n);let g,v,_=!1,w=-1,E=-1,k=-1;r===D0&&(w=Pk(t,w,e.length),w!==-1&&(h=w+f));for(let N;N=t[w+=1];){if(r===Hm&&N==="\\"){switch(E=w,t[w+1]){case"x":w+=3;break;case"u":w+=5;break;case"U":w+=9;break;default:w+=1}k=w}if(N===`
@@ -102,13 +102,13 @@ fragment TypeRef on __Type {
102
102
  `&&$!==" "&&(g=w)}if(w>=h)if(g)c.push(g),h=g+f,g=void 0;else if(r===Hm){for(;v===" "||v===" ";)v=N,N=t[w+=1],_=!0;let $=w>k+1?w-2:E-1;if(p[$])return t;c.push($),p[$]=!0,h=$+f,g=void 0}else _=!0}v=N}if(_&&l&&l(),c.length===0)return t;o&&o();let T=t.slice(0,c[0]);for(let N=0;N<c.length;++N){let $=c[N],j=c[N+1]||t.length;$===0?T=`
103
103
  ${e}${t.slice(0,j)}`:(r===Hm&&p[$]&&(T+=`${t[$]}\\`),T+=`
104
104
  ${e}${t.slice($+1,j)}`)}return T}function Pk(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!==`
105
- `);n=e,i=e+1,s=t[i]}return n}ad.FOLD_BLOCK=D0;ad.FOLD_FLOW=lJ;ad.FOLD_QUOTED=Hm;ad.foldFlowLines=uJ});var ud=H(Ak=>{"use strict";var ii=Bt(),lo=Tk(),Vm=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Wm=t=>/^(%|---|\.\.\.)/m.test(t);function cJ(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]===`
105
+ `);n=e,i=e+1,s=t[i]}return n}ad.FOLD_BLOCK=D0;ad.FOLD_FLOW=lJ;ad.FOLD_QUOTED=Hm;ad.foldFlowLines=uJ});var ud=H(Ak=>{"use strict";var ii=Wt(),uo=Tk(),Vm=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Wm=t=>/^(%|---|\.\.\.)/m.test(t);function cJ(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]===`
106
106
  `){if(s-o>n)return!0;if(o=s+1,i-o<=n)return!1}return!0}function ld(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(Wm(t)?" ":""),o="",l=0;for(let f=0,c=r[f];c;c=r[++f])if(c===" "&&r[f+1]==="\\"&&r[f+2]==="n"&&(o+=r.slice(l,f)+"\\ ",f+=1,l=f,c="\\"),c==="\\")switch(r[f+1]){case"u":{o+=r.slice(l,f);let p=r.substr(f+2,4);switch(p){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:p.substr(0,2)==="00"?o+="\\x"+p.substr(2):o+=r.substr(f,6)}f+=5,l=f+1}break;case"n":if(n||r[f+2]==='"'||r.length<i)f+=1;else{for(o+=r.slice(l,f)+`
107
107
 
108
108
  `;r[f+2]==="\\"&&r[f+3]==="n"&&r[f+4]!=='"';)o+=`
109
- `,f+=2;o+=s,r[f+2]===" "&&(o+="\\"),f+=1,l=f+1}break;default:f+=1}return o=l?o+r.slice(l):r,n?o:lo.foldFlowLines(o,s,lo.FOLD_QUOTED,Vm(e,!1))}function L0(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
109
+ `,f+=2;o+=s,r[f+2]===" "&&(o+="\\"),f+=1,l=f+1}break;default:f+=1}return o=l?o+r.slice(l):r,n?o:uo.foldFlowLines(o,s,uo.FOLD_QUOTED,Vm(e,!1))}function L0(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
110
110
  `)||/[ \t]\n|\n[ \t]/.test(t))return ld(t,e);let r=e.indent||(Wm(t)?" ":""),n="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
111
- ${r}`)+"'";return e.implicitKey?n:lo.foldFlowLines(n,r,lo.FOLD_FLOW,Vm(e,!1))}function _u(t,e){let{singleQuote:r}=e.options,n;if(r===!1)n=ld;else{let i=t.includes('"'),s=t.includes("'");i&&!s?n=L0:s&&!i?n=ld:n=r?L0:ld}return n(t,e)}var j0;try{j0=new RegExp(`(^|(?<!
111
+ ${r}`)+"'";return e.implicitKey?n:uo.foldFlowLines(n,r,uo.FOLD_FLOW,Vm(e,!1))}function _u(t,e){let{singleQuote:r}=e.options,n;if(r===!1)n=ld;else{let i=t.includes('"'),s=t.includes("'");i&&!s?n=L0:s&&!i?n=ld:n=r?L0:ld}return n(t,e)}var j0;try{j0=new RegExp(`(^|(?<!
112
112
  ))
113
113
  +(?!
114
114
  |$)`,"g")}catch{j0=/\n+(?!\n|$)/g}function Bm({comment:t,type:e,value:r},n,i,s){let{blockQuote:o,commentString:l,lineWidth:f}=n.options;if(!o||/\n[\t ]+$/.test(r))return _u(r,n);let c=n.indent||(n.forceBlockIndent||Wm(r)?" ":""),p=o==="literal"?!0:o==="folded"||e===ii.Scalar.BLOCK_FOLDED?!1:e===ii.Scalar.BLOCK_LITERAL?!0:!cJ(r,f,c.length);if(!r)return p?`|
@@ -118,14 +118,14 @@ ${r}`)+"'";return e.implicitKey?n:lo.foldFlowLines(n,r,lo.FOLD_FLOW,Vm(e,!1))}fu
118
118
  `);_===-1?h="-":r===v||_!==v.length-1?(h="+",s&&s()):h="",v&&(r=r.slice(0,-v.length),v[v.length-1]===`
119
119
  `&&(v=v.slice(0,-1)),v=v.replace(j0,`$&${c}`));let w=!1,E,k=-1;for(E=0;E<r.length;++E){let j=r[E];if(j===" ")w=!0;else if(j===`
120
120
  `)k=E;else break}let T=r.substring(0,k<E?k+1:E);T&&(r=r.substring(T.length),T=T.replace(/\n+/g,`$&${c}`));let $=(w?c?"2":"1":"")+h;if(t&&($+=" "+l(t.replace(/ ?[\r\n]+/g," ")),i&&i()),!p){let j=r.replace(/\n+/g,`
121
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),G=!1,q=Vm(n,!0);o!=="folded"&&e!==ii.Scalar.BLOCK_FOLDED&&(q.onOverflow=()=>{G=!0});let C=lo.foldFlowLines(`${T}${j}${v}`,c,lo.FOLD_BLOCK,q);if(!G)return`>${$}
121
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),G=!1,q=Vm(n,!0);o!=="folded"&&e!==ii.Scalar.BLOCK_FOLDED&&(q.onOverflow=()=>{G=!0});let C=uo.foldFlowLines(`${T}${j}${v}`,c,uo.FOLD_BLOCK,q);if(!G)return`>${$}
122
122
  ${c}${C}`}return r=r.replace(/\n+/g,`$&${c}`),`|${$}
123
123
  ${c}${T}${r}${v}`}function fJ(t,e,r,n){let{type:i,value:s}=t,{actualString:o,implicitKey:l,indent:f,indentStep:c,inFlow:p}=e;if(l&&s.includes(`
124
124
  `)||p&&/[[\]{},]/.test(s))return _u(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||p||!s.includes(`
125
125
  `)?_u(s,e):Bm(t,e,r,n);if(!l&&!p&&i!==ii.Scalar.PLAIN&&s.includes(`
126
126
  `))return Bm(t,e,r,n);if(Wm(s)){if(f==="")return e.forceBlockIndent=!0,Bm(t,e,r,n);if(l&&f===c)return _u(s,e)}let h=s.replace(/\n+/g,`$&
127
- ${f}`);if(o){let g=w=>w.default&&w.tag!=="tag:yaml.org,2002:str"&&w.test?.test(h),{compat:v,tags:_}=e.doc.schema;if(_.some(g)||v?.some(g))return _u(s,e)}return l?h:lo.foldFlowLines(h,f,lo.FOLD_FLOW,Vm(e,!1))}function dJ(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!==ii.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=ii.Scalar.QUOTE_DOUBLE);let f=p=>{switch(p){case ii.Scalar.BLOCK_FOLDED:case ii.Scalar.BLOCK_LITERAL:return i||s?_u(o.value,e):Bm(o,e,r,n);case ii.Scalar.QUOTE_DOUBLE:return ld(o.value,e);case ii.Scalar.QUOTE_SINGLE:return L0(o.value,e);case ii.Scalar.PLAIN:return fJ(o,e,r,n);default:return null}},c=f(l);if(c===null){let{defaultKeyType:p,defaultStringType:h}=e.options,g=i&&p||h;if(c=f(g),c===null)throw new Error(`Unsupported default string type ${g}`)}return c}Ak.stringifyString=dJ});var cd=H(U0=>{"use strict";var pJ=Mm(),uo=Ze(),hJ=od(),mJ=ud();function gJ(t,e){let r=Object.assign({blockQuote:!0,commentString:hJ.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 yJ(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(uo.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 vJ(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],s=(uo.isScalar(t)||uo.isCollection(t))&&t.anchor;s&&pJ.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 bJ(t,e,r,n){if(uo.isPair(t))return t.toString(e,r,n);if(uo.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=uo.isNode(t)?t:e.doc.createNode(t,{onTagObj:f=>i=f});i??(i=yJ(e.doc.schema.tags,s));let o=vJ(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):uo.isScalar(s)?mJ.stringifyString(s,e,r,n):s.toString(e,r,n);return o?uo.isScalar(s)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}
128
- ${e.indent}${l}`:l}U0.createStringifyContext=gJ;U0.stringify=bJ});var Fk=H(Mk=>{"use strict";var ds=Ze(),$k=Bt(),Nk=cd(),fd=od();function SJ({key:t,value:e},r,n,i){let{allNullValues:s,doc:o,indent:l,indentStep:f,options:{commentString:c,indentSeq:p,simpleKeys:h}}=r,g=ds.isNode(t)&&t.comment||null;if(h){if(g)throw new Error("With simple keys, key nodes cannot have comments");if(ds.isCollection(t)||!ds.isNode(t)&&typeof t=="object"){let q="With simple keys, collection cannot be used as a key value";throw new Error(q)}}let v=!h&&(!t||g&&e==null&&!r.inFlow||ds.isCollection(t)||(ds.isScalar(t)?t.type===$k.Scalar.BLOCK_FOLDED||t.type===$k.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!v&&(h||!s),indent:l+f});let _=!1,w=!1,E=Nk.stringify(t,r,()=>_=!0,()=>w=!0);if(!v&&!r.inFlow&&E.length>1024){if(h)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(r.inFlow){if(s||e==null)return _&&n&&n(),E===""?"?":v?`? ${E}`:E}else if(s&&!h||e==null&&v)return E=`? ${E}`,g&&!_?E+=fd.lineComment(E,r.indent,c(g)):w&&i&&i(),E;_&&(g=null),v?(g&&(E+=fd.lineComment(E,r.indent,c(g))),E=`? ${E}
127
+ ${f}`);if(o){let g=w=>w.default&&w.tag!=="tag:yaml.org,2002:str"&&w.test?.test(h),{compat:v,tags:_}=e.doc.schema;if(_.some(g)||v?.some(g))return _u(s,e)}return l?h:uo.foldFlowLines(h,f,uo.FOLD_FLOW,Vm(e,!1))}function dJ(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!==ii.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=ii.Scalar.QUOTE_DOUBLE);let f=p=>{switch(p){case ii.Scalar.BLOCK_FOLDED:case ii.Scalar.BLOCK_LITERAL:return i||s?_u(o.value,e):Bm(o,e,r,n);case ii.Scalar.QUOTE_DOUBLE:return ld(o.value,e);case ii.Scalar.QUOTE_SINGLE:return L0(o.value,e);case ii.Scalar.PLAIN:return fJ(o,e,r,n);default:return null}},c=f(l);if(c===null){let{defaultKeyType:p,defaultStringType:h}=e.options,g=i&&p||h;if(c=f(g),c===null)throw new Error(`Unsupported default string type ${g}`)}return c}Ak.stringifyString=dJ});var cd=H(U0=>{"use strict";var pJ=Mm(),co=Ze(),hJ=od(),mJ=ud();function gJ(t,e){let r=Object.assign({blockQuote:!0,commentString:hJ.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 yJ(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(co.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 vJ(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],s=(co.isScalar(t)||co.isCollection(t))&&t.anchor;s&&pJ.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 bJ(t,e,r,n){if(co.isPair(t))return t.toString(e,r,n);if(co.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=co.isNode(t)?t:e.doc.createNode(t,{onTagObj:f=>i=f});i??(i=yJ(e.doc.schema.tags,s));let o=vJ(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):co.isScalar(s)?mJ.stringifyString(s,e,r,n):s.toString(e,r,n);return o?co.isScalar(s)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}
128
+ ${e.indent}${l}`:l}U0.createStringifyContext=gJ;U0.stringify=bJ});var Fk=H(Mk=>{"use strict";var ds=Ze(),$k=Wt(),Nk=cd(),fd=od();function SJ({key:t,value:e},r,n,i){let{allNullValues:s,doc:o,indent:l,indentStep:f,options:{commentString:c,indentSeq:p,simpleKeys:h}}=r,g=ds.isNode(t)&&t.comment||null;if(h){if(g)throw new Error("With simple keys, key nodes cannot have comments");if(ds.isCollection(t)||!ds.isNode(t)&&typeof t=="object"){let q="With simple keys, collection cannot be used as a key value";throw new Error(q)}}let v=!h&&(!t||g&&e==null&&!r.inFlow||ds.isCollection(t)||(ds.isScalar(t)?t.type===$k.Scalar.BLOCK_FOLDED||t.type===$k.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!v&&(h||!s),indent:l+f});let _=!1,w=!1,E=Nk.stringify(t,r,()=>_=!0,()=>w=!0);if(!v&&!r.inFlow&&E.length>1024){if(h)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(r.inFlow){if(s||e==null)return _&&n&&n(),E===""?"?":v?`? ${E}`:E}else if(s&&!h||e==null&&v)return E=`? ${E}`,g&&!_?E+=fd.lineComment(E,r.indent,c(g)):w&&i&&i(),E;_&&(g=null),v?(g&&(E+=fd.lineComment(E,r.indent,c(g))),E=`? ${E}
129
129
  ${l}:`):(E=`${E}:`,g&&(E+=fd.lineComment(E,r.indent,c(g))));let k,T,N;ds.isNode(e)?(k=!!e.spaceBefore,T=e.commentBefore,N=e.comment):(k=!1,T=null,N=null,e&&typeof e=="object"&&(e=o.createNode(e))),r.implicitKey=!1,!v&&!g&&ds.isScalar(e)&&(r.indentAtStart=E.length+1),w=!1,!p&&f.length>=2&&!r.inFlow&&!v&&ds.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let $=!1,j=Nk.stringify(e,r,()=>$=!0,()=>w=!0),G=" ";if(g||k||T){if(G=k?`
130
130
  `:"",T){let q=c(T);G+=`
131
131
  ${fd.indentComment(q,r.indent)}`}j===""&&!r.inFlow?G===`
@@ -135,32 +135,32 @@ ${fd.indentComment(q,r.indent)}`}j===""&&!r.inFlow?G===`
135
135
  ${r.indent}`}else if(!v&&ds.isCollection(e)){let q=j[0],C=j.indexOf(`
136
136
  `),A=C!==-1,D=r.inFlow??e.flow??e.items.length===0;if(A||!D){let B=!1;if(A&&(q==="&"||q==="!")){let F=j.indexOf(" ");q==="&"&&F!==-1&&F<C&&j[F+1]==="!"&&(F=j.indexOf(" ",F+1)),(F===-1||C<F)&&(B=!0)}B||(G=`
137
137
  ${r.indent}`)}}else(j===""||j[0]===`
138
- `)&&(G="");return E+=G+j,r.inFlow?$&&n&&n():N&&!$?E+=fd.lineComment(E,r.indent,c(N)):w&&i&&i(),E}Mk.stringifyPair=SJ});var B0=H(H0=>{"use strict";var Dk=ft("process");function wJ(t,...e){t==="debug"&&console.log(...e)}function _J(t,e){(t==="debug"||t==="warn")&&(typeof Dk.emitWarning=="function"?Dk.emitWarning(e):console.warn(e))}H0.debug=wJ;H0.warn=_J});var Km=H(Ym=>{"use strict";var Gm=Ze(),Lk=Bt(),zm="<<",Jm={identify:t=>t===zm||typeof t=="symbol"&&t.description===zm,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Lk.Scalar(Symbol(zm)),{addToJSMap:jk}),stringify:()=>zm},RJ=(t,e)=>(Jm.identify(e)||Gm.isScalar(e)&&(!e.type||e.type===Lk.Scalar.PLAIN)&&Jm.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===Jm.tag&&r.default);function jk(t,e,r){let n=Uk(t,r);if(Gm.isSeq(n))for(let i of n.items)V0(t,e,i);else if(Array.isArray(n))for(let i of n)V0(t,e,i);else V0(t,e,n)}function V0(t,e,r){let n=Uk(t,r);if(!Gm.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 Uk(t,e){return t&&Gm.isAlias(e)?e.resolve(t.doc,t):e}Ym.addMergeToJSMap=jk;Ym.isMergeKey=RJ;Ym.merge=Jm});var z0=H(Vk=>{"use strict";var CJ=B0(),Hk=Km(),xJ=cd(),Bk=Ze(),W0=oo();function EJ(t,e,{key:r,value:n}){if(Bk.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(Hk.isMergeKey(t,r))Hk.addMergeToJSMap(t,e,n);else{let i=W0.toJS(r,"",t);if(e instanceof Map)e.set(i,W0.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let s=IJ(r,i,t),o=W0.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 IJ(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(Bk.isNode(t)&&r?.doc){let n=xJ.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)+'..."'),CJ.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)}Vk.addPairToJSMap=EJ});var co=H(J0=>{"use strict";var Wk=sd(),OJ=Fk(),qJ=z0(),Qm=Ze();function kJ(t,e,r){let n=Wk.createNode(t,void 0,r),i=Wk.createNode(e,void 0,r);return new Zm(n,i)}var Zm=class t{constructor(e,r=null){Object.defineProperty(this,Qm.NODE_TYPE,{value:Qm.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return Qm.isNode(r)&&(r=r.clone(e)),Qm.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return qJ.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?OJ.stringifyPair(this,e,r,n):JSON.stringify(this)}};J0.Pair=Zm;J0.createPair=kJ});var G0=H(Jk=>{"use strict";var $a=Ze(),zk=cd(),Xm=od();function PJ(t,e,r){return(e.inFlow??t.flow?AJ:TJ)(t,e,r)}function TJ({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:s,onChompKeep:o,onComment:l}){let{indent:f,options:{commentString:c}}=r,p=Object.assign({},r,{indent:s,type:null}),h=!1,g=[];for(let _=0;_<e.length;++_){let w=e[_],E=null;if($a.isNode(w))!h&&w.spaceBefore&&g.push(""),eg(r,g,w.commentBefore,h),w.comment&&(E=w.comment);else if($a.isPair(w)){let T=$a.isNode(w.key)?w.key:null;T&&(!h&&T.spaceBefore&&g.push(""),eg(r,g,T.commentBefore,h))}h=!1;let k=zk.stringify(w,p,()=>E=null,()=>h=!0);E&&(k+=Xm.lineComment(k,s,c(E))),h&&E&&(h=!1),g.push(n+k)}let v;if(g.length===0)v=i.start+i.end;else{v=g[0];for(let _=1;_<g.length;++_){let w=g[_];v+=w?`
138
+ `)&&(G="");return E+=G+j,r.inFlow?$&&n&&n():N&&!$?E+=fd.lineComment(E,r.indent,c(N)):w&&i&&i(),E}Mk.stringifyPair=SJ});var B0=H(H0=>{"use strict";var Dk=ft("process");function wJ(t,...e){t==="debug"&&console.log(...e)}function _J(t,e){(t==="debug"||t==="warn")&&(typeof Dk.emitWarning=="function"?Dk.emitWarning(e):console.warn(e))}H0.debug=wJ;H0.warn=_J});var Km=H(Ym=>{"use strict";var Gm=Ze(),Lk=Wt(),zm="<<",Jm={identify:t=>t===zm||typeof t=="symbol"&&t.description===zm,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Lk.Scalar(Symbol(zm)),{addToJSMap:jk}),stringify:()=>zm},RJ=(t,e)=>(Jm.identify(e)||Gm.isScalar(e)&&(!e.type||e.type===Lk.Scalar.PLAIN)&&Jm.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===Jm.tag&&r.default);function jk(t,e,r){let n=Uk(t,r);if(Gm.isSeq(n))for(let i of n.items)V0(t,e,i);else if(Array.isArray(n))for(let i of n)V0(t,e,i);else V0(t,e,n)}function V0(t,e,r){let n=Uk(t,r);if(!Gm.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 Uk(t,e){return t&&Gm.isAlias(e)?e.resolve(t.doc,t):e}Ym.addMergeToJSMap=jk;Ym.isMergeKey=RJ;Ym.merge=Jm});var z0=H(Vk=>{"use strict";var CJ=B0(),Hk=Km(),xJ=cd(),Bk=Ze(),W0=ao();function EJ(t,e,{key:r,value:n}){if(Bk.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(Hk.isMergeKey(t,r))Hk.addMergeToJSMap(t,e,n);else{let i=W0.toJS(r,"",t);if(e instanceof Map)e.set(i,W0.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let s=IJ(r,i,t),o=W0.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 IJ(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(Bk.isNode(t)&&r?.doc){let n=xJ.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)+'..."'),CJ.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)}Vk.addPairToJSMap=EJ});var fo=H(J0=>{"use strict";var Wk=sd(),OJ=Fk(),qJ=z0(),Qm=Ze();function kJ(t,e,r){let n=Wk.createNode(t,void 0,r),i=Wk.createNode(e,void 0,r);return new Zm(n,i)}var Zm=class t{constructor(e,r=null){Object.defineProperty(this,Qm.NODE_TYPE,{value:Qm.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return Qm.isNode(r)&&(r=r.clone(e)),Qm.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return qJ.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?OJ.stringifyPair(this,e,r,n):JSON.stringify(this)}};J0.Pair=Zm;J0.createPair=kJ});var G0=H(Jk=>{"use strict";var $a=Ze(),zk=cd(),Xm=od();function PJ(t,e,r){return(e.inFlow??t.flow?AJ:TJ)(t,e,r)}function TJ({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:s,onChompKeep:o,onComment:l}){let{indent:f,options:{commentString:c}}=r,p=Object.assign({},r,{indent:s,type:null}),h=!1,g=[];for(let _=0;_<e.length;++_){let w=e[_],E=null;if($a.isNode(w))!h&&w.spaceBefore&&g.push(""),eg(r,g,w.commentBefore,h),w.comment&&(E=w.comment);else if($a.isPair(w)){let T=$a.isNode(w.key)?w.key:null;T&&(!h&&T.spaceBefore&&g.push(""),eg(r,g,T.commentBefore,h))}h=!1;let k=zk.stringify(w,p,()=>E=null,()=>h=!0);E&&(k+=Xm.lineComment(k,s,c(E))),h&&E&&(h=!1),g.push(n+k)}let v;if(g.length===0)v=i.start+i.end;else{v=g[0];for(let _=1;_<g.length;++_){let w=g[_];v+=w?`
139
139
  ${f}${w}`:`
140
140
  `}}return t?(v+=`
141
141
  `+Xm.indentComment(c(t),f),l&&l()):h&&o&&o(),v}function AJ({items:t},e,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:s,flowCollectionPadding:o,options:{commentString:l}}=e;n+=s;let f=Object.assign({},e,{indent:n,inFlow:!0,type:null}),c=!1,p=0,h=[];for(let _=0;_<t.length;++_){let w=t[_],E=null;if($a.isNode(w))w.spaceBefore&&h.push(""),eg(e,h,w.commentBefore,!1),w.comment&&(E=w.comment);else if($a.isPair(w)){let T=$a.isNode(w.key)?w.key:null;T&&(T.spaceBefore&&h.push(""),eg(e,h,T.commentBefore,!1),T.comment&&(c=!0));let N=$a.isNode(w.value)?w.value:null;N?(N.comment&&(E=N.comment),N.commentBefore&&(c=!0)):w.value==null&&T?.comment&&(E=T.comment)}E&&(c=!0);let k=zk.stringify(w,f,()=>E=null);c||(c=h.length>p||k.includes(`
142
142
  `)),_<t.length-1?k+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=h.reduce((T,N)=>T+N.length+2,2)+(k.length+2)>e.options.lineWidth)),c&&(k+=",")),E&&(k+=Xm.lineComment(k,n,l(E))),h.push(k),p=h.length}let{start:g,end:v}=r;if(h.length===0)return g+v;if(!c){let _=h.reduce((w,E)=>w+E.length+2,2);c=e.options.lineWidth>0&&_>e.options.lineWidth}if(c){let _=g;for(let w of h)_+=w?`
143
143
  ${s}${i}${w}`:`
144
144
  `;return`${_}
145
- ${i}${v}`}else return`${g}${o}${h.join(" ")}${o}${v}`}function eg({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let s=Xm.indentComment(e(n),t);r.push(s.trimStart())}}Jk.stringifyCollection=PJ});var po=H(K0=>{"use strict";var $J=G0(),NJ=z0(),MJ=jm(),fo=Ze(),tg=co(),FJ=Bt();function dd(t,e){let r=fo.isScalar(e)?e.value:e;for(let n of t)if(fo.isPair(n)&&(n.key===e||n.key===r||fo.isScalar(n.key)&&n.key.value===r))return n}var Y0=class extends MJ.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(fo.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:s}=n,o=new this(e),l=(f,c)=>{if(typeof s=="function")c=s.call(r,f,c);else if(Array.isArray(s)&&!s.includes(f))return;(c!==void 0||i)&&o.items.push(tg.createPair(f,c,n))};if(r instanceof Map)for(let[f,c]of r)l(f,c);else if(r&&typeof r=="object")for(let f of Object.keys(r))l(f,r[f]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,r){let n;fo.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new tg.Pair(e,e?.value):n=new tg.Pair(e.key,e.value);let i=dd(this.items,n.key),s=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);fo.isScalar(i.value)&&FJ.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=dd(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=dd(this.items,e)?.value;return(!r&&fo.isScalar(i)?i.value:i)??void 0}has(e){return!!dd(this.items,e)}set(e,r){this.add(new tg.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)NJ.addPairToJSMap(r,i,s);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!fo.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})),$J.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};K0.YAMLMap=Y0;K0.findPair=dd});var Ru=H(Yk=>{"use strict";var DJ=Ze(),Gk=po(),LJ={collection:"map",default:!0,nodeClass:Gk.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return DJ.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>Gk.YAMLMap.from(t,e,r)};Yk.map=LJ});var ho=H(Kk=>{"use strict";var jJ=sd(),UJ=G0(),HJ=jm(),ng=Ze(),BJ=Bt(),VJ=oo(),Q0=class extends HJ.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(ng.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=rg(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=rg(e);if(typeof n!="number")return;let i=this.items[n];return!r&&ng.isScalar(i)?i.value:i}has(e){let r=rg(e);return typeof r=="number"&&r<this.items.length}set(e,r){let n=rg(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];ng.isScalar(i)&&BJ.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(VJ.toJS(s,String(i++),r));return n}toString(e,r,n){return e?UJ.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 f=r instanceof Set?l:String(o++);l=i.call(r,f,l)}s.items.push(jJ.createNode(l,void 0,n))}}return s}};function rg(t){let e=ng.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}Kk.YAMLSeq=Q0});var Cu=H(Zk=>{"use strict";var WJ=Ze(),Qk=ho(),zJ={collection:"seq",default:!0,nodeClass:Qk.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return WJ.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>Qk.YAMLSeq.from(t,e,r)};Zk.seq=zJ});var pd=H(Xk=>{"use strict";var JJ=ud(),GJ={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),JJ.stringifyString(t,e,r,n)}};Xk.string=GJ});var ig=H(rP=>{"use strict";var eP=Bt(),tP={identify:t=>t==null,createNode:()=>new eP.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new eP.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&tP.test.test(t)?t:e.options.nullStr};rP.nullTag=tP});var Z0=H(iP=>{"use strict";var YJ=Bt(),nP={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new YJ.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&nP.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};iP.boolTag=nP});var xu=H(sP=>{"use strict";function KJ({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}sP.stringifyNumber=KJ});var e_=H(sg=>{"use strict";var QJ=Bt(),X0=xu(),ZJ={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:X0.stringifyNumber},XJ={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():X0.stringifyNumber(t)}},eG={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 QJ.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:X0.stringifyNumber};sg.float=eG;sg.floatExp=XJ;sg.floatNaN=ZJ});var r_=H(ag=>{"use strict";var oP=xu(),og=t=>typeof t=="bigint"||Number.isInteger(t),t_=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function aP(t,e,r){let{value:n}=t;return og(n)&&n>=0?r+n.toString(e):oP.stringifyNumber(t)}var tG={identify:t=>og(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>t_(t,2,8,r),stringify:t=>aP(t,8,"0o")},rG={identify:og,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>t_(t,0,10,r),stringify:oP.stringifyNumber},nG={identify:t=>og(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>t_(t,2,16,r),stringify:t=>aP(t,16,"0x")};ag.int=rG;ag.intHex=nG;ag.intOct=tG});var uP=H(lP=>{"use strict";var iG=Ru(),sG=ig(),oG=Cu(),aG=pd(),lG=Z0(),n_=e_(),i_=r_(),uG=[iG.map,oG.seq,aG.string,sG.nullTag,lG.boolTag,i_.intOct,i_.int,i_.intHex,n_.floatNaN,n_.floatExp,n_.float];lP.schema=uG});var dP=H(fP=>{"use strict";var cG=Bt(),fG=Ru(),dG=Cu();function cP(t){return typeof t=="bigint"||Number.isInteger(t)}var lg=({value:t})=>JSON.stringify(t),pG=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:lg},{identify:t=>t==null,createNode:()=>new cG.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:lg},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:lg},{identify:cP,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})=>cP(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:lg}],hG={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},mG=[fG.map,dG.seq].concat(pG,hG);fP.schema=mG});var o_=H(pP=>{"use strict";var hd=ft("buffer"),s_=Bt(),gG=ud(),yG={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof hd.Buffer=="function")return hd.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 hd.Buffer=="function")l=o instanceof hd.Buffer?o.toString("base64"):hd.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let f="";for(let c=0;c<o.length;++c)f+=String.fromCharCode(o[c]);l=btoa(f)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=s_.Scalar.BLOCK_LITERAL),e!==s_.Scalar.QUOTE_DOUBLE){let f=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),c=Math.ceil(l.length/f),p=new Array(c);for(let h=0,g=0;h<c;++h,g+=f)p[h]=l.substr(g,f);l=p.join(e===s_.Scalar.BLOCK_LITERAL?`
146
- `:" ")}return gG.stringifyString({comment:t,type:e,value:l},n,i,s)}};pP.binary=yG});var fg=H(cg=>{"use strict";var ug=Ze(),a_=co(),vG=Bt(),bG=ho();function hP(t,e){if(ug.isSeq(t))for(let r=0;r<t.items.length;++r){let n=t.items[r];if(!ug.isPair(n)){if(ug.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new a_.Pair(new vG.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
145
+ ${i}${v}`}else return`${g}${o}${h.join(" ")}${o}${v}`}function eg({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let s=Xm.indentComment(e(n),t);r.push(s.trimStart())}}Jk.stringifyCollection=PJ});var ho=H(K0=>{"use strict";var $J=G0(),NJ=z0(),MJ=jm(),po=Ze(),tg=fo(),FJ=Wt();function dd(t,e){let r=po.isScalar(e)?e.value:e;for(let n of t)if(po.isPair(n)&&(n.key===e||n.key===r||po.isScalar(n.key)&&n.key.value===r))return n}var Y0=class extends MJ.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(po.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:s}=n,o=new this(e),l=(f,c)=>{if(typeof s=="function")c=s.call(r,f,c);else if(Array.isArray(s)&&!s.includes(f))return;(c!==void 0||i)&&o.items.push(tg.createPair(f,c,n))};if(r instanceof Map)for(let[f,c]of r)l(f,c);else if(r&&typeof r=="object")for(let f of Object.keys(r))l(f,r[f]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,r){let n;po.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new tg.Pair(e,e?.value):n=new tg.Pair(e.key,e.value);let i=dd(this.items,n.key),s=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);po.isScalar(i.value)&&FJ.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=dd(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=dd(this.items,e)?.value;return(!r&&po.isScalar(i)?i.value:i)??void 0}has(e){return!!dd(this.items,e)}set(e,r){this.add(new tg.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)NJ.addPairToJSMap(r,i,s);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!po.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})),$J.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};K0.YAMLMap=Y0;K0.findPair=dd});var Ru=H(Yk=>{"use strict";var DJ=Ze(),Gk=ho(),LJ={collection:"map",default:!0,nodeClass:Gk.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return DJ.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>Gk.YAMLMap.from(t,e,r)};Yk.map=LJ});var mo=H(Kk=>{"use strict";var jJ=sd(),UJ=G0(),HJ=jm(),ng=Ze(),BJ=Wt(),VJ=ao(),Q0=class extends HJ.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(ng.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=rg(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=rg(e);if(typeof n!="number")return;let i=this.items[n];return!r&&ng.isScalar(i)?i.value:i}has(e){let r=rg(e);return typeof r=="number"&&r<this.items.length}set(e,r){let n=rg(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];ng.isScalar(i)&&BJ.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(VJ.toJS(s,String(i++),r));return n}toString(e,r,n){return e?UJ.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 f=r instanceof Set?l:String(o++);l=i.call(r,f,l)}s.items.push(jJ.createNode(l,void 0,n))}}return s}};function rg(t){let e=ng.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}Kk.YAMLSeq=Q0});var Cu=H(Zk=>{"use strict";var WJ=Ze(),Qk=mo(),zJ={collection:"seq",default:!0,nodeClass:Qk.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return WJ.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>Qk.YAMLSeq.from(t,e,r)};Zk.seq=zJ});var pd=H(Xk=>{"use strict";var JJ=ud(),GJ={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),JJ.stringifyString(t,e,r,n)}};Xk.string=GJ});var ig=H(rP=>{"use strict";var eP=Wt(),tP={identify:t=>t==null,createNode:()=>new eP.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new eP.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&tP.test.test(t)?t:e.options.nullStr};rP.nullTag=tP});var Z0=H(iP=>{"use strict";var YJ=Wt(),nP={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new YJ.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&nP.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};iP.boolTag=nP});var xu=H(sP=>{"use strict";function KJ({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}sP.stringifyNumber=KJ});var e_=H(sg=>{"use strict";var QJ=Wt(),X0=xu(),ZJ={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:X0.stringifyNumber},XJ={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():X0.stringifyNumber(t)}},eG={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 QJ.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:X0.stringifyNumber};sg.float=eG;sg.floatExp=XJ;sg.floatNaN=ZJ});var r_=H(ag=>{"use strict";var oP=xu(),og=t=>typeof t=="bigint"||Number.isInteger(t),t_=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function aP(t,e,r){let{value:n}=t;return og(n)&&n>=0?r+n.toString(e):oP.stringifyNumber(t)}var tG={identify:t=>og(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>t_(t,2,8,r),stringify:t=>aP(t,8,"0o")},rG={identify:og,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>t_(t,0,10,r),stringify:oP.stringifyNumber},nG={identify:t=>og(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>t_(t,2,16,r),stringify:t=>aP(t,16,"0x")};ag.int=rG;ag.intHex=nG;ag.intOct=tG});var uP=H(lP=>{"use strict";var iG=Ru(),sG=ig(),oG=Cu(),aG=pd(),lG=Z0(),n_=e_(),i_=r_(),uG=[iG.map,oG.seq,aG.string,sG.nullTag,lG.boolTag,i_.intOct,i_.int,i_.intHex,n_.floatNaN,n_.floatExp,n_.float];lP.schema=uG});var dP=H(fP=>{"use strict";var cG=Wt(),fG=Ru(),dG=Cu();function cP(t){return typeof t=="bigint"||Number.isInteger(t)}var lg=({value:t})=>JSON.stringify(t),pG=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:lg},{identify:t=>t==null,createNode:()=>new cG.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:lg},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:lg},{identify:cP,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})=>cP(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:lg}],hG={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},mG=[fG.map,dG.seq].concat(pG,hG);fP.schema=mG});var o_=H(pP=>{"use strict";var hd=ft("buffer"),s_=Wt(),gG=ud(),yG={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof hd.Buffer=="function")return hd.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 hd.Buffer=="function")l=o instanceof hd.Buffer?o.toString("base64"):hd.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let f="";for(let c=0;c<o.length;++c)f+=String.fromCharCode(o[c]);l=btoa(f)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=s_.Scalar.BLOCK_LITERAL),e!==s_.Scalar.QUOTE_DOUBLE){let f=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),c=Math.ceil(l.length/f),p=new Array(c);for(let h=0,g=0;h<c;++h,g+=f)p[h]=l.substr(g,f);l=p.join(e===s_.Scalar.BLOCK_LITERAL?`
146
+ `:" ")}return gG.stringifyString({comment:t,type:e,value:l},n,i,s)}};pP.binary=yG});var fg=H(cg=>{"use strict";var ug=Ze(),a_=fo(),vG=Wt(),bG=mo();function hP(t,e){if(ug.isSeq(t))for(let r=0;r<t.items.length;++r){let n=t.items[r];if(!ug.isPair(n)){if(ug.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new a_.Pair(new vG.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
147
147
  ${i.key.commentBefore}`:n.commentBefore),n.comment){let s=i.value??i.key;s.comment=s.comment?`${n.comment}
148
- ${s.comment}`:n.comment}n=i}t.items[r]=ug.isPair(n)?n:new a_.Pair(n)}}else e("Expected a sequence for this tag");return t}function mP(t,e,r){let{replacer:n}=r,i=new bG.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,f;if(Array.isArray(o))if(o.length===2)l=o[0],f=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)l=c[0],f=o[l];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else l=o;i.items.push(a_.createPair(l,f,r))}return i}var SG={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:hP,createNode:mP};cg.createPairs=mP;cg.pairs=SG;cg.resolvePairs=hP});var c_=H(u_=>{"use strict";var gP=Ze(),l_=oo(),md=po(),wG=ho(),yP=fg(),Na=class t extends wG.YAMLSeq{constructor(){super(),this.add=md.YAMLMap.prototype.add.bind(this),this.delete=md.YAMLMap.prototype.delete.bind(this),this.get=md.YAMLMap.prototype.get.bind(this),this.has=md.YAMLMap.prototype.has.bind(this),this.set=md.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(gP.isPair(i)?(s=l_.toJS(i.key,"",r),o=l_.toJS(i.value,s,r)):s=l_.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=yP.createPairs(e,r,n),s=new this;return s.items=i.items,s}};Na.tag="tag:yaml.org,2002:omap";var _G={collection:"seq",identify:t=>t instanceof Map,nodeClass:Na,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=yP.resolvePairs(t,e),n=[];for(let{key:i}of r.items)gP.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new Na,r)},createNode:(t,e,r)=>Na.from(t,e,r)};u_.YAMLOMap=Na;u_.omap=_G});var _P=H(f_=>{"use strict";var vP=Bt();function bP({value:t,source:e},r){return e&&(t?SP:wP).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var SP={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 vP.Scalar(!0),stringify:bP},wP={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 vP.Scalar(!1),stringify:bP};f_.falseTag=wP;f_.trueTag=SP});var RP=H(dg=>{"use strict";var RG=Bt(),d_=xu(),CG={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:d_.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.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():d_.stringifyNumber(t)}},EG={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 RG.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:d_.stringifyNumber};dg.float=EG;dg.floatExp=xG;dg.floatNaN=CG});var xP=H(yd=>{"use strict";var CP=xu(),gd=t=>typeof t=="bigint"||Number.isInteger(t);function pg(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 p_(t,e,r){let{value:n}=t;if(gd(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return CP.stringifyNumber(t)}var IG={identify:gd,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>pg(t,2,2,r),stringify:t=>p_(t,2,"0b")},OG={identify:gd,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>pg(t,1,8,r),stringify:t=>p_(t,8,"0")},qG={identify:gd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>pg(t,0,10,r),stringify:CP.stringifyNumber},kG={identify:gd,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>pg(t,2,16,r),stringify:t=>p_(t,16,"0x")};yd.int=qG;yd.intBin=IG;yd.intHex=kG;yd.intOct=OG});var m_=H(h_=>{"use strict";var gg=Ze(),hg=co(),mg=po(),Ma=class t extends mg.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;gg.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new hg.Pair(e.key,null):r=new hg.Pair(e,null),mg.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=mg.findPair(this.items,e);return!r&&gg.isPair(n)?gg.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=mg.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new hg.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(hg.createPair(o,null,n));return s}};Ma.tag="tag:yaml.org,2002:set";var PG={collection:"map",identify:t=>t instanceof Set,nodeClass:Ma,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>Ma.from(t,e,r),resolve(t,e){if(gg.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Ma,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};h_.YAMLSet=Ma;h_.set=PG});var y_=H(yg=>{"use strict";var TG=xu();function g_(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 EP(t){let{value:e}=t,r=o=>o;if(typeof e=="bigint")r=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return TG.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 AG={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})=>g_(t,r),stringify:EP},$G={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=>g_(t,!1),stringify:EP},IP={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(IP.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),f=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(r,n-1,i,s||0,o||0,l||0,f),p=e[8];if(p&&p!=="Z"){let h=g_(p,!1);Math.abs(h)<30&&(h*=60),c-=6e4*h}return new Date(c)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};yg.floatTime=$G;yg.intTime=AG;yg.timestamp=IP});var kP=H(qP=>{"use strict";var NG=Ru(),MG=ig(),FG=Cu(),DG=pd(),LG=o_(),OP=_P(),v_=RP(),vg=xP(),jG=Km(),UG=c_(),HG=fg(),BG=m_(),b_=y_(),VG=[NG.map,FG.seq,DG.string,MG.nullTag,OP.trueTag,OP.falseTag,vg.intBin,vg.intOct,vg.int,vg.intHex,v_.floatNaN,v_.floatExp,v_.float,LG.binary,jG.merge,UG.omap,HG.pairs,BG.set,b_.intTime,b_.floatTime,b_.timestamp];qP.schema=VG});var jP=H(__=>{"use strict";var $P=Ru(),WG=ig(),NP=Cu(),zG=pd(),JG=Z0(),S_=e_(),w_=r_(),GG=uP(),YG=dP(),MP=o_(),vd=Km(),FP=c_(),DP=fg(),PP=kP(),LP=m_(),bg=y_(),TP=new Map([["core",GG.schema],["failsafe",[$P.map,NP.seq,zG.string]],["json",YG.schema],["yaml11",PP.schema],["yaml-1.1",PP.schema]]),AP={binary:MP.binary,bool:JG.boolTag,float:S_.float,floatExp:S_.floatExp,floatNaN:S_.floatNaN,floatTime:bg.floatTime,int:w_.int,intHex:w_.intHex,intOct:w_.intOct,intTime:bg.intTime,map:$P.map,merge:vd.merge,null:WG.nullTag,omap:FP.omap,pairs:DP.pairs,seq:NP.seq,set:LP.set,timestamp:bg.timestamp},KG={"tag:yaml.org,2002:binary":MP.binary,"tag:yaml.org,2002:merge":vd.merge,"tag:yaml.org,2002:omap":FP.omap,"tag:yaml.org,2002:pairs":DP.pairs,"tag:yaml.org,2002:set":LP.set,"tag:yaml.org,2002:timestamp":bg.timestamp};function QG(t,e,r){let n=TP.get(e);if(n&&!t)return r&&!n.includes(vd.merge)?n.concat(vd.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(TP.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(vd.merge)),i.reduce((s,o)=>{let l=typeof o=="string"?AP[o]:o;if(!l){let f=JSON.stringify(o),c=Object.keys(AP).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${c}`)}return s.includes(l)||s.push(l),s},[])}__.coreKnownTags=KG;__.getTags=QG});var x_=H(UP=>{"use strict";var R_=Ze(),ZG=Ru(),XG=Cu(),eY=pd(),Sg=jP(),tY=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,C_=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(e)?Sg.getTags(e,"compat"):e?Sg.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?Sg.coreKnownTags:{},this.tags=Sg.getTags(r,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,R_.MAP,{value:ZG.map}),Object.defineProperty(this,R_.SCALAR,{value:eY.string}),Object.defineProperty(this,R_.SEQ,{value:XG.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?tY:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};UP.Schema=C_});var BP=H(HP=>{"use strict";var rY=Ze(),E_=cd(),bd=od();function nY(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let f=t.directives.toString(t);f?(r.push(f),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=E_.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let f=s(t.commentBefore);r.unshift(bd.indentComment(f,""))}let o=!1,l=null;if(t.contents){if(rY.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let p=s(t.contents.commentBefore);r.push(bd.indentComment(p,""))}i.forceBlockIndent=!!t.comment,l=t.contents.comment}let f=l?void 0:()=>o=!0,c=E_.stringify(t.contents,i,()=>l=null,f);l&&(c+=bd.lineComment(c,"",s(l))),(c[0]==="|"||c[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${c}`:r.push(c)}else r.push(E_.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let f=s(t.comment);f.includes(`
148
+ ${s.comment}`:n.comment}n=i}t.items[r]=ug.isPair(n)?n:new a_.Pair(n)}}else e("Expected a sequence for this tag");return t}function mP(t,e,r){let{replacer:n}=r,i=new bG.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,f;if(Array.isArray(o))if(o.length===2)l=o[0],f=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)l=c[0],f=o[l];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else l=o;i.items.push(a_.createPair(l,f,r))}return i}var SG={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:hP,createNode:mP};cg.createPairs=mP;cg.pairs=SG;cg.resolvePairs=hP});var c_=H(u_=>{"use strict";var gP=Ze(),l_=ao(),md=ho(),wG=mo(),yP=fg(),Na=class t extends wG.YAMLSeq{constructor(){super(),this.add=md.YAMLMap.prototype.add.bind(this),this.delete=md.YAMLMap.prototype.delete.bind(this),this.get=md.YAMLMap.prototype.get.bind(this),this.has=md.YAMLMap.prototype.has.bind(this),this.set=md.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(gP.isPair(i)?(s=l_.toJS(i.key,"",r),o=l_.toJS(i.value,s,r)):s=l_.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=yP.createPairs(e,r,n),s=new this;return s.items=i.items,s}};Na.tag="tag:yaml.org,2002:omap";var _G={collection:"seq",identify:t=>t instanceof Map,nodeClass:Na,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=yP.resolvePairs(t,e),n=[];for(let{key:i}of r.items)gP.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new Na,r)},createNode:(t,e,r)=>Na.from(t,e,r)};u_.YAMLOMap=Na;u_.omap=_G});var _P=H(f_=>{"use strict";var vP=Wt();function bP({value:t,source:e},r){return e&&(t?SP:wP).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var SP={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 vP.Scalar(!0),stringify:bP},wP={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 vP.Scalar(!1),stringify:bP};f_.falseTag=wP;f_.trueTag=SP});var RP=H(dg=>{"use strict";var RG=Wt(),d_=xu(),CG={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:d_.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.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():d_.stringifyNumber(t)}},EG={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 RG.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:d_.stringifyNumber};dg.float=EG;dg.floatExp=xG;dg.floatNaN=CG});var xP=H(yd=>{"use strict";var CP=xu(),gd=t=>typeof t=="bigint"||Number.isInteger(t);function pg(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 p_(t,e,r){let{value:n}=t;if(gd(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return CP.stringifyNumber(t)}var IG={identify:gd,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>pg(t,2,2,r),stringify:t=>p_(t,2,"0b")},OG={identify:gd,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>pg(t,1,8,r),stringify:t=>p_(t,8,"0")},qG={identify:gd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>pg(t,0,10,r),stringify:CP.stringifyNumber},kG={identify:gd,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>pg(t,2,16,r),stringify:t=>p_(t,16,"0x")};yd.int=qG;yd.intBin=IG;yd.intHex=kG;yd.intOct=OG});var m_=H(h_=>{"use strict";var gg=Ze(),hg=fo(),mg=ho(),Ma=class t extends mg.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;gg.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new hg.Pair(e.key,null):r=new hg.Pair(e,null),mg.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=mg.findPair(this.items,e);return!r&&gg.isPair(n)?gg.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=mg.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new hg.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(hg.createPair(o,null,n));return s}};Ma.tag="tag:yaml.org,2002:set";var PG={collection:"map",identify:t=>t instanceof Set,nodeClass:Ma,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>Ma.from(t,e,r),resolve(t,e){if(gg.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Ma,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};h_.YAMLSet=Ma;h_.set=PG});var y_=H(yg=>{"use strict";var TG=xu();function g_(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 EP(t){let{value:e}=t,r=o=>o;if(typeof e=="bigint")r=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return TG.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 AG={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})=>g_(t,r),stringify:EP},$G={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=>g_(t,!1),stringify:EP},IP={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(IP.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),f=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(r,n-1,i,s||0,o||0,l||0,f),p=e[8];if(p&&p!=="Z"){let h=g_(p,!1);Math.abs(h)<30&&(h*=60),c-=6e4*h}return new Date(c)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};yg.floatTime=$G;yg.intTime=AG;yg.timestamp=IP});var kP=H(qP=>{"use strict";var NG=Ru(),MG=ig(),FG=Cu(),DG=pd(),LG=o_(),OP=_P(),v_=RP(),vg=xP(),jG=Km(),UG=c_(),HG=fg(),BG=m_(),b_=y_(),VG=[NG.map,FG.seq,DG.string,MG.nullTag,OP.trueTag,OP.falseTag,vg.intBin,vg.intOct,vg.int,vg.intHex,v_.floatNaN,v_.floatExp,v_.float,LG.binary,jG.merge,UG.omap,HG.pairs,BG.set,b_.intTime,b_.floatTime,b_.timestamp];qP.schema=VG});var jP=H(__=>{"use strict";var $P=Ru(),WG=ig(),NP=Cu(),zG=pd(),JG=Z0(),S_=e_(),w_=r_(),GG=uP(),YG=dP(),MP=o_(),vd=Km(),FP=c_(),DP=fg(),PP=kP(),LP=m_(),bg=y_(),TP=new Map([["core",GG.schema],["failsafe",[$P.map,NP.seq,zG.string]],["json",YG.schema],["yaml11",PP.schema],["yaml-1.1",PP.schema]]),AP={binary:MP.binary,bool:JG.boolTag,float:S_.float,floatExp:S_.floatExp,floatNaN:S_.floatNaN,floatTime:bg.floatTime,int:w_.int,intHex:w_.intHex,intOct:w_.intOct,intTime:bg.intTime,map:$P.map,merge:vd.merge,null:WG.nullTag,omap:FP.omap,pairs:DP.pairs,seq:NP.seq,set:LP.set,timestamp:bg.timestamp},KG={"tag:yaml.org,2002:binary":MP.binary,"tag:yaml.org,2002:merge":vd.merge,"tag:yaml.org,2002:omap":FP.omap,"tag:yaml.org,2002:pairs":DP.pairs,"tag:yaml.org,2002:set":LP.set,"tag:yaml.org,2002:timestamp":bg.timestamp};function QG(t,e,r){let n=TP.get(e);if(n&&!t)return r&&!n.includes(vd.merge)?n.concat(vd.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(TP.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(vd.merge)),i.reduce((s,o)=>{let l=typeof o=="string"?AP[o]:o;if(!l){let f=JSON.stringify(o),c=Object.keys(AP).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${c}`)}return s.includes(l)||s.push(l),s},[])}__.coreKnownTags=KG;__.getTags=QG});var x_=H(UP=>{"use strict";var R_=Ze(),ZG=Ru(),XG=Cu(),eY=pd(),Sg=jP(),tY=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,C_=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(e)?Sg.getTags(e,"compat"):e?Sg.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?Sg.coreKnownTags:{},this.tags=Sg.getTags(r,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,R_.MAP,{value:ZG.map}),Object.defineProperty(this,R_.SCALAR,{value:eY.string}),Object.defineProperty(this,R_.SEQ,{value:XG.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?tY:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};UP.Schema=C_});var BP=H(HP=>{"use strict";var rY=Ze(),E_=cd(),bd=od();function nY(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let f=t.directives.toString(t);f?(r.push(f),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=E_.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let f=s(t.commentBefore);r.unshift(bd.indentComment(f,""))}let o=!1,l=null;if(t.contents){if(rY.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let p=s(t.contents.commentBefore);r.push(bd.indentComment(p,""))}i.forceBlockIndent=!!t.comment,l=t.contents.comment}let f=l?void 0:()=>o=!0,c=E_.stringify(t.contents,i,()=>l=null,f);l&&(c+=bd.lineComment(c,"",s(l))),(c[0]==="|"||c[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${c}`:r.push(c)}else r.push(E_.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let f=s(t.comment);f.includes(`
149
149
  `)?(r.push("..."),r.push(bd.indentComment(f,""))):r.push(`... ${f}`)}else r.push("...");else{let f=t.comment;f&&o&&(f=f.replace(/^\n+/,"")),f&&((!o||l)&&r[r.length-1]!==""&&r.push(""),r.push(bd.indentComment(s(f),"")))}return r.join(`
150
150
  `)+`
151
- `}HP.stringifyDocument=nY});var Sd=H(VP=>{"use strict";var iY=id(),Eu=jm(),Pn=Ze(),sY=co(),oY=oo(),aY=x_(),lY=BP(),I_=Mm(),uY=P0(),cY=sd(),O_=k0(),q_=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Pn.NODE_TYPE,{value:Pn.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 O_.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,{[Pn.NODE_TYPE]:{value:Pn.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=Pn.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Iu(this.contents)&&this.contents.add(e)}addIn(e,r){Iu(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=I_.anchorNames(this);e.anchor=!r||n.has(r)?I_.findNewAnchor(r||"a",n):r}return new iY.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 E=T=>typeof T=="number"||T instanceof String||T instanceof Number,k=r.filter(E).map(String);k.length>0&&(r=r.concat(k)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:l,keepUndefined:f,onTagObj:c,tag:p}=n??{},{onAnchor:h,setAnchors:g,sourceObjects:v}=I_.createNodeAnchors(this,o||"a"),_={aliasDuplicateObjects:s??!0,keepUndefined:f??!1,onAnchor:h,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:v},w=cY.createNode(e,p,_);return l&&Pn.isCollection(w)&&(w.flow=!0),g(),w}createPair(e,r,n={}){let i=this.createNode(e,null,n),s=this.createNode(r,null,n);return new sY.Pair(i,s)}delete(e){return Iu(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Eu.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Iu(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return Pn.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return Eu.isEmptyPath(e)?!r&&Pn.isScalar(this.contents)?this.contents.value:this.contents:Pn.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return Pn.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Eu.isEmptyPath(e)?this.contents!==void 0:Pn.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=Eu.collectionFromPath(this.schema,[e],r):Iu(this.contents)&&this.contents.set(e,r)}setIn(e,r){Eu.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=Eu.collectionFromPath(this.schema,Array.from(e),r):Iu(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 O_.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 O_.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},f=oY.toJS(this.contents,r??"",l);if(typeof s=="function")for(let{count:c,res:p}of l.anchors.values())s(p,c);return typeof o=="function"?uY.applyReviver(o,{"":f},"",f):f}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 lY.stringifyDocument(this,e)}};function Iu(t){if(Pn.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}VP.Document=q_});var Rd=H(_d=>{"use strict";var wd=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},k_=class extends wd{constructor(e,r,n){super("YAMLParseError",e,r,n)}},P_=class extends wd{constructor(e,r,n){super("YAMLWarning",e,r,n)}},fY=(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
151
+ `}HP.stringifyDocument=nY});var Sd=H(VP=>{"use strict";var iY=id(),Eu=jm(),Pn=Ze(),sY=fo(),oY=ao(),aY=x_(),lY=BP(),I_=Mm(),uY=P0(),cY=sd(),O_=k0(),q_=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Pn.NODE_TYPE,{value:Pn.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 O_.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,{[Pn.NODE_TYPE]:{value:Pn.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=Pn.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Iu(this.contents)&&this.contents.add(e)}addIn(e,r){Iu(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=I_.anchorNames(this);e.anchor=!r||n.has(r)?I_.findNewAnchor(r||"a",n):r}return new iY.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 E=T=>typeof T=="number"||T instanceof String||T instanceof Number,k=r.filter(E).map(String);k.length>0&&(r=r.concat(k)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:l,keepUndefined:f,onTagObj:c,tag:p}=n??{},{onAnchor:h,setAnchors:g,sourceObjects:v}=I_.createNodeAnchors(this,o||"a"),_={aliasDuplicateObjects:s??!0,keepUndefined:f??!1,onAnchor:h,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:v},w=cY.createNode(e,p,_);return l&&Pn.isCollection(w)&&(w.flow=!0),g(),w}createPair(e,r,n={}){let i=this.createNode(e,null,n),s=this.createNode(r,null,n);return new sY.Pair(i,s)}delete(e){return Iu(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Eu.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Iu(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return Pn.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return Eu.isEmptyPath(e)?!r&&Pn.isScalar(this.contents)?this.contents.value:this.contents:Pn.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return Pn.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return Eu.isEmptyPath(e)?this.contents!==void 0:Pn.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=Eu.collectionFromPath(this.schema,[e],r):Iu(this.contents)&&this.contents.set(e,r)}setIn(e,r){Eu.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=Eu.collectionFromPath(this.schema,Array.from(e),r):Iu(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 O_.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 O_.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},f=oY.toJS(this.contents,r??"",l);if(typeof s=="function")for(let{count:c,res:p}of l.anchors.values())s(p,c);return typeof o=="function"?uY.applyReviver(o,{"":f},"",f):f}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 lY.stringifyDocument(this,e)}};function Iu(t){if(Pn.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}VP.Document=q_});var Rd=H(_d=>{"use strict";var wd=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},k_=class extends wd{constructor(e,r,n){super("YAMLParseError",e,r,n)}},P_=class extends wd{constructor(e,r,n){super("YAMLWarning",e,r,n)}},fY=(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
152
152
  `),o=l+o}if(/[^ ]/.test(o)){let l=1,f=r.linePos[1];f?.line===n&&f.col>i&&(l=Math.max(1,Math.min(f.col-i,80-s)));let c=" ".repeat(s)+"^".repeat(l);r.message+=`:
153
153
 
154
154
  ${o}
155
155
  ${c}
156
156
  `}};_d.YAMLError=wd;_d.YAMLParseError=k_;_d.YAMLWarning=P_;_d.prettifyError=fY});var Cd=H(WP=>{"use strict";function dY(t,{flow:e,indicator:r,next:n,offset:i,onError:s,parentIndent:o,startOnNewline:l}){let f=!1,c=l,p=l,h="",g="",v=!1,_=!1,w=null,E=null,k=null,T=null,N=null,$=null,j=null;for(let C of t)switch(_&&(C.type!=="space"&&C.type!=="newline"&&C.type!=="comma"&&s(C.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),_=!1),w&&(c&&C.type!=="comment"&&C.type!=="newline"&&s(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),w=null),C.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&C.source.includes(" ")&&(w=C),p=!0;break;case"comment":{p||s(C,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let A=C.source.substring(1)||" ";h?h+=g+A:h=A,g="",c=!1;break}case"newline":c?h?h+=C.source:(!$||r!=="seq-item-ind")&&(f=!0):g+=C.source,c=!0,v=!0,(E||k)&&(T=C),p=!0;break;case"anchor":E&&s(C,"MULTIPLE_ANCHORS","A node can have at most one anchor"),C.source.endsWith(":")&&s(C.offset+C.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),E=C,j??(j=C.offset),c=!1,p=!1,_=!0;break;case"tag":{k&&s(C,"MULTIPLE_TAGS","A node can have at most one tag"),k=C,j??(j=C.offset),c=!1,p=!1,_=!0;break}case r:(E||k)&&s(C,"BAD_PROP_ORDER",`Anchors and tags must be after the ${C.source} indicator`),$&&s(C,"UNEXPECTED_TOKEN",`Unexpected ${C.source} in ${e??"collection"}`),$=C,c=r==="seq-item-ind"||r==="explicit-key-ind",p=!1;break;case"comma":if(e){N&&s(C,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),N=C,c=!1,p=!1;break}default:s(C,"UNEXPECTED_TOKEN",`Unexpected ${C.type} token`),c=!1,p=!1}let G=t[t.length-1],q=G?G.offset+G.source.length:i;return _&&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"),w&&(c&&w.indent<=o||n?.type==="block-map"||n?.type==="block-seq")&&s(w,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:N,found:$,spaceBefore:f,comment:h,hasNewline:v,anchor:E,tag:k,newlineAfterProp:T,end:q,start:j??q}}WP.resolveProps=dY});var wg=H(zP=>{"use strict";function T_(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
157
- `))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(T_(e.key)||T_(e.value))return!0}return!1;default:return!0}}zP.containsNewline=T_});var A_=H(JP=>{"use strict";var pY=wg();function hY(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&pY.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}JP.flowIndentCheck=hY});var $_=H(YP=>{"use strict";var GP=Ze();function mY(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(s,o)=>s===o||GP.isScalar(s)&&GP.isScalar(o)&&s.value===o.value;return e.some(s=>i(s.key,r))}YP.mapIncludes=mY});var tT=H(eT=>{"use strict";var KP=co(),gY=po(),QP=Cd(),yY=wg(),ZP=A_(),vY=$_(),XP="All mapping items must start at the same column";function bY({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=s?.nodeClass??gY.YAMLMap,l=new o(r.schema);r.atRoot&&(r.atRoot=!1);let f=n.offset,c=null;for(let p of n.items){let{start:h,key:g,sep:v,value:_}=p,w=QP.resolveProps(h,{indicator:"explicit-key-ind",next:g??v?.[0],offset:f,onError:i,parentIndent:n.indent,startOnNewline:!0}),E=!w.found;if(E){if(g&&(g.type==="block-seq"?i(f,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in g&&g.indent!==n.indent&&i(f,"BAD_INDENT",XP)),!w.anchor&&!w.tag&&!v){c=w.end,w.comment&&(l.comment?l.comment+=`
157
+ `))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(T_(e.key)||T_(e.value))return!0}return!1;default:return!0}}zP.containsNewline=T_});var A_=H(JP=>{"use strict";var pY=wg();function hY(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&pY.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}JP.flowIndentCheck=hY});var $_=H(YP=>{"use strict";var GP=Ze();function mY(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(s,o)=>s===o||GP.isScalar(s)&&GP.isScalar(o)&&s.value===o.value;return e.some(s=>i(s.key,r))}YP.mapIncludes=mY});var tT=H(eT=>{"use strict";var KP=fo(),gY=ho(),QP=Cd(),yY=wg(),ZP=A_(),vY=$_(),XP="All mapping items must start at the same column";function bY({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=s?.nodeClass??gY.YAMLMap,l=new o(r.schema);r.atRoot&&(r.atRoot=!1);let f=n.offset,c=null;for(let p of n.items){let{start:h,key:g,sep:v,value:_}=p,w=QP.resolveProps(h,{indicator:"explicit-key-ind",next:g??v?.[0],offset:f,onError:i,parentIndent:n.indent,startOnNewline:!0}),E=!w.found;if(E){if(g&&(g.type==="block-seq"?i(f,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in g&&g.indent!==n.indent&&i(f,"BAD_INDENT",XP)),!w.anchor&&!w.tag&&!v){c=w.end,w.comment&&(l.comment?l.comment+=`
158
158
  `+w.comment:l.comment=w.comment);continue}(w.newlineAfterProp||yY.containsNewline(g))&&i(g??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else w.found?.indent!==n.indent&&i(f,"BAD_INDENT",XP);r.atKey=!0;let k=w.end,T=g?t(r,g,w,i):e(r,k,h,null,w,i);r.schema.compat&&ZP.flowIndentCheck(n.indent,g,i),r.atKey=!1,vY.mapIncludes(r,l.items,T)&&i(k,"DUPLICATE_KEY","Map keys must be unique");let N=QP.resolveProps(v??[],{indicator:"map-value-ind",next:_,offset:T.range[2],onError:i,parentIndent:n.indent,startOnNewline:!g||g.type==="block-scalar"});if(f=N.end,N.found){E&&(_?.type==="block-map"&&!N.hasNewline&&i(f,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&w.start<N.found.offset-1024&&i(T.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let $=_?t(r,_,N,i):e(r,f,v,null,N,i);r.schema.compat&&ZP.flowIndentCheck(n.indent,_,i),f=$.range[2];let j=new KP.Pair(T,$);r.options.keepSourceTokens&&(j.srcToken=p),l.items.push(j)}else{E&&i(T.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),N.comment&&(T.comment?T.comment+=`
159
- `+N.comment:T.comment=N.comment);let $=new KP.Pair(T);r.options.keepSourceTokens&&($.srcToken=p),l.items.push($)}}return c&&c<f&&i(c,"IMPOSSIBLE","Map comment with trailing content"),l.range=[n.offset,f,c??f],l}eT.resolveBlockMap=bY});var nT=H(rT=>{"use strict";var SY=ho(),wY=Cd(),_Y=A_();function RY({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=s?.nodeClass??SY.YAMLSeq,l=new o(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let f=n.offset,c=null;for(let{start:p,value:h}of n.items){let g=wY.resolveProps(p,{indicator:"seq-item-ind",next:h,offset:f,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!g.found)if(g.anchor||g.tag||h)h?.type==="block-seq"?i(g.end,"BAD_INDENT","All sequence items must start at the same column"):i(f,"MISSING_CHAR","Sequence item without - indicator");else{c=g.end,g.comment&&(l.comment=g.comment);continue}let v=h?t(r,h,g,i):e(r,g.end,p,null,g,i);r.schema.compat&&_Y.flowIndentCheck(n.indent,h,i),f=v.range[2],l.items.push(v)}return l.range=[n.offset,f,c??f],l}rT.resolveBlockSeq=RY});var Ou=H(iT=>{"use strict";function CY(t,e,r,n){let i="";if(t){let s=!1,o="";for(let l of t){let{source:f,type:c}=l;switch(c){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=f.substring(1)||" ";i?i+=o+p:i=p,o="";break}case"newline":i&&(o+=f),s=!0;break;default:n(l,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=f.length}}return{comment:i,offset:e}}iT.resolveEnd=CY});var lT=H(aT=>{"use strict";var xY=Ze(),EY=co(),sT=po(),IY=ho(),OY=Ou(),oT=Cd(),qY=wg(),kY=$_(),N_="Block collections are not allowed within flow collections",M_=t=>t&&(t.type==="block-map"||t.type==="block-seq");function PY({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=n.start.source==="{",l=o?"flow map":"flow sequence",f=s?.nodeClass??(o?sT.YAMLMap:IY.YAMLSeq),c=new f(r.schema);c.flow=!0;let p=r.atRoot;p&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let h=n.offset+n.start.source.length;for(let E=0;E<n.items.length;++E){let k=n.items[E],{start:T,key:N,sep:$,value:j}=k,G=oT.resolveProps(T,{flow:l,indicator:"explicit-key-ind",next:N??$?.[0],offset:h,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!G.found){if(!G.anchor&&!G.tag&&!$&&!j){E===0&&G.comma?i(G.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):E<n.items.length-1&&i(G.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),G.comment&&(c.comment?c.comment+=`
159
+ `+N.comment:T.comment=N.comment);let $=new KP.Pair(T);r.options.keepSourceTokens&&($.srcToken=p),l.items.push($)}}return c&&c<f&&i(c,"IMPOSSIBLE","Map comment with trailing content"),l.range=[n.offset,f,c??f],l}eT.resolveBlockMap=bY});var nT=H(rT=>{"use strict";var SY=mo(),wY=Cd(),_Y=A_();function RY({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=s?.nodeClass??SY.YAMLSeq,l=new o(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let f=n.offset,c=null;for(let{start:p,value:h}of n.items){let g=wY.resolveProps(p,{indicator:"seq-item-ind",next:h,offset:f,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!g.found)if(g.anchor||g.tag||h)h?.type==="block-seq"?i(g.end,"BAD_INDENT","All sequence items must start at the same column"):i(f,"MISSING_CHAR","Sequence item without - indicator");else{c=g.end,g.comment&&(l.comment=g.comment);continue}let v=h?t(r,h,g,i):e(r,g.end,p,null,g,i);r.schema.compat&&_Y.flowIndentCheck(n.indent,h,i),f=v.range[2],l.items.push(v)}return l.range=[n.offset,f,c??f],l}rT.resolveBlockSeq=RY});var Ou=H(iT=>{"use strict";function CY(t,e,r,n){let i="";if(t){let s=!1,o="";for(let l of t){let{source:f,type:c}=l;switch(c){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=f.substring(1)||" ";i?i+=o+p:i=p,o="";break}case"newline":i&&(o+=f),s=!0;break;default:n(l,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=f.length}}return{comment:i,offset:e}}iT.resolveEnd=CY});var lT=H(aT=>{"use strict";var xY=Ze(),EY=fo(),sT=ho(),IY=mo(),OY=Ou(),oT=Cd(),qY=wg(),kY=$_(),N_="Block collections are not allowed within flow collections",M_=t=>t&&(t.type==="block-map"||t.type==="block-seq");function PY({composeNode:t,composeEmptyNode:e},r,n,i,s){let o=n.start.source==="{",l=o?"flow map":"flow sequence",f=s?.nodeClass??(o?sT.YAMLMap:IY.YAMLSeq),c=new f(r.schema);c.flow=!0;let p=r.atRoot;p&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let h=n.offset+n.start.source.length;for(let E=0;E<n.items.length;++E){let k=n.items[E],{start:T,key:N,sep:$,value:j}=k,G=oT.resolveProps(T,{flow:l,indicator:"explicit-key-ind",next:N??$?.[0],offset:h,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!G.found){if(!G.anchor&&!G.tag&&!$&&!j){E===0&&G.comma?i(G.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):E<n.items.length-1&&i(G.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),G.comment&&(c.comment?c.comment+=`
160
160
  `+G.comment:c.comment=G.comment),h=G.end;continue}!o&&r.options.strict&&qY.containsNewline(N)&&i(N,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(E===0)G.comma&&i(G.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(G.comma||i(G.start,"MISSING_CHAR",`Missing , between ${l} items`),G.comment){let q="";e:for(let C of T)switch(C.type){case"comma":case"space":break;case"comment":q=C.source.substring(1);break e;default:break e}if(q){let C=c.items[c.items.length-1];xY.isPair(C)&&(C=C.value??C.key),C.comment?C.comment+=`
161
161
  `+q:C.comment=q,G.comment=G.comment.substring(q.length+1)}}if(!o&&!$&&!G.found){let q=j?t(r,j,G,i):e(r,G.end,$,null,G,i);c.items.push(q),h=q.range[2],M_(j)&&i(q.range,"BLOCK_IN_FLOW",N_)}else{r.atKey=!0;let q=G.end,C=N?t(r,N,G,i):e(r,q,T,null,G,i);M_(N)&&i(C.range,"BLOCK_IN_FLOW",N_),r.atKey=!1;let A=oT.resolveProps($??[],{flow:l,indicator:"map-value-ind",next:j,offset:C.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(A.found){if(!o&&!G.found&&r.options.strict){if($)for(let F of $){if(F===A.found)break;if(F.type==="newline"){i(F,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}G.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 j&&("source"in j&&j.source?.[0]===":"?i(j,"MISSING_CHAR",`Missing space after : in ${l}`):i(A.start,"MISSING_CHAR",`Missing , or : between ${l} items`));let D=j?t(r,j,A,i):A.found?e(r,A.end,$,null,A,i):null;D?M_(j)&&i(D.range,"BLOCK_IN_FLOW",N_):A.comment&&(C.comment?C.comment+=`
162
162
  `+A.comment:C.comment=A.comment);let B=new EY.Pair(C,D);if(r.options.keepSourceTokens&&(B.srcToken=k),o){let F=c;kY.mapIncludes(r,F.items,C)&&i(q,"DUPLICATE_KEY","Map keys must be unique"),F.items.push(B)}else{let F=new sT.YAMLMap(r.schema);F.flow=!0,F.items.push(B);let K=(D??C).range;F.range=[C.range[0],K[1],K[2]],c.items.push(F)}h=D?D.range[2]:A.end}}let g=o?"}":"]",[v,..._]=n.end,w=h;if(v?.source===g)w=v.offset+v.source.length;else{let E=l[0].toUpperCase()+l.substring(1),k=p?`${E} must end with a ${g}`:`${E} in block collection must be sufficiently indented and end with a ${g}`;i(h,p?"MISSING_CHAR":"BAD_INDENT",k),v&&v.source.length!==1&&_.unshift(v)}if(_.length>0){let E=OY.resolveEnd(_,w,r.options.strict,i);E.comment&&(c.comment?c.comment+=`
163
- `+E.comment:c.comment=E.comment),c.range=[n.offset,w,E.offset]}else c.range=[n.offset,w,w];return c}aT.resolveFlowCollection=PY});var cT=H(uT=>{"use strict";var TY=Ze(),AY=Bt(),$Y=po(),NY=ho(),MY=tT(),FY=nT(),DY=lT();function F_(t,e,r,n,i,s){let o=r.type==="block-map"?MY.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?FY.resolveBlockSeq(t,e,r,n,s):DY.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 LY(t,e,r,n,i){let s=n.tag,o=s?e.directives.tagName(s.source,g=>i(s,"TAG_RESOLVE_FAILED",g)):null;if(r.type==="block-seq"){let{anchor:g,newlineAfterProp:v}=n,_=g&&s?g.offset>s.offset?g:s:g??s;_&&(!v||v.offset<_.offset)&&i(_,"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===$Y.YAMLMap.tagName&&l==="map"||o===NY.YAMLSeq.tagName&&l==="seq")return F_(t,e,r,i,o);let f=e.schema.tags.find(g=>g.tag===o&&g.collection===l);if(!f){let g=e.schema.knownTags[o];if(g?.collection===l)e.schema.tags.push(Object.assign({},g,{default:!1})),f=g;else return g?i(s,"BAD_COLLECTION_TYPE",`${g.tag} used for ${l} collection, but expects ${g.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),F_(t,e,r,i,o)}let c=F_(t,e,r,i,o,f),p=f.resolve?.(c,g=>i(s,"TAG_RESOLVE_FAILED",g),e.options)??c,h=TY.isNode(p)?p:new AY.Scalar(p);return h.range=c.range,h.tag=o,f?.format&&(h.format=f.format),h}uT.composeCollection=LY});var L_=H(fT=>{"use strict";var D_=Bt();function jY(t,e,r){let n=e.offset,i=UY(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let s=i.mode===">"?D_.Scalar.BLOCK_FOLDED:D_.Scalar.BLOCK_LITERAL,o=e.source?HY(e.source):[],l=o.length;for(let w=o.length-1;w>=0;--w){let E=o[w][1];if(E===""||E==="\r")l=w;else break}if(l===0){let w=i.chomp==="+"&&o.length>0?`
163
+ `+E.comment:c.comment=E.comment),c.range=[n.offset,w,E.offset]}else c.range=[n.offset,w,w];return c}aT.resolveFlowCollection=PY});var cT=H(uT=>{"use strict";var TY=Ze(),AY=Wt(),$Y=ho(),NY=mo(),MY=tT(),FY=nT(),DY=lT();function F_(t,e,r,n,i,s){let o=r.type==="block-map"?MY.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?FY.resolveBlockSeq(t,e,r,n,s):DY.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 LY(t,e,r,n,i){let s=n.tag,o=s?e.directives.tagName(s.source,g=>i(s,"TAG_RESOLVE_FAILED",g)):null;if(r.type==="block-seq"){let{anchor:g,newlineAfterProp:v}=n,_=g&&s?g.offset>s.offset?g:s:g??s;_&&(!v||v.offset<_.offset)&&i(_,"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===$Y.YAMLMap.tagName&&l==="map"||o===NY.YAMLSeq.tagName&&l==="seq")return F_(t,e,r,i,o);let f=e.schema.tags.find(g=>g.tag===o&&g.collection===l);if(!f){let g=e.schema.knownTags[o];if(g?.collection===l)e.schema.tags.push(Object.assign({},g,{default:!1})),f=g;else return g?i(s,"BAD_COLLECTION_TYPE",`${g.tag} used for ${l} collection, but expects ${g.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),F_(t,e,r,i,o)}let c=F_(t,e,r,i,o,f),p=f.resolve?.(c,g=>i(s,"TAG_RESOLVE_FAILED",g),e.options)??c,h=TY.isNode(p)?p:new AY.Scalar(p);return h.range=c.range,h.tag=o,f?.format&&(h.format=f.format),h}uT.composeCollection=LY});var L_=H(fT=>{"use strict";var D_=Wt();function jY(t,e,r){let n=e.offset,i=UY(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let s=i.mode===">"?D_.Scalar.BLOCK_FOLDED:D_.Scalar.BLOCK_LITERAL,o=e.source?HY(e.source):[],l=o.length;for(let w=o.length-1;w>=0;--w){let E=o[w][1];if(E===""||E==="\r")l=w;else break}if(l===0){let w=i.chomp==="+"&&o.length>0?`
164
164
  `.repeat(Math.max(1,o.length-1)):"",E=n+i.length;return e.source&&(E+=e.source.length),{value:w,type:s,comment:i.comment,range:[n,E,E]}}let f=e.indent+i.indent,c=e.offset+i.length,p=0;for(let w=0;w<l;++w){let[E,k]=o[w];if(k===""||k==="\r")i.indent===0&&E.length>f&&(f=E.length);else{E.length<f&&r(c+E.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(f=E.length),p=w,f===0&&!t.atRoot&&r(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=E.length+k.length+1}for(let w=o.length-1;w>=l;--w)o[w][0].length>f&&(l=w+1);let h="",g="",v=!1;for(let w=0;w<p;++w)h+=o[w][0].slice(f)+`
165
165
  `;for(let w=p;w<l;++w){let[E,k]=o[w];c+=E.length+k.length+1;let T=k[k.length-1]==="\r";if(T&&(k=k.slice(0,-1)),k&&E.length<f){let $=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(c-k.length-(T?2:1),"BAD_INDENT",$),E=""}s===D_.Scalar.BLOCK_LITERAL?(h+=g+E.slice(f)+k,g=`
166
166
  `):E.length>f||k[0]===" "?(g===" "?g=`
@@ -175,7 +175,7 @@ ${c}
175
175
  `+o[w][0].slice(f);h[h.length-1]!==`
176
176
  `&&(h+=`
177
177
  `);break;default:h+=`
178
- `}let _=n+i.length+e.source.length;return{value:h,type:s,comment:i.comment,range:[n,_,_]}}function UY({offset:t,props:e},r,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],s=i[0],o=0,l="",f=-1;for(let g=1;g<i.length;++g){let v=i[g];if(!l&&(v==="-"||v==="+"))l=v;else{let _=Number(v);!o&&_?o=_:f===-1&&(f=t+g)}}f!==-1&&n(f,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,p="",h=i.length;for(let g=1;g<e.length;++g){let v=e[g];switch(v.type){case"space":c=!0;case"newline":h+=v.source.length;break;case"comment":r&&!c&&n(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),h+=v.source.length,p=v.source.substring(1);break;case"error":n(v,"UNEXPECTED_TOKEN",v.message),h+=v.source.length;break;default:{let _=`Unexpected token in block scalar header: ${v.type}`;n(v,"UNEXPECTED_TOKEN",_);let w=v.source;w&&typeof w=="string"&&(h+=w.length)}}}return{mode:s,indent:o,chomp:l,comment:p,length:h}}function HY(t){let e=t.split(/\n( *)/),r=e[0],n=r.match(/^( *)/),s=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let o=1;o<e.length;o+=2)s.push([e[o],e[o+1]]);return s}fT.resolveBlockScalar=jY});var U_=H(pT=>{"use strict";var j_=Bt(),BY=Ou();function VY(t,e,r){let{offset:n,type:i,source:s,end:o}=t,l,f,c=(g,v,_)=>r(n+g,v,_);switch(i){case"scalar":l=j_.Scalar.PLAIN,f=WY(s,c);break;case"single-quoted-scalar":l=j_.Scalar.QUOTE_SINGLE,f=zY(s,c);break;case"double-quoted-scalar":l=j_.Scalar.QUOTE_DOUBLE,f=JY(s,c);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+s.length,n+s.length]}}let p=n+s.length,h=BY.resolveEnd(o,p,e,r);return{value:f,type:l,comment:h.comment,range:[n,p,h.offset]}}function WY(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),dT(t)}function zY(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),dT(t.slice(1,-1)).replace(/''/g,"'")}function dT(t){let e,r;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
178
+ `}let _=n+i.length+e.source.length;return{value:h,type:s,comment:i.comment,range:[n,_,_]}}function UY({offset:t,props:e},r,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],s=i[0],o=0,l="",f=-1;for(let g=1;g<i.length;++g){let v=i[g];if(!l&&(v==="-"||v==="+"))l=v;else{let _=Number(v);!o&&_?o=_:f===-1&&(f=t+g)}}f!==-1&&n(f,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,p="",h=i.length;for(let g=1;g<e.length;++g){let v=e[g];switch(v.type){case"space":c=!0;case"newline":h+=v.source.length;break;case"comment":r&&!c&&n(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),h+=v.source.length,p=v.source.substring(1);break;case"error":n(v,"UNEXPECTED_TOKEN",v.message),h+=v.source.length;break;default:{let _=`Unexpected token in block scalar header: ${v.type}`;n(v,"UNEXPECTED_TOKEN",_);let w=v.source;w&&typeof w=="string"&&(h+=w.length)}}}return{mode:s,indent:o,chomp:l,comment:p,length:h}}function HY(t){let e=t.split(/\n( *)/),r=e[0],n=r.match(/^( *)/),s=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let o=1;o<e.length;o+=2)s.push([e[o],e[o+1]]);return s}fT.resolveBlockScalar=jY});var U_=H(pT=>{"use strict";var j_=Wt(),BY=Ou();function VY(t,e,r){let{offset:n,type:i,source:s,end:o}=t,l,f,c=(g,v,_)=>r(n+g,v,_);switch(i){case"scalar":l=j_.Scalar.PLAIN,f=WY(s,c);break;case"single-quoted-scalar":l=j_.Scalar.QUOTE_SINGLE,f=zY(s,c);break;case"double-quoted-scalar":l=j_.Scalar.QUOTE_DOUBLE,f=JY(s,c);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+s.length,n+s.length]}}let p=n+s.length,h=BY.resolveEnd(o,p,e,r);return{value:f,type:l,comment:h.comment,range:[n,p,h.offset]}}function WY(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),dT(t)}function zY(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),dT(t.slice(1,-1)).replace(/''/g,"'")}function dT(t){let e,r;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
179
179
  `,"sy"),r=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
180
180
  `,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,r=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=e.exec(t);if(!n)return t;let i=n[1],s=" ",o=e.lastIndex;for(r.lastIndex=o;n=r.exec(t);)n[1]===""?s===`
181
181
  `?i+=s:s=`
@@ -190,7 +190,7 @@ ${c}
190
190
  `);)n===`
191
191
  `&&(r+=`
192
192
  `),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}var YY={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
193
- `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function KY(t,e,r,n){let i=t.substr(e,r),o=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(o)}catch{let l=t.substr(e-2,r+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}pT.resolveFlowScalar=VY});var gT=H(mT=>{"use strict";var Fa=Ze(),hT=Bt(),QY=L_(),ZY=U_();function XY(t,e,r,n){let{value:i,type:s,comment:o,range:l}=e.type==="block-scalar"?QY.resolveBlockScalar(t,e,n):ZY.resolveFlowScalar(e,t.options.strict,n),f=r?t.directives.tagName(r.source,h=>n(r,"TAG_RESOLVE_FAILED",h)):null,c;t.options.stringKeys&&t.atKey?c=t.schema[Fa.SCALAR]:f?c=eK(t.schema,i,f,r,n):e.type==="scalar"?c=tK(t,i,e,n):c=t.schema[Fa.SCALAR];let p;try{let h=c.resolve(i,g=>n(r??e,"TAG_RESOLVE_FAILED",g),t.options);p=Fa.isScalar(h)?h:new hT.Scalar(h)}catch(h){let g=h instanceof Error?h.message:String(h);n(r??e,"TAG_RESOLVE_FAILED",g),p=new hT.Scalar(i)}return p.range=l,p.source=i,s&&(p.type=s),f&&(p.tag=f),c.format&&(p.format=c.format),o&&(p.comment=o),p}function eK(t,e,r,n,i){if(r==="!")return t[Fa.SCALAR];let s=[];for(let l of t.tags)if(!l.collection&&l.tag===r)if(l.default&&l.test)s.push(l);else return l;for(let l of s)if(l.test?.test(e))return l;let o=t.knownTags[r];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[Fa.SCALAR])}function tK({atKey:t,directives:e,schema:r},n,i,s){let o=r.tags.find(l=>(l.default===!0||t&&l.default==="key")&&l.test?.test(n))||r[Fa.SCALAR];if(r.compat){let l=r.compat.find(f=>f.default&&f.test?.test(n))??r[Fa.SCALAR];if(o.tag!==l.tag){let f=e.tagString(o.tag),c=e.tagString(l.tag),p=`Value may be parsed as either ${f} or ${c}`;s(i,"TAG_RESOLVE_FAILED",p,!0)}}return o}mT.composeScalar=XY});var vT=H(yT=>{"use strict";function rK(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++n];i?.type==="space";)t+=i.source.length,i=e[++n];break}}return t}yT.emptyScalarPosition=rK});var wT=H(B_=>{"use strict";var nK=id(),iK=Ze(),sK=cT(),bT=gT(),oK=Ou(),aK=vT(),lK={composeNode:ST,composeEmptyNode:H_};function ST(t,e,r,n){let i=t.atKey,{spaceBefore:s,comment:o,anchor:l,tag:f}=r,c,p=!0;switch(e.type){case"alias":c=uK(t,e,n),(l||f)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=bT.composeScalar(t,e,f,n),l&&(c.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=sK.composeCollection(lK,t,e,r,n),l&&(c.anchor=l.source.substring(1))}catch(h){let g=h instanceof Error?h.message:String(h);n(e,"RESOURCE_EXHAUSTION",g)}break;default:{let h=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",h),p=!1}}return c??(c=H_(t,e.offset,void 0,null,r,n)),l&&c.anchor===""&&n(l,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!iK.isScalar(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&n(f??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),t.options.keepSourceTokens&&p&&(c.srcToken=e),c}function H_(t,e,r,n,{spaceBefore:i,comment:s,anchor:o,tag:l,end:f},c){let p={type:"scalar",offset:aK.emptyScalarPosition(e,r,n),indent:-1,source:""},h=bT.composeScalar(t,p,l,c);return o&&(h.anchor=o.source.substring(1),h.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(h.spaceBefore=!0),s&&(h.comment=s,h.range[2]=f),h}function uK({options:t},{offset:e,source:r,end:n},i){let s=new nK.Alias(r.substring(1));s.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+r.length,l=oK.resolveEnd(n,o,t.strict,i);return s.range=[e,o,l.offset],l.comment&&(s.comment=l.comment),s}B_.composeEmptyNode=H_;B_.composeNode=ST});var CT=H(RT=>{"use strict";var cK=Sd(),_T=wT(),fK=Ou(),dK=Cd();function pK(t,e,{offset:r,start:n,value:i,end:s},o){let l=Object.assign({_directives:e},t),f=new cK.Document(void 0,l),c={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},p=dK.resolveProps(n,{indicator:"doc-start",next:i??s?.[0],offset:r,onError:o,parentIndent:0,startOnNewline:!0});p.found&&(f.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!p.hasNewline&&o(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),f.contents=i?_T.composeNode(c,i,p,o):_T.composeEmptyNode(c,p.end,n,null,p,o);let h=f.contents.range[2],g=fK.resolveEnd(s,h,!1,o);return g.comment&&(f.comment=g.comment),f.range=[r,h,g.offset],f}RT.composeDoc=pK});var W_=H(IT=>{"use strict";var hK=ft("process"),mK=k0(),gK=Sd(),xd=Rd(),xT=Ze(),yK=CT(),vK=Ou();function Ed(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function ET(t){let e="",r=!1,n=!1;for(let i=0;i<t.length;++i){let s=t[i];switch(s[0]){case"#":e+=(e===""?"":n?`
193
+ `,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function KY(t,e,r,n){let i=t.substr(e,r),o=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(o)}catch{let l=t.substr(e-2,r+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}pT.resolveFlowScalar=VY});var gT=H(mT=>{"use strict";var Fa=Ze(),hT=Wt(),QY=L_(),ZY=U_();function XY(t,e,r,n){let{value:i,type:s,comment:o,range:l}=e.type==="block-scalar"?QY.resolveBlockScalar(t,e,n):ZY.resolveFlowScalar(e,t.options.strict,n),f=r?t.directives.tagName(r.source,h=>n(r,"TAG_RESOLVE_FAILED",h)):null,c;t.options.stringKeys&&t.atKey?c=t.schema[Fa.SCALAR]:f?c=eK(t.schema,i,f,r,n):e.type==="scalar"?c=tK(t,i,e,n):c=t.schema[Fa.SCALAR];let p;try{let h=c.resolve(i,g=>n(r??e,"TAG_RESOLVE_FAILED",g),t.options);p=Fa.isScalar(h)?h:new hT.Scalar(h)}catch(h){let g=h instanceof Error?h.message:String(h);n(r??e,"TAG_RESOLVE_FAILED",g),p=new hT.Scalar(i)}return p.range=l,p.source=i,s&&(p.type=s),f&&(p.tag=f),c.format&&(p.format=c.format),o&&(p.comment=o),p}function eK(t,e,r,n,i){if(r==="!")return t[Fa.SCALAR];let s=[];for(let l of t.tags)if(!l.collection&&l.tag===r)if(l.default&&l.test)s.push(l);else return l;for(let l of s)if(l.test?.test(e))return l;let o=t.knownTags[r];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[Fa.SCALAR])}function tK({atKey:t,directives:e,schema:r},n,i,s){let o=r.tags.find(l=>(l.default===!0||t&&l.default==="key")&&l.test?.test(n))||r[Fa.SCALAR];if(r.compat){let l=r.compat.find(f=>f.default&&f.test?.test(n))??r[Fa.SCALAR];if(o.tag!==l.tag){let f=e.tagString(o.tag),c=e.tagString(l.tag),p=`Value may be parsed as either ${f} or ${c}`;s(i,"TAG_RESOLVE_FAILED",p,!0)}}return o}mT.composeScalar=XY});var vT=H(yT=>{"use strict";function rK(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++n];i?.type==="space";)t+=i.source.length,i=e[++n];break}}return t}yT.emptyScalarPosition=rK});var wT=H(B_=>{"use strict";var nK=id(),iK=Ze(),sK=cT(),bT=gT(),oK=Ou(),aK=vT(),lK={composeNode:ST,composeEmptyNode:H_};function ST(t,e,r,n){let i=t.atKey,{spaceBefore:s,comment:o,anchor:l,tag:f}=r,c,p=!0;switch(e.type){case"alias":c=uK(t,e,n),(l||f)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=bT.composeScalar(t,e,f,n),l&&(c.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=sK.composeCollection(lK,t,e,r,n),l&&(c.anchor=l.source.substring(1))}catch(h){let g=h instanceof Error?h.message:String(h);n(e,"RESOURCE_EXHAUSTION",g)}break;default:{let h=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",h),p=!1}}return c??(c=H_(t,e.offset,void 0,null,r,n)),l&&c.anchor===""&&n(l,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!iK.isScalar(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&n(f??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),t.options.keepSourceTokens&&p&&(c.srcToken=e),c}function H_(t,e,r,n,{spaceBefore:i,comment:s,anchor:o,tag:l,end:f},c){let p={type:"scalar",offset:aK.emptyScalarPosition(e,r,n),indent:-1,source:""},h=bT.composeScalar(t,p,l,c);return o&&(h.anchor=o.source.substring(1),h.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(h.spaceBefore=!0),s&&(h.comment=s,h.range[2]=f),h}function uK({options:t},{offset:e,source:r,end:n},i){let s=new nK.Alias(r.substring(1));s.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+r.length,l=oK.resolveEnd(n,o,t.strict,i);return s.range=[e,o,l.offset],l.comment&&(s.comment=l.comment),s}B_.composeEmptyNode=H_;B_.composeNode=ST});var CT=H(RT=>{"use strict";var cK=Sd(),_T=wT(),fK=Ou(),dK=Cd();function pK(t,e,{offset:r,start:n,value:i,end:s},o){let l=Object.assign({_directives:e},t),f=new cK.Document(void 0,l),c={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},p=dK.resolveProps(n,{indicator:"doc-start",next:i??s?.[0],offset:r,onError:o,parentIndent:0,startOnNewline:!0});p.found&&(f.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!p.hasNewline&&o(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),f.contents=i?_T.composeNode(c,i,p,o):_T.composeEmptyNode(c,p.end,n,null,p,o);let h=f.contents.range[2],g=fK.resolveEnd(s,h,!1,o);return g.comment&&(f.comment=g.comment),f.range=[r,h,g.offset],f}RT.composeDoc=pK});var W_=H(IT=>{"use strict";var hK=ft("process"),mK=k0(),gK=Sd(),xd=Rd(),xT=Ze(),yK=CT(),vK=Ou();function Ed(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function ET(t){let e="",r=!1,n=!1;for(let i=0;i<t.length;++i){let s=t[i];switch(s[0]){case"#":e+=(e===""?"":n?`
194
194
 
195
195
  `:`
196
196
  `)+(s.substring(1)||" "),r=!0,n=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:e,afterEmptyLine:n}}var V_=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,i,s)=>{let o=Ed(r);s?this.warnings.push(new xd.YAMLWarning(o,n,i)):this.errors.push(new xd.YAMLParseError(o,n,i))},this.directives=new mK.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=ET(this.prelude);if(n){let s=e.contents;if(r)e.comment=e.comment?`${e.comment}
@@ -226,20 +226,20 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus
226
226
  `,s=this.buffer[n+1]):r=n),s==="#"||e&&Eg.has(s))break;if(i===`
227
227
  `){let o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(e&&Eg.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Id.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(X_),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,n=this.charAt(1);if(si(n)||r&&Eg.has(n)){r?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!si(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if($K.has(r))r=this.buffer[++e];else if(r==="%"&&FT.has(this.buffer[e+1])&&FT.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
228
228
  `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
229
- `?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let i=r-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};DT.Lexer=eR});var nR=H(LT=>{"use strict";var rR=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r<n;){let s=r+n>>1;this.lineStarts[s]<e?r=s+1:n=s}if(this.lineStarts[r]===e)return{line:r+1,col:1};if(r===0)return{line:0,col:e};let i=this.lineStarts[r-1];return{line:r,col:e-i+1}}}};LT.LineCounter=rR});var sR=H(VT=>{"use strict";var MK=ft("process"),jT=xg(),FK=tR();function mo(t,e){for(let r=0;r<t.length;++r)if(t[r].type===e)return!0;return!1}function UT(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function BT(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Ig(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function qu(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Og(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let r=0;r<e.length;++r)t.push(e[r])}function HT(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!mo(e.start,"explicit-key-ind")&&!mo(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,BT(e.value)?e.value.end?Og(e.value.end,e.sep):e.value.end=e.sep:Og(e.start,e.sep),delete e.sep)}var iR=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new FK.Lexer,this.onNewLine=e}*parse(e,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,r))yield*this.next(n);r||(yield*this.end())}*next(e){if(this.source=e,MK.env.LOG_TOKENS&&console.log("|",jT.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=jT.tokenType(e);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&HT(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&UT(i.start)===-1&&(r.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<r.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),r.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{UT(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let r=Ig(this.peek(2)),n=qu(r),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let r=this.source.indexOf(`
229
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let i=r-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};DT.Lexer=eR});var nR=H(LT=>{"use strict";var rR=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r<n;){let s=r+n>>1;this.lineStarts[s]<e?r=s+1:n=s}if(this.lineStarts[r]===e)return{line:r+1,col:1};if(r===0)return{line:0,col:e};let i=this.lineStarts[r-1];return{line:r,col:e-i+1}}}};LT.LineCounter=rR});var sR=H(VT=>{"use strict";var MK=ft("process"),jT=xg(),FK=tR();function go(t,e){for(let r=0;r<t.length;++r)if(t[r].type===e)return!0;return!1}function UT(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function BT(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Ig(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function qu(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Og(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let r=0;r<e.length;++r)t.push(e[r])}function HT(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!go(e.start,"explicit-key-ind")&&!go(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,BT(e.value)?e.value.end?Og(e.value.end,e.sep):e.value.end=e.sep:Og(e.start,e.sep),delete e.sep)}var iR=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new FK.Lexer,this.onNewLine=e}*parse(e,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,r))yield*this.next(n);r||(yield*this.end())}*next(e){if(this.source=e,MK.env.LOG_TOKENS&&console.log("|",jT.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=jT.tokenType(e);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&HT(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&UT(i.start)===-1&&(r.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<r.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),r.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{UT(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let r=Ig(this.peek(2)),n=qu(r),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let r=this.source.indexOf(`
230
230
  `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
231
- `,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)){Og(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 f=r.sep[l];switch(f.type){case"newline":o.push(l);break;case"space":break;case"comment":f.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(mo(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(BT(r.key)&&!mo(r.sep,"newline")){let o=qu(r.start),l=r.key,f=r.sep;f.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:f}]})}else s.length>0?r.sep=r.sep.concat(s,this.sourceToken):r.sep.push(this.sourceToken);else if(mo(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let o=qu(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]}):mo(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&&!mo(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)){Og(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||mo(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=Ig(n),s=qu(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(`
231
+ `,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)){Og(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 f=r.sep[l];switch(f.type){case"newline":o.push(l);break;case"space":break;case"comment":f.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(go(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(BT(r.key)&&!go(r.sep,"newline")){let o=qu(r.start),l=r.key,f=r.sep;f.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:f}]})}else s.length>0?r.sep=r.sep.concat(s,this.sourceToken):r.sep.push(this.sourceToken);else if(go(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let o=qu(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]}):go(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&&!go(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)){Og(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||go(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=Ig(n),s=qu(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(`
232
232
  `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
233
- `,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=Ig(e),n=qu(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=Ig(e),n=qu(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())}}};VT.Parser=iR});var YT=H(qd=>{"use strict";var WT=W_(),DK=Sd(),Od=Rd(),LK=B0(),jK=Ze(),UK=nR(),zT=sR();function JT(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new UK.LineCounter||null,prettyErrors:e}}function HK(t,e={}){let{lineCounter:r,prettyErrors:n}=JT(e),i=new zT.Parser(r?.addNewLine),s=new WT.Composer(e),o=Array.from(s.compose(i.parse(t)));if(n&&r)for(let l of o)l.errors.forEach(Od.prettifyError(t,r)),l.warnings.forEach(Od.prettifyError(t,r));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function GT(t,e={}){let{lineCounter:r,prettyErrors:n}=JT(e),i=new zT.Parser(r?.addNewLine),s=new WT.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 Od.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(o.errors.forEach(Od.prettifyError(t,r)),o.warnings.forEach(Od.prettifyError(t,r))),o}function BK(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=GT(t,r);if(!i)return null;if(i.warnings.forEach(s=>LK.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 VK(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 jK.isDocument(t)&&!n?t.toString(r):new DK.Document(t,n,r).toString(r)}qd.parse=BK;qd.parseAllDocuments=HK;qd.parseDocument=GT;qd.stringify=VK});var kd=H(dt=>{"use strict";var WK=W_(),zK=Sd(),JK=x_(),oR=Rd(),GK=id(),go=Ze(),YK=co(),KK=Bt(),QK=po(),ZK=ho(),XK=xg(),e4=tR(),t4=nR(),r4=sR(),qg=YT(),KT=ed();dt.Composer=WK.Composer;dt.Document=zK.Document;dt.Schema=JK.Schema;dt.YAMLError=oR.YAMLError;dt.YAMLParseError=oR.YAMLParseError;dt.YAMLWarning=oR.YAMLWarning;dt.Alias=GK.Alias;dt.isAlias=go.isAlias;dt.isCollection=go.isCollection;dt.isDocument=go.isDocument;dt.isMap=go.isMap;dt.isNode=go.isNode;dt.isPair=go.isPair;dt.isScalar=go.isScalar;dt.isSeq=go.isSeq;dt.Pair=YK.Pair;dt.Scalar=KK.Scalar;dt.YAMLMap=QK.YAMLMap;dt.YAMLSeq=ZK.YAMLSeq;dt.CST=XK;dt.Lexer=e4.Lexer;dt.LineCounter=t4.LineCounter;dt.Parser=r4.Parser;dt.parse=qg.parse;dt.parseAllDocuments=qg.parseAllDocuments;dt.parseDocument=qg.parseDocument;dt.stringify=qg.stringify;dt.visit=KT.visit;dt.visitAsync=KT.visitAsync});var n4,i4,s4,o4,a4,l4,u4,yo,kg=se(()=>{"use strict";n4=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,i4=/^\d{4}-\d{2}-\d{2}$/,s4=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,o4=/^https?:\/\/[^\s]+$/,a4=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,l4=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,u4=/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/,yo=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(n4.test(e))return"date-time";if(i4.test(e))return"date";if(s4.test(e))return"email";if(a4.test(e))return"uuid";if(o4.test(e))return"uri";if(l4.test(e))return"ipv4";if(u4.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 h of l)s[h]&&o[h]?i.properties[h]=this.mergeSchemas(s[h],o[h]):s[h]?i.properties[h]={...s[h]}:i.properties[h]={...o[h]};let f=new Set(e.required||Object.keys(s)),c=new Set(r.required||Object.keys(o)),p=[...l].filter(h=>f.has(h)&&c.has(h));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 QT,c4,ku,aR=se(()=>{"use strict";QT=Hc(kd());kg();c4=new Set(["content-type","authorization","accept","cookie","host","content-length"]),ku=class{constructor(e,r,n){this.collectionService=e;this.envConfigService=r;this.inferenceService=n;this.inferrer=new yo}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 f=this.mapAuthToSecurityScheme(n.auth);if(f){let{schemeName:c,scheme:p,requirement:h}=f;s.set(c,p),i.security=[h]}}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[f,c]of s)i.components.securitySchemes[f]=c;else delete i.components.securitySchemes;return i.tags=[...o].map(f=>({name:f})),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"?QT.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,f){for(let c of e)if(c.type==="folder"){let p=c,h=o||p.name;i.add(h),p.items&&await this.processItems(p.items,r,n,i,s,h,l,f)}else{let p=c;await this.processRequest(p,r,n,i,s,o,l,f)}}async processRequest(e,r,n,i,s,o,l,f){let{path:c,hostVar:p}=this.normalizeUrl(e.url);p&&s.add(p);let h=(e.method||"GET").toLowerCase();r.paths[c]||(r.paths[c]={});let g={};g.operationId=e.operationId||this.generateOperationId(e,h,c,r),g.summary=e.summary||this.cleanSummary(e.name),e.description&&(g.description=e.description),(e.deprecated||this.hasDeprecatedPrefix(e.name))&&(g.deprecated=!0,this.hasDeprecatedPrefix(e.name)&&(g.summary=e.name.replace(/^\[DEPRECATED\]\s*/i,"")));let v=e.tags;if(v&&v.length>0){g.tags=v;for(let N of v)i.add(N)}else o&&(g.tags=[o]);let _=this.buildParameters(e);_.length>0&&(g.parameters=_);let w=await this.buildRequestBody(e,f);w&&(g.requestBody=w);let E=e.responses;E&&Object.keys(E).length>0?g.responses=this.mapResponseDefinitions(E):g.responses=await this.buildResponses(e,l.id,f);let k=e.security;if(k&&k.length>0)g.security=k;else{let N=this.buildOperationSecurity(e,l,n);N!==void 0&&(g.security=N)}let T=r.paths[c][h];T?this.mergeOperation(T,g,e.name):r.paths[c][h]=g}mergeOperation(e,r,n){if(r.summary&&r.summary!==e.summary&&(e.description=(e.description||e.summary||"")+`
233
+ `,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=Ig(e),n=qu(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=Ig(e),n=qu(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())}}};VT.Parser=iR});var YT=H(qd=>{"use strict";var WT=W_(),DK=Sd(),Od=Rd(),LK=B0(),jK=Ze(),UK=nR(),zT=sR();function JT(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new UK.LineCounter||null,prettyErrors:e}}function HK(t,e={}){let{lineCounter:r,prettyErrors:n}=JT(e),i=new zT.Parser(r?.addNewLine),s=new WT.Composer(e),o=Array.from(s.compose(i.parse(t)));if(n&&r)for(let l of o)l.errors.forEach(Od.prettifyError(t,r)),l.warnings.forEach(Od.prettifyError(t,r));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function GT(t,e={}){let{lineCounter:r,prettyErrors:n}=JT(e),i=new zT.Parser(r?.addNewLine),s=new WT.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 Od.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(o.errors.forEach(Od.prettifyError(t,r)),o.warnings.forEach(Od.prettifyError(t,r))),o}function BK(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=GT(t,r);if(!i)return null;if(i.warnings.forEach(s=>LK.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 VK(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 jK.isDocument(t)&&!n?t.toString(r):new DK.Document(t,n,r).toString(r)}qd.parse=BK;qd.parseAllDocuments=HK;qd.parseDocument=GT;qd.stringify=VK});var kd=H(dt=>{"use strict";var WK=W_(),zK=Sd(),JK=x_(),oR=Rd(),GK=id(),yo=Ze(),YK=fo(),KK=Wt(),QK=ho(),ZK=mo(),XK=xg(),e4=tR(),t4=nR(),r4=sR(),qg=YT(),KT=ed();dt.Composer=WK.Composer;dt.Document=zK.Document;dt.Schema=JK.Schema;dt.YAMLError=oR.YAMLError;dt.YAMLParseError=oR.YAMLParseError;dt.YAMLWarning=oR.YAMLWarning;dt.Alias=GK.Alias;dt.isAlias=yo.isAlias;dt.isCollection=yo.isCollection;dt.isDocument=yo.isDocument;dt.isMap=yo.isMap;dt.isNode=yo.isNode;dt.isPair=yo.isPair;dt.isScalar=yo.isScalar;dt.isSeq=yo.isSeq;dt.Pair=YK.Pair;dt.Scalar=KK.Scalar;dt.YAMLMap=QK.YAMLMap;dt.YAMLSeq=ZK.YAMLSeq;dt.CST=XK;dt.Lexer=e4.Lexer;dt.LineCounter=t4.LineCounter;dt.Parser=r4.Parser;dt.parse=qg.parse;dt.parseAllDocuments=qg.parseAllDocuments;dt.parseDocument=qg.parseDocument;dt.stringify=qg.stringify;dt.visit=KT.visit;dt.visitAsync=KT.visitAsync});var n4,i4,s4,o4,a4,l4,u4,vo,kg=se(()=>{"use strict";n4=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,i4=/^\d{4}-\d{2}-\d{2}$/,s4=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,o4=/^https?:\/\/[^\s]+$/,a4=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,l4=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,u4=/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/,vo=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(n4.test(e))return"date-time";if(i4.test(e))return"date";if(s4.test(e))return"email";if(a4.test(e))return"uuid";if(o4.test(e))return"uri";if(l4.test(e))return"ipv4";if(u4.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 h of l)s[h]&&o[h]?i.properties[h]=this.mergeSchemas(s[h],o[h]):s[h]?i.properties[h]={...s[h]}:i.properties[h]={...o[h]};let f=new Set(e.required||Object.keys(s)),c=new Set(r.required||Object.keys(o)),p=[...l].filter(h=>f.has(h)&&c.has(h));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 QT,c4,ku,aR=se(()=>{"use strict";QT=Hc(kd());kg();c4=new Set(["content-type","authorization","accept","cookie","host","content-length"]),ku=class{constructor(e,r,n){this.collectionService=e;this.envConfigService=r;this.inferenceService=n;this.inferrer=new vo}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 f=this.mapAuthToSecurityScheme(n.auth);if(f){let{schemeName:c,scheme:p,requirement:h}=f;s.set(c,p),i.security=[h]}}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[f,c]of s)i.components.securitySchemes[f]=c;else delete i.components.securitySchemes;return i.tags=[...o].map(f=>({name:f})),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"?QT.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,f){for(let c of e)if(c.type==="folder"){let p=c,h=o||p.name;i.add(h),p.items&&await this.processItems(p.items,r,n,i,s,h,l,f)}else{let p=c;await this.processRequest(p,r,n,i,s,o,l,f)}}async processRequest(e,r,n,i,s,o,l,f){let{path:c,hostVar:p}=this.normalizeUrl(e.url);p&&s.add(p);let h=(e.method||"GET").toLowerCase();r.paths[c]||(r.paths[c]={});let g={};g.operationId=e.operationId||this.generateOperationId(e,h,c,r),g.summary=e.summary||this.cleanSummary(e.name),e.description&&(g.description=e.description),(e.deprecated||this.hasDeprecatedPrefix(e.name))&&(g.deprecated=!0,this.hasDeprecatedPrefix(e.name)&&(g.summary=e.name.replace(/^\[DEPRECATED\]\s*/i,"")));let v=e.tags;if(v&&v.length>0){g.tags=v;for(let N of v)i.add(N)}else o&&(g.tags=[o]);let _=this.buildParameters(e);_.length>0&&(g.parameters=_);let w=await this.buildRequestBody(e,f);w&&(g.requestBody=w);let E=e.responses;E&&Object.keys(E).length>0?g.responses=this.mapResponseDefinitions(E):g.responses=await this.buildResponses(e,l.id,f);let k=e.security;if(k&&k.length>0)g.security=k;else{let N=this.buildOperationSecurity(e,l,n);N!==void 0&&(g.security=N)}let T=r.paths[c][h];T?this.mergeOperation(T,g,e.name):r.paths[c][h]=g}mergeOperation(e,r,n){if(r.summary&&r.summary!==e.summary&&(e.description=(e.description||e.summary||"")+`
234
234
 
235
235
  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 f=this.buildVariantSchema(s);i.oneOf.some(c=>JSON.stringify(c)===JSON.stringify(f))||i.oneOf.push(f)}else if(s.oneOf){let f=this.buildVariantSchema(i);i.oneOf=[f,...s.oneOf]}else{let f=this.buildVariantSchema(i),c=this.buildVariantSchema(s);i.oneOf=[f,c]}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 f=`variant_${n.replace(/[^a-zA-Z0-9_]/g,"_")}`;e.examples[f]={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(f=>f&&!f.startsWith("{"));s=r+l.map(f=>f.charAt(0).toUpperCase()+f.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||c4.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,f;if(e.bodySchema){if(e.bodySchema.content){for(let[h,g]of Object.entries(e.bodySchema.content)){let v={};g.schema&&(v.schema=g.schema),g.examples&&(v.examples=g.examples),g.encoding&&(v.encoding=g.encoding),i.content[h]=v}let p=e.bodySchema.contentType||Object.keys(e.bodySchema.content)[0];if(p&&n.content){let h=this.tryParseBodyContent(n);h!==void 0&&i.content[p]&&(i.content[p].example=h)}return i}s=e.bodySchema.contentType||this.getContentType(n),o=e.bodySchema.schema,e.bodySchema.components,l=this.tryParseBodyContent(n),e.bodySchema.encoding&&(f=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 c={};return o&&(c.schema=o),l!==void 0&&(c.example=l),f&&(c.encoding=f),i.content[s]=c,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[f,c]of Object.entries(o.content)){let p={};c.schema&&(p.schema=c.schema),c.examples&&(p.examples=c.examples),l.content[f]=p}}else if(o.schema){let f=o.contentType||"application/json",c={schema:o.schema};o.examples&&(c.examples=o.examples),l.content={[f]:c}}if(o.headers){l.headers={};for(let[f,c]of Object.entries(o.headers))l.headers[f]={...c.description&&{description:c.description},schema:c.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 f=l;s.headers[o]={...f.description&&{description:f.description},...f.schema&&{schema:f.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 f=l;if(f.responses){for(let[c,p]of Object.entries(f.responses))if(p.content)for(let h of Object.values(p.content))h.schema&&this.trackSchema(h.schema,`${o}${i}Response${c}`,r,n)}if(f.requestBody?.content)for(let c of Object.values(f.requestBody.content))c.schema&&this.trackSchema(c.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 f of Object.values(l.content))f.schema&&JSON.stringify(f.schema)===i&&(f.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}}}`,f=!1;for(let c of s){let p=this.envConfigService.resolveVariables(l,c);p&&p!==l&&!i.has(p)&&(r.push({url:p,description:c}),i.add(p),f=!0)}if(!f){let c=`{${o}}`;i.has(c)||(r.push({url:c,variables:{[o]:{default:""}}}),i.add(c))}}}}});var Pu,lR=se(()=>{"use strict";Pu=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 Pg=H(Tu=>{"use strict";Object.defineProperty(Tu,"__esModule",{value:!0});Tu.getDeepKeys=Tu.toJSON=void 0;var f4=["function","symbol","undefined"],d4=["constructor","prototype","__proto__"],p4=Object.getPrototypeOf({});function h4(){let t={},e=this;for(let r of ZT(e))if(typeof r=="string"){let n=e[r],i=typeof n;f4.includes(i)||(t[r]=n)}return t}Tu.toJSON=h4;function ZT(t,e=[]){let r=[];for(;t&&t!==p4;)r=r.concat(Object.getOwnPropertyNames(t),Object.getOwnPropertySymbols(t)),t=Object.getPrototypeOf(t);let n=new Set(r);for(let i of e.concat(d4))n.delete(i);return n}Tu.getDeepKeys=ZT});var uR=H(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});Au.addInspectMethod=Au.format=void 0;var XT=ft("util"),m4=Pg(),eA=XT.inspect.custom||Symbol.for("nodejs.util.inspect.custom");Au.format=XT.format;function g4(t){t[eA]=y4}Au.addInspectMethod=g4;function y4(){let t={},e=this;for(let r of m4.getDeepKeys(e)){let n=e[r];t[r]=n}return delete t[eA],t}});var nA=H(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.lazyJoinStacks=Ai.joinStacks=Ai.isWritableStack=Ai.isLazyStack=void 0;var v4=/\r?\n/,b4=/\bono[ @]/;function S4(t){return!!(t&&t.configurable&&typeof t.get=="function")}Ai.isLazyStack=S4;function w4(t){return!!(!t||t.writable||typeof t.set=="function")}Ai.isWritableStack=w4;function tA(t,e){let r=rA(t.stack),n=e?e.stack:void 0;return r&&n?r+`
236
236
 
237
237
  `+n:r||n}Ai.joinStacks=tA;function _4(t,e,r){r?Object.defineProperty(e,"stack",{get:()=>{let n=t.get.apply(e);return tA({stack:n},r)},enumerable:!1,configurable:!0}):R4(e,t)}Ai.lazyJoinStacks=_4;function rA(t){if(t){let e=t.split(v4),r;for(let n=0;n<e.length;n++){let i=e[n];if(b4.test(i))r===void 0&&(r=n);else if(r!==void 0){e.splice(r,n-r);break}}if(e.length>0)return e.join(`
238
238
  `)}return t}function R4(t,e){Object.defineProperty(t,"stack",{get:()=>rA(e.get.apply(t)),enumerable:!1,configurable:!0})}});var oA=H(Ag=>{"use strict";Object.defineProperty(Ag,"__esModule",{value:!0});Ag.extendError=void 0;var iA=uR(),Tg=nA(),sA=Pg(),C4=["name","message","stack"];function x4(t,e,r){let n=t;return E4(n,e),e&&typeof e=="object"&&I4(n,e),n.toJSON=sA.toJSON,iA.addInspectMethod&&iA.addInspectMethod(n),r&&typeof r=="object"&&Object.assign(n,r),n}Ag.extendError=x4;function E4(t,e){let r=Object.getOwnPropertyDescriptor(t,"stack");Tg.isLazyStack(r)?Tg.lazyJoinStacks(r,t,e):Tg.isWritableStack(r)&&(t.stack=Tg.joinStacks(t,e))}function I4(t,e){let r=sA.getDeepKeys(e,C4),n=t,i=e;for(let s of r)if(n[s]===void 0)try{n[s]=i[s]}catch{}}});var aA=H($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.normalizeArgs=$u.normalizeOptions=void 0;var O4=uR();function q4(t){return t=t||{},{concatMessages:t.concatMessages===void 0?!0:!!t.concatMessages,format:t.format===void 0?O4.format:typeof t.format=="function"?t.format:!1}}$u.normalizeOptions=q4;function k4(t,e){let r,n,i,s="";return typeof t[0]=="string"?i=t:typeof t[1]=="string"?(t[0]instanceof Error?r=t[0]:n=t[0],i=t.slice(1)):(r=t[0],n=t[1],i=t.slice(2)),i.length>0&&(e.format?s=e.format.apply(void 0,i):s=i.join(" ")),e.concatMessages&&r&&r.message&&(s+=(s?`
239
- `:"")+r.message),{originalError:r,props:n,message:s}}$u.normalizeArgs=k4});var fR=H(Ng=>{"use strict";Object.defineProperty(Ng,"__esModule",{value:!0});Ng.Ono=void 0;var $g=oA(),lA=aA(),P4=Pg(),T4=cR;Ng.Ono=T4;function cR(t,e){e=lA.normalizeOptions(e);function r(...n){let{originalError:i,props:s,message:o}=lA.normalizeArgs(n,e),l=new t(o);return $g.extendError(l,i,s)}return r[Symbol.species]=t,r}cR.toJSON=function(e){return P4.toJSON.call(e)};cR.extend=function(e,r,n){return n||r instanceof Error?$g.extendError(e,r,n):r?$g.extendError(e,void 0,r):$g.extendError(e)}});var uA=H(Mg=>{"use strict";Object.defineProperty(Mg,"__esModule",{value:!0});Mg.ono=void 0;var La=fR(),A4=$i;Mg.ono=A4;$i.error=new La.Ono(Error);$i.eval=new La.Ono(EvalError);$i.range=new La.Ono(RangeError);$i.reference=new La.Ono(ReferenceError);$i.syntax=new La.Ono(SyntaxError);$i.type=new La.Ono(TypeError);$i.uri=new La.Ono(URIError);var $4=$i;function $i(...t){let e=t[0];if(typeof e=="object"&&typeof e.name=="string"){for(let r of Object.values($4))if(typeof r=="function"&&r.name==="ono"){let n=r[Symbol.species];if(n&&n!==Error&&(e instanceof n||e.name===n.name))return r.apply(void 0,t)}}return $i.error.apply(void 0,t)}});var fA=H(cA=>{"use strict";Object.defineProperty(cA,"__esModule",{value:!0});var zte=ft("util")});var vo=H((oi,Nu)=>{"use strict";var N4=oi&&oi.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),M4=oi&&oi.__exportStar||function(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&N4(e,t,r)};Object.defineProperty(oi,"__esModule",{value:!0});oi.ono=void 0;var dA=uA();Object.defineProperty(oi,"ono",{enumerable:!0,get:function(){return dA.ono}});var F4=fR();Object.defineProperty(oi,"Ono",{enumerable:!0,get:function(){return F4.Ono}});M4(fA(),oi);oi.default=dA.ono;typeof Nu=="object"&&typeof Nu.exports=="object"&&(Nu.exports=Object.assign(Nu.exports.default,Nu.exports))});var dR=H(Pd=>{"use strict";var D4=Pd&&Pd.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Pd,"__esModule",{value:!0});Pd.default=L4;var pA=D4(ft("path"));function L4(t){return t.startsWith("\\\\?\\")?t:t.split(pA.default?.win32?.sep).join(pA.default?.posix?.sep??"/")}});var hA=H(Fg=>{"use strict";Object.defineProperty(Fg,"__esModule",{value:!0});Fg.isWindows=void 0;var j4=/^win/.test(globalThis.process?globalThis.process.platform:""),U4=()=>j4;Fg.isWindows=U4});var Tn=H(qt=>{"use strict";var H4=qt&&qt.__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]})),B4=qt&&qt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),V4=qt&&qt.__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"&&H4(r,e,n[i]);return B4(r,e),r}})(),W4=qt&&qt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(qt,"__esModule",{value:!0});qt.parse=void 0;qt.resolve=mA;qt.cwd=gA;qt.getProtocol=yR;qt.getExtension=X4;qt.stripQuery=yA;qt.getHash=vA;qt.stripHash=mR;qt.isHttp=e3;qt.isFileSystemPath=gR;qt.fromFileSystemPath=t3;qt.toFileSystemPath=r3;qt.safePointerToPath=n3;qt.relative=i3;var Lg=W4(dR()),hR=V4(ft("path")),z4=/\//g,J4=/^(\w{2,}):\/\//i,G4=/~1/g,Y4=/~0/g,K4=ft("path"),Dg=hA(),Q4=[[/\?/g,"%3F"],[/#/g,"%23"]],pR=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],Z4=t=>new URL(t);qt.parse=Z4;function mA(t,e){let r=new URL((0,Lg.default)(t),"https://aaa.nonexistanturl.com"),n=new URL((0,Lg.default)(e),r),i=e.match(/(\s*)$/)?.[1]||"";if(n.hostname==="aaa.nonexistanturl.com"){let{pathname:s,search:o,hash:l}=n;return s+o+l+i}return n.toString()+i}function gA(){if(typeof window<"u")return location.href;let t=process.cwd(),e=t.slice(-1);return e==="/"||e==="\\"?t:t+"/"}function yR(t){let e=J4.exec(t||"");if(e)return e[1].toLowerCase()}function X4(t){let e=t.lastIndexOf(".");return e>=0?yA(t.substr(e).toLowerCase()):""}function yA(t){let e=t.indexOf("?");return e>=0&&(t=t.substr(0,e)),t}function vA(t){if(!t)return"#";let e=t.indexOf("#");return e>=0?t.substring(e):"#"}function mR(t){if(!t)return"";let e=t.indexOf("#");return e>=0&&(t=t.substring(0,e)),t}function e3(t){let e=yR(t);return e==="http"||e==="https"?!0:e===void 0?typeof window<"u":!1}function gR(t){if(typeof window<"u"||typeof process<"u"&&process.browser)return!1;let e=yR(t);return e===void 0||e==="file"}function t3(t){if((0,Dg.isWindows)()){let e=gA(),r=t.toUpperCase(),i=(0,Lg.default)(e).toUpperCase(),s=r.includes(i),o=r.includes(i),l=hR.win32?.isAbsolute(t)||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("file://");!(s||o||l)&&!e.startsWith("http")&&(t=(0,K4.join)(e,t)),t=(0,Lg.default)(t)}t=encodeURI(t);for(let e of Q4)t=t.replace(e[0],e[1]);return t}function r3(t,e){t=decodeURI(t);for(let n=0;n<pR.length;n+=2)t=t.replace(pR[n],pR[n+1]);let r=t.substr(0,7).toLowerCase()==="file://";return r&&(t=t[7]==="/"?t.substr(8):t.substr(7),(0,Dg.isWindows)()&&t[1]==="/"&&(t=t[0]+":"+t.substr(1)),e?t="file:///"+t:(r=!1,t=(0,Dg.isWindows)()?t:"/"+t)),(0,Dg.isWindows)()&&!r&&(t=t.replace(z4,"\\"),t.substr(1,2)===":\\"&&(t=t[0].toUpperCase()+t.substr(1))),t}function n3(t){return t.length<=1||t[0]!=="#"||t[1]!=="/"?[]:t.slice(2).split("/").map(e=>decodeURIComponent(e).replace(G4,"/").replace(Y4,"~"))}function i3(t,e){if(!gR(t)||!gR(e))return mA(t,e);let r=hR.default.dirname(mR(t)),n=mR(e);return hR.default.relative(r,n)+vA(e)}});var An=H(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.InvalidPointerError=Nt.TimeoutError=Nt.MissingPointerError=Nt.UnmatchedResolverError=Nt.ResolverError=Nt.UnmatchedParserError=Nt.ParserError=Nt.JSONParserErrorGroup=Nt.JSONParserError=void 0;Nt.isHandledError=s3;Nt.normalizeError=o3;var bA=vo(),jg=Tn(),ai=class extends Error{constructor(e,r){super(),this.code="EUNKNOWN",this.name="JSONParserError",this.message=e,this.source=r,this.path=null,bA.Ono.extend(this)}get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};Nt.JSONParserError=ai;var Ug=class t extends Error{constructor(e){super(),this.files=e,this.name="JSONParserErrorGroup",this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${(0,jg.toFileSystemPath)(e.$refs._root$Ref.path)}'`,bA.Ono.extend(this)}static getParserErrors(e){let r=[];for(let n of Object.values(e.$refs._$refs))n.errors&&r.push(...n.errors);return r}get errors(){return t.getParserErrors(this.files)}};Nt.JSONParserErrorGroup=Ug;var vR=class extends ai{constructor(e,r){super(`Error parsing ${r}: ${e}`,r),this.code="EPARSER",this.name="ParserError"}};Nt.ParserError=vR;var bR=class extends ai{constructor(e){super(`Could not find parser for "${e}"`,e),this.code="EUNMATCHEDPARSER",this.name="UnmatchedParserError"}};Nt.UnmatchedParserError=bR;var SR=class extends ai{constructor(e,r){super(e.message||`Error reading file "${r}"`,r),this.code="ERESOLVER",this.name="ResolverError","code"in e&&(this.ioErrorCode=String(e.code))}};Nt.ResolverError=SR;var wR=class extends ai{constructor(e){super(`Could not find resolver for "${e}"`,e),this.code="EUNMATCHEDRESOLVER",this.name="UnmatchedResolverError"}};Nt.UnmatchedResolverError=wR;var _R=class extends ai{constructor(e,r,n,i,s){super(`Missing $ref pointer "${(0,jg.getHash)(r)}". Token "${e}" does not exist.`,(0,jg.stripHash)(r)),this.code="EMISSINGPOINTER",this.name="MissingPointerError",this.targetToken=e,this.targetRef=n,this.targetFound=i,this.parentPath=s}};Nt.MissingPointerError=_R;var RR=class extends ai{constructor(e){super(`Dereferencing timeout reached: ${e}ms`),this.code="ETIMEOUT",this.name="TimeoutError"}};Nt.TimeoutError=RR;var CR=class extends ai{constructor(e,r){super(`Invalid $ref pointer "${e}". Pointers must begin with "#/"`,(0,jg.stripHash)(r)),this.code="EUNMATCHEDRESOLVER",this.name="InvalidPointerError"}};Nt.InvalidPointerError=CR;function s3(t){return t instanceof ai||t instanceof Ug}function o3(t){return t.path===null&&(t.path=[]),t}});var Td=H(Kr=>{"use strict";var a3=Kr&&Kr.__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]})),l3=Kr&&Kr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),u3=Kr&&Kr.__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"&&a3(r,e,n[i]);return l3(r,e),r}})(),c3=Kr&&Kr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Kr,"__esModule",{value:!0});Kr.nullSymbol=void 0;var xR=c3(Mu()),ER=u3(Tn()),Bg=An();Kr.nullSymbol=Symbol("null");var f3=/\//g,d3=/~/g,p3=/~1/g,h3=/~0/g,m3=t=>{try{return decodeURIComponent(t)}catch{return t}},Vg=class t{constructor(e,r,n){this.$ref=e,this.path=r,this.originalPath=n||r,this.value=void 0,this.circular=!1,this.indirections=0}resolve(e,r,n){let i=t.parse(this.path,this.originalPath),s=[];this.value=wA(e);for(let o=0;o<i.length;o++){if(Hg(this,r,n)&&(this.path=t.join(this.path,i.slice(o))),typeof this.value=="object"&&this.value!==null&&!_A(n)&&"$ref"in this.value)return this;let l=i[o];if(this.value[l]===void 0||this.value[l]===null&&o===i.length-1){let f=!1;for(let v=i.length-1;v>o;v--){let _=i.slice(o,v+1).join("/");if(this.value[_]!==void 0){this.value=this.value[_],o=v,f=!0;break}}if(f)continue;if(l in this.value&&this.value[l]===null){this.value=Kr.nullSymbol;continue}this.value=null;let c=this.$ref.path||"",p=this.path.replace(c,""),h=t.join("",s),g=n?.replace(c,"");throw new Bg.MissingPointerError(l,decodeURI(this.originalPath),p,h,g)}else this.value=this.value[l];s.push(l)}return(!this.value||this.value.$ref&&ER.resolve(this.path,this.value.$ref)!==n)&&Hg(this,r,n),this}set(e,r,n){let i=t.parse(this.path),s;if(i.length===0)return this.value=r,r;this.value=wA(e);for(let o=0;o<i.length-1;o++)Hg(this,n),s=i[o],this.value&&this.value[s]!==void 0?this.value=this.value[s]:this.value=SA(this,s,{});return Hg(this,n),s=i[i.length-1],SA(this,s,r),e}static parse(e,r){let n=ER.getHash(e).substring(1);if(!n)return[];let i=n.split("/");for(let s=0;s<i.length;s++)i[s]=m3(i[s].replace(p3,"/").replace(h3,"~"));if(i[0]!=="")throw new Bg.InvalidPointerError(n,r===void 0?e:r);return i.slice(1)}static join(e,r){e.indexOf("#")===-1&&(e+="#"),r=Array.isArray(r)?r:[r];for(let n=0;n<r.length;n++){let i=r[n];e+="/"+encodeURIComponent(i.replace(d3,"~0").replace(f3,"~1"))}return e}};function Hg(t,e,r){if(xR.default.isAllowed$Ref(t.value,e)){let n=ER.resolve(t.path,t.value.$ref);if(n===t.path&&!_A(r))t.circular=!0;else{let i=t.$ref.$refs._resolve(n,t.path,e);return i===null?!1:(t.indirections+=i.indirections+1,xR.default.isExtended$Ref(t.value)?(t.value=xR.default.dereference(t.value,i.value),!1):(t.$ref=i.$ref,t.path=i.path,t.value=i.value,!0))}}}Kr.default=Vg;function SA(t,e,r){if(t.value&&typeof t.value=="object")e==="-"&&Array.isArray(t.value)?t.value.push(r):t.value[e]=r;else throw new Bg.JSONParserError(`Error assigning $ref pointer "${t.path}".
240
- Cannot set "${e}" of a non-object.`);return r}function wA(t){if((0,Bg.isHandledError)(t))throw t;return t}function _A(t){return typeof t=="string"&&Vg.parse(t).length==0}});var Mu=H(ps=>{"use strict";var g3=ps&&ps.__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]})),y3=ps&&ps.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),v3=ps&&ps.__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"&&g3(r,e,n[i]);return y3(r,e),r}})();Object.defineProperty(ps,"__esModule",{value:!0});var Wg=v3(Td()),zg=An(),IR=Tn(),OR=class t{constructor(e){this.errors=[],this.$refs=e}addError(e){this.errors===void 0&&(this.errors=[]);let r=this.errors.map(({footprint:n})=>n);"errors"in e&&Array.isArray(e.errors)?this.errors.push(...e.errors.map(zg.normalizeError).filter(({footprint:n})=>!r.includes(n))):(!("footprint"in e)||!r.includes(e.footprint))&&this.errors.push((0,zg.normalizeError)(e))}exists(e,r){try{return this.resolve(e,r),!0}catch{return!1}}get(e,r){return this.resolve(e,r)?.value}resolve(e,r,n,i){let s=new Wg.default(this,e,n);try{let o=s.resolve(this.value,r,i);return o.value===Wg.nullSymbol&&(o.value=null),o}catch(o){if(!r||!r.continueOnError||!(0,zg.isHandledError)(o))throw o;return o.path===null&&(o.path=(0,IR.safePointerToPath)((0,IR.getHash)(i))),o instanceof zg.InvalidPointerError&&(o.source=decodeURI((0,IR.stripHash)(i))),this.addError(o),null}}set(e,r){let n=new Wg.default(this,e);this.value=n.set(this.value,r),this.value===Wg.nullSymbol&&(this.value=null)}static is$Ref(e){return!!e&&typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string"&&e.$ref.length>0}static isExternal$Ref(e){return t.is$Ref(e)&&e.$ref[0]!=="#"}static isAllowed$Ref(e,r){if(this.is$Ref(e)){if(e.$ref.substring(0,2)==="#/"||e.$ref==="#")return!0;if(e.$ref[0]!=="#"&&(!r||r.resolve?.external))return!0}}static isExtended$Ref(e){return t.is$Ref(e)&&Object.keys(e).length>1}static dereference(e,r){if(r&&typeof r=="object"&&t.isExtended$Ref(e)){let n={};for(let i of Object.keys(e))i!=="$ref"&&(n[i]=e[i]);for(let i of Object.keys(r))i in n||(n[i]=r[i]);return n}else return r}};ps.default=OR});var IA=H(li=>{"use strict";var b3=li&&li.__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]})),S3=li&&li.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),w3=li&&li.__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"&&b3(r,e,n[i]);return S3(r,e),r}})(),EA=li&&li.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(li,"__esModule",{value:!0});var RA=vo(),_3=EA(Mu()),bo=w3(Tn()),CA=EA(dR()),qR=class{paths(...e){return xA(this._$refs,e.flat()).map(n=>(0,CA.default)(n.decoded))}values(...e){let r=this._$refs;return xA(r,e.flat()).reduce((i,s)=>(i[(0,CA.default)(s.decoded)]=r[s.encoded].value,i),{})}exists(e,r){try{return this._resolve(e,"",r),!0}catch{return!1}}get(e,r){return this._resolve(e,"",r).value}set(e,r){let n=bo.resolve(this._root$Ref.path,e),i=bo.stripHash(n),s=this._$refs[i];if(!s)throw(0,RA.ono)(`Error resolving $ref pointer "${e}".
241
- "${i}" not found.`);s.set(n,r)}_get$Ref(e){e=bo.resolve(this._root$Ref.path,e);let r=bo.stripHash(e);return this._$refs[r]}_add(e){let r=bo.stripHash(e),n=new _3.default(this);return n.path=r,this._$refs[r]=n,this._root$Ref=this._root$Ref||n,n}_resolve(e,r,n){let i=bo.resolve(this._root$Ref.path,e),s=bo.stripHash(i),o=this._$refs[s];if(!o)throw(0,RA.ono)(`Error resolving $ref pointer "${e}".
242
- "${s}" not found.`);return o.resolve(i,n,e,r)}constructor(){this._$refs={},this.toJSON=this.values,this.circular=!1,this._$refs={},this._root$Ref=null}};li.default=qR;function xA(t,e){let r=Object.keys(t);return e=Array.isArray(e[0])?e[0]:Array.prototype.slice.call(e),e.length>0&&e[0]&&(r=r.filter(n=>e.includes(t[n].pathType))),r.map(n=>({encoded:n,decoded:t[n].pathType==="file"?bo.toFileSystemPath(n,!0):n}))}});var qA=H(Fu=>{"use strict";Object.defineProperty(Fu,"__esModule",{value:!0});Fu.all=R3;Fu.filter=C3;Fu.sort=x3;Fu.run=E3;function R3(t){return Object.keys(t||{}).filter(e=>typeof t[e]=="object").map(e=>(t[e].name=e,t[e]))}function C3(t,e,r){return t.filter(n=>!!OA(n,e,r))}function x3(t){for(let e of t)e.order=e.order||Number.MAX_SAFE_INTEGER;return t.sort((e,r)=>e.order-r.order)}async function E3(t,e,r,n){let i,s,o=0;return new Promise((l,f)=>{c();function c(){if(i=t[o++],!i)return f(s);try{let v=OA(i,e,r,p,n);if(v&&typeof v.then=="function")v.then(h,g);else if(v!==void 0)h(v);else if(o===t.length)throw new Error("No promise has been returned or callback has been called.")}catch(v){g(v)}}function p(v,_){v?g(v):h(_)}function h(v){l({plugin:i,result:v})}function g(v){s={plugin:i,error:v},c()}})}function OA(t,e,r,n,i){let s=t[e];if(typeof s=="function")return s.apply(t,[r,n,i]);if(!n){if(s instanceof RegExp)return s.test(r.url);if(typeof s=="string")return s===r.extension;if(Array.isArray(s))return s.indexOf(r.extension)!==-1}return s}});var PR=H(hs=>{"use strict";var I3=hs&&hs.__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]})),O3=hs&&hs.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),kA=hs&&hs.__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"&&I3(r,e,n[i]);return O3(r,e),r}})();Object.defineProperty(hs,"__esModule",{value:!0});var kR=vo(),q3=kA(Tn()),So=kA(qA()),ja=An();async function k3(t,e,r){let n=t.indexOf("#"),i="";n>=0&&(i=t.substring(n),t=t.substring(0,n));let s=e._add(t),o={url:t,hash:i,extension:q3.getExtension(t)};try{let l=await P3(o,r,e);s.pathType=l.plugin.name,o.data=l.result;let f=await T3(o,r,e);return s.value=f.result,f.result}catch(l){throw(0,ja.isHandledError)(l)&&(s.value=l),l}}async function P3(t,e,r){let n=So.all(e.resolve);n=So.filter(n,"canRead",t),So.sort(n);try{return await So.run(n,"read",t,r)}catch(i){throw!i&&e.continueOnError?new ja.UnmatchedResolverError(t.url):!i||!("error"in i)?kR.ono.syntax(`Unable to resolve $ref pointer "${t.url}"`):i.error instanceof ja.ResolverError?i.error:new ja.ResolverError(i,t.url)}}async function T3(t,e,r){let n=So.all(e.parse),i=So.filter(n,"canParse",t),s=i.length>0?i:n;So.sort(s);try{let o=await So.run(s,"parse",t,r);if(!o.plugin.allowEmpty&&A3(o.result))throw kR.ono.syntax(`Error parsing "${t.url}" as ${o.plugin.name}.
239
+ `:"")+r.message),{originalError:r,props:n,message:s}}$u.normalizeArgs=k4});var fR=H(Ng=>{"use strict";Object.defineProperty(Ng,"__esModule",{value:!0});Ng.Ono=void 0;var $g=oA(),lA=aA(),P4=Pg(),T4=cR;Ng.Ono=T4;function cR(t,e){e=lA.normalizeOptions(e);function r(...n){let{originalError:i,props:s,message:o}=lA.normalizeArgs(n,e),l=new t(o);return $g.extendError(l,i,s)}return r[Symbol.species]=t,r}cR.toJSON=function(e){return P4.toJSON.call(e)};cR.extend=function(e,r,n){return n||r instanceof Error?$g.extendError(e,r,n):r?$g.extendError(e,void 0,r):$g.extendError(e)}});var uA=H(Mg=>{"use strict";Object.defineProperty(Mg,"__esModule",{value:!0});Mg.ono=void 0;var La=fR(),A4=$i;Mg.ono=A4;$i.error=new La.Ono(Error);$i.eval=new La.Ono(EvalError);$i.range=new La.Ono(RangeError);$i.reference=new La.Ono(ReferenceError);$i.syntax=new La.Ono(SyntaxError);$i.type=new La.Ono(TypeError);$i.uri=new La.Ono(URIError);var $4=$i;function $i(...t){let e=t[0];if(typeof e=="object"&&typeof e.name=="string"){for(let r of Object.values($4))if(typeof r=="function"&&r.name==="ono"){let n=r[Symbol.species];if(n&&n!==Error&&(e instanceof n||e.name===n.name))return r.apply(void 0,t)}}return $i.error.apply(void 0,t)}});var fA=H(cA=>{"use strict";Object.defineProperty(cA,"__esModule",{value:!0});var zte=ft("util")});var bo=H((oi,Nu)=>{"use strict";var N4=oi&&oi.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),M4=oi&&oi.__exportStar||function(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&N4(e,t,r)};Object.defineProperty(oi,"__esModule",{value:!0});oi.ono=void 0;var dA=uA();Object.defineProperty(oi,"ono",{enumerable:!0,get:function(){return dA.ono}});var F4=fR();Object.defineProperty(oi,"Ono",{enumerable:!0,get:function(){return F4.Ono}});M4(fA(),oi);oi.default=dA.ono;typeof Nu=="object"&&typeof Nu.exports=="object"&&(Nu.exports=Object.assign(Nu.exports.default,Nu.exports))});var dR=H(Pd=>{"use strict";var D4=Pd&&Pd.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Pd,"__esModule",{value:!0});Pd.default=L4;var pA=D4(ft("path"));function L4(t){return t.startsWith("\\\\?\\")?t:t.split(pA.default?.win32?.sep).join(pA.default?.posix?.sep??"/")}});var hA=H(Fg=>{"use strict";Object.defineProperty(Fg,"__esModule",{value:!0});Fg.isWindows=void 0;var j4=/^win/.test(globalThis.process?globalThis.process.platform:""),U4=()=>j4;Fg.isWindows=U4});var Tn=H(qt=>{"use strict";var H4=qt&&qt.__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]})),B4=qt&&qt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),V4=qt&&qt.__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"&&H4(r,e,n[i]);return B4(r,e),r}})(),W4=qt&&qt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(qt,"__esModule",{value:!0});qt.parse=void 0;qt.resolve=mA;qt.cwd=gA;qt.getProtocol=yR;qt.getExtension=X4;qt.stripQuery=yA;qt.getHash=vA;qt.stripHash=mR;qt.isHttp=e3;qt.isFileSystemPath=gR;qt.fromFileSystemPath=t3;qt.toFileSystemPath=r3;qt.safePointerToPath=n3;qt.relative=i3;var Lg=W4(dR()),hR=V4(ft("path")),z4=/\//g,J4=/^(\w{2,}):\/\//i,G4=/~1/g,Y4=/~0/g,K4=ft("path"),Dg=hA(),Q4=[[/\?/g,"%3F"],[/#/g,"%23"]],pR=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],Z4=t=>new URL(t);qt.parse=Z4;function mA(t,e){let r=new URL((0,Lg.default)(t),"https://aaa.nonexistanturl.com"),n=new URL((0,Lg.default)(e),r),i=e.match(/(\s*)$/)?.[1]||"";if(n.hostname==="aaa.nonexistanturl.com"){let{pathname:s,search:o,hash:l}=n;return s+o+l+i}return n.toString()+i}function gA(){if(typeof window<"u")return location.href;let t=process.cwd(),e=t.slice(-1);return e==="/"||e==="\\"?t:t+"/"}function yR(t){let e=J4.exec(t||"");if(e)return e[1].toLowerCase()}function X4(t){let e=t.lastIndexOf(".");return e>=0?yA(t.substr(e).toLowerCase()):""}function yA(t){let e=t.indexOf("?");return e>=0&&(t=t.substr(0,e)),t}function vA(t){if(!t)return"#";let e=t.indexOf("#");return e>=0?t.substring(e):"#"}function mR(t){if(!t)return"";let e=t.indexOf("#");return e>=0&&(t=t.substring(0,e)),t}function e3(t){let e=yR(t);return e==="http"||e==="https"?!0:e===void 0?typeof window<"u":!1}function gR(t){if(typeof window<"u"||typeof process<"u"&&process.browser)return!1;let e=yR(t);return e===void 0||e==="file"}function t3(t){if((0,Dg.isWindows)()){let e=gA(),r=t.toUpperCase(),i=(0,Lg.default)(e).toUpperCase(),s=r.includes(i),o=r.includes(i),l=hR.win32?.isAbsolute(t)||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("file://");!(s||o||l)&&!e.startsWith("http")&&(t=(0,K4.join)(e,t)),t=(0,Lg.default)(t)}t=encodeURI(t);for(let e of Q4)t=t.replace(e[0],e[1]);return t}function r3(t,e){t=decodeURI(t);for(let n=0;n<pR.length;n+=2)t=t.replace(pR[n],pR[n+1]);let r=t.substr(0,7).toLowerCase()==="file://";return r&&(t=t[7]==="/"?t.substr(8):t.substr(7),(0,Dg.isWindows)()&&t[1]==="/"&&(t=t[0]+":"+t.substr(1)),e?t="file:///"+t:(r=!1,t=(0,Dg.isWindows)()?t:"/"+t)),(0,Dg.isWindows)()&&!r&&(t=t.replace(z4,"\\"),t.substr(1,2)===":\\"&&(t=t[0].toUpperCase()+t.substr(1))),t}function n3(t){return t.length<=1||t[0]!=="#"||t[1]!=="/"?[]:t.slice(2).split("/").map(e=>decodeURIComponent(e).replace(G4,"/").replace(Y4,"~"))}function i3(t,e){if(!gR(t)||!gR(e))return mA(t,e);let r=hR.default.dirname(mR(t)),n=mR(e);return hR.default.relative(r,n)+vA(e)}});var An=H(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.InvalidPointerError=Ft.TimeoutError=Ft.MissingPointerError=Ft.UnmatchedResolverError=Ft.ResolverError=Ft.UnmatchedParserError=Ft.ParserError=Ft.JSONParserErrorGroup=Ft.JSONParserError=void 0;Ft.isHandledError=s3;Ft.normalizeError=o3;var bA=bo(),jg=Tn(),ai=class extends Error{constructor(e,r){super(),this.code="EUNKNOWN",this.name="JSONParserError",this.message=e,this.source=r,this.path=null,bA.Ono.extend(this)}get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};Ft.JSONParserError=ai;var Ug=class t extends Error{constructor(e){super(),this.files=e,this.name="JSONParserErrorGroup",this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${(0,jg.toFileSystemPath)(e.$refs._root$Ref.path)}'`,bA.Ono.extend(this)}static getParserErrors(e){let r=[];for(let n of Object.values(e.$refs._$refs))n.errors&&r.push(...n.errors);return r}get errors(){return t.getParserErrors(this.files)}};Ft.JSONParserErrorGroup=Ug;var vR=class extends ai{constructor(e,r){super(`Error parsing ${r}: ${e}`,r),this.code="EPARSER",this.name="ParserError"}};Ft.ParserError=vR;var bR=class extends ai{constructor(e){super(`Could not find parser for "${e}"`,e),this.code="EUNMATCHEDPARSER",this.name="UnmatchedParserError"}};Ft.UnmatchedParserError=bR;var SR=class extends ai{constructor(e,r){super(e.message||`Error reading file "${r}"`,r),this.code="ERESOLVER",this.name="ResolverError","code"in e&&(this.ioErrorCode=String(e.code))}};Ft.ResolverError=SR;var wR=class extends ai{constructor(e){super(`Could not find resolver for "${e}"`,e),this.code="EUNMATCHEDRESOLVER",this.name="UnmatchedResolverError"}};Ft.UnmatchedResolverError=wR;var _R=class extends ai{constructor(e,r,n,i,s){super(`Missing $ref pointer "${(0,jg.getHash)(r)}". Token "${e}" does not exist.`,(0,jg.stripHash)(r)),this.code="EMISSINGPOINTER",this.name="MissingPointerError",this.targetToken=e,this.targetRef=n,this.targetFound=i,this.parentPath=s}};Ft.MissingPointerError=_R;var RR=class extends ai{constructor(e){super(`Dereferencing timeout reached: ${e}ms`),this.code="ETIMEOUT",this.name="TimeoutError"}};Ft.TimeoutError=RR;var CR=class extends ai{constructor(e,r){super(`Invalid $ref pointer "${e}". Pointers must begin with "#/"`,(0,jg.stripHash)(r)),this.code="EUNMATCHEDRESOLVER",this.name="InvalidPointerError"}};Ft.InvalidPointerError=CR;function s3(t){return t instanceof ai||t instanceof Ug}function o3(t){return t.path===null&&(t.path=[]),t}});var Td=H(Kr=>{"use strict";var a3=Kr&&Kr.__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]})),l3=Kr&&Kr.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),u3=Kr&&Kr.__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"&&a3(r,e,n[i]);return l3(r,e),r}})(),c3=Kr&&Kr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Kr,"__esModule",{value:!0});Kr.nullSymbol=void 0;var xR=c3(Mu()),ER=u3(Tn()),Bg=An();Kr.nullSymbol=Symbol("null");var f3=/\//g,d3=/~/g,p3=/~1/g,h3=/~0/g,m3=t=>{try{return decodeURIComponent(t)}catch{return t}},Vg=class t{constructor(e,r,n){this.$ref=e,this.path=r,this.originalPath=n||r,this.value=void 0,this.circular=!1,this.indirections=0}resolve(e,r,n){let i=t.parse(this.path,this.originalPath),s=[];this.value=wA(e);for(let o=0;o<i.length;o++){if(Hg(this,r,n)&&(this.path=t.join(this.path,i.slice(o))),typeof this.value=="object"&&this.value!==null&&!_A(n)&&"$ref"in this.value)return this;let l=i[o];if(this.value[l]===void 0||this.value[l]===null&&o===i.length-1){let f=!1;for(let v=i.length-1;v>o;v--){let _=i.slice(o,v+1).join("/");if(this.value[_]!==void 0){this.value=this.value[_],o=v,f=!0;break}}if(f)continue;if(l in this.value&&this.value[l]===null){this.value=Kr.nullSymbol;continue}this.value=null;let c=this.$ref.path||"",p=this.path.replace(c,""),h=t.join("",s),g=n?.replace(c,"");throw new Bg.MissingPointerError(l,decodeURI(this.originalPath),p,h,g)}else this.value=this.value[l];s.push(l)}return(!this.value||this.value.$ref&&ER.resolve(this.path,this.value.$ref)!==n)&&Hg(this,r,n),this}set(e,r,n){let i=t.parse(this.path),s;if(i.length===0)return this.value=r,r;this.value=wA(e);for(let o=0;o<i.length-1;o++)Hg(this,n),s=i[o],this.value&&this.value[s]!==void 0?this.value=this.value[s]:this.value=SA(this,s,{});return Hg(this,n),s=i[i.length-1],SA(this,s,r),e}static parse(e,r){let n=ER.getHash(e).substring(1);if(!n)return[];let i=n.split("/");for(let s=0;s<i.length;s++)i[s]=m3(i[s].replace(p3,"/").replace(h3,"~"));if(i[0]!=="")throw new Bg.InvalidPointerError(n,r===void 0?e:r);return i.slice(1)}static join(e,r){e.indexOf("#")===-1&&(e+="#"),r=Array.isArray(r)?r:[r];for(let n=0;n<r.length;n++){let i=r[n];e+="/"+encodeURIComponent(i.replace(d3,"~0").replace(f3,"~1"))}return e}};function Hg(t,e,r){if(xR.default.isAllowed$Ref(t.value,e)){let n=ER.resolve(t.path,t.value.$ref);if(n===t.path&&!_A(r))t.circular=!0;else{let i=t.$ref.$refs._resolve(n,t.path,e);return i===null?!1:(t.indirections+=i.indirections+1,xR.default.isExtended$Ref(t.value)?(t.value=xR.default.dereference(t.value,i.value),!1):(t.$ref=i.$ref,t.path=i.path,t.value=i.value,!0))}}}Kr.default=Vg;function SA(t,e,r){if(t.value&&typeof t.value=="object")e==="-"&&Array.isArray(t.value)?t.value.push(r):t.value[e]=r;else throw new Bg.JSONParserError(`Error assigning $ref pointer "${t.path}".
240
+ Cannot set "${e}" of a non-object.`);return r}function wA(t){if((0,Bg.isHandledError)(t))throw t;return t}function _A(t){return typeof t=="string"&&Vg.parse(t).length==0}});var Mu=H(ps=>{"use strict";var g3=ps&&ps.__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]})),y3=ps&&ps.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),v3=ps&&ps.__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"&&g3(r,e,n[i]);return y3(r,e),r}})();Object.defineProperty(ps,"__esModule",{value:!0});var Wg=v3(Td()),zg=An(),IR=Tn(),OR=class t{constructor(e){this.errors=[],this.$refs=e}addError(e){this.errors===void 0&&(this.errors=[]);let r=this.errors.map(({footprint:n})=>n);"errors"in e&&Array.isArray(e.errors)?this.errors.push(...e.errors.map(zg.normalizeError).filter(({footprint:n})=>!r.includes(n))):(!("footprint"in e)||!r.includes(e.footprint))&&this.errors.push((0,zg.normalizeError)(e))}exists(e,r){try{return this.resolve(e,r),!0}catch{return!1}}get(e,r){return this.resolve(e,r)?.value}resolve(e,r,n,i){let s=new Wg.default(this,e,n);try{let o=s.resolve(this.value,r,i);return o.value===Wg.nullSymbol&&(o.value=null),o}catch(o){if(!r||!r.continueOnError||!(0,zg.isHandledError)(o))throw o;return o.path===null&&(o.path=(0,IR.safePointerToPath)((0,IR.getHash)(i))),o instanceof zg.InvalidPointerError&&(o.source=decodeURI((0,IR.stripHash)(i))),this.addError(o),null}}set(e,r){let n=new Wg.default(this,e);this.value=n.set(this.value,r),this.value===Wg.nullSymbol&&(this.value=null)}static is$Ref(e){return!!e&&typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string"&&e.$ref.length>0}static isExternal$Ref(e){return t.is$Ref(e)&&e.$ref[0]!=="#"}static isAllowed$Ref(e,r){if(this.is$Ref(e)){if(e.$ref.substring(0,2)==="#/"||e.$ref==="#")return!0;if(e.$ref[0]!=="#"&&(!r||r.resolve?.external))return!0}}static isExtended$Ref(e){return t.is$Ref(e)&&Object.keys(e).length>1}static dereference(e,r){if(r&&typeof r=="object"&&t.isExtended$Ref(e)){let n={};for(let i of Object.keys(e))i!=="$ref"&&(n[i]=e[i]);for(let i of Object.keys(r))i in n||(n[i]=r[i]);return n}else return r}};ps.default=OR});var IA=H(li=>{"use strict";var b3=li&&li.__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]})),S3=li&&li.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),w3=li&&li.__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"&&b3(r,e,n[i]);return S3(r,e),r}})(),EA=li&&li.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(li,"__esModule",{value:!0});var RA=bo(),_3=EA(Mu()),So=w3(Tn()),CA=EA(dR()),qR=class{paths(...e){return xA(this._$refs,e.flat()).map(n=>(0,CA.default)(n.decoded))}values(...e){let r=this._$refs;return xA(r,e.flat()).reduce((i,s)=>(i[(0,CA.default)(s.decoded)]=r[s.encoded].value,i),{})}exists(e,r){try{return this._resolve(e,"",r),!0}catch{return!1}}get(e,r){return this._resolve(e,"",r).value}set(e,r){let n=So.resolve(this._root$Ref.path,e),i=So.stripHash(n),s=this._$refs[i];if(!s)throw(0,RA.ono)(`Error resolving $ref pointer "${e}".
241
+ "${i}" not found.`);s.set(n,r)}_get$Ref(e){e=So.resolve(this._root$Ref.path,e);let r=So.stripHash(e);return this._$refs[r]}_add(e){let r=So.stripHash(e),n=new _3.default(this);return n.path=r,this._$refs[r]=n,this._root$Ref=this._root$Ref||n,n}_resolve(e,r,n){let i=So.resolve(this._root$Ref.path,e),s=So.stripHash(i),o=this._$refs[s];if(!o)throw(0,RA.ono)(`Error resolving $ref pointer "${e}".
242
+ "${s}" not found.`);return o.resolve(i,n,e,r)}constructor(){this._$refs={},this.toJSON=this.values,this.circular=!1,this._$refs={},this._root$Ref=null}};li.default=qR;function xA(t,e){let r=Object.keys(t);return e=Array.isArray(e[0])?e[0]:Array.prototype.slice.call(e),e.length>0&&e[0]&&(r=r.filter(n=>e.includes(t[n].pathType))),r.map(n=>({encoded:n,decoded:t[n].pathType==="file"?So.toFileSystemPath(n,!0):n}))}});var qA=H(Fu=>{"use strict";Object.defineProperty(Fu,"__esModule",{value:!0});Fu.all=R3;Fu.filter=C3;Fu.sort=x3;Fu.run=E3;function R3(t){return Object.keys(t||{}).filter(e=>typeof t[e]=="object").map(e=>(t[e].name=e,t[e]))}function C3(t,e,r){return t.filter(n=>!!OA(n,e,r))}function x3(t){for(let e of t)e.order=e.order||Number.MAX_SAFE_INTEGER;return t.sort((e,r)=>e.order-r.order)}async function E3(t,e,r,n){let i,s,o=0;return new Promise((l,f)=>{c();function c(){if(i=t[o++],!i)return f(s);try{let v=OA(i,e,r,p,n);if(v&&typeof v.then=="function")v.then(h,g);else if(v!==void 0)h(v);else if(o===t.length)throw new Error("No promise has been returned or callback has been called.")}catch(v){g(v)}}function p(v,_){v?g(v):h(_)}function h(v){l({plugin:i,result:v})}function g(v){s={plugin:i,error:v},c()}})}function OA(t,e,r,n,i){let s=t[e];if(typeof s=="function")return s.apply(t,[r,n,i]);if(!n){if(s instanceof RegExp)return s.test(r.url);if(typeof s=="string")return s===r.extension;if(Array.isArray(s))return s.indexOf(r.extension)!==-1}return s}});var PR=H(hs=>{"use strict";var I3=hs&&hs.__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]})),O3=hs&&hs.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),kA=hs&&hs.__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"&&I3(r,e,n[i]);return O3(r,e),r}})();Object.defineProperty(hs,"__esModule",{value:!0});var kR=bo(),q3=kA(Tn()),wo=kA(qA()),ja=An();async function k3(t,e,r){let n=t.indexOf("#"),i="";n>=0&&(i=t.substring(n),t=t.substring(0,n));let s=e._add(t),o={url:t,hash:i,extension:q3.getExtension(t)};try{let l=await P3(o,r,e);s.pathType=l.plugin.name,o.data=l.result;let f=await T3(o,r,e);return s.value=f.result,f.result}catch(l){throw(0,ja.isHandledError)(l)&&(s.value=l),l}}async function P3(t,e,r){let n=wo.all(e.resolve);n=wo.filter(n,"canRead",t),wo.sort(n);try{return await wo.run(n,"read",t,r)}catch(i){throw!i&&e.continueOnError?new ja.UnmatchedResolverError(t.url):!i||!("error"in i)?kR.ono.syntax(`Unable to resolve $ref pointer "${t.url}"`):i.error instanceof ja.ResolverError?i.error:new ja.ResolverError(i,t.url)}}async function T3(t,e,r){let n=wo.all(e.parse),i=wo.filter(n,"canParse",t),s=i.length>0?i:n;wo.sort(s);try{let o=await wo.run(s,"parse",t,r);if(!o.plugin.allowEmpty&&A3(o.result))throw kR.ono.syntax(`Error parsing "${t.url}" as ${o.plugin.name}.
243
243
  Parsed value is empty`);return o}catch(o){throw!o&&e.continueOnError?new ja.UnmatchedParserError(t.url):o&&o.message&&o.message.startsWith("Error parsing")?o:!o||!("error"in o)?kR.ono.syntax(`Unable to parse ${t.url}`):o.error instanceof ja.ParserError?o.error:new ja.ParserError(o.error.message,t.url)}}function A3(t){return t===void 0||typeof t=="object"&&Object.keys(t).length===0||typeof t=="string"&&t.trim().length===0||Buffer.isBuffer(t)&&t.length===0}hs.default=k3});var TA=H(TR=>{"use strict";Object.defineProperty(TR,"__esModule",{value:!0});var PA=An();TR.default={order:100,allowEmpty:!0,canParse:".json",allowBOM:!0,async parse(t){let e=t.data;if(Buffer.isBuffer(e)&&(e=e.toString()),typeof e=="string"){if(e.trim().length===0)return;try{return JSON.parse(e)}catch(r){if(this.allowBOM)try{let n=e.indexOf("{");return e=e.slice(n),JSON.parse(e)}catch(n){throw new PA.ParserError(n.message,t.url)}throw new PA.ParserError(r.message,t.url)}}else return e}}});var Du=H((ire,Ua)=>{"use strict";function AA(t){return typeof t>"u"||t===null}function $3(t){return typeof t=="object"&&t!==null}function N3(t){return Array.isArray(t)?t:AA(t)?[]:[t]}function M3(t,e){if(e){let r=Object.keys(e);for(let n=0,i=r.length;n<i;n+=1){let s=r[n];t[s]=e[s]}}return t}function F3(t,e){let r="";for(let n=0;n<e;n+=1)r+=t;return r}function D3(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}Ua.exports.isNothing=AA;Ua.exports.isObject=$3;Ua.exports.toArray=N3;Ua.exports.repeat=F3;Ua.exports.isNegativeZero=D3;Ua.exports.extend=M3});var Lu=H((sre,NA)=>{"use strict";function $A(t,e){let r="",n=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(r+='in "'+t.mark.name+'" '),r+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(r+=`
244
244
 
245
245
  `+t.mark.snippet),n+" "+r):n}function Ad(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=$A(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Ad.prototype=Object.create(Error.prototype);Ad.prototype.constructor=Ad;Ad.prototype.toString=function(e){return this.name+": "+$A(this,e)};NA.exports=Ad});var FA=H((ore,MA)=>{"use strict";var $d=Du();function AR(t,e,r,n,i){let s="",o="",l=Math.floor(i/2)-1;return n-e>l&&(s=" ... ",e=n-l+s.length),r-n>l&&(o=" ...",r=n+l-o.length),{str:s+t.slice(e,r).replace(/\t/g,"\u2192")+o,pos:n-e+s.length}}function $R(t,e){return $d.repeat(" ",e-t.length)+t}function L3(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);let r=/\r?\n|\r|\0/g,n=[0],i=[],s,o=-1;for(;s=r.exec(t.buffer);)i.push(s.index),n.push(s.index+s[0].length),t.position<=s.index&&o<0&&(o=n.length-2);o<0&&(o=n.length-1);let l="",f=Math.min(t.line+e.linesAfter,i.length).toString().length,c=e.maxLength-(e.indent+f+3);for(let h=1;h<=e.linesBefore&&!(o-h<0);h++){let g=AR(t.buffer,n[o-h],i[o-h],t.position-(n[o]-n[o-h]),c);l=$d.repeat(" ",e.indent)+$R((t.line-h+1).toString(),f)+" | "+g.str+`
@@ -248,14 +248,14 @@ Parsed value is empty`);return o}catch(o){throw!o&&e.continueOnError?new ja.Unma
248
248
  `;for(let h=1;h<=e.linesAfter&&!(o+h>=i.length);h++){let g=AR(t.buffer,n[o+h],i[o+h],t.position-(n[o]-n[o+h]),c);l+=$d.repeat(" ",e.indent)+$R((t.line+h+1).toString(),f)+" | "+g.str+`
249
249
  `}return l.replace(/\n$/,"")}MA.exports=L3});var br=H((are,LA)=>{"use strict";var DA=Lu(),j3=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],U3=["scalar","sequence","mapping"];function H3(t){let e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}function B3(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(j3.indexOf(r)===-1)throw new DA('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=H3(e.styleAliases||null),U3.indexOf(this.kind)===-1)throw new DA('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}LA.exports=B3});var FR=H((lre,UA)=>{"use strict";var Nd=Lu(),NR=br();function jA(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 V3(){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 MR(t){return this.extend(t)}MR.prototype.extend=function(e){let r=[],n=[];if(e instanceof NR)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 Nd("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(s){if(!(s instanceof NR))throw new Nd("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new Nd("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 Nd("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 NR))throw new Nd("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let i=Object.create(MR.prototype);return i.implicit=(this.implicit||[]).concat(r),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=jA(i,"implicit"),i.compiledExplicit=jA(i,"explicit"),i.compiledTypeMap=V3(i.compiledImplicit,i.compiledExplicit),i};UA.exports=MR});var DR=H((ure,HA)=>{"use strict";var W3=br();HA.exports=new W3("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}})});var LR=H((cre,BA)=>{"use strict";var z3=br();BA.exports=new z3("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}})});var jR=H((fre,VA)=>{"use strict";var J3=br();VA.exports=new J3("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}})});var UR=H((dre,WA)=>{"use strict";var G3=FR();WA.exports=new G3({explicit:[DR(),LR(),jR()]})});var HR=H((pre,zA)=>{"use strict";var Y3=br();function K3(t){if(t===null)return!0;let e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}function Q3(){return null}function Z3(t){return t===null}zA.exports=new Y3("tag:yaml.org,2002:null",{kind:"scalar",resolve:K3,construct:Q3,predicate:Z3,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"})});var BR=H((hre,JA)=>{"use strict";var X3=br();function e6(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 t6(t){return t==="true"||t==="True"||t==="TRUE"}function r6(t){return Object.prototype.toString.call(t)==="[object Boolean]"}JA.exports=new X3("tag:yaml.org,2002:bool",{kind:"scalar",resolve:e6,construct:t6,predicate:r6,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 VR=H((mre,GA)=>{"use strict";var n6=Du(),i6=br();function s6(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function o6(t){return t>=48&&t<=55}function a6(t){return t>=48&&t<=57}function l6(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(Md(t))}if(i==="x"){for(r++;r<e;r++){if(!s6(t.charCodeAt(r)))return!1;n=!0}return n&&Number.isFinite(Md(t))}if(i==="o"){for(r++;r<e;r++){if(!o6(t.charCodeAt(r)))return!1;n=!0}return n&&Number.isFinite(Md(t))}}for(;r<e;r++){if(!a6(t.charCodeAt(r)))return!1;n=!0}return n?Number.isFinite(Md(t)):!1}function Md(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 u6(t){return Md(t)}function c6(t){return Object.prototype.toString.call(t)==="[object Number]"&&t%1===0&&!n6.isNegativeZero(t)}GA.exports=new i6("tag:yaml.org,2002:int",{kind:"scalar",resolve:l6,construct:u6,predicate:c6,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 WR=H((gre,KA)=>{"use strict";var YA=Du(),f6=br(),d6=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),p6=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function h6(t){return t===null||!d6.test(t)?!1:Number.isFinite(parseFloat(t,10))?!0:p6.test(t)}function m6(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 g6=/^[-+]?[0-9]+e/;function y6(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(YA.isNegativeZero(t))return"-0.0";let r=t.toString(10);return g6.test(r)?r.replace("e",".e"):r}function v6(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||YA.isNegativeZero(t))}KA.exports=new f6("tag:yaml.org,2002:float",{kind:"scalar",resolve:h6,construct:m6,predicate:v6,represent:y6,defaultStyle:"lowercase"})});var zR=H((yre,QA)=>{"use strict";QA.exports=UR().extend({implicit:[HR(),BR(),VR(),WR()]})});var JR=H((vre,ZA)=>{"use strict";ZA.exports=zR()});var GR=H((bre,t1)=>{"use strict";var b6=br(),XA=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),e1=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 S6(t){return t===null?!1:XA.exec(t)!==null||e1.exec(t)!==null}function w6(t){let e=0,r=null,n=XA.exec(t);if(n===null&&(n=e1.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],f=+n[5],c=+n[6];if(n[7]){for(e=n[7].slice(0,3);e.length<3;)e+="0";e=+e}if(n[9]){let h=+n[10],g=+(n[11]||0);r=(h*60+g)*6e4,n[9]==="-"&&(r=-r)}let p=new Date(Date.UTC(i,s,o,l,f,c,e));return r&&p.setTime(p.getTime()-r),p}function _6(t){return t.toISOString()}t1.exports=new b6("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:S6,construct:w6,instanceOf:Date,represent:_6})});var YR=H((Sre,r1)=>{"use strict";var R6=br();function C6(t){return t==="<<"||t===null}r1.exports=new R6("tag:yaml.org,2002:merge",{kind:"scalar",resolve:C6})});var QR=H((wre,n1)=>{"use strict";var x6=br(),KR=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
250
250
  \r`;function E6(t){if(t===null)return!1;let e=0,r=t.length,n=KR;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 I6(t){let e=t.replace(/[\r\n=]/g,""),r=e.length,n=KR,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 O6(t){let e="",r=0,n=t.length,i=KR;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 q6(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}n1.exports=new x6("tag:yaml.org,2002:binary",{kind:"scalar",resolve:E6,construct:I6,predicate:q6,represent:O6})});var ZR=H((_re,i1)=>{"use strict";var k6=br(),P6=Object.prototype.hasOwnProperty,T6=Object.prototype.toString;function A6(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(T6.call(s)!=="[object Object]")return!1;let l;for(l in s)if(P6.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 $6(t){return t!==null?t:[]}i1.exports=new k6("tag:yaml.org,2002:omap",{kind:"sequence",resolve:A6,construct:$6})});var XR=H((Rre,s1)=>{"use strict";var N6=br(),M6=Object.prototype.toString;function F6(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(M6.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 D6(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}s1.exports=new N6("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:F6,construct:D6})});var eC=H((Cre,o1)=>{"use strict";var L6=br(),j6=Object.prototype.hasOwnProperty;function U6(t){if(t===null)return!0;let e=t;for(let r in e)if(j6.call(e,r)&&e[r]!==null)return!1;return!0}function H6(t){return t!==null?t:{}}o1.exports=new L6("tag:yaml.org,2002:set",{kind:"mapping",resolve:U6,construct:H6})});var Jg=H((xre,a1)=>{"use strict";a1.exports=JR().extend({implicit:[GR(),YR()],explicit:[QR(),ZR(),XR(),eC()]})});var I1=H((Ere,iC)=>{"use strict";var Ha=Du(),m1=Lu(),B6=FA(),V6=Jg(),ui=Object.prototype.hasOwnProperty,Gg=1,g1=2,y1=3,Yg=4,tC=1,W6=2,l1=3,z6=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,J6=/[\x85\u2028\u2029]/,G6=/[,\[\]{}]/,v1=/^(?:!|!!|![0-9A-Za-z-]+!)$/,b1=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function u1(t){return Object.prototype.toString.call(t)}function Ni(t){return t===10||t===13}function ms(t){return t===9||t===32}function Qr(t){return t===9||t===32||t===10||t===13}function ju(t){return t===44||t===91||t===93||t===123||t===125}function Y6(t){if(t>=48&&t<=57)return t-48;let e=t|32;return e>=97&&e<=102?e-97+10:-1}function K6(t){return t===120?2:t===117?4:t===85?8:0}function Q6(t){return t>=48&&t<=57?t-48:-1}function c1(t){switch(t){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
251
- `;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 Z6(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}function S1(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}var w1=new Array(256),_1=new Array(256);for(let t=0;t<256;t++)w1[t]=c1(t)?1:0,_1[t]=c1(t);function X6(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||V6,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 R1(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=B6(r),new m1(e,r)}function me(t,e){throw R1(t,e)}function Kg(t,e){t.onWarning&&t.onWarning.call(null,R1(t,e))}function Ba(t,e,r){let n=t.anchorMapTransactions;if(n.length!==0){let i=n[n.length-1];ui.call(i,e)||(i[e]={existed:ui.call(t.anchorMap,e),value:t.anchorMap[e]})}t.anchorMap[e]=r}function e9(t){t.anchorMapTransactions.push(Object.create(null))}function t9(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];ui.call(n,l)||(n[l]=e[l])}}function r9(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 C1(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 f1(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 d1={YAML:function(e,r,n){e.version!==null&&me(e,"duplication of %YAML directive"),n.length!==1&&me(e,"YAML directive accepts exactly one argument");let i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]);i===null&&me(e,"ill-formed argument of the YAML directive");let s=parseInt(i[1],10),o=parseInt(i[2],10);s!==1&&me(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&Kg(e,"unsupported YAML version of the document")},TAG:function(e,r,n){let i;n.length!==2&&me(e,"TAG directive accepts exactly two arguments");let s=n[0];i=n[1],v1.test(s)||me(e,"ill-formed tag handle (first argument) of the TAG directive"),ui.call(e.tagMap,s)&&me(e,'there is a previously declared suffix for "'+s+'" tag handle'),b1.test(i)||me(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch{me(e,"tag prefix is malformed: "+i)}e.tagMap[s]=i}};function wo(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||me(t,"expected valid JSON character")}else z6.test(i)&&me(t,"the stream contains non-printable characters");t.result+=i}}function p1(t,e,r,n){Ha.isObject(r)||me(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];ui.call(e,l)||(S1(e,l,r[l]),n[l]=!0)}}function Uu(t,e,r,n,i,s,o,l,f){if(Array.isArray(i)){i=Array.prototype.slice.call(i);for(let c=0,p=i.length;c<p;c+=1)Array.isArray(i[c])&&me(t,"nested arrays are not supported inside keys"),typeof i=="object"&&u1(i[c])==="[object Object]"&&(i[c]="[object Object]")}if(typeof i=="object"&&u1(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&&me(t,"merge sequence length exceeded maxMergeSeqLength ("+t.maxMergeSeqLength+")");let c=new Set;for(let p=0,h=s.length;p<h;p+=1){let g=s[p];c.has(g)||(c.add(g),p1(t,e,g,r))}}else p1(t,e,s,r);else!t.json&&!ui.call(r,i)&&ui.call(e,i)&&(t.line=o||t.line,t.lineStart=l||t.lineStart,t.position=f||t.position,me(t,"duplicated mapping key")),S1(e,i,s),delete r[i];return e}function rC(t){let e=t.input.charCodeAt(t.position);e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):me(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function Vt(t,e,r){let n=0,i=t.input.charCodeAt(t.position);for(;i!==0;){for(;ms(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(Ni(i))for(rC(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&&Kg(t,"deficient indentation"),n}function Qg(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||Qr(r)))}function nC(t,e){e===1?t.result+=" ":e>1&&(t.result+=Ha.repeat(`
252
- `,e-1))}function n9(t,e,r){let n,i,s,o,l,f,c=t.kind,p=t.result,h=t.input.charCodeAt(t.position);if(Qr(h)||ju(h)||h===35||h===38||h===42||h===33||h===124||h===62||h===39||h===34||h===37||h===64||h===96)return!1;if(h===63||h===45){let g=t.input.charCodeAt(t.position+1);if(Qr(g)||r&&ju(g))return!1}for(t.kind="scalar",t.result="",n=i=t.position,s=!1;h!==0;){if(h===58){let g=t.input.charCodeAt(t.position+1);if(Qr(g)||r&&ju(g))break}else if(h===35){let g=t.input.charCodeAt(t.position-1);if(Qr(g))break}else{if(t.position===t.lineStart&&Qg(t)||r&&ju(h))break;if(Ni(h))if(o=t.line,l=t.lineStart,f=t.lineIndent,Vt(t,!1,-1),t.lineIndent>=e){s=!0,h=t.input.charCodeAt(t.position);continue}else{t.position=i,t.line=o,t.lineStart=l,t.lineIndent=f;break}}s&&(wo(t,n,i,!1),nC(t,t.line-o),n=i=t.position,s=!1),ms(h)||(i=t.position+1),h=t.input.charCodeAt(++t.position)}return wo(t,n,i,!1),t.result?!0:(t.kind=c,t.result=p,!1)}function i9(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(wo(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 Ni(i)?(wo(t,r,n,!0),nC(t,Vt(t,!1,e)),r=n=t.position):t.position===t.lineStart&&Qg(t)?me(t,"unexpected end of the document within a single quoted scalar"):(t.position++,ms(i)||(n=t.position));me(t,"unexpected end of the stream within a single quoted scalar")}function s9(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 wo(t,r,t.position,!0),t.position++,!0;if(s===92){if(wo(t,r,t.position,!0),s=t.input.charCodeAt(++t.position),Ni(s))Vt(t,!1,e);else if(s<256&&w1[s])t.result+=_1[s],t.position++;else if((i=K6(s))>0){let o=i,l=0;for(;o>0;o--)s=t.input.charCodeAt(++t.position),(i=Y6(s))>=0?l=(l<<4)+i:me(t,"expected hexadecimal character");t.result+=Z6(l),t.position++}else me(t,"unknown escape sequence");r=n=t.position}else Ni(s)?(wo(t,r,n,!0),nC(t,Vt(t,!1,e)),r=n=t.position):t.position===t.lineStart&&Qg(t)?me(t,"unexpected end of the document within a double quoted scalar"):(t.position++,ms(s)||(n=t.position))}me(t,"unexpected end of the stream within a double quoted scalar")}function o9(t,e){let r=!0,n,i,s,o=t.tag,l,f=t.anchor,c,p,h,g,v=Object.create(null),_,w,E,k=t.input.charCodeAt(t.position);if(k===91)c=93,g=!1,l=[];else if(k===123)c=125,g=!0,l={};else return!1;for(t.anchor!==null&&Ba(t,t.anchor,l),k=t.input.charCodeAt(++t.position);k!==0;){if(Vt(t,!0,e),k=t.input.charCodeAt(t.position),k===c)return t.position++,t.tag=o,t.anchor=f,t.kind=g?"mapping":"sequence",t.result=l,!0;if(r?k===44&&me(t,"expected the node content, but found ','"):me(t,"missed comma between flow collection entries"),w=_=E=null,p=h=!1,k===63){let T=t.input.charCodeAt(t.position+1);Qr(T)&&(p=h=!0,t.position++,Vt(t,!0,e))}n=t.line,i=t.lineStart,s=t.position,Hu(t,e,Gg,!1,!0),w=t.tag,_=t.result,Vt(t,!0,e),k=t.input.charCodeAt(t.position),(h||t.line===n)&&k===58&&(p=!0,k=t.input.charCodeAt(++t.position),Vt(t,!0,e),Hu(t,e,Gg,!1,!0),E=t.result),g?Uu(t,l,v,w,_,E,n,i,s):p?l.push(Uu(t,null,v,w,_,E,n,i,s)):l.push(_),Vt(t,!0,e),k=t.input.charCodeAt(t.position),k===44?(r=!0,k=t.input.charCodeAt(++t.position)):r=!1}me(t,"unexpected end of the stream within a flow collection")}function a9(t,e){let r,n=tC,i=!1,s=!1,o=e,l=0,f=!1,c,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)tC===n?n=p===43?l1:W6:me(t,"repeat of a chomping mode identifier");else if((c=Q6(p))>=0)c===0?me(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?me(t,"repeat of an indentation width identifier"):(o=e+c-1,s=!0);else break;if(ms(p)){do p=t.input.charCodeAt(++t.position);while(ms(p));if(p===35)do p=t.input.charCodeAt(++t.position);while(!Ni(p)&&p!==0)}for(;p!==0;){for(rC(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),Ni(p)){l++;continue}if(!s&&o===0&&me(t,"missing indentation for block scalar"),t.lineIndent<o){n===l1?t.result+=Ha.repeat(`
251
+ `;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 Z6(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}function S1(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}var w1=new Array(256),_1=new Array(256);for(let t=0;t<256;t++)w1[t]=c1(t)?1:0,_1[t]=c1(t);function X6(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||V6,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 R1(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=B6(r),new m1(e,r)}function me(t,e){throw R1(t,e)}function Kg(t,e){t.onWarning&&t.onWarning.call(null,R1(t,e))}function Ba(t,e,r){let n=t.anchorMapTransactions;if(n.length!==0){let i=n[n.length-1];ui.call(i,e)||(i[e]={existed:ui.call(t.anchorMap,e),value:t.anchorMap[e]})}t.anchorMap[e]=r}function e9(t){t.anchorMapTransactions.push(Object.create(null))}function t9(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];ui.call(n,l)||(n[l]=e[l])}}function r9(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 C1(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 f1(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 d1={YAML:function(e,r,n){e.version!==null&&me(e,"duplication of %YAML directive"),n.length!==1&&me(e,"YAML directive accepts exactly one argument");let i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]);i===null&&me(e,"ill-formed argument of the YAML directive");let s=parseInt(i[1],10),o=parseInt(i[2],10);s!==1&&me(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&Kg(e,"unsupported YAML version of the document")},TAG:function(e,r,n){let i;n.length!==2&&me(e,"TAG directive accepts exactly two arguments");let s=n[0];i=n[1],v1.test(s)||me(e,"ill-formed tag handle (first argument) of the TAG directive"),ui.call(e.tagMap,s)&&me(e,'there is a previously declared suffix for "'+s+'" tag handle'),b1.test(i)||me(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch{me(e,"tag prefix is malformed: "+i)}e.tagMap[s]=i}};function _o(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||me(t,"expected valid JSON character")}else z6.test(i)&&me(t,"the stream contains non-printable characters");t.result+=i}}function p1(t,e,r,n){Ha.isObject(r)||me(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];ui.call(e,l)||(S1(e,l,r[l]),n[l]=!0)}}function Uu(t,e,r,n,i,s,o,l,f){if(Array.isArray(i)){i=Array.prototype.slice.call(i);for(let c=0,p=i.length;c<p;c+=1)Array.isArray(i[c])&&me(t,"nested arrays are not supported inside keys"),typeof i=="object"&&u1(i[c])==="[object Object]"&&(i[c]="[object Object]")}if(typeof i=="object"&&u1(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&&me(t,"merge sequence length exceeded maxMergeSeqLength ("+t.maxMergeSeqLength+")");let c=new Set;for(let p=0,h=s.length;p<h;p+=1){let g=s[p];c.has(g)||(c.add(g),p1(t,e,g,r))}}else p1(t,e,s,r);else!t.json&&!ui.call(r,i)&&ui.call(e,i)&&(t.line=o||t.line,t.lineStart=l||t.lineStart,t.position=f||t.position,me(t,"duplicated mapping key")),S1(e,i,s),delete r[i];return e}function rC(t){let e=t.input.charCodeAt(t.position);e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):me(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function zt(t,e,r){let n=0,i=t.input.charCodeAt(t.position);for(;i!==0;){for(;ms(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(Ni(i))for(rC(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&&Kg(t,"deficient indentation"),n}function Qg(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||Qr(r)))}function nC(t,e){e===1?t.result+=" ":e>1&&(t.result+=Ha.repeat(`
252
+ `,e-1))}function n9(t,e,r){let n,i,s,o,l,f,c=t.kind,p=t.result,h=t.input.charCodeAt(t.position);if(Qr(h)||ju(h)||h===35||h===38||h===42||h===33||h===124||h===62||h===39||h===34||h===37||h===64||h===96)return!1;if(h===63||h===45){let g=t.input.charCodeAt(t.position+1);if(Qr(g)||r&&ju(g))return!1}for(t.kind="scalar",t.result="",n=i=t.position,s=!1;h!==0;){if(h===58){let g=t.input.charCodeAt(t.position+1);if(Qr(g)||r&&ju(g))break}else if(h===35){let g=t.input.charCodeAt(t.position-1);if(Qr(g))break}else{if(t.position===t.lineStart&&Qg(t)||r&&ju(h))break;if(Ni(h))if(o=t.line,l=t.lineStart,f=t.lineIndent,zt(t,!1,-1),t.lineIndent>=e){s=!0,h=t.input.charCodeAt(t.position);continue}else{t.position=i,t.line=o,t.lineStart=l,t.lineIndent=f;break}}s&&(_o(t,n,i,!1),nC(t,t.line-o),n=i=t.position,s=!1),ms(h)||(i=t.position+1),h=t.input.charCodeAt(++t.position)}return _o(t,n,i,!1),t.result?!0:(t.kind=c,t.result=p,!1)}function i9(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(_o(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 Ni(i)?(_o(t,r,n,!0),nC(t,zt(t,!1,e)),r=n=t.position):t.position===t.lineStart&&Qg(t)?me(t,"unexpected end of the document within a single quoted scalar"):(t.position++,ms(i)||(n=t.position));me(t,"unexpected end of the stream within a single quoted scalar")}function s9(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 _o(t,r,t.position,!0),t.position++,!0;if(s===92){if(_o(t,r,t.position,!0),s=t.input.charCodeAt(++t.position),Ni(s))zt(t,!1,e);else if(s<256&&w1[s])t.result+=_1[s],t.position++;else if((i=K6(s))>0){let o=i,l=0;for(;o>0;o--)s=t.input.charCodeAt(++t.position),(i=Y6(s))>=0?l=(l<<4)+i:me(t,"expected hexadecimal character");t.result+=Z6(l),t.position++}else me(t,"unknown escape sequence");r=n=t.position}else Ni(s)?(_o(t,r,n,!0),nC(t,zt(t,!1,e)),r=n=t.position):t.position===t.lineStart&&Qg(t)?me(t,"unexpected end of the document within a double quoted scalar"):(t.position++,ms(s)||(n=t.position))}me(t,"unexpected end of the stream within a double quoted scalar")}function o9(t,e){let r=!0,n,i,s,o=t.tag,l,f=t.anchor,c,p,h,g,v=Object.create(null),_,w,E,k=t.input.charCodeAt(t.position);if(k===91)c=93,g=!1,l=[];else if(k===123)c=125,g=!0,l={};else return!1;for(t.anchor!==null&&Ba(t,t.anchor,l),k=t.input.charCodeAt(++t.position);k!==0;){if(zt(t,!0,e),k=t.input.charCodeAt(t.position),k===c)return t.position++,t.tag=o,t.anchor=f,t.kind=g?"mapping":"sequence",t.result=l,!0;if(r?k===44&&me(t,"expected the node content, but found ','"):me(t,"missed comma between flow collection entries"),w=_=E=null,p=h=!1,k===63){let T=t.input.charCodeAt(t.position+1);Qr(T)&&(p=h=!0,t.position++,zt(t,!0,e))}n=t.line,i=t.lineStart,s=t.position,Hu(t,e,Gg,!1,!0),w=t.tag,_=t.result,zt(t,!0,e),k=t.input.charCodeAt(t.position),(h||t.line===n)&&k===58&&(p=!0,k=t.input.charCodeAt(++t.position),zt(t,!0,e),Hu(t,e,Gg,!1,!0),E=t.result),g?Uu(t,l,v,w,_,E,n,i,s):p?l.push(Uu(t,null,v,w,_,E,n,i,s)):l.push(_),zt(t,!0,e),k=t.input.charCodeAt(t.position),k===44?(r=!0,k=t.input.charCodeAt(++t.position)):r=!1}me(t,"unexpected end of the stream within a flow collection")}function a9(t,e){let r,n=tC,i=!1,s=!1,o=e,l=0,f=!1,c,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)tC===n?n=p===43?l1:W6:me(t,"repeat of a chomping mode identifier");else if((c=Q6(p))>=0)c===0?me(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?me(t,"repeat of an indentation width identifier"):(o=e+c-1,s=!0);else break;if(ms(p)){do p=t.input.charCodeAt(++t.position);while(ms(p));if(p===35)do p=t.input.charCodeAt(++t.position);while(!Ni(p)&&p!==0)}for(;p!==0;){for(rC(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),Ni(p)){l++;continue}if(!s&&o===0&&me(t,"missing indentation for block scalar"),t.lineIndent<o){n===l1?t.result+=Ha.repeat(`
253
253
  `,i?1+l:l):n===tC&&i&&(t.result+=`
254
254
  `);break}r?ms(p)?(f=!0,t.result+=Ha.repeat(`
255
255
  `,i?1+l:l)):f?(f=!1,t.result+=Ha.repeat(`
256
256
  `,l+1)):l===0?i&&(t.result+=" "):t.result+=Ha.repeat(`
257
257
  `,l):t.result+=Ha.repeat(`
258
- `,i?1+l:l),i=!0,s=!0,l=0;let h=t.position;for(;!Ni(p)&&p!==0;)p=t.input.charCodeAt(++t.position);wo(t,h,t.position,!1)}return!0}function h1(t,e){let r=t.tag,n=t.anchor,i=[],s=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&Ba(t,t.anchor,i);let o=t.input.charCodeAt(t.position);for(;o!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,me(t,"tab characters must not be used in indentation")),o===45);){let l=t.input.charCodeAt(t.position+1);if(!Qr(l))break;if(s=!0,t.position++,Vt(t,!0,-1)&&t.lineIndent<=e){i.push(null),o=t.input.charCodeAt(t.position);continue}let f=t.line;if(Hu(t,e,y1,!1,!0),i.push(t.result),Vt(t,!0,-1),o=t.input.charCodeAt(t.position),(t.line===f||t.lineIndent>e)&&o!==0)me(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 x1(t,e,r){let n,i,s,o,l=t.tag,f=t.anchor,c={},p=Object.create(null),h=null,g=null,v=null,_=!1,w=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&Ba(t,t.anchor,c);let E=t.input.charCodeAt(t.position);for(;E!==0;){!_&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,me(t,"tab characters must not be used in indentation"));let k=t.input.charCodeAt(t.position+1),T=t.line;if((E===63||E===58)&&Qr(k))E===63?(_&&(Uu(t,c,p,h,g,null,i,s,o),h=g=v=null),w=!0,_=!0,n=!0):_?(_=!1,n=!0):me(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,E=k;else{if(i=t.line,s=t.lineStart,o=t.position,!Hu(t,r,g1,!1,!0))break;if(t.line===T){for(E=t.input.charCodeAt(t.position);ms(E);)E=t.input.charCodeAt(++t.position);if(E===58)E=t.input.charCodeAt(++t.position),Qr(E)||me(t,"a whitespace character is expected after the key-value separator within a block mapping"),_&&(Uu(t,c,p,h,g,null,i,s,o),h=g=v=null),w=!0,_=!1,n=!1,h=t.tag,g=t.result;else if(w)me(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=l,t.anchor=f,!0}else if(w)me(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=l,t.anchor=f,!0}if((t.line===T||t.lineIndent>e)&&(_&&(i=t.line,s=t.lineStart,o=t.position),Hu(t,e,Yg,!0,n)&&(_?g=t.result:v=t.result),_||(Uu(t,c,p,h,g,v,i,s,o),h=g=v=null),Vt(t,!0,-1),E=t.input.charCodeAt(t.position)),(t.line===T||t.lineIndent>e)&&E!==0)me(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return _&&Uu(t,c,p,h,g,null,i,s,o),w&&(t.tag=l,t.anchor=f,t.kind="mapping",t.result=c),w}function l9(t){let e=!1,r=!1,n,i,s=t.input.charCodeAt(t.position);if(s!==33)return!1;t.tag!==null&&me(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)):me(t,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!Qr(s);)s===33&&(r?me(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(o-1,t.position+1),v1.test(n)||me(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),G6.test(i)&&me(t,"tag suffix cannot contain flow indicator characters")}i&&!b1.test(i)&&me(t,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{me(t,"tag name is malformed: "+i)}return e?t.tag=i:ui.call(t.tagMap,n)?t.tag=t.tagMap[n]+i:n==="!"?t.tag="!"+i:n==="!!"?t.tag="tag:yaml.org,2002:"+i:me(t,'undeclared tag handle "'+n+'"'),!0}function u9(t){let e=t.input.charCodeAt(t.position);if(e!==38)return!1;t.anchor!==null&&me(t,"duplication of an anchor property"),e=t.input.charCodeAt(++t.position);let r=t.position;for(;e!==0&&!Qr(e)&&!ju(e);)e=t.input.charCodeAt(++t.position);return t.position===r&&me(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(r,t.position),!0}function c9(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&&!Qr(e)&&!ju(e);)e=t.input.charCodeAt(++t.position);t.position===r&&me(t,"name of an alias node must contain at least one character");let n=t.input.slice(r,t.position);return ui.call(t.anchorMap,n)||me(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],Vt(t,!0,-1),!0}function f9(t,e,r,n){let i=C1(t);return e9(t),f1(t,e),t.tag=null,t.anchor=null,t.kind=null,t.result=null,x1(t,r,n)&&t.kind==="mapping"?(t9(t),!0):(r9(t),f1(t,i),!1)}function Hu(t,e,r,n,i){let s,o,l=1,f=!1,c=!1,p=null,h,g,v;t.depth>=t.maxDepth&&me(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 _=s=o=Yg===r||y1===r;if(n&&Vt(t,!0,-1)&&(f=!0,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)),l===1)for(;;){let w=t.input.charCodeAt(t.position),E=C1(t);if(f&&(w===33&&t.tag!==null||w===38&&t.anchor!==null)||!l9(t)&&!u9(t))break;p===null&&(p=E),Vt(t,!0,-1)?(f=!0,o=_,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)):o=!1}if(o&&(o=f||i),l===1||Yg===r)if(Gg===r||g1===r?g=e:g=e+1,v=t.position-t.lineStart,l===1)if(o&&(h1(t,v)||x1(t,v,g))||o9(t,g))c=!0;else{let w=t.input.charCodeAt(t.position);p!==null&&_&&!o&&w!==124&&w!==62&&f9(t,p,p.position-p.lineStart,g)||s&&a9(t,g)||i9(t,g)||s9(t,g)?c=!0:c9(t)?(c=!0,(t.tag!==null||t.anchor!==null)&&me(t,"alias node should not have any properties")):n9(t,g,Gg===r)&&(c=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&Ba(t,t.anchor,t.result)}else l===0&&(c=o&&h1(t,v));if(t.tag===null)t.anchor!==null&&Ba(t,t.anchor,t.result);else if(t.tag==="?"){t.result!==null&&t.kind!=="scalar"&&me(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"');for(let w=0,E=t.implicitTypes.length;w<E;w+=1)if(h=t.implicitTypes[w],h.resolve(t.result)){t.result=h.construct(t.result),t.tag=h.tag,t.anchor!==null&&Ba(t,t.anchor,t.result);break}}else if(t.tag!=="!"){if(ui.call(t.typeMap[t.kind||"fallback"],t.tag))h=t.typeMap[t.kind||"fallback"][t.tag];else{h=null;let w=t.typeMap.multi[t.kind||"fallback"];for(let E=0,k=w.length;E<k;E+=1)if(t.tag.slice(0,w[E].tag.length)===w[E].tag){h=w[E];break}}h||me(t,"unknown tag !<"+t.tag+">"),t.result!==null&&h.kind!==t.kind&&me(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+h.kind+'", not "'+t.kind+'"'),h.resolve(t.result,t.tag)?(t.result=h.construct(t.result,t.tag),t.anchor!==null&&Ba(t,t.anchor,t.result)):me(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||c}function d9(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&&(Vt(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&&!Qr(n);)n=t.input.charCodeAt(++t.position);let s=t.input.slice(i,t.position),o=[];for(s.length<1&&me(t,"directive name must not be less than one character in length");n!==0;){for(;ms(n);)n=t.input.charCodeAt(++t.position);if(n===35){do n=t.input.charCodeAt(++t.position);while(n!==0&&!Ni(n));break}if(Ni(n))break;for(i=t.position;n!==0&&!Qr(n);)n=t.input.charCodeAt(++t.position);o.push(t.input.slice(i,t.position))}n!==0&&rC(t),ui.call(d1,s)?d1[s](t,s,o):Kg(t,'unknown document directive "'+s+'"')}if(Vt(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,Vt(t,!0,-1)):r&&me(t,"directives end mark is expected"),Hu(t,t.lineIndent-1,Yg,!1,!0),Vt(t,!0,-1),t.checkLineBreaks&&J6.test(t.input.slice(e,t.position))&&Kg(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Qg(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Vt(t,!0,-1));return}t.position<t.length-1&&me(t,"end of the stream or a document separator is expected")}function E1(t,e){t=String(t),e=e||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
258
+ `,i?1+l:l),i=!0,s=!0,l=0;let h=t.position;for(;!Ni(p)&&p!==0;)p=t.input.charCodeAt(++t.position);_o(t,h,t.position,!1)}return!0}function h1(t,e){let r=t.tag,n=t.anchor,i=[],s=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&Ba(t,t.anchor,i);let o=t.input.charCodeAt(t.position);for(;o!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,me(t,"tab characters must not be used in indentation")),o===45);){let l=t.input.charCodeAt(t.position+1);if(!Qr(l))break;if(s=!0,t.position++,zt(t,!0,-1)&&t.lineIndent<=e){i.push(null),o=t.input.charCodeAt(t.position);continue}let f=t.line;if(Hu(t,e,y1,!1,!0),i.push(t.result),zt(t,!0,-1),o=t.input.charCodeAt(t.position),(t.line===f||t.lineIndent>e)&&o!==0)me(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 x1(t,e,r){let n,i,s,o,l=t.tag,f=t.anchor,c={},p=Object.create(null),h=null,g=null,v=null,_=!1,w=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&Ba(t,t.anchor,c);let E=t.input.charCodeAt(t.position);for(;E!==0;){!_&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,me(t,"tab characters must not be used in indentation"));let k=t.input.charCodeAt(t.position+1),T=t.line;if((E===63||E===58)&&Qr(k))E===63?(_&&(Uu(t,c,p,h,g,null,i,s,o),h=g=v=null),w=!0,_=!0,n=!0):_?(_=!1,n=!0):me(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,E=k;else{if(i=t.line,s=t.lineStart,o=t.position,!Hu(t,r,g1,!1,!0))break;if(t.line===T){for(E=t.input.charCodeAt(t.position);ms(E);)E=t.input.charCodeAt(++t.position);if(E===58)E=t.input.charCodeAt(++t.position),Qr(E)||me(t,"a whitespace character is expected after the key-value separator within a block mapping"),_&&(Uu(t,c,p,h,g,null,i,s,o),h=g=v=null),w=!0,_=!1,n=!1,h=t.tag,g=t.result;else if(w)me(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=l,t.anchor=f,!0}else if(w)me(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=l,t.anchor=f,!0}if((t.line===T||t.lineIndent>e)&&(_&&(i=t.line,s=t.lineStart,o=t.position),Hu(t,e,Yg,!0,n)&&(_?g=t.result:v=t.result),_||(Uu(t,c,p,h,g,v,i,s,o),h=g=v=null),zt(t,!0,-1),E=t.input.charCodeAt(t.position)),(t.line===T||t.lineIndent>e)&&E!==0)me(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return _&&Uu(t,c,p,h,g,null,i,s,o),w&&(t.tag=l,t.anchor=f,t.kind="mapping",t.result=c),w}function l9(t){let e=!1,r=!1,n,i,s=t.input.charCodeAt(t.position);if(s!==33)return!1;t.tag!==null&&me(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)):me(t,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!Qr(s);)s===33&&(r?me(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(o-1,t.position+1),v1.test(n)||me(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),G6.test(i)&&me(t,"tag suffix cannot contain flow indicator characters")}i&&!b1.test(i)&&me(t,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{me(t,"tag name is malformed: "+i)}return e?t.tag=i:ui.call(t.tagMap,n)?t.tag=t.tagMap[n]+i:n==="!"?t.tag="!"+i:n==="!!"?t.tag="tag:yaml.org,2002:"+i:me(t,'undeclared tag handle "'+n+'"'),!0}function u9(t){let e=t.input.charCodeAt(t.position);if(e!==38)return!1;t.anchor!==null&&me(t,"duplication of an anchor property"),e=t.input.charCodeAt(++t.position);let r=t.position;for(;e!==0&&!Qr(e)&&!ju(e);)e=t.input.charCodeAt(++t.position);return t.position===r&&me(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(r,t.position),!0}function c9(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&&!Qr(e)&&!ju(e);)e=t.input.charCodeAt(++t.position);t.position===r&&me(t,"name of an alias node must contain at least one character");let n=t.input.slice(r,t.position);return ui.call(t.anchorMap,n)||me(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],zt(t,!0,-1),!0}function f9(t,e,r,n){let i=C1(t);return e9(t),f1(t,e),t.tag=null,t.anchor=null,t.kind=null,t.result=null,x1(t,r,n)&&t.kind==="mapping"?(t9(t),!0):(r9(t),f1(t,i),!1)}function Hu(t,e,r,n,i){let s,o,l=1,f=!1,c=!1,p=null,h,g,v;t.depth>=t.maxDepth&&me(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 _=s=o=Yg===r||y1===r;if(n&&zt(t,!0,-1)&&(f=!0,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)),l===1)for(;;){let w=t.input.charCodeAt(t.position),E=C1(t);if(f&&(w===33&&t.tag!==null||w===38&&t.anchor!==null)||!l9(t)&&!u9(t))break;p===null&&(p=E),zt(t,!0,-1)?(f=!0,o=_,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)):o=!1}if(o&&(o=f||i),l===1||Yg===r)if(Gg===r||g1===r?g=e:g=e+1,v=t.position-t.lineStart,l===1)if(o&&(h1(t,v)||x1(t,v,g))||o9(t,g))c=!0;else{let w=t.input.charCodeAt(t.position);p!==null&&_&&!o&&w!==124&&w!==62&&f9(t,p,p.position-p.lineStart,g)||s&&a9(t,g)||i9(t,g)||s9(t,g)?c=!0:c9(t)?(c=!0,(t.tag!==null||t.anchor!==null)&&me(t,"alias node should not have any properties")):n9(t,g,Gg===r)&&(c=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&Ba(t,t.anchor,t.result)}else l===0&&(c=o&&h1(t,v));if(t.tag===null)t.anchor!==null&&Ba(t,t.anchor,t.result);else if(t.tag==="?"){t.result!==null&&t.kind!=="scalar"&&me(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"');for(let w=0,E=t.implicitTypes.length;w<E;w+=1)if(h=t.implicitTypes[w],h.resolve(t.result)){t.result=h.construct(t.result),t.tag=h.tag,t.anchor!==null&&Ba(t,t.anchor,t.result);break}}else if(t.tag!=="!"){if(ui.call(t.typeMap[t.kind||"fallback"],t.tag))h=t.typeMap[t.kind||"fallback"][t.tag];else{h=null;let w=t.typeMap.multi[t.kind||"fallback"];for(let E=0,k=w.length;E<k;E+=1)if(t.tag.slice(0,w[E].tag.length)===w[E].tag){h=w[E];break}}h||me(t,"unknown tag !<"+t.tag+">"),t.result!==null&&h.kind!==t.kind&&me(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+h.kind+'", not "'+t.kind+'"'),h.resolve(t.result,t.tag)?(t.result=h.construct(t.result,t.tag),t.anchor!==null&&Ba(t,t.anchor,t.result)):me(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||c}function d9(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&&(zt(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&&!Qr(n);)n=t.input.charCodeAt(++t.position);let s=t.input.slice(i,t.position),o=[];for(s.length<1&&me(t,"directive name must not be less than one character in length");n!==0;){for(;ms(n);)n=t.input.charCodeAt(++t.position);if(n===35){do n=t.input.charCodeAt(++t.position);while(n!==0&&!Ni(n));break}if(Ni(n))break;for(i=t.position;n!==0&&!Qr(n);)n=t.input.charCodeAt(++t.position);o.push(t.input.slice(i,t.position))}n!==0&&rC(t),ui.call(d1,s)?d1[s](t,s,o):Kg(t,'unknown document directive "'+s+'"')}if(zt(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,zt(t,!0,-1)):r&&me(t,"directives end mark is expected"),Hu(t,t.lineIndent-1,Yg,!1,!0),zt(t,!0,-1),t.checkLineBreaks&&J6.test(t.input.slice(e,t.position))&&Kg(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Qg(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,zt(t,!0,-1));return}t.position<t.length-1&&me(t,"end of the stream or a document separator is expected")}function E1(t,e){t=String(t),e=e||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
259
259
  `),t.charCodeAt(0)===65279&&(t=t.slice(1)));let r=new X6(t,e),n=t.indexOf("\0");for(n!==-1&&(r.position=n,me(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;)d9(r);return r.documents}function p9(t,e,r){e!==null&&typeof e=="object"&&typeof r>"u"&&(r=e,e=null);let n=E1(t,r);if(typeof e!="function")return n;for(let i=0,s=n.length;i<s;i+=1)e(n[i])}function h9(t,e){let r=E1(t,e);if(r.length!==0){if(r.length===1)return r[0];throw new m1("expected a single document in the stream, but found more")}}iC.exports.loadAll=p9;iC.exports.load=h9});var G1=H((Ire,J1)=>{"use strict";var ey=Du(),Ud=Lu(),m9=Jg(),M1=Object.prototype.toString,F1=Object.prototype.hasOwnProperty,uC=65279,g9=9,Dd=10,y9=13,v9=32,b9=33,S9=34,sC=35,w9=37,_9=38,R9=39,C9=42,D1=44,x9=45,Zg=58,E9=61,I9=62,O9=63,q9=64,L1=91,j1=93,k9=96,U1=123,P9=124,H1=125,Sr={};Sr[0]="\\0";Sr[7]="\\a";Sr[8]="\\b";Sr[9]="\\t";Sr[10]="\\n";Sr[11]="\\v";Sr[12]="\\f";Sr[13]="\\r";Sr[27]="\\e";Sr[34]='\\"';Sr[92]="\\\\";Sr[133]="\\N";Sr[160]="\\_";Sr[8232]="\\L";Sr[8233]="\\P";var T9=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],A9=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function $9(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 f=t.compiledTypeMap.fallback[o];f&&F1.call(f.styleAliases,l)&&(l=f.styleAliases[l]),r[o]=l}return r}function N9(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 Ud("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+e+ey.repeat("0",r-n.length)+n}var M9=1,Ld=2;function F9(t){this.schema=t.schema||m9,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=ey.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=$9(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==='"'?Ld:M9,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 O1(t,e){let r=ey.repeat(" ",e),n=0,i="",s=t.length;for(;n<s;){let o,l=t.indexOf(`
260
260
  `,n);l===-1?(o=t.slice(n),n=s):(o=t.slice(n,l+1),n=l+1),o.length&&o!==`
261
261
  `&&(i+=r),i+=o}return i}function oC(t,e){return`
@@ -271,10 +271,10 @@ Parsed value is empty`);return o}catch(o){throw!o&&e.continueOnError?new ja.Unma
271
271
  `+t.slice(i,s),i=s+1),o=l;return f+=`
272
272
  `,t.length-i>e&&o>i?f+=t.slice(i,o)+`
273
273
  `+t.slice(o+1):f+=t.slice(i),f.slice(1)}function V9(t){let e="",r=0;for(let n=0;n<t.length;r>=65536?n+=2:n++){r=Fd(t,n);let i=Sr[r];!i&&jd(r)?(e+=t[n],r>=65536&&(e+=t[n+1])):e+=i||N9(r)}return e}function W9(t,e,r){let n="",i=t.tag;for(let s=0,o=r.length;s<o;s+=1){let l=r[s];t.replacer&&(l=t.replacer.call(r,String(s),l)),(gs(t,e,l,!1,!1)||typeof l>"u"&&gs(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump)}t.tag=i,t.dump="["+n+"]"}function $1(t,e,r,n){let i="",s=t.tag;for(let o=0,l=r.length;o<l;o+=1){let f=r[o];t.replacer&&(f=t.replacer.call(r,String(o),f)),(gs(t,e+1,f,!0,!0,!1,!0)||typeof f>"u"&&gs(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=oC(t,e)),t.dump&&Dd===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump)}t.tag=s,t.dump=i||"[]"}function z9(t,e,r){let n="",i=t.tag,s=Object.keys(r);for(let o=0,l=s.length;o<l;o+=1){let f="";n!==""&&(f+=", "),t.condenseFlow&&(f+='"');let c=s[o],p=r[c];t.replacer&&(p=t.replacer.call(r,c,p)),gs(t,e,c,!1,!1)&&(t.dump.length>1024&&(f+="? "),f+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),gs(t,e,p,!1,!1)&&(f+=t.dump,n+=f))}t.tag=i,t.dump="{"+n+"}"}function J9(t,e,r,n){let i="",s=t.tag,o=Object.keys(r);if(t.sortKeys===!0)o.sort();else if(typeof t.sortKeys=="function")o.sort(t.sortKeys);else if(t.sortKeys)throw new Ud("sortKeys must be a boolean or a function");for(let l=0,f=o.length;l<f;l+=1){let c="";(!n||i!=="")&&(c+=oC(t,e));let p=o[l],h=r[p];if(t.replacer&&(h=t.replacer.call(r,p,h)),!gs(t,e+1,p,!0,!0,!0))continue;let g=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024;g&&(t.dump&&Dd===t.dump.charCodeAt(0)?c+="?":c+="? "),c+=t.dump,g&&(c+=oC(t,e)),gs(t,e+1,h,!0,g)&&(t.dump&&Dd===t.dump.charCodeAt(0)?c+=":":c+=": ",c+=t.dump,i+=c)}t.tag=s,t.dump=i||"{}"}function N1(t,e,r){let n=r?t.explicitTypes:t.implicitTypes;for(let i=0,s=n.length;i<s;i+=1){let o=n[i];if((o.instanceOf||o.predicate)&&(!o.instanceOf||typeof e=="object"&&e instanceof o.instanceOf)&&(!o.predicate||o.predicate(e))){if(r?o.multi&&o.representName?t.tag=o.representName(e):t.tag=o.tag:t.tag="?",o.represent){let l=t.styleMap[o.tag]||o.defaultStyle,f;if(M1.call(o.represent)==="[object Function]")f=o.represent(e,l);else if(F1.call(o.represent,l))f=o.represent[l](e,l);else throw new Ud("!<"+o.tag+'> tag resolver accepts not "'+l+'" style');t.dump=f}return!0}}return!1}function gs(t,e,r,n,i,s,o){t.tag=null,t.dump=r,N1(t,r,!1)||N1(t,r,!0);let l=M1.call(t.dump),f=n;n&&(n=t.flowLevel<0||t.flowLevel>e);let c=l==="[object Object]"||l==="[object Array]",p,h;if(c&&(p=t.duplicates.indexOf(r),h=p!==-1),(t.tag!==null&&t.tag!=="?"||h||t.indent!==2&&e>0)&&(i=!1),h&&t.usedDuplicates[p])t.dump="*ref_"+p;else{if(c&&h&&!t.usedDuplicates[p]&&(t.usedDuplicates[p]=!0),l==="[object Object]")n&&Object.keys(t.dump).length!==0?(J9(t,e,t.dump,i),h&&(t.dump="&ref_"+p+t.dump)):(z9(t,e,t.dump),h&&(t.dump="&ref_"+p+" "+t.dump));else if(l==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!o&&e>0?$1(t,e-1,t.dump,i):$1(t,e,t.dump,i),h&&(t.dump="&ref_"+p+t.dump)):(W9(t,e,t.dump),h&&(t.dump="&ref_"+p+" "+t.dump));else if(l==="[object String]")t.tag!=="?"&&H9(t,t.dump,e,s,f);else{if(l==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new Ud("unacceptable kind of an object to dump "+l)}if(t.tag!==null&&t.tag!=="?"){let g=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21");t.tag[0]==="!"?g="!"+g:g.slice(0,18)==="tag:yaml.org,2002:"?g="!!"+g.slice(18):g="!<"+g+">",t.dump=g+" "+t.dump}}return!0}function G9(t,e){let r=[],n=[];lC(t,r,n);let i=n.length;for(let s=0;s<i;s+=1)e.duplicates.push(r[n[s]]);e.usedDuplicates=new Array(i)}function lC(t,e,r){if(t!==null&&typeof t=="object"){let n=e.indexOf(t);if(n!==-1)r.indexOf(n)===-1&&r.push(n);else if(e.push(t),Array.isArray(t))for(let i=0,s=t.length;i<s;i+=1)lC(t[i],e,r);else{let i=Object.keys(t);for(let s=0,o=i.length;s<o;s+=1)lC(t[i[s]],e,r)}}}function Y9(t,e){e=e||{};let r=new F9(e);r.noRefs||G9(t,r);let n=t;return r.replacer&&(n=r.replacer.call({"":n},"",n)),gs(r,0,n,!0,!0)?r.dump+`
274
- `:""}J1.exports.dump=Y9});var fC=H((Ore,$r)=>{"use strict";var Y1=I1(),K9=G1();function cC(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.")}}$r.exports.Type=br();$r.exports.Schema=FR();$r.exports.FAILSAFE_SCHEMA=UR();$r.exports.JSON_SCHEMA=zR();$r.exports.CORE_SCHEMA=JR();$r.exports.DEFAULT_SCHEMA=Jg();$r.exports.load=Y1.load;$r.exports.loadAll=Y1.loadAll;$r.exports.dump=K9.dump;$r.exports.YAMLException=Lu();$r.exports.types={binary:QR(),float:WR(),map:jR(),null:HR(),pairs:XR(),set:eC(),timestamp:GR(),bool:BR(),int:VR(),merge:YR(),omap:ZR(),seq:LR(),str:DR()};$r.exports.safeLoad=cC("safeLoad","load");$r.exports.safeLoadAll=cC("safeLoadAll","loadAll");$r.exports.safeDump=cC("safeDump","dump")});var K1=H(Hd=>{"use strict";var Q9=Hd&&Hd.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Hd,"__esModule",{value:!0});var Z9=An(),X9=Q9(fC()),e8=fC();Hd.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 X9.default.load(e,{schema:e8.JSON_SCHEMA})}catch(r){throw new Z9.ParserError(r?.message||"Parser Error",t.url)}else return e}}});var Q1=H(dC=>{"use strict";Object.defineProperty(dC,"__esModule",{value:!0});var t8=An(),r8=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i;dC.default={order:300,allowEmpty:!0,encoding:"utf8",canParse(t){return(typeof t.data=="string"||Buffer.isBuffer(t.data))&&r8.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 t8.ParserError("data is not text",t.url)}}});var Z1=H(pC=>{"use strict";Object.defineProperty(pC,"__esModule",{value:!0});var n8=/\.(jpeg|jpg|gif|png|bmp|ico)$/i;pC.default={order:400,allowEmpty:!0,canParse(t){return Buffer.isBuffer(t.data)&&n8.test(t.url)},parse(t){return Buffer.isBuffer(t.data)?t.data:Buffer.from(t.data)}}});var r$=H(ci=>{"use strict";var i8=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]})),s8=ci&&ci.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),o8=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"&&i8(r,e,n[i]);return s8(r,e),r}})(),a8=ci&&ci.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ci,"__esModule",{value:!0});var l8=a8(ft("fs")),X1=vo(),e$=o8(Tn()),t$=An();ci.default={order:100,canRead(t){return e$.isFileSystemPath(t.url)},async read(t){let e;try{e=e$.toFileSystemPath(t.url)}catch(r){throw new t$.ResolverError(X1.ono.uri(r,`Malformed URI: ${t.url}`),t.url)}try{return await l8.default.promises.readFile(e)}catch(r){throw new t$.ResolverError((0,X1.ono)(r,`Error opening file "${e}"`),e)}}}});var s$=H(ys=>{"use strict";var u8=ys&&ys.__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]})),c8=ys&&ys.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),f8=ys&&ys.__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"&&u8(r,e,n[i]);return c8(r,e),r}})();Object.defineProperty(ys,"__esModule",{value:!0});var ty=vo(),Bd=f8(Tn()),n$=An();ys.default={order:200,headers:null,timeout:6e4,redirects:5,withCredentials:!1,canRead(t){return Bd.isHttp(t.url)},read(t){let e=Bd.parse(t.url);return typeof window<"u"&&!e.protocol&&(e.protocol=Bd.parse(location.href).protocol),i$(e,this)}};async function i$(t,e,r){t=Bd.parse(t);let n=r||[];n.push(t.href);try{let i=await d8(t,e);if(i.status>=400)throw(0,ty.ono)({status:i.status},`HTTP ERROR ${i.status}`);if(i.status>=300){if(!Number.isNaN(e.redirects)&&n.length>e.redirects)throw new n$.ResolverError((0,ty.ono)({status:i.status},`Error downloading ${n[0]}.
274
+ `:""}J1.exports.dump=Y9});var fC=H((Ore,$r)=>{"use strict";var Y1=I1(),K9=G1();function cC(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.")}}$r.exports.Type=br();$r.exports.Schema=FR();$r.exports.FAILSAFE_SCHEMA=UR();$r.exports.JSON_SCHEMA=zR();$r.exports.CORE_SCHEMA=JR();$r.exports.DEFAULT_SCHEMA=Jg();$r.exports.load=Y1.load;$r.exports.loadAll=Y1.loadAll;$r.exports.dump=K9.dump;$r.exports.YAMLException=Lu();$r.exports.types={binary:QR(),float:WR(),map:jR(),null:HR(),pairs:XR(),set:eC(),timestamp:GR(),bool:BR(),int:VR(),merge:YR(),omap:ZR(),seq:LR(),str:DR()};$r.exports.safeLoad=cC("safeLoad","load");$r.exports.safeLoadAll=cC("safeLoadAll","loadAll");$r.exports.safeDump=cC("safeDump","dump")});var K1=H(Hd=>{"use strict";var Q9=Hd&&Hd.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Hd,"__esModule",{value:!0});var Z9=An(),X9=Q9(fC()),e8=fC();Hd.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 X9.default.load(e,{schema:e8.JSON_SCHEMA})}catch(r){throw new Z9.ParserError(r?.message||"Parser Error",t.url)}else return e}}});var Q1=H(dC=>{"use strict";Object.defineProperty(dC,"__esModule",{value:!0});var t8=An(),r8=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i;dC.default={order:300,allowEmpty:!0,encoding:"utf8",canParse(t){return(typeof t.data=="string"||Buffer.isBuffer(t.data))&&r8.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 t8.ParserError("data is not text",t.url)}}});var Z1=H(pC=>{"use strict";Object.defineProperty(pC,"__esModule",{value:!0});var n8=/\.(jpeg|jpg|gif|png|bmp|ico)$/i;pC.default={order:400,allowEmpty:!0,canParse(t){return Buffer.isBuffer(t.data)&&n8.test(t.url)},parse(t){return Buffer.isBuffer(t.data)?t.data:Buffer.from(t.data)}}});var r$=H(ci=>{"use strict";var i8=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]})),s8=ci&&ci.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),o8=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"&&i8(r,e,n[i]);return s8(r,e),r}})(),a8=ci&&ci.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ci,"__esModule",{value:!0});var l8=a8(ft("fs")),X1=bo(),e$=o8(Tn()),t$=An();ci.default={order:100,canRead(t){return e$.isFileSystemPath(t.url)},async read(t){let e;try{e=e$.toFileSystemPath(t.url)}catch(r){throw new t$.ResolverError(X1.ono.uri(r,`Malformed URI: ${t.url}`),t.url)}try{return await l8.default.promises.readFile(e)}catch(r){throw new t$.ResolverError((0,X1.ono)(r,`Error opening file "${e}"`),e)}}}});var s$=H(ys=>{"use strict";var u8=ys&&ys.__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]})),c8=ys&&ys.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),f8=ys&&ys.__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"&&u8(r,e,n[i]);return c8(r,e),r}})();Object.defineProperty(ys,"__esModule",{value:!0});var ty=bo(),Bd=f8(Tn()),n$=An();ys.default={order:200,headers:null,timeout:6e4,redirects:5,withCredentials:!1,canRead(t){return Bd.isHttp(t.url)},read(t){let e=Bd.parse(t.url);return typeof window<"u"&&!e.protocol&&(e.protocol=Bd.parse(location.href).protocol),i$(e,this)}};async function i$(t,e,r){t=Bd.parse(t);let n=r||[];n.push(t.href);try{let i=await d8(t,e);if(i.status>=400)throw(0,ty.ono)({status:i.status},`HTTP ERROR ${i.status}`);if(i.status>=300){if(!Number.isNaN(e.redirects)&&n.length>e.redirects)throw new n$.ResolverError((0,ty.ono)({status:i.status},`Error downloading ${n[0]}.
275
275
  Too many redirects:
276
276
  ${n.join(`
277
- `)}`));if(!("location"in i.headers)||!i.headers.location)throw(0,ty.ono)({status:i.status},`HTTP ${i.status} redirect with no location header`);{let s=Bd.resolve(t.href,i.headers.location);return i$(s,e,n)}}else{if(i.body){let s=await i.arrayBuffer();return Buffer.from(s)}return Buffer.alloc(0)}}catch(i){throw new n$.ResolverError((0,ty.ono)(i,`Error downloading ${t.href}`),t.href)}}async function d8(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 hC=H(vs=>{"use strict";var Vu=vs&&vs.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(vs,"__esModule",{value:!0});vs.getNewOptions=vs.getJsonSchemaRefParserDefaultOptions=void 0;var p8=Vu(TA()),h8=Vu(K1()),m8=Vu(Q1()),g8=Vu(Z1()),y8=Vu(r$()),v8=Vu(s$()),b8=()=>({parse:{json:{...p8.default},yaml:{...h8.default},text:{...m8.default},binary:{...g8.default}},resolve:{file:{...y8.default},http:{...v8.default},external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative"},mutateInputSchema:!0});vs.getJsonSchemaRefParserDefaultOptions=b8;var S8=t=>{let e=(0,vs.getJsonSchemaRefParserDefaultOptions)();return t&&a$(e,t),e};vs.getNewOptions=S8;function a$(t,e){if(o$(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];o$(s)?t[i]=a$(o||{},s):s!==void 0&&(t[i]=s)}}return t}function o$(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}});var u$=H(ry=>{"use strict";Object.defineProperty(ry,"__esModule",{value:!0});ry.normalizeArgs=l$;var w8=hC();function l$(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,w8.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}}ry.default=l$});var c$=H(fi=>{"use strict";var _8=fi&&fi.__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]})),R8=fi&&fi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),C8=fi&&fi.__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 R8(r,e),r}})(),mC=fi&&fi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fi,"__esModule",{value:!0});var x8=mC(Mu()),E8=mC(Td()),I8=mC(PR()),Wu=C8(Tn()),O8=An();function q8(t,e){if(!e.resolve?.external)return Promise.resolve();try{let r=gC(t.schema,t.$refs._root$Ref.path+"#",t.$refs,e);return Promise.all(r)}catch(r){return Promise.reject(r)}}function gC(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),x8.default.isExternal$Ref(t)&&o.push(k8(t,e,r,n));let l=Object.keys(t);for(let f of l){let c=E8.default.join(e,f),p=t[f];o=o.concat(gC(p,c,r,n,i,s))}}return o}async function k8(t,e,r,n){let i=n.dereference?.externalReferenceResolution==="root",s=Wu.resolve(i?Wu.cwd():e,t.$ref),o=Wu.stripHash(s),l=r._$refs[o];if(l)return Promise.resolve(l.value);try{let f=await(0,I8.default)(s,r,n),c=gC(f,o+"#",r,n,new Set,!0);return Promise.all(c)}catch(f){if(!n?.continueOnError||!(0,O8.isHandledError)(f))throw f;return r._$refs[o]&&(f.source=decodeURI(Wu.stripHash(e)),f.path=Wu.safePointerToPath(Wu.getHash(e))),[]}}fi.default=q8});var p$=H(di=>{"use strict";var P8=di&&di.__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]})),T8=di&&di.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),A8=di&&di.__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"&&P8(r,e,n[i]);return T8(r,e),r}})(),d$=di&&di.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(di,"__esModule",{value:!0});var ny=d$(Mu()),Vd=d$(Td()),yC=A8(Tn());function $8(t,e){let r=[];vC(t,"schema",t.$refs._root$Ref.path+"#","#",0,r,t.$refs,e),N8(r)}function vC(t,e,r,n,i,s,o,l){let f=e===null?t:t[e];if(f&&typeof f=="object"&&!ArrayBuffer.isView(f))if(ny.default.isAllowed$Ref(f))f$(t,e,r,n,i,s,o,l);else{let c=Object.keys(f).sort((p,h)=>p==="definitions"?-1:h==="definitions"?1:p.length-h.length);for(let p of c){let h=Vd.default.join(r,p),g=Vd.default.join(n,p),v=f[p];ny.default.isAllowed$Ref(v)?f$(f,p,r,g,i,s,o,l):vC(f,p,h,g,i,s,o,l)}}}function f$(t,e,r,n,i,s,o,l){let f=e===null?t:t[e],c=yC.resolve(r,f.$ref),p=o._resolve(c,n,l);if(p===null)return;let g=Vd.default.parse(n).length,v=yC.stripHash(p.path),_=yC.getHash(p.path),w=v!==o._root$Ref.path,E=ny.default.isExtended$Ref(f);i+=p.indirections;let k=M8(s,t,e);if(k)if(g<k.depth||i<k.indirections)F8(s,k);else return;s.push({$ref:f,parent:t,key:e,pathFromRoot:n,depth:g,file:v,hash:_,value:p.value,circular:p.circular,extended:E,external:w,indirections:i}),(!k||w)&&vC(p.value,null,p.path,n,i+1,s,o,l)}function N8(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=Vd.default.join(n,Vd.default.parse(i.hash.replace(r,"#"))):(e=i.file,r=i.hash,n=i.pathFromRoot,i.$ref=i.parent[i.key]=ny.default.dereference(i.$ref,i.value),i.circular&&(i.$ref.$ref=i.pathFromRoot)):i.$ref.$ref=i.hash}function M8(t,e,r){for(let n of t)if(n&&n.parent===e&&n.key===r)return n}function F8(t,e){let r=t.indexOf(e);t.splice(r,1)}di.default=$8});var b$=H(pi=>{"use strict";var D8=pi&&pi.__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]})),L8=pi&&pi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),j8=pi&&pi.__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"&&D8(r,e,n[i]);return L8(r,e),r}})(),y$=pi&&pi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pi,"__esModule",{value:!0});var iy=y$(Mu()),h$=y$(Td()),U8=vo(),m$=j8(Tn()),H8=An();pi.default=B8;function B8(t,e){let r=Date.now(),n=bC(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 bC(t,e,r,n,i,s,o,l,f){let c,p={value:t,circular:!1};if(l&&l.timeoutMs&&Date.now()-f>l.timeoutMs)throw new H8.TimeoutError(l.timeoutMs);let h=l.dereference||{},g=h.excludedPathMatcher||(()=>!1);if((h?.circular==="ignore"||!i.has(t))&&t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!g(r)){if(n.add(t),i.add(t),iy.default.isAllowed$Ref(t,l))c=g$(t,e,r,n,i,s,o,l,f),p.circular=c.circular,p.value=c.value;else for(let v of Object.keys(t)){let _=h$.default.join(e,v),w=h$.default.join(r,v);if(g(w))continue;let E=t[v],k=!1;if(iy.default.isAllowed$Ref(E,l)){if(c=g$(E,_,w,n,i,s,o,l,f),k=c.circular,t[v]!==c.value){let T=new Map;h?.preservedProperties&&typeof t[v]=="object"&&!Array.isArray(t[v])&&h?.preservedProperties.forEach(N=>{N in t[v]&&T.set(N,t[v][N])}),t[v]=c.value,h?.preservedProperties&&T.size&&typeof t[v]=="object"&&!Array.isArray(t[v])&&T.forEach((N,$)=>{t[v][$]=N}),h?.onDereference?.(E.$ref,t[v],t,v)}}else n.has(E)?k=v$(_,o,l):(c=bC(E,_,w,n,i,s,o,l,f),k=c.circular,t[v]!==c.value&&(t[v]=c.value));p.circular=p.circular||k}n.delete(t)}return p}function g$(t,e,r,n,i,s,o,l,f){let p=iy.default.isExternal$Ref(t)&&l?.dereference?.externalReferenceResolution==="root",h=m$.resolve(p?m$.cwd():e,t.$ref),g=s.get(h);if(g&&!g.circular){let T=Object.keys(t);if(T.length>1){let N={};for(let $ of T)$!=="$ref"&&!($ in g.value)&&(N[$]=t[$]);return{circular:g.circular,value:Object.assign({},g.value,N)}}return g}let v=o._resolve(h,e,l);if(v===null)return{circular:!1,value:null};let _=v.circular,w=_||n.has(v.value);w&&v$(e,o,l);let E=iy.default.dereference(t,v.value);if(!w){let T=bC(E,v.path,r,n,i,s,o,l,f);w=T.circular,E=T.value}w&&!_&&l.dereference?.circular==="ignore"&&(E=t),_&&(E.$ref=r);let k={circular:w,value:E};return Object.keys(t).length===1&&s.set(h,k),k}function v$(t,e,r){if(e.circular=!0,r?.dereference?.onCircular?.(t),!r.dereference.circular)throw U8.ono.reference(`Circular $ref pointer found at ${t}`);return!0}});var S$=H(SC=>{"use strict";Object.defineProperty(SC,"__esModule",{value:!0});function V8(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(e){setTimeout(e,0)}}SC.default=V8()});var _$=H(Wd=>{"use strict";var W8=Wd&&Wd.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wd,"__esModule",{value:!0});Wd.default=z8;var w$=W8(S$());function z8(t,e){if(t){e.then(function(r){(0,w$.default)(function(){t(null,r)})},function(r){(0,w$.default)(function(){t(r)})});return}else return e}});var E$=H(xe=>{"use strict";var J8=xe&&xe.__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=xe&&xe.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Y8=xe&&xe.__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}})(),Wa=xe&&xe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xe,"__esModule",{value:!0});xe.getJsonSchemaRefParserDefaultOptions=xe.jsonSchemaParserNormalizeArgs=xe.dereferenceInternal=xe.JSONParserErrorGroup=xe.isHandledError=xe.UnmatchedParserError=xe.ParserError=xe.ResolverError=xe.MissingPointerError=xe.InvalidPointerError=xe.JSONParserError=xe.UnmatchedResolverError=xe.dereference=xe.bundle=xe.resolve=xe.parse=xe.$RefParser=void 0;var R$=Wa(IA()),K8=Wa(PR()),zd=Wa(u$());xe.jsonSchemaParserNormalizeArgs=zd.default;var Q8=Wa(c$()),Z8=Wa(p$()),x$=Wa(b$());xe.dereferenceInternal=x$.default;var Va=Y8(Tn()),$n=An();Object.defineProperty(xe,"JSONParserError",{enumerable:!0,get:function(){return $n.JSONParserError}});Object.defineProperty(xe,"InvalidPointerError",{enumerable:!0,get:function(){return $n.InvalidPointerError}});Object.defineProperty(xe,"MissingPointerError",{enumerable:!0,get:function(){return $n.MissingPointerError}});Object.defineProperty(xe,"ResolverError",{enumerable:!0,get:function(){return $n.ResolverError}});Object.defineProperty(xe,"ParserError",{enumerable:!0,get:function(){return $n.ParserError}});Object.defineProperty(xe,"UnmatchedParserError",{enumerable:!0,get:function(){return $n.UnmatchedParserError}});Object.defineProperty(xe,"UnmatchedResolverError",{enumerable:!0,get:function(){return $n.UnmatchedResolverError}});Object.defineProperty(xe,"isHandledError",{enumerable:!0,get:function(){return $n.isHandledError}});Object.defineProperty(xe,"JSONParserErrorGroup",{enumerable:!0,get:function(){return $n.JSONParserErrorGroup}});var C$=vo(),hi=Wa(_$()),X8=hC();Object.defineProperty(xe,"getJsonSchemaRefParserDefaultOptions",{enumerable:!0,get:function(){return X8.getJsonSchemaRefParserDefaultOptions}});var _o=class t{constructor(){this.schema=null,this.$refs=new R$.default}async parse(){let e=(0,zd.default)(arguments),r;if(!e.path&&!e.schema){let i=(0,C$.ono)(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return(0,hi.default)(e.callback,Promise.reject(i))}this.schema=null,this.$refs=new R$.default;let n="http";if(Va.isFileSystemPath(e.path))e.path=Va.fromFileSystemPath(e.path),n="file";else if(!e.path&&e.schema&&"$id"in e.schema&&e.schema.$id){let i=Va.parse(e.schema.$id),s=i.protocol==="https:"?443:80;e.path=`${i.protocol}//${i.hostname}:${s}`}if(e.path=Va.resolve(Va.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,K8.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,hi.default)(e.callback,Promise.resolve(this.schema));if(e.options.continueOnError)return this.schema=null,(0,hi.default)(e.callback,Promise.resolve(this.schema));throw C$.ono.syntax(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(i){return!e.options.continueOnError||!(0,$n.isHandledError)(i)?(0,hi.default)(e.callback,Promise.reject(i)):(this.$refs._$refs[Va.stripHash(e.path)]&&this.$refs._$refs[Va.stripHash(e.path)].addError(i),(0,hi.default)(e.callback,Promise.resolve(null)))}}static parse(){let e=new t;return e.parse.apply(e,arguments)}async resolve(){let e=(0,zd.default)(arguments);try{return await this.parse(e.path,e.schema,e.options),await(0,Q8.default)(this,e.options),wC(this),(0,hi.default)(e.callback,Promise.resolve(this.$refs))}catch(r){return(0,hi.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,zd.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,Z8.default)(this,e.options),wC(this),(0,hi.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,hi.default)(e.callback,Promise.reject(r))}}static dereference(){let e=new t;return e.dereference.apply(e,arguments)}async dereference(){let e=(0,zd.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,x$.default)(this,e.options),wC(this),(0,hi.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,hi.default)(e.callback,Promise.reject(r))}}};xe.$RefParser=_o;xe.default=_o;function wC(t){if($n.JSONParserErrorGroup.getParserErrors(t).length>0)throw new $n.JSONParserErrorGroup(t)}xe.parse=_o.parse;xe.resolve=_o.resolve;xe.bundle=_o.bundle;xe.dereference=_o.dereference});var sy,zu,_C=se(()=>{"use strict";sy=Hc(E$()),zu=class{async resolve(e){try{return await sy.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 sy.default.bundle(e)}catch(r){return console.error("[RefResolver] Failed to bundle $ref pointers:",r),e}}async resolveFile(e){try{return await sy.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){throw console.error(`[RefResolver] Failed to resolve file ${e}:`,r),r}}}});import*as I$ from"fs";var O$,e5,Ro,oy=se(()=>{"use strict";O$=Hc(kd());xn();lR();_C();e5=["application/json","text/plain","text/html","multipart/form-data","application/x-www-form-urlencoded"],Ro=class{constructor(e,r){this.collectionService=e;this.envConfigService=r;this.exampleGenerator=new Pu,this.refResolver=new zu}collectionService;envConfigService;exampleGenerator;refResolver;async import(e,r){let n=await I$.promises.readFile(e,"utf-8"),i;e.endsWith(".yaml")||e.endsWith(".yml")?i=O$.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",f={id:St(o),name:o,description:i.info?.description||"",version:i.info?.version||"1.0.0",variables:{},items:[]};if(i.servers&&i.servers.length>0&&(f.variables.baseUrl=i.servers[0].url),i.security&&i.security.length>0&&i.components?.securitySchemes){let h=this.mapSecurityToAuth(i.security[0],i.components.securitySchemes);h&&(f.auth=h)}let c=new Map;if(i.tags)for(let h of i.tags){let g={type:"folder",id:St(h.name),name:h.name,description:h.description,items:[]};c.set(h.name,g),f.items.push(g)}if(i.paths)for(let[h,g]of Object.entries(i.paths))for(let v of["get","post","put","patch","delete","head","options","trace"]){let _=g[v];if(!_)continue;let w=this.processOperation(v,h,_,g,i,s),E=_.tags?.[0];if(E&&c.has(E))c.get(E).items.push(w);else if(E){let k={type:"folder",id:St(E),name:E,items:[w]};c.set(E,k),f.items.push(k)}else f.items.push(w)}await this.collectionService.saveCollection(f);let p;return r?.environmentName&&i.servers&&(p=await this.createEnvironmentFromServers(i.servers,r.environmentName)),{collection:f,environmentCreated:p}}processOperation(e,r,n,i,s,o){let l=St(n.operationId||`${e}-${r}`),f=`{{baseUrl}}${this.convertPathParams(r)}`,c=n.summary||n.operationId||`${e.toUpperCase()} ${r}`,p=n.deprecated===!0;p&&(c=`[DEPRECATED] ${c}`);let h={type:"request",id:l,name:c,method:e.toUpperCase(),url:f,description:n.description||"",deprecated:p},g=[...i.parameters||[],...n.parameters||[]];if(this.processParameters(h,g,o),n.requestBody&&this.processRequestBody(h,n.requestBody,o),n.responses&&(h.responseSchema=this.processResponses(n.responses,o)),n.security!==void 0&&s.components?.securitySchemes){if(Array.isArray(n.security)&&n.security.length===0)h.auth={type:"none"};else if(n.security&&n.security.length>0){let v=this.mapSecurityToAuth(n.security[0],s.components.securitySchemes);v&&(h.auth=v)}}return h}convertPathParams(e){return e.replace(/\{(\w+)\}/g,":$1")}processParameters(e,r,n){let i=[],s=[],o={},l=[];for(let f of r){let c=f.name,p=f.in,h=f.schema||{},g=f.example!==void 0?String(f.example):this.generateExampleForParam(h,n),v=f.deprecated===!0;switch(p){case"path":{if(f.description||h.type||h.format||h.enum||v||h.pattern||h.minimum!==void 0||h.maximum!==void 0||h.minLength!==void 0||h.maxLength!==void 0||h.multipleOf!==void 0||h.minItems!==void 0||h.maxItems!==void 0||h.uniqueItems||h.nullable||h.oneOf){let w={value:g};h.oneOf?(w.oneOf=h.oneOf,this.applyOneOfHints(w,h.oneOf)):(h.type&&(w.type=h.type),h.format&&(w.format=h.format),h.enum&&(w.enum=h.enum.map(String)),h.pattern&&(w.pattern=h.pattern),h.minimum!==void 0&&(w.minimum=h.minimum),h.maximum!==void 0&&(w.maximum=h.maximum),h.exclusiveMinimum!==void 0&&(w.exclusiveMinimum=h.exclusiveMinimum),h.exclusiveMaximum!==void 0&&(w.exclusiveMaximum=h.exclusiveMaximum),h.multipleOf!==void 0&&(w.multipleOf=h.multipleOf),h.minLength!==void 0&&(w.minLength=h.minLength),h.maxLength!==void 0&&(w.maxLength=h.maxLength),h.minItems!==void 0&&(w.minItems=h.minItems),h.maxItems!==void 0&&(w.maxItems=h.maxItems),h.uniqueItems&&(w.uniqueItems=!0),h.nullable&&(w.nullable=!0)),f.description&&(w.description=f.description),v&&(w.deprecated=!0),o[c]=w}else o[c]=g;break}case"query":{let _={key:c,value:g};this.applySchemaConstraints(_,h,f,v),s.push(_);break}case"header":{let _={key:c,value:g};this.applySchemaConstraints(_,h,f,v),i.push(_);break}case"cookie":{l.push(`${c}={{${c}}}`);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:f}=this.mapContentTypeToBodyType(s);if(e.body={type:l,...f&&{format:f},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 c=this.buildBodySchema(r,s,n);c&&(e.bodySchema=c)}selectPrimaryContentType(e){for(let i of e5)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 f=l,c=f.type==="string"&&f.format==="binary",p={key:o,value:c?"":String(this.exampleGenerator.generate(f,{components:r})||""),type:c?"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 f of i){let c=e.content[f],p={};c.schema&&(p.schema=c.schema),c.examples&&(p.examples=c.examples),c.encoding&&(p.encoding=c.encoding),o.content[f]=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,f={description:l.description||`Status ${s}`};if(l.content){let c=Object.keys(l.content);if(c.length===1){let p=c[0],h=l.content[p];f.contentType=p,h.schema&&(f.schema=h.schema),h.examples&&(f.examples=h.examples),h.schema&&Object.assign(i,this.extractUsedComponents(h.schema,r))}else{f.content={};for(let p of c){let h=l.content[p],g={};h.schema&&(g.schema=h.schema),h.examples&&(g.examples=h.examples),f.content[p]=g,h.schema&&Object.assign(i,this.extractUsedComponents(h.schema,r))}}}if(l.headers){f.headers={};for(let[c,p]of Object.entries(l.headers)){let h=p;f.headers[c]={...h.description&&{description:h.description},schema:h.schema||{type:"string"}}}}n.responses[s]=f}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 Ju,RC=se(()=>{"use strict";Ju=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 f=e;if(typeof e=="string")try{f=JSON.parse(e)}catch{return}o=this.inferrer.inferFromValue(f),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,f=i?`${i}.${s}`:s,c=r.slice(1);if(!e.properties[l])if(o)e.properties[l]={type:"array",items:{type:"object"}};else if(c.length>0)e.properties[l]={type:"object",properties:{}};else{let p=n.typeHints[f];e.properties[l]={type:p||"string"};return}if(c.length>0){let p=o?e.properties[l].items:e.properties[l];p&&this.ensureFieldPath(p,c,n,f)}}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 q$,ay,k$,P$,T$,A$,$$,Gu,CC=se(()=>{"use strict";q$=/(?:jsonData|responseJson|data|json|body|response\.json\(\))\.([a-zA-Z_][\w.\[\]]*)/g,ay="(?:pm|hf|ctx)",k$=new RegExp(`${ay}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(?:a|an)\\(['"](\\w+)['"]\\)`,"g"),P$=new RegExp(`${ay}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.(?:equal|eql)\\((.+?)\\)`,"g"),T$=/(?:to\.have\.status|response\.code.*?equal)\((\d+)\)/g,A$=new RegExp(`${ay}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(true|false)`,"g"),$$=new RegExp(`${ay}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.have\\.(?:lengthOf|length\\.above|length\\.below)`,"g"),Gu=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(q$.source,q$.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(k$.source,k$.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(P$.source,P$.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(A$.source,A$.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($$.source,$$.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(T$.source,T$.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 N$={};Ws(N$,{AwsSecretResolver:()=>ly});var ly,xC=se(()=>{"use strict";ly=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=>ft(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"),f=await new s(this.region?{region:this.region}:{}).send(new o({SecretId:n})),c=f.SecretString??(f.SecretBinary?Buffer.from(f.SecretBinary).toString("utf-8"):void 0);if(c===void 0)return;if(i)try{let p=JSON.parse(c);return p[i]!==void 0?String(p[i]):void 0}catch{return}return c}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 M$={};Ws(M$,{AzureKeyVaultResolver:()=>uy});var uy,EC=se(()=>{"use strict";uy=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=>ft(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 F$={};Ws(F$,{HashiCorpVaultResolver:()=>cy});var cy,IC=se(()=>{"use strict";cy=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 f;try{f=await fetch(o,{headers:l})}catch(g){throw new Error(`[HTTP Forge] Vault request failed: ${g?.message??g}`)}if(f.status===404)return;if(!f.ok)throw new Error(`[HTTP Forge] Vault returned HTTP ${f.status} for path: ${n}`);let p=(await f.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 h=Object.keys(p);return h.length===1?String(p[h[0]]):void 0}}});var D$={};Ws(D$,{OnePasswordResolver:()=>fy});import{execFile as t5}from"child_process";import{promisify as r5}from"util";var n5,fy,OC=se(()=>{"use strict";n5=r5(t5),fy=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}=ft("@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 n5("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 L$={};Ws(L$,{GcpSecretResolver:()=>dy});var dy,qC=se(()=>{"use strict";dy=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=>ft(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}`,[f]=await o.accessSecretVersion({name:l}),c=f.payload?.data;return c?Buffer.isBuffer(c)?c.toString("utf-8"):Buffer.from(c).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 U$={};Ws(U$,{DopplerResolver:()=>py});import*as j$ from"https";var py,kC=se(()=>{"use strict";py=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=j$.request(i,{method:"GET",headers:{Authorization:`Bearer ${n}`,Accept:"application/json"}},f=>{let c=[];f.on("data",p=>c.push(p)),f.on("end",()=>{let p=Buffer.concat(c).toString("utf-8");if(f.statusCode===404){s(void 0);return}if(f.statusCode!==200){o(new Error(`[HTTP Forge] Doppler API returned ${f.statusCode} for secret "${r}": ${p}`));return}try{let g=JSON.parse(p)?.value?.computed;s(g!=null?String(g):void 0)}catch{o(new Error(`[HTTP Forge] Doppler API returned non-JSON response for secret "${r}"`))}})});l.on("error",o),l.end()})}}});import*as hy from"fs";import{createRequire as i5}from"module";import*as H$ from"path";var Jd,PC=se(()=>{"use strict";Jd=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),f=l.indexOf("/");if(f<0)return;let c=l.slice(0,f),p=l.slice(f+1),h=this.resolvers.get(c);if(h)try{let g=await h.resolve(p);g!==void 0&&n.set(o,g)}catch(g){let v=g?.message??String(g);console.warn(`[HTTP Forge] {{${o}}} could not be resolved: ${v}`)}}));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}=(xC(),Vl(N$));return new r(e,this.moduleRequire)}case"azure":{let{AzureKeyVaultResolver:r}=(EC(),Vl(M$));return new r(e,this.moduleRequire)}case"vault":{let{HashiCorpVaultResolver:r}=(IC(),Vl(F$));return new r(e)}case"1password":{let{OnePasswordResolver:r}=(OC(),Vl(D$));return new r(e)}case"gcp":{let{GcpSecretResolver:r}=(qC(),Vl(L$));return new r(e,this.moduleRequire)}case"doppler":{let{DopplerResolver:r}=(kC(),Vl(U$));return new r(e)}default:return}}buildModuleRequire(e){let r=i=>ft(i);if(!e)return r;let n=[];try{n=e.getModulePaths()??[]}catch{return r}for(let i of n)try{let s=H$.resolve(i,"package.json");if(hy.existsSync(s)){let o=hy.realpathSync(s),l=i5(o);return f=>{try{return l(f)}catch{return r(f)}}}}catch{}return r}}});function wr(t){return t.replace(/\//g,"%2F")}function B$(t){return t.replace(/%2F/gi,"/")}function bs(t){return t?t.split("/").map(B$).join(" / "):""}function my(t){return t.includes(" / ")?t.split(" / ").map(e=>wr(e.trim())).join("/"):wr(t)}function Xe(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=wr(s.name),l=r?`${r}/${o}`:o;n.push(...Xe(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=wr(s.name),l=r?`${r}/${o}`:o;n.push({folderId:s.id,folderPath:l,requestCount:TC(s.items??[])}),n.push(...Zr(t,s.items??[],l))}return n}function TC(t){let e=0;for(let r of t)r.type==="request"?e++:e+=TC(r.items??[]);return e}var mi=se(()=>{"use strict"});var Gd,AC=se(()=>{"use strict";Gd={iterations:1,delayBetweenRequests:0,stopOnError:!1,readFromSharedSession:!1,writeToSharedSession:!1}});import*as Mt from"fs";import*as Co from"path";var Yd,$C=se(()=>{"use strict";mi();xn();AC();Yd=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(){Mt.existsSync(this.suitesDir)||Mt.mkdirSync(this.suitesDir,{recursive:!0})}setupFileWatcher(){try{this.fileWatcher=Mt.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(),!Mt.existsSync(this.suitesDir))return;let e=Mt.readdirSync(this.suitesDir);for(let r of e)if(r.endsWith(".suite.json"))try{let n=Co.join(this.suitesDir,r),i=Mt.readFileSync(n,"utf-8"),s=JSON.parse(i);s.id&&s.name&&this.suites.set(s.id,s)}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,r=[]){let n=Date.now(),i={id:St(e),name:e,requests:r,config:{...Gd},createdAt:n,updatedAt:n};return await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}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=await this.createSuite(r,n.requests.map(l=>({...l})));i.config={...n.config},i.description=n.description;let s=Co.join(this.suitesDir,e),o=Co.join(this.suitesDir,i.id);return Mt.existsSync(s)&&this.copyDirRecursive(s,o),await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}copyDirRecursive(e,r){Mt.existsSync(r)||Mt.mkdirSync(r,{recursive:!0});for(let n of Mt.readdirSync(e,{withFileTypes:!0})){let i=Co.join(e,n.name),s=Co.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):Mt.copyFileSync(i,s)}}async deleteSuite(e){let r=this.suites.get(e);if(!r)return!1;let n=`${r.id}.suite.json`,i=Co.join(this.suitesDir,n);try{return Mt.existsSync(i)&&Mt.unlinkSync(i),this.suites.delete(e),!0}catch(s){return console.error("[TestSuiteService] Failed to delete suite:",s),!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=Date.now();return{id:`temp-${e}`,name:r.name,requests:n,config:{...Gd},isTemporary:!0,createdAt:i,updatedAt:i}}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(p=>n?p.folderPath===o||p.folderPath.startsWith(`${o}/`):p.folderPath===o);if(l.length===0){console.error(`[TestSuiteService] No requests under folder "${r}" in collection: ${e}`);return}let f=Date.now();return{id:`temp-${e}-${this.slugifyFolderPath(o)}`,name:`${i.name} / ${bs(o)}`,requests:l,config:{...Gd},isTemporary:!0,createdAt:f,updatedAt:f}}slugifyFolderPath(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}async saveTempSuite(e,r){let n=Date.now(),i={...e,id:St(r),name:r,isTemporary:!1,createdAt:n,updatedAt:n};return await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}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}/${wr(o.name)}`:wr(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}/${wr(o.name)}`:wr(o.name);this.extractRequestsFromCollection(o,r,n,l,s)}}async saveSuiteToDisk(e){this.ensureSuitesDir();let r=`${e.id}.suite.json`,n=Co.join(this.suitesDir,r),i=JSON.stringify(e,null,2);Mt.writeFileSync(n,i,"utf-8")}}});var ne,gy=se(()=>{"use strict";ne={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")}});import*as V$ from"path";function yy(t,e){let{workspaceFolder:r,fileWatcherFactory:n,notificationService:i,workspaceStore:s,globalStore:o,secretStore:l,browserService:f,applicationInfo:c,consoleService:p}=e;t.registerValue(ne.WorkspaceFolder,r),t.registerSingleton(ne.Config,()=>new no(r,n,i)),t.registerSingleton(ne.Console,()=>p??s5),t.registerSingleton(ne.EnvironmentConfig,g=>new Gf(r,s,g.resolve(ne.Config),n,l,e.persistOverrides??!0)),t.registerSingleton(ne.Cookie,()=>new Wf(o)),t.registerSingleton(ne.Collection,g=>new Vf(r,g.resolve(ne.Config),n)),t.registerSingleton(ne.TestSuite,g=>new Yd(g.resolve(ne.Collection),g.resolve(ne.Config))),t.registerSingleton(ne.HttpClient,()=>new pa),t.registerSingleton(ne.UrlBuilder,()=>new Kn),t.registerSingleton(ne.InterceptorChain,()=>new ss),t.registerSingleton(ne.HttpRequest,g=>new is(g.resolve(ne.UrlBuilder),g.resolve(ne.InterceptorChain),g.resolve(ne.HttpClient))),t.registerSingleton(ne.RequestPreprocessor,()=>new Ea),t.registerSingleton(ne.RequestHistory,g=>{let v=g.resolve(ne.EnvironmentConfig);return new Xf(v.getHistoriesPath(),V$.join(v.getRootPath(),"shared-histories"))}),l&&f&&t.registerSingleton(ne.OAuth2TokenManager,g=>new Uf(l,f,g.resolve(ne.EnvironmentConfig),g.resolve(ne.HttpRequest))),t.registerSingleton(ne.GraphQLSchemaService,g=>new Kf(g.resolve(ne.HttpClient))),t.registerSingleton(ne.SecretResolverRegistry,g=>new Jd(g.resolve(ne.Config)));let h=c??{name:"HttpForge",version:"0.0.0"};t.registerSingleton(ne.RequestPreparer,g=>new Yf(g.resolve(ne.EnvironmentConfig),g.resolve(ne.HttpRequest),g.resolve(ne.RequestPreprocessor),g.has(ne.OAuth2TokenManager)?g.resolve(ne.OAuth2TokenManager):void 0,h,g.resolve(ne.SecretResolverRegistry))),t.registerSingleton(ne.ScriptExecutor,g=>{let v=g.resolve(ne.Config);return new cs(g.resolve(ne.HttpRequest),v.getModulePaths(),g.resolve(ne.SecretResolverRegistry),v.getScriptScope(),v.getScriptTimeout())}),t.registerSingleton(ne.DataFileParser,()=>new Oa),t.registerSingleton(ne.CollectionRequestExecutor,g=>new io(g.resolve(ne.HttpRequest),g.resolve(ne.ScriptExecutor),g.resolve(ne.EnvironmentConfig),g.resolve(ne.RequestPreparer),"")),t.registerSingleton(ne.PersistentCookieJar,g=>new zf(g.resolve(ne.Cookie))),t.registerSingleton(ne.SchemaInferrer,()=>new yo),t.registerSingleton(ne.HistoryAnalyzer,g=>new vu(g.resolve(ne.RequestHistory),g.resolve(ne.SchemaInferrer))),t.registerSingleton(ne.ScriptAnalyzer,()=>new Gu),t.registerSingleton(ne.SchemaInferenceService,g=>new Ju(g.resolve(ne.HistoryAnalyzer),g.resolve(ne.ScriptAnalyzer),g.resolve(ne.SchemaInferrer))),t.registerSingleton(ne.OpenApiExporter,g=>new ku(g.resolve(ne.Collection),g.resolve(ne.EnvironmentConfig),g.resolve(ne.SchemaInferenceService))),t.registerSingleton(ne.OpenApiImporter,g=>new Ro(g.resolve(ne.Collection),g.resolve(ne.EnvironmentConfig)))}var s5,NC=se(()=>{"use strict";o0();f0();Em();p0();h0();g0();Om();y0();v0();x0();tf();rf();ef();_m();zl();E0();aR();oy();RC();kg();CC();Rm();Ff();PC();$C();gy();s5={log:()=>{},trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},logBatch:()=>{},logRawLines:()=>{},show:()=>{},clear:()=>{},dispose:()=>{}}});function W$(){return za.instance}var za,MC=se(()=>{"use strict";gy();za=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(ne.Config)}get console(){return this.resolve(ne.Console)}get environmentConfig(){return this.resolve(ne.EnvironmentConfig)}get collection(){return this.resolve(ne.Collection)}get httpRequest(){return this.resolve(ne.HttpRequest)}get httpClient(){return this.resolve(ne.HttpClient)}get cookie(){return this.resolve(ne.Cookie)}get requestHistory(){return this.resolve(ne.RequestHistory)}get dataFileParser(){return this.resolve(ne.DataFileParser)}get scriptExecutor(){return this.resolve(ne.ScriptExecutor)}get requestPreparer(){return this.resolve(ne.RequestPreparer)}get persistentCookieJar(){return this.resolve(ne.PersistentCookieJar)}get oauth2TokenManager(){return this.has(ne.OAuth2TokenManager)?this.resolve(ne.OAuth2TokenManager):void 0}get graphqlSchemaService(){return this.resolve(ne.GraphQLSchemaService)}get testSuite(){return this.resolve(ne.TestSuite)}}});function z$(t){return/\{\{[^}]+\}\}/.test(t)}function Kd(t,e=16){return!!t&&t.length>=e&&!z$(t)}function FC(t){return t.toUpperCase().replace(/[^A-Z0-9]/g,"_")}function Qd(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(f=>`${f.requestId}::${f.field}`===l)||o.occurrences.push(i)}function vy(t,e=1){let r=Xe(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 f=l.key.toLowerCase(),c=l.value;if(f==="authorization"){let p=c.match(/^(bearer|basic|token|digest)\s+(.+)$/i);p&&Kd(p[2])?Qd(n,p[2],`${p[1].toUpperCase()}_TOKEN`,`Authorization ${p[1]} token`,o(`header:${l.key}`),1):Kd(c)&&Qd(n,c,"AUTH_TOKEN","Authorization header value",o(`header:${l.key}`),1)}else o5.has(f)&&Kd(c)?Qd(n,c,FC(l.key),`Sensitive header: ${l.key}`,o(`header:${l.key}`),2):Kd(c,20)&&!c.includes(" ")&&/^[A-Za-z0-9+/=_.-]+$/.test(c)&&Qd(n,c,FC(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&&a5.has(l.key.toLowerCase())&&Kd(l.value)&&Qd(n,l.value,FC(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||z$(s.url)))try{let o=new URL(s.url);if(!["localhost","127.0.0.1","0.0.0.0","::1"].includes(o.hostname)){let f=`${o.protocol}//${o.host}`,c=i.get(f)??[];c.push({requestId:s.id,requestName:s.name,field:"url"}),i.set(f,c)}}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 DC(t,e){let r={};return J$(t,e,r),r}function J$(t,e,r){for(let n of t){if(n.type==="folder"){n.items&&J$(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 f=l.value.match(/^(bearer|basic|token|digest)\s+(.+)$/i);f&&f[2]===s.value?(l.value=`${f[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 o5,a5,LC=se(()=>{"use strict";mi();o5=new Set(["x-api-key","x-auth-token","x-access-token","x-token","x-secret","api-key","apikey","x-client-secret","x-rapidapi-key"]),a5=new Set(["api_key","apikey","api-key","access_token","token","auth_token","client_id","client_secret","key","secret"])});function Ss(t,e){let r={type:"string",description:t};return e.length>0&&(r.enum=[...e]),r}function jC(t,e,r){let n=i=>Ss("Name of the collection to act on."+(i?"":" Optional."),e);return[{name:`${t}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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.'},...by.properties},required:["collection","request"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${J.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").'},...wy.properties},required:["collection","folder"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${J.runCollection}`,description:"Run every request in a collection.",inputSchema:{type:"object",properties:{collection:n(!0),...Sy.properties},required:["collection"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${J.runSuite}`,description:"Run a saved test suite.",inputSchema:{type:"object",properties:{suite:Ss("Name of the test suite to run.",r),..._y.properties},required:["suite"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.listSuites}`,description:"List all test suites with name, id, request count, and configuration summary.",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${J.getSuite}`,description:"Get full details of a test suite including its request list.",inputSchema:{type:"object",properties:{suite:Ss("Name or id of the test suite.",r)},required:["suite"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.createSuite}`,description:"Create a new test suite (empty or pre-populated from a collection/folder).",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."},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}${J.updateSuiteConfig}`,description:"Change a suite's name, description, or run configuration.",inputSchema:{type:"object",properties:{suite:Ss("Name or id of the suite to update.",r),name:{type:"string",description:"New display name."},description:{type:"string",description:"New description."},iterations:{type:"number"},stopOnError:{type:"boolean"},delayBetweenRequests:{type:"number"}},required:["suite"]},annotations:{idempotentHint:!0}},{name:`${t}${J.addSuiteRequests}`,description:"Append or insert one or more requests into a suite.",inputSchema:{type:"object",properties:{suite:Ss("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 index to insert at. Omit to append at end."}},required:["suite","requests"]},annotations:{idempotentHint:!1}},{name:`${t}${J.removeSuiteRequest}`,description:"Remove a request from a suite by position (0-based) or by name.",inputSchema:{type:"object",properties:{suite:Ss("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}${J.reorderSuiteRequests}`,description:"Reorder requests in a suite. Requests not listed are moved to the end.",inputSchema:{type:"object",properties:{suite:Ss("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}${J.duplicateSuite}`,description:"Clone an existing suite under a new name.",inputSchema:{type:"object",properties:{suite:Ss("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}${J.deleteSuite}`,description:"Delete a test suite permanently. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{suite:Ss("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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.getGlobals}`,description:"Return all global variables (merged _global.json + runtime pm.globals.set() values).",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${J.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}${J.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}${J.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}${J.suggestEnvVars}`,description:`Scan a collection for hardcoded values (API keys, base URLs, tokens, tenant IDs) that should become environment variables.
277
+ `)}`));if(!("location"in i.headers)||!i.headers.location)throw(0,ty.ono)({status:i.status},`HTTP ${i.status} redirect with no location header`);{let s=Bd.resolve(t.href,i.headers.location);return i$(s,e,n)}}else{if(i.body){let s=await i.arrayBuffer();return Buffer.from(s)}return Buffer.alloc(0)}}catch(i){throw new n$.ResolverError((0,ty.ono)(i,`Error downloading ${t.href}`),t.href)}}async function d8(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 hC=H(vs=>{"use strict";var Vu=vs&&vs.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(vs,"__esModule",{value:!0});vs.getNewOptions=vs.getJsonSchemaRefParserDefaultOptions=void 0;var p8=Vu(TA()),h8=Vu(K1()),m8=Vu(Q1()),g8=Vu(Z1()),y8=Vu(r$()),v8=Vu(s$()),b8=()=>({parse:{json:{...p8.default},yaml:{...h8.default},text:{...m8.default},binary:{...g8.default}},resolve:{file:{...y8.default},http:{...v8.default},external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative"},mutateInputSchema:!0});vs.getJsonSchemaRefParserDefaultOptions=b8;var S8=t=>{let e=(0,vs.getJsonSchemaRefParserDefaultOptions)();return t&&a$(e,t),e};vs.getNewOptions=S8;function a$(t,e){if(o$(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];o$(s)?t[i]=a$(o||{},s):s!==void 0&&(t[i]=s)}}return t}function o$(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}});var u$=H(ry=>{"use strict";Object.defineProperty(ry,"__esModule",{value:!0});ry.normalizeArgs=l$;var w8=hC();function l$(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,w8.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}}ry.default=l$});var c$=H(fi=>{"use strict";var _8=fi&&fi.__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]})),R8=fi&&fi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),C8=fi&&fi.__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 R8(r,e),r}})(),mC=fi&&fi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fi,"__esModule",{value:!0});var x8=mC(Mu()),E8=mC(Td()),I8=mC(PR()),Wu=C8(Tn()),O8=An();function q8(t,e){if(!e.resolve?.external)return Promise.resolve();try{let r=gC(t.schema,t.$refs._root$Ref.path+"#",t.$refs,e);return Promise.all(r)}catch(r){return Promise.reject(r)}}function gC(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),x8.default.isExternal$Ref(t)&&o.push(k8(t,e,r,n));let l=Object.keys(t);for(let f of l){let c=E8.default.join(e,f),p=t[f];o=o.concat(gC(p,c,r,n,i,s))}}return o}async function k8(t,e,r,n){let i=n.dereference?.externalReferenceResolution==="root",s=Wu.resolve(i?Wu.cwd():e,t.$ref),o=Wu.stripHash(s),l=r._$refs[o];if(l)return Promise.resolve(l.value);try{let f=await(0,I8.default)(s,r,n),c=gC(f,o+"#",r,n,new Set,!0);return Promise.all(c)}catch(f){if(!n?.continueOnError||!(0,O8.isHandledError)(f))throw f;return r._$refs[o]&&(f.source=decodeURI(Wu.stripHash(e)),f.path=Wu.safePointerToPath(Wu.getHash(e))),[]}}fi.default=q8});var p$=H(di=>{"use strict";var P8=di&&di.__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]})),T8=di&&di.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),A8=di&&di.__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"&&P8(r,e,n[i]);return T8(r,e),r}})(),d$=di&&di.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(di,"__esModule",{value:!0});var ny=d$(Mu()),Vd=d$(Td()),yC=A8(Tn());function $8(t,e){let r=[];vC(t,"schema",t.$refs._root$Ref.path+"#","#",0,r,t.$refs,e),N8(r)}function vC(t,e,r,n,i,s,o,l){let f=e===null?t:t[e];if(f&&typeof f=="object"&&!ArrayBuffer.isView(f))if(ny.default.isAllowed$Ref(f))f$(t,e,r,n,i,s,o,l);else{let c=Object.keys(f).sort((p,h)=>p==="definitions"?-1:h==="definitions"?1:p.length-h.length);for(let p of c){let h=Vd.default.join(r,p),g=Vd.default.join(n,p),v=f[p];ny.default.isAllowed$Ref(v)?f$(f,p,r,g,i,s,o,l):vC(f,p,h,g,i,s,o,l)}}}function f$(t,e,r,n,i,s,o,l){let f=e===null?t:t[e],c=yC.resolve(r,f.$ref),p=o._resolve(c,n,l);if(p===null)return;let g=Vd.default.parse(n).length,v=yC.stripHash(p.path),_=yC.getHash(p.path),w=v!==o._root$Ref.path,E=ny.default.isExtended$Ref(f);i+=p.indirections;let k=M8(s,t,e);if(k)if(g<k.depth||i<k.indirections)F8(s,k);else return;s.push({$ref:f,parent:t,key:e,pathFromRoot:n,depth:g,file:v,hash:_,value:p.value,circular:p.circular,extended:E,external:w,indirections:i}),(!k||w)&&vC(p.value,null,p.path,n,i+1,s,o,l)}function N8(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=Vd.default.join(n,Vd.default.parse(i.hash.replace(r,"#"))):(e=i.file,r=i.hash,n=i.pathFromRoot,i.$ref=i.parent[i.key]=ny.default.dereference(i.$ref,i.value),i.circular&&(i.$ref.$ref=i.pathFromRoot)):i.$ref.$ref=i.hash}function M8(t,e,r){for(let n of t)if(n&&n.parent===e&&n.key===r)return n}function F8(t,e){let r=t.indexOf(e);t.splice(r,1)}di.default=$8});var b$=H(pi=>{"use strict";var D8=pi&&pi.__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]})),L8=pi&&pi.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),j8=pi&&pi.__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"&&D8(r,e,n[i]);return L8(r,e),r}})(),y$=pi&&pi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pi,"__esModule",{value:!0});var iy=y$(Mu()),h$=y$(Td()),U8=bo(),m$=j8(Tn()),H8=An();pi.default=B8;function B8(t,e){let r=Date.now(),n=bC(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 bC(t,e,r,n,i,s,o,l,f){let c,p={value:t,circular:!1};if(l&&l.timeoutMs&&Date.now()-f>l.timeoutMs)throw new H8.TimeoutError(l.timeoutMs);let h=l.dereference||{},g=h.excludedPathMatcher||(()=>!1);if((h?.circular==="ignore"||!i.has(t))&&t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!g(r)){if(n.add(t),i.add(t),iy.default.isAllowed$Ref(t,l))c=g$(t,e,r,n,i,s,o,l,f),p.circular=c.circular,p.value=c.value;else for(let v of Object.keys(t)){let _=h$.default.join(e,v),w=h$.default.join(r,v);if(g(w))continue;let E=t[v],k=!1;if(iy.default.isAllowed$Ref(E,l)){if(c=g$(E,_,w,n,i,s,o,l,f),k=c.circular,t[v]!==c.value){let T=new Map;h?.preservedProperties&&typeof t[v]=="object"&&!Array.isArray(t[v])&&h?.preservedProperties.forEach(N=>{N in t[v]&&T.set(N,t[v][N])}),t[v]=c.value,h?.preservedProperties&&T.size&&typeof t[v]=="object"&&!Array.isArray(t[v])&&T.forEach((N,$)=>{t[v][$]=N}),h?.onDereference?.(E.$ref,t[v],t,v)}}else n.has(E)?k=v$(_,o,l):(c=bC(E,_,w,n,i,s,o,l,f),k=c.circular,t[v]!==c.value&&(t[v]=c.value));p.circular=p.circular||k}n.delete(t)}return p}function g$(t,e,r,n,i,s,o,l,f){let p=iy.default.isExternal$Ref(t)&&l?.dereference?.externalReferenceResolution==="root",h=m$.resolve(p?m$.cwd():e,t.$ref),g=s.get(h);if(g&&!g.circular){let T=Object.keys(t);if(T.length>1){let N={};for(let $ of T)$!=="$ref"&&!($ in g.value)&&(N[$]=t[$]);return{circular:g.circular,value:Object.assign({},g.value,N)}}return g}let v=o._resolve(h,e,l);if(v===null)return{circular:!1,value:null};let _=v.circular,w=_||n.has(v.value);w&&v$(e,o,l);let E=iy.default.dereference(t,v.value);if(!w){let T=bC(E,v.path,r,n,i,s,o,l,f);w=T.circular,E=T.value}w&&!_&&l.dereference?.circular==="ignore"&&(E=t),_&&(E.$ref=r);let k={circular:w,value:E};return Object.keys(t).length===1&&s.set(h,k),k}function v$(t,e,r){if(e.circular=!0,r?.dereference?.onCircular?.(t),!r.dereference.circular)throw U8.ono.reference(`Circular $ref pointer found at ${t}`);return!0}});var S$=H(SC=>{"use strict";Object.defineProperty(SC,"__esModule",{value:!0});function V8(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(e){setTimeout(e,0)}}SC.default=V8()});var _$=H(Wd=>{"use strict";var W8=Wd&&Wd.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wd,"__esModule",{value:!0});Wd.default=z8;var w$=W8(S$());function z8(t,e){if(t){e.then(function(r){(0,w$.default)(function(){t(null,r)})},function(r){(0,w$.default)(function(){t(r)})});return}else return e}});var E$=H(xe=>{"use strict";var J8=xe&&xe.__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=xe&&xe.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),Y8=xe&&xe.__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}})(),Wa=xe&&xe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xe,"__esModule",{value:!0});xe.getJsonSchemaRefParserDefaultOptions=xe.jsonSchemaParserNormalizeArgs=xe.dereferenceInternal=xe.JSONParserErrorGroup=xe.isHandledError=xe.UnmatchedParserError=xe.ParserError=xe.ResolverError=xe.MissingPointerError=xe.InvalidPointerError=xe.JSONParserError=xe.UnmatchedResolverError=xe.dereference=xe.bundle=xe.resolve=xe.parse=xe.$RefParser=void 0;var R$=Wa(IA()),K8=Wa(PR()),zd=Wa(u$());xe.jsonSchemaParserNormalizeArgs=zd.default;var Q8=Wa(c$()),Z8=Wa(p$()),x$=Wa(b$());xe.dereferenceInternal=x$.default;var Va=Y8(Tn()),$n=An();Object.defineProperty(xe,"JSONParserError",{enumerable:!0,get:function(){return $n.JSONParserError}});Object.defineProperty(xe,"InvalidPointerError",{enumerable:!0,get:function(){return $n.InvalidPointerError}});Object.defineProperty(xe,"MissingPointerError",{enumerable:!0,get:function(){return $n.MissingPointerError}});Object.defineProperty(xe,"ResolverError",{enumerable:!0,get:function(){return $n.ResolverError}});Object.defineProperty(xe,"ParserError",{enumerable:!0,get:function(){return $n.ParserError}});Object.defineProperty(xe,"UnmatchedParserError",{enumerable:!0,get:function(){return $n.UnmatchedParserError}});Object.defineProperty(xe,"UnmatchedResolverError",{enumerable:!0,get:function(){return $n.UnmatchedResolverError}});Object.defineProperty(xe,"isHandledError",{enumerable:!0,get:function(){return $n.isHandledError}});Object.defineProperty(xe,"JSONParserErrorGroup",{enumerable:!0,get:function(){return $n.JSONParserErrorGroup}});var C$=bo(),hi=Wa(_$()),X8=hC();Object.defineProperty(xe,"getJsonSchemaRefParserDefaultOptions",{enumerable:!0,get:function(){return X8.getJsonSchemaRefParserDefaultOptions}});var Ro=class t{constructor(){this.schema=null,this.$refs=new R$.default}async parse(){let e=(0,zd.default)(arguments),r;if(!e.path&&!e.schema){let i=(0,C$.ono)(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return(0,hi.default)(e.callback,Promise.reject(i))}this.schema=null,this.$refs=new R$.default;let n="http";if(Va.isFileSystemPath(e.path))e.path=Va.fromFileSystemPath(e.path),n="file";else if(!e.path&&e.schema&&"$id"in e.schema&&e.schema.$id){let i=Va.parse(e.schema.$id),s=i.protocol==="https:"?443:80;e.path=`${i.protocol}//${i.hostname}:${s}`}if(e.path=Va.resolve(Va.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,K8.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,hi.default)(e.callback,Promise.resolve(this.schema));if(e.options.continueOnError)return this.schema=null,(0,hi.default)(e.callback,Promise.resolve(this.schema));throw C$.ono.syntax(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(i){return!e.options.continueOnError||!(0,$n.isHandledError)(i)?(0,hi.default)(e.callback,Promise.reject(i)):(this.$refs._$refs[Va.stripHash(e.path)]&&this.$refs._$refs[Va.stripHash(e.path)].addError(i),(0,hi.default)(e.callback,Promise.resolve(null)))}}static parse(){let e=new t;return e.parse.apply(e,arguments)}async resolve(){let e=(0,zd.default)(arguments);try{return await this.parse(e.path,e.schema,e.options),await(0,Q8.default)(this,e.options),wC(this),(0,hi.default)(e.callback,Promise.resolve(this.$refs))}catch(r){return(0,hi.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,zd.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,Z8.default)(this,e.options),wC(this),(0,hi.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,hi.default)(e.callback,Promise.reject(r))}}static dereference(){let e=new t;return e.dereference.apply(e,arguments)}async dereference(){let e=(0,zd.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,x$.default)(this,e.options),wC(this),(0,hi.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,hi.default)(e.callback,Promise.reject(r))}}};xe.$RefParser=Ro;xe.default=Ro;function wC(t){if($n.JSONParserErrorGroup.getParserErrors(t).length>0)throw new $n.JSONParserErrorGroup(t)}xe.parse=Ro.parse;xe.resolve=Ro.resolve;xe.bundle=Ro.bundle;xe.dereference=Ro.dereference});var sy,zu,_C=se(()=>{"use strict";sy=Hc(E$()),zu=class{async resolve(e){try{return await sy.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 sy.default.bundle(e)}catch(r){return console.error("[RefResolver] Failed to bundle $ref pointers:",r),e}}async resolveFile(e){try{return await sy.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){throw console.error(`[RefResolver] Failed to resolve file ${e}:`,r),r}}}});import*as I$ from"fs";var O$,e5,Co,oy=se(()=>{"use strict";O$=Hc(kd());xn();lR();_C();e5=["application/json","text/plain","text/html","multipart/form-data","application/x-www-form-urlencoded"],Co=class{constructor(e,r){this.collectionService=e;this.envConfigService=r;this.exampleGenerator=new Pu,this.refResolver=new zu}collectionService;envConfigService;exampleGenerator;refResolver;async import(e,r){let n=await I$.promises.readFile(e,"utf-8"),i;e.endsWith(".yaml")||e.endsWith(".yml")?i=O$.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",f={id:St(o),name:o,description:i.info?.description||"",version:i.info?.version||"1.0.0",variables:{},items:[]};if(i.servers&&i.servers.length>0&&(f.variables.baseUrl=i.servers[0].url),i.security&&i.security.length>0&&i.components?.securitySchemes){let h=this.mapSecurityToAuth(i.security[0],i.components.securitySchemes);h&&(f.auth=h)}let c=new Map;if(i.tags)for(let h of i.tags){let g={type:"folder",id:St(h.name),name:h.name,description:h.description,items:[]};c.set(h.name,g),f.items.push(g)}if(i.paths)for(let[h,g]of Object.entries(i.paths))for(let v of["get","post","put","patch","delete","head","options","trace"]){let _=g[v];if(!_)continue;let w=this.processOperation(v,h,_,g,i,s),E=_.tags?.[0];if(E&&c.has(E))c.get(E).items.push(w);else if(E){let k={type:"folder",id:St(E),name:E,items:[w]};c.set(E,k),f.items.push(k)}else f.items.push(w)}await this.collectionService.saveCollection(f);let p;return r?.environmentName&&i.servers&&(p=await this.createEnvironmentFromServers(i.servers,r.environmentName)),{collection:f,environmentCreated:p}}processOperation(e,r,n,i,s,o){let l=St(n.operationId||`${e}-${r}`),f=`{{baseUrl}}${this.convertPathParams(r)}`,c=n.summary||n.operationId||`${e.toUpperCase()} ${r}`,p=n.deprecated===!0;p&&(c=`[DEPRECATED] ${c}`);let h={type:"request",id:l,name:c,method:e.toUpperCase(),url:f,description:n.description||"",deprecated:p},g=[...i.parameters||[],...n.parameters||[]];if(this.processParameters(h,g,o),n.requestBody&&this.processRequestBody(h,n.requestBody,o),n.responses&&(h.responseSchema=this.processResponses(n.responses,o)),n.security!==void 0&&s.components?.securitySchemes){if(Array.isArray(n.security)&&n.security.length===0)h.auth={type:"none"};else if(n.security&&n.security.length>0){let v=this.mapSecurityToAuth(n.security[0],s.components.securitySchemes);v&&(h.auth=v)}}return h}convertPathParams(e){return e.replace(/\{(\w+)\}/g,":$1")}processParameters(e,r,n){let i=[],s=[],o={},l=[];for(let f of r){let c=f.name,p=f.in,h=f.schema||{},g=f.example!==void 0?String(f.example):this.generateExampleForParam(h,n),v=f.deprecated===!0;switch(p){case"path":{if(f.description||h.type||h.format||h.enum||v||h.pattern||h.minimum!==void 0||h.maximum!==void 0||h.minLength!==void 0||h.maxLength!==void 0||h.multipleOf!==void 0||h.minItems!==void 0||h.maxItems!==void 0||h.uniqueItems||h.nullable||h.oneOf){let w={value:g};h.oneOf?(w.oneOf=h.oneOf,this.applyOneOfHints(w,h.oneOf)):(h.type&&(w.type=h.type),h.format&&(w.format=h.format),h.enum&&(w.enum=h.enum.map(String)),h.pattern&&(w.pattern=h.pattern),h.minimum!==void 0&&(w.minimum=h.minimum),h.maximum!==void 0&&(w.maximum=h.maximum),h.exclusiveMinimum!==void 0&&(w.exclusiveMinimum=h.exclusiveMinimum),h.exclusiveMaximum!==void 0&&(w.exclusiveMaximum=h.exclusiveMaximum),h.multipleOf!==void 0&&(w.multipleOf=h.multipleOf),h.minLength!==void 0&&(w.minLength=h.minLength),h.maxLength!==void 0&&(w.maxLength=h.maxLength),h.minItems!==void 0&&(w.minItems=h.minItems),h.maxItems!==void 0&&(w.maxItems=h.maxItems),h.uniqueItems&&(w.uniqueItems=!0),h.nullable&&(w.nullable=!0)),f.description&&(w.description=f.description),v&&(w.deprecated=!0),o[c]=w}else o[c]=g;break}case"query":{let _={key:c,value:g};this.applySchemaConstraints(_,h,f,v),s.push(_);break}case"header":{let _={key:c,value:g};this.applySchemaConstraints(_,h,f,v),i.push(_);break}case"cookie":{l.push(`${c}={{${c}}}`);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:f}=this.mapContentTypeToBodyType(s);if(e.body={type:l,...f&&{format:f},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 c=this.buildBodySchema(r,s,n);c&&(e.bodySchema=c)}selectPrimaryContentType(e){for(let i of e5)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 f=l,c=f.type==="string"&&f.format==="binary",p={key:o,value:c?"":String(this.exampleGenerator.generate(f,{components:r})||""),type:c?"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 f of i){let c=e.content[f],p={};c.schema&&(p.schema=c.schema),c.examples&&(p.examples=c.examples),c.encoding&&(p.encoding=c.encoding),o.content[f]=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,f={description:l.description||`Status ${s}`};if(l.content){let c=Object.keys(l.content);if(c.length===1){let p=c[0],h=l.content[p];f.contentType=p,h.schema&&(f.schema=h.schema),h.examples&&(f.examples=h.examples),h.schema&&Object.assign(i,this.extractUsedComponents(h.schema,r))}else{f.content={};for(let p of c){let h=l.content[p],g={};h.schema&&(g.schema=h.schema),h.examples&&(g.examples=h.examples),f.content[p]=g,h.schema&&Object.assign(i,this.extractUsedComponents(h.schema,r))}}}if(l.headers){f.headers={};for(let[c,p]of Object.entries(l.headers)){let h=p;f.headers[c]={...h.description&&{description:h.description},schema:h.schema||{type:"string"}}}}n.responses[s]=f}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 Ju,RC=se(()=>{"use strict";Ju=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 f=e;if(typeof e=="string")try{f=JSON.parse(e)}catch{return}o=this.inferrer.inferFromValue(f),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,f=i?`${i}.${s}`:s,c=r.slice(1);if(!e.properties[l])if(o)e.properties[l]={type:"array",items:{type:"object"}};else if(c.length>0)e.properties[l]={type:"object",properties:{}};else{let p=n.typeHints[f];e.properties[l]={type:p||"string"};return}if(c.length>0){let p=o?e.properties[l].items:e.properties[l];p&&this.ensureFieldPath(p,c,n,f)}}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 q$,ay,k$,P$,T$,A$,$$,Gu,CC=se(()=>{"use strict";q$=/(?:jsonData|responseJson|data|json|body|response\.json\(\))\.([a-zA-Z_][\w.\[\]]*)/g,ay="(?:pm|hf|ctx)",k$=new RegExp(`${ay}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(?:a|an)\\(['"](\\w+)['"]\\)`,"g"),P$=new RegExp(`${ay}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.(?:equal|eql)\\((.+?)\\)`,"g"),T$=/(?:to\.have\.status|response\.code.*?equal)\((\d+)\)/g,A$=new RegExp(`${ay}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(true|false)`,"g"),$$=new RegExp(`${ay}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.have\\.(?:lengthOf|length\\.above|length\\.below)`,"g"),Gu=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(q$.source,q$.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(k$.source,k$.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(P$.source,P$.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(A$.source,A$.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($$.source,$$.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(T$.source,T$.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 N$={};Ws(N$,{AwsSecretResolver:()=>ly});var ly,xC=se(()=>{"use strict";ly=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=>ft(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"),f=await new s(this.region?{region:this.region}:{}).send(new o({SecretId:n})),c=f.SecretString??(f.SecretBinary?Buffer.from(f.SecretBinary).toString("utf-8"):void 0);if(c===void 0)return;if(i)try{let p=JSON.parse(c);return p[i]!==void 0?String(p[i]):void 0}catch{return}return c}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 M$={};Ws(M$,{AzureKeyVaultResolver:()=>uy});var uy,EC=se(()=>{"use strict";uy=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=>ft(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 F$={};Ws(F$,{HashiCorpVaultResolver:()=>cy});var cy,IC=se(()=>{"use strict";cy=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 f;try{f=await fetch(o,{headers:l})}catch(g){throw new Error(`[HTTP Forge] Vault request failed: ${g?.message??g}`)}if(f.status===404)return;if(!f.ok)throw new Error(`[HTTP Forge] Vault returned HTTP ${f.status} for path: ${n}`);let p=(await f.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 h=Object.keys(p);return h.length===1?String(p[h[0]]):void 0}}});var D$={};Ws(D$,{OnePasswordResolver:()=>fy});import{execFile as t5}from"child_process";import{promisify as r5}from"util";var n5,fy,OC=se(()=>{"use strict";n5=r5(t5),fy=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}=ft("@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 n5("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 L$={};Ws(L$,{GcpSecretResolver:()=>dy});var dy,qC=se(()=>{"use strict";dy=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=>ft(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}`,[f]=await o.accessSecretVersion({name:l}),c=f.payload?.data;return c?Buffer.isBuffer(c)?c.toString("utf-8"):Buffer.from(c).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 U$={};Ws(U$,{DopplerResolver:()=>py});import*as j$ from"https";var py,kC=se(()=>{"use strict";py=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=j$.request(i,{method:"GET",headers:{Authorization:`Bearer ${n}`,Accept:"application/json"}},f=>{let c=[];f.on("data",p=>c.push(p)),f.on("end",()=>{let p=Buffer.concat(c).toString("utf-8");if(f.statusCode===404){s(void 0);return}if(f.statusCode!==200){o(new Error(`[HTTP Forge] Doppler API returned ${f.statusCode} for secret "${r}": ${p}`));return}try{let g=JSON.parse(p)?.value?.computed;s(g!=null?String(g):void 0)}catch{o(new Error(`[HTTP Forge] Doppler API returned non-JSON response for secret "${r}"`))}})});l.on("error",o),l.end()})}}});import*as hy from"fs";import{createRequire as i5}from"module";import*as H$ from"path";var Jd,PC=se(()=>{"use strict";Jd=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),f=l.indexOf("/");if(f<0)return;let c=l.slice(0,f),p=l.slice(f+1),h=this.resolvers.get(c);if(h)try{let g=await h.resolve(p);g!==void 0&&n.set(o,g)}catch(g){let v=g?.message??String(g);console.warn(`[HTTP Forge] {{${o}}} could not be resolved: ${v}`)}}));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}=(xC(),Vl(N$));return new r(e,this.moduleRequire)}case"azure":{let{AzureKeyVaultResolver:r}=(EC(),Vl(M$));return new r(e,this.moduleRequire)}case"vault":{let{HashiCorpVaultResolver:r}=(IC(),Vl(F$));return new r(e)}case"1password":{let{OnePasswordResolver:r}=(OC(),Vl(D$));return new r(e)}case"gcp":{let{GcpSecretResolver:r}=(qC(),Vl(L$));return new r(e,this.moduleRequire)}case"doppler":{let{DopplerResolver:r}=(kC(),Vl(U$));return new r(e)}default:return}}buildModuleRequire(e){let r=i=>ft(i);if(!e)return r;let n=[];try{n=e.getModulePaths()??[]}catch{return r}for(let i of n)try{let s=H$.resolve(i,"package.json");if(hy.existsSync(s)){let o=hy.realpathSync(s),l=i5(o);return f=>{try{return l(f)}catch{return r(f)}}}}catch{}return r}}});function wr(t){return t.replace(/\//g,"%2F")}function B$(t){return t.replace(/%2F/gi,"/")}function bs(t){return t?t.split("/").map(B$).join(" / "):""}function my(t){return t.includes(" / ")?t.split(" / ").map(e=>wr(e.trim())).join("/"):wr(t)}function Xe(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=wr(s.name),l=r?`${r}/${o}`:o;n.push(...Xe(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=wr(s.name),l=r?`${r}/${o}`:o;n.push({folderId:s.id,folderPath:l,requestCount:TC(s.items??[])}),n.push(...Zr(t,s.items??[],l))}return n}function TC(t){let e=0;for(let r of t)r.type==="request"?e++:e+=TC(r.items??[]);return e}var mi=se(()=>{"use strict"});var Gd,AC=se(()=>{"use strict";Gd={iterations:1,delayBetweenRequests:0,stopOnError:!1,readFromSharedSession:!1,writeToSharedSession:!1}});import*as Dt from"fs";import*as xo from"path";var Yd,$C=se(()=>{"use strict";mi();xn();AC();Yd=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(){Dt.existsSync(this.suitesDir)||Dt.mkdirSync(this.suitesDir,{recursive:!0})}setupFileWatcher(){try{this.fileWatcher=Dt.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(),!Dt.existsSync(this.suitesDir))return;let e=Dt.readdirSync(this.suitesDir);for(let r of e)if(r.endsWith(".suite.json"))try{let n=xo.join(this.suitesDir,r),i=Dt.readFileSync(n,"utf-8"),s=JSON.parse(i);s.id&&s.name&&this.suites.set(s.id,s)}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,r=[]){let n=Date.now(),i={id:St(e),name:e,requests:r,config:{...Gd},createdAt:n,updatedAt:n};return await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}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=await this.createSuite(r,n.requests.map(l=>({...l})));i.config={...n.config},i.description=n.description;let s=xo.join(this.suitesDir,e),o=xo.join(this.suitesDir,i.id);return Dt.existsSync(s)&&this.copyDirRecursive(s,o),await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}copyDirRecursive(e,r){Dt.existsSync(r)||Dt.mkdirSync(r,{recursive:!0});for(let n of Dt.readdirSync(e,{withFileTypes:!0})){let i=xo.join(e,n.name),s=xo.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):Dt.copyFileSync(i,s)}}async deleteSuite(e){let r=this.suites.get(e);if(!r)return!1;let n=`${r.id}.suite.json`,i=xo.join(this.suitesDir,n);try{return Dt.existsSync(i)&&Dt.unlinkSync(i),this.suites.delete(e),!0}catch(s){return console.error("[TestSuiteService] Failed to delete suite:",s),!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=Date.now();return{id:`temp-${e}`,name:r.name,requests:n,config:{...Gd},isTemporary:!0,createdAt:i,updatedAt:i}}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(p=>n?p.folderPath===o||p.folderPath.startsWith(`${o}/`):p.folderPath===o);if(l.length===0){console.error(`[TestSuiteService] No requests under folder "${r}" in collection: ${e}`);return}let f=Date.now();return{id:`temp-${e}-${this.slugifyFolderPath(o)}`,name:`${i.name} / ${bs(o)}`,requests:l,config:{...Gd},isTemporary:!0,createdAt:f,updatedAt:f}}slugifyFolderPath(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}async saveTempSuite(e,r){let n=Date.now(),i={...e,id:St(r),name:r,isTemporary:!1,createdAt:n,updatedAt:n};return await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}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}/${wr(o.name)}`:wr(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}/${wr(o.name)}`:wr(o.name);this.extractRequestsFromCollection(o,r,n,l,s)}}async saveSuiteToDisk(e){this.ensureSuitesDir();let r=`${e.id}.suite.json`,n=xo.join(this.suitesDir,r),i=JSON.stringify(e,null,2);Dt.writeFileSync(n,i,"utf-8")}}});var ne,gy=se(()=>{"use strict";ne={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")}});import*as V$ from"path";function yy(t,e){let{workspaceFolder:r,fileWatcherFactory:n,notificationService:i,workspaceStore:s,globalStore:o,secretStore:l,browserService:f,applicationInfo:c,consoleService:p}=e;t.registerValue(ne.WorkspaceFolder,r),t.registerSingleton(ne.Config,()=>new io(r,n,i)),t.registerSingleton(ne.Console,()=>p??s5),t.registerSingleton(ne.EnvironmentConfig,g=>new Gf(r,s,g.resolve(ne.Config),n,l,e.persistOverrides??!0)),t.registerSingleton(ne.Cookie,()=>new Wf(o)),t.registerSingleton(ne.Collection,g=>new Vf(r,g.resolve(ne.Config),n)),t.registerSingleton(ne.TestSuite,g=>new Yd(g.resolve(ne.Collection),g.resolve(ne.Config))),t.registerSingleton(ne.HttpClient,()=>new ha),t.registerSingleton(ne.UrlBuilder,()=>new Kn),t.registerSingleton(ne.InterceptorChain,()=>new ss),t.registerSingleton(ne.HttpRequest,g=>new is(g.resolve(ne.UrlBuilder),g.resolve(ne.InterceptorChain),g.resolve(ne.HttpClient))),t.registerSingleton(ne.RequestPreprocessor,()=>new Ia),t.registerSingleton(ne.RequestHistory,g=>{let v=g.resolve(ne.EnvironmentConfig);return new Xf(v.getHistoriesPath(),V$.join(v.getRootPath(),"shared-histories"))}),l&&f&&t.registerSingleton(ne.OAuth2TokenManager,g=>new Uf(l,f,g.resolve(ne.EnvironmentConfig),g.resolve(ne.HttpRequest))),t.registerSingleton(ne.GraphQLSchemaService,g=>new Kf(g.resolve(ne.HttpClient))),t.registerSingleton(ne.SecretResolverRegistry,g=>new Jd(g.resolve(ne.Config)));let h=c??{name:"HttpForge",version:"0.0.0"};t.registerSingleton(ne.RequestPreparer,g=>new Yf(g.resolve(ne.EnvironmentConfig),g.resolve(ne.HttpRequest),g.resolve(ne.RequestPreprocessor),g.has(ne.OAuth2TokenManager)?g.resolve(ne.OAuth2TokenManager):void 0,h,g.resolve(ne.SecretResolverRegistry))),t.registerSingleton(ne.ScriptExecutor,g=>{let v=g.resolve(ne.Config);return new cs(g.resolve(ne.HttpRequest),v.getModulePaths(),g.resolve(ne.SecretResolverRegistry),v.getScriptScope(),v.getScriptTimeout())}),t.registerSingleton(ne.DataFileParser,()=>new qa),t.registerSingleton(ne.CollectionRequestExecutor,g=>new so(g.resolve(ne.HttpRequest),g.resolve(ne.ScriptExecutor),g.resolve(ne.EnvironmentConfig),g.resolve(ne.RequestPreparer),"")),t.registerSingleton(ne.PersistentCookieJar,g=>new zf(g.resolve(ne.Cookie))),t.registerSingleton(ne.SchemaInferrer,()=>new vo),t.registerSingleton(ne.HistoryAnalyzer,g=>new vu(g.resolve(ne.RequestHistory),g.resolve(ne.SchemaInferrer))),t.registerSingleton(ne.ScriptAnalyzer,()=>new Gu),t.registerSingleton(ne.SchemaInferenceService,g=>new Ju(g.resolve(ne.HistoryAnalyzer),g.resolve(ne.ScriptAnalyzer),g.resolve(ne.SchemaInferrer))),t.registerSingleton(ne.OpenApiExporter,g=>new ku(g.resolve(ne.Collection),g.resolve(ne.EnvironmentConfig),g.resolve(ne.SchemaInferenceService))),t.registerSingleton(ne.OpenApiImporter,g=>new Co(g.resolve(ne.Collection),g.resolve(ne.EnvironmentConfig)))}var s5,NC=se(()=>{"use strict";o0();f0();Em();p0();h0();g0();Om();y0();v0();x0();tf();rf();ef();_m();zl();E0();aR();oy();RC();kg();CC();Rm();Ff();PC();$C();gy();s5={log:()=>{},trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},logBatch:()=>{},logRawLines:()=>{},show:()=>{},clear:()=>{},dispose:()=>{}}});function W$(){return za.instance}var za,MC=se(()=>{"use strict";gy();za=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(ne.Config)}get console(){return this.resolve(ne.Console)}get environmentConfig(){return this.resolve(ne.EnvironmentConfig)}get collection(){return this.resolve(ne.Collection)}get httpRequest(){return this.resolve(ne.HttpRequest)}get httpClient(){return this.resolve(ne.HttpClient)}get cookie(){return this.resolve(ne.Cookie)}get requestHistory(){return this.resolve(ne.RequestHistory)}get dataFileParser(){return this.resolve(ne.DataFileParser)}get scriptExecutor(){return this.resolve(ne.ScriptExecutor)}get requestPreparer(){return this.resolve(ne.RequestPreparer)}get persistentCookieJar(){return this.resolve(ne.PersistentCookieJar)}get oauth2TokenManager(){return this.has(ne.OAuth2TokenManager)?this.resolve(ne.OAuth2TokenManager):void 0}get graphqlSchemaService(){return this.resolve(ne.GraphQLSchemaService)}get testSuite(){return this.resolve(ne.TestSuite)}}});function z$(t){return/\{\{[^}]+\}\}/.test(t)}function Kd(t,e=16){return!!t&&t.length>=e&&!z$(t)}function FC(t){return t.toUpperCase().replace(/[^A-Z0-9]/g,"_")}function Qd(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(f=>`${f.requestId}::${f.field}`===l)||o.occurrences.push(i)}function vy(t,e=1){let r=Xe(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 f=l.key.toLowerCase(),c=l.value;if(f==="authorization"){let p=c.match(/^(bearer|basic|token|digest)\s+(.+)$/i);p&&Kd(p[2])?Qd(n,p[2],`${p[1].toUpperCase()}_TOKEN`,`Authorization ${p[1]} token`,o(`header:${l.key}`),1):Kd(c)&&Qd(n,c,"AUTH_TOKEN","Authorization header value",o(`header:${l.key}`),1)}else o5.has(f)&&Kd(c)?Qd(n,c,FC(l.key),`Sensitive header: ${l.key}`,o(`header:${l.key}`),2):Kd(c,20)&&!c.includes(" ")&&/^[A-Za-z0-9+/=_.-]+$/.test(c)&&Qd(n,c,FC(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&&a5.has(l.key.toLowerCase())&&Kd(l.value)&&Qd(n,l.value,FC(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||z$(s.url)))try{let o=new URL(s.url);if(!["localhost","127.0.0.1","0.0.0.0","::1"].includes(o.hostname)){let f=`${o.protocol}//${o.host}`,c=i.get(f)??[];c.push({requestId:s.id,requestName:s.name,field:"url"}),i.set(f,c)}}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 DC(t,e){let r={};return J$(t,e,r),r}function J$(t,e,r){for(let n of t){if(n.type==="folder"){n.items&&J$(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 f=l.value.match(/^(bearer|basic|token|digest)\s+(.+)$/i);f&&f[2]===s.value?(l.value=`${f[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 o5,a5,LC=se(()=>{"use strict";mi();o5=new Set(["x-api-key","x-auth-token","x-access-token","x-token","x-secret","api-key","apikey","x-client-secret","x-rapidapi-key"]),a5=new Set(["api_key","apikey","api-key","access_token","token","auth_token","client_id","client_secret","key","secret"])});function Ss(t,e){let r={type:"string",description:t};return e.length>0&&(r.enum=[...e]),r}function jC(t,e,r){let n=i=>Ss("Name of the collection to act on."+(i?"":" Optional."),e);return[{name:`${t}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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.'},...by.properties},required:["collection","request"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${J.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").'},...wy.properties},required:["collection","folder"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${J.runCollection}`,description:"Run every request in a collection.",inputSchema:{type:"object",properties:{collection:n(!0),...Sy.properties},required:["collection"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${J.runSuite}`,description:"Run a saved test suite.",inputSchema:{type:"object",properties:{suite:Ss("Name of the test suite to run.",r),..._y.properties},required:["suite"]},annotations:{readOnlyHint:!1,openWorldHint:!0}},{name:`${t}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.listSuites}`,description:"List all test suites with name, id, request count, and configuration summary.",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${J.getSuite}`,description:"Get full details of a test suite including its request list.",inputSchema:{type:"object",properties:{suite:Ss("Name or id of the test suite.",r)},required:["suite"]},annotations:{readOnlyHint:!0}},{name:`${t}${J.createSuite}`,description:"Create a new test suite (empty or pre-populated from a collection/folder).",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."},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}${J.updateSuiteConfig}`,description:"Change a suite's name, description, or run configuration.",inputSchema:{type:"object",properties:{suite:Ss("Name or id of the suite to update.",r),name:{type:"string",description:"New display name."},description:{type:"string",description:"New description."},iterations:{type:"number"},stopOnError:{type:"boolean"},delayBetweenRequests:{type:"number"}},required:["suite"]},annotations:{idempotentHint:!0}},{name:`${t}${J.addSuiteRequests}`,description:"Append or insert one or more requests into a suite.",inputSchema:{type:"object",properties:{suite:Ss("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 index to insert at. Omit to append at end."}},required:["suite","requests"]},annotations:{idempotentHint:!1}},{name:`${t}${J.removeSuiteRequest}`,description:"Remove a request from a suite by position (0-based) or by name.",inputSchema:{type:"object",properties:{suite:Ss("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}${J.reorderSuiteRequests}`,description:"Reorder requests in a suite. Requests not listed are moved to the end.",inputSchema:{type:"object",properties:{suite:Ss("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}${J.duplicateSuite}`,description:"Clone an existing suite under a new name.",inputSchema:{type:"object",properties:{suite:Ss("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}${J.deleteSuite}`,description:"Delete a test suite permanently. Set confirm:true to proceed.",inputSchema:{type:"object",properties:{suite:Ss("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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.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}${J.getGlobals}`,description:"Return all global variables (merged _global.json + runtime pm.globals.set() values).",inputSchema:{type:"object",properties:{}},annotations:{readOnlyHint:!0}},{name:`${t}${J.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}${J.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}${J.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}${J.suggestEnvVars}`,description:`Scan a collection for hardcoded values (API keys, base URLs, tokens, tenant IDs) that should become environment variables.
278
278
 
279
279
  Returns:
280
280
  \u2022 heuristicSuggestions \u2014 values identified by pattern-matching rules (ready to apply)
@@ -347,7 +347,7 @@ This tool returns request details AND a structured task. You MUST:
347
347
  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.
348
348
  4. Respond with the JSON array directly so the user can pass it to run_collection or the CLI --variables flag.
349
349
 
350
- 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 by,Sy,wy,_y,J,Zd=se(()=>{"use strict";by={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)"}}},Sy={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."}}},wy={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."}}},_y={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)"}}},J={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",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"}});import*as Xd from"fs";import*as Fi from"path";function ge(t){return new Error(`Bad request: ${t}`)}function et(t,e){if(typeof t!="string"||!t.trim())throw ge('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 ge(`collection not found: "${t}". Available collections: ${i||"(none)"}. Call list_collections to see all.`)}return n}function Mi(t,e){if(typeof t!="string"||!t.trim())throw ge('the "request" argument is required');let r=Xe(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 ge(`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 G$(t,e){for(let r of t){if(r.type!=="folder")continue;let n=r;if(n.id===e)return n;let i=G$(n.items??[],e);if(i)return i}}async function Ja(t,e){if(typeof t!="string"||!t.trim())throw ge('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 ge(`suite "${t}" not found. Available suites: ${s||"(none)"}. Call list_suites to see all.`)}return i}async function HC(t,e,r,n,i){let s=r.collection.getAllCollections();if(t===J.listCollections)return{collections:s.map(c=>({name:c.name,id:c.id,description:c.description??"",requestCount:Xe(c).length}))};if(t===J.listFolders){let c=et(e.collection,s);return{collection:c.name,folders:Zr(c).map(({folderPath:p,requestCount:h})=>({path:bs(p),requestCount:h}))}}if(t===J.listRequests){let c=et(e.collection,s),p=typeof e.folder=="string"?e.folder.toLowerCase():void 0,h=typeof e.offset=="number"?Math.max(0,e.offset):0,g=typeof e.limit=="number"?Math.min(200,Math.max(1,e.limit)):50,v=Xe(c).filter(({folderPath:_})=>!p||_.toLowerCase().includes(p)).map(({request:_,folderPath:w})=>({id:_.id,name:_.name,method:_.method,folder:bs(w),description:_.description??""}));return{collection:c.name,total:v.length,offset:h,limit:g,requests:v.slice(h,h+g)}}if(t===J.searchRequests){let c=et(e.collection,s),p=typeof e.query=="string"?e.query.toLowerCase().trim():"";if(!p)throw ge('the "query" argument is required');let h=Xe(c).filter(({request:g,folderPath:v})=>g.name.toLowerCase().includes(p)||(g.url??"").toLowerCase().includes(p)||g.method.toLowerCase().includes(p)||v.toLowerCase().includes(p)||(g.description??"").toLowerCase().includes(p)).map(({request:g,folderPath:v})=>({id:g.id,name:g.name,method:g.method,url:g.url??"",folder:bs(v),description:g.description??""}));return{collection:c.name,query:e.query,total:h.length,requests:h}}if(t===J.getRequest){let c=et(e.collection,s),p=Mi(e.request,c),h=r.collection.getRequestScript(c.id,p.id,"pre-request")??"",g=r.collection.getRequestScript(c.id,p.id,"post-response")??"";return{id:p.id,name:p.name,method:p.method,url:p.url??"",description:p.description??"",headers:p.headers??[],body:p.body??null,auth:p.auth??null,scripts:{preRequest:h,postResponse:g},hint:"Use update_request to modify fields, set_request_script to modify scripts, or run_request to execute it."}}if(t===J.getEnvironment){let c=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),p=r.environmentConfig.getResolvedEnvironment(c);if(!p)throw ge(`environment "${c}" not found`);return{name:p.name,variables:p.variables}}if(t===J.setVariable){let c=typeof e.key=="string"?e.key.trim():"",p=typeof e.value=="string"?e.value:String(e.value??"");if(!c)throw ge('"key" is required');let h=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment();return r.environmentConfig.setEnvironmentVariable(c,p,h),{set:!0,key:c,environment:h}}if(t===J.getRunStatus){let c=n.require(e.runId);return{runId:c.id,status:c.status,suiteName:c.suiteName,progress:c.progress,...c.error?{error:c.error}:{}}}if(t===J.getRunSummary){let c=n.require(e.runId);if(c.status==="running")return{runId:c.id,status:"running",progress:c.progress};let p=(c.summary.failed??0)>0||c.summary.allPassed===!1,h=c.noAssertionExamples??[],g=h.length,v=c.summary.total,_=g>0?g/(v||1)>.5?`${g}/${v} requests have no pm.test() assertions. Invoke the "review-collection" prompt (collection="${c.suiteName}") for a full coverage analysis.`:`${g} request(s) have no pm.test() assertions (e.g. ${h.slice(0,3).map(w=>`"${w}"`).join(", ")}). Invoke the "suggest-assertions" prompt (collection="${c.suiteName}") to add test coverage.`:null;return{runId:c.id,status:c.status,suiteName:c.suiteName,summary:c.summary,...c.reportPath?{report:{uri:`file://${c.reportPath}`}}:{},...p?{failedRequests:c.failedRequests}:{},...p?{_nextStep:`REQUIRED ACTION: ${c.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.`}:{},..._?{_suggestions:[_]}:{}}}if(t===J.getFailedRequests){let c=n.require(e.runId);if(c.status==="running")return{runId:c.id,status:"running",progress:c.progress,failedSoFar:c.failedRequests.length};let p=typeof e.offset=="number"?Math.max(0,e.offset):0,h=typeof e.limit=="number"?Math.min(100,Math.max(1,e.limit)):20;return{runId:c.id,status:c.status,totalFailed:c.failedRequests.length,offset:p,limit:h,failedRequests:c.failedRequests.slice(p,p+h)}}if(t===J.getRequestResult){let c=n.require(e.runId),p=e.request;if(typeof p!="string"||!p)throw ge('"request" is required');let h=typeof e.iteration=="number"?e.iteration:1,g=c.allResults.find(v=>v.iteration===h&&(v.name===p||v.name.toLowerCase()===p.toLowerCase()));if(!g){if(c.status==="running")return{runId:c.id,status:"running",message:`Request "${p}" has not completed yet.`};throw new Error(`Request "${p}" (iteration ${h}) not found in run "${c.id}".`)}return{runId:c.id,...g}}if(t===J.cancelRun){let c=n.require(e.runId);if(c.status!=="running")return{runId:c.id,status:c.status,cancelled:!1,message:`Run is already "${c.status}" \u2014 nothing to cancel.`};let p=n.cancel(String(e.runId));return{runId:c.id,status:"cancelled",cancelled:p,progress:c.progress,message:"Cancellation requested. The currently-executing request will finish; remaining requests will be skipped."}}if(t===J.runRequest){let c=et(e.collection,s),p=Xe(c),h=typeof e.requestId=="string"?e.requestId.trim():void 0,g=e.request,v;if(h){if(v=p.find(_=>_.request.id===h),!v)throw ge(`request with id "${h}" not found in collection "${c.name}"`)}else{if(typeof g!="string"||!g.trim())throw ge('the "request" or "requestId" argument is required');if(v=p.find(_=>_.request.name===g)??p.find(_=>_.request.name.toLowerCase()===g.toLowerCase()),!v)throw ge(`request "${g}" not found in collection "${c.name}"`)}return i.runRequest(c,v.request.id,e)}if(t===J.runFolder){let c=et(e.collection,s);if(typeof e.folder!="string"||!e.folder.trim())throw ge('the "folder" argument is required');let p=e.folder.toLowerCase(),h=my(e.folder),g=h.toLowerCase(),v=Zr(c).map(w=>w.folderPath),_=v.find(w=>w===h)??v.find(w=>w.toLowerCase()===g)??v.find(w=>w.toLowerCase().includes(g))??v.find(w=>w.split("/").some(E=>E.toLowerCase().includes(g)));if(!_){let w=v.map(E=>`"${E}"`).join(", ");throw ge(`folder "${e.folder}" not found in collection "${c.name}". Available folders: ${w||"(none)"}. Call list_folders to see all.`)}return i.runFolder(c,_,e)}if(t===J.runCollection){let c=et(e.collection,s);return i.runCollection(c,e)}if(t===J.createCollection){let c=typeof e.name=="string"?e.name.trim():"";if(!c)throw ge('"name" is required');let p=await r.collection.createCollection(c);return{id:p.id,name:p.name,created:!0,hint:"Collection is empty. Call create_folder to add folders, or create_request to add requests directly."}}if(t===J.renameCollection){let c=et(e.collection,s),p=typeof e.newName=="string"?e.newName.trim():"";if(!p)throw ge('"newName" is required');return await r.collection.renameCollection(c.id,p),{id:c.id,oldName:c.name,newName:p,renamed:!0}}if(t===J.deleteCollection){if(e.confirm!==!0)throw ge('"confirm" must be true to delete a collection');let c=et(e.collection,s);return await r.collection.deleteCollection(c.id),{deleted:!0,collection:c.name}}if(t===J.duplicateCollection){let c=et(e.collection,s),p=typeof e.newName=="string"?e.newName.trim():"";if(!p)throw ge('"newName" is required');let h=await r.collection.duplicateCollection(c.id,p);return{id:h.id,name:h.name,duplicatedFrom:c.name}}if(t===J.createFolder){let c=et(e.collection,s),p=typeof e.name=="string"?e.name.trim():"";if(!p)throw ge('"name" is required');let h;if(typeof e.parentFolder=="string"&&e.parentFolder.trim()){let v=e.parentFolder.toLowerCase(),_=Zr(c);if(Xe(c).map(E=>E.folderPath)&&_.find(E=>E.folderPath===e.parentFolder||E.folderPath.toLowerCase()===v)){let k=Zr(c).find(T=>T.folderPath===e.parentFolder||T.folderPath.toLowerCase()===v);if(k){let T=c.items,N=(j,G)=>{for(let q of j)if(q.type==="folder"){let C=q;if(C.name===G||G.endsWith("/"+C.name))return C;let A=N(C.items??[],G);if(A)return A}};h=N(T,k.folderPath)?.id}}}let g=await r.collection.createFolder({collectionId:c.id,name:p,parentId:h});return{id:g.id,name:g.name,created:!0,collection:c.name}}if(t===J.deleteFolder){if(e.confirm!==!0)throw ge('"confirm" must be true to delete a folder');let c=et(e.collection,s);if(typeof e.folder!="string"||!e.folder.trim())throw ge('"folder" is required');let p=e.folder.toLowerCase(),h=Zr(c).find(_=>_.folderPath===e.folder||_.folderPath.toLowerCase()===p);if(!h)throw ge(`folder "${e.folder}" not found in collection "${c.name}"`);let g=G$(c.items,h.folderId);if(!g)throw ge(`folder "${e.folder}" could not be resolved`);let v=h.requestCount;return await r.collection.deleteFolder(c.id,g.id),{deleted:!0,folder:h.folderPath,requestsRemoved:v}}if(t===J.createRequest){let c=et(e.collection,s),p=typeof e.name=="string"?e.name.trim():"";if(!p)throw ge('"name" is required');let h=typeof e.method=="string"?e.method.toUpperCase():"GET",g=typeof e.url=="string"?e.url:"";if(!g)throw ge('"url" is required');let v;if(typeof e.folder=="string"&&e.folder.trim()){let E=e.folder.toLowerCase(),k=Zr(c).find(T=>T.folderPath===e.folder||T.folderPath.toLowerCase()===E);k&&(v=k.folderId)}let _={collectionId:c.id,parentId:v,name:p,method:h,url:g,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},w=await r.collection.createRequest(_);return{id:w.id,name:w.name,created:!0,collection:c.name,hint:"Request created. Call run_request to execute it, or set_request_script to add pre-request/post-response scripts."}}if(t===J.updateRequest){let c=et(e.collection,s),p=Mi(e.request,c),h={};return typeof e.name=="string"&&(h.name=e.name),typeof e.method=="string"&&(h.method=e.method.toUpperCase()),typeof e.url=="string"&&(h.url=e.url),e.headers&&typeof e.headers=="object"&&!Array.isArray(e.headers)&&(h.headers=Object.entries(e.headers).map(([g,v])=>({name:g,value:String(v),enabled:!0}))),typeof e.body=="string"&&(h.body={type:"raw",raw:e.body,contentType:"application/json"}),typeof e.description=="string"&&(h.description=e.description),await r.collection.updateRequest(c.id,p.id,h),{updated:!0,request:p.name}}if(t===J.deleteRequest){if(e.confirm!==!0)throw ge('"confirm" must be true to delete a request');let c=et(e.collection,s),p=Mi(e.request,c);return await r.collection.deleteRequest(c.id,p.id),{deleted:!0,request:p.name}}if(t===J.getRequestScript){let c=et(e.collection,s),p=Mi(e.request,c),h=e.phase;if(h!=="pre-request"&&h!=="post-response")throw ge('"phase" must be "pre-request" or "post-response"');let g=r.collection.getRequestScript(c.id,p.id,h);return{collection:c.name,request:p.name,phase:h,script:g??""}}if(t===J.setRequestScript){let c=et(e.collection,s),p=Mi(e.request,c),h=e.phase;if(h!=="pre-request"&&h!=="post-response")throw ge('"phase" must be "pre-request" or "post-response"');if(typeof e.script!="string")throw ge('"script" is required');return await r.collection.setRequestScript(c.id,p.id,h,e.script),{updated:!0,collection:c.name,request:p.name,phase:h}}if(t===J.reorderCollectionItems){let c=et(e.collection,s);if(!Array.isArray(e.order))throw ge('"order" must be an array');let p;if(typeof e.folder=="string"&&e.folder.trim()){let v=e.folder.toLowerCase(),_=Zr(c).find(w=>w.folderPath===e.folder||w.folderPath.toLowerCase()===v);if(!_)throw ge(`folder "${e.folder}" not found in collection "${c.name}"`);p=_.folderId}let h=p?c.items.find(v=>v.id===p)?.items??[]:c.items,g=e.order.map(v=>h.find(w=>w.id===v||w.name===v)?.id??v);return await r.collection.reorderItems(c.id,p,g),{reordered:!0,collection:c.name,order:e.order}}if(t===J.listSuites)return{suites:(await r.testSuite.getAllSuites()).map(p=>({id:p.id,name:p.name,description:p.description??"",requestCount:p.requests.length,iterations:p.config?.iterations??1}))};if(t===J.getSuite){let c=await Ja(e.suite,r);return{id:c.id,name:c.name,description:c.description??"",config:{iterations:c.config?.iterations??1,delayBetweenRequests:c.config?.delayBetweenRequests??0,stopOnError:c.config?.stopOnError??!1},requests:c.requests.map(p=>({slug:p.slug??p.requestId,collectionId:p.collectionId,requestId:p.requestId,name:p.name,method:p.method,folderPath:p.folderPath??"",enabled:p.enabled!==!1}))}}if(t===J.createSuite){let c=typeof e.name=="string"?e.name.trim():"";if(!c)throw ge('"name" is required');let p;if(typeof e.fromCollection=="string"&&e.fromCollection.trim()){let h=et(e.fromCollection,s),g=await r.testSuite.createTempSuiteFromCollection(h.id);if(!g)throw new Error(`Could not build suite from collection "${h.name}"`);if(typeof e.fromFolder=="string"&&e.fromFolder.trim()){let v=my(e.fromFolder),_=g.requests.filter(w=>w.folderPath===v||w.folderPath.startsWith(`${v}/`));g.requests=_}p=await r.testSuite.saveTempSuite(g,c)}else p=await r.testSuite.createSuite(c);return(e.iterations!==void 0||e.stopOnError!==void 0||e.delayBetweenRequests!==void 0||e.description!==void 0)&&(e.description!==void 0&&(p.description=String(e.description)),p.config={...p.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(p)),{id:p.id,name:p.name,requestCount:p.requests.length,created:!0,hint:p.requests.length===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===J.updateSuiteConfig){let c=await Ja(e.suite,r);return typeof e.name=="string"&&e.name.trim()&&(c.name=e.name.trim()),typeof e.description=="string"&&(c.description=e.description),c.config={...c.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(c),{updated:!0,suite:c.name}}if(t===J.addSuiteRequests){let c=await Ja(e.suite,r),p=Array.isArray(e.requests)?e.requests:[];if(p.length===0)throw ge('"requests" array is required and must not be empty');let h=[];for(let v of p){let _=et(v.collection,s),w=Mi(v.request,_),E=Xe(_).find(k=>k.request.id===w.id)?.folderPath??"";h.push({slug:w.id,collectionId:_.id,requestId:w.id,name:w.name,method:w.method,collectionName:_.name,folderPath:E,enabled:!0})}let g=typeof e.insertAt=="number"?Math.max(0,e.insertAt):void 0;return g!==void 0&&g<c.requests.length?c.requests.splice(g,0,...h):c.requests.push(...h),await r.testSuite.updateSuite(c),{added:h.length,suite:c.name,newRequestCount:c.requests.length}}if(t===J.removeSuiteRequest){let c=await Ja(e.suite,r),p;if(typeof e.index=="number"){if(e.index<0||e.index>=c.requests.length)throw ge(`index ${e.index} is out of range`);let[h]=c.requests.splice(e.index,1);p=h.name}else if(typeof e.request=="string"){let h=e.request.toLowerCase(),g=c.requests.findIndex(v=>v.name===e.request||v.name.toLowerCase()===h);if(g===-1)throw ge(`request "${e.request}" not found in suite "${c.name}"`);p=c.requests.splice(g,1)[0].name}else throw ge('either "index" or "request" is required');return await r.testSuite.updateSuite(c),{removed:!0,request:p,newRequestCount:c.requests.length}}if(t===J.reorderSuiteRequests){let c=await Ja(e.suite,r);if(!Array.isArray(e.order))throw ge('"order" must be an array of request names');let p=e.order,h=[...c.requests].sort((g,v)=>{let _=p.findIndex(T=>T===g.name||T.toLowerCase()===g.name.toLowerCase()),w=p.findIndex(T=>T===v.name||T.toLowerCase()===v.name.toLowerCase());return(_===-1?1/0:_)-(w===-1?1/0:w)});return c.requests=h,await r.testSuite.updateSuite(c),{reordered:!0,suite:c.name,newOrder:c.requests.map(g=>g.name)}}if(t===J.duplicateSuite){let c=await Ja(e.suite,r),p=typeof e.newName=="string"?e.newName.trim():"";if(!p)throw ge('"newName" is required');let h=await r.testSuite.duplicateSuite(c.id,p);return{id:h.id,name:h.name,duplicatedFrom:c.name,requestCount:h.requests.length}}if(t===J.deleteSuite){if(e.confirm!==!0)throw ge('"confirm" must be true to delete a suite');let c=await Ja(e.suite,r);return await r.testSuite.deleteSuite(c.id),{deleted:!0,suite:c.name}}if(t===J.listEnvironments){let c=r.environmentConfig.getAllEnvironments(),p=r.environmentConfig.getSelectedEnvironment();return{environments:c.map(h=>({name:h.name,active:h.active,variableKeys:Object.keys(h.variables)})),active:p}}if(t===J.getEnvironmentVariables){let c=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),p=r.environmentConfig.getResolvedEnvironment(c);if(!p)throw ge(`environment "${c}" not found`);let g=r.environmentConfig.getSharedConfig()?.environments?.[c]?.variables??{},v=r.environmentConfig.getEnvironmentVariableLocals();return{environment:c,active:r.environmentConfig.getSelectedEnvironment()===c,fileVariables:g,sessionOverrides:v,resolved:p.variables}}if(t===J.selectEnvironment){let c=typeof e.environment=="string"?e.environment.trim():"";if(!c)throw ge('"environment" is required');return await r.environmentConfig.setSelectedEnvironment(c),{selected:!0,environment:c}}if(t===J.createEnvironment){let c=typeof e.name=="string"?e.name.trim():"";if(!c)throw ge('"name" is required');if(await r.environmentConfig.createEnvironment(c),e.variables&&typeof e.variables=="object"){let p=e.variables,h=r.environmentConfig.getSharedConfig();h&&(h.environments=h.environments??{},h.environments[c]={...h.environments[c]??{},variables:{...h.environments[c]?.variables??{},...p}},r.environmentConfig.saveSharedConfig(h))}return{created:!0,environment:c}}if(t===J.deleteEnvironment){if(e.confirm!==!0)throw ge('"confirm" must be true to delete an environment');let c=typeof e.environment=="string"?e.environment.trim():"";if(!c)throw ge('"environment" is required');let p=r.environmentConfig.getSelectedEnvironment();return await r.environmentConfig.deleteEnvironment(c),{deleted:!0,environment:c,newActive:p===c?void 0:p}}if(t===J.setEnvironmentVariable){let c=typeof e.key=="string"?e.key.trim():"",p=typeof e.value=="string"?e.value:String(e.value??"");if(!c)throw ge('"key" is required');let h=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),g=e.scope==="permanent"?"permanent":"session";if(g==="permanent"){let v=r.environmentConfig.getSharedConfig();v&&(v.environments=v.environments??{},v.environments[h]=v.environments[h]??{variables:{}},v.environments[h].variables=v.environments[h].variables??{},v.environments[h].variables[c]=p,r.environmentConfig.saveSharedConfig(v))}else r.environmentConfig.setEnvironmentVariable(c,p,h);return{set:!0,key:c,environment:h,scope:g}}if(t===J.unsetEnvironmentVariable){let c=typeof e.key=="string"?e.key.trim():"";if(!c)throw ge('"key" is required');let p=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment();return r.environmentConfig.deleteEnvironmentVariable(c,p),{unset:!0,key:c,environment:p}}if(t===J.setGlobalVariable){let c=typeof e.key=="string"?e.key.trim():"",p=typeof e.value=="string"?e.value:String(e.value??"");if(!c)throw ge('"key" is required');let h=e.scope==="permanent"?"permanent":"session";if(h==="permanent"){let g=r.environmentConfig.getSharedConfig();g&&(g.globalVariables=g.globalVariables??{},g.globalVariables[c]=p,r.environmentConfig.saveSharedConfig(g))}else r.environmentConfig.setGlobalVariable(c,p);return{set:!0,key:c,scope:h}}if(t===J.getGlobals)return{globals:r.environmentConfig.getGlobalVariables()};if(t===J.scaffoldCollectionFromOpenApi){let c=typeof e.specPath=="string"?e.specPath.trim():"";if(!c)throw ge('"specPath" is required');let p=r.workspaceFolder&&!Fi.isAbsolute(c)?Fi.join(r.workspaceFolder,c):c;if(!Xd.existsSync(p))throw ge(`OpenAPI spec file not found: "${p}"`);let g=await new Ro(r.collection,r.environmentConfig).import(p,{collectionName:typeof e.collectionName=="string"?e.collectionName:void 0,environmentName:typeof e.environmentName=="string"?e.environmentName:void 0});return{collectionId:g.collection.id,collectionName:g.collection.name,requestCount:g.collection.items.filter(v=>v.type==="request").length,environmentCreated:g.environmentCreated??null,hint:"Use list_requests to browse the scaffolded collection, then run_request to test individual endpoints."}}if(t===J.suggestAssertions){let c=e.collection;if(!(typeof e.request=="string"?e.request.trim():""))throw ge('"request" is required');let h=et(c,s),g=Mi(e.request,h),v=typeof e.maxSuggestions=="number"?Math.min(20,Math.max(1,e.maxSuggestions)):10,_=[],E=Array.from(n.values()).filter($=>$.status!=="running").flatMap($=>$.allResults??[]).filter($=>$.name===g.name||typeof $.name=="string"&&$.name.toLowerCase()===g.name.toLowerCase()),k=E[E.length-1],T=k?.status;T?_.push({snippet:`pm.test("Status code is ${T}", function () {
350
+ 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 by,Sy,wy,_y,J,Zd=se(()=>{"use strict";by={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)"}}},Sy={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."}}},wy={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."}}},_y={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)"}}},J={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",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"}});import*as Xd from"fs";import*as Fi from"path";function ge(t){return new Error(`Bad request: ${t}`)}function et(t,e){if(typeof t!="string"||!t.trim())throw ge('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 ge(`collection not found: "${t}". Available collections: ${i||"(none)"}. Call list_collections to see all.`)}return n}function Mi(t,e){if(typeof t!="string"||!t.trim())throw ge('the "request" argument is required');let r=Xe(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 ge(`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 G$(t,e){for(let r of t){if(r.type!=="folder")continue;let n=r;if(n.id===e)return n;let i=G$(n.items??[],e);if(i)return i}}async function Ja(t,e){if(typeof t!="string"||!t.trim())throw ge('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 ge(`suite "${t}" not found. Available suites: ${s||"(none)"}. Call list_suites to see all.`)}return i}async function HC(t,e,r,n,i){let s=r.collection.getAllCollections();if(t===J.listCollections)return{collections:s.map(c=>({name:c.name,id:c.id,description:c.description??"",requestCount:Xe(c).length}))};if(t===J.listFolders){let c=et(e.collection,s);return{collection:c.name,folders:Zr(c).map(({folderPath:p,requestCount:h})=>({path:bs(p),requestCount:h}))}}if(t===J.listRequests){let c=et(e.collection,s),p=typeof e.folder=="string"?e.folder.toLowerCase():void 0,h=typeof e.offset=="number"?Math.max(0,e.offset):0,g=typeof e.limit=="number"?Math.min(200,Math.max(1,e.limit)):50,v=Xe(c).filter(({folderPath:_})=>!p||_.toLowerCase().includes(p)).map(({request:_,folderPath:w})=>({id:_.id,name:_.name,method:_.method,folder:bs(w),description:_.description??""}));return{collection:c.name,total:v.length,offset:h,limit:g,requests:v.slice(h,h+g)}}if(t===J.searchRequests){let c=et(e.collection,s),p=typeof e.query=="string"?e.query.toLowerCase().trim():"";if(!p)throw ge('the "query" argument is required');let h=Xe(c).filter(({request:g,folderPath:v})=>g.name.toLowerCase().includes(p)||(g.url??"").toLowerCase().includes(p)||g.method.toLowerCase().includes(p)||v.toLowerCase().includes(p)||(g.description??"").toLowerCase().includes(p)).map(({request:g,folderPath:v})=>({id:g.id,name:g.name,method:g.method,url:g.url??"",folder:bs(v),description:g.description??""}));return{collection:c.name,query:e.query,total:h.length,requests:h}}if(t===J.getRequest){let c=et(e.collection,s),p=Mi(e.request,c),h=r.collection.getRequestScript(c.id,p.id,"pre-request")??"",g=r.collection.getRequestScript(c.id,p.id,"post-response")??"";return{id:p.id,name:p.name,method:p.method,url:p.url??"",description:p.description??"",headers:p.headers??[],body:p.body??null,auth:p.auth??null,scripts:{preRequest:h,postResponse:g},hint:"Use update_request to modify fields, set_request_script to modify scripts, or run_request to execute it."}}if(t===J.getEnvironment){let c=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),p=r.environmentConfig.getResolvedEnvironment(c);if(!p)throw ge(`environment "${c}" not found`);return{name:p.name,variables:p.variables}}if(t===J.setVariable){let c=typeof e.key=="string"?e.key.trim():"",p=typeof e.value=="string"?e.value:String(e.value??"");if(!c)throw ge('"key" is required');let h=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment();return r.environmentConfig.setEnvironmentVariable(c,p,h),{set:!0,key:c,environment:h}}if(t===J.getRunStatus){let c=n.require(e.runId);return{runId:c.id,status:c.status,suiteName:c.suiteName,progress:c.progress,...c.error?{error:c.error}:{}}}if(t===J.getRunSummary){let c=n.require(e.runId);if(c.status==="running")return{runId:c.id,status:"running",progress:c.progress};let p=(c.summary.failed??0)>0||c.summary.allPassed===!1,h=c.noAssertionExamples??[],g=h.length,v=c.summary.total,_=g>0?g/(v||1)>.5?`${g}/${v} requests have no pm.test() assertions. Invoke the "review-collection" prompt (collection="${c.suiteName}") for a full coverage analysis.`:`${g} request(s) have no pm.test() assertions (e.g. ${h.slice(0,3).map(w=>`"${w}"`).join(", ")}). Invoke the "suggest-assertions" prompt (collection="${c.suiteName}") to add test coverage.`:null;return{runId:c.id,status:c.status,suiteName:c.suiteName,summary:c.summary,...c.reportPath?{report:{uri:`file://${c.reportPath}`}}:{},...p?{failedRequests:c.failedRequests}:{},...p?{_nextStep:`REQUIRED ACTION: ${c.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.`}:{},..._?{_suggestions:[_]}:{}}}if(t===J.getFailedRequests){let c=n.require(e.runId);if(c.status==="running")return{runId:c.id,status:"running",progress:c.progress,failedSoFar:c.failedRequests.length};let p=typeof e.offset=="number"?Math.max(0,e.offset):0,h=typeof e.limit=="number"?Math.min(100,Math.max(1,e.limit)):20;return{runId:c.id,status:c.status,totalFailed:c.failedRequests.length,offset:p,limit:h,failedRequests:c.failedRequests.slice(p,p+h)}}if(t===J.getRequestResult){let c=n.require(e.runId),p=e.request;if(typeof p!="string"||!p)throw ge('"request" is required');let h=typeof e.iteration=="number"?e.iteration:1,g=c.allResults.find(v=>v.iteration===h&&(v.name===p||v.name.toLowerCase()===p.toLowerCase()));if(!g){if(c.status==="running")return{runId:c.id,status:"running",message:`Request "${p}" has not completed yet.`};throw new Error(`Request "${p}" (iteration ${h}) not found in run "${c.id}".`)}return{runId:c.id,...g}}if(t===J.cancelRun){let c=n.require(e.runId);if(c.status!=="running")return{runId:c.id,status:c.status,cancelled:!1,message:`Run is already "${c.status}" \u2014 nothing to cancel.`};let p=n.cancel(String(e.runId));return{runId:c.id,status:"cancelled",cancelled:p,progress:c.progress,message:"Cancellation requested. The currently-executing request will finish; remaining requests will be skipped."}}if(t===J.runRequest){let c=et(e.collection,s),p=Xe(c),h=typeof e.requestId=="string"?e.requestId.trim():void 0,g=e.request,v;if(h){if(v=p.find(_=>_.request.id===h),!v)throw ge(`request with id "${h}" not found in collection "${c.name}"`)}else{if(typeof g!="string"||!g.trim())throw ge('the "request" or "requestId" argument is required');if(v=p.find(_=>_.request.name===g)??p.find(_=>_.request.name.toLowerCase()===g.toLowerCase()),!v)throw ge(`request "${g}" not found in collection "${c.name}"`)}return i.runRequest(c,v.request.id,e)}if(t===J.runFolder){let c=et(e.collection,s);if(typeof e.folder!="string"||!e.folder.trim())throw ge('the "folder" argument is required');let p=e.folder.toLowerCase(),h=my(e.folder),g=h.toLowerCase(),v=Zr(c).map(w=>w.folderPath),_=v.find(w=>w===h)??v.find(w=>w.toLowerCase()===g)??v.find(w=>w.toLowerCase().includes(g))??v.find(w=>w.split("/").some(E=>E.toLowerCase().includes(g)));if(!_){let w=v.map(E=>`"${E}"`).join(", ");throw ge(`folder "${e.folder}" not found in collection "${c.name}". Available folders: ${w||"(none)"}. Call list_folders to see all.`)}return i.runFolder(c,_,e)}if(t===J.runCollection){let c=et(e.collection,s);return i.runCollection(c,e)}if(t===J.createCollection){let c=typeof e.name=="string"?e.name.trim():"";if(!c)throw ge('"name" is required');let p=await r.collection.createCollection(c);return{id:p.id,name:p.name,created:!0,hint:"Collection is empty. Call create_folder to add folders, or create_request to add requests directly."}}if(t===J.renameCollection){let c=et(e.collection,s),p=typeof e.newName=="string"?e.newName.trim():"";if(!p)throw ge('"newName" is required');return await r.collection.renameCollection(c.id,p),{id:c.id,oldName:c.name,newName:p,renamed:!0}}if(t===J.deleteCollection){if(e.confirm!==!0)throw ge('"confirm" must be true to delete a collection');let c=et(e.collection,s);return await r.collection.deleteCollection(c.id),{deleted:!0,collection:c.name}}if(t===J.duplicateCollection){let c=et(e.collection,s),p=typeof e.newName=="string"?e.newName.trim():"";if(!p)throw ge('"newName" is required');let h=await r.collection.duplicateCollection(c.id,p);return{id:h.id,name:h.name,duplicatedFrom:c.name}}if(t===J.createFolder){let c=et(e.collection,s),p=typeof e.name=="string"?e.name.trim():"";if(!p)throw ge('"name" is required');let h;if(typeof e.parentFolder=="string"&&e.parentFolder.trim()){let v=e.parentFolder.toLowerCase(),_=Zr(c);if(Xe(c).map(E=>E.folderPath)&&_.find(E=>E.folderPath===e.parentFolder||E.folderPath.toLowerCase()===v)){let k=Zr(c).find(T=>T.folderPath===e.parentFolder||T.folderPath.toLowerCase()===v);if(k){let T=c.items,N=(j,G)=>{for(let q of j)if(q.type==="folder"){let C=q;if(C.name===G||G.endsWith("/"+C.name))return C;let A=N(C.items??[],G);if(A)return A}};h=N(T,k.folderPath)?.id}}}let g=await r.collection.createFolder({collectionId:c.id,name:p,parentId:h});return{id:g.id,name:g.name,created:!0,collection:c.name}}if(t===J.deleteFolder){if(e.confirm!==!0)throw ge('"confirm" must be true to delete a folder');let c=et(e.collection,s);if(typeof e.folder!="string"||!e.folder.trim())throw ge('"folder" is required');let p=e.folder.toLowerCase(),h=Zr(c).find(_=>_.folderPath===e.folder||_.folderPath.toLowerCase()===p);if(!h)throw ge(`folder "${e.folder}" not found in collection "${c.name}"`);let g=G$(c.items,h.folderId);if(!g)throw ge(`folder "${e.folder}" could not be resolved`);let v=h.requestCount;return await r.collection.deleteFolder(c.id,g.id),{deleted:!0,folder:h.folderPath,requestsRemoved:v}}if(t===J.createRequest){let c=et(e.collection,s),p=typeof e.name=="string"?e.name.trim():"";if(!p)throw ge('"name" is required');let h=typeof e.method=="string"?e.method.toUpperCase():"GET",g=typeof e.url=="string"?e.url:"";if(!g)throw ge('"url" is required');let v;if(typeof e.folder=="string"&&e.folder.trim()){let E=e.folder.toLowerCase(),k=Zr(c).find(T=>T.folderPath===e.folder||T.folderPath.toLowerCase()===E);k&&(v=k.folderId)}let _={collectionId:c.id,parentId:v,name:p,method:h,url:g,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},w=await r.collection.createRequest(_);return{id:w.id,name:w.name,created:!0,collection:c.name,hint:"Request created. Call run_request to execute it, or set_request_script to add pre-request/post-response scripts."}}if(t===J.updateRequest){let c=et(e.collection,s),p=Mi(e.request,c),h={};return typeof e.name=="string"&&(h.name=e.name),typeof e.method=="string"&&(h.method=e.method.toUpperCase()),typeof e.url=="string"&&(h.url=e.url),e.headers&&typeof e.headers=="object"&&!Array.isArray(e.headers)&&(h.headers=Object.entries(e.headers).map(([g,v])=>({name:g,value:String(v),enabled:!0}))),typeof e.body=="string"&&(h.body={type:"raw",raw:e.body,contentType:"application/json"}),typeof e.description=="string"&&(h.description=e.description),await r.collection.updateRequest(c.id,p.id,h),{updated:!0,request:p.name}}if(t===J.deleteRequest){if(e.confirm!==!0)throw ge('"confirm" must be true to delete a request');let c=et(e.collection,s),p=Mi(e.request,c);return await r.collection.deleteRequest(c.id,p.id),{deleted:!0,request:p.name}}if(t===J.getRequestScript){let c=et(e.collection,s),p=Mi(e.request,c),h=e.phase;if(h!=="pre-request"&&h!=="post-response")throw ge('"phase" must be "pre-request" or "post-response"');let g=r.collection.getRequestScript(c.id,p.id,h);return{collection:c.name,request:p.name,phase:h,script:g??""}}if(t===J.setRequestScript){let c=et(e.collection,s),p=Mi(e.request,c),h=e.phase;if(h!=="pre-request"&&h!=="post-response")throw ge('"phase" must be "pre-request" or "post-response"');if(typeof e.script!="string")throw ge('"script" is required');return await r.collection.setRequestScript(c.id,p.id,h,e.script),{updated:!0,collection:c.name,request:p.name,phase:h}}if(t===J.reorderCollectionItems){let c=et(e.collection,s);if(!Array.isArray(e.order))throw ge('"order" must be an array');let p;if(typeof e.folder=="string"&&e.folder.trim()){let v=e.folder.toLowerCase(),_=Zr(c).find(w=>w.folderPath===e.folder||w.folderPath.toLowerCase()===v);if(!_)throw ge(`folder "${e.folder}" not found in collection "${c.name}"`);p=_.folderId}let h=p?c.items.find(v=>v.id===p)?.items??[]:c.items,g=e.order.map(v=>h.find(w=>w.id===v||w.name===v)?.id??v);return await r.collection.reorderItems(c.id,p,g),{reordered:!0,collection:c.name,order:e.order}}if(t===J.listSuites)return{suites:(await r.testSuite.getAllSuites()).map(p=>({id:p.id,name:p.name,description:p.description??"",requestCount:p.requests.length,iterations:p.config?.iterations??1}))};if(t===J.getSuite){let c=await Ja(e.suite,r);return{id:c.id,name:c.name,description:c.description??"",config:{iterations:c.config?.iterations??1,delayBetweenRequests:c.config?.delayBetweenRequests??0,stopOnError:c.config?.stopOnError??!1},requests:c.requests.map(p=>({slug:p.slug??p.requestId,collectionId:p.collectionId,requestId:p.requestId,name:p.name,method:p.method,folderPath:p.folderPath??"",enabled:p.enabled!==!1}))}}if(t===J.createSuite){let c=typeof e.name=="string"?e.name.trim():"";if(!c)throw ge('"name" is required');let p;if(typeof e.fromCollection=="string"&&e.fromCollection.trim()){let h=et(e.fromCollection,s),g=await r.testSuite.createTempSuiteFromCollection(h.id);if(!g)throw new Error(`Could not build suite from collection "${h.name}"`);if(typeof e.fromFolder=="string"&&e.fromFolder.trim()){let v=my(e.fromFolder),_=g.requests.filter(w=>w.folderPath===v||w.folderPath.startsWith(`${v}/`));g.requests=_}p=await r.testSuite.saveTempSuite(g,c)}else p=await r.testSuite.createSuite(c);return(e.iterations!==void 0||e.stopOnError!==void 0||e.delayBetweenRequests!==void 0||e.description!==void 0)&&(e.description!==void 0&&(p.description=String(e.description)),p.config={...p.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(p)),{id:p.id,name:p.name,requestCount:p.requests.length,created:!0,hint:p.requests.length===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===J.updateSuiteConfig){let c=await Ja(e.suite,r);return typeof e.name=="string"&&e.name.trim()&&(c.name=e.name.trim()),typeof e.description=="string"&&(c.description=e.description),c.config={...c.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(c),{updated:!0,suite:c.name}}if(t===J.addSuiteRequests){let c=await Ja(e.suite,r),p=Array.isArray(e.requests)?e.requests:[];if(p.length===0)throw ge('"requests" array is required and must not be empty');let h=[];for(let v of p){let _=et(v.collection,s),w=Mi(v.request,_),E=Xe(_).find(k=>k.request.id===w.id)?.folderPath??"";h.push({slug:w.id,collectionId:_.id,requestId:w.id,name:w.name,method:w.method,collectionName:_.name,folderPath:E,enabled:!0})}let g=typeof e.insertAt=="number"?Math.max(0,e.insertAt):void 0;return g!==void 0&&g<c.requests.length?c.requests.splice(g,0,...h):c.requests.push(...h),await r.testSuite.updateSuite(c),{added:h.length,suite:c.name,newRequestCount:c.requests.length}}if(t===J.removeSuiteRequest){let c=await Ja(e.suite,r),p;if(typeof e.index=="number"){if(e.index<0||e.index>=c.requests.length)throw ge(`index ${e.index} is out of range`);let[h]=c.requests.splice(e.index,1);p=h.name}else if(typeof e.request=="string"){let h=e.request.toLowerCase(),g=c.requests.findIndex(v=>v.name===e.request||v.name.toLowerCase()===h);if(g===-1)throw ge(`request "${e.request}" not found in suite "${c.name}"`);p=c.requests.splice(g,1)[0].name}else throw ge('either "index" or "request" is required');return await r.testSuite.updateSuite(c),{removed:!0,request:p,newRequestCount:c.requests.length}}if(t===J.reorderSuiteRequests){let c=await Ja(e.suite,r);if(!Array.isArray(e.order))throw ge('"order" must be an array of request names');let p=e.order,h=[...c.requests].sort((g,v)=>{let _=p.findIndex(T=>T===g.name||T.toLowerCase()===g.name.toLowerCase()),w=p.findIndex(T=>T===v.name||T.toLowerCase()===v.name.toLowerCase());return(_===-1?1/0:_)-(w===-1?1/0:w)});return c.requests=h,await r.testSuite.updateSuite(c),{reordered:!0,suite:c.name,newOrder:c.requests.map(g=>g.name)}}if(t===J.duplicateSuite){let c=await Ja(e.suite,r),p=typeof e.newName=="string"?e.newName.trim():"";if(!p)throw ge('"newName" is required');let h=await r.testSuite.duplicateSuite(c.id,p);return{id:h.id,name:h.name,duplicatedFrom:c.name,requestCount:h.requests.length}}if(t===J.deleteSuite){if(e.confirm!==!0)throw ge('"confirm" must be true to delete a suite');let c=await Ja(e.suite,r);return await r.testSuite.deleteSuite(c.id),{deleted:!0,suite:c.name}}if(t===J.listEnvironments){let c=r.environmentConfig.getAllEnvironments(),p=r.environmentConfig.getSelectedEnvironment();return{environments:c.map(h=>({name:h.name,active:h.active,variableKeys:Object.keys(h.variables)})),active:p}}if(t===J.getEnvironmentVariables){let c=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),p=r.environmentConfig.getResolvedEnvironment(c);if(!p)throw ge(`environment "${c}" not found`);let g=r.environmentConfig.getSharedConfig()?.environments?.[c]?.variables??{},v=r.environmentConfig.getEnvironmentVariableLocals();return{environment:c,active:r.environmentConfig.getSelectedEnvironment()===c,fileVariables:g,sessionOverrides:v,resolved:p.variables}}if(t===J.selectEnvironment){let c=typeof e.environment=="string"?e.environment.trim():"";if(!c)throw ge('"environment" is required');return await r.environmentConfig.setSelectedEnvironment(c),{selected:!0,environment:c}}if(t===J.createEnvironment){let c=typeof e.name=="string"?e.name.trim():"";if(!c)throw ge('"name" is required');if(await r.environmentConfig.createEnvironment(c),e.variables&&typeof e.variables=="object"){let p=e.variables,h=r.environmentConfig.getSharedConfig();h&&(h.environments=h.environments??{},h.environments[c]={...h.environments[c]??{},variables:{...h.environments[c]?.variables??{},...p}},r.environmentConfig.saveSharedConfig(h))}return{created:!0,environment:c}}if(t===J.deleteEnvironment){if(e.confirm!==!0)throw ge('"confirm" must be true to delete an environment');let c=typeof e.environment=="string"?e.environment.trim():"";if(!c)throw ge('"environment" is required');let p=r.environmentConfig.getSelectedEnvironment();return await r.environmentConfig.deleteEnvironment(c),{deleted:!0,environment:c,newActive:p===c?void 0:p}}if(t===J.setEnvironmentVariable){let c=typeof e.key=="string"?e.key.trim():"",p=typeof e.value=="string"?e.value:String(e.value??"");if(!c)throw ge('"key" is required');let h=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment(),g=e.scope==="permanent"?"permanent":"session";if(g==="permanent"){let v=r.environmentConfig.getSharedConfig();v&&(v.environments=v.environments??{},v.environments[h]=v.environments[h]??{variables:{}},v.environments[h].variables=v.environments[h].variables??{},v.environments[h].variables[c]=p,r.environmentConfig.saveSharedConfig(v))}else r.environmentConfig.setEnvironmentVariable(c,p,h);return{set:!0,key:c,environment:h,scope:g}}if(t===J.unsetEnvironmentVariable){let c=typeof e.key=="string"?e.key.trim():"";if(!c)throw ge('"key" is required');let p=typeof e.environment=="string"&&e.environment.trim()?e.environment.trim():r.environmentConfig.getSelectedEnvironment();return r.environmentConfig.deleteEnvironmentVariable(c,p),{unset:!0,key:c,environment:p}}if(t===J.setGlobalVariable){let c=typeof e.key=="string"?e.key.trim():"",p=typeof e.value=="string"?e.value:String(e.value??"");if(!c)throw ge('"key" is required');let h=e.scope==="permanent"?"permanent":"session";if(h==="permanent"){let g=r.environmentConfig.getSharedConfig();g&&(g.globalVariables=g.globalVariables??{},g.globalVariables[c]=p,r.environmentConfig.saveSharedConfig(g))}else r.environmentConfig.setGlobalVariable(c,p);return{set:!0,key:c,scope:h}}if(t===J.getGlobals)return{globals:r.environmentConfig.getGlobalVariables()};if(t===J.scaffoldCollectionFromOpenApi){let c=typeof e.specPath=="string"?e.specPath.trim():"";if(!c)throw ge('"specPath" is required');let p=r.workspaceFolder&&!Fi.isAbsolute(c)?Fi.join(r.workspaceFolder,c):c;if(!Xd.existsSync(p))throw ge(`OpenAPI spec file not found: "${p}"`);let g=await new Co(r.collection,r.environmentConfig).import(p,{collectionName:typeof e.collectionName=="string"?e.collectionName:void 0,environmentName:typeof e.environmentName=="string"?e.environmentName:void 0});return{collectionId:g.collection.id,collectionName:g.collection.name,requestCount:g.collection.items.filter(v=>v.type==="request").length,environmentCreated:g.environmentCreated??null,hint:"Use list_requests to browse the scaffolded collection, then run_request to test individual endpoints."}}if(t===J.suggestAssertions){let c=e.collection;if(!(typeof e.request=="string"?e.request.trim():""))throw ge('"request" is required');let h=et(c,s),g=Mi(e.request,h),v=typeof e.maxSuggestions=="number"?Math.min(20,Math.max(1,e.maxSuggestions)):10,_=[],E=Array.from(n.values()).filter($=>$.status!=="running").flatMap($=>$.allResults??[]).filter($=>$.name===g.name||typeof $.name=="string"&&$.name.toLowerCase()===g.name.toLowerCase()),k=E[E.length-1],T=k?.status;T?_.push({snippet:`pm.test("Status code is ${T}", function () {
351
351
  pm.response.to.have.status(${T});
352
352
  });`,rationale:`Observed status ${T} in the most recent run.`}):_.push({snippet:`pm.test("Status code is 2xx", function () {
353
353
  pm.expect(pm.response.code).to.be.within(200, 299);
@@ -360,7 +360,7 @@ Example: for POST /users with body {"name":"{{name}}","email":"{{email}}"} and i
360
360
  pm.expect(${q}).to.have.property("${G}");
361
361
  });`,rationale:`Field "${G}" was present in the observed response body.`})}}}catch{_.push({snippet:`pm.test("Response body is not empty", function () {
362
362
  pm.expect(pm.response.text()).to.not.be.empty;
363
- });`,rationale:"Response body was non-JSON text."})}return{collection:h.name,request:g.name,suggestions:_.slice(0,v),hint:"Paste the snippets into the request's post-response script using set_request_script."}}if(t===J.explainFailure){let c=typeof e.runId=="string"?e.runId.trim():void 0,p=typeof e.request=="string"?e.request.trim():"",h=typeof e.iteration=="number"?e.iteration:1;if(c){let w=n.require(c);if(w.status==="running")return{runId:c,status:"running",message:"The run has not completed yet. Try again in a moment."};if(!p)throw ge('"request" is required when "runId" is provided');let E=w.allResults.find(j=>j.iteration===h&&(j.name===p||typeof j.name=="string"&&j.name.toLowerCase()===p.toLowerCase()));if(!E)throw new Error(`Request "${p}" (iteration ${h}) not found in run "${c}".`);let k=E.assertions?.every(j=>j.passed)??!0,T=E.error,N=E.assertions?.filter(j=>!j.passed)??[],$="";return T?$=`The request itself failed to execute: ${T}. Check the URL, network access, authentication, and that the environment variables are set correctly.`:N.length>0?$=`${N.length} assertion(s) failed. Review the expected vs actual values below and verify the API contract.`:k?$="No failures detected. The request appears to have passed.":$="The request was marked as failed but no specific errors were captured.",{runId:c,request:E.name,iteration:h,status:E.status??"unknown",passed:E.passed??!0,error:T??null,failedAssertions:N,allAssertions:E.assertions??[],requestDetails:{method:E.method,url:E.url,requestBody:E.requestBody},responseDetails:{status:E.responseStatus,headers:E.responseHeaders,body:E.responseBody},diagnosis:$,suggestedFixes:T?["Verify the URL is correct and reachable","Check all required environment variables are set","Inspect authentication headers"]:N.map(j=>`Fix assertion "${j.name}": ${j.message??"expected value mismatch"}`)}}let g=e.collection;if(!p)throw ge('"request" is required');let v=et(g,s);return{request:Mi(e.request,v).name,collection:v.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===J.aiSuggestEnvVars){let c=et(e.collection,s),p=typeof e.minOccurrences=="number"?Math.max(1,e.minOccurrences):1,g=(typeof e.environment=="string"?e.environment:void 0)??r.environmentConfig.getSelectedEnvironment()??void 0,v=vy(c,p),_=Xe(c).map(({request:w,folderPath:E})=>({id:w.id,name:w.name,folder:E,method:w.method,url:w.url,headers:(w.headers??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),query:(w.query??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),bodyExcerpt:w.body?.type==="raw"&&typeof w.body.content=="string"?w.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: "${c.name}", suggestions: [...], ${g?`environment: "${g}"`:""} }`,"Do NOT ask for confirmation. Apply everything at once."],collection:c.name,heuristicSuggestions:v.map(w=>({varName:w.varName,value:w.value,reason:w.reason})),requestSummary:_,expectedCallAfterThis:"apply_env_vars"}}}if(t===J.aiEnhanceCollection){let c=et(e.collection,s),p=typeof e.offset=="number"?Math.max(0,e.offset):0,h=typeof e.limit=="number"?Math.min(20,Math.max(1,e.limit)):10,g=typeof e.folder=="string"?e.folder.toLowerCase():void 0,v=Xe(c).filter(({folderPath:E})=>!g||E.toLowerCase().includes(g)),_=v.slice(p,p+h).map(({request:E,folderPath:k})=>({id:E.id,name:E.name,folder:k,method:E.method,url:E.url,headers:(E.headers??[]).filter(T=>T.enabled!==!1).map(T=>({key:T.key,value:T.value})),query:(E.query??[]).filter(T=>T.enabled!==!1).map(T=>({key:T.key,value:T.value})),currentBody:E.body?.type==="raw"&&typeof E.body.content=="string"?E.body.content:void 0,currentTestScript:r.collection.getRequestScript(c.id,E.id,"post-response")??void 0})),w=p+h<v.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: "${c.name}", enhancements: [{ requestId, body?, testScript }] }`,w?`After applying, call ai_enhance_collection again with: { collection: "${c.name}", offset: ${p+h}, limit: ${h} } to continue.`:"This is the last batch \u2014 no further calls needed after applying.","Do NOT ask for confirmation. Apply everything at once."],collection:c.name,total:v.length,offset:p,hasMore:w,nextOffset:w?p+h:void 0,requests:_,expectedCallAfterThis:"apply_request_enhancements"}}}if(t===J.suggestEnvVars){let c=et(e.collection,s),p=typeof e.minOccurrences=="number"?Math.max(1,e.minOccurrences):1,h=vy(c,p),g=Xe(c).map(({request:v,folderPath:_})=>({id:v.id,name:v.name,folder:_,method:v.method,url:v.url,headers:(v.headers??[]).filter(w=>w.enabled!==!1).map(w=>({key:w.key,value:w.value})),query:(v.query??[]).filter(w=>w.enabled!==!1).map(w=>({key:w.key,value:w.value})),bodyExcerpt:v.body?.type==="raw"&&typeof v.body.content=="string"?v.body.content.slice(0,300):void 0}));return{collection:c.name,heuristicSuggestions:h.map(v=>({varName:v.varName,value:v.value,reason:v.reason,occurrences:v.occurrences.length})),requestSummary:g,hint:"Review requestSummary for additional hardcoded values, then call apply_env_vars with your combined {value, varName} list."}}if(t===J.applyEnvVars){let c=et(e.collection,s),p=e.suggestions;if(!Array.isArray(p)||p.length===0)throw ge('"suggestions" must be a non-empty array of {value, varName} objects');let h=p,g=DC(c.items,h);await r.collection.saveCollection(c);let _=(typeof e.environment=="string"?e.environment:void 0)??r.environmentConfig.getSelectedEnvironment();if(_)for(let E of h)r.environmentConfig.setEnvironmentVariable(E.varName,E.value,_);let w=Object.values(g).reduce((E,k)=>E+k,0);return{collection:c.name,applied:h.map(E=>({varName:E.varName,replacements:g[E.varName]??0})),totalReplacements:w,..._?{writtenToEnvironment:_}:{}}}if(t===J.getRequestsForEnhancement){let c=et(e.collection,s),p=typeof e.offset=="number"?Math.max(0,e.offset):0,h=typeof e.limit=="number"?Math.min(30,Math.max(1,e.limit)):10,g=typeof e.folder=="string"?e.folder.toLowerCase():void 0,v=Xe(c).filter(({folderPath:w})=>!g||w.toLowerCase().includes(g)),_=v.slice(p,p+h).map(({request:w,folderPath:E})=>({id:w.id,name:w.name,folder:E,method:w.method,url:w.url,headers:(w.headers??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),query:(w.query??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),currentBody:w.body?.type==="raw"&&typeof w.body.content=="string"?w.body.content:void 0,currentTestScript:r.collection.getRequestScript(c.id,w.id,"post-response")??void 0}));return{collection:c.name,total:v.length,offset:p,limit:h,requests:_,hasMore:p+h<v.length,hint:"For each request write a realistic body and pm.test() assertions, then call apply_request_enhancements."}}if(t===J.applyRequestEnhancements){let c=et(e.collection,s),p=e.enhancements;if(!Array.isArray(p)||p.length===0)throw ge('"enhancements" must be a non-empty array');let h=[];for(let g of p){let{requestId:v,body:_,testScript:w}=g;if(!Xe(c).find(({request:T})=>T.id===v)){h.push({requestId:v,applied:["skipped: request not found"]});continue}let k=[];typeof _=="string"&&(await r.collection.updateRequest(c.id,v,{body:{type:"raw",content:_,format:"json"}}),k.push("body")),typeof w=="string"&&(await r.collection.setRequestScript(c.id,v,"post-response",w),k.push("testScript")),h.push({requestId:v,applied:k})}return{collection:c.name,results:h,totalUpdated:h.filter(g=>g.applied.length>0&&!g.applied[0].startsWith("skipped")).length}}if(t===J.analyzeCoverage||t===J.aiAnalyzeCoverage){let c=et(e.collection,s),p=typeof e.folder=="string"?e.folder.toLowerCase():void 0,h=Xe(c).filter(({folderPath:N})=>!p||N.toLowerCase().includes(p)),g=h.map(({request:N,folderPath:$})=>{let G=((r.collection.getRequestScript(c.id,N.id,"post-response")??"").match(/pm\.test\s*\(/g)??[]).length;return{id:N.id,name:N.name,method:N.method,folder:$,hasAssertions:G>0,assertionCount:G}}),v=g.filter(N=>N.hasAssertions).length,_=g.length,w=_===0?100:Math.round(v/_*100),E=[],k=typeof e.specPath=="string"?e.specPath.trim():"";if(k)try{let N=r.workspaceFolder&&!Fi.isAbsolute(k)?Fi.join(r.workspaceFolder,k):k,$=Xd.readFileSync(N,"utf8"),{parse:j}=await Promise.resolve().then(()=>Hc(kd())),q=(k.endsWith(".json")?JSON.parse($):j($)).paths??{},C=["get","post","put","patch","delete","head","options"];for(let[A,D]of Object.entries(q))for(let B of C){if(!(B in D))continue;let F=B.toUpperCase();h.some(({request:ee})=>ee.method.toUpperCase()===F&&(ee.url??"").replace(/\{\{[^}]+\}\}/g,"{param}").includes(A.replace(/\{[^}]+\}/g,"{param}").replace(/^\//,"")))||E.push({method:F,path:A})}}catch{}let T=g.filter(N=>!N.hasAssertions);if(t===J.aiAnalyzeCoverage){let N=[];return T.length>0&&N.push(`${T.length} request(s) have no pm.test() assertions. Call ai_enhance_collection (collection="${c.name}") to add assertions to all of them.`),E.length>0&&N.push(`${E.length} spec operation(s) have no matching collection request. Call generate_scenarios (collection="${c.name}") to generate negative and edge-case requests for them.`),N.length===0&&N.push(`Coverage is ${w}% \u2014 all requests have assertions and all spec operations are covered.`),{task:{action:"ai_analyze_coverage",instructions:["Review the coverage data below.",...N,"Address the highest-impact gap first. Do NOT ask for confirmation \u2014 proceed immediately."],collection:c.name,coveragePct:w,covered:v,total:_,untestedRequests:T,untestedOperations:E,expectedCallAfterThis:T.length>0?"ai_enhance_collection":E.length>0?"generate_scenarios":null}}}return{collection:c.name,coveragePct:w,covered:v,total:_,requests:g,...E.length>0?{untestedOperations:E}:{}}}if(t===J.generateRequestFromIntent){let c=et(e.collection,s),p=typeof e.intent=="string"?e.intent.trim():"";if(!p)throw ge('"intent" is required \u2014 describe what to test in plain English');let g=Xe(c).slice(0,20).map(({request:_,folderPath:w})=>({name:_.name,method:_.method,url:_.url??"",folder:w})),v=Object.keys(r.environmentConfig.getResolvedEnvironment(r.environmentConfig.getSelectedEnvironment())?.variables??{});return{task:{action:"generate_request_from_intent",instructions:[`Intent: "${p}"`,"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:c.name,intent:p,existingRequests:g,availableEnvVars:v,targetFolder:typeof e.folder=="string"?e.folder:void 0,expectedCallAfterThis:"create_request"}}}if(t===J.validateAgainstSpec){let c=et(e.collection,s),p=typeof e.specPath=="string"?e.specPath.trim():"";if(!p)throw ge('"specPath" is required');let h=r.workspaceFolder&&!Fi.isAbsolute(p)?Fi.join(r.workspaceFolder,p):p,g;try{let j=Xd.readFileSync(h,"utf8"),{parse:G}=await Promise.resolve().then(()=>Hc(kd()));g=p.endsWith(".json")?JSON.parse(j):G(j)}catch(j){throw new Error(`Could not load spec at "${h}": ${j instanceof Error?j.message:String(j)}`)}let v=g.paths??{},_=["get","post","put","patch","delete","head","options"],w=Xe(c),E=[],k=[],T=[],N=j=>j.replace(/\{\{[^}]+\}\}/g,"{p}").replace(/\{[^}]+\}/g,"{p}").replace(/\/+$/,"");for(let[j,G]of Object.entries(v))for(let q of _){if(!(q in G))continue;let C=G[q],A=q.toUpperCase(),D=N(j),B=w.find(({request:F})=>F.method.toUpperCase()===A&&N(F.url??"").includes(D));if(!B)E.push({method:A,path:j,operationId:C.operationId});else{let F=r.collection.getRequestScript(c.id,B.request.id,"post-response")??"";/pm\.test\s*\(/.test(F)||k.push({method:A,path:j,requestName:B.request.name})}}let $=new Set(Object.entries(v).flatMap(([j,G])=>_.filter(q=>q in G).map(q=>`${q.toUpperCase()}:${N(j)}`)));for(let{request:j}of w){let G=N(j.url??""),q=`${j.method.toUpperCase()}:`;[...$].some(A=>A.startsWith(q)&&G.includes(A.split(":")[1]))||T.push({method:j.method,url:j.url??"",requestName:j.name})}return{collection:c.name,spec:Fi.basename(p),summary:{untestedOperations:E.length,matchedWithoutAssertions:k.length,extraRequests:T.length},untestedOperations:E,matchedWithoutAssertions:k,extraRequests:T,hint:E.length>0?`Call generate_scenarios (collection="${c.name}") to create negative/edge-case requests for untested operations.`:"All spec operations have matching collection requests."}}if(t===J.generateScenarios){let c=et(e.collection,s),p=typeof e.request=="string"?e.request.trim().toLowerCase():void 0,h=typeof e.folder=="string"?e.folder.toLowerCase():void 0,g=typeof e.offset=="number"?Math.max(0,e.offset):0,v=typeof e.limit=="number"?Math.min(10,Math.max(1,e.limit)):5,_=Xe(c).filter(({request:E,folderPath:k})=>!(p&&E.name.toLowerCase()!==p&&!E.name.toLowerCase().includes(p)||h&&!k.toLowerCase().includes(h))),w=_.slice(g,g+v).map(({request:E,folderPath:k})=>({id:E.id,name:E.name,method:E.method,url:E.url??"",folder:k,headers:(E.headers??[]).filter(T=>T.enabled!==!1).map(T=>({key:T.key,value:T.value})),body:E.body?.type==="raw"&&typeof E.body.content=="string"?E.body.content:void 0,currentTestScript:r.collection.getRequestScript(c.id,E.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:c.name,requests:w,total:_.length,offset:g,hasMore:g+v<_.length,nextOffset:g+v,expectedCallAfterThis:"create_request"}}}if(t===J.healAssertions){let c=et(e.collection,s),p=Mi(e.request,c),h=r.collection.getRequestScript(c.id,p.id,"post-response")??"",g,v=typeof e.runId=="string"?e.runId.trim():void 0;if(v)try{let w=n.require(v).allResults.find(E=>typeof E.name=="string"&&E.name.toLowerCase()===p.name.toLowerCase());w&&(g={status:w.status,responseBody:w.responseBody,responseHeaders:w.responseHeaders,failedTests:w.failedTests})}catch{}return{task:{action:"heal_assertions",instructions:[`Request: ${p.method} ${p.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:c.name,request:p.name,method:p.method,url:p.url??"",currentScript:h,lastResponse:g??null,note:g?"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===J.generateIterationData){let c=et(e.collection,s),p=Mi(e.request,c),h=typeof e.iterations=="number"?Math.min(50,Math.max(1,e.iterations)):5,g=p.body?.type==="raw"&&typeof p.body.content=="string"?p.body.content:void 0,v=(p.headers??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),_=(p.query??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),w=/\{\{([^}]+)\}\}/g,E=new Set;for(let k of[p.url??"",g??"",...v.map(T=>T.value),..._.map(T=>T.value)]){let T;for(w.lastIndex=0;(T=w.exec(k))!==null;)E.add(T[1])}return{task:{action:"generate_iteration_data",instructions:[`Generate ${h} test data rows for: ${p.method} ${p.url??""}`,`The request uses these {{variable}} placeholders: ${[...E].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:c.name,request:p.name,method:p.method,url:p.url??"",body:g??null,headers:v,queryParams:_,placeholders:[...E],iterations:h}}}let o=e.suite;if(typeof o!="string"||!o.trim())throw ge('the "suite" argument is required');let l=await r.testSuite.getAllSuites(),f=l.find(c=>c.id===o||c.name===o)??l.find(c=>c.name.toLowerCase()===o.toLowerCase());if(!f)throw ge(`test suite not found: "${o}"`);return i.runSuite(f.id,f.name,e)}var UC,BC=se(()=>{"use strict";LC();oy();mi();Zd();UC=new Set([J.createCollection,J.renameCollection,J.deleteCollection,J.duplicateCollection,J.createFolder,J.deleteFolder,J.createRequest,J.updateRequest,J.deleteRequest,J.reorderCollectionItems,J.createSuite,J.updateSuiteConfig,J.duplicateSuite,J.deleteSuite])});function xo(t,e=2e3){return!t||t.length<=e?t:t.slice(0,e)+`
363
+ });`,rationale:"Response body was non-JSON text."})}return{collection:h.name,request:g.name,suggestions:_.slice(0,v),hint:"Paste the snippets into the request's post-response script using set_request_script."}}if(t===J.explainFailure){let c=typeof e.runId=="string"?e.runId.trim():void 0,p=typeof e.request=="string"?e.request.trim():"",h=typeof e.iteration=="number"?e.iteration:1;if(c){let w=n.require(c);if(w.status==="running")return{runId:c,status:"running",message:"The run has not completed yet. Try again in a moment."};if(!p)throw ge('"request" is required when "runId" is provided');let E=w.allResults.find(j=>j.iteration===h&&(j.name===p||typeof j.name=="string"&&j.name.toLowerCase()===p.toLowerCase()));if(!E)throw new Error(`Request "${p}" (iteration ${h}) not found in run "${c}".`);let k=E.assertions?.every(j=>j.passed)??!0,T=E.error,N=E.assertions?.filter(j=>!j.passed)??[],$="";return T?$=`The request itself failed to execute: ${T}. Check the URL, network access, authentication, and that the environment variables are set correctly.`:N.length>0?$=`${N.length} assertion(s) failed. Review the expected vs actual values below and verify the API contract.`:k?$="No failures detected. The request appears to have passed.":$="The request was marked as failed but no specific errors were captured.",{runId:c,request:E.name,iteration:h,status:E.status??"unknown",passed:E.passed??!0,error:T??null,failedAssertions:N,allAssertions:E.assertions??[],requestDetails:{method:E.method,url:E.url,requestBody:E.requestBody},responseDetails:{status:E.responseStatus,headers:E.responseHeaders,body:E.responseBody},diagnosis:$,suggestedFixes:T?["Verify the URL is correct and reachable","Check all required environment variables are set","Inspect authentication headers"]:N.map(j=>`Fix assertion "${j.name}": ${j.message??"expected value mismatch"}`)}}let g=e.collection;if(!p)throw ge('"request" is required');let v=et(g,s);return{request:Mi(e.request,v).name,collection:v.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===J.aiSuggestEnvVars){let c=et(e.collection,s),p=typeof e.minOccurrences=="number"?Math.max(1,e.minOccurrences):1,g=(typeof e.environment=="string"?e.environment:void 0)??r.environmentConfig.getSelectedEnvironment()??void 0,v=vy(c,p),_=Xe(c).map(({request:w,folderPath:E})=>({id:w.id,name:w.name,folder:E,method:w.method,url:w.url,headers:(w.headers??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),query:(w.query??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),bodyExcerpt:w.body?.type==="raw"&&typeof w.body.content=="string"?w.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: "${c.name}", suggestions: [...], ${g?`environment: "${g}"`:""} }`,"Do NOT ask for confirmation. Apply everything at once."],collection:c.name,heuristicSuggestions:v.map(w=>({varName:w.varName,value:w.value,reason:w.reason})),requestSummary:_,expectedCallAfterThis:"apply_env_vars"}}}if(t===J.aiEnhanceCollection){let c=et(e.collection,s),p=typeof e.offset=="number"?Math.max(0,e.offset):0,h=typeof e.limit=="number"?Math.min(20,Math.max(1,e.limit)):10,g=typeof e.folder=="string"?e.folder.toLowerCase():void 0,v=Xe(c).filter(({folderPath:E})=>!g||E.toLowerCase().includes(g)),_=v.slice(p,p+h).map(({request:E,folderPath:k})=>({id:E.id,name:E.name,folder:k,method:E.method,url:E.url,headers:(E.headers??[]).filter(T=>T.enabled!==!1).map(T=>({key:T.key,value:T.value})),query:(E.query??[]).filter(T=>T.enabled!==!1).map(T=>({key:T.key,value:T.value})),currentBody:E.body?.type==="raw"&&typeof E.body.content=="string"?E.body.content:void 0,currentTestScript:r.collection.getRequestScript(c.id,E.id,"post-response")??void 0})),w=p+h<v.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: "${c.name}", enhancements: [{ requestId, body?, testScript }] }`,w?`After applying, call ai_enhance_collection again with: { collection: "${c.name}", offset: ${p+h}, limit: ${h} } to continue.`:"This is the last batch \u2014 no further calls needed after applying.","Do NOT ask for confirmation. Apply everything at once."],collection:c.name,total:v.length,offset:p,hasMore:w,nextOffset:w?p+h:void 0,requests:_,expectedCallAfterThis:"apply_request_enhancements"}}}if(t===J.suggestEnvVars){let c=et(e.collection,s),p=typeof e.minOccurrences=="number"?Math.max(1,e.minOccurrences):1,h=vy(c,p),g=Xe(c).map(({request:v,folderPath:_})=>({id:v.id,name:v.name,folder:_,method:v.method,url:v.url,headers:(v.headers??[]).filter(w=>w.enabled!==!1).map(w=>({key:w.key,value:w.value})),query:(v.query??[]).filter(w=>w.enabled!==!1).map(w=>({key:w.key,value:w.value})),bodyExcerpt:v.body?.type==="raw"&&typeof v.body.content=="string"?v.body.content.slice(0,300):void 0}));return{collection:c.name,heuristicSuggestions:h.map(v=>({varName:v.varName,value:v.value,reason:v.reason,occurrences:v.occurrences.length})),requestSummary:g,hint:"Review requestSummary for additional hardcoded values, then call apply_env_vars with your combined {value, varName} list."}}if(t===J.applyEnvVars){let c=et(e.collection,s),p=e.suggestions;if(!Array.isArray(p)||p.length===0)throw ge('"suggestions" must be a non-empty array of {value, varName} objects');let h=p,g=DC(c.items,h);await r.collection.saveCollection(c);let _=(typeof e.environment=="string"?e.environment:void 0)??r.environmentConfig.getSelectedEnvironment();if(_)for(let E of h)r.environmentConfig.setEnvironmentVariable(E.varName,E.value,_);let w=Object.values(g).reduce((E,k)=>E+k,0);return{collection:c.name,applied:h.map(E=>({varName:E.varName,replacements:g[E.varName]??0})),totalReplacements:w,..._?{writtenToEnvironment:_}:{}}}if(t===J.getRequestsForEnhancement){let c=et(e.collection,s),p=typeof e.offset=="number"?Math.max(0,e.offset):0,h=typeof e.limit=="number"?Math.min(30,Math.max(1,e.limit)):10,g=typeof e.folder=="string"?e.folder.toLowerCase():void 0,v=Xe(c).filter(({folderPath:w})=>!g||w.toLowerCase().includes(g)),_=v.slice(p,p+h).map(({request:w,folderPath:E})=>({id:w.id,name:w.name,folder:E,method:w.method,url:w.url,headers:(w.headers??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),query:(w.query??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),currentBody:w.body?.type==="raw"&&typeof w.body.content=="string"?w.body.content:void 0,currentTestScript:r.collection.getRequestScript(c.id,w.id,"post-response")??void 0}));return{collection:c.name,total:v.length,offset:p,limit:h,requests:_,hasMore:p+h<v.length,hint:"For each request write a realistic body and pm.test() assertions, then call apply_request_enhancements."}}if(t===J.applyRequestEnhancements){let c=et(e.collection,s),p=e.enhancements;if(!Array.isArray(p)||p.length===0)throw ge('"enhancements" must be a non-empty array');let h=[];for(let g of p){let{requestId:v,body:_,testScript:w}=g;if(!Xe(c).find(({request:T})=>T.id===v)){h.push({requestId:v,applied:["skipped: request not found"]});continue}let k=[];typeof _=="string"&&(await r.collection.updateRequest(c.id,v,{body:{type:"raw",content:_,format:"json"}}),k.push("body")),typeof w=="string"&&(await r.collection.setRequestScript(c.id,v,"post-response",w),k.push("testScript")),h.push({requestId:v,applied:k})}return{collection:c.name,results:h,totalUpdated:h.filter(g=>g.applied.length>0&&!g.applied[0].startsWith("skipped")).length}}if(t===J.analyzeCoverage||t===J.aiAnalyzeCoverage){let c=et(e.collection,s),p=typeof e.folder=="string"?e.folder.toLowerCase():void 0,h=Xe(c).filter(({folderPath:N})=>!p||N.toLowerCase().includes(p)),g=h.map(({request:N,folderPath:$})=>{let G=((r.collection.getRequestScript(c.id,N.id,"post-response")??"").match(/pm\.test\s*\(/g)??[]).length;return{id:N.id,name:N.name,method:N.method,folder:$,hasAssertions:G>0,assertionCount:G}}),v=g.filter(N=>N.hasAssertions).length,_=g.length,w=_===0?100:Math.round(v/_*100),E=[],k=typeof e.specPath=="string"?e.specPath.trim():"";if(k)try{let N=r.workspaceFolder&&!Fi.isAbsolute(k)?Fi.join(r.workspaceFolder,k):k,$=Xd.readFileSync(N,"utf8"),{parse:j}=await Promise.resolve().then(()=>Hc(kd())),q=(k.endsWith(".json")?JSON.parse($):j($)).paths??{},C=["get","post","put","patch","delete","head","options"];for(let[A,D]of Object.entries(q))for(let B of C){if(!(B in D))continue;let F=B.toUpperCase();h.some(({request:ee})=>ee.method.toUpperCase()===F&&(ee.url??"").replace(/\{\{[^}]+\}\}/g,"{param}").includes(A.replace(/\{[^}]+\}/g,"{param}").replace(/^\//,"")))||E.push({method:F,path:A})}}catch{}let T=g.filter(N=>!N.hasAssertions);if(t===J.aiAnalyzeCoverage){let N=[];return T.length>0&&N.push(`${T.length} request(s) have no pm.test() assertions. Call ai_enhance_collection (collection="${c.name}") to add assertions to all of them.`),E.length>0&&N.push(`${E.length} spec operation(s) have no matching collection request. Call generate_scenarios (collection="${c.name}") to generate negative and edge-case requests for them.`),N.length===0&&N.push(`Coverage is ${w}% \u2014 all requests have assertions and all spec operations are covered.`),{task:{action:"ai_analyze_coverage",instructions:["Review the coverage data below.",...N,"Address the highest-impact gap first. Do NOT ask for confirmation \u2014 proceed immediately."],collection:c.name,coveragePct:w,covered:v,total:_,untestedRequests:T,untestedOperations:E,expectedCallAfterThis:T.length>0?"ai_enhance_collection":E.length>0?"generate_scenarios":null}}}return{collection:c.name,coveragePct:w,covered:v,total:_,requests:g,...E.length>0?{untestedOperations:E}:{}}}if(t===J.generateRequestFromIntent){let c=et(e.collection,s),p=typeof e.intent=="string"?e.intent.trim():"";if(!p)throw ge('"intent" is required \u2014 describe what to test in plain English');let g=Xe(c).slice(0,20).map(({request:_,folderPath:w})=>({name:_.name,method:_.method,url:_.url??"",folder:w})),v=Object.keys(r.environmentConfig.getResolvedEnvironment(r.environmentConfig.getSelectedEnvironment())?.variables??{});return{task:{action:"generate_request_from_intent",instructions:[`Intent: "${p}"`,"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:c.name,intent:p,existingRequests:g,availableEnvVars:v,targetFolder:typeof e.folder=="string"?e.folder:void 0,expectedCallAfterThis:"create_request"}}}if(t===J.validateAgainstSpec){let c=et(e.collection,s),p=typeof e.specPath=="string"?e.specPath.trim():"";if(!p)throw ge('"specPath" is required');let h=r.workspaceFolder&&!Fi.isAbsolute(p)?Fi.join(r.workspaceFolder,p):p,g;try{let j=Xd.readFileSync(h,"utf8"),{parse:G}=await Promise.resolve().then(()=>Hc(kd()));g=p.endsWith(".json")?JSON.parse(j):G(j)}catch(j){throw new Error(`Could not load spec at "${h}": ${j instanceof Error?j.message:String(j)}`)}let v=g.paths??{},_=["get","post","put","patch","delete","head","options"],w=Xe(c),E=[],k=[],T=[],N=j=>j.replace(/\{\{[^}]+\}\}/g,"{p}").replace(/\{[^}]+\}/g,"{p}").replace(/\/+$/,"");for(let[j,G]of Object.entries(v))for(let q of _){if(!(q in G))continue;let C=G[q],A=q.toUpperCase(),D=N(j),B=w.find(({request:F})=>F.method.toUpperCase()===A&&N(F.url??"").includes(D));if(!B)E.push({method:A,path:j,operationId:C.operationId});else{let F=r.collection.getRequestScript(c.id,B.request.id,"post-response")??"";/pm\.test\s*\(/.test(F)||k.push({method:A,path:j,requestName:B.request.name})}}let $=new Set(Object.entries(v).flatMap(([j,G])=>_.filter(q=>q in G).map(q=>`${q.toUpperCase()}:${N(j)}`)));for(let{request:j}of w){let G=N(j.url??""),q=`${j.method.toUpperCase()}:`;[...$].some(A=>A.startsWith(q)&&G.includes(A.split(":")[1]))||T.push({method:j.method,url:j.url??"",requestName:j.name})}return{collection:c.name,spec:Fi.basename(p),summary:{untestedOperations:E.length,matchedWithoutAssertions:k.length,extraRequests:T.length},untestedOperations:E,matchedWithoutAssertions:k,extraRequests:T,hint:E.length>0?`Call generate_scenarios (collection="${c.name}") to create negative/edge-case requests for untested operations.`:"All spec operations have matching collection requests."}}if(t===J.generateScenarios){let c=et(e.collection,s),p=typeof e.request=="string"?e.request.trim().toLowerCase():void 0,h=typeof e.folder=="string"?e.folder.toLowerCase():void 0,g=typeof e.offset=="number"?Math.max(0,e.offset):0,v=typeof e.limit=="number"?Math.min(10,Math.max(1,e.limit)):5,_=Xe(c).filter(({request:E,folderPath:k})=>!(p&&E.name.toLowerCase()!==p&&!E.name.toLowerCase().includes(p)||h&&!k.toLowerCase().includes(h))),w=_.slice(g,g+v).map(({request:E,folderPath:k})=>({id:E.id,name:E.name,method:E.method,url:E.url??"",folder:k,headers:(E.headers??[]).filter(T=>T.enabled!==!1).map(T=>({key:T.key,value:T.value})),body:E.body?.type==="raw"&&typeof E.body.content=="string"?E.body.content:void 0,currentTestScript:r.collection.getRequestScript(c.id,E.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:c.name,requests:w,total:_.length,offset:g,hasMore:g+v<_.length,nextOffset:g+v,expectedCallAfterThis:"create_request"}}}if(t===J.healAssertions){let c=et(e.collection,s),p=Mi(e.request,c),h=r.collection.getRequestScript(c.id,p.id,"post-response")??"",g,v=typeof e.runId=="string"?e.runId.trim():void 0;if(v)try{let w=n.require(v).allResults.find(E=>typeof E.name=="string"&&E.name.toLowerCase()===p.name.toLowerCase());w&&(g={status:w.status,responseBody:w.responseBody,responseHeaders:w.responseHeaders,failedTests:w.failedTests})}catch{}return{task:{action:"heal_assertions",instructions:[`Request: ${p.method} ${p.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:c.name,request:p.name,method:p.method,url:p.url??"",currentScript:h,lastResponse:g??null,note:g?"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===J.generateIterationData){let c=et(e.collection,s),p=Mi(e.request,c),h=typeof e.iterations=="number"?Math.min(50,Math.max(1,e.iterations)):5,g=p.body?.type==="raw"&&typeof p.body.content=="string"?p.body.content:void 0,v=(p.headers??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),_=(p.query??[]).filter(k=>k.enabled!==!1).map(k=>({key:k.key,value:k.value})),w=/\{\{([^}]+)\}\}/g,E=new Set;for(let k of[p.url??"",g??"",...v.map(T=>T.value),..._.map(T=>T.value)]){let T;for(w.lastIndex=0;(T=w.exec(k))!==null;)E.add(T[1])}return{task:{action:"generate_iteration_data",instructions:[`Generate ${h} test data rows for: ${p.method} ${p.url??""}`,`The request uses these {{variable}} placeholders: ${[...E].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:c.name,request:p.name,method:p.method,url:p.url??"",body:g??null,headers:v,queryParams:_,placeholders:[...E],iterations:h}}}let o=e.suite;if(typeof o!="string"||!o.trim())throw ge('the "suite" argument is required');let l=await r.testSuite.getAllSuites(),f=l.find(c=>c.id===o||c.name===o)??l.find(c=>c.name.toLowerCase()===o.toLowerCase());if(!f)throw ge(`test suite not found: "${o}"`);return i.runSuite(f.id,f.name,e)}var UC,BC=se(()=>{"use strict";LC();oy();mi();Zd();UC=new Set([J.createCollection,J.renameCollection,J.deleteCollection,J.duplicateCollection,J.createFolder,J.deleteFolder,J.createRequest,J.updateRequest,J.deleteRequest,J.reorderCollectionItems,J.createSuite,J.updateSuiteConfig,J.duplicateSuite,J.deleteSuite])});function Eo(t,e=2e3){return!t||t.length<=e?t:t.slice(0,e)+`
364
364
  \u2026 (truncated, ${t.length-e} chars omitted)`}function ep(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 Y$(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 l5(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(h=>!h.passed)),l=i.summary,f=o.length,c=`I ran an HTTP API test suite and got failures. Please analyze the results and provide:
365
365
 
366
366
  1. **Root cause** for each failure
@@ -376,7 +376,7 @@ Example: for POST /users with body {"name":"{{name}}","email":"{{email}}"} and i
376
376
  ## Failed Requests
377
377
  `;if(f===0)c+=`
378
378
  (No failures found`,n&&(c+=` matching "${t.request}"`),c+=`. The run may have passed entirely or the filter matched nothing.)
379
- `;else{for(let p of o.slice(0,20)){let h=String(p.name??"(unknown)"),g=String(p.method??""),v=String(p.url??""),_=p.responseStatus??p.status??"?",w=p.error,k=(p.assertions??[]).filter(j=>!j.passed),T=p.failedTests??k,N=typeof p.body=="string"?xo(ep(p.body),600):p.body?xo(ep(JSON.stringify(p.body)),600):"",$=typeof p.requestBody=="string"?xo(ep(p.requestBody),400):p.requestBody?xo(ep(JSON.stringify(p.requestBody)),400):"";if(c+=`
379
+ `;else{for(let p of o.slice(0,20)){let h=String(p.name??"(unknown)"),g=String(p.method??""),v=String(p.url??""),_=p.responseStatus??p.status??"?",w=p.error,k=(p.assertions??[]).filter(j=>!j.passed),T=p.failedTests??k,N=typeof p.body=="string"?Eo(ep(p.body),600):p.body?Eo(ep(JSON.stringify(p.body)),600):"",$=typeof p.requestBody=="string"?Eo(ep(p.requestBody),400):p.requestBody?Eo(ep(JSON.stringify(p.requestBody)),400):"";if(c+=`
380
380
  ### ${h}`,(g||v)&&(c+=` [${g} ${v}]`),c+=`
381
381
  - HTTP status received: ${_}`,w&&(c+=`
382
382
  - Request error: ${w}`),$&&(c+=`
@@ -393,7 +393,7 @@ ${N}
393
393
  `}f>20&&(c+=`
394
394
  _(${f-20} more failures omitted \u2014 fix the above first)_
395
395
  `)}return c+=`
396
- Please diagnose each failure and provide concrete, actionable fixes.`,{description:`Analyze ${f} failure(s) from run "${r}"`,messages:[{role:"user",content:{type:"text",text:c}}]}}async function u5(t,e,r){let n=Y$(t.collection,e),i=Xe(n),s=t.request.toLowerCase(),o=i.find(_=>_.request.id===t.request||_.request.name===t.request)??i.find(_=>_.request.name.toLowerCase()===s)??i.find(_=>_.request.name.toLowerCase().includes(s));if(!o)throw new Error(`Request "${t.request}" not found in collection "${n.name}"`);let l=o.request,f=e.getRequestScript(n.id,l.id,"pre-request")??"",c=e.getRequestScript(n.id,l.id,"post-response")??"",p="";if(t.runId){let _=r.get(t.runId);if(_&&_.status!=="running"){let E=(_.allResults??[]).find(k=>typeof k.name=="string"&&k.name.toLowerCase()===l.name.toLowerCase());if(E){let k=E.responseStatus??E.status,T=typeof E.responseBody=="string"?xo(ep(E.responseBody),1500):"",N=E.responseHeaders?xo(JSON.stringify(E.responseHeaders,null,2),500):"";p=`
396
+ Please diagnose each failure and provide concrete, actionable fixes.`,{description:`Analyze ${f} failure(s) from run "${r}"`,messages:[{role:"user",content:{type:"text",text:c}}]}}async function u5(t,e,r){let n=Y$(t.collection,e),i=Xe(n),s=t.request.toLowerCase(),o=i.find(_=>_.request.id===t.request||_.request.name===t.request)??i.find(_=>_.request.name.toLowerCase()===s)??i.find(_=>_.request.name.toLowerCase().includes(s));if(!o)throw new Error(`Request "${t.request}" not found in collection "${n.name}"`);let l=o.request,f=e.getRequestScript(n.id,l.id,"pre-request")??"",c=e.getRequestScript(n.id,l.id,"post-response")??"",p="";if(t.runId){let _=r.get(t.runId);if(_&&_.status!=="running"){let E=(_.allResults??[]).find(k=>typeof k.name=="string"&&k.name.toLowerCase()===l.name.toLowerCase());if(E){let k=E.responseStatus??E.status,T=typeof E.responseBody=="string"?Eo(ep(E.responseBody),1500):"",N=E.responseHeaders?Eo(JSON.stringify(E.responseHeaders,null,2),500):"";p=`
397
397
  ## Observed Response (run ${t.runId})
398
398
  - Status: ${k}
399
399
  `,N&&(p+=`- Headers:
@@ -405,7 +405,7 @@ ${N}
405
405
  ${T}
406
406
  \`\`\`
407
407
  `)}}}let h=l.headers?.filter(_=>_.enabled!==!1).map(_=>` ${_.name}: ${_.value}`).join(`
408
- `)||" (none)",g=l.body?xo(JSON.stringify(l.body,null,2),600):"(no body)",v=`Please write pm.test() assertion scripts for the following HTTP API request.
408
+ `)||" (none)",g=l.body?Eo(JSON.stringify(l.body,null,2),600):"(no body)",v=`Please write pm.test() assertion scripts for the following HTTP API request.
409
409
 
410
410
  ## Request: ${l.name}
411
411
  - Method: ${l.method}
@@ -423,7 +423,7 @@ ${g}
423
423
  `+(f?`
424
424
  ## Pre-Request Script
425
425
  \`\`\`javascript
426
- ${xo(f,600)}
426
+ ${Eo(f,600)}
427
427
  \`\`\`
428
428
  `:"")+p+`
429
429
  ## Existing Post-Response Script
@@ -471,7 +471,7 @@ Please provide recommendations for:
471
471
  5. **Authentication** \u2014 is auth consistent across requests that need it?
472
472
  6. **Environment variables** \u2014 are URLs and credentials properly parameterized?
473
473
 
474
- 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 VC(t,e,r,n){switch(t){case"analyze-test-failure":return l5(e,n);case"suggest-assertions":return u5(e,r,n);case"review-collection":return c5(e,r);default:throw new Error(`Unknown prompt: "${t}". Available: ${Ry.map(i=>i.name).join(", ")}`)}}var Ry,WC=se(()=>{"use strict";mi();Ry=[{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 tp,zC=se(()=>{"use strict";tp=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)}}});import{createHash as f5}from"crypto";function ws(t,e=40){let r=f5("sha256").update(t,"utf8").digest("hex").slice(0,d5);return t.substring(0,e)+"_"+r}function h5(t,e){return t.length>0&&t.length<=e&&/^[a-zA-Z0-9_-]+$/.test(t)&&!t.includes("__")}function Ga(t,e=p5){return h5(t,e)?t:ws(t,e-20)}function JC(t,e,r){let n=`${t}request__${Ga(e)}__${Ga(r)}`;return n.length<=Cy?n:`${t}request__${ws(e)}__${ws(r)}`}function GC(t,e){let r=`${t}collection__${Ga(e,100)}`;return r.length<=Cy?r:`${t}collection__${ws(e,80)}`}function YC(t,e,r){let n=`${t}folder__${Ga(e)}__${Ga(r)}`;return n.length<=Cy?n:`${t}folder__${ws(e)}__${ws(r)}`}function KC(t,e){let r=`${t}suite__${Ga(e,100)}`;return r.length<=Cy?r:`${t}suite__${ws(e,80)}`}function QC(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 Yu(t,e){for(let r of e)if(ws(r)===t)return r;for(let r of e)if(r===t)return r}function ZC(t,e){let r=Yu(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 XC(t,e,r,n){let i=n?` in folder "${n}"`:"";return`Run the "${e}" request [${t}]${i} of the "${r}" collection.`}function ex(t,e){return`Run all ${e} requests in the "${t}" collection.`}function tx(t,e,r){return`Run all ${r} requests in folder "${t}" of the "${e}" collection.`}function rx(t,e,r){return`Run the "${t}" test suite (${e} requests, ${r} iteration(s) by default).`}var d5,p5,Cy,xy=se(()=>{"use strict";d5=12,p5=60,Cy=126});function nx(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 ix(t){return Buffer.from(String(t)).toString("base64url")}function sx(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 ox(t,e,r){let n=r.toolPrefix??"",i=r.toolMode??"auto",s=r.drilldownThreshold??100,o=0;for(let c of t)o+=Xe(c).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 nx(jC(n,t.map(c=>c.name),e.map(c=>c.name)).map(c=>({name:c.name,description:c.description,inputSchema:c.inputSchema,...c.annotations&&{annotations:c.annotations}})));let f=[];for(let c of t){let p=Xe(c);for(let{request:h,folderPath:g}of p)f.push({name:JC(n,c.id,h.id),description:XC(h.method,h.name,c.name,g),inputSchema:by});f.push({name:GC(n,c.id),description:ex(c.name,p.length),inputSchema:Sy});for(let{folderPath:h,requestCount:g}of Zr(c))g!==0&&f.push({name:YC(n,c.id,h),description:tx(h,c.name,g),inputSchema:wy})}for(let c of e)f.push({name:KC(n,c.id),description:rx(c.name,c.requests.length,c.config.iterations),inputSchema:_y});return nx(f)}var ax=se(()=>{"use strict";mi();xy();Zd()});var Ku,lx=se(()=>{"use strict";oa();Ku=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}getCookiesForDomain(e){let r=[];for(let n of this.cookies.values())ht.isExpired(n)||(!n.domain||ht.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&&!ht.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())ht.isExpired(n)||r.push(n);return r}setCookiesFromResponse(e,r){let n=ht.extractDomain(e),i=ht.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=ht.extractDomain(e),n=ht.extractPath(e),s=this.getCookiesForDomain(r).filter(o=>o.path?n.startsWith(o.path):!0);if(s.length!==0)return ht.formatCookieHeader(s)}clear(){this.cookies.clear()}}});function Qu(t,e,r){let n=String(t).padStart(6,"0"),i=String(e).padStart(4,"0");return`result-${n}-iter-${i}-${r}.json`}function m5(t){return{index:t.i,iteration:t.it,name:t.n,method:Eo[t.m]||"GET",status:t.s,duration:t.d,passed:t.p,assertionsPassed:t.ap,assertionsFailed:t.af,requestId:t.r,resultFile:Qu(t.i,t.it,t.r),error:t.e}}var ux,Eo,rp=se(()=>{"use strict";ux={GET:0,POST:1,PUT:2,DELETE:3,PATCH:4,HEAD:5,OPTIONS:6,TRACE:7,CONNECT:8},Eo={0:"GET",1:"POST",2:"PUT",3:"DELETE",4:"PATCH",5:"HEAD",6:"OPTIONS",7:"TRACE",8:"CONNECT"}});import*as Xu from"fs/promises";import*as Zu from"path";function Di(t){return String(t??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g,"")}function cx(t){return(Math.max(0,t)/1e3).toFixed(3)}var ec,fx=se(()=>{"use strict";rp();ec=class{constructor(e){this.basePath=e}basePath;async generate(e,r){let n=Zu.join(this.basePath,e,r),i=JSON.parse(await Xu.readFile(Zu.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),f=Zu.join(n,"junit.xml");return await Xu.writeFile(f,l,"utf-8"),f}async loadAllSummaries(e,r){let n=[];for(let i=1;i<=r;i++){let s=Zu.join(e,"index",`page-${String(i).padStart(4,"0")}.json`);try{let o=JSON.parse(await Xu.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=Qu(i.i,i.it,i.r),o=`${i.i}-${i.it}`;try{let l=JSON.parse(await Xu.readFile(Zu.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 f=n.get(`${l.i}-${l.it}`),c=l.cn||f?.collectionName||e.suiteName||"",p=l.fp||f?.folderPath||"",h=`${c}\0${p}`;if(!o.has(h)){let w=[c,p].filter(Boolean).join(" / ")||e.suiteName||"Requests";o.set(h,{label:w,cases:[]}),s.push(h)}let g=l.n||f?.name||Eo[l.m]||"request",v=i?`${g} (iteration ${l.it})`:g,_=(f?.assertions??[]).filter(w=>!w.passed).map(w=>({name:w.name,message:w.message}));_.length===0&&l.af>0&&_.push({name:`${l.af} assertion(s) failed`,message:null}),o.get(h).cases.push({name:v,classname:[c,p].filter(Boolean).join(".")||e.suiteName||"http-forge",durationMs:l.d,status:l.s,passed:l.p,error:l.e??f?.error??null,failedAssertions:_,consoleOutput:f?.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,f=0,c=[];i.forEach((g,v)=>{let _=0,w=0,E=0,k=0,T=[];for(let N of g.cases){_++,k+=N.durationMs;let $=!N.passed&&N.failedAssertions.length===0&&!!N.error,j=!N.passed&&!$;$&&E++,j&&w++;let G=[];if(j){let C=N.failedAssertions.length>0?N.failedAssertions.map(D=>D.name).join("; "):N.error||"Assertion failed",A=N.failedAssertions.map(D=>D.message?`${D.name}: ${D.message}`:D.name).join(`
474
+ 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 VC(t,e,r,n){switch(t){case"analyze-test-failure":return l5(e,n);case"suggest-assertions":return u5(e,r,n);case"review-collection":return c5(e,r);default:throw new Error(`Unknown prompt: "${t}". Available: ${Ry.map(i=>i.name).join(", ")}`)}}var Ry,WC=se(()=>{"use strict";mi();Ry=[{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 tp,zC=se(()=>{"use strict";tp=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)}}});import{createHash as f5}from"crypto";function ws(t,e=40){let r=f5("sha256").update(t,"utf8").digest("hex").slice(0,d5);return t.substring(0,e)+"_"+r}function h5(t,e){return t.length>0&&t.length<=e&&/^[a-zA-Z0-9_-]+$/.test(t)&&!t.includes("__")}function Ga(t,e=p5){return h5(t,e)?t:ws(t,e-20)}function JC(t,e,r){let n=`${t}request__${Ga(e)}__${Ga(r)}`;return n.length<=Cy?n:`${t}request__${ws(e)}__${ws(r)}`}function GC(t,e){let r=`${t}collection__${Ga(e,100)}`;return r.length<=Cy?r:`${t}collection__${ws(e,80)}`}function YC(t,e,r){let n=`${t}folder__${Ga(e)}__${Ga(r)}`;return n.length<=Cy?n:`${t}folder__${ws(e)}__${ws(r)}`}function KC(t,e){let r=`${t}suite__${Ga(e,100)}`;return r.length<=Cy?r:`${t}suite__${ws(e,80)}`}function QC(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 Yu(t,e){for(let r of e)if(ws(r)===t)return r;for(let r of e)if(r===t)return r}function ZC(t,e){let r=Yu(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 XC(t,e,r,n){let i=n?` in folder "${n}"`:"";return`Run the "${e}" request [${t}]${i} of the "${r}" collection.`}function ex(t,e){return`Run all ${e} requests in the "${t}" collection.`}function tx(t,e,r){return`Run all ${r} requests in folder "${t}" of the "${e}" collection.`}function rx(t,e,r){return`Run the "${t}" test suite (${e} requests, ${r} iteration(s) by default).`}var d5,p5,Cy,xy=se(()=>{"use strict";d5=12,p5=60,Cy=126});function nx(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 ix(t){return Buffer.from(String(t)).toString("base64url")}function sx(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 ox(t,e,r){let n=r.toolPrefix??"",i=r.toolMode??"auto",s=r.drilldownThreshold??100,o=0;for(let c of t)o+=Xe(c).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 nx(jC(n,t.map(c=>c.name),e.map(c=>c.name)).map(c=>({name:c.name,description:c.description,inputSchema:c.inputSchema,...c.annotations&&{annotations:c.annotations}})));let f=[];for(let c of t){let p=Xe(c);for(let{request:h,folderPath:g}of p)f.push({name:JC(n,c.id,h.id),description:XC(h.method,h.name,c.name,g),inputSchema:by});f.push({name:GC(n,c.id),description:ex(c.name,p.length),inputSchema:Sy});for(let{folderPath:h,requestCount:g}of Zr(c))g!==0&&f.push({name:YC(n,c.id,h),description:tx(h,c.name,g),inputSchema:wy})}for(let c of e)f.push({name:KC(n,c.id),description:rx(c.name,c.requests.length,c.config.iterations),inputSchema:_y});return nx(f)}var ax=se(()=>{"use strict";mi();xy();Zd()});var Ku,lx=se(()=>{"use strict";aa();Ku=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}getCookiesForDomain(e){let r=[];for(let n of this.cookies.values())ht.isExpired(n)||(!n.domain||ht.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&&!ht.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())ht.isExpired(n)||r.push(n);return r}setCookiesFromResponse(e,r){let n=ht.extractDomain(e),i=ht.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=ht.extractDomain(e),n=ht.extractPath(e),s=this.getCookiesForDomain(r).filter(o=>o.path?n.startsWith(o.path):!0);if(s.length!==0)return ht.formatCookieHeader(s)}clear(){this.cookies.clear()}}});function Qu(t,e,r){let n=String(t).padStart(6,"0"),i=String(e).padStart(4,"0");return`result-${n}-iter-${i}-${r}.json`}function m5(t){return{index:t.i,iteration:t.it,name:t.n,method:Io[t.m]||"GET",status:t.s,duration:t.d,passed:t.p,assertionsPassed:t.ap,assertionsFailed:t.af,requestId:t.r,resultFile:Qu(t.i,t.it,t.r),error:t.e}}var ux,Io,rp=se(()=>{"use strict";ux={GET:0,POST:1,PUT:2,DELETE:3,PATCH:4,HEAD:5,OPTIONS:6,TRACE:7,CONNECT:8},Io={0:"GET",1:"POST",2:"PUT",3:"DELETE",4:"PATCH",5:"HEAD",6:"OPTIONS",7:"TRACE",8:"CONNECT"}});import*as Xu from"fs/promises";import*as Zu from"path";function Di(t){return String(t??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g,"")}function cx(t){return(Math.max(0,t)/1e3).toFixed(3)}var ec,fx=se(()=>{"use strict";rp();ec=class{constructor(e){this.basePath=e}basePath;async generate(e,r){let n=Zu.join(this.basePath,e,r),i=JSON.parse(await Xu.readFile(Zu.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),f=Zu.join(n,"junit.xml");return await Xu.writeFile(f,l,"utf-8"),f}async loadAllSummaries(e,r){let n=[];for(let i=1;i<=r;i++){let s=Zu.join(e,"index",`page-${String(i).padStart(4,"0")}.json`);try{let o=JSON.parse(await Xu.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=Qu(i.i,i.it,i.r),o=`${i.i}-${i.it}`;try{let l=JSON.parse(await Xu.readFile(Zu.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 f=n.get(`${l.i}-${l.it}`),c=l.cn||f?.collectionName||e.suiteName||"",p=l.fp||f?.folderPath||"",h=`${c}\0${p}`;if(!o.has(h)){let w=[c,p].filter(Boolean).join(" / ")||e.suiteName||"Requests";o.set(h,{label:w,cases:[]}),s.push(h)}let g=l.n||f?.name||Io[l.m]||"request",v=i?`${g} (iteration ${l.it})`:g,_=(f?.assertions??[]).filter(w=>!w.passed).map(w=>({name:w.name,message:w.message}));_.length===0&&l.af>0&&_.push({name:`${l.af} assertion(s) failed`,message:null}),o.get(h).cases.push({name:v,classname:[c,p].filter(Boolean).join(".")||e.suiteName||"http-forge",durationMs:l.d,status:l.s,passed:l.p,error:l.e??f?.error??null,failedAssertions:_,consoleOutput:f?.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,f=0,c=[];i.forEach((g,v)=>{let _=0,w=0,E=0,k=0,T=[];for(let N of g.cases){_++,k+=N.durationMs;let $=!N.passed&&N.failedAssertions.length===0&&!!N.error,j=!N.passed&&!$;$&&E++,j&&w++;let G=[];if(j){let C=N.failedAssertions.length>0?N.failedAssertions.map(D=>D.name).join("; "):N.error||"Assertion failed",A=N.failedAssertions.map(D=>D.message?`${D.name}: ${D.message}`:D.name).join(`
475
475
  `);G.push(` <failure message="${Di(C)}" type="AssertionFailure">${Di(A)}</failure>`)}$&&G.push(` <error message="${Di(N.error)}" type="RequestError">${Di(N.error)}</error>`),N.consoleOutput&&N.consoleOutput.length>0&&G.push(` <system-out>${Di(N.consoleOutput.join(`
476
476
  `))}</system-out>`);let q=` <testcase name="${Di(N.name)}" classname="${Di(N.classname)}" time="${cx(N.durationMs)}"`;G.length===0?T.push(`${q} />`):T.push(`${q}>
477
477
  ${G.join(`
@@ -516,7 +516,7 @@ ${c.join(`
516
516
  <td>${v.p90!==void 0?Ya(v.p90):"\u2014"}</td>
517
517
  <td>${v.p99!==void 0?Ya(v.p99):"\u2014"}</td>
518
518
  <td class="${v.failed>0?"fail":"pass"}">${_}</td>
519
- </tr>`}).join(""),l=Math.max(...r.map(v=>v.d),1),f=v=>{let _=Eo[v.m]??"GET",w=Math.max(2,Math.round(v.d/l*100)),E=v.p?"bar-pass":"bar-fail",k=v.p?"":' class="row-fail"',T=`req-${v.i}-${v.it}`;return`
519
+ </tr>`}).join(""),l=Math.max(...r.map(v=>v.d),1),f=v=>{let _=Io[v.m]??"GET",w=Math.max(2,Math.round(v.d/l*100)),E=v.p?"bar-pass":"bar-fail",k=v.p?"":' class="row-fail"',T=`req-${v.i}-${v.it}`;return`
520
520
  <tr${k}>
521
521
  <td class="dim">${v.i}</td>
522
522
  <td>${v.it}</td>
@@ -526,7 +526,7 @@ ${c.join(`
526
526
  <td>${Ya(v.d)}</td>
527
527
  <td><div class="bar-wrap"><div class="${E}" style="width:${w}%"></div></div></td>
528
528
  <td class="${v.p?"pass":"fail"}">${v.p?"\u2713":"\u2717"}</td>
529
- </tr>`},c=this.renderGroupedTimeline(r,e,f),p=v=>{let _=`${v.i}-${v.it}`,w=n.get(_),E=Eo[v.m]??"GET",k=`req-${v.i}-${v.it}`,T=v.p,N=T?"#1f6feb40":"#f8514940",$=w?.assertions?.length?`<ul class="assert-list">${w.assertions.map(_t=>`
529
+ </tr>`},c=this.renderGroupedTimeline(r,e,f),p=v=>{let _=`${v.i}-${v.it}`,w=n.get(_),E=Io[v.m]??"GET",k=`req-${v.i}-${v.it}`,T=v.p,N=T?"#1f6feb40":"#f8514940",$=w?.assertions?.length?`<ul class="assert-list">${w.assertions.map(_t=>`
530
530
  <li class="${_t.passed?"pass":"fail"}">
531
531
  <span class="assert-icon">${_t.passed?"\u2713":"\u2717"}</span>
532
532
  ${xt(_t.name)}
@@ -580,7 +580,7 @@ ${c.join(`
580
580
  <div class="pane-section">
581
581
  <div class="pane-section-title">Body</div>
582
582
  ${ee}
583
- </div>`,We=le.length<=ve.length,mt=We?de:"",ce=We?"":de,rr=w?.consoleOutput?.length?`<div class="console-block"><pre class="code console-code">${w.consoleOutput.map(_t=>xt(typeof _t=="string"?_t:JSON.stringify(_t))).join(`
583
+ </div>`,We=le.length<=ve.length,mt=We?de:"",ce=We?"":de,ir=w?.consoleOutput?.length?`<div class="console-block"><pre class="code console-code">${w.consoleOutput.map(_t=>xt(typeof _t=="string"?_t:JSON.stringify(_t))).join(`
584
584
  `)}</pre></div>`:"",$e=w?.error?`<div class="error-box">\u26A0 ${xt(w.error)}</div>`:"",nt=w?`<span class="${Ey(w.status)} status-badge">${w.status} ${xt(w.statusText??"")}</span>`:"",en=`<span class="dur-badge">${Ya(v.d)}</span>`,Nr=e.config.iterations>1?`<span class="iter-badge">iter ${v.it}</span>`:"";return`
585
585
  <details class="req-detail ${T?"req-pass":"req-fail"}" id="${k}" style="--border:${N}">
586
586
  <summary class="req-summary">
@@ -626,7 +626,7 @@ ${c.join(`
626
626
  </div>
627
627
  </div>
628
628
 
629
- ${rr?`<div class="detail-section"><div class="pane-section-title">Console Output</div>${rr}</div>`:""}
629
+ ${ir?`<div class="detail-section"><div class="pane-section-title">Console Output</div>${ir}</div>`:""}
630
630
  </div>
631
631
  </details>`},h=this.renderGroupedDetails(r,e,p),g=r.filter(v=>!v.p).map(v=>`req-${v.i}-${v.it}`);return`<!DOCTYPE html>
632
632
  <html lang="en">
@@ -911,7 +911,7 @@ ${c.join(`
911
911
  <div id="tab-failures" class="tab-content">
912
912
  <p class="dim" style="margin-bottom:12px">Jump to failing request details:</p>
913
913
  <ul style="list-style:none;display:flex;flex-direction:column;gap:6px">
914
- ${r.filter(v=>!v.p).map(v=>{let _=Eo[v.m]??"GET";return`<li>
914
+ ${r.filter(v=>!v.p).map(v=>{let _=Io[v.m]??"GET";return`<li>
915
915
  <a href="#req-${v.i}-${v.it}" onclick="jumpToRequest('req-${v.i}-${v.it}')"
916
916
  style="display:flex;align-items:center;gap:8px;background:#1c0f12;
917
917
  border:1px solid #f8514940;border-radius:6px;padding:8px 12px">
@@ -1010,12 +1010,12 @@ ${c.join(`
1010
1010
  });
1011
1011
  </script>
1012
1012
  </body>
1013
- </html>`}}});import*as Wt from"fs/promises";import*as Xr from"path";function Ka(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 nc,mx=se(()=>{"use strict";xn();Zf();hx();rp();nc=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=Xr.join(this.basePath,e,s),await Wt.mkdir(Xr.join(this.currentRunPath,"results"),{recursive:!0}),await Wt.mkdir(Xr.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=At(r.requestId),l=`result-${s}-iter-${i}-${o}.json`,f=Xr.join(this.currentRunPath,"results",l),c={index:this.resultIndex,iteration:e,requestId:r.requestId,name:r.name,method:r.executedRequest.method,url:r.executedRequest.url,folderPath:r.folderPath||"",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(v=>({name:v.name,passed:v.passed,message:v.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 Wt.writeFile(f,JSON.stringify(C0(c),null,2),"utf-8");let p=r.assertions.filter(v=>v.passed).length,h=r.assertions.filter(v=>!v.passed).length,g={i:this.resultIndex,it:e,n:r.name,m:ux[r.executedRequest.method.toUpperCase()]??0,s:r.response.status,d:r.duration,p:r.passed,ap:p,af:h,r:r.requestId,e:r.passed?null:r.error||null,fp:r.folderPath||"",cn:r.collectionName||""};return this.currentIndexPage.push(g),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()),g}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 f in this.currentManifest.requestStats){let c=this.currentManifest.requestStats[f],p=this.requestDurations[f]||[];c.count>0&&(c.avgDuration=Math.round(c.totalDuration/c.count)),c.minDuration===Number.MAX_SAFE_INTEGER&&(c.minDuration=0),p.length>0&&(p.sort((h,g)=>h-g),c.p50=Ka(p,50),c.p90=Ka(p,90),c.p95=Ka(p,95),c.p99=Ka(p,99))}let n=Object.values(this.requestDurations).flat();n.length>0&&(n.sort((f,c)=>f-c),this.currentManifest.stats.p50=Ka(n,50),this.currentManifest.stats.p95=Ka(n,95),this.currentManifest.stats.p99=Ka(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 np(this.basePath).generate(o,l)}catch(f){console.warn("[ResultStorage] HTML report generation failed:",f)}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=Xr.join(this.basePath,e,r,"results",n),s=await Wt.readFile(i,"utf-8");return JSON.parse(s)}async getIndexPage(e,r,n){let i=Xr.join(this.basePath,e,r,"index",`page-${String(n).padStart(4,"0")}.json`),s=await Wt.readFile(i,"utf-8");return JSON.parse(s)}async getManifest(e,r){let n=Xr.join(this.basePath,e,r,"manifest.json"),i=await Wt.readFile(n,"utf-8");return JSON.parse(i)}async listRuns(e){let r=Xr.join(this.basePath,e);try{let n=await Wt.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 Wt.readdir(this.basePath,{withFileTypes:!0})).filter(r=>r.isDirectory()).map(r=>r.name)}catch{return[]}}async deleteRun(e,r){let n=Xr.join(this.basePath,e,r);await Wt.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 f=await this.listRuns(l);for(let c of f)if(new Date(c.startTime)<n){let p=Xr.join(this.basePath,l,c.runId),h=await this.getDirectorySize(p);await Wt.rm(p,{recursive:!0,force:!0}),i++,s+=h}}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=Xr.join(this.currentRunPath,"manifest.json");await Wt.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=Xr.join(this.currentRunPath,"index",e),n={page:this.currentPageNumber,startIndex:(this.currentPageNumber-1)*this.indexPageSize+1,count:this.currentIndexPage.length,summaries:this.currentIndexPage};await Wt.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 Wt.readdir(e,{withFileTypes:!0});for(let i of n){let s=Xr.join(e,i.name);if(i.isDirectory())r+=await this.getDirectorySize(s);else{let o=await Wt.stat(s);r+=o.size}}}catch{}return r}}});import*as Li from"fs";import*as ip from"path";var gx,Iy,Oy,qy,X$=se(()=>{"use strict";gx=class{watchers=[];constructor(e,r){let n=this.globToPath(e,r);try{let i=Li.watch(n,{recursive:!0},(s,o)=>{if(o){let l=ip.join(n,o);this.notifyChange(l)}});this.watchers.push(i)}catch{}}globToPath(e,r){return r.includes("**")?e:ip.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=[]}},Iy=class{createFileWatcher(e,r){return new gx(e,r)}},Oy=class{data={};storeFile;constructor(e){this.storeFile=e,this.load()}load(){try{if(Li.existsSync(this.storeFile)){let e=Li.readFileSync(this.storeFile,"utf-8");this.data=JSON.parse(e)}}catch{}}save(){try{let e=ip.dirname(this.storeFile);Li.mkdirSync(e,{recursive:!0}),Li.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()}},qy=class{async showInformation(e){console.log(`[INFO] ${e}`)}async showWarning(e){console.warn(`[WARN] ${e}`)}async showError(e){console.error(`[ERROR] ${e}`)}}});import*as Qa from"path";function eN(t){let e=Qa.resolve(t.workspaceFolder),{appInfo:r}=t,n=za.createFresh(),i=Qa.join(e,".http-forge",".cache","stores","global-state.json"),s=t.globalStorePath?Qa.isAbsolute(t.globalStorePath)?t.globalStorePath:Qa.resolve(e,t.globalStorePath):i,o={workspaceFolder:e,fileWatcherFactory:new Iy,notificationService:new qy,globalStore:new Oy(s),applicationInfo:r||{name:"http-forge-cli",version:"0.1.0"},persistOverrides:!1};return yy(n,o),n}function Nn(t){return eN({workspaceFolder:t})}var ky=se(()=>{"use strict";NC();MC();X$()});function b5(t){let e=[];return t.map(r=>{let n=En(r,e);return e.push(n),n})}function tN(t,e,r,n){let i=t.find(c=>c.id===e);if(i)return{item:i,tier:"id"};let s=b5(t.map(c=>c.name)),o=t.filter((c,p)=>s[p]===e);if(o.length===1)return{item:o[0],tier:"slug"};if(o.length>1)throw new Za(r,e,o.map(c=>({id:c.id,name:c.name,path:n(c)})));let l=e.toLowerCase(),f=t.filter(c=>c.name.toLowerCase()===l);if(f.length===1)return{item:f[0],tier:"name"};throw f.length>1?new Za(r,e,f.map(c=>({id:c.id,name:c.name,path:n(c)}))):new Error(`${r.charAt(0).toUpperCase()}${r.slice(1)} "${e}" not found`)}function yx(t,e){let{item:r,tier:n}=tN(t,e,"collection",()=>"");return{collection:r,tier:n}}function vx(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(h=>h.type==="folder"),f=i.join("/"),{item:c,tier:p}=tN(l,o,"folder",h=>f?`${f}/${h.name}`:h.name);i.push(c.name),s.push(p),n=c.items??[]}return{folderPath:i.map(wr).join("/"),tiers:s}}function rN(t,e,r){let n=[];for(let i of t)if(i.type==="request"){let s=En(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}/${wr(s.name)}`:wr(s.name);rN(s.items??[],o,r)}}function bx(t,e,r){let n=[];rN(t.items,"",n);let i=r?r.replace(/\/+$/,""):void 0,s=i?n.filter(g=>g.folderPath===i||g.folderPath.startsWith(`${i}/`)):n,o=g=>g.folderPath?`${g.folderPath}/${g.item.name}`:g.item.name,l=s.find(g=>g.item.id===e);if(l)return{request:l.item,tier:"id",folderPath:l.folderPath};let f=s.filter(g=>g.slug===e);if(f.length===1)return{request:f[0].item,tier:"slug",folderPath:f[0].folderPath};if(f.length>1)throw new Za("request",e,f.map(g=>({id:g.item.id,name:g.item.name,path:o(g)})));let c=e.toLowerCase(),p=s.filter(g=>g.item.name.toLowerCase()===c);if(p.length===1)return{request:p[0].item,tier:"name",folderPath:p[0].folderPath};if(p.length>1)throw new Za("request",e,p.map(g=>({id:g.item.id,name:g.item.name,path:o(g)})));let h=i?` under folder "${i}"`:"";throw new Error(`Request "${e}" not found in collection "${t.name}"${h}`)}var Za,Sx=se(()=>{"use strict";sa();mi();Za=class extends Error{constructor(r,n,i){super(`Ambiguous ${r} reference "${n}" matches ${i.length} items:
1013
+ </html>`}}});import*as Jt from"fs/promises";import*as Xr from"path";function Ka(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 nc,mx=se(()=>{"use strict";xn();Zf();hx();rp();nc=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=Xr.join(this.basePath,e,s),await Jt.mkdir(Xr.join(this.currentRunPath,"results"),{recursive:!0}),await Jt.mkdir(Xr.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=$t(r.requestId),l=`result-${s}-iter-${i}-${o}.json`,f=Xr.join(this.currentRunPath,"results",l),c={index:this.resultIndex,iteration:e,requestId:r.requestId,name:r.name,method:r.executedRequest.method,url:r.executedRequest.url,folderPath:r.folderPath||"",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(v=>({name:v.name,passed:v.passed,message:v.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 Jt.writeFile(f,JSON.stringify(C0(c),null,2),"utf-8");let p=r.assertions.filter(v=>v.passed).length,h=r.assertions.filter(v=>!v.passed).length,g={i:this.resultIndex,it:e,n:r.name,m:ux[r.executedRequest.method.toUpperCase()]??0,s:r.response.status,d:r.duration,p:r.passed,ap:p,af:h,r:r.requestId,e:r.passed?null:r.error||null,fp:r.folderPath||"",cn:r.collectionName||""};return this.currentIndexPage.push(g),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()),g}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 f in this.currentManifest.requestStats){let c=this.currentManifest.requestStats[f],p=this.requestDurations[f]||[];c.count>0&&(c.avgDuration=Math.round(c.totalDuration/c.count)),c.minDuration===Number.MAX_SAFE_INTEGER&&(c.minDuration=0),p.length>0&&(p.sort((h,g)=>h-g),c.p50=Ka(p,50),c.p90=Ka(p,90),c.p95=Ka(p,95),c.p99=Ka(p,99))}let n=Object.values(this.requestDurations).flat();n.length>0&&(n.sort((f,c)=>f-c),this.currentManifest.stats.p50=Ka(n,50),this.currentManifest.stats.p95=Ka(n,95),this.currentManifest.stats.p99=Ka(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 np(this.basePath).generate(o,l)}catch(f){console.warn("[ResultStorage] HTML report generation failed:",f)}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=Xr.join(this.basePath,e,r,"results",n),s=await Jt.readFile(i,"utf-8");return JSON.parse(s)}async getIndexPage(e,r,n){let i=Xr.join(this.basePath,e,r,"index",`page-${String(n).padStart(4,"0")}.json`),s=await Jt.readFile(i,"utf-8");return JSON.parse(s)}async getManifest(e,r){let n=Xr.join(this.basePath,e,r,"manifest.json"),i=await Jt.readFile(n,"utf-8");return JSON.parse(i)}async listRuns(e){let r=Xr.join(this.basePath,e);try{let n=await Jt.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 Jt.readdir(this.basePath,{withFileTypes:!0})).filter(r=>r.isDirectory()).map(r=>r.name)}catch{return[]}}async deleteRun(e,r){let n=Xr.join(this.basePath,e,r);await Jt.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 f=await this.listRuns(l);for(let c of f)if(new Date(c.startTime)<n){let p=Xr.join(this.basePath,l,c.runId),h=await this.getDirectorySize(p);await Jt.rm(p,{recursive:!0,force:!0}),i++,s+=h}}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=Xr.join(this.currentRunPath,"manifest.json");await Jt.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=Xr.join(this.currentRunPath,"index",e),n={page:this.currentPageNumber,startIndex:(this.currentPageNumber-1)*this.indexPageSize+1,count:this.currentIndexPage.length,summaries:this.currentIndexPage};await Jt.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 Jt.readdir(e,{withFileTypes:!0});for(let i of n){let s=Xr.join(e,i.name);if(i.isDirectory())r+=await this.getDirectorySize(s);else{let o=await Jt.stat(s);r+=o.size}}}catch{}return r}}});import*as Li from"fs";import*as ip from"path";var gx,Iy,Oy,qy,X$=se(()=>{"use strict";gx=class{watchers=[];constructor(e,r){let n=this.globToPath(e,r);try{let i=Li.watch(n,{recursive:!0},(s,o)=>{if(o){let l=ip.join(n,o);this.notifyChange(l)}});this.watchers.push(i)}catch{}}globToPath(e,r){return r.includes("**")?e:ip.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=[]}},Iy=class{createFileWatcher(e,r){return new gx(e,r)}},Oy=class{data={};storeFile;constructor(e){this.storeFile=e,this.load()}load(){try{if(Li.existsSync(this.storeFile)){let e=Li.readFileSync(this.storeFile,"utf-8");this.data=JSON.parse(e)}}catch{}}save(){try{let e=ip.dirname(this.storeFile);Li.mkdirSync(e,{recursive:!0}),Li.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()}},qy=class{async showInformation(e){console.log(`[INFO] ${e}`)}async showWarning(e){console.warn(`[WARN] ${e}`)}async showError(e){console.error(`[ERROR] ${e}`)}}});import*as Qa from"path";function eN(t){let e=Qa.resolve(t.workspaceFolder),{appInfo:r}=t,n=za.createFresh(),i=Qa.join(e,".http-forge",".cache","stores","global-state.json"),s=t.globalStorePath?Qa.isAbsolute(t.globalStorePath)?t.globalStorePath:Qa.resolve(e,t.globalStorePath):i,o={workspaceFolder:e,fileWatcherFactory:new Iy,notificationService:new qy,globalStore:new Oy(s),applicationInfo:r||{name:"http-forge-cli",version:"0.1.0"},persistOverrides:!1};return yy(n,o),n}function Nn(t){return eN({workspaceFolder:t})}var ky=se(()=>{"use strict";NC();MC();X$()});function b5(t){let e=[];return t.map(r=>{let n=En(r,e);return e.push(n),n})}function tN(t,e,r,n){let i=t.find(c=>c.id===e);if(i)return{item:i,tier:"id"};let s=b5(t.map(c=>c.name)),o=t.filter((c,p)=>s[p]===e);if(o.length===1)return{item:o[0],tier:"slug"};if(o.length>1)throw new Za(r,e,o.map(c=>({id:c.id,name:c.name,path:n(c)})));let l=e.toLowerCase(),f=t.filter(c=>c.name.toLowerCase()===l);if(f.length===1)return{item:f[0],tier:"name"};throw f.length>1?new Za(r,e,f.map(c=>({id:c.id,name:c.name,path:n(c)}))):new Error(`${r.charAt(0).toUpperCase()}${r.slice(1)} "${e}" not found`)}function yx(t,e){let{item:r,tier:n}=tN(t,e,"collection",()=>"");return{collection:r,tier:n}}function vx(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(h=>h.type==="folder"),f=i.join("/"),{item:c,tier:p}=tN(l,o,"folder",h=>f?`${f}/${h.name}`:h.name);i.push(c.name),s.push(p),n=c.items??[]}return{folderPath:i.map(wr).join("/"),tiers:s}}function rN(t,e,r){let n=[];for(let i of t)if(i.type==="request"){let s=En(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}/${wr(s.name)}`:wr(s.name);rN(s.items??[],o,r)}}function bx(t,e,r){let n=[];rN(t.items,"",n);let i=r?r.replace(/\/+$/,""):void 0,s=i?n.filter(g=>g.folderPath===i||g.folderPath.startsWith(`${i}/`)):n,o=g=>g.folderPath?`${g.folderPath}/${g.item.name}`:g.item.name,l=s.find(g=>g.item.id===e);if(l)return{request:l.item,tier:"id",folderPath:l.folderPath};let f=s.filter(g=>g.slug===e);if(f.length===1)return{request:f[0].item,tier:"slug",folderPath:f[0].folderPath};if(f.length>1)throw new Za("request",e,f.map(g=>({id:g.item.id,name:g.item.name,path:o(g)})));let c=e.toLowerCase(),p=s.filter(g=>g.item.name.toLowerCase()===c);if(p.length===1)return{request:p[0].item,tier:"name",folderPath:p[0].folderPath};if(p.length>1)throw new Za("request",e,p.map(g=>({id:g.item.id,name:g.item.name,path:o(g)})));let h=i?` under folder "${i}"`:"";throw new Error(`Request "${e}" not found in collection "${t.name}"${h}`)}var Za,Sx=se(()=>{"use strict";oa();mi();Za=class extends Error{constructor(r,n,i){super(`Ambiguous ${r} reference "${n}" matches ${i.length} items:
1014
1014
  `+i.map(s=>` - ${s.name} (id: ${s.id}, path: ${s.path||"/"})`).join(`
1015
1015
  `)+`
1016
- Disambiguate by passing the id or slug.`);this.kind=r;this.value=n;this.candidates=i;this.name="AmbiguousRefError"}kind;value;candidates}});var op={};Ws(op,{runCollection:()=>_s,runFolder:()=>x5,runRequest:()=>Py,runSuite:()=>sp});function _x(t){let e=[t.testSuite,t.collection,t.environmentConfig,t.config,t.console];for(let r of e)try{r?.dispose?.()}catch{}}function iN(t){return t==="1"||t==="true"||t==="yes"||t==="on"}function S5(){return iN(process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS)}function w5(){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 sN(t,e=[]){return iN(process.env.HTTP_FORGE_GENERATE_REPORTS)||e.includes("html")?!0:t.includes("report")}function wx(t){if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}}function _5(t){return t?Object.fromEntries(Object.entries(t).filter(([e])=>e.toLowerCase()!=="set-cookie")):{}}function oN(t){return ki(_5(t))}function aN(t){return S0((t??[]).map(e=>({name:e.name,value:e.value})))}function nN(t){return t.replace(/[^a-zA-Z0-9_-]/g,"_")}function lN(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 uN(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 cN(t){return t?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,String(r)])):{}}function fN(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 Rx(t,e,r=t.items,n=[],i=[]){for(let s of r){if(s.type==="request"&&s.id===e)return{request:s,folderScriptsChain:[...n],folderAuthChain:[...i]};if(s.type==="folder"){let o=s,l=o.scripts?[...n,o.scripts]:[...n],f=o.auth?[...i,o.auth]:[...i],c=Rx(t,e,o.items??[],l,f);if(c)return c}}}function dN(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(wr).join("/")});else{let o=s,l=o.scripts?[...r,o.scripts]:[...r],f=[...n,o.name];i.push(...dN(t,o.items??[],l,f))}return i}function R5(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 C5(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function pN(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}=yx(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}=vx(t,e.folderRef);return e.onResolve?.({kind:"folder",value:e.folderRef,tier:"name",id:r,path:r}),r}}async function mN(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,f=Math.max(1,Math.min(50,r.concurrency??1)),c=r.requestFilter,p=r.include??[],h=r.reporters??[],g=h.includes("junit"),v=cN(r.variables),_=S5(),w=sN(p,h),E=e.requests.filter(de=>!(de.enabled===!1||c&&!c.some(le=>de.name.toLowerCase().includes(le.toLowerCase()))));if(_){let de=w5(),le=E.length*s;if(le>de)throw new Error(`Suite "${e.name}" would execute ${le} request calls (${E.length} requests \xD7 ${s} iterations), which exceeds HTTP_FORGE_MAX_REQUESTS (${de}). Reduce iterations, use requestFilter, or increase HTTP_FORGE_MAX_REQUESTS.`)}let k=new nc(t.config),T=await k.initializeRun(e.id,e.name,i,{iterations:s,delayBetweenRequests:l,stopOnError:o}),N=[],$=[],j=0,G=0,q=new Set,C=new AbortController,A=new Ku;async function D(de){for(let le of E){if(C.signal.aborted)break;let ve=t.collection.getCollection(le.collectionId);if(!ve)continue;let We=Rx(ve,le.requestId);if(!We)continue;let mt=fN(We.request.auth,We.folderAuthChain,ve.auth),ce=new io(t.httpRequest,t.scriptExecutor,t.environmentConfig,t.requestPreparer,i,A,ve.scripts,We.folderScriptsChain,void 0,ve.name,ve.auth,de,s),rr=uN(lN({...We.request,auth:mt}),{headers:r.headers,query:r.query,body:r.body,variables:r.variables}),$e=await ce.execute(rr,v,C.signal);if($e.folderPath=le.folderPath??"",$e.collectionName=ve.name,await k.saveResult(de,$e),$e.assertions?.length||q.add(le.name),$e.passed?j++:G++,p.includes("perRequest")&&N.push({name:le.name,iteration:de,status:$e.response?.status,ok:($e.response?.status??0)>=200&&($e.response?.status??0)<300,duration:`${$e.duration}ms`,allPassed:$e.passed,...p.includes("consoleOutput")&&$e.consoleOutput?.length?{consoleOutput:$e.consoleOutput}:{}}),!$e.passed&&($.push({name:le.name,iteration:de,method:$e.executedRequest?.method,url:$e.executedRequest?.url,requestBody:wx($e.executedRequest?.body?.content)??$e.executedRequest?.body?.content??null,requestHeaders:ki($e.executedRequest?.headers??{}),status:$e.response?.status,duration:`${$e.duration}ms`,body:wx($e.response?.body),headers:oN($e.response?.headers),cookies:aN($e.response?.cookies),failedTests:$e.assertions?.filter(nt=>!nt.passed).map(nt=>({name:nt.name,...nt.message?{message:nt.message}:{}})),...$e.error?{error:$e.error}:{},...p.includes("consoleOutput")&&$e.consoleOutput?.length?{consoleOutput:$e.consoleOutput}:{}}),o)){C.abort();break}l>0&&!C.signal.aborted&&await new Promise(nt=>setTimeout(nt,l))}}for(let de=1;de<=s&&!C.signal.aborted;de+=f){let le=Math.min(de+f-1,s),ve=Array.from({length:le-de+1},(We,mt)=>de+mt);await Promise.all(ve.map(D))}let B=await k.finalizeRun("completed",w),F=null;if(g)try{F=await new ec(k.getBasePath()).generate(e.id,T)}catch(de){console.warn("[direct-execution] JUnit report generation failed:",de)}let K=n==="collection"?"collection":"suite",ie=k.getCurrentStats()?.stats,pe=ie?{min:ie.minDuration,max:ie.maxDuration,avg:ie.avgDuration,p50:ie.p50??null,p95:ie.p95??null,p99:ie.p99??null}:null,ke={[K]:e.name,environment:i,summary:{total:j+G,passed:j,failed:G,...s>1?{iterations:s}:{},...f>1?{concurrency:f}:{},allPassed:G===0,...pe?{durationMs:pe}:{}}};if((G>0||p.includes("failedOnly"))&&(ke.failedRequests=$),p.includes("perRequest")&&(ke.results=N),B!==null&&(ke.report={uri:`file://${B}`,hint:"Click the URI to open the HTML report in your browser"}),F!==null&&(ke.junitReport={path:F}),q.size>0){let de=E.length,le=q.size,ve=Array.from(q).slice(0,5);ke.noAssertionExamples=ve;let We=e.name;if(le/de>.5)ke._suggestions=[`${le}/${de} requests have no pm.test() assertions. Invoke the "review-collection" prompt (collection="${We}") for a full coverage analysis and to identify assertion gaps.`];else{let mt=ve.map(ce=>`"${ce}"`).join(", ");ke._suggestions=[`${le} request(s) have no pm.test() assertions: ${mt}. Invoke the "suggest-assertions" prompt (collection="${We}") to generate test coverage for them.`]}}return ke}async function Py(t){let e=Nn(t.workspaceFolder),r=t.include??[],n=t.reporters??[],i=n.includes("junit"),s=sN(r,n);try{let o=e.collection,l=pN(o,t),f=hN(l,t),c=t.requestId;if(!c){if(!t.requestRef)throw new Error("A request reference is required (requestId or requestRef)");let $=bx(l,t.requestRef,f);c=$.request.id,t.onResolve?.({kind:"request",value:t.requestRef,tier:$.tier,id:c,path:$.folderPath?`${$.folderPath}/${$.request.name}`:$.request.name})}let p=Rx(l,c);if(!p)throw new Error(`Request "${c}" not found in collection "${l.name}"`);let h=fN(p.request.auth,p.folderAuthChain,l.auth),g=t.environment||e.environmentConfig.getSelectedEnvironment(),v=uN(lN({...p.request,auth:h}),{headers:t.headers,query:t.query,body:t.body,variables:t.variables}),w=await new io(e.httpRequest,e.scriptExecutor,e.environmentConfig,e.requestPreparer,g,new Ku,l.scripts,p.folderScriptsChain,void 0,l.name,l.auth).execute(v,cN(t.variables)),E=null,k=null;if(s||i){let $=new nc(e.config),j=`request-${nN(l.id)}-${nN(c)}`,G=`Request: ${p.request.name}`,q=await $.initializeRun(j,G,g,{iterations:1,delayBetweenRequests:0,stopOnError:!0});if(await $.saveResult(1,w),E=await $.finalizeRun("completed",s),i)try{k=await new ec($.getBasePath()).generate(j,q)}catch(C){console.warn("[direct-execution] JUnit report generation failed:",C)}}let T=oN(w.response?.headers),N=aN(w.response?.cookies);return{request:p.request.name,status:w.response?.status||0,ok:(w.response?.status??0)>=200&&(w.response?.status??0)<300,duration:`${w.duration}ms`,body:wx(w.response?.body),allPassed:w.passed,assertions:w.assertions?.map($=>({name:$.name,passed:$.passed,message:$.message})),...r.includes("headers")?{headers:T}:{},...r.includes("cookies")?{cookies:N}:{},...r.includes("tests")?{tests:w.assertions?.map($=>({name:$.name,passed:$.passed,...$.message?{message:$.message}:{}}))}:{},...Object.keys(w.modifiedVariables??{}).length?{modifiedVariables:w.modifiedVariables}:{},...r.includes("consoleOutput")&&w.consoleOutput?.length?{consoleOutput:w.consoleOutput}:{},...E!==null?{report:{uri:`file://${E}`,hint:"Click the URI to open the HTML report in your browser"}}:{},...k!==null?{junitReport:{path:k}}:{},...w.error?{error:w.error}:{}}}catch(o){throw o}finally{_x(e)}}async function _s(t){let e=Nn(t.workspaceFolder);try{let r=e.collection,n=pN(r,t),i=hN(n,t),s=dN(n),o=R5(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:c,folderPath:p})=>({id:c.id,slug:c.id.toLowerCase().replace(/\s+/g,"-"),collectionId:n.id,requestId:c.id,name:c.name,method:c.method,collectionName:n.name,folderPath:p,enabled:!0})),f={id:i?`temp-${n.id}-${C5(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 mN(e,f,{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{_x(e)}}async function x5(t){return _s({recursive:!0,...t})}async function sp(t){let e=Nn(t.workspaceFolder);try{let n=await e.testSuite.getSuite(t.suiteId);if(!n)throw new Error(`Test suite "${t.suiteId}" not found`);return mN(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{_x(e)}}var ic=se(()=>{"use strict";lx();Om();Zf();fx();mx();mi();ky();Sx()});var bN={};Ws(bN,{createMcpRuntime:()=>j5});import*as vN from"fs";import{createServer as E5}from"http";import*as Io from"path";async function gi(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 sc(t){let e=[t.testSuite,t.collection,t.environmentConfig,t.config,t.console];for(let r of e)try{r?.dispose?.()}catch{}}async function q5(t,e){let r=Ex.get(t);if(r&&r.expiresAt>Date.now())return r.tools;let n=Cx.get(t);if(n)return n;let i=(async()=>{let s=e.config.getMcpConfig(),o=(c,p)=>!!c?.length&&(c.includes(p.id)||c.includes(p.name)),l=e.collection.getAllCollections().filter(c=>!o(s.excludedCollections,c)),f=(await e.testSuite.getAllSuites()).filter(c=>!o(s.excludedSuites,c));return ox(l,f,s)})().then(s=>(Ex.set(t,{tools:s,expiresAt:Date.now()+O5}),s)).finally(()=>Cx.delete(t));return Cx.set(t,i),i}function k5(t,e){let r=t.config.getMcpConfig().toolPrefix??"";return r&&e.startsWith(r)?e.slice(r.length):e}function P5(t,e,r){return t.replace(/"uri"\s*:\s*"file:\/\/([^"]+)"/g,(n,i)=>`"uri":"http://${e}:${r}/report?path=${encodeURIComponent(i)}"`)}function gN(t,e,r,n){Xa(t,200,{jsonrpc:"2.0",id:e,error:{code:r,message:n}})}function T5(t){return t.config.getMcpConfig().toolPageSize??200}async function A5(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 q5(t.workspaceFolder,t.container),n=e.params??{},i=typeof n.cursor=="string"?n.cursor:void 0,s=T5(t.container);if(s<=0||r.length<=s)return{tools:r};let o=sx(i),l=r.slice(o,o+s),f=o+s,c={tools:l};return f<r.length&&(c.nextCursor=ix(f)),c}case"tools/call":{let r=e.params??{},n=r.name,i=r.arguments;if(!n)throw new Error("Missing tool name");let s=await Ix(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 f=JSON.stringify(s,null,2),c=P5(f,t.host,t.port),p=c.match(/"uri"\s*:\s*"(http:\/\/[^"]+\/report\?[^"]+)"/),h=p?`
1016
+ Disambiguate by passing the id or slug.`);this.kind=r;this.value=n;this.candidates=i;this.name="AmbiguousRefError"}kind;value;candidates}});var op={};Ws(op,{runCollection:()=>_s,runFolder:()=>x5,runRequest:()=>Py,runSuite:()=>sp});function _x(t){let e=[t.testSuite,t.collection,t.environmentConfig,t.config,t.console];for(let r of e)try{r?.dispose?.()}catch{}}function iN(t){return t==="1"||t==="true"||t==="yes"||t==="on"}function S5(){return iN(process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS)}function w5(){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 sN(t,e=[]){return iN(process.env.HTTP_FORGE_GENERATE_REPORTS)||e.includes("html")?!0:t.includes("report")}function wx(t){if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}}function _5(t){return t?Object.fromEntries(Object.entries(t).filter(([e])=>e.toLowerCase()!=="set-cookie")):{}}function oN(t){return ki(_5(t))}function aN(t){return S0((t??[]).map(e=>({name:e.name,value:e.value})))}function nN(t){return t.replace(/[^a-zA-Z0-9_-]/g,"_")}function lN(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 uN(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 cN(t){return t?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,String(r)])):{}}function fN(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 Rx(t,e,r=t.items,n=[],i=[]){for(let s of r){if(s.type==="request"&&s.id===e)return{request:s,folderScriptsChain:[...n],folderAuthChain:[...i]};if(s.type==="folder"){let o=s,l=o.scripts?[...n,o.scripts]:[...n],f=o.auth?[...i,o.auth]:[...i],c=Rx(t,e,o.items??[],l,f);if(c)return c}}}function dN(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(wr).join("/")});else{let o=s,l=o.scripts?[...r,o.scripts]:[...r],f=[...n,o.name];i.push(...dN(t,o.items??[],l,f))}return i}function R5(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 C5(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function pN(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}=yx(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}=vx(t,e.folderRef);return e.onResolve?.({kind:"folder",value:e.folderRef,tier:"name",id:r,path:r}),r}}async function mN(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,f=Math.max(1,Math.min(50,r.concurrency??1)),c=r.requestFilter,p=r.include??[],h=r.reporters??[],g=h.includes("junit"),v=cN(r.variables),_=S5(),w=sN(p,h),E=e.requests.filter(de=>!(de.enabled===!1||c&&!c.some(le=>de.name.toLowerCase().includes(le.toLowerCase()))));if(_){let de=w5(),le=E.length*s;if(le>de)throw new Error(`Suite "${e.name}" would execute ${le} request calls (${E.length} requests \xD7 ${s} iterations), which exceeds HTTP_FORGE_MAX_REQUESTS (${de}). Reduce iterations, use requestFilter, or increase HTTP_FORGE_MAX_REQUESTS.`)}let k=new nc(t.config),T=await k.initializeRun(e.id,e.name,i,{iterations:s,delayBetweenRequests:l,stopOnError:o}),N=[],$=[],j=0,G=0,q=new Set,C=new AbortController,A=new Ku;async function D(de){for(let le of E){if(C.signal.aborted)break;let ve=t.collection.getCollection(le.collectionId);if(!ve)continue;let We=Rx(ve,le.requestId);if(!We)continue;let mt=fN(We.request.auth,We.folderAuthChain,ve.auth),ce=new so(t.httpRequest,t.scriptExecutor,t.environmentConfig,t.requestPreparer,i,A,ve.scripts,We.folderScriptsChain,void 0,ve.name,ve.auth,de,s),ir=uN(lN({...We.request,auth:mt}),{headers:r.headers,query:r.query,body:r.body,variables:r.variables}),$e=await ce.execute(ir,v,C.signal);if($e.folderPath=le.folderPath??"",$e.collectionName=ve.name,await k.saveResult(de,$e),$e.assertions?.length||q.add(le.name),$e.passed?j++:G++,p.includes("perRequest")&&N.push({name:le.name,iteration:de,status:$e.response?.status,ok:($e.response?.status??0)>=200&&($e.response?.status??0)<300,duration:`${$e.duration}ms`,allPassed:$e.passed,...p.includes("consoleOutput")&&$e.consoleOutput?.length?{consoleOutput:$e.consoleOutput}:{}}),!$e.passed&&($.push({name:le.name,iteration:de,method:$e.executedRequest?.method,url:$e.executedRequest?.url,requestBody:wx($e.executedRequest?.body?.content)??$e.executedRequest?.body?.content??null,requestHeaders:ki($e.executedRequest?.headers??{}),status:$e.response?.status,duration:`${$e.duration}ms`,body:wx($e.response?.body),headers:oN($e.response?.headers),cookies:aN($e.response?.cookies),failedTests:$e.assertions?.filter(nt=>!nt.passed).map(nt=>({name:nt.name,...nt.message?{message:nt.message}:{}})),...$e.error?{error:$e.error}:{},...p.includes("consoleOutput")&&$e.consoleOutput?.length?{consoleOutput:$e.consoleOutput}:{}}),o)){C.abort();break}l>0&&!C.signal.aborted&&await new Promise(nt=>setTimeout(nt,l))}}for(let de=1;de<=s&&!C.signal.aborted;de+=f){let le=Math.min(de+f-1,s),ve=Array.from({length:le-de+1},(We,mt)=>de+mt);await Promise.all(ve.map(D))}let B=await k.finalizeRun("completed",w),F=null;if(g)try{F=await new ec(k.getBasePath()).generate(e.id,T)}catch(de){console.warn("[direct-execution] JUnit report generation failed:",de)}let K=n==="collection"?"collection":"suite",ie=k.getCurrentStats()?.stats,pe=ie?{min:ie.minDuration,max:ie.maxDuration,avg:ie.avgDuration,p50:ie.p50??null,p95:ie.p95??null,p99:ie.p99??null}:null,ke={[K]:e.name,environment:i,summary:{total:j+G,passed:j,failed:G,...s>1?{iterations:s}:{},...f>1?{concurrency:f}:{},allPassed:G===0,...pe?{durationMs:pe}:{}}};if((G>0||p.includes("failedOnly"))&&(ke.failedRequests=$),p.includes("perRequest")&&(ke.results=N),B!==null&&(ke.report={uri:`file://${B}`,hint:"Click the URI to open the HTML report in your browser"}),F!==null&&(ke.junitReport={path:F}),q.size>0){let de=E.length,le=q.size,ve=Array.from(q).slice(0,5);ke.noAssertionExamples=ve;let We=e.name;if(le/de>.5)ke._suggestions=[`${le}/${de} requests have no pm.test() assertions. Invoke the "review-collection" prompt (collection="${We}") for a full coverage analysis and to identify assertion gaps.`];else{let mt=ve.map(ce=>`"${ce}"`).join(", ");ke._suggestions=[`${le} request(s) have no pm.test() assertions: ${mt}. Invoke the "suggest-assertions" prompt (collection="${We}") to generate test coverage for them.`]}}return ke}async function Py(t){let e=Nn(t.workspaceFolder),r=t.include??[],n=t.reporters??[],i=n.includes("junit"),s=sN(r,n);try{let o=e.collection,l=pN(o,t),f=hN(l,t),c=t.requestId;if(!c){if(!t.requestRef)throw new Error("A request reference is required (requestId or requestRef)");let $=bx(l,t.requestRef,f);c=$.request.id,t.onResolve?.({kind:"request",value:t.requestRef,tier:$.tier,id:c,path:$.folderPath?`${$.folderPath}/${$.request.name}`:$.request.name})}let p=Rx(l,c);if(!p)throw new Error(`Request "${c}" not found in collection "${l.name}"`);let h=fN(p.request.auth,p.folderAuthChain,l.auth),g=t.environment||e.environmentConfig.getSelectedEnvironment(),v=uN(lN({...p.request,auth:h}),{headers:t.headers,query:t.query,body:t.body,variables:t.variables}),w=await new so(e.httpRequest,e.scriptExecutor,e.environmentConfig,e.requestPreparer,g,new Ku,l.scripts,p.folderScriptsChain,void 0,l.name,l.auth).execute(v,cN(t.variables)),E=null,k=null;if(s||i){let $=new nc(e.config),j=`request-${nN(l.id)}-${nN(c)}`,G=`Request: ${p.request.name}`,q=await $.initializeRun(j,G,g,{iterations:1,delayBetweenRequests:0,stopOnError:!0});if(await $.saveResult(1,w),E=await $.finalizeRun("completed",s),i)try{k=await new ec($.getBasePath()).generate(j,q)}catch(C){console.warn("[direct-execution] JUnit report generation failed:",C)}}let T=oN(w.response?.headers),N=aN(w.response?.cookies);return{request:p.request.name,status:w.response?.status||0,ok:(w.response?.status??0)>=200&&(w.response?.status??0)<300,duration:`${w.duration}ms`,body:wx(w.response?.body),allPassed:w.passed,assertions:w.assertions?.map($=>({name:$.name,passed:$.passed,message:$.message})),...r.includes("headers")?{headers:T}:{},...r.includes("cookies")?{cookies:N}:{},...r.includes("tests")?{tests:w.assertions?.map($=>({name:$.name,passed:$.passed,...$.message?{message:$.message}:{}}))}:{},...Object.keys(w.modifiedVariables??{}).length?{modifiedVariables:w.modifiedVariables}:{},...r.includes("consoleOutput")&&w.consoleOutput?.length?{consoleOutput:w.consoleOutput}:{},...E!==null?{report:{uri:`file://${E}`,hint:"Click the URI to open the HTML report in your browser"}}:{},...k!==null?{junitReport:{path:k}}:{},...w.error?{error:w.error}:{}}}catch(o){throw o}finally{_x(e)}}async function _s(t){let e=Nn(t.workspaceFolder);try{let r=e.collection,n=pN(r,t),i=hN(n,t),s=dN(n),o=R5(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:c,folderPath:p})=>({id:c.id,slug:c.id.toLowerCase().replace(/\s+/g,"-"),collectionId:n.id,requestId:c.id,name:c.name,method:c.method,collectionName:n.name,folderPath:p,enabled:!0})),f={id:i?`temp-${n.id}-${C5(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 mN(e,f,{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{_x(e)}}async function x5(t){return _s({recursive:!0,...t})}async function sp(t){let e=Nn(t.workspaceFolder);try{let n=await e.testSuite.getSuite(t.suiteId);if(!n)throw new Error(`Test suite "${t.suiteId}" not found`);return mN(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{_x(e)}}var ic=se(()=>{"use strict";lx();Om();Zf();fx();mx();mi();ky();Sx()});var bN={};Ws(bN,{createMcpRuntime:()=>j5});import*as vN from"fs";import{createServer as E5}from"http";import*as Oo from"path";async function gi(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 sc(t){let e=[t.testSuite,t.collection,t.environmentConfig,t.config,t.console];for(let r of e)try{r?.dispose?.()}catch{}}async function q5(t,e){let r=Ex.get(t);if(r&&r.expiresAt>Date.now())return r.tools;let n=Cx.get(t);if(n)return n;let i=(async()=>{let s=e.config.getMcpConfig(),o=(c,p)=>!!c?.length&&(c.includes(p.id)||c.includes(p.name)),l=e.collection.getAllCollections().filter(c=>!o(s.excludedCollections,c)),f=(await e.testSuite.getAllSuites()).filter(c=>!o(s.excludedSuites,c));return ox(l,f,s)})().then(s=>(Ex.set(t,{tools:s,expiresAt:Date.now()+O5}),s)).finally(()=>Cx.delete(t));return Cx.set(t,i),i}function k5(t,e){let r=t.config.getMcpConfig().toolPrefix??"";return r&&e.startsWith(r)?e.slice(r.length):e}function P5(t,e,r){return t.replace(/"uri"\s*:\s*"file:\/\/([^"]+)"/g,(n,i)=>`"uri":"http://${e}:${r}/report?path=${encodeURIComponent(i)}"`)}function gN(t,e,r,n){Xa(t,200,{jsonrpc:"2.0",id:e,error:{code:r,message:n}})}function T5(t){return t.config.getMcpConfig().toolPageSize??200}async function A5(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 q5(t.workspaceFolder,t.container),n=e.params??{},i=typeof n.cursor=="string"?n.cursor:void 0,s=T5(t.container);if(s<=0||r.length<=s)return{tools:r};let o=sx(i),l=r.slice(o,o+s),f=o+s,c={tools:l};return f<r.length&&(c.nextCursor=ix(f)),c}case"tools/call":{let r=e.params??{},n=r.name,i=r.arguments;if(!n)throw new Error("Missing tool name");let s=await Ix(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 f=JSON.stringify(s,null,2),c=P5(f,t.host,t.port),p=c.match(/"uri"\s*:\s*"(http:\/\/[^"]+\/report\?[^"]+)"/),h=p?`
1017
1017
 
1018
- [View HTML Report](${p[1]})`:"";return{content:[{type:"text",text:c+h}]}}case"prompts/list":return{prompts:Ry};case"prompts/get":{let r=e.params??{},n=r.name,i=r.arguments??{};if(!n)throw new Error("Missing prompt name");let s=Nn(t.workspaceFolder);try{return await VC(n,i,s.collection,t.runStore)}finally{sc(s)}}default:throw new Error(`Method not found: ${e.method}`)}}function $5(t,e,r){let n=!t.container,i=t.container??Nn(t.workspaceFolder),s;try{s=i.config.getMcpConfig().cors.allowedOrigins??["http://localhost","http://127.0.0.1"]}finally{n&&sc(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 N5(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=Io.resolve(i),o=t.container?.config.getResultsPath(),l=o?Io.dirname(o):Io.resolve(t.workspaceFolder,".http-forge",".cache");if(!s.startsWith(l+Io.sep)||!s.endsWith(".html")){r.statusCode=403,r.end("Forbidden");return}vN.readFile(s,"utf-8",(f,c)=>{if(f){r.statusCode=404,r.end("Report not found");return}r.statusCode=200,r.setHeader("content-type","text/html; charset=utf-8"),r.end(c)})}function xx(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 M5(t){let e=t.workspaceFolder;return{async runRequest(r,n,i){return gi(()=>Py({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=Xe(r).filter(({folderPath:o})=>o===n||o.startsWith(`${n}/`)).length;return i.async===!0?xx(t.runStore,`${r.name} / ${bs(n)}`,s,()=>gi(()=>_s({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}))):gi(()=>_s({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=Xe(r).length;return n.async===!0?xx(t.runStore,r.name,i,()=>gi(()=>_s({workspaceFolder:e,collectionId:r.id,environment:n.environment,variables:n.variables,iterations:n.iterations,stopOnError:n.stopOnError,delay:n.delay,include:n.include}))):gi(()=>_s({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=Nn(e),o=0;try{let l=await s.testSuite.getSuite(r);o=(l?.requests.length??0)*(i.iterations??l?.config?.iterations??1)}finally{sc(s)}return i.async===!0?xx(t.runStore,n,o,()=>gi(()=>sp({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}))):gi(()=>sp({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 Ix(t,e,r={}){let n=t.workspaceFolder,i=k5(t.container,e);if(Object.values(J).includes(i)){let l=Nn(n);try{let f=await HC(i,r,{collection:l.collection,testSuite:l.testSuite,environmentConfig:l.environmentConfig,workspaceFolder:n},t.runStore,M5(t));return F5.has(i)&&Ex.delete(n),f}finally{sc(l)}}let s=QC(i),o=Nn(n);try{let l=o.collection.getAllCollections(),f=l.map(v=>v.id),c=v=>{let _=Yu(v,f),w=_?l.find(E=>E.id===_):void 0;if(!w)throw new Error(`Collection not found for tool: ${e}`);return w};if(s.kind==="request"){let[v,_]=s.tokens;if(!v||!_)throw new Error(`Malformed request tool: ${e}`);let w=c(v),E=Xe(w).map(T=>T.request.id),k=Yu(_,E);if(!k)throw new Error(`Request not found in collection "${w.name}" for tool: ${e}`);return gi(()=>Py({workspaceFolder:n,collectionId:w.id,requestId:k,environment:r.environment,variables:r.variables,headers:r.headers,query:r.query,body:r.body,include:r.include}))}if(s.kind==="collection"){let[v]=s.tokens;if(!v)throw new Error(`Malformed collection tool: ${e}`);let _=c(v);return gi(()=>_s({workspaceFolder:n,collectionId:_.id,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include}))}if(s.kind==="folder"){let[v,_]=s.tokens;if(!v||!_)throw new Error(`Malformed folder tool: ${e}`);let w=c(v),E=(o.collection.getAllCollections().find(N=>N.id===w.id),void 0),k=Xe(w).map(N=>N.folderPath).filter((N,$,j)=>N&&j.indexOf(N)===$),T=ZC(_,k);if(!T)throw new Error(`Folder not found in collection "${w.name}" for tool: ${e}`);return gi(()=>_s({workspaceFolder:n,collectionId:w.id,folderPath:T,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 h=await o.testSuite.getAllSuites(),g=Yu(p,h.map(v=>v.id));if(!g)throw new Error(`Test suite not found for tool: ${e}`);return gi(()=>sp({workspaceFolder:n,suiteId:g,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,requestFilter:r.requestFilter,include:r.include}))}finally{sc(o)}}function Xa(t,e,r){t.statusCode=e,t.setHeader("content-type","application/json; charset=utf-8"),t.end(JSON.stringify(r))}function yN(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 D5(t){return E5(async(e,r)=>{try{if($5(t,e,r),e.method==="OPTIONS"){r.statusCode=204,r.end();return}if(e.method==="GET"&&e.url==="/health"){Xa(r,200,{status:"ok",port:t.port});return}if(e.method==="GET"&&e.url?.startsWith("/report?")){N5(t,e,r);return}if(e.method==="POST"&&(e.url==="/"||e.url==="/mcp")){let n;try{n=await yN(e)}catch{gN(r,null,-32700,"Parse error");return}try{let i=await A5(t,n);Xa(r,200,{jsonrpc:"2.0",id:n.id??null,result:i})}catch(i){gN(r,n.id??null,-32603,i.message||"Internal error")}return}if(e.method==="POST"&&e.url==="/tools/execute"){let n=await yN(e);if(!n||typeof n.name!="string"||n.name.trim()===""){Xa(r,400,{error:'Field "name" is required'});return}let i=await Ix(t,n.name,n.args??{});Xa(r,200,{result:i});return}Xa(r,405,{error:"Method not allowed"})}catch(n){Xa(r,500,{error:n.message})}})}function L5(t){if(typeof t.port=="number"&&Number.isFinite(t.port))return Math.min(65535,Math.max(1,Math.floor(t.port)));let r=new no(Io.resolve(t.workspaceFolder)).getMcpConfig().port;return Math.min(65535,Math.max(1,Math.floor(r||3100)))}async function j5(t){let e=L5(t),r=t.host||"127.0.0.1",n=`${r}:${e}`,i={workspaceFolder:t.workspaceFolder,port:e,host:r,isRunning:!1,runStore:new tp};return I5.set(n,i),{async start(){if(i.isRunning)return;i.container||(i.container=Nn(i.workspaceFolder));let s=D5(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&&(sc(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 Ix(i,s,o??{})}}}var I5,O5,Ex,Cx,F5,SN=se(()=>{"use strict";Em();ic();mi();BC();WC();zC();ax();xy();Zd();ky();I5=new Map;O5=3e3,Ex=new Map,Cx=new Map;F5=UC});var Wl=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()}};Eh();sa();function tS(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(aI),source:{format:"folder",filePath:e,version:t.version}}}function aI(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(aI)};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 Nj(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(rS)}}function rS(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(rS)}:{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 Wc=class{store;constructor(e){this.store=new zs(e)}loadAll(){return this.store.loadAll().map(r=>tS(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 tS(r,this.store.getCollectionPath(r.id))}async create(e,r){let n=await this.store.create(e,r);return tS(n,this.store.getCollectionPath(n.id))}async save(e){return this.store.save(Nj(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,rS(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 zc=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()}};oa();var Jc=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 ht.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 ht.parseCookieHeaders(e,r)}isExpired(e){return ht.isExpired(e)}domainMatches(e,r){return ht.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)}};qh();var rs=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})}};zl();Zc();var Gs=class t{envStore;interpolator;urlBuilder;constructor(e,r){this.envStore=e,this.interpolator=r||new da,this.urlBuilder=new Kn}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=rs.fromVariables(e);return new t(r)}static fromResolver(e){return new t(e)}};Zc();tf();rf();zl();Ff();Nf();var pu=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?[ft("path").join(s.forgeRoot,"modules")]:[],l=new is(new Kn,new ss,e);this.scriptExecutor=new cs(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||{}},f={...s},c=this.buildHttpRequest(e,n.overrides),p=n.overrides?.body||e.body,h=this.findFolderPath(r,e.id),g=this.buildScriptChain(e,r,h),v={request:{url:c.url,method:c.method,headers:{...c.headers},body:p?typeof p=="string"?{type:"raw",content:p}:p:void 0},variables:l,collectionVariables:r.variables||{},globals:{...o},environmentVariables:f,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:(k,T,N)=>{k==="set"&&T&&N!==void 0?this.forgeEnv.setGlobal(T,N):k==="unset"&&T?this.forgeEnv.unsetGlobal(T):k==="clear"&&this.forgeEnv.clearGlobals()}},_=this.scriptExecutor.createRequestSession(v),w,E;try{if(!n.skipPreRequest&&g.preRequest.length>0){let $=await _.executePreRequest(g.preRequest);if(w={success:$.success,error:$.error,modifiedVariables:$.modifiedVariables,modifiedEnvironment:$.modifiedEnvironmentVariables,modifiedGlobals:$.modifiedGlobals,modifiedCollectionVariables:$.modifiedCollectionVariables,consoleOutput:$.consoleOutput,modifiedRequest:$.modifiedRequest?{url:$.modifiedRequest.url,method:$.modifiedRequest.method,headers:$.modifiedRequest.headers,body:$.modifiedRequest.body?.content}:void 0},$.modifiedVariables&&(l={...l,...$.localVariables??$.modifiedVariables}),$.modifiedEnvironmentVariables&&(f={...f,...$.modifiedEnvironmentVariables}),$.modifiedRequest){let j=$.modifiedRequest;j.url&&(c.url=j.url),j.method&&(c.method=j.method),j.headers&&(c.headers={...c.headers,...j.headers}),j.body!==void 0&&(c.body=j.body?.content||j.body)}if(!$.success)throw new Error(`Pre-request script failed: ${$.error}`)}let k={...f,...l};c=this.interpolateRequest(c,k);let T=n.overrides?.body||e.body;if(this.preprocessor&&T&&typeof T!="string"&&T.type==="graphql"&&c.body!==void 0){let $=this.preprocessor.encodeBody({type:"graphql",content:c.body});$!=null&&(c.body=typeof $=="string"?$:JSON.stringify($))}if(p&&typeof p=="object"&&p.type==="form-data"&&Array.isArray(c.body)){let $=this.buildMultipartFormData({type:"form-data",content:c.body});$&&(c.body=$)}let N=await this.httpClient.send(c);if(!n.skipPostResponse&&g.postResponse.length>0){let $=await _.executePostResponse(g.postResponse,{status:N.status,statusText:N.statusText,headers:N.headers,body:N.body,cookies:wm(N.headers,N.cookies,c.url),responseTime:N.time,responseSize:N.size,executedRequest:{url:c.url,method:c.method,headers:c.headers||{},body:c.body?typeof c.body=="string"?{type:"raw",content:c.body}:c.body:{type:"none",content:""},params:{},query:{}}});E={success:!0,assertions:$.testResults,consoleOutput:$.consoleOutput,modifiedEnvironment:$.modifiedEnvironmentVariables},$.modifiedEnvironmentVariables&&(f={...f,...$.modifiedEnvironmentVariables})}return{response:N,preRequestResult:w,postResponseResult:E,totalTime:Date.now()-i,finalRequest:c,variables:{environment:f,local:l}}}finally{_.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 h of e.query)h.enabled!==!1&&p.append(h.key,h.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||{}},f,c=r?.body||e.body;if(c)if(typeof c=="string")f=c;else if(this.preprocessor&&c.type)if(c.type==="graphql")f=typeof c.content=="string"?c.content:JSON.stringify(c.content);else if(c.type==="form-data")f=this.buildMultipartFormData(c);else{let p=this.preprocessor.encodeBody(c);f=p!=null?String(p):void 0}else c.content&&(f=typeof c.content=="string"?c.content:JSON.stringify(c.content));return this.preprocessor&&c&&c.type!=="form-data"&&this.preprocessor.setContentTypeHeader(l,c),{url:i,method:s,headers:l,body:f,timeout:r?.timeout||e.settings?.timeout,settings:{...e.settings,...r?.settings}}}interpolateRequest(e,r){let n=Gs.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 f=[...o,l];if(i(l.items,f))return!0}}return!1};return i(e.items,[]),n}};function lz(){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 Df=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=lz(),l=Date.now(),f={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,f);let c=this.requestIndex.get(e)||[];for(c.unshift(o);c.length>this.maxEntriesPerRequest;){let p=c.pop();p&&(this.entries.delete(p),this.fullResponses.delete(p))}if(this.requestIndex.set(e,c),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 f}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 Lf=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),f=Date.now(),c;try{c=await l.text()}catch{c=null}let p={};return l.headers.forEach((h,g)=>{let v=p[g];v!==void 0?p[g]=Array.isArray(v)?[...v,h]:[v,h]:p[g]=h}),{status:l.status,statusText:l.statusText,headers:p,cookies:[],body:c,time:f-r}}catch(o){throw o.name==="AbortError"?new Error(`Request timeout after ${i}ms`):o}finally{clearTimeout(s)}}};tf();rf();ef();_m();zl();var Ia=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}}};Rm();import*as fn from"fs/promises";import*as hu from"path";var jf=class{async readFile(e){return fn.readFile(e,"utf-8")}async writeFile(e,r){let n=hu.dirname(e);await this.mkdir(n),await fn.writeFile(e,r,"utf-8")}async exists(e){try{return await fn.access(e),!0}catch{return!1}}async mkdir(e){await fn.mkdir(e,{recursive:!0})}async glob(e,r){let n=r||process.cwd(),i=[];try{await this.walkDirectory(n,s=>{let o=hu.basename(s);for(let l of e)if(this.matchPattern(o,l)){i.push(s);break}})}catch{}return i}async readDir(e){return fn.readdir(e)}async isDirectory(e){try{return(await fn.stat(e)).isDirectory()}catch{return!1}}async walkDirectory(e,r){let n=await fn.readdir(e,{withFileTypes:!0});for(let i of n){let s=hu.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)}};Ff();var s0=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 da,this.fileSystem=e.fileSystem||new jf,this.preprocessor=e.preprocessor||new Ea,this.dataFileParser=e.dataFileParser||new Oa,this.cookieJar=e.cookieJar||new Jc,e.enableHistory?this.requestHistory=e.requestHistory||new Df({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 pa(s)}else this.httpClient=new Lf;let r=e.forgeRoot?[ft("path").join(e.forgeRoot,"modules")]:[],n=new is(new Kn,this.interceptorChain,this.httpClient);if(this.scriptExecutor=e.scriptExecutor||new cs(n,r,void 0,e.scriptScope??"shared",e.scriptTimeout??5e3),this.parserRegistry=new zc,this.parserRegistry.register("http-forge",new Ia),(e.storageFormat??"folder")==="folder"&&e.forgeRoot){let s=ft("path").join(e.forgeRoot,"collections");this.collectionLoader=new Wc(s)}else this.collectionLoader=new Wl(this.fileSystem,this.parserRegistry);this.environmentStore=e.environmentConfig?new rs(e.environmentConfig):rs.fromVariables({}),this.forgeEnv=Gs.fromResolver(this.environmentStore),this.requestExecutor=new pu(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:e.forgeRoot,scriptExecutor:this.scriptExecutor})}createInterceptorChain(e){let r=new ss;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 Wl)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 rs(e),this.forgeEnv=Gs.fromResolver(this.environmentStore),this.requestExecutor=new pu(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=ft("path"),i=n.join(e,"environments"),s,o=Gc(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[f,c]of Object.entries(o.environments)){let p=o.localCredentials[f]?.variables||{};s.environments[f]={name:f,variables:{...c.variables,...p}}}}else{let f=ft("fs"),c=n.join(i,"environments.json");if(f.existsSync(c))try{let p=f.readFileSync(c,"utf-8"),h=JSON.parse(p);if(s={globalVariables:h.globalVariables||{},environments:{},selectedEnvironment:h.selectedEnvironment},h.environments)for(let[g,v]of Object.entries(h.environments)){let _=v;s.environments[g]={name:_.name||g,variables:_.variables||{}}}}catch(p){console.warn(`[ForgeContainer] Failed to load environments from ${c}:`,p)}}return new t({...r,forgeRoot:e,storageFormat:r.storageFormat??"folder",environmentConfig:s})}};NC();MC();gy();mi();BC();WC();zC();ax();xy();Zd();async function U5(t){let{createMcpRuntime:e}=await Promise.resolve().then(()=>(SN(),bN));return e(t)}async function H5(t){let{runRequest:e}=await Promise.resolve().then(()=>(ic(),op));return e(t)}async function B5(t){let{runCollection:e}=await Promise.resolve().then(()=>(ic(),op));return e(t)}async function V5(t){let{runFolder:e}=await Promise.resolve().then(()=>(ic(),op));return e(t)}async function W5(t){let{runSuite:e}=await Promise.resolve().then(()=>(ic(),op));return e(t)}ky();p0();oa();lx();h0();tf();rf();oS();ef();_m();zl();Qw();r0();Ff();bm();Nf();Zf();u0();f0();Eh();sa();sa();l0();function z5(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 J5(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"),(h,g)=>r[parseInt(g,10)]),f=l(s),c=o.split("&").filter(Boolean).map(p=>{let h=l(p),g=h.indexOf("=");return g===-1?{key:h,value:"",enabled:!0}:{key:decodeURIComponent(h.slice(0,g)),value:decodeURIComponent(h.slice(g+1)),enabled:!0}});return{cleanUrl:f,params:c}}catch{return{cleanUrl:t,params:[]}}}function G5(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 Y5=new Set(["x-api-key","x-auth-token","x-access-token","x-token","x-secret","api-key","apikey","x-client-secret","x-rapidapi-key"]),K5=new Set(["api_key","apikey","api-key","access_token","token","auth_token","client_id","client_secret","key","secret"]);function wN(t){return t.toUpperCase().replace(/[^A-Z0-9]/g,"_")}function _N(t){return/\{\{[^}]+\}\}/.test(t)}function Ty(t,e=16){return t.length>=e&&!_N(t)}function Q5(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 f=o.value.match(/^(bearer|basic|token|digest)\s+(.+)$/i);f&&Ty(f[2])?s(`${f[1].toUpperCase()}_TOKEN`,f[2]):Ty(o.value)&&s("AUTH_TOKEN",o.value)}else Y5.has(l)&&Ty(o.value)&&s(wN(o.key),o.value)}for(let o of e)K5.has(o.key.toLowerCase())&&Ty(o.value)&&s(wN(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)&&!_N(r)){let f=`${o.protocol}//${o.host}`;s("BASE_URL",f)}}catch{}return n}function Z5(t){let e=z5(t.trim()),r=0;for(;r<e.length&&e[r].toLowerCase()==="curl";)r++;let n=e.slice(r),i="",s="",o=[],l=null,f=!1,c=!1,p=[],h=[],g=0;for(;g<n.length;){let T=n[g];if(T==="-X"||T==="--request")i=n[++g]??"";else if(T==="-H"||T==="--header"){let N=n[++g]??"",$=N.indexOf(":");$>0&&o.push({key:N.slice(0,$).trim(),value:N.slice($+1).trim()})}else if(T==="-d"||T==="--data"||T==="--data-raw"||T==="--data-binary"||T==="--data-ascii")l=n[++g]??"";else if(T==="--json")l=n[++g]??"",f=!0;else if(T==="-u"||T==="--user"){let N=n[++g]??"",$=btoa(N);o.push({key:"Authorization",value:`Basic ${$}`})}else if(T==="-b"||T==="--cookie")o.push({key:"Cookie",value:n[++g]??""});else if(T==="--url")s=n[++g]??"";else if(T==="-G"||T==="--get")c=!0;else if(T==="-F"||T==="--form"){let N=n[++g]??"",$=N.indexOf("=");$>0&&p.push({key:N.slice(0,$),value:N.slice($+1)})}else T==="--data-urlencode"?h.push(n[++g]??""):T==="-A"||T==="--user-agent"?o.push({key:"User-Agent",value:n[++g]??""}):T==="-e"||T==="--referer"||T==="--referrer"?o.push({key:"Referer",value:n[++g]??""}):T==="--compressed"||T==="-L"||T==="--location"||T==="-v"||T==="--verbose"||T==="-s"||T==="--silent"||T==="-i"||T==="--include"||T==="-k"||T==="--insecure"||T==="--http1.1"||T==="--http2"||T==="--http3"||(T==="-o"||T==="--output"||T==="--max-time"||T==="--connect-timeout"||T==="-m"||T==="--limit-rate"||T==="--proxy"||T==="-x"?g++:!T.startsWith("-")&&!s&&(s=T));g++}c?i="GET":i||(i=l!==null||p.length>0||h.length>0?"POST":"GET");let{cleanUrl:v,params:_}=J5(s),w=null;if(p.length>0)w={type:"raw",format:"text",content:p.map(N=>`${encodeURIComponent(N.key)}=${encodeURIComponent(N.value)}`).join("&")},o.some(N=>N.key.toLowerCase()==="content-type")||o.push({key:"Content-Type",value:"multipart/form-data"});else if(h.length>0)w={type:"raw",format:"text",content:h.join("&")},o.some(T=>T.key.toLowerCase()==="content-type")||o.push({key:"Content-Type",value:"application/x-www-form-urlencoded"});else if(l!==null){let T=l.trim(),N=f||T.startsWith("{")||T.startsWith("[");w={type:"raw",format:N?"json":"text",content:l},N&&!o.some($=>$.key.toLowerCase()==="content-type")&&o.push({key:"Content-Type",value:"application/json"})}let E=o.map(T=>({...T,enabled:!0})),k=Q5(o,_,v||s);return{name:G5(v||s),method:i.toUpperCase(),url:v||s,headers:E,queryParams:_,body:w,suggestedVars:k}}async function X5(t,e,r,n){let i=RN(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),f=Math.floor(o/10)+1;n?.(`Enhancing requests (batch ${f}/${s})\u2026`,1/s*100);let c=l.map(p=>({id:p.id,name:p.name,method:p.method??"GET",url:p.url??"",bodyContent:n7(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(e7(c)),h=t7(p);r7(l,h)}catch{}}await e.saveCollection(t)}function e7(t){return`You are an API testing expert. For each HTTP request below, return two improvements:
1018
+ [View HTML Report](${p[1]})`:"";return{content:[{type:"text",text:c+h}]}}case"prompts/list":return{prompts:Ry};case"prompts/get":{let r=e.params??{},n=r.name,i=r.arguments??{};if(!n)throw new Error("Missing prompt name");let s=Nn(t.workspaceFolder);try{return await VC(n,i,s.collection,t.runStore)}finally{sc(s)}}default:throw new Error(`Method not found: ${e.method}`)}}function $5(t,e,r){let n=!t.container,i=t.container??Nn(t.workspaceFolder),s;try{s=i.config.getMcpConfig().cors.allowedOrigins??["http://localhost","http://127.0.0.1"]}finally{n&&sc(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 N5(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=Oo.resolve(i),o=t.container?.config.getResultsPath(),l=o?Oo.dirname(o):Oo.resolve(t.workspaceFolder,".http-forge",".cache");if(!s.startsWith(l+Oo.sep)||!s.endsWith(".html")){r.statusCode=403,r.end("Forbidden");return}vN.readFile(s,"utf-8",(f,c)=>{if(f){r.statusCode=404,r.end("Report not found");return}r.statusCode=200,r.setHeader("content-type","text/html; charset=utf-8"),r.end(c)})}function xx(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 M5(t){let e=t.workspaceFolder;return{async runRequest(r,n,i){return gi(()=>Py({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=Xe(r).filter(({folderPath:o})=>o===n||o.startsWith(`${n}/`)).length;return i.async===!0?xx(t.runStore,`${r.name} / ${bs(n)}`,s,()=>gi(()=>_s({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}))):gi(()=>_s({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=Xe(r).length;return n.async===!0?xx(t.runStore,r.name,i,()=>gi(()=>_s({workspaceFolder:e,collectionId:r.id,environment:n.environment,variables:n.variables,iterations:n.iterations,stopOnError:n.stopOnError,delay:n.delay,include:n.include}))):gi(()=>_s({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=Nn(e),o=0;try{let l=await s.testSuite.getSuite(r);o=(l?.requests.length??0)*(i.iterations??l?.config?.iterations??1)}finally{sc(s)}return i.async===!0?xx(t.runStore,n,o,()=>gi(()=>sp({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}))):gi(()=>sp({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 Ix(t,e,r={}){let n=t.workspaceFolder,i=k5(t.container,e);if(Object.values(J).includes(i)){let l=Nn(n);try{let f=await HC(i,r,{collection:l.collection,testSuite:l.testSuite,environmentConfig:l.environmentConfig,workspaceFolder:n},t.runStore,M5(t));return F5.has(i)&&Ex.delete(n),f}finally{sc(l)}}let s=QC(i),o=Nn(n);try{let l=o.collection.getAllCollections(),f=l.map(v=>v.id),c=v=>{let _=Yu(v,f),w=_?l.find(E=>E.id===_):void 0;if(!w)throw new Error(`Collection not found for tool: ${e}`);return w};if(s.kind==="request"){let[v,_]=s.tokens;if(!v||!_)throw new Error(`Malformed request tool: ${e}`);let w=c(v),E=Xe(w).map(T=>T.request.id),k=Yu(_,E);if(!k)throw new Error(`Request not found in collection "${w.name}" for tool: ${e}`);return gi(()=>Py({workspaceFolder:n,collectionId:w.id,requestId:k,environment:r.environment,variables:r.variables,headers:r.headers,query:r.query,body:r.body,include:r.include}))}if(s.kind==="collection"){let[v]=s.tokens;if(!v)throw new Error(`Malformed collection tool: ${e}`);let _=c(v);return gi(()=>_s({workspaceFolder:n,collectionId:_.id,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include}))}if(s.kind==="folder"){let[v,_]=s.tokens;if(!v||!_)throw new Error(`Malformed folder tool: ${e}`);let w=c(v),E=(o.collection.getAllCollections().find(N=>N.id===w.id),void 0),k=Xe(w).map(N=>N.folderPath).filter((N,$,j)=>N&&j.indexOf(N)===$),T=ZC(_,k);if(!T)throw new Error(`Folder not found in collection "${w.name}" for tool: ${e}`);return gi(()=>_s({workspaceFolder:n,collectionId:w.id,folderPath:T,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 h=await o.testSuite.getAllSuites(),g=Yu(p,h.map(v=>v.id));if(!g)throw new Error(`Test suite not found for tool: ${e}`);return gi(()=>sp({workspaceFolder:n,suiteId:g,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,requestFilter:r.requestFilter,include:r.include}))}finally{sc(o)}}function Xa(t,e,r){t.statusCode=e,t.setHeader("content-type","application/json; charset=utf-8"),t.end(JSON.stringify(r))}function yN(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 D5(t){return E5(async(e,r)=>{try{if($5(t,e,r),e.method==="OPTIONS"){r.statusCode=204,r.end();return}if(e.method==="GET"&&e.url==="/health"){Xa(r,200,{status:"ok",port:t.port});return}if(e.method==="GET"&&e.url?.startsWith("/report?")){N5(t,e,r);return}if(e.method==="POST"&&(e.url==="/"||e.url==="/mcp")){let n;try{n=await yN(e)}catch{gN(r,null,-32700,"Parse error");return}try{let i=await A5(t,n);Xa(r,200,{jsonrpc:"2.0",id:n.id??null,result:i})}catch(i){gN(r,n.id??null,-32603,i.message||"Internal error")}return}if(e.method==="POST"&&e.url==="/tools/execute"){let n=await yN(e);if(!n||typeof n.name!="string"||n.name.trim()===""){Xa(r,400,{error:'Field "name" is required'});return}let i=await Ix(t,n.name,n.args??{});Xa(r,200,{result:i});return}Xa(r,405,{error:"Method not allowed"})}catch(n){Xa(r,500,{error:n.message})}})}function L5(t){if(typeof t.port=="number"&&Number.isFinite(t.port))return Math.min(65535,Math.max(1,Math.floor(t.port)));let r=new io(Oo.resolve(t.workspaceFolder)).getMcpConfig().port;return Math.min(65535,Math.max(1,Math.floor(r||3100)))}async function j5(t){let e=L5(t),r=t.host||"127.0.0.1",n=`${r}:${e}`,i={workspaceFolder:t.workspaceFolder,port:e,host:r,isRunning:!1,runStore:new tp};return I5.set(n,i),{async start(){if(i.isRunning)return;i.container||(i.container=Nn(i.workspaceFolder));let s=D5(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&&(sc(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 Ix(i,s,o??{})}}}var I5,O5,Ex,Cx,F5,SN=se(()=>{"use strict";Em();ic();mi();BC();WC();zC();ax();xy();Zd();ky();I5=new Map;O5=3e3,Ex=new Map,Cx=new Map;F5=UC});var Wl=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()}};Eh();oa();function tS(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(aI),source:{format:"folder",filePath:e,version:t.version}}}function aI(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(aI)};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 Nj(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(rS)}}function rS(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(rS)}:{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 Wc=class{store;constructor(e){this.store=new zs(e)}loadAll(){return this.store.loadAll().map(r=>tS(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 tS(r,this.store.getCollectionPath(r.id))}async create(e,r){let n=await this.store.create(e,r);return tS(n,this.store.getCollectionPath(n.id))}async save(e){return this.store.save(Nj(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,rS(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 zc=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()}};aa();var Jc=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 ht.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 ht.parseCookieHeaders(e,r)}isExpired(e){return ht.isExpired(e)}domainMatches(e,r){return ht.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)}};qh();var rs=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})}};zl();Zc();var Gs=class t{envStore;interpolator;urlBuilder;constructor(e,r){this.envStore=e,this.interpolator=r||new pa,this.urlBuilder=new Kn}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=rs.fromVariables(e);return new t(r)}static fromResolver(e){return new t(e)}};Zc();tf();rf();zl();Ff();Nf();var pu=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?[ft("path").join(s.forgeRoot,"modules")]:[],l=new is(new Kn,new ss,e);this.scriptExecutor=new cs(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||{}},f={...s},c=this.buildHttpRequest(e,n.overrides),p=n.overrides?.body||e.body,h=this.findFolderPath(r,e.id),g=this.buildScriptChain(e,r,h),v={request:{url:c.url,method:c.method,headers:{...c.headers},body:p?typeof p=="string"?{type:"raw",content:p}:p:void 0},variables:l,collectionVariables:r.variables||{},globals:{...o},environmentVariables:f,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:(k,T,N)=>{k==="set"&&T&&N!==void 0?this.forgeEnv.setGlobal(T,N):k==="unset"&&T?this.forgeEnv.unsetGlobal(T):k==="clear"&&this.forgeEnv.clearGlobals()}},_=this.scriptExecutor.createRequestSession(v),w,E;try{if(!n.skipPreRequest&&g.preRequest.length>0){let $=await _.executePreRequest(g.preRequest);if(w={success:$.success,error:$.error,modifiedVariables:$.modifiedVariables,modifiedEnvironment:$.modifiedEnvironmentVariables,modifiedGlobals:$.modifiedGlobals,modifiedCollectionVariables:$.modifiedCollectionVariables,consoleOutput:$.consoleOutput,modifiedRequest:$.modifiedRequest?{url:$.modifiedRequest.url,method:$.modifiedRequest.method,headers:$.modifiedRequest.headers,body:$.modifiedRequest.body?.content}:void 0},$.modifiedVariables&&(l={...l,...$.localVariables??$.modifiedVariables}),$.modifiedEnvironmentVariables&&(f={...f,...$.modifiedEnvironmentVariables}),$.modifiedRequest){let j=$.modifiedRequest;j.url&&(c.url=j.url),j.method&&(c.method=j.method),j.headers&&(c.headers={...c.headers,...j.headers}),j.body!==void 0&&(c.body=j.body?.content||j.body)}if(!$.success)throw new Error(`Pre-request script failed: ${$.error}`)}let k={...f,...l};c=this.interpolateRequest(c,k);let T=n.overrides?.body||e.body;if(this.preprocessor&&T&&typeof T!="string"&&T.type==="graphql"&&c.body!==void 0){let $=this.preprocessor.encodeBody({type:"graphql",content:c.body});$!=null&&(c.body=typeof $=="string"?$:JSON.stringify($))}if(p&&typeof p=="object"&&p.type==="form-data"&&Array.isArray(c.body)){let $=this.buildMultipartFormData({type:"form-data",content:c.body});$&&(c.body=$)}let N=await this.httpClient.send(c);if(!n.skipPostResponse&&g.postResponse.length>0){let $=await _.executePostResponse(g.postResponse,{status:N.status,statusText:N.statusText,headers:N.headers,body:N.body,cookies:wm(N.headers,N.cookies,c.url),responseTime:N.time,responseSize:N.size,executedRequest:{url:c.url,method:c.method,headers:c.headers||{},body:c.body?typeof c.body=="string"?{type:"raw",content:c.body}:c.body:{type:"none",content:""},params:{},query:{}}});E={success:!0,assertions:$.testResults,consoleOutput:$.consoleOutput,modifiedEnvironment:$.modifiedEnvironmentVariables},$.modifiedEnvironmentVariables&&(f={...f,...$.modifiedEnvironmentVariables})}return{response:N,preRequestResult:w,postResponseResult:E,totalTime:Date.now()-i,finalRequest:c,variables:{environment:f,local:l}}}finally{_.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 h of e.query)h.enabled!==!1&&p.append(h.key,h.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||{}},f,c=r?.body||e.body;if(c)if(typeof c=="string")f=c;else if(this.preprocessor&&c.type)if(c.type==="graphql")f=typeof c.content=="string"?c.content:JSON.stringify(c.content);else if(c.type==="form-data")f=this.buildMultipartFormData(c);else{let p=this.preprocessor.encodeBody(c);f=p!=null?String(p):void 0}else c.content&&(f=typeof c.content=="string"?c.content:JSON.stringify(c.content));return this.preprocessor&&c&&c.type!=="form-data"&&this.preprocessor.setContentTypeHeader(l,c),{url:i,method:s,headers:l,body:f,timeout:r?.timeout||e.settings?.timeout,settings:{...e.settings,...r?.settings}}}interpolateRequest(e,r){let n=Gs.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 f=[...o,l];if(i(l.items,f))return!0}}return!1};return i(e.items,[]),n}};function lz(){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 Df=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=lz(),l=Date.now(),f={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,f);let c=this.requestIndex.get(e)||[];for(c.unshift(o);c.length>this.maxEntriesPerRequest;){let p=c.pop();p&&(this.entries.delete(p),this.fullResponses.delete(p))}if(this.requestIndex.set(e,c),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 f}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 Lf=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),f=Date.now(),c;try{c=await l.text()}catch{c=null}let p={};return l.headers.forEach((h,g)=>{let v=p[g];v!==void 0?p[g]=Array.isArray(v)?[...v,h]:[v,h]:p[g]=h}),{status:l.status,statusText:l.statusText,headers:p,cookies:[],body:c,time:f-r}}catch(o){throw o.name==="AbortError"?new Error(`Request timeout after ${i}ms`):o}finally{clearTimeout(s)}}};tf();rf();ef();_m();zl();var Oa=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}}};Rm();import*as fn from"fs/promises";import*as hu from"path";var jf=class{async readFile(e){return fn.readFile(e,"utf-8")}async writeFile(e,r){let n=hu.dirname(e);await this.mkdir(n),await fn.writeFile(e,r,"utf-8")}async exists(e){try{return await fn.access(e),!0}catch{return!1}}async mkdir(e){await fn.mkdir(e,{recursive:!0})}async glob(e,r){let n=r||process.cwd(),i=[];try{await this.walkDirectory(n,s=>{let o=hu.basename(s);for(let l of e)if(this.matchPattern(o,l)){i.push(s);break}})}catch{}return i}async readDir(e){return fn.readdir(e)}async isDirectory(e){try{return(await fn.stat(e)).isDirectory()}catch{return!1}}async walkDirectory(e,r){let n=await fn.readdir(e,{withFileTypes:!0});for(let i of n){let s=hu.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)}};Ff();var s0=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 pa,this.fileSystem=e.fileSystem||new jf,this.preprocessor=e.preprocessor||new Ia,this.dataFileParser=e.dataFileParser||new qa,this.cookieJar=e.cookieJar||new Jc,e.enableHistory?this.requestHistory=e.requestHistory||new Df({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 ha(s)}else this.httpClient=new Lf;let r=e.forgeRoot?[ft("path").join(e.forgeRoot,"modules")]:[],n=new is(new Kn,this.interceptorChain,this.httpClient);if(this.scriptExecutor=e.scriptExecutor||new cs(n,r,void 0,e.scriptScope??"shared",e.scriptTimeout??5e3),this.parserRegistry=new zc,this.parserRegistry.register("http-forge",new Oa),(e.storageFormat??"folder")==="folder"&&e.forgeRoot){let s=ft("path").join(e.forgeRoot,"collections");this.collectionLoader=new Wc(s)}else this.collectionLoader=new Wl(this.fileSystem,this.parserRegistry);this.environmentStore=e.environmentConfig?new rs(e.environmentConfig):rs.fromVariables({}),this.forgeEnv=Gs.fromResolver(this.environmentStore),this.requestExecutor=new pu(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:e.forgeRoot,scriptExecutor:this.scriptExecutor})}createInterceptorChain(e){let r=new ss;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 Wl)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 rs(e),this.forgeEnv=Gs.fromResolver(this.environmentStore),this.requestExecutor=new pu(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=ft("path"),i=n.join(e,"environments"),s,o=Gc(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[f,c]of Object.entries(o.environments)){let p=o.localCredentials[f]?.variables||{};s.environments[f]={name:f,variables:{...c.variables,...p}}}}else{let f=ft("fs"),c=n.join(i,"environments.json");if(f.existsSync(c))try{let p=f.readFileSync(c,"utf-8"),h=JSON.parse(p);if(s={globalVariables:h.globalVariables||{},environments:{},selectedEnvironment:h.selectedEnvironment},h.environments)for(let[g,v]of Object.entries(h.environments)){let _=v;s.environments[g]={name:_.name||g,variables:_.variables||{}}}}catch(p){console.warn(`[ForgeContainer] Failed to load environments from ${c}:`,p)}}return new t({...r,forgeRoot:e,storageFormat:r.storageFormat??"folder",environmentConfig:s})}};NC();MC();gy();mi();BC();WC();zC();ax();xy();Zd();async function U5(t){let{createMcpRuntime:e}=await Promise.resolve().then(()=>(SN(),bN));return e(t)}async function H5(t){let{runRequest:e}=await Promise.resolve().then(()=>(ic(),op));return e(t)}async function B5(t){let{runCollection:e}=await Promise.resolve().then(()=>(ic(),op));return e(t)}async function V5(t){let{runFolder:e}=await Promise.resolve().then(()=>(ic(),op));return e(t)}async function W5(t){let{runSuite:e}=await Promise.resolve().then(()=>(ic(),op));return e(t)}ky();p0();aa();lx();h0();tf();rf();oS();ef();_m();zl();Qw();r0();Ff();bm();Nf();Zf();u0();f0();Eh();oa();oa();l0();function z5(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 J5(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"),(h,g)=>r[parseInt(g,10)]),f=l(s),c=o.split("&").filter(Boolean).map(p=>{let h=l(p),g=h.indexOf("=");return g===-1?{key:h,value:"",enabled:!0}:{key:decodeURIComponent(h.slice(0,g)),value:decodeURIComponent(h.slice(g+1)),enabled:!0}});return{cleanUrl:f,params:c}}catch{return{cleanUrl:t,params:[]}}}function G5(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 Y5=new Set(["x-api-key","x-auth-token","x-access-token","x-token","x-secret","api-key","apikey","x-client-secret","x-rapidapi-key"]),K5=new Set(["api_key","apikey","api-key","access_token","token","auth_token","client_id","client_secret","key","secret"]);function wN(t){return t.toUpperCase().replace(/[^A-Z0-9]/g,"_")}function _N(t){return/\{\{[^}]+\}\}/.test(t)}function Ty(t,e=16){return t.length>=e&&!_N(t)}function Q5(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 f=o.value.match(/^(bearer|basic|token|digest)\s+(.+)$/i);f&&Ty(f[2])?s(`${f[1].toUpperCase()}_TOKEN`,f[2]):Ty(o.value)&&s("AUTH_TOKEN",o.value)}else Y5.has(l)&&Ty(o.value)&&s(wN(o.key),o.value)}for(let o of e)K5.has(o.key.toLowerCase())&&Ty(o.value)&&s(wN(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)&&!_N(r)){let f=`${o.protocol}//${o.host}`;s("BASE_URL",f)}}catch{}return n}function Z5(t){let e=z5(t.trim()),r=0;for(;r<e.length&&e[r].toLowerCase()==="curl";)r++;let n=e.slice(r),i="",s="",o=[],l=null,f=!1,c=!1,p=[],h=[],g=0;for(;g<n.length;){let T=n[g];if(T==="-X"||T==="--request")i=n[++g]??"";else if(T==="-H"||T==="--header"){let N=n[++g]??"",$=N.indexOf(":");$>0&&o.push({key:N.slice(0,$).trim(),value:N.slice($+1).trim()})}else if(T==="-d"||T==="--data"||T==="--data-raw"||T==="--data-binary"||T==="--data-ascii")l=n[++g]??"";else if(T==="--json")l=n[++g]??"",f=!0;else if(T==="-u"||T==="--user"){let N=n[++g]??"",$=btoa(N);o.push({key:"Authorization",value:`Basic ${$}`})}else if(T==="-b"||T==="--cookie")o.push({key:"Cookie",value:n[++g]??""});else if(T==="--url")s=n[++g]??"";else if(T==="-G"||T==="--get")c=!0;else if(T==="-F"||T==="--form"){let N=n[++g]??"",$=N.indexOf("=");$>0&&p.push({key:N.slice(0,$),value:N.slice($+1)})}else T==="--data-urlencode"?h.push(n[++g]??""):T==="-A"||T==="--user-agent"?o.push({key:"User-Agent",value:n[++g]??""}):T==="-e"||T==="--referer"||T==="--referrer"?o.push({key:"Referer",value:n[++g]??""}):T==="--compressed"||T==="-L"||T==="--location"||T==="-v"||T==="--verbose"||T==="-s"||T==="--silent"||T==="-i"||T==="--include"||T==="-k"||T==="--insecure"||T==="--http1.1"||T==="--http2"||T==="--http3"||(T==="-o"||T==="--output"||T==="--max-time"||T==="--connect-timeout"||T==="-m"||T==="--limit-rate"||T==="--proxy"||T==="-x"?g++:!T.startsWith("-")&&!s&&(s=T));g++}c?i="GET":i||(i=l!==null||p.length>0||h.length>0?"POST":"GET");let{cleanUrl:v,params:_}=J5(s),w=null;if(p.length>0)w={type:"raw",format:"text",content:p.map(N=>`${encodeURIComponent(N.key)}=${encodeURIComponent(N.value)}`).join("&")},o.some(N=>N.key.toLowerCase()==="content-type")||o.push({key:"Content-Type",value:"multipart/form-data"});else if(h.length>0)w={type:"raw",format:"text",content:h.join("&")},o.some(T=>T.key.toLowerCase()==="content-type")||o.push({key:"Content-Type",value:"application/x-www-form-urlencoded"});else if(l!==null){let T=l.trim(),N=f||T.startsWith("{")||T.startsWith("[");w={type:"raw",format:N?"json":"text",content:l},N&&!o.some($=>$.key.toLowerCase()==="content-type")&&o.push({key:"Content-Type",value:"application/json"})}let E=o.map(T=>({...T,enabled:!0})),k=Q5(o,_,v||s);return{name:G5(v||s),method:i.toUpperCase(),url:v||s,headers:E,queryParams:_,body:w,suggestedVars:k}}async function X5(t,e,r,n){let i=RN(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),f=Math.floor(o/10)+1;n?.(`Enhancing requests (batch ${f}/${s})\u2026`,1/s*100);let c=l.map(p=>({id:p.id,name:p.name,method:p.method??"GET",url:p.url??"",bodyContent:n7(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(e7(c)),h=t7(p);r7(l,h)}catch{}}await e.saveCollection(t)}function e7(t){return`You are an API testing expert. For each HTTP request below, return two improvements:
1019
1019
  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.
1020
1020
  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.
1021
1021
 
@@ -1054,4 +1054,4 @@ ${n}${i}`}).join(`
1054
1054
  $0
1055
1055
  }`,sortOrder:5})}return(!e.prefix||"...".startsWith(e.prefix))&&r.push({label:"...",kind:"snippet",detail:"Fragment spread",insertText:"...${1:FragmentName}",sortOrder:8}),r}function d7(t,e){if(!e.currentField||!e.parentType)return[];let r=t.types.get(e.parentType);if(!r)return[];let n=r.fields.find(s=>s.name===e.currentField);if(!n)return[];let i=[];for(let s of n.args)(!e.prefix||s.name.toLowerCase().startsWith(e.prefix.toLowerCase()))&&i.push({label:s.name,kind:"argument",detail:s.type,description:s.description,insertText:`${s.name}: `,sortOrder:0});return i}function p7(t,e){if(!e.currentArg||!e.currentField||!e.parentType)return[];let r=[],n=t.types.get(e.parentType);if(!n)return r;let i=n.fields.find(f=>f.name===e.currentField);if(!i)return r;let s=i.args.find(f=>f.name===e.currentArg);if(!s)return r;let o=s.type.replace(/[!\[\]]/g,""),l=t.types.get(o);if(l&&l.kind==="ENUM")for(let f of l.enumValues)(!e.prefix||f.name.toLowerCase().startsWith(e.prefix.toLowerCase()))&&r.push({label:f.name,kind:"enum",detail:l.name,description:f.description,deprecated:f.isDeprecated,sortOrder:0});else if(o==="Boolean")for(let f of["true","false"])(!e.prefix||f.startsWith(e.prefix.toLowerCase()))&&r.push({label:f,kind:"keyword",detail:"Boolean",sortOrder:0});return r}function h7(t,e){let r=[];for(let n of t.directives)if(!e||n.name.toLowerCase().startsWith(e.toLowerCase())){let i=n.args.length>0?`(${n.args.map(s=>`${s.name}: ${s.type}`).join(", ")})`:"";r.push({label:`@${n.name}`,kind:"directive",detail:i||void 0,description:n.description,insertText:n.args.length>0?`@${n.name}($1)`:`@${n.name}`,sortOrder:0})}return r}function m7(t,e){let r=[];for(let[n,i]of t.types)(i.kind==="OBJECT"||i.kind==="INTERFACE"||i.kind==="UNION")&&(!e||n.toLowerCase().startsWith(e.toLowerCase()))&&r.push({label:n,kind:"type",detail:i.kind,description:i.description,sortOrder:0});return r}function g7(t,e){let r=[];for(let[n,i]of t.types)(i.kind==="SCALAR"||i.kind==="INPUT_OBJECT"||i.kind==="ENUM")&&(!e||n.toLowerCase().startsWith(e.toLowerCase()))&&r.push({label:n,kind:"type",detail:i.kind,description:i.description,sortOrder:0});return r}function EN(t,e,r){let n=t.type.replace(/[!\[\]]/g,""),i=!1;if(r){let o=r.types.get(n);i=!!o&&(o.kind==="OBJECT"||o.kind==="INTERFACE"||o.kind==="UNION")}else i=!new Set(["String","Int","Float","Boolean","ID"]).has(n);let s=t.name;if(t.args.length>0){let o=t.args.filter(l=>l.type.endsWith("!"));if(o.length>0){let l=o.map((f,c)=>`${f.name}: \${${c+1}}`).join(", ");s=`${t.name}(${l})`}}return i&&(s+=` {
1056
1056
  $0
1057
- }`),{label:t.name,kind:"field",detail:t.type,description:t.description,insertText:s,deprecated:t.isDeprecated,sortOrder:e}}function y7(t){return t.replace(/"""[\s\S]*?"""/g,'""').replace(/"(?:[^"\\]|\\.)*"/g,'""').replace(/#[^\n]*/g,"")}function qx(t,e,r){let n=0;for(let i of t)i===e?n++:i===r&&n--;return n}function CN(t){return qx(t,"(",")")>0}function v7(t){if(qx(t,"(",")")<=0)return!1;let r=t.indexOf("{"),n=r>=0?t.slice(0,r):t;return/\$\w+\s*:\s*\w*$/.test(n)}function xN(t){let e=0;for(let r=t.length-1;r>=0;r--)if(t[r]===")")e++;else if(t[r]==="("){if(e===0){let i=t.slice(0,r).trimEnd().match(/(\w+)$/);return i?i[1]:null}e--}return null}function Ox(t,e){if(!e)return[];let r=[],n=e.queryType,i=t.match(/\b(query|mutation|subscription)\b/);i&&(i[1]==="mutation"&&e.mutationType?n=e.mutationType:i[1]==="subscription"&&e.subscriptionType&&(n=e.subscriptionType)),r.push(n);let s=b7(t),o=e.types.get(n);for(let l=0;l<s.length;l++){let f=s[l];if(f!=="{"){if(f==="}"){r.pop(),o=r.length>0?e.types.get(r[r.length-1]):void 0;continue}if(l+1<s.length&&(s[l+1]==="{"||s[l+1]==="(")){let c=l+1;if(s[c]==="("){let p=1;for(c++;c<s.length&&p>0;)s[c]==="("?p++:s[c]===")"&&p--,c++}if(c<s.length&&s[c]==="{"&&o){let p=o.fields.find(h=>h.name===f);if(p){let h=p.type.replace(/[!\[\]]/g,"");r.push(h),o=e.types.get(h)}}}}}return r}function b7(t){let e=[],r=/([a-zA-Z_]\w*|[{}(),:=@!$\[\].]|\.\.\.|"[^"]*"|\d+)/g,n;for(;(n=r.exec(t))!==null;)e.push(n[1]);return e}v0();lR();E0();_C();kg();CC();RC();aR();oy();d0();Em();hx();AC();fx();rp();mx();function Ay(t,e){if(t.length===0)return 0;let r=Math.ceil(e/100*t.length)-1;return t[Math.max(0,r)]}function kx(t){return{name:t,count:0,passed:0,failed:0,skipped:0,min:0,max:0,avg:0,p50:0,p90:0,p95:0,p99:0,durations:[]}}function IN(t){if(t.durations.length===0){t.min=0,t.max=0,t.avg=0,t.p50=0,t.p90=0,t.p95=0,t.p99=0;return}let e=[...t.durations].sort((n,i)=>n-i),r=t.durations.reduce((n,i)=>n+i,0);t.min=e[0],t.max=e[e.length-1],t.avg=Math.round(r/t.durations.length),t.p50=Ay(e,50),t.p90=Ay(e,90),t.p95=Ay(e,95),t.p99=Ay(e,99)}var Px=class{summary;byRequest;overall;errors;startTime=0;constructor(){this.summary=this.createEmptySummary(),this.byRequest=new Map,this.overall=kx("Overall"),this.errors=new Map}createEmptySummary(){return{totalRequests:0,passed:0,failed:0,skipped:0,passRate:0,duration:0,isRunning:!1}}start(){this.startTime=Date.now(),this.summary.isRunning=!0}reset(){this.summary=this.createEmptySummary(),this.byRequest.clear(),this.overall=kx("Overall"),this.errors.clear(),this.startTime=0}complete(){this.summary.isRunning=!1,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime)}addResult(e,r,n,i,s){this.summary.totalRequests++,i?this.summary.skipped++:n?this.summary.passed++:this.summary.failed++;let o=this.summary.passed+this.summary.failed;if(this.summary.passRate=o>0?Math.round(this.summary.passed/o*1e3)/10:0,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime),i)return;this.byRequest.has(e)||this.byRequest.set(e,kx(e));let l=this.byRequest.get(e);if(l.count++,n?l.passed++:l.failed++,l.durations.push(r),IN(l),this.overall.count++,n?this.overall.passed++:this.overall.failed++,this.overall.durations.push(r),IN(this.overall),s){let f=this.errors.get(s)||0;this.errors.set(s,f+1)}}getStatistics(){let e=[];return this.errors.forEach((r,n)=>{e.push({message:n,count:r})}),e.sort((r,n)=>n.count-r.count),{summary:{...this.summary},byRequest:new Map(this.byRequest),overall:{...this.overall},errors:e}}getSerializableStatistics(){let e=this.getStatistics();return{summary:e.summary,byRequest:Array.from(e.byRequest.values()),overall:e.overall,errors:e.errors}}};$C();sa();import*as Rs from"fs";import*as el from"path";var Tx=class{constructor(e){this.collectionService=e}collectionService;suite;suiteDir;setSuite(e){this.suite=e}setSuiteDir(e){this.suiteDir=e}getSuite(){return this.suite}loadSuiteRequest(e){if(!this.suiteDir)return;let r=el.join(this.suiteDir,e,"request.json");if(Rs.existsSync(r))try{let n=JSON.parse(Rs.readFileSync(r,"utf-8")),i=el.join(this.suiteDir,e,"scripts"),s=Ch(i);return s&&(n.scripts=s),n}catch(n){console.error(`[TestSuiteStore] Failed to load request from ${e}:`,n);return}}saveSuiteRequest(e,r){if(!this.suiteDir)return;let n=el.join(this.suiteDir,e);Rs.mkdirSync(n,{recursive:!0});let i=r.scripts,s={...r};if(delete s.scripts,Rs.writeFileSync(el.join(n,"request.json"),JSON.stringify(s,null,2),"utf-8"),i){let o=el.join(n,"scripts");xh(o,{preRequest:i.preRequest||void 0,postResponse:i.postResponse||void 0})}}hasEmbeddedRequest(e){return!this.suiteDir||!e?!1:Rs.existsSync(el.join(this.suiteDir,e,"request.json"))}resolveRequest(e){let r=e.slug?this.loadSuiteRequest(e.slug):void 0,n=this.collectionService.getCollection(e.collectionId);if(r){let s,o=[],l=[];if(n){s=n.scripts;let f=this.findRequestInCollection(n,e.requestId);f&&(o=f.folderScriptsChain,l=f.folderAuthChain)}return{request:r,suiteRequest:e,collectionScripts:s,collectionAuth:n?.auth,folderScriptsChain:o,folderAuthChain:l}}if(!n){console.warn(`[TestSuiteStore] Collection not found: ${e.collectionId}`);return}let i=this.findRequestInCollection(n,e.requestId);if(!i){console.warn(`[TestSuiteStore] Request not found: ${e.requestId}`);return}return{request:i.request,suiteRequest:e,collectionScripts:n.scripts,collectionAuth:n.auth,folderScriptsChain:i.folderScriptsChain,folderAuthChain:i.folderAuthChain}}findRequestInCollection(e,r,n=[]){let i=e.items||[];return this.searchItems(i,r,n)}searchItems(e,r,n,i=[]){for(let s of e)if(s.type==="folder"){let o=s;if(!o.items)continue;let l=o.scripts?[...n,o.scripts]:n,f=o.auth?[...i,o.auth]:i,c=this.searchItems(o.items||[],r,l,f);if(c)return c}else if(s.id===r)return{request:this.normalizeRequest(s),folderScriptsChain:n,folderAuthChain:i}}normalizeRequest(e){let{type:r,...n}=e;return n}normalizeKeyValues(e){return e?Array.isArray(e)?e.map(r=>({key:r.key||"",value:r.value||"",enabled:r.enabled!==!1})):typeof e=="object"?Object.entries(e).map(([r,n])=>({key:r,value:String(n||""),enabled:!0})):[]:[]}getRequestWithContext(e,r){if(!this.suite)return;let n=this.suite.requests.find(i=>i.collectionId===e&&i.requestId===r);if(n)return this.resolveRequest(n)}getRequestBySlug(e){if(!this.suite)return;let r=this.suite.requests.find(n=>n.slug===e);if(r)return this.resolveRequest(r)}getAllSuiteRequests(){if(!this.suite)return[];let e=[];for(let r of this.suite.requests){let n=this.resolveRequest(r);n&&e.push(n)}return e}getResolvedRequests(){if(!this.suite)return[];let e=[];for(let r of this.suite.requests){if(!r.slug){let i=this.suite.requests.map(s=>s.slug||"").filter(Boolean);r.slug=En(r.name||"request",i)}let n=this.resolveRequest(r);if(n){let i=this.collectionService.getCollection(r.collectionId);e.push({id:`${r.collectionId}:${r.requestId}`,collectionId:r.collectionId,requestId:r.requestId,name:n.request.name||"Unknown",method:n.request.method||"GET",url:n.request.url||"",collectionName:i?.name||"Unknown Collection",folderPath:r.folderPath||"",enabled:r.enabled!==!1,hasEmbeddedRequest:this.hasEmbeddedRequest(r.slug),slug:r.slug})}}return e}getSelectedRequests(e){let r=[];for(let n of e){let[i,s]=n.split(":"),o=this.suite?.requests.find(l=>l.collectionId===i&&l.requestId===s);if(o){let l=this.resolveRequest(o);l&&r.push(l)}}return r}addRequest(e,r){if(this.suite){if(this.suiteDir&&r){if(e.slug)e.slug=this.resolveUniqueSlug(e.slug);else{let n=this.suite.requests.map(i=>i.slug||"").filter(Boolean);e.slug=En(e.name||r.name||"request",n)}this.saveSuiteRequest(e.slug,r)}this.suite.requests.push(e)}}resolveUniqueSlug(e){if(!this.suite)return e;let r=new Set(this.suite.requests.map(i=>i.slug).filter(Boolean));if(!r.has(e))return e;let n=2;for(;r.has(`${e}-${n}`);)n++;return`${e}-${n}`}removeRequest(e){this.suite&&(this.suite.requests=this.suite.requests.filter(r=>r.requestId!==e))}reorderRequests(e){if(!this.suite)return;let r=new Map;for(let i of this.suite.requests)r.set(`${i.collectionId}:${i.requestId}`,i);let n=[];for(let i of e){let s=r.get(i);s&&n.push(s)}this.suite.requests=n}updateSuiteRequest(e,r){if(!this.suite||!this.suiteDir)return;this.saveSuiteRequest(e,r);let n=this.suite.requests.find(i=>i.slug===e);n&&(n.name=r.name||n.name,n.method=r.method||n.method)}resyncFromCollection(e){if(!this.suite||!this.suiteDir)return;let r=this.suite.requests.find(s=>s.slug===e);if(!r)return;let n=this.collectionService.getCollection(r.collectionId);if(!n)return;let i=this.findRequestInCollection(n,r.requestId);if(i)return this.saveSuiteRequest(e,i.request),r.name=i.request.name||r.name,r.method=i.request.method||r.method,i.request}};m0();xm();Rm();xC();EC();kC();qC();IC();OC();PC();kh();Th();$h();xn();export{Za as AmbiguousRefError,ly as AwsSecretResolver,uy as AzureKeyVaultResolver,eI as BODY_FILE_MAP,UC as CACHE_BUSTING_TOOLS,Sy as COLLECTION_INPUT_SCHEMA,ka as CONFIG_FILES,Wl as CollectionLoader,Bf as CollectionLoaderFactory,io as CollectionRequestExecutor,Vf as CollectionService,no as ConfigService,Jc as CookieJar,Wf as CookieService,ht as CookieUtils,Yt as DEFAULT_CONFIG,Qn as DEFAULT_REQUEST_SETTINGS,Gd as DEFAULT_SUITE_CONFIG,hI as DYNAMIC_VARIABLES,Oa as DataFileParser,py as DopplerResolver,Gf as EnvironmentConfigService,rs as EnvironmentResolver,Pu as ExampleGenerator,wy as FOLDER_INPUT_SCHEMA,Lf as FetchHttpClient,Wc as FolderCollectionLoader,zs as FolderCollectionStore,s0 as ForgeContainer,Gs as ForgeEnv,J as GENERIC_TOOL_NAMES,dy as GcpSecretResolver,Kf as GraphQLSchemaService,ux as HTTP_METHOD_MAP,Eo as HTTP_METHOD_REVERSE,cy as HashiCorpVaultResolver,vu as HistoryAnalyzer,np as HtmlReportGenerator,Ia as HttpForgeParser,is as HttpRequestService,Ku as InMemoryCookieJar,ss as InterceptorChain,ec as JUnitReportGenerator,yu as JsonCollectionLoader,aS as LoggingRequestInterceptor,Ry as MCP_PROMPTS,Pr as METADATA_FILES,tp as McpRunStore,gm as ModuleLoader,jf as NodeFileSystem,pa as NodeHttpClient,Uf as OAuth2TokenManager,fy as OnePasswordResolver,ku as OpenApiExporter,Ro as OpenApiImporter,zc as ParserRegistry,zf as PersistentCookieJar,by as REQUEST_INPUT_SCHEMA,Pa as ROOT_DIRECTORIES,zu as RefResolver,pu as RequestExecutor,Xf as RequestHistoryService,Df as RequestHistoryStore,Yf as RequestPreparer,Ea as RequestPreprocessor,Mf as RequestScriptSession,nc as ResultStorageService,uS as RetryErrorInterceptor,Vc as SCHEMA_FILES,cn as SCRIPTS_DIR,Rh as SCRIPT_FILES,_y as SUITE_INPUT_SCHEMA,Ju as SchemaInferenceService,yo as SchemaInferrer,Gu as ScriptAnalyzer,cs as ScriptExecutor,Jd as SecretResolverRegistry,za as ServiceContainer,ne as ServiceIdentifiers,Px as StatisticsService,Yd as TestSuiteService,Tx as TestSuiteStore,lS as TimingResponseInterceptor,Kn as UrlBuilder,da as VariableInterpolator,fa as VariableResolver,DC as applyEnvSuggestionsToItems,Iz as applyExtractionPlan,Qc as applyFilterChain,la as augmentWithDynamicVars,eN as bootstrapNodeRuntime,ex as buildCollectionToolDescription,GC as buildCollectionToolName,Ez as buildExtractionPlan,tx as buildFolderToolDescription,YC as buildFolderToolName,jC as buildGenericTools,ox as buildMcpToolList,VC as buildPromptResult,XC as buildRequestToolDescription,JC as buildRequestToolName,Qu as buildResultFileName,rx as buildSuiteToolDescription,KC as buildSuiteToolName,nI as cleanupOldBodyFiles,Sm as concatenateScripts,TC as countRequests,Af as createExpectChain,Xq as createLodashShim,U5 as createMcpRuntime,Kw as createModuleLoader,ym as createMomentShim,Nn as createNodeContainer,vm as createResponseObject,nz as createScriptConsole,Xw as createTestFunction,f2 as createVariableResolver,sx as decodeCursor,B$ as decodeFolderName,bs as decodeFolderPath,nx as dedupeToolsByName,qj as deepClone,Zb as deleteItemFromTree,vy as detectEnvSuggestions,xz as detectSensitiveData,HC as dispatchGenericTool,ix as encodeCursor,wr as encodeFolderName,X5 as enhanceCollection,Zr as enumerateFolders,ca as evaluateExpression,m5 as expandSummary,fz as exportCollectionToRestClient,Qb as findItemById,Xe as flattenRequests,Tj as formatBytes,du as formatConsoleOutput,Aj as formatDuration,St as generateId,En as generateSlug,Kb as generateUUID,u7 as getCompletions,cz as getRestClientExportFolder,W$ as getServiceContainer,$f as hasChanged,ua as isExpression,kj as isPlainObject,Oh as isSystemEnvironmentFile,Gc as loadEnvironmentsFromFolder,Ga as mcpToolSegment,ws as mcpToolToken,Bc as mergeHeadersCaseInsensitive,sS as mergeRequestSettings,my as normalizeFolderInput,e0 as normalizeHeaders,Z5 as parseCurlCommand,Kc as parseFilterChain,QC as parseMcpToolName,Im as parsePostmanEnvironment,wz as parsePostmanEnvironmentFile,l7 as parseQueryContext,rI as prepareBodyForSave,tI as readBodyFromDir,iI as readSchemaFile,Ch as readScriptsFromDir,w0 as redactBody,R0 as redactFullResponse,C0 as redactFullResultDetails,ki as redactHeaders,_0 as redactHistoryEntry,Pm as redactUrl,yy as registerCoreServices,yx as resolveCollectionRef,ns as resolveDynamicVariable,r2 as resolveDynamicVariablesInString,vx as resolveFolderRef,ZC as resolveFolderToken,bx as resolveRequestRef,Yu as resolveToken,B5 as runCollection,V5 as runFolder,H5 as runRequest,W5 as runSuite,Pj as safeJsonParse,At as sanitizeName,i7 as scanCollectionForEnvVarsWithAi,Xb as searchForItemPath,eS as searchForItemPathById,oI as sortItemsByOrder,gu as writeEnvFile,Cm as writeFolderItems,sI as writeSchemaFiles,Hf as writeScriptFile,xh as writeScriptsToDir};
1057
+ }`),{label:t.name,kind:"field",detail:t.type,description:t.description,insertText:s,deprecated:t.isDeprecated,sortOrder:e}}function y7(t){return t.replace(/"""[\s\S]*?"""/g,'""').replace(/"(?:[^"\\]|\\.)*"/g,'""').replace(/#[^\n]*/g,"")}function qx(t,e,r){let n=0;for(let i of t)i===e?n++:i===r&&n--;return n}function CN(t){return qx(t,"(",")")>0}function v7(t){if(qx(t,"(",")")<=0)return!1;let r=t.indexOf("{"),n=r>=0?t.slice(0,r):t;return/\$\w+\s*:\s*\w*$/.test(n)}function xN(t){let e=0;for(let r=t.length-1;r>=0;r--)if(t[r]===")")e++;else if(t[r]==="("){if(e===0){let i=t.slice(0,r).trimEnd().match(/(\w+)$/);return i?i[1]:null}e--}return null}function Ox(t,e){if(!e)return[];let r=[],n=e.queryType,i=t.match(/\b(query|mutation|subscription)\b/);i&&(i[1]==="mutation"&&e.mutationType?n=e.mutationType:i[1]==="subscription"&&e.subscriptionType&&(n=e.subscriptionType)),r.push(n);let s=b7(t),o=e.types.get(n);for(let l=0;l<s.length;l++){let f=s[l];if(f!=="{"){if(f==="}"){r.pop(),o=r.length>0?e.types.get(r[r.length-1]):void 0;continue}if(l+1<s.length&&(s[l+1]==="{"||s[l+1]==="(")){let c=l+1;if(s[c]==="("){let p=1;for(c++;c<s.length&&p>0;)s[c]==="("?p++:s[c]===")"&&p--,c++}if(c<s.length&&s[c]==="{"&&o){let p=o.fields.find(h=>h.name===f);if(p){let h=p.type.replace(/[!\[\]]/g,"");r.push(h),o=e.types.get(h)}}}}}return r}function b7(t){let e=[],r=/([a-zA-Z_]\w*|[{}(),:=@!$\[\].]|\.\.\.|"[^"]*"|\d+)/g,n;for(;(n=r.exec(t))!==null;)e.push(n[1]);return e}v0();lR();E0();_C();kg();CC();RC();aR();oy();d0();Em();hx();AC();fx();rp();mx();function Ay(t,e){if(t.length===0)return 0;let r=Math.ceil(e/100*t.length)-1;return t[Math.max(0,r)]}function kx(t){return{name:t,count:0,passed:0,failed:0,skipped:0,min:0,max:0,avg:0,p50:0,p90:0,p95:0,p99:0,durations:[]}}function IN(t){if(t.durations.length===0){t.min=0,t.max=0,t.avg=0,t.p50=0,t.p90=0,t.p95=0,t.p99=0;return}let e=[...t.durations].sort((n,i)=>n-i),r=t.durations.reduce((n,i)=>n+i,0);t.min=e[0],t.max=e[e.length-1],t.avg=Math.round(r/t.durations.length),t.p50=Ay(e,50),t.p90=Ay(e,90),t.p95=Ay(e,95),t.p99=Ay(e,99)}var Px=class{summary;byRequest;overall;errors;startTime=0;constructor(){this.summary=this.createEmptySummary(),this.byRequest=new Map,this.overall=kx("Overall"),this.errors=new Map}createEmptySummary(){return{totalRequests:0,passed:0,failed:0,skipped:0,passRate:0,duration:0,isRunning:!1}}start(){this.startTime=Date.now(),this.summary.isRunning=!0}reset(){this.summary=this.createEmptySummary(),this.byRequest.clear(),this.overall=kx("Overall"),this.errors.clear(),this.startTime=0}complete(){this.summary.isRunning=!1,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime)}addResult(e,r,n,i,s){this.summary.totalRequests++,i?this.summary.skipped++:n?this.summary.passed++:this.summary.failed++;let o=this.summary.passed+this.summary.failed;if(this.summary.passRate=o>0?Math.round(this.summary.passed/o*1e3)/10:0,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime),i)return;this.byRequest.has(e)||this.byRequest.set(e,kx(e));let l=this.byRequest.get(e);if(l.count++,n?l.passed++:l.failed++,l.durations.push(r),IN(l),this.overall.count++,n?this.overall.passed++:this.overall.failed++,this.overall.durations.push(r),IN(this.overall),s){let f=this.errors.get(s)||0;this.errors.set(s,f+1)}}getStatistics(){let e=[];return this.errors.forEach((r,n)=>{e.push({message:n,count:r})}),e.sort((r,n)=>n.count-r.count),{summary:{...this.summary},byRequest:new Map(this.byRequest),overall:{...this.overall},errors:e}}getSerializableStatistics(){let e=this.getStatistics();return{summary:e.summary,byRequest:Array.from(e.byRequest.values()),overall:e.overall,errors:e.errors}}};$C();oa();import*as Rs from"fs";import*as el from"path";var Tx=class{constructor(e){this.collectionService=e}collectionService;suite;suiteDir;setSuite(e){this.suite=e}setSuiteDir(e){this.suiteDir=e}getSuite(){return this.suite}loadSuiteRequest(e){if(!this.suiteDir)return;let r=el.join(this.suiteDir,e,"request.json");if(Rs.existsSync(r))try{let n=JSON.parse(Rs.readFileSync(r,"utf-8")),i=el.join(this.suiteDir,e,"scripts"),s=Ch(i);return s&&(n.scripts=s),n}catch(n){console.error(`[TestSuiteStore] Failed to load request from ${e}:`,n);return}}saveSuiteRequest(e,r){if(!this.suiteDir)return;let n=el.join(this.suiteDir,e);Rs.mkdirSync(n,{recursive:!0});let i=r.scripts,s={...r};if(delete s.scripts,Rs.writeFileSync(el.join(n,"request.json"),JSON.stringify(s,null,2),"utf-8"),i){let o=el.join(n,"scripts");xh(o,{preRequest:i.preRequest||void 0,postResponse:i.postResponse||void 0})}}hasEmbeddedRequest(e){return!this.suiteDir||!e?!1:Rs.existsSync(el.join(this.suiteDir,e,"request.json"))}resolveRequest(e){let r=e.slug?this.loadSuiteRequest(e.slug):void 0,n=this.collectionService.getCollection(e.collectionId);if(r){let s,o=[],l=[];if(n){s=n.scripts;let f=this.findRequestInCollection(n,e.requestId);f&&(o=f.folderScriptsChain,l=f.folderAuthChain)}return{request:r,suiteRequest:e,collectionScripts:s,collectionAuth:n?.auth,folderScriptsChain:o,folderAuthChain:l}}if(!n){console.warn(`[TestSuiteStore] Collection not found: ${e.collectionId}`);return}let i=this.findRequestInCollection(n,e.requestId);if(!i){console.warn(`[TestSuiteStore] Request not found: ${e.requestId}`);return}return{request:i.request,suiteRequest:e,collectionScripts:n.scripts,collectionAuth:n.auth,folderScriptsChain:i.folderScriptsChain,folderAuthChain:i.folderAuthChain}}findRequestInCollection(e,r,n=[]){let i=e.items||[];return this.searchItems(i,r,n)}searchItems(e,r,n,i=[]){for(let s of e)if(s.type==="folder"){let o=s;if(!o.items)continue;let l=o.scripts?[...n,o.scripts]:n,f=o.auth?[...i,o.auth]:i,c=this.searchItems(o.items||[],r,l,f);if(c)return c}else if(s.id===r)return{request:this.normalizeRequest(s),folderScriptsChain:n,folderAuthChain:i}}normalizeRequest(e){let{type:r,...n}=e;return n}normalizeKeyValues(e){return e?Array.isArray(e)?e.map(r=>({key:r.key||"",value:r.value||"",enabled:r.enabled!==!1})):typeof e=="object"?Object.entries(e).map(([r,n])=>({key:r,value:String(n||""),enabled:!0})):[]:[]}getRequestWithContext(e,r){if(!this.suite)return;let n=this.suite.requests.find(i=>i.collectionId===e&&i.requestId===r);if(n)return this.resolveRequest(n)}getRequestBySlug(e){if(!this.suite)return;let r=this.suite.requests.find(n=>n.slug===e);if(r)return this.resolveRequest(r)}getAllSuiteRequests(){if(!this.suite)return[];let e=[];for(let r of this.suite.requests){let n=this.resolveRequest(r);n&&e.push(n)}return e}getResolvedRequests(){if(!this.suite)return[];let e=[];for(let r of this.suite.requests){if(!r.slug){let i=this.suite.requests.map(s=>s.slug||"").filter(Boolean);r.slug=En(r.name||"request",i)}let n=this.resolveRequest(r);if(n){let i=this.collectionService.getCollection(r.collectionId);e.push({id:`${r.collectionId}:${r.requestId}`,collectionId:r.collectionId,requestId:r.requestId,name:n.request.name||"Unknown",method:n.request.method||"GET",url:n.request.url||"",collectionName:i?.name||"Unknown Collection",folderPath:r.folderPath||"",enabled:r.enabled!==!1,hasEmbeddedRequest:this.hasEmbeddedRequest(r.slug),slug:r.slug})}}return e}getSelectedRequests(e){let r=[];for(let n of e){let[i,s]=n.split(":"),o=this.suite?.requests.find(l=>l.collectionId===i&&l.requestId===s);if(o){let l=this.resolveRequest(o);l&&r.push(l)}}return r}addRequest(e,r){if(this.suite){if(this.suiteDir&&r){if(e.slug)e.slug=this.resolveUniqueSlug(e.slug);else{let n=this.suite.requests.map(i=>i.slug||"").filter(Boolean);e.slug=En(e.name||r.name||"request",n)}this.saveSuiteRequest(e.slug,r)}this.suite.requests.push(e)}}resolveUniqueSlug(e){if(!this.suite)return e;let r=new Set(this.suite.requests.map(i=>i.slug).filter(Boolean));if(!r.has(e))return e;let n=2;for(;r.has(`${e}-${n}`);)n++;return`${e}-${n}`}removeRequest(e){this.suite&&(this.suite.requests=this.suite.requests.filter(r=>r.requestId!==e))}reorderRequests(e){if(!this.suite)return;let r=new Map;for(let i of this.suite.requests)r.set(`${i.collectionId}:${i.requestId}`,i);let n=[];for(let i of e){let s=r.get(i);s&&n.push(s)}this.suite.requests=n}updateSuiteRequest(e,r){if(!this.suite||!this.suiteDir)return;this.saveSuiteRequest(e,r);let n=this.suite.requests.find(i=>i.slug===e);n&&(n.name=r.name||n.name,n.method=r.method||n.method)}resyncFromCollection(e){if(!this.suite||!this.suiteDir)return;let r=this.suite.requests.find(s=>s.slug===e);if(!r)return;let n=this.collectionService.getCollection(r.collectionId);if(!n)return;let i=this.findRequestInCollection(n,r.requestId);if(i)return this.saveSuiteRequest(e,i.request),r.name=i.request.name||r.name,r.method=i.request.method||r.method,i.request}};m0();xm();Rm();xC();EC();kC();qC();IC();OC();PC();kh();Th();$h();xn();export{Za as AmbiguousRefError,ly as AwsSecretResolver,uy as AzureKeyVaultResolver,eI as BODY_FILE_MAP,UC as CACHE_BUSTING_TOOLS,Sy as COLLECTION_INPUT_SCHEMA,Pa as CONFIG_FILES,Wl as CollectionLoader,Bf as CollectionLoaderFactory,so as CollectionRequestExecutor,Vf as CollectionService,io as ConfigService,Jc as CookieJar,Wf as CookieService,ht as CookieUtils,Qt as DEFAULT_CONFIG,Qn as DEFAULT_REQUEST_SETTINGS,Gd as DEFAULT_SUITE_CONFIG,hI as DYNAMIC_VARIABLES,qa as DataFileParser,py as DopplerResolver,Gf as EnvironmentConfigService,rs as EnvironmentResolver,Pu as ExampleGenerator,wy as FOLDER_INPUT_SCHEMA,Lf as FetchHttpClient,Wc as FolderCollectionLoader,zs as FolderCollectionStore,s0 as ForgeContainer,Gs as ForgeEnv,J as GENERIC_TOOL_NAMES,dy as GcpSecretResolver,Kf as GraphQLSchemaService,ux as HTTP_METHOD_MAP,Io as HTTP_METHOD_REVERSE,cy as HashiCorpVaultResolver,vu as HistoryAnalyzer,np as HtmlReportGenerator,Oa as HttpForgeParser,is as HttpRequestService,Ku as InMemoryCookieJar,ss as InterceptorChain,ec as JUnitReportGenerator,yu as JsonCollectionLoader,aS as LoggingRequestInterceptor,Ry as MCP_PROMPTS,Pr as METADATA_FILES,tp as McpRunStore,gm as ModuleLoader,jf as NodeFileSystem,ha as NodeHttpClient,Uf as OAuth2TokenManager,fy as OnePasswordResolver,ku as OpenApiExporter,Co as OpenApiImporter,zc as ParserRegistry,zf as PersistentCookieJar,by as REQUEST_INPUT_SCHEMA,no as ROOT_DIRECTORIES,zu as RefResolver,pu as RequestExecutor,Xf as RequestHistoryService,Df as RequestHistoryStore,Yf as RequestPreparer,Ia as RequestPreprocessor,Mf as RequestScriptSession,nc as ResultStorageService,uS as RetryErrorInterceptor,Vc as SCHEMA_FILES,cn as SCRIPTS_DIR,Rh as SCRIPT_FILES,_y as SUITE_INPUT_SCHEMA,Ju as SchemaInferenceService,vo as SchemaInferrer,Gu as ScriptAnalyzer,cs as ScriptExecutor,Jd as SecretResolverRegistry,za as ServiceContainer,ne as ServiceIdentifiers,Px as StatisticsService,Yd as TestSuiteService,Tx as TestSuiteStore,lS as TimingResponseInterceptor,Kn as UrlBuilder,pa as VariableInterpolator,da as VariableResolver,DC as applyEnvSuggestionsToItems,Iz as applyExtractionPlan,Qc as applyFilterChain,ua as augmentWithDynamicVars,eN as bootstrapNodeRuntime,ex as buildCollectionToolDescription,GC as buildCollectionToolName,Ez as buildExtractionPlan,tx as buildFolderToolDescription,YC as buildFolderToolName,jC as buildGenericTools,ox as buildMcpToolList,VC as buildPromptResult,XC as buildRequestToolDescription,JC as buildRequestToolName,Qu as buildResultFileName,rx as buildSuiteToolDescription,KC as buildSuiteToolName,nI as cleanupOldBodyFiles,Sm as concatenateScripts,TC as countRequests,Af as createExpectChain,Xq as createLodashShim,U5 as createMcpRuntime,Kw as createModuleLoader,ym as createMomentShim,Nn as createNodeContainer,vm as createResponseObject,nz as createScriptConsole,Xw as createTestFunction,f2 as createVariableResolver,sx as decodeCursor,B$ as decodeFolderName,bs as decodeFolderPath,nx as dedupeToolsByName,qj as deepClone,Zb as deleteItemFromTree,vy as detectEnvSuggestions,xz as detectSensitiveData,HC as dispatchGenericTool,ix as encodeCursor,wr as encodeFolderName,X5 as enhanceCollection,Zr as enumerateFolders,fa as evaluateExpression,m5 as expandSummary,fz as exportCollectionToRestClient,Qb as findItemById,Xe as flattenRequests,Tj as formatBytes,du as formatConsoleOutput,Aj as formatDuration,St as generateId,En as generateSlug,Kb as generateUUID,u7 as getCompletions,cz as getRestClientExportFolder,W$ as getServiceContainer,$f as hasChanged,ca as isExpression,kj as isPlainObject,Oh as isSystemEnvironmentFile,Gc as loadEnvironmentsFromFolder,Ga as mcpToolSegment,ws as mcpToolToken,Bc as mergeHeadersCaseInsensitive,sS as mergeRequestSettings,my as normalizeFolderInput,e0 as normalizeHeaders,Z5 as parseCurlCommand,Kc as parseFilterChain,QC as parseMcpToolName,Im as parsePostmanEnvironment,wz as parsePostmanEnvironmentFile,l7 as parseQueryContext,rI as prepareBodyForSave,tI as readBodyFromDir,iI as readSchemaFile,Ch as readScriptsFromDir,w0 as redactBody,R0 as redactFullResponse,C0 as redactFullResultDetails,ki as redactHeaders,_0 as redactHistoryEntry,Pm as redactUrl,yy as registerCoreServices,yx as resolveCollectionRef,ns as resolveDynamicVariable,r2 as resolveDynamicVariablesInString,vx as resolveFolderRef,ZC as resolveFolderToken,bx as resolveRequestRef,Yu as resolveToken,B5 as runCollection,V5 as runFolder,H5 as runRequest,W5 as runSuite,Pj as safeJsonParse,$t as sanitizeName,i7 as scanCollectionForEnvVarsWithAi,Xb as searchForItemPath,eS as searchForItemPathById,oI as sortItemsByOrder,gu as writeEnvFile,Cm as writeFolderItems,sI as writeSchemaFiles,Hf as writeScriptFile,xh as writeScriptsToDir};