@http-forge/core 0.4.6 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -1
- package/dist/index.js +156 -156
- package/dist/index.mjs +156 -156
- package/dist/infrastructure/config/config-service.d.ts +1 -0
- package/dist/infrastructure/config/config.interface.d.ts +8 -0
- package/dist/infrastructure/environment/variable-interpolator.d.ts +24 -1
- package/dist/infrastructure/execution/request-executor.d.ts +1 -0
- package/dist/infrastructure/script/async-drain.d.ts +53 -0
- package/dist/infrastructure/script/request-script-session.d.ts +8 -1
- package/dist/infrastructure/script/script-executor.d.ts +6 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var tL=Object.create;var Hp=Object.defineProperty;var rL=Object.getOwnPropertyDescriptor;var nL=Object.getOwnPropertyNames;var iL=Object.getPrototypeOf,sL=Object.prototype.hasOwnProperty;var it=(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 ae=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var F=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},ks=(t,e)=>{for(var r in e)Hp(t,r,{get:e[r],enumerable:!0})},FC=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of nL(e))!sL.call(t,i)&&i!==r&&Hp(t,i,{get:()=>e[i],enumerable:!(n=rL(e,i))||n.enumerable});return t};var ab=(t,e,r)=>(r=t!=null?tL(iL(t)):{},FC(e||!t||!t.__esModule?Hp(r,"default",{value:t,enumerable:!0}):r,t)),vl=t=>FC(Hp({},"__esModule",{value:!0}),t);function It(t){return t.replace(/[^a-zA-Z0-9-_]/g,"_").replace(/\s+/g,"-").toLowerCase().substring(0,100)}function ft(t){let e=Date.now().toString(36)+(oL++).toString(36)+Math.random().toString(36).slice(2,7);return t?`${It(t)}_${e}`:e}function lb(){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 yu(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 aL(t){return JSON.parse(JSON.stringify(t))}function lL(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function cL(t,e){try{return JSON.parse(t)}catch{return e}}function uL(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 fL(t){return t<1e3?`${t} ms`:`${(t/1e3).toFixed(2)} s`}var oL,yn=ae(()=>{"use strict";oL=0});import*as Xe from"fs";import*as en from"path";function Vp(t){if(!Xe.existsSync(t))return;let e={},r=en.join(t,Bp.preRequest);Xe.existsSync(r)&&(e.preRequest=Xe.readFileSync(r,"utf-8"));let n=en.join(t,Bp.postResponse);return Xe.existsSync(n)&&(e.postResponse=Xe.readFileSync(n,"utf-8")),Object.keys(e).length>0?e:void 0}async function Wp(t,e){await Xe.promises.mkdir(t,{recursive:!0});let r=en.join(t,Bp.preRequest);e.preRequest?await Xe.promises.writeFile(r,e.preRequest,"utf-8"):Xe.existsSync(r)&&await Xe.promises.unlink(r);let n=en.join(t,Bp.postResponse);e.postResponse?await Xe.promises.writeFile(n,e.postResponse,"utf-8"):Xe.existsSync(n)&&await Xe.promises.unlink(n)}function jC(t){for(let[e,r]of Object.entries(LC)){let n=en.join(t,e);if(Xe.existsSync(n))try{let i=Xe.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 UC(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 HC(t,e){for(let r of Object.keys(LC))if(r!==e){let n=en.join(t,r);if(Xe.existsSync(n))try{await Xe.promises.unlink(n)}catch{}}}function BC(t){if(Xe.existsSync(t))try{let e=Xe.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){console.error(`[FolderIO] Failed to load schema file ${t}:`,e);return}}async function VC(t,e,r){let n=en.join(t,vu.responseSchema),i=en.join(t,vu.bodySchema);e?await Xe.promises.writeFile(n,JSON.stringify(e,null,2),"utf-8"):Xe.existsSync(n)&&await Xe.promises.unlink(n),r?await Xe.promises.writeFile(i,JSON.stringify(r,null,2),"utf-8"):Xe.existsSync(i)&&await Xe.promises.unlink(i)}function cb(t,e){for(let r of t){if(r.id===e)return r;if(r.type==="folder"&&r.items){let n=cb(r.items,e);if(n)return n}}}function ub(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&&ub(n.items,e))return!0}return!1}function WC(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 fb(t,e){let r;try{r=Xe.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===tn)continue;if(n.name===e)return en.join(t,n.name);let i=fb(en.join(t,n.name),e);if(i)return i}}function dL(t){for(let e of[Rr.request,Rr.folder]){let r=en.join(t,e);if(Xe.existsSync(r))try{let n=Xe.readFileSync(r,"utf-8");return JSON.parse(n).id}catch{return}}}function db(t,e){let r;try{r=Xe.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===tn)continue;let i=en.join(t,n.name);if(dL(i)===e)return i;let s=db(i,e);if(s)return s}}function vn(t,e=[]){let r=t.toLowerCase().trim(),n=r.match(/^(get|post|put|patch|delete|head|options)[_\s-]/i),i=n?n[1]:"",s=r.match(/t(\d+)/gi)||[],o=0;for(let y of s){let w=parseInt(y.substring(1));w>o&&(o=w)}let l="";if(o>0)l=`t${o}`;else{let y=r.match(/[_\s-](\d+\.\d+)[_\s-]/);y&&(l=`v${y[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 d=f.split("-").filter(y=>y.length>0),m=[];i&&m.push(i),m.push(...d),l&&m.push(l);let g=m.join("-");if(g||(g="item"),e.includes(g)){let y=2;for(;e.includes(`${g}-${y}`);)y++;g=`${g}-${y}`}return g}var Bp,Rr,LC,vu,tn,Fo=ae(()=>{"use strict";Bp={preRequest:"pre-request.js",postResponse:"post-response.js"},Rr={collection:"collection.json",folder:"folder.json",request:"request.json"},LC={"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"}},vu={responseSchema:"response.schema.json",bodySchema:"body.schema.json"},tn="scripts"});import*as xe from"fs";import*as Pe from"path";var Ts,zp=ae(()=>{"use strict";yn();Fo();Ts=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(){xe.existsSync(this.collectionsDir)||xe.mkdirSync(this.collectionsDir,{recursive:!0})}readJsonFileSafe(e,r){let n;try{n=xe.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(),!xe.existsSync(this.collectionsDir))return[];let e=xe.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=Pe.join(this.collectionsDir,e),n=Pe.join(r,Rr.collection);if(!xe.existsSync(n))return;let i=this.readJsonFileSafe(n,"collection");if(i)try{let s=this.loadScriptsFromDir(Pe.join(r,tn)),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=xe.readdirSync(e,{withFileTypes:!0});for(let l of o){if(!l.isDirectory()||l.name===tn)continue;let f=Pe.join(e,l.name);if(xe.existsSync(Pe.join(f,Rr.folder))){let d=this.loadFolderFromDir(f,l.name);d&&s.set(l.name,d)}else if(xe.existsSync(Pe.join(f,Rr.request))){let d=this.loadRequestFromDir(f,l.name);d&&s.set(l.name,d)}}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=Pe.join(e,Rr.folder),i=this.readJsonFileSafe(n,"folder");if(i)try{let s=this.loadScriptsFromDir(Pe.join(e,tn)),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=Pe.join(e,Rr.request),i=this.readJsonFileSafe(n,"request");if(i)try{let s=this.loadScriptsFromDir(Pe.join(e,tn)),o=i.body,l=this.loadBodyFromDir(e);l&&(o=l);let f=this.loadSchemaFile(Pe.join(e,vu.responseSchema)),d=this.loadSchemaFile(Pe.join(e,vu.bodySchema)),m=Pe.join(e,"doc.md"),g=xe.existsSync(m)?xe.readFileSync(m,"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,...g&&{doc:g},...f&&{responseSchema:f},...d&&{bodySchema:d}}}catch(s){console.error(`[FolderCollectionStore] Failed to load request ${e}:`,s);return}}loadScriptsFromDir(e){return Vp(e)}loadBodyFromDir(e){return jC(e)}loadSchemaFile(e){return BC(e)}async saveSchemaFiles(e,r){return VC(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=ft(e.name));let r=this.idToSlugMap.get(e.id);if(!r){let l=xe.readdirSync(this.collectionsDir);r=vn(e.name,l),this.idToSlugMap.set(e.id,r),this.slugToIdMap.set(r,e.id)}let n=Pe.join(this.collectionsDir,r),i=!xe.existsSync(n);await xe.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(Pe.join(n,tn),e.scripts):Promise.resolve()]);o.length>0&&(s.order=o),await xe.promises.writeFile(Pe.join(n,Rr.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=vn(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=Pe.join(e,l);await xe.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(Pe.join(e,tn),r.scripts):Promise.resolve()]);s.length>0&&(i.order=s),await xe.promises.writeFile(Pe.join(e,Rr.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}},l=[xe.promises.writeFile(Pe.join(e,Rr.request),JSON.stringify(o,null,2),"utf-8")];s&&l.push(xe.promises.writeFile(Pe.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(xe.promises.writeFile(Pe.join(e,"doc.md"),r.doc,"utf-8")),r.scripts&&l.push(this.saveScriptsToDir(Pe.join(e,tn),r.scripts)),await Promise.all(l)}prepareBodyForSave(e){return UC(e)}async cleanupOldBodyFiles(e,r){return HC(e,r)}async saveScriptsToDir(e,r){return Wp(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=Pe.join(this.collectionsDir,r);if(!xe.existsSync(n))return!1;try{return await xe.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?xe.existsSync(Pe.join(this.collectionsDir,r,Rr.collection)):!1}getCollectionPath(e){let r=this.idToSlugMap.get(e)||e;return Pe.join(this.collectionsDir,r)}getItemPath(e,r){return this.findItemPath(e,r)}async create(e,r){let n={id:r||ft(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(Pe.join(s,tn),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(Pe.join(n,tn))}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=Pe.join(this.collectionsDir,i),o=Pe.join(s,Rr.collection),l=xe.readFileSync(o,"utf-8"),d={...JSON.parse(l),...r,id:e};await xe.promises.writeFile(o,JSON.stringify(d,null,2),"utf-8"),r.name!==void 0&&(n.name=r.name),r.description!==void 0&&(n.description=r.description),r.version!==void 0&&(n.version=r.version),r.variables!==void 0&&(n.variables=r.variables),r.auth!==void 0&&(n.auth=r.auth)}async saveItem(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.idToSlugMap.get(e);if(!s)throw new Error(`Collection slug not found for ${e}`);let o;if(n){let m=this.findItemPath(e,n);if(!m)throw new Error(`Parent folder ${n} not found`);o=m}else o=Pe.join(this.collectionsDir,s);let l=this.idToSlugMap.get(r.id);if(!l){let m=xe.readdirSync(o).filter(g=>xe.statSync(Pe.join(o,g)).isDirectory()&&g!==tn);l=vn(r.name,m),this.idToSlugMap.set(r.id,l),this.slugToIdMap.set(l,r.id)}let f=Pe.join(o,l);await xe.promises.mkdir(f,{recursive:!0}),r.type==="folder"?await this.saveFolderToDir(f,r):await this.saveRequestToDir(f,r);let d=this.findItemById(i.items,r.id);if(d)Object.assign(d,r);else if(n){let m=this.findItemById(i.items,n);m&&m.type==="folder"&&(m.items=m.items||[],m.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||!xe.existsSync(i))return!1;try{await xe.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:d,...m}=n;return Object.assign(o,m),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||!xe.existsSync(o))return!1;let l;if(n){let m=this.findItemPath(e,n);if(!m)return!1;l=m}else l=Pe.join(this.collectionsDir,s);let f=this.idToSlugMap.get(r);if(!f)return!1;let d=Pe.join(l,f);if(xe.existsSync(d))return!1;try{await xe.promises.rename(o,d);let m=this.findItemById(i.items,r);if(m){let g=m.type==="folder"?{...m,items:m.items?[...m.items]:[]}:{...m};if(this.deleteItemFromTree(i.items,r),n){let y=this.findItemById(i.items,n);y&&y.type==="folder"&&(y.items=y.items||[],y.items.push(g))}else i.items.push(g)}return!0}catch(m){return console.error(`[FolderCollectionStore] Failed to move item ${r}:`,m),!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=Pe.join(l,Rr.folder),d=xe.readFileSync(f,"utf-8"),m=JSON.parse(d);m.order=o,await xe.promises.writeFile(f,JSON.stringify(m,null,2),"utf-8");let g=this.findItemById(i.items,r);g&&g.type==="folder"&&g.items&&(g.items=this.sortItemsByOrder(g.items,n))}else{let l=Pe.join(this.collectionsDir,s,Rr.collection),f=xe.readFileSync(l,"utf-8"),d=JSON.parse(f);d.order=o,await xe.promises.writeFile(l,JSON.stringify(d,null,2),"utf-8"),i.items=this.sortItemsByOrder(i.items,n)}return!0}catch(l){return console.error("[FolderCollectionStore] Failed to reorder items:",l),!1}}sortItemsByOrder(e,r){return WC(e,r)}findItemPath(e,r){let n=this.idToSlugMap.get(e);if(!n)return;let i=Pe.join(this.collectionsDir,n),s=db(i,r);if(s)return s;let o=this.load(e);if(o){let f=this.buildSlugPath(o.items,r);if(f)return Pe.join(i,...f)}let l=this.idToSlugMap.get(r);if(l)return fb(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 cb(e,r)}deleteItemFromTree(e,r){return ub(e,r)}}});var dt,Sl=ae(()=>{"use strict";dt=class{static parseSetCookie(e,r){let n=e.split(";").map(m=>m.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(),d={name:l,value:f,domain:r};for(let m of s){let g=m.indexOf("="),y=(g===-1?m:m.substring(0,g)).toLowerCase(),w=g===-1?"":m.substring(g+1);switch(y){case"domain":d.domain=w.startsWith(".")?w.substring(1):w;break;case"path":d.path=w;break;case"expires":d.expires=w;break;case"max-age":d.maxAge=parseInt(w,10);break;case"httponly":d.httpOnly=!0;break;case"secure":d.secure=!0;break;case"samesite":d.sameSite=w;break}}return d}static parseCookieHeaders(e,r){let n=[],i=e["set-cookie"]||e["Set-Cookie"];if(!i)return n;let s=Array.isArray(i)?i:[i];for(let o of s){let l=this.parseSetCookie(o,r);l&&n.push(l)}return n}static formatCookieHeader(e){return e.map(r=>`${r.name}=${r.value}`).join("; ")}static isExpired(e){return!!(e.expires&&new Date(e.expires).getTime()<Date.now()||e.maxAge!==void 0&&e.maxAge<=0)}static domainMatches(e,r){if(r==="*")return!0;let n=e.toLowerCase().split(".").reverse(),i=r.toLowerCase().split(".").reverse();if(i.length>n.length)return!1;for(let s=0;s<i.length;s++)if(i[s]!==n[s])return!1;return!0}static extractDomain(e){try{return new URL(e).hostname}catch{return""}}static extractPath(e){try{return new URL(e).pathname}catch{return"/"}}}});import*as As from"fs";import*as Lo from"path";function Yp(t){let e=t.toLowerCase();return e==="_global.json"||e==="_global.local.json"||e.endsWith(".local.json")}function _u(t){if(!As.existsSync(t))return hL();let e=Jp(Lo.join(t,"_global.json"))||{},r=e.globalVariables||e.variables||{},n=e.defaultHeaders||{},i=As.readdirSync(t).filter(d=>d.endsWith(".json")).filter(d=>!d.endsWith(".local.json")).filter(d=>!Yp(d)),s={};for(let d of i){let m=Jp(Lo.join(t,d))||{},g=Lo.basename(d,".json");s[g]={description:m.description,requiresConfirmation:m.requiresConfirmation,variables:m.variables||{},secretVariables:m.secretVariables}}let l=(Jp(Lo.join(t,"_global.local.json"))||{}).variables||{},f={};for(let d of Object.keys(s)){let m=Lo.join(t,`${d}.local.json`);if(As.existsSync(m)){let g=Jp(m)||{};f[d]={variables:g.variables||{}}}}return{globalVariables:r,defaultHeaders:n,environments:s,localVariables:l,localCredentials:f}}function hL(){return{globalVariables:{},defaultHeaders:{},environments:{},localVariables:{},localCredentials:{}}}function Jp(t){try{if(!As.existsSync(t))return null;let e=As.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 Gp=ae(()=>{"use strict"});var Hn,wl=ae(()=>{"use strict";Hn=class{buildUrl(e,r={},n={}){let i=e;return i=this.replacePathParams(i,r),i=this.appendQueryParams(i,n),i}replacePathParams(e,r){let n="",i="",s=e,o="",l=e.indexOf("?");l!==-1&&(o=e.substring(l),s=e.substring(0,l));let f=s.match(/^(https?:\/\/)([^\/]*)(\/.*)?$/);f&&(n=f[1],i=f[2],s=f[3]||"/");let d=/:(\w+)(?:\([^)]*\))?(\?)?/g,m=s.replace(d,(g,y,w)=>{let C=r[y];return C!==void 0&&C!==""?encodeURIComponent(C):w?"":(console.warn(`[UrlBuilder] Missing required path parameter: ${y}`),g)});return m=m.replace(/([^:])\/+/g,"$1/"),m.length>1&&m.endsWith("/")&&(m=m.slice(0,-1)),`${n}${i}${m}${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,d]=e.split("?");n=f,d&&new URLSearchParams(d).forEach((g,y)=>{i[y]=g})}let s={...i,...r},o=new URLSearchParams;for(let[f,d]of Object.entries(s))d!=null&&o.append(f,d);let l=o.toString();return l?`${n}?${l}`:n}}});function JC(t,e=0){return(Zt[t[e+0]]+Zt[t[e+1]]+Zt[t[e+2]]+Zt[t[e+3]]+"-"+Zt[t[e+4]]+Zt[t[e+5]]+"-"+Zt[t[e+6]]+Zt[t[e+7]]+"-"+Zt[t[e+8]]+Zt[t[e+9]]+"-"+Zt[t[e+10]]+Zt[t[e+11]]+Zt[t[e+12]]+Zt[t[e+13]]+Zt[t[e+14]]+Zt[t[e+15]]).toLowerCase()}var Zt,YC=ae(()=>{Zt=[];for(let t=0;t<256;++t)Zt.push((t+256).toString(16).slice(1))});function mb(){return crypto.getRandomValues(mL)}var mL,GC=ae(()=>{mL=new Uint8Array(16)});function gL(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():yL(t,e,r)}function yL(t,e,r){t=t||{};let n=t.random??t.rng?.()??mb();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 JC(n)}var _l,KC=ae(()=>{GC();YC();_l=gL});var gb=ae(()=>{KC()});function vL(t=0,e=999){return Math.floor(Math.random()*(e-t+1))+t}function bL(){return Date.now()}function QC(){return _l()}function SL(){return _l()}function ZC(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 wL(){let t=ZC(8).toLowerCase(),e=["example.com","test.org","mail.dev","sample.net"];return`${t}@${e[Math.floor(Math.random()*e.length)]}`}function _L(){return Math.random()<.5}function RL(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 xL(){return Math.floor(Date.now()/1e3)}function CL(){return new Date().toISOString()}function EL(){return new Date().toISOString().split("T")[0]}function OL(){return new Date().toISOString().split("T")[1].split(".")[0]}function IL(){return new Date().toISOString()}function PL(t=""){return Buffer.from(String(t)).toString("base64")}function kL(t=""){return Buffer.from(String(t),"base64").toString("utf-8")}function TL(t=""){return encodeURIComponent(String(t))}function AL(t=""){return decodeURIComponent(String(t))}function qL(t){return t?t.split(",").map(e=>{let r=e.trim(),n=Number(r);return!isNaN(n)&&r!==""?n:r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'")?r.slice(1,-1):r}):[]}function Vi(t,e){let r=XC[t];return r?e&&e.length>0?r(...e):r():null}function $L(t){return!t||typeof t!="string"?t:t.replace(/\{\{\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?\}\}/g,(e,r,n)=>{try{let i=n?qL(n):void 0,s=Vi(r,i);return s===null?e:String(s)}catch{return e}})}function jo(t,e){let r=/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,n=null,i;for(;(i=r.exec(t))!==null;){let s=i[0],o=i[1];if(!(s in e)){let l=Vi(o);l!==null&&(n||(n={...e}),n[s]=l)}}return n??e}var XC,Kp=ae(()=>{"use strict";gb();XC={randomInt:vL,timestamp:bL,guid:SL,uuid:QC,randomUUID:QC,randomString:ZC,randomHexadecimal:RL,randomEmail:wL,randomBoolean:_L,isoTimestamp:IL,timestamp_s:xL,datetime:CL,date:EL,time:OL,base64Encode:PL,base64Decode:kL,urlEncode:TL,urlDecode:AL}});import*as Qp from"vm";function Uo(t){let e=t.trim();return!e||/^(\$?)[a-zA-Z_][a-zA-Z0-9_]*(\([^)]*\))?$/.test(e)||/(?<!\|)\|(?!\|)/.test(e)?!1:/[+\-*/%<>=!&|?:~^()[\]{}.,`]/.test(e)}function Ho(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=Qp.createContext(r);return Qp.runInContext(t,n,{timeout:ML,displayErrors:!1})}catch{return}}var ML,Zp=ae(()=>{"use strict";ML=100});import*as Xp from"crypto";function NL(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function xu(t){if(!t||!t.includes("|"))return null;let e=DL(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=FL(s);o&&n.push(o)}return n.length===0?null:{input:r,filters:n}}function DL(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]:"",d=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(d==="|"){r+="||",o++;continue}e.push(r),r="";continue}r+=l}return r&&e.push(r),e}function FL(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:LL(n)}}function LL(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 Pt(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=NL(e[t]),i=Number(n);return!isNaN(i)&&n!==""?i:n}return t}function Cu(t,e,r={}){let n=t;for(let i of e)n=jL(n,i.name,i.args,r);return n}function jL(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=Pt(r[0],n),s=r[1]!==void 0?Pt(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(Pt(r[0],n)):"",s=r[1]!==void 0?String(Pt(r[1],n)):"";return String(t).replace(new RegExp(HL(i),"g"),s)}case"split":{let i=r[0]!==void 0?String(Pt(r[0],n)):",";return String(t).split(i)}case"join":{let i=r[0]!==void 0?String(Pt(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(Pt(r[0],n)):"{0}";i=i.replace("{0}",String(t));for(let s=1;s<r.length;s++){let o=Pt(r[s],n);i=i.replace(`{${s}}`,String(o))}return i}case"add":{let i=Pt(r[0],n);return Number(t)+i}case"subtract":{let i=Pt(r[0],n);return Number(t)-i}case"multiply":{let i=Pt(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?Pt(r[0],n):"md5").toLowerCase(),s=String(r[1]!==void 0?Pt(r[1],n):"base64"),l={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[i]||"md5";return Xp.createHash(l).update(String(t)).digest(s)}case"hmac":{let i=r[0]?String(Pt(r[0],n)):"",s=String(r[1]!==void 0?Pt(r[1],n):"sha256").toLowerCase(),o=String(r[2]!==void 0?Pt(r[2],n):"base64"),f={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[s]||"sha256";return Xp.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=Pt(r[0],n);return Array.isArray(t)?t.at(i):t}case"slice":{let i=Pt(r[0],n),s=r[1]!==void 0?Pt(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:UL(t,r[0],n);case"map":{if(!Array.isArray(t))return t;let i=r.map(s=>String(Pt(s,n)));return i.length===1?t.map(s=>Ru(s,i[0])):t.map(s=>{let o={};for(let l of i){let f=Ru(s,l);f!==void 0&&(o[l]=f)}return o})}case"prop":{let i=r[0]!==void 0?String(Pt(r[0],n)):"";if(Array.isArray(t)){let s=t.map(o=>Ru(o,i)).filter(o=>o!==void 0);return s.length===1?s[0]:s.join(",")}return t&&typeof t=="object"?Ru(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 UL(t,e,r){let n=e.match(/^([\w.]+)\s*(>=|<=|!=|\*=|\^=|\$=|>|<|=)\s*(.+)$/);if(!n)return t;let[,i,s,o]=n,l=Pt(o,r);return t.filter(f=>{let d=Ru(f,i);if(d===void 0)return!1;switch(s){case">":return Number(d)>Number(l);case">=":return Number(d)>=Number(l);case"<":return Number(d)<Number(l);case"<=":return Number(d)<=Number(l);case"=":return String(d)===String(l);case"!=":return String(d)!==String(l);case"*=":return String(d).includes(String(l));case"^=":return String(d).startsWith(String(l));case"$=":return String(d).endsWith(String(l));default:return!0}})}function Ru(t,e){if(!(!t||typeof t!="object"))return e in t?t[e]:e.split(".").reduce((r,n)=>r?.[n],t)}function HL(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var eh=ae(()=>{"use strict"});function eE(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 BL(t){return new Bo(t)}var Bo,Vo,Eu=ae(()=>{"use strict";Kp();Zp();eh();Bo=class{allVariables;constructor(e){this.allVariables={...e.globals,...e.collectionVariables,...e.environmentVariables,...e.variables}}resolveString(e,r=!1){if(typeof e!="string")return e;if(!r)return e.replace(/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,(l,f)=>this.resolveTemplateContent(f.trim(),this.allVariables,l));let n="",i=0,s=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,o;for(;(o=s.exec(e))!==null;){let l=o[1].trim(),f=this.resolveTemplateContent(l,this.allVariables,o[0]);if(f!==o[0]){n+=e.slice(i,o.index);let d=this.getStringContext(e,o.index);n+=d?this.escapeForString(String(f),d):String(f)}else n+=e.slice(i,o.index+o[0].length);i=o.index+o[0].length}return n+=e.slice(i),n}resolveStringWithExtra(e,r,n=!1){if(typeof e!="string")return e;let i={...this.allVariables,...r};if(!n)return e.replace(/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,(d,m)=>this.resolveTemplateContent(m.trim(),i,d));let s="",o=0,l=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,f;for(;(f=l.exec(e))!==null;){let d=f[1].trim(),m=this.resolveTemplateContent(d,i,f[0]);if(m!==f[0]){s+=e.slice(o,f.index);let g=this.getStringContext(e,f.index);s+=g?this.escapeForString(String(m),g):String(m)}else s+=e.slice(o,f.index+f[0].length);o=f.index+f[0].length}return s+=e.slice(o),s}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=eE(i[2],r),f=Vi(i[1],l);return f!==null?String(f):n}let s=xu(e);if(s){let l=this.resolveFilterInput(s.input,r);if(l!==void 0){let f=Cu(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]),d=o[2],m=this.resolvePropertyAccess(f,d);if(m!==void 0)return typeof m=="object"?JSON.stringify(m):String(m)}}if(r[e]!==void 0){let l=r[e];return typeof l=="string"&&l.charCodeAt(0)===30?l.slice(1):String(l)}if(Uo(e)){let l=this.deserializeVariables(r),f=jo(e,l),d=Ho(e,f);if(d!==void 0)return String(d)}return n}resolveFilterInput(e,r){if(e==="@")return"";if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1);let n=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(n){let s=eE(n[2],r),o=Vi(n[1],s);return o!==null?o:void 0}let i=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(i){let s=i[1];if(r[s]!==void 0){let o=this.deserializeValue(r[s]),l=this.resolvePropertyAccess(o,i[2]);if(l!==void 0)return l}}if(r[e]!==void 0)return this.deserializeValue(r[e]);if(Uo(e)){let s=this.deserializeVariables(r),o=jo(e,s),l=Ho(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}},Vo=class{interpolate(e,r){return!e||typeof e!="string"?e:new Bo({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 VL from"http";import*as Ou from"https";import{URL as tE}from"url";import*as th from"zlib";var Bn,Wo,Iu=ae(()=>{"use strict";Bn={timeout:3e4,followRedirects:!0,followOriginalMethod:!1,followAuthHeader:!1,maxRedirects:10,strictSSL:!0,decompress:!0,includeCookies:!1},Wo=class{settings;version;constructor(e){this.settings={...Bn,...e};try{this.version=it("../../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 tE(e.url),l=o.protocol==="https:",f=this.sanitizeHeaders(e.headers||{});Object.keys(f).some(g=>g.toLowerCase()==="user-agent")||(f["User-Agent"]=`HttpForge/${this.version}`);let m={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"]&&(m.headers["Accept-Encoding"]="gzip, deflate"),l&&(m.rejectUnauthorized=r.strictSSL,r.strictSSL?m.agent=Ou.globalAgent:m.agent=new Ou.Agent({rejectUnauthorized:!1})),new Promise((g,y)=>{if(i?.aborted){let R=new Error("Request cancelled");R.name="AbortError",y(R);return}let C=(l?Ou:VL).request(m,async R=>{let P=R.statusCode||0;if(r.followRedirects&&[301,302,303,307,308].includes(P)){if(n>=r.maxRedirects){y(new Error(`Maximum redirects (${r.maxRedirects}) exceeded`));return}let U=R.headers.location;if(!U){y(new Error("Redirect response missing Location header"));return}let B=new tE(U,e.url).toString(),z=e.method;!r.followOriginalMethod&&[301,302,303].includes(P)&&(z="GET");let V={...e.headers};r.followAuthHeader||(delete V.authorization,delete V.Authorization);try{let X=await this.executeInternal({...e,url:B,method:z,headers:V,body:z==="GET"?void 0:e.body},r,n+1,i),T=Date.now();X.time=T-s,g(X)}catch(X){y(X)}return}let A=[];R.on("data",U=>A.push(U)),R.on("end",()=>{let U=Date.now(),B=Buffer.concat(A),z=R.headers["content-encoding"];if(r.decompress&&z)try{z==="gzip"?B=th.gunzipSync(B):z==="deflate"&&(B=th.inflateSync(B))}catch(k){console.warn("[NodeHttpClient] Decompression failed:",k)}let V=B.toString("utf-8"),X;try{X=JSON.parse(V)}catch{X=V}let T={};for(let[k,M]of Object.entries(R.headers))(typeof M=="string"||Array.isArray(M))&&(T[k]=M);let _=this.parseCookies(R.headers["set-cookie"],o.hostname);g({status:R.statusCode||0,statusText:R.statusMessage||"",headers:T,cookies:_,body:X,time:U-s,size:B.length})})});if(i&&i.addEventListener("abort",()=>{C.destroy();let R=new Error("Request cancelled");R.name="AbortError",y(R)}),C.on("error",R=>{y(R)}),C.on("timeout",()=>{C.destroy(),y(new Error("Request timeout"))}),e.body!==void 0&&e.body!==null){let R=typeof e.body=="string"?e.body:JSON.stringify(e.body);C.write(R)}C.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(m=>m.trim()),[s,...o]=i,[l,f]=s.split("="),d={name:l.trim(),value:f?.trim()||"",domain:r};for(let m of o){let[g,y]=m.split("=");switch(g.toLowerCase().trim()){case"domain":d.domain=y?.trim();break;case"path":d.path=y?.trim();break;case"expires":d.expires=y?.trim();break;case"httponly":d.httpOnly=!0;break;case"secure":d.secure=!0;break}}return d}):[]}}});function yb(t){return{timeout:t?.timeout??Bn.timeout,followRedirects:t?.followRedirects??Bn.followRedirects,followOriginalMethod:t?.followOriginalMethod??Bn.followOriginalMethod,followAuthHeader:t?.followAuthHeader??Bn.followAuthHeader,maxRedirects:t?.maxRedirects??Bn.maxRedirects,strictSSL:t?.strictSSL??Bn.strictSSL,decompress:t?.decompress??Bn.decompress,includeCookies:t?.includeCookies??Bn.includeCookies}}var vb=ae(()=>{"use strict";Iu()});var Wi,Pu=ae(()=>{"use strict";vb();Wi=class{constructor(e,r,n){this.urlBuilder=e;this.interceptors=r;this.httpClient=n}urlBuilder;interceptors;httpClient;async execute(e){let r=yb(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 zi,bb,Sb,wb,ku=ae(()=>{"use strict";zi=class{requestInterceptors=[];responseInterceptors=[];errorInterceptors=[];addRequestInterceptor(e){return this.requestInterceptors.push(e),this.sortByPriority(this.requestInterceptors),this}addResponseInterceptor(e){return this.responseInterceptors.push(e),this.sortByPriority(this.responseInterceptors),this}addErrorInterceptor(e){return this.errorInterceptors.push(e),this.sortByPriority(this.errorInterceptors),this}removeRequestInterceptor(e){let r=this.requestInterceptors.findIndex(n=>n.name===e);return r>=0?(this.requestInterceptors.splice(r,1),!0):!1}removeResponseInterceptor(e){let r=this.responseInterceptors.findIndex(n=>n.name===e);return r>=0?(this.responseInterceptors.splice(r,1),!0):!1}removeErrorInterceptor(e){let r=this.errorInterceptors.findIndex(n=>n.name===e);return r>=0?(this.errorInterceptors.splice(r,1),!0):!1}async executeRequestInterceptors(e,r){let n=e;for(let i of this.requestInterceptors)try{n=await i.intercept(n,r)}catch(s){throw console.error(`[InterceptorChain] Request interceptor '${i.name}' failed:`,s),s}return n}async executeResponseInterceptors(e,r,n){let i=e;for(let s of this.responseInterceptors)try{i=await s.intercept(i,r,n)}catch(o){throw console.error(`[InterceptorChain] Response interceptor '${s.name}' failed:`,o),o}return i}async executeErrorInterceptors(e,r,n){for(let i of this.errorInterceptors)try{let s=await i.handle(e,r,n);if(s)return s}catch(s){console.error(`[InterceptorChain] Error interceptor '${i.name}' failed:`,s)}}clear(){this.requestInterceptors=[],this.responseInterceptors=[],this.errorInterceptors=[]}getRegisteredInterceptors(){return{request:this.requestInterceptors.map(e=>e.name),response:this.responseInterceptors.map(e=>e.name),error:this.errorInterceptors.map(e=>e.name)}}sortByPriority(e){e.sort((r,n)=>(r.priority??100)-(n.priority??100))}},bb=class{name="logging";priority=1e3;intercept(e,r){return e}},Sb=class{name="timing";priority=1;intercept(e,r,n){return e}},wb=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 rE=F((Rl,Tu)=>{(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,d="__lodash_placeholder__",m=1,g=2,y=4,w=1,C=2,R=1,P=2,A=4,U=8,B=16,z=32,V=64,X=128,T=256,_=512,k=30,M="...",j=800,$=16,Y=1,K=2,ne=3,ue=1/0,et=9007199254740991,_e=17976931348623157e292,he=NaN,Ce=4294967295,vt=Ce-1,Et=Ce>>>1,ce=[["ary",X],["bind",R],["bindKey",P],["curry",U],["curryRight",B],["flip",_],["partial",z],["partialRight",V],["rearg",T]],pr="[object Arguments]",ai="[object Array]",Rt="[object AsyncFunction]",zr="[object Boolean]",Or="[object Date]",ht="[object DOMException]",mt="[object Error]",on="[object Function]",oo="[object GeneratorFunction]",Jt="[object Map]",ao="[object Number]",Wg="[object Null]",In="[object Object]",Od="[object Promise]",Id="[object Proxy]",Yt="[object RegExp]",hr="[object Set]",lo="[object String]",Pa="[object Symbol]",Pd="[object Undefined]",Ut="[object WeakMap]",kd="[object WeakSet]",Oi="[object ArrayBuffer]",Pn="[object DataView]",ot="[object Float32Array]",ka="[object Float64Array]",Ta="[object Int8Array]",cs="[object Int16Array]",co="[object Int32Array]",us="[object Uint8Array]",li="[object Uint8ClampedArray]",fs="[object Uint16Array]",Mc="[object Uint32Array]",Aa=/\b__p \+= '';/g,zg=/\b(__p \+=) '' \+/g,uo=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ii=/&(?:amp|lt|gt|quot|#39);/g,qa=/[&<>"']/g,$a=RegExp(Ii.source),le=RegExp(qa.source),Jg=/<%-([\s\S]+?)%>/g,Yg=/<%([\s\S]+?)%>/g,an=/<%=([\s\S]+?)%>/g,Ir=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qe=/^\w*$/,Nc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ke=/[\\^$.*+?()[\]{}|]/g,fo=RegExp(Ke.source),Dc=/^\s+/,Ma=/\s/,Gt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,kn=/\{\n\/\* \[wrapped with (.+)\] \*/,ln=/,? & /,At=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Pr=/[()=,{}\[\]\/\s]/,Tn=/\\(\\)?/g,Pi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Td=/\w*$/,Gg=/^[-+]0x[0-9a-f]+$/i,po=/^0b[01]+$/i,Ad=/^\[object .+?Constructor\]$/,Kg=/^0o[0-7]+$/i,ds=/^(?:0|[1-9]\d*)$/,ho=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,mo=/($^)/,Qg=/['\n\r\u2028\u2029\\]/g,Na="\\ud800-\\udfff",Zg="\\u0300-\\u036f",xt="\\ufe20-\\ufe2f",Fc="\\u20d0-\\u20ff",qd=Zg+xt+Fc,Lc="\\u2700-\\u27bf",jc="a-z\\xdf-\\xf6\\xf8-\\xff",Xg="\\xac\\xb1\\xd7\\xf7",ey="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ty="\\u2000-\\u206f",ry=" \\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",$d="A-Z\\xc0-\\xd6\\xd8-\\xde",Md="\\ufe0e\\ufe0f",Uc=Xg+ey+ty+ry,Da="['\u2019]",ny="["+Na+"]",Nd="["+Uc+"]",Fa="["+qd+"]",Hc="\\d+",iy="["+Lc+"]",ps="["+jc+"]",go="[^"+Na+Uc+Hc+Lc+jc+$d+"]",La="\\ud83c[\\udffb-\\udfff]",yo="(?:"+Fa+"|"+La+")",cn="[^"+Na+"]",Bc="(?:\\ud83c[\\udde6-\\uddff]){2}",Vc="[\\ud800-\\udbff][\\udc00-\\udfff]",hs="["+$d+"]",Dd="\\u200d",Fd="(?:"+ps+"|"+go+")",sy="(?:"+hs+"|"+go+")",Ld="(?:"+Da+"(?:d|ll|m|re|s|t|ve))?",jd="(?:"+Da+"(?:D|LL|M|RE|S|T|VE))?",ja=yo+"?",Ud="["+Md+"]?",Hd="(?:"+Dd+"(?:"+[cn,Bc,Vc].join("|")+")"+Ud+ja+")*",oy="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ay="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Bd=Ud+ja+Hd,ly="(?:"+[iy,Bc,Vc].join("|")+")"+Bd,cy="(?:"+[cn+Fa+"?",Fa,Bc,Vc,ny].join("|")+")",uy=RegExp(Da,"g"),fy=RegExp(Fa,"g"),Wc=RegExp(La+"(?="+La+")|"+cy+Bd,"g"),dy=RegExp([hs+"?"+ps+"+"+Ld+"(?="+[Nd,hs,"$"].join("|")+")",sy+"+"+jd+"(?="+[Nd,hs+Fd,"$"].join("|")+")",hs+"?"+Fd+"+"+Ld,hs+"+"+jd,ay,oy,Hc,ly].join("|"),"g"),py=RegExp("["+Dd+Na+qd+Md+"]"),hy=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,my=["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"],gy=-1,ut={};ut[ot]=ut[ka]=ut[Ta]=ut[cs]=ut[co]=ut[us]=ut[li]=ut[fs]=ut[Mc]=!0,ut[pr]=ut[ai]=ut[Oi]=ut[zr]=ut[Pn]=ut[Or]=ut[mt]=ut[on]=ut[Jt]=ut[ao]=ut[In]=ut[Yt]=ut[hr]=ut[lo]=ut[Ut]=!1;var at={};at[pr]=at[ai]=at[Oi]=at[Pn]=at[zr]=at[Or]=at[ot]=at[ka]=at[Ta]=at[cs]=at[co]=at[Jt]=at[ao]=at[In]=at[Yt]=at[hr]=at[lo]=at[Pa]=at[us]=at[li]=at[fs]=at[Mc]=!0,at[mt]=at[on]=at[Ut]=!1;var zc={\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"},Jc={"&":"&","<":"<",">":">",'"':""","'":"'"},yy={"&":"&","<":"<",">":">",""":'"',"'":"'"},Vd={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Wd=parseFloat,vy=parseInt,zd=typeof global=="object"&&global&&global.Object===Object&&global,by=typeof self=="object"&&self&&self.Object===Object&&self,Nt=zd||by||Function("return this")(),Ua=typeof Rl=="object"&&Rl&&!Rl.nodeType&&Rl,Qe=Ua&&typeof Tu=="object"&&Tu&&!Tu.nodeType&&Tu,ms=Qe&&Qe.exports===Ua,ki=ms&&zd.process,kr=(function(){try{var L=Qe&&Qe.require&&Qe.require("util").types;return L||ki&&ki.binding&&ki.binding("util")}catch{}})(),Yc=kr&&kr.isArrayBuffer,Jd=kr&&kr.isDate,Yd=kr&&kr.isMap,vo=kr&&kr.isRegExp,An=kr&&kr.isSet,Ha=kr&&kr.isTypedArray;function mr(L,G,W){switch(W.length){case 0:return L.call(G);case 1:return L.call(G,W[0]);case 2:return L.call(G,W[0],W[1]);case 3:return L.call(G,W[0],W[1],W[2])}return L.apply(G,W)}function qn(L,G,W,oe){for(var be=-1,Ye=L==null?0:L.length;++be<Ye;){var rt=L[be];G(oe,rt,W(rt),L)}return oe}function gr(L,G){for(var W=-1,oe=L==null?0:L.length;++W<oe&&G(L[W],W,L)!==!1;);return L}function Gc(L,G){for(var W=L==null?0:L.length;W--&&G(L[W],W,L)!==!1;);return L}function Gd(L,G){for(var W=-1,oe=L==null?0:L.length;++W<oe;)if(!G(L[W],W,L))return!1;return!0}function ci(L,G){for(var W=-1,oe=L==null?0:L.length,be=0,Ye=[];++W<oe;){var rt=L[W];G(rt,W,L)&&(Ye[be++]=rt)}return Ye}function Ba(L,G){var W=L==null?0:L.length;return!!W&&Ti(L,G,0)>-1}function gs(L,G,W){for(var oe=-1,be=L==null?0:L.length;++oe<be;)if(W(G,L[oe]))return!0;return!1}function lt(L,G){for(var W=-1,oe=L==null?0:L.length,be=Array(oe);++W<oe;)be[W]=G(L[W],W,L);return be}function ui(L,G){for(var W=-1,oe=G.length,be=L.length;++W<oe;)L[be+W]=G[W];return L}function Kc(L,G,W,oe){var be=-1,Ye=L==null?0:L.length;for(oe&&Ye&&(W=L[++be]);++be<Ye;)W=G(W,L[be],be,L);return W}function Sy(L,G,W,oe){var be=L==null?0:L.length;for(oe&&be&&(W=L[--be]);be--;)W=G(W,L[be],be,L);return W}function Va(L,G){for(var W=-1,oe=L==null?0:L.length;++W<oe;)if(G(L[W],W,L))return!0;return!1}var wy=bo("length");function _y(L){return L.split("")}function Ry(L){return L.match(At)||[]}function Kd(L,G,W){var oe;return W(L,function(be,Ye,rt){if(G(be,Ye,rt))return oe=Ye,!1}),oe}function Wa(L,G,W,oe){for(var be=L.length,Ye=W+(oe?1:-1);oe?Ye--:++Ye<be;)if(G(L[Ye],Ye,L))return Ye;return-1}function Ti(L,G,W){return G===G?Ay(L,G,W):Wa(L,Ai,W)}function xy(L,G,W,oe){for(var be=W-1,Ye=L.length;++be<Ye;)if(oe(L[be],G))return be;return-1}function Ai(L){return L!==L}function Qd(L,G){var W=L==null?0:L.length;return W?Zc(L,G)/W:he}function bo(L){return function(G){return G==null?t:G[L]}}function Qc(L){return function(G){return L==null?t:L[G]}}function za(L,G,W,oe,be){return be(L,function(Ye,rt,Ue){W=oe?(oe=!1,Ye):G(W,Ye,rt,Ue)}),W}function Cy(L,G){var W=L.length;for(L.sort(G);W--;)L[W]=L[W].value;return L}function Zc(L,G){for(var W,oe=-1,be=L.length;++oe<be;){var Ye=G(L[oe]);Ye!==t&&(W=W===t?Ye:W+Ye)}return W}function Xc(L,G){for(var W=-1,oe=Array(L);++W<L;)oe[W]=G(W);return oe}function Ey(L,G){return lt(G,function(W){return[W,L[W]]})}function eu(L){return L&&L.slice(0,rp(L)+1).replace(Dc,"")}function yr(L){return function(G){return L(G)}}function Ja(L,G){return lt(G,function(W){return L[W]})}function tt(L,G){return L.has(G)}function Zd(L,G){for(var W=-1,oe=L.length;++W<oe&&Ti(G,L[W],0)>-1;);return W}function Xd(L,G){for(var W=L.length;W--&&Ti(G,L[W],0)>-1;);return W}function ep(L,G){for(var W=L.length,oe=0;W--;)L[W]===G&&++oe;return oe}var Oy=Qc(zc),Iy=Qc(Jc);function Py(L){return"\\"+Vd[L]}function So(L,G){return L==null?t:L[G]}function ys(L){return py.test(L)}function ky(L){return hy.test(L)}function Ty(L){for(var G,W=[];!(G=L.next()).done;)W.push(G.value);return W}function vs(L){var G=-1,W=Array(L.size);return L.forEach(function(oe,be){W[++G]=[be,oe]}),W}function wo(L,G){return function(W){return L(G(W))}}function un(L,G){for(var W=-1,oe=L.length,be=0,Ye=[];++W<oe;){var rt=L[W];(rt===G||rt===d)&&(L[W]=d,Ye[be++]=W)}return Ye}function Ya(L){var G=-1,W=Array(L.size);return L.forEach(function(oe){W[++G]=oe}),W}function tp(L){var G=-1,W=Array(L.size);return L.forEach(function(oe){W[++G]=[oe,oe]}),W}function Ay(L,G,W){for(var oe=W-1,be=L.length;++oe<be;)if(L[oe]===G)return oe;return-1}function tu(L,G,W){for(var oe=W+1;oe--;)if(L[oe]===G)return oe;return oe}function fi(L){return ys(L)?$y(L):wy(L)}function vr(L){return ys(L)?My(L):_y(L)}function rp(L){for(var G=L.length;G--&&Ma.test(L.charAt(G)););return G}var qy=Qc(yy);function $y(L){for(var G=Wc.lastIndex=0;Wc.test(L);)++G;return G}function My(L){return L.match(Wc)||[]}function Ny(L){return L.match(dy)||[]}var Dy=(function L(G){G=G==null?Nt:di.defaults(Nt.Object(),G,di.pick(Nt,my));var W=G.Array,oe=G.Date,be=G.Error,Ye=G.Function,rt=G.Math,Ue=G.Object,Ga=G.RegExp,Fy=G.String,br=G.TypeError,_o=W.prototype,Ly=Ye.prototype,bs=Ue.prototype,Ro=G["__core-js_shared__"],Ka=Ly.toString,Ze=bs.hasOwnProperty,jy=0,np=(function(){var a=/[^.]+$/.exec(Ro&&Ro.keys&&Ro.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""})(),Qa=bs.toString,Uy=Ka.call(Ue),Hy=Nt._,By=Ga("^"+Ka.call(Ze).replace(Ke,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Za=ms?G.Buffer:t,pi=G.Symbol,Xa=G.Uint8Array,ip=Za?Za.allocUnsafe:t,el=wo(Ue.getPrototypeOf,Ue),sp=Ue.create,xo=bs.propertyIsEnumerable,tl=_o.splice,op=pi?pi.isConcatSpreadable:t,Co=pi?pi.iterator:t,qi=pi?pi.toStringTag:t,rl=(function(){try{var a=Mo(Ue,"defineProperty");return a({},"",{}),a}catch{}})(),Vy=G.clearTimeout!==Nt.clearTimeout&&G.clearTimeout,Wy=oe&&oe.now!==Nt.Date.now&&oe.now,zy=G.setTimeout!==Nt.setTimeout&&G.setTimeout,Eo=rt.ceil,Oo=rt.floor,nl=Ue.getOwnPropertySymbols,il=Za?Za.isBuffer:t,$i=G.isFinite,sl=_o.join,ap=wo(Ue.keys,Ue),gt=rt.max,Ht=rt.min,lp=oe.now,Jy=G.parseInt,cp=rt.random,Yy=_o.reverse,ru=Mo(G,"DataView"),Io=Mo(G,"Map"),nu=Mo(G,"Promise"),Ss=Mo(G,"Set"),Po=Mo(G,"WeakMap"),ko=Mo(Ue,"create"),ol=Po&&new Po,ws={},Gy=No(ru),Ky=No(Io),Qy=No(nu),Zy=No(Ss),Xy=No(Po),al=pi?pi.prototype:t,To=al?al.valueOf:t,up=al?al.toString:t;function O(a){if(Ot(a)&&!Re(a)&&!(a instanceof $e)){if(a instanceof nr)return a;if(Ze.call(a,"__wrapped__"))return rC(a)}return new nr(a)}var _s=(function(){function a(){}return function(c){if(!Ct(c))return{};if(sp)return sp(c);a.prototype=c;var p=new a;return a.prototype=t,p}})();function ll(){}function nr(a,c){this.__wrapped__=a,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=t}O.templateSettings={escape:Jg,evaluate:Yg,interpolate:an,variable:"",imports:{_:O}},O.prototype=ll.prototype,O.prototype.constructor=O,nr.prototype=_s(ll.prototype),nr.prototype.constructor=nr;function $e(a){this.__wrapped__=a,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ce,this.__views__=[]}function ev(){var a=new $e(this.__wrapped__);return a.__actions__=Tr(this.__actions__),a.__dir__=this.__dir__,a.__filtered__=this.__filtered__,a.__iteratees__=Tr(this.__iteratees__),a.__takeCount__=this.__takeCount__,a.__views__=Tr(this.__views__),a}function tv(){if(this.__filtered__){var a=new $e(this);a.__dir__=-1,a.__filtered__=!0}else a=this.clone(),a.__dir__*=-1;return a}function iu(){var a=this.__wrapped__.value(),c=this.__dir__,p=Re(a),v=c<0,x=p?a.length:0,I=P$(0,x,this.__views__),q=I.start,D=I.end,H=D-q,Q=v?D:q-1,Z=this.__iteratees__,ee=Z.length,ie=0,fe=Ht(H,this.__takeCount__);if(!p||!v&&x==H&&fe==H)return Cx(a,this.__actions__);var ye=[];e:for(;H--&&ie<fe;){Q+=c;for(var Ie=-1,me=a[Q];++Ie<ee;){var Le=Z[Ie],He=Le.iteratee,Zr=Le.type,_r=He(me);if(Zr==K)me=_r;else if(!_r){if(Zr==Y)continue e;break e}}ye[ie++]=me}return ye}$e.prototype=_s(ll.prototype),$e.prototype.constructor=$e;function fn(a){var c=-1,p=a==null?0:a.length;for(this.clear();++c<p;){var v=a[c];this.set(v[0],v[1])}}function rv(){this.__data__=ko?ko(null):{},this.size=0}function nv(a){var c=this.has(a)&&delete this.__data__[a];return this.size-=c?1:0,c}function iv(a){var c=this.__data__;if(ko){var p=c[a];return p===l?t:p}return Ze.call(c,a)?c[a]:t}function sv(a){var c=this.__data__;return ko?c[a]!==t:Ze.call(c,a)}function ov(a,c){var p=this.__data__;return this.size+=this.has(a)?0:1,p[a]=ko&&c===t?l:c,this}fn.prototype.clear=rv,fn.prototype.delete=nv,fn.prototype.get=iv,fn.prototype.has=sv,fn.prototype.set=ov;function $n(a){var c=-1,p=a==null?0:a.length;for(this.clear();++c<p;){var v=a[c];this.set(v[0],v[1])}}function fp(){this.__data__=[],this.size=0}function av(a){var c=this.__data__,p=ul(c,a);if(p<0)return!1;var v=c.length-1;return p==v?c.pop():tl.call(c,p,1),--this.size,!0}function lv(a){var c=this.__data__,p=ul(c,a);return p<0?t:c[p][1]}function dp(a){return ul(this.__data__,a)>-1}function cv(a,c){var p=this.__data__,v=ul(p,a);return v<0?(++this.size,p.push([a,c])):p[v][1]=c,this}$n.prototype.clear=fp,$n.prototype.delete=av,$n.prototype.get=lv,$n.prototype.has=dp,$n.prototype.set=cv;function Mn(a){var c=-1,p=a==null?0:a.length;for(this.clear();++c<p;){var v=a[c];this.set(v[0],v[1])}}function uv(){this.size=0,this.__data__={hash:new fn,map:new(Io||$n),string:new fn}}function hi(a){var c=qp(this,a).delete(a);return this.size-=c?1:0,c}function pp(a){return qp(this,a).get(a)}function fv(a){return qp(this,a).has(a)}function dv(a,c){var p=qp(this,a),v=p.size;return p.set(a,c),this.size+=p.size==v?0:1,this}Mn.prototype.clear=uv,Mn.prototype.delete=hi,Mn.prototype.get=pp,Mn.prototype.has=fv,Mn.prototype.set=dv;function Mi(a){var c=-1,p=a==null?0:a.length;for(this.__data__=new Mn;++c<p;)this.add(a[c])}function te(a){return this.__data__.set(a,l),this}function pv(a){return this.__data__.has(a)}Mi.prototype.add=Mi.prototype.push=te,Mi.prototype.has=pv;function Jr(a){var c=this.__data__=new $n(a);this.size=c.size}function hp(){this.__data__=new $n,this.size=0}function Ve(a){var c=this.__data__,p=c.delete(a);return this.size=c.size,p}function cl(a){return this.__data__.get(a)}function mp(a){return this.__data__.has(a)}function su(a,c){var p=this.__data__;if(p instanceof $n){var v=p.__data__;if(!Io||v.length<r-1)return v.push([a,c]),this.size=++p.size,this;p=this.__data__=new Mn(v)}return p.set(a,c),this.size=p.size,this}Jr.prototype.clear=hp,Jr.prototype.delete=Ve,Jr.prototype.get=cl,Jr.prototype.has=mp,Jr.prototype.set=su;function gp(a,c){var p=Re(a),v=!p&&Do(a),x=!p&&!v&&Ps(a),I=!p&&!v&&!x&&gl(a),q=p||v||x||I,D=q?Xc(a.length,Fy):[],H=D.length;for(var Q in a)(c||Ze.call(a,Q))&&!(q&&(Q=="length"||x&&(Q=="offset"||Q=="parent")||I&&(Q=="buffer"||Q=="byteLength"||Q=="byteOffset")||Li(Q,H)))&&D.push(Q);return D}function yp(a){var c=a.length;return c?a[Ev(0,c-1)]:t}function hv(a,c){return $p(Tr(a),mi(c,0,a.length))}function mv(a){return $p(Tr(a))}function ou(a,c,p){(p!==t&&!jn(a[c],p)||p===t&&!(c in a))&&Yr(a,c,p)}function Sr(a,c,p){var v=a[c];(!(Ze.call(a,c)&&jn(v,p))||p===t&&!(c in a))&&Yr(a,c,p)}function ul(a,c){for(var p=a.length;p--;)if(jn(a[p][0],c))return p;return-1}function vp(a,c,p,v){return gi(a,function(x,I,q){c(v,x,p(x),q)}),v}function bp(a,c){return a&&yi(c,Kt(c),a)}function gv(a,c){return a&&yi(c,qr(c),a)}function Yr(a,c,p){c=="__proto__"&&rl?rl(a,c,{configurable:!0,enumerable:!0,value:p,writable:!0}):a[c]=p}function au(a,c){for(var p=-1,v=c.length,x=W(v),I=a==null;++p<v;)x[p]=I?t:Zv(a,c[p]);return x}function mi(a,c,p){return a===a&&(p!==t&&(a=a<=p?a:p),c!==t&&(a=a>=c?a:c)),a}function ir(a,c,p,v,x,I){var q,D=c&m,H=c&g,Q=c&y;if(p&&(q=x?p(a,v,x,I):p(a)),q!==t)return q;if(!Ct(a))return a;var Z=Re(a);if(Z){if(q=T$(a),!D)return Tr(a,q)}else{var ee=sr(a),ie=ee==on||ee==oo;if(Ps(a))return Ix(a,D);if(ee==In||ee==pr||ie&&!x){if(q=H||ie?{}:Jx(a),!D)return H?S$(a,gv(q,a)):b$(a,bp(q,a))}else{if(!at[ee])return x?a:{};q=A$(a,ee,D)}}I||(I=new Jr);var fe=I.get(a);if(fe)return fe;I.set(a,q),_C(a)?a.forEach(function(me){q.add(ir(me,c,p,me,a,I))}):SC(a)&&a.forEach(function(me,Le){q.set(Le,ir(me,c,p,Le,a,I))});var ye=Q?H?Dv:Nv:H?qr:Kt,Ie=Z?t:ye(a);return gr(Ie||a,function(me,Le){Ie&&(Le=me,me=a[Le]),Sr(q,Le,ir(me,c,p,Le,a,I))}),q}function yv(a){var c=Kt(a);return function(p){return dn(p,a,c)}}function dn(a,c,p){var v=p.length;if(a==null)return!v;for(a=Ue(a);v--;){var x=p[v],I=c[x],q=a[x];if(q===t&&!(x in a)||!I(q))return!1}return!0}function lu(a,c,p){if(typeof a!="function")throw new br(i);return mu(function(){a.apply(t,p)},c)}function Ao(a,c,p,v){var x=-1,I=Ba,q=!0,D=a.length,H=[],Q=c.length;if(!D)return H;p&&(c=lt(c,yr(p))),v?(I=gs,q=!1):c.length>=r&&(I=tt,q=!1,c=new Mi(c));e:for(;++x<D;){var Z=a[x],ee=p==null?Z:p(Z);if(Z=v||Z!==0?Z:0,q&&ee===ee){for(var ie=Q;ie--;)if(c[ie]===ee)continue e;H.push(Z)}else I(c,ee,v)||H.push(Z)}return H}var gi=qx(pn),Sp=qx(Nn,!0);function vv(a,c){var p=!0;return gi(a,function(v,x,I){return p=!!c(v,x,I),p}),p}function fl(a,c,p){for(var v=-1,x=a.length;++v<x;){var I=a[v],q=c(I);if(q!=null&&(D===t?q===q&&!Qr(q):p(q,D)))var D=q,H=I}return H}function bv(a,c,p,v){var x=a.length;for(p=Ee(p),p<0&&(p=-p>x?0:x+p),v=v===t||v>x?x:Ee(v),v<0&&(v+=x),v=p>v?0:xC(v);p<v;)a[p++]=c;return a}function wp(a,c){var p=[];return gi(a,function(v,x,I){c(v,x,I)&&p.push(v)}),p}function Bt(a,c,p,v,x){var I=-1,q=a.length;for(p||(p=$$),x||(x=[]);++I<q;){var D=a[I];c>0&&p(D)?c>1?Bt(D,c-1,p,v,x):ui(x,D):v||(x[x.length]=D)}return x}var cu=$x(),_p=$x(!0);function pn(a,c){return a&&cu(a,c,Kt)}function Nn(a,c){return a&&_p(a,c,Kt)}function dl(a,c){return ci(c,function(p){return ji(a[p])})}function Ni(a,c){c=Os(c,a);for(var p=0,v=c.length;a!=null&&p<v;)a=a[Ln(c[p++])];return p&&p==v?a:t}function Rp(a,c,p){var v=c(a);return Re(a)?v:ui(v,p(a))}function Qt(a){return a==null?a===t?Pd:Wg:qi&&qi in Ue(a)?I$(a):U$(a)}function uu(a,c){return a>c}function Sv(a,c){return a!=null&&Ze.call(a,c)}function wv(a,c){return a!=null&&c in Ue(a)}function _v(a,c,p){return a>=Ht(c,p)&&a<gt(c,p)}function Gr(a,c,p){for(var v=p?gs:Ba,x=a[0].length,I=a.length,q=I,D=W(I),H=1/0,Q=[];q--;){var Z=a[q];q&&c&&(Z=lt(Z,yr(c))),H=Ht(Z.length,H),D[q]=!p&&(c||x>=120&&Z.length>=120)?new Mi(q&&Z):t}Z=a[0];var ee=-1,ie=D[0];e:for(;++ee<x&&Q.length<H;){var fe=Z[ee],ye=c?c(fe):fe;if(fe=p||fe!==0?fe:0,!(ie?tt(ie,ye):v(Q,ye,p))){for(q=I;--q;){var Ie=D[q];if(!(Ie?tt(Ie,ye):v(a[q],ye,p)))continue e}ie&&ie.push(ye),Q.push(fe)}}return Q}function Rs(a,c,p,v){return pn(a,function(x,I,q){c(v,p(x),I,q)}),v}function qo(a,c,p){c=Os(c,a),a=Qx(a,c);var v=a==null?a:a[Ln(mn(c))];return v==null?t:mr(v,a,p)}function xp(a){return Ot(a)&&Qt(a)==pr}function Rv(a){return Ot(a)&&Qt(a)==Oi}function xv(a){return Ot(a)&&Qt(a)==Or}function $o(a,c,p,v,x){return a===c?!0:a==null||c==null||!Ot(a)&&!Ot(c)?a!==a&&c!==c:fu(a,c,p,v,$o,x)}function fu(a,c,p,v,x,I){var q=Re(a),D=Re(c),H=q?ai:sr(a),Q=D?ai:sr(c);H=H==pr?In:H,Q=Q==pr?In:Q;var Z=H==In,ee=Q==In,ie=H==Q;if(ie&&Ps(a)){if(!Ps(c))return!1;q=!0,Z=!1}if(ie&&!Z)return I||(I=new Jr),q||gl(a)?Vx(a,c,p,v,x,I):E$(a,c,H,p,v,x,I);if(!(p&w)){var fe=Z&&Ze.call(a,"__wrapped__"),ye=ee&&Ze.call(c,"__wrapped__");if(fe||ye){var Ie=fe?a.value():a,me=ye?c.value():c;return I||(I=new Jr),x(Ie,me,p,v,I)}}return ie?(I||(I=new Jr),O$(a,c,p,v,x,I)):!1}function xs(a){return Ot(a)&&sr(a)==Jt}function Cs(a,c,p,v){var x=p.length,I=x,q=!v;if(a==null)return!I;for(a=Ue(a);x--;){var D=p[x];if(q&&D[2]?D[1]!==a[D[0]]:!(D[0]in a))return!1}for(;++x<I;){D=p[x];var H=D[0],Q=a[H],Z=D[1];if(q&&D[2]){if(Q===t&&!(H in a))return!1}else{var ee=new Jr;if(v)var ie=v(Q,Z,H,a,c,ee);if(!(ie===t?$o(Z,Q,w|C,v,ee):ie))return!1}}return!0}function Fe(a){if(!Ct(a)||N$(a))return!1;var c=ji(a)?By:Ad;return c.test(No(a))}function u(a){return Ot(a)&&Qt(a)==Yt}function h(a){return Ot(a)&&sr(a)==hr}function b(a){return Ot(a)&&jp(a.length)&&!!ut[Qt(a)]}function S(a){return typeof a=="function"?a:a==null?$r:typeof a=="object"?Re(a)?Me(a[0],a[1]):ve(a):NC(a)}function E(a){if(!hu(a))return ap(a);var c=[];for(var p in Ue(a))Ze.call(a,p)&&p!="constructor"&&c.push(p);return c}function N(a){if(!Ct(a))return j$(a);var c=hu(a),p=[];for(var v in a)v=="constructor"&&(c||!Ze.call(a,v))||p.push(v);return p}function J(a,c){return a<c}function se(a,c){var p=-1,v=Ar(a)?W(a.length):[];return gi(a,function(x,I,q){v[++p]=c(x,I,q)}),v}function ve(a){var c=Lv(a);return c.length==1&&c[0][2]?Gx(c[0][0],c[0][1]):function(p){return p===a||Cs(p,a,c)}}function Me(a,c){return Uv(a)&&Yx(c)?Gx(Ln(a),c):function(p){var v=Zv(p,a);return v===t&&v===c?Xv(p,a):$o(c,v,w|C)}}function Dt(a,c,p,v,x){a!==c&&cu(c,function(I,q){if(x||(x=new Jr),Ct(I))Dn(a,c,q,p,Dt,v,x);else{var D=v?v(Bv(a,q),I,q+"",a,c,x):t;D===t&&(D=I),ou(a,q,D)}},qr)}function Dn(a,c,p,v,x,I,q){var D=Bv(a,p),H=Bv(c,p),Q=q.get(H);if(Q){ou(a,p,Q);return}var Z=I?I(D,H,p+"",a,c,q):t,ee=Z===t;if(ee){var ie=Re(H),fe=!ie&&Ps(H),ye=!ie&&!fe&&gl(H);Z=H,ie||fe||ye?Re(D)?Z=D:qt(D)?Z=Tr(D):fe?(ee=!1,Z=Ix(H,!0)):ye?(ee=!1,Z=Px(H,!0)):Z=[]:gu(H)||Do(H)?(Z=D,Do(D)?Z=CC(D):(!Ct(D)||ji(D))&&(Z=Jx(H))):ee=!1}ee&&(q.set(H,Z),x(Z,H,v,I,q),q.delete(H)),ou(a,p,Z)}function Fn(a,c){var p=a.length;if(p)return c+=c<0?p:0,Li(c,p)?a[c]:t}function vx(a,c,p){c.length?c=lt(c,function(I){return Re(I)?function(q){return Ni(q,I.length===1?I[0]:I)}:I}):c=[$r];var v=-1;c=lt(c,yr(ge()));var x=se(a,function(I,q,D){var H=lt(c,function(Q){return Q(I)});return{criteria:H,index:++v,value:I}});return Cy(x,function(I,q){return v$(I,q,p)})}function o$(a,c){return bx(a,c,function(p,v){return Xv(a,v)})}function bx(a,c,p){for(var v=-1,x=c.length,I={};++v<x;){var q=c[v],D=Ni(a,q);p(D,q)&&du(I,Os(q,a),D)}return I}function a$(a){return function(c){return Ni(c,a)}}function Cv(a,c,p,v){var x=v?xy:Ti,I=-1,q=c.length,D=a;for(a===c&&(c=Tr(c)),p&&(D=lt(a,yr(p)));++I<q;)for(var H=0,Q=c[I],Z=p?p(Q):Q;(H=x(D,Z,H,v))>-1;)D!==a&&tl.call(D,H,1),tl.call(a,H,1);return a}function Sx(a,c){for(var p=a?c.length:0,v=p-1;p--;){var x=c[p];if(p==v||x!==I){var I=x;Li(x)?tl.call(a,x,1):Pv(a,x)}}return a}function Ev(a,c){return a+Oo(cp()*(c-a+1))}function l$(a,c,p,v){for(var x=-1,I=gt(Eo((c-a)/(p||1)),0),q=W(I);I--;)q[v?I:++x]=a,a+=p;return q}function Ov(a,c){var p="";if(!a||c<1||c>et)return p;do c%2&&(p+=a),c=Oo(c/2),c&&(a+=a);while(c);return p}function Te(a,c){return Vv(Kx(a,c,$r),a+"")}function c$(a){return yp(yl(a))}function u$(a,c){var p=yl(a);return $p(p,mi(c,0,p.length))}function du(a,c,p,v){if(!Ct(a))return a;c=Os(c,a);for(var x=-1,I=c.length,q=I-1,D=a;D!=null&&++x<I;){var H=Ln(c[x]),Q=p;if(H==="__proto__"||H==="constructor"||H==="prototype")return a;if(x!=q){var Z=D[H];Q=v?v(Z,H,D):t,Q===t&&(Q=Ct(Z)?Z:Li(c[x+1])?[]:{})}Sr(D,H,Q),D=D[H]}return a}var wx=ol?function(a,c){return ol.set(a,c),a}:$r,f$=rl?function(a,c){return rl(a,"toString",{configurable:!0,enumerable:!1,value:tb(c),writable:!0})}:$r;function d$(a){return $p(yl(a))}function hn(a,c,p){var v=-1,x=a.length;c<0&&(c=-c>x?0:x+c),p=p>x?x:p,p<0&&(p+=x),x=c>p?0:p-c>>>0,c>>>=0;for(var I=W(x);++v<x;)I[v]=a[v+c];return I}function p$(a,c){var p;return gi(a,function(v,x,I){return p=c(v,x,I),!p}),!!p}function Cp(a,c,p){var v=0,x=a==null?v:a.length;if(typeof c=="number"&&c===c&&x<=Et){for(;v<x;){var I=v+x>>>1,q=a[I];q!==null&&!Qr(q)&&(p?q<=c:q<c)?v=I+1:x=I}return x}return Iv(a,c,$r,p)}function Iv(a,c,p,v){var x=0,I=a==null?0:a.length;if(I===0)return 0;c=p(c);for(var q=c!==c,D=c===null,H=Qr(c),Q=c===t;x<I;){var Z=Oo((x+I)/2),ee=p(a[Z]),ie=ee!==t,fe=ee===null,ye=ee===ee,Ie=Qr(ee);if(q)var me=v||ye;else Q?me=ye&&(v||ie):D?me=ye&&ie&&(v||!fe):H?me=ye&&ie&&!fe&&(v||!Ie):fe||Ie?me=!1:me=v?ee<=c:ee<c;me?x=Z+1:I=Z}return Ht(I,vt)}function _x(a,c){for(var p=-1,v=a.length,x=0,I=[];++p<v;){var q=a[p],D=c?c(q):q;if(!p||!jn(D,H)){var H=D;I[x++]=q===0?0:q}}return I}function Rx(a){return typeof a=="number"?a:Qr(a)?he:+a}function Kr(a){if(typeof a=="string")return a;if(Re(a))return lt(a,Kr)+"";if(Qr(a))return up?up.call(a):"";var c=a+"";return c=="0"&&1/a==-ue?"-0":c}function Es(a,c,p){var v=-1,x=Ba,I=a.length,q=!0,D=[],H=D;if(p)q=!1,x=gs;else if(I>=r){var Q=c?null:x$(a);if(Q)return Ya(Q);q=!1,x=tt,H=new Mi}else H=c?[]:D;e:for(;++v<I;){var Z=a[v],ee=c?c(Z):Z;if(Z=p||Z!==0?Z:0,q&&ee===ee){for(var ie=H.length;ie--;)if(H[ie]===ee)continue e;c&&H.push(ee),D.push(Z)}else x(H,ee,p)||(H!==D&&H.push(ee),D.push(Z))}return D}function Pv(a,c){c=Os(c,a);var p=-1,v=c.length;if(!v)return!0;for(;++p<v;){var x=Ln(c[p]);if(x==="__proto__"&&!Ze.call(a,"__proto__")||(x==="constructor"||x==="prototype")&&p<v-1)return!1}var I=Qx(a,c);return I==null||delete I[Ln(mn(c))]}function xx(a,c,p,v){return du(a,c,p(Ni(a,c)),v)}function Ep(a,c,p,v){for(var x=a.length,I=v?x:-1;(v?I--:++I<x)&&c(a[I],I,a););return p?hn(a,v?0:I,v?I+1:x):hn(a,v?I+1:0,v?x:I)}function Cx(a,c){var p=a;return p instanceof $e&&(p=p.value()),Kc(c,function(v,x){return x.func.apply(x.thisArg,ui([v],x.args))},p)}function kv(a,c,p){var v=a.length;if(v<2)return v?Es(a[0]):[];for(var x=-1,I=W(v);++x<v;)for(var q=a[x],D=-1;++D<v;)D!=x&&(I[x]=Ao(I[x]||q,a[D],c,p));return Es(Bt(I,1),c,p)}function Ex(a,c,p){for(var v=-1,x=a.length,I=c.length,q={};++v<x;){var D=v<I?c[v]:t;p(q,a[v],D)}return q}function Tv(a){return qt(a)?a:[]}function Av(a){return typeof a=="function"?a:$r}function Os(a,c){return Re(a)?a:Uv(a,c)?[a]:tC(nt(a))}var h$=Te;function Is(a,c,p){var v=a.length;return p=p===t?v:p,!c&&p>=v?a:hn(a,c,p)}var Ox=Vy||function(a){return Nt.clearTimeout(a)};function Ix(a,c){if(c)return a.slice();var p=a.length,v=ip?ip(p):new a.constructor(p);return a.copy(v),v}function qv(a){var c=new a.constructor(a.byteLength);return new Xa(c).set(new Xa(a)),c}function m$(a,c){var p=c?qv(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.byteLength)}function g$(a){var c=new a.constructor(a.source,Td.exec(a));return c.lastIndex=a.lastIndex,c}function y$(a){return To?Ue(To.call(a)):{}}function Px(a,c){var p=c?qv(a.buffer):a.buffer;return new a.constructor(p,a.byteOffset,a.length)}function kx(a,c){if(a!==c){var p=a!==t,v=a===null,x=a===a,I=Qr(a),q=c!==t,D=c===null,H=c===c,Q=Qr(c);if(!D&&!Q&&!I&&a>c||I&&q&&H&&!D&&!Q||v&&q&&H||!p&&H||!x)return 1;if(!v&&!I&&!Q&&a<c||Q&&p&&x&&!v&&!I||D&&p&&x||!q&&x||!H)return-1}return 0}function v$(a,c,p){for(var v=-1,x=a.criteria,I=c.criteria,q=x.length,D=p.length;++v<q;){var H=kx(x[v],I[v]);if(H){if(v>=D)return H;var Q=p[v];return H*(Q=="desc"?-1:1)}}return a.index-c.index}function Tx(a,c,p,v){for(var x=-1,I=a.length,q=p.length,D=-1,H=c.length,Q=gt(I-q,0),Z=W(H+Q),ee=!v;++D<H;)Z[D]=c[D];for(;++x<q;)(ee||x<I)&&(Z[p[x]]=a[x]);for(;Q--;)Z[D++]=a[x++];return Z}function Ax(a,c,p,v){for(var x=-1,I=a.length,q=-1,D=p.length,H=-1,Q=c.length,Z=gt(I-D,0),ee=W(Z+Q),ie=!v;++x<Z;)ee[x]=a[x];for(var fe=x;++H<Q;)ee[fe+H]=c[H];for(;++q<D;)(ie||x<I)&&(ee[fe+p[q]]=a[x++]);return ee}function Tr(a,c){var p=-1,v=a.length;for(c||(c=W(v));++p<v;)c[p]=a[p];return c}function yi(a,c,p,v){var x=!p;p||(p={});for(var I=-1,q=c.length;++I<q;){var D=c[I],H=v?v(p[D],a[D],D,p,a):t;H===t&&(H=a[D]),x?Yr(p,D,H):Sr(p,D,H)}return p}function b$(a,c){return yi(a,jv(a),c)}function S$(a,c){return yi(a,Wx(a),c)}function Op(a,c){return function(p,v){var x=Re(p)?qn:vp,I=c?c():{};return x(p,a,ge(v,2),I)}}function pl(a){return Te(function(c,p){var v=-1,x=p.length,I=x>1?p[x-1]:t,q=x>2?p[2]:t;for(I=a.length>3&&typeof I=="function"?(x--,I):t,q&&wr(p[0],p[1],q)&&(I=x<3?t:I,x=1),c=Ue(c);++v<x;){var D=p[v];D&&a(c,D,v,I)}return c})}function qx(a,c){return function(p,v){if(p==null)return p;if(!Ar(p))return a(p,v);for(var x=p.length,I=c?x:-1,q=Ue(p);(c?I--:++I<x)&&v(q[I],I,q)!==!1;);return p}}function $x(a){return function(c,p,v){for(var x=-1,I=Ue(c),q=v(c),D=q.length;D--;){var H=q[a?D:++x];if(p(I[H],H,I)===!1)break}return c}}function w$(a,c,p){var v=c&R,x=pu(a);function I(){var q=this&&this!==Nt&&this instanceof I?x:a;return q.apply(v?p:this,arguments)}return I}function Mx(a){return function(c){c=nt(c);var p=ys(c)?vr(c):t,v=p?p[0]:c.charAt(0),x=p?Is(p,1).join(""):c.slice(1);return v[a]()+x}}function hl(a){return function(c){return Kc($C(qC(c).replace(uy,"")),a,"")}}function pu(a){return function(){var c=arguments;switch(c.length){case 0:return new a;case 1:return new a(c[0]);case 2:return new a(c[0],c[1]);case 3:return new a(c[0],c[1],c[2]);case 4:return new a(c[0],c[1],c[2],c[3]);case 5:return new a(c[0],c[1],c[2],c[3],c[4]);case 6:return new a(c[0],c[1],c[2],c[3],c[4],c[5]);case 7:return new a(c[0],c[1],c[2],c[3],c[4],c[5],c[6])}var p=_s(a.prototype),v=a.apply(p,c);return Ct(v)?v:p}}function _$(a,c,p){var v=pu(a);function x(){for(var I=arguments.length,q=W(I),D=I,H=ml(x);D--;)q[D]=arguments[D];var Q=I<3&&q[0]!==H&&q[I-1]!==H?[]:un(q,H);if(I-=Q.length,I<p)return jx(a,c,Ip,x.placeholder,t,q,Q,t,t,p-I);var Z=this&&this!==Nt&&this instanceof x?v:a;return mr(Z,this,q)}return x}function Nx(a){return function(c,p,v){var x=Ue(c);if(!Ar(c)){var I=ge(p,3);c=Kt(c),p=function(D){return I(x[D],D,x)}}var q=a(c,p,v);return q>-1?x[I?c[q]:q]:t}}function Dx(a){return Fi(function(c){var p=c.length,v=p,x=nr.prototype.thru;for(a&&c.reverse();v--;){var I=c[v];if(typeof I!="function")throw new br(i);if(x&&!q&&Ap(I)=="wrapper")var q=new nr([],!0)}for(v=q?v:p;++v<p;){I=c[v];var D=Ap(I),H=D=="wrapper"?Fv(I):t;H&&Hv(H[0])&&H[1]==(X|U|z|T)&&!H[4].length&&H[9]==1?q=q[Ap(H[0])].apply(q,H[3]):q=I.length==1&&Hv(I)?q[D]():q.thru(I)}return function(){var Q=arguments,Z=Q[0];if(q&&Q.length==1&&Re(Z))return q.plant(Z).value();for(var ee=0,ie=p?c[ee].apply(this,Q):Z;++ee<p;)ie=c[ee].call(this,ie);return ie}})}function Ip(a,c,p,v,x,I,q,D,H,Q){var Z=c&X,ee=c&R,ie=c&P,fe=c&(U|B),ye=c&_,Ie=ie?t:pu(a);function me(){for(var Le=arguments.length,He=W(Le),Zr=Le;Zr--;)He[Zr]=arguments[Zr];if(fe)var _r=ml(me),Xr=ep(He,_r);if(v&&(He=Tx(He,v,x,fe)),I&&(He=Ax(He,I,q,fe)),Le-=Xr,fe&&Le<Q){var $t=un(He,_r);return jx(a,c,Ip,me.placeholder,p,He,$t,D,H,Q-Le)}var Un=ee?p:this,Hi=ie?Un[a]:a;return Le=He.length,D?He=H$(He,D):ye&&Le>1&&He.reverse(),Z&&H<Le&&(He.length=H),this&&this!==Nt&&this instanceof me&&(Hi=Ie||pu(Hi)),Hi.apply(Un,He)}return me}function Fx(a,c){return function(p,v){return Rs(p,a,c(v),{})}}function Pp(a,c){return function(p,v){var x;if(p===t&&v===t)return c;if(p!==t&&(x=p),v!==t){if(x===t)return v;typeof p=="string"||typeof v=="string"?(p=Kr(p),v=Kr(v)):(p=Rx(p),v=Rx(v)),x=a(p,v)}return x}}function $v(a){return Fi(function(c){return c=lt(c,yr(ge())),Te(function(p){var v=this;return a(c,function(x){return mr(x,v,p)})})})}function kp(a,c){c=c===t?" ":Kr(c);var p=c.length;if(p<2)return p?Ov(c,a):c;var v=Ov(c,Eo(a/fi(c)));return ys(c)?Is(vr(v),0,a).join(""):v.slice(0,a)}function R$(a,c,p,v){var x=c&R,I=pu(a);function q(){for(var D=-1,H=arguments.length,Q=-1,Z=v.length,ee=W(Z+H),ie=this&&this!==Nt&&this instanceof q?I:a;++Q<Z;)ee[Q]=v[Q];for(;H--;)ee[Q++]=arguments[++D];return mr(ie,x?p:this,ee)}return q}function Lx(a){return function(c,p,v){return v&&typeof v!="number"&&wr(c,p,v)&&(p=v=t),c=Ui(c),p===t?(p=c,c=0):p=Ui(p),v=v===t?c<p?1:-1:Ui(v),l$(c,p,v,a)}}function Tp(a){return function(c,p){return typeof c=="string"&&typeof p=="string"||(c=gn(c),p=gn(p)),a(c,p)}}function jx(a,c,p,v,x,I,q,D,H,Q){var Z=c&U,ee=Z?q:t,ie=Z?t:q,fe=Z?I:t,ye=Z?t:I;c|=Z?z:V,c&=~(Z?V:z),c&A||(c&=~(R|P));var Ie=[a,c,x,fe,ee,ye,ie,D,H,Q],me=p.apply(t,Ie);return Hv(a)&&Zx(me,Ie),me.placeholder=v,Xx(me,a,c)}function Mv(a){var c=rt[a];return function(p,v){if(p=gn(p),v=v==null?0:Ht(Ee(v),292),v&&$i(p)){var x=(nt(p)+"e").split("e"),I=c(x[0]+"e"+(+x[1]+v));return x=(nt(I)+"e").split("e"),+(x[0]+"e"+(+x[1]-v))}return c(p)}}var x$=Ss&&1/Ya(new Ss([,-0]))[1]==ue?function(a){return new Ss(a)}:ib;function Ux(a){return function(c){var p=sr(c);return p==Jt?vs(c):p==hr?tp(c):Ey(c,a(c))}}function Di(a,c,p,v,x,I,q,D){var H=c&P;if(!H&&typeof a!="function")throw new br(i);var Q=v?v.length:0;if(Q||(c&=~(z|V),v=x=t),q=q===t?q:gt(Ee(q),0),D=D===t?D:Ee(D),Q-=x?x.length:0,c&V){var Z=v,ee=x;v=x=t}var ie=H?t:Fv(a),fe=[a,c,p,v,x,Z,ee,I,q,D];if(ie&&L$(fe,ie),a=fe[0],c=fe[1],p=fe[2],v=fe[3],x=fe[4],D=fe[9]=fe[9]===t?H?0:a.length:gt(fe[9]-Q,0),!D&&c&(U|B)&&(c&=~(U|B)),!c||c==R)var ye=w$(a,c,p);else c==U||c==B?ye=_$(a,c,D):(c==z||c==(R|z))&&!x.length?ye=R$(a,c,p,v):ye=Ip.apply(t,fe);var Ie=ie?wx:Zx;return Xx(Ie(ye,fe),a,c)}function Hx(a,c,p,v){return a===t||jn(a,bs[p])&&!Ze.call(v,p)?c:a}function Bx(a,c,p,v,x,I){return Ct(a)&&Ct(c)&&(I.set(c,a),Dt(a,c,t,Bx,I),I.delete(c)),a}function C$(a){return gu(a)?t:a}function Vx(a,c,p,v,x,I){var q=p&w,D=a.length,H=c.length;if(D!=H&&!(q&&H>D))return!1;var Q=I.get(a),Z=I.get(c);if(Q&&Z)return Q==c&&Z==a;var ee=-1,ie=!0,fe=p&C?new Mi:t;for(I.set(a,c),I.set(c,a);++ee<D;){var ye=a[ee],Ie=c[ee];if(v)var me=q?v(Ie,ye,ee,c,a,I):v(ye,Ie,ee,a,c,I);if(me!==t){if(me)continue;ie=!1;break}if(fe){if(!Va(c,function(Le,He){if(!tt(fe,He)&&(ye===Le||x(ye,Le,p,v,I)))return fe.push(He)})){ie=!1;break}}else if(!(ye===Ie||x(ye,Ie,p,v,I))){ie=!1;break}}return I.delete(a),I.delete(c),ie}function E$(a,c,p,v,x,I,q){switch(p){case Pn:if(a.byteLength!=c.byteLength||a.byteOffset!=c.byteOffset)return!1;a=a.buffer,c=c.buffer;case Oi:return!(a.byteLength!=c.byteLength||!I(new Xa(a),new Xa(c)));case zr:case Or:case ao:return jn(+a,+c);case mt:return a.name==c.name&&a.message==c.message;case Yt:case lo:return a==c+"";case Jt:var D=vs;case hr:var H=v&w;if(D||(D=Ya),a.size!=c.size&&!H)return!1;var Q=q.get(a);if(Q)return Q==c;v|=C,q.set(a,c);var Z=Vx(D(a),D(c),v,x,I,q);return q.delete(a),Z;case Pa:if(To)return To.call(a)==To.call(c)}return!1}function O$(a,c,p,v,x,I){var q=p&w,D=Nv(a),H=D.length,Q=Nv(c),Z=Q.length;if(H!=Z&&!q)return!1;for(var ee=H;ee--;){var ie=D[ee];if(!(q?ie in c:Ze.call(c,ie)))return!1}var fe=I.get(a),ye=I.get(c);if(fe&&ye)return fe==c&&ye==a;var Ie=!0;I.set(a,c),I.set(c,a);for(var me=q;++ee<H;){ie=D[ee];var Le=a[ie],He=c[ie];if(v)var Zr=q?v(He,Le,ie,c,a,I):v(Le,He,ie,a,c,I);if(!(Zr===t?Le===He||x(Le,He,p,v,I):Zr)){Ie=!1;break}me||(me=ie=="constructor")}if(Ie&&!me){var _r=a.constructor,Xr=c.constructor;_r!=Xr&&"constructor"in a&&"constructor"in c&&!(typeof _r=="function"&&_r instanceof _r&&typeof Xr=="function"&&Xr instanceof Xr)&&(Ie=!1)}return I.delete(a),I.delete(c),Ie}function Fi(a){return Vv(Kx(a,t,sC),a+"")}function Nv(a){return Rp(a,Kt,jv)}function Dv(a){return Rp(a,qr,Wx)}var Fv=ol?function(a){return ol.get(a)}:ib;function Ap(a){for(var c=a.name+"",p=ws[c],v=Ze.call(ws,c)?p.length:0;v--;){var x=p[v],I=x.func;if(I==null||I==a)return x.name}return c}function ml(a){var c=Ze.call(O,"placeholder")?O:a;return c.placeholder}function ge(){var a=O.iteratee||rb;return a=a===rb?S:a,arguments.length?a(arguments[0],arguments[1]):a}function qp(a,c){var p=a.__data__;return M$(c)?p[typeof c=="string"?"string":"hash"]:p.map}function Lv(a){for(var c=Kt(a),p=c.length;p--;){var v=c[p],x=a[v];c[p]=[v,x,Yx(x)]}return c}function Mo(a,c){var p=So(a,c);return Fe(p)?p:t}function I$(a){var c=Ze.call(a,qi),p=a[qi];try{a[qi]=t;var v=!0}catch{}var x=Qa.call(a);return v&&(c?a[qi]=p:delete a[qi]),x}var jv=nl?function(a){return a==null?[]:(a=Ue(a),ci(nl(a),function(c){return xo.call(a,c)}))}:sb,Wx=nl?function(a){for(var c=[];a;)ui(c,jv(a)),a=el(a);return c}:sb,sr=Qt;(ru&&sr(new ru(new ArrayBuffer(1)))!=Pn||Io&&sr(new Io)!=Jt||nu&&sr(nu.resolve())!=Od||Ss&&sr(new Ss)!=hr||Po&&sr(new Po)!=Ut)&&(sr=function(a){var c=Qt(a),p=c==In?a.constructor:t,v=p?No(p):"";if(v)switch(v){case Gy:return Pn;case Ky:return Jt;case Qy:return Od;case Zy:return hr;case Xy:return Ut}return c});function P$(a,c,p){for(var v=-1,x=p.length;++v<x;){var I=p[v],q=I.size;switch(I.type){case"drop":a+=q;break;case"dropRight":c-=q;break;case"take":c=Ht(c,a+q);break;case"takeRight":a=gt(a,c-q);break}}return{start:a,end:c}}function k$(a){var c=a.match(kn);return c?c[1].split(ln):[]}function zx(a,c,p){c=Os(c,a);for(var v=-1,x=c.length,I=!1;++v<x;){var q=Ln(c[v]);if(!(I=a!=null&&p(a,q)))break;a=a[q]}return I||++v!=x?I:(x=a==null?0:a.length,!!x&&jp(x)&&Li(q,x)&&(Re(a)||Do(a)))}function T$(a){var c=a.length,p=new a.constructor(c);return c&&typeof a[0]=="string"&&Ze.call(a,"index")&&(p.index=a.index,p.input=a.input),p}function Jx(a){return typeof a.constructor=="function"&&!hu(a)?_s(el(a)):{}}function A$(a,c,p){var v=a.constructor;switch(c){case Oi:return qv(a);case zr:case Or:return new v(+a);case Pn:return m$(a,p);case ot:case ka:case Ta:case cs:case co:case us:case li:case fs:case Mc:return Px(a,p);case Jt:return new v;case ao:case lo:return new v(a);case Yt:return g$(a);case hr:return new v;case Pa:return y$(a)}}function q$(a,c){var p=c.length;if(!p)return a;var v=p-1;return c[v]=(p>1?"& ":"")+c[v],c=c.join(p>2?", ":" "),a.replace(Gt,`{
|
|
1
|
+
var nL=Object.create;var Hp=Object.defineProperty;var iL=Object.getOwnPropertyDescriptor;var sL=Object.getOwnPropertyNames;var oL=Object.getPrototypeOf,aL=Object.prototype.hasOwnProperty;var it=(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 oe=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var F=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},ks=(t,e)=>{for(var r in e)Hp(t,r,{get:e[r],enumerable:!0})},FC=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of sL(e))!aL.call(t,i)&&i!==r&&Hp(t,i,{get:()=>e[i],enumerable:!(n=iL(e,i))||n.enumerable});return t};var ab=(t,e,r)=>(r=t!=null?nL(oL(t)):{},FC(e||!t||!t.__esModule?Hp(r,"default",{value:t,enumerable:!0}):r,t)),vl=t=>FC(Hp({},"__esModule",{value:!0}),t);function It(t){return t.replace(/[^a-zA-Z0-9-_]/g,"_").replace(/\s+/g,"-").toLowerCase().substring(0,100)}function ft(t){let e=Date.now().toString(36)+(lL++).toString(36)+Math.random().toString(36).slice(2,7);return t?`${It(t)}_${e}`:e}function lb(){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 yu(t,e){let r={},n={};for(let[i,s]of Object.entries(t)){let a=i.toLowerCase();n[a]=i,r[i]=s}for(let[i,s]of Object.entries(e)){let a=i.toLowerCase(),l=n[a];l&&delete r[l],n[a]=i,r[i]=s}return r}function cL(t){return JSON.parse(JSON.stringify(t))}function uL(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function fL(t,e){try{return JSON.parse(t)}catch{return e}}function dL(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 pL(t){return t<1e3?`${t} ms`:`${(t/1e3).toFixed(2)} s`}var lL,yn=oe(()=>{"use strict";lL=0});import*as Xe from"fs";import*as en from"path";function Vp(t){if(!Xe.existsSync(t))return;let e={},r=en.join(t,Bp.preRequest);Xe.existsSync(r)&&(e.preRequest=Xe.readFileSync(r,"utf-8"));let n=en.join(t,Bp.postResponse);return Xe.existsSync(n)&&(e.postResponse=Xe.readFileSync(n,"utf-8")),Object.keys(e).length>0?e:void 0}async function Wp(t,e){await Xe.promises.mkdir(t,{recursive:!0});let r=en.join(t,Bp.preRequest);e.preRequest?await Xe.promises.writeFile(r,e.preRequest,"utf-8"):Xe.existsSync(r)&&await Xe.promises.unlink(r);let n=en.join(t,Bp.postResponse);e.postResponse?await Xe.promises.writeFile(n,e.postResponse,"utf-8"):Xe.existsSync(n)&&await Xe.promises.unlink(n)}function jC(t){for(let[e,r]of Object.entries(LC)){let n=en.join(t,e);if(Xe.existsSync(n))try{let i=Xe.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 UC(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 HC(t,e){for(let r of Object.keys(LC))if(r!==e){let n=en.join(t,r);if(Xe.existsSync(n))try{await Xe.promises.unlink(n)}catch{}}}function BC(t){if(Xe.existsSync(t))try{let e=Xe.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){console.error(`[FolderIO] Failed to load schema file ${t}:`,e);return}}async function VC(t,e,r){let n=en.join(t,vu.responseSchema),i=en.join(t,vu.bodySchema);e?await Xe.promises.writeFile(n,JSON.stringify(e,null,2),"utf-8"):Xe.existsSync(n)&&await Xe.promises.unlink(n),r?await Xe.promises.writeFile(i,JSON.stringify(r,null,2),"utf-8"):Xe.existsSync(i)&&await Xe.promises.unlink(i)}function cb(t,e){for(let r of t){if(r.id===e)return r;if(r.type==="folder"&&r.items){let n=cb(r.items,e);if(n)return n}}}function ub(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&&ub(n.items,e))return!0}return!1}function WC(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 fb(t,e){let r;try{r=Xe.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===tn)continue;if(n.name===e)return en.join(t,n.name);let i=fb(en.join(t,n.name),e);if(i)return i}}function hL(t){for(let e of[Rr.request,Rr.folder]){let r=en.join(t,e);if(Xe.existsSync(r))try{let n=Xe.readFileSync(r,"utf-8");return JSON.parse(n).id}catch{return}}}function db(t,e){let r;try{r=Xe.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===tn)continue;let i=en.join(t,n.name);if(hL(i)===e)return i;let s=db(i,e);if(s)return s}}function vn(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)||[],a=0;for(let y of s){let w=parseInt(y.substring(1));w>a&&(a=w)}let l="";if(a>0)l=`t${a}`;else{let y=r.match(/[_\s-](\d+\.\d+)[_\s-]/);y&&(l=`v${y[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 d=f.split("-").filter(y=>y.length>0),m=[];i&&m.push(i),m.push(...d),l&&m.push(l);let g=m.join("-");if(g||(g="item"),e.includes(g)){let y=2;for(;e.includes(`${g}-${y}`);)y++;g=`${g}-${y}`}return g}var Bp,Rr,LC,vu,tn,Fo=oe(()=>{"use strict";Bp={preRequest:"pre-request.js",postResponse:"post-response.js"},Rr={collection:"collection.json",folder:"folder.json",request:"request.json"},LC={"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"}},vu={responseSchema:"response.schema.json",bodySchema:"body.schema.json"},tn="scripts"});import*as xe from"fs";import*as Pe from"path";var Ts,zp=oe(()=>{"use strict";yn();Fo();Ts=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(){xe.existsSync(this.collectionsDir)||xe.mkdirSync(this.collectionsDir,{recursive:!0})}readJsonFileSafe(e,r){let n;try{n=xe.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(),!xe.existsSync(this.collectionsDir))return[];let e=xe.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=Pe.join(this.collectionsDir,e),n=Pe.join(r,Rr.collection);if(!xe.existsSync(n))return;let i=this.readJsonFileSafe(n,"collection");if(i)try{let s=this.loadScriptsFromDir(Pe.join(r,tn)),a=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:a}}catch(s){console.error(`[FolderCollectionStore] Failed to parse ${n}:`,s);return}}loadItemsFromDir(e,r,n){let i=[],s=new Map,a=xe.readdirSync(e,{withFileTypes:!0});for(let l of a){if(!l.isDirectory()||l.name===tn)continue;let f=Pe.join(e,l.name);if(xe.existsSync(Pe.join(f,Rr.folder))){let d=this.loadFolderFromDir(f,l.name);d&&s.set(l.name,d)}else if(xe.existsSync(Pe.join(f,Rr.request))){let d=this.loadRequestFromDir(f,l.name);d&&s.set(l.name,d)}}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=Pe.join(e,Rr.folder),i=this.readJsonFileSafe(n,"folder");if(i)try{let s=this.loadScriptsFromDir(Pe.join(e,tn)),a=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:a}}catch(s){console.error(`[FolderCollectionStore] Failed to load folder ${e}:`,s);return}}loadRequestFromDir(e,r){let n=Pe.join(e,Rr.request),i=this.readJsonFileSafe(n,"request");if(i)try{let s=this.loadScriptsFromDir(Pe.join(e,tn)),a=i.body,l=this.loadBodyFromDir(e);l&&(a=l);let f=this.loadSchemaFile(Pe.join(e,vu.responseSchema)),d=this.loadSchemaFile(Pe.join(e,vu.bodySchema)),m=Pe.join(e,"doc.md"),g=xe.existsSync(m)?xe.readFileSync(m,"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:a,auth:i.auth,settings:i.settings,scripts:s,deprecated:i.deprecated,...g&&{doc:g},...f&&{responseSchema:f},...d&&{bodySchema:d}}}catch(s){console.error(`[FolderCollectionStore] Failed to load request ${e}:`,s);return}}loadScriptsFromDir(e){return Vp(e)}loadBodyFromDir(e){return jC(e)}loadSchemaFile(e){return BC(e)}async saveSchemaFiles(e,r){return VC(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=ft(e.name));let r=this.idToSlugMap.get(e.id);if(!r){let l=xe.readdirSync(this.collectionsDir);r=vn(e.name,l),this.idToSlugMap.set(e.id,r),this.slugToIdMap.set(r,e.id)}let n=Pe.join(this.collectionsDir,r),i=!xe.existsSync(n);await xe.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},[a]=await Promise.all([this.saveItemsToDir(n,e.items,i),e.scripts?this.saveScriptsToDir(Pe.join(n,tn),e.scripts):Promise.resolve()]);a.length>0&&(s.order=a),await xe.promises.writeFile(Pe.join(n,Rr.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 a of r){let l=this.idToSlugMap.get(a.id);l||(l=vn(a.name,i),this.idToSlugMap.set(a.id,l),this.slugToIdMap.set(l,a.id)),i.push(l),s.push({item:a,slug:l})}return await Promise.all(s.map(async({item:a,slug:l})=>{let f=Pe.join(e,l);await xe.promises.mkdir(f,{recursive:!0}),a.type==="folder"?await this.saveFolderToDir(f,a,n):await this.saveRequestToDir(f,a,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(Pe.join(e,tn),r.scripts):Promise.resolve()]);s.length>0&&(i.order=s),await xe.promises.writeFile(Pe.join(e,Rr.folder),JSON.stringify(i,null,2),"utf-8")}async saveRequestToDir(e,r,n=!1){let{bodyForMetadata:i,externalBodyFile:s}=this.prepareBodyForSave(r.body),a={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}},l=[xe.promises.writeFile(Pe.join(e,Rr.request),JSON.stringify(a,null,2),"utf-8")];s&&l.push(xe.promises.writeFile(Pe.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(xe.promises.writeFile(Pe.join(e,"doc.md"),r.doc,"utf-8")),r.scripts&&l.push(this.saveScriptsToDir(Pe.join(e,tn),r.scripts)),await Promise.all(l)}prepareBodyForSave(e){return UC(e)}async cleanupOldBodyFiles(e,r){return HC(e,r)}async saveScriptsToDir(e,r){return Wp(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=Pe.join(this.collectionsDir,r);if(!xe.existsSync(n))return!1;try{return await xe.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?xe.existsSync(Pe.join(this.collectionsDir,r,Rr.collection)):!1}getCollectionPath(e){let r=this.idToSlugMap.get(e)||e;return Pe.join(this.collectionsDir,r)}getItemPath(e,r){return this.findItemPath(e,r)}async create(e,r){let n={id:r||ft(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(Pe.join(s,tn),n);let a=this.findItemById(i.items,r);a&&(a.scripts=n)}loadScripts(e,r){let n=this.findItemPath(e,r);if(n)return this.loadScriptsFromDir(Pe.join(n,tn))}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=Pe.join(this.collectionsDir,i),a=Pe.join(s,Rr.collection),l=xe.readFileSync(a,"utf-8"),d={...JSON.parse(l),...r,id:e};await xe.promises.writeFile(a,JSON.stringify(d,null,2),"utf-8"),r.name!==void 0&&(n.name=r.name),r.description!==void 0&&(n.description=r.description),r.version!==void 0&&(n.version=r.version),r.variables!==void 0&&(n.variables=r.variables),r.auth!==void 0&&(n.auth=r.auth)}async saveItem(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.idToSlugMap.get(e);if(!s)throw new Error(`Collection slug not found for ${e}`);let a;if(n){let m=this.findItemPath(e,n);if(!m)throw new Error(`Parent folder ${n} not found`);a=m}else a=Pe.join(this.collectionsDir,s);let l=this.idToSlugMap.get(r.id);if(!l){let m=xe.readdirSync(a).filter(g=>xe.statSync(Pe.join(a,g)).isDirectory()&&g!==tn);l=vn(r.name,m),this.idToSlugMap.set(r.id,l),this.slugToIdMap.set(l,r.id)}let f=Pe.join(a,l);await xe.promises.mkdir(f,{recursive:!0}),r.type==="folder"?await this.saveFolderToDir(f,r):await this.saveRequestToDir(f,r);let d=this.findItemById(i.items,r.id);if(d)Object.assign(d,r);else if(n){let m=this.findItemById(i.items,n);m&&m.type==="folder"&&(m.items=m.items||[],m.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||!xe.existsSync(i))return!1;try{await xe.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 a=this.findItemById(i.items,r);if(!a)return!1;let{id:l,type:f,items:d,...m}=n;return Object.assign(a,m),a.type==="folder"?await this.saveFolderToDir(s,a):await this.saveRequestToDir(s,a),!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 a=this.findItemPath(e,r);if(!a||!xe.existsSync(a))return!1;let l;if(n){let m=this.findItemPath(e,n);if(!m)return!1;l=m}else l=Pe.join(this.collectionsDir,s);let f=this.idToSlugMap.get(r);if(!f)return!1;let d=Pe.join(l,f);if(xe.existsSync(d))return!1;try{await xe.promises.rename(a,d);let m=this.findItemById(i.items,r);if(m){let g=m.type==="folder"?{...m,items:m.items?[...m.items]:[]}:{...m};if(this.deleteItemFromTree(i.items,r),n){let y=this.findItemById(i.items,n);y&&y.type==="folder"&&(y.items=y.items||[],y.items.push(g))}else i.items.push(g)}return!0}catch(m){return console.error(`[FolderCollectionStore] Failed to move item ${r}:`,m),!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 a=[];for(let l of n){let f=this.idToSlugMap.get(l);f&&a.push(f)}try{if(r){let l=this.findItemPath(e,r);if(!l)return!1;let f=Pe.join(l,Rr.folder),d=xe.readFileSync(f,"utf-8"),m=JSON.parse(d);m.order=a,await xe.promises.writeFile(f,JSON.stringify(m,null,2),"utf-8");let g=this.findItemById(i.items,r);g&&g.type==="folder"&&g.items&&(g.items=this.sortItemsByOrder(g.items,n))}else{let l=Pe.join(this.collectionsDir,s,Rr.collection),f=xe.readFileSync(l,"utf-8"),d=JSON.parse(f);d.order=a,await xe.promises.writeFile(l,JSON.stringify(d,null,2),"utf-8"),i.items=this.sortItemsByOrder(i.items,n)}return!0}catch(l){return console.error("[FolderCollectionStore] Failed to reorder items:",l),!1}}sortItemsByOrder(e,r){return WC(e,r)}findItemPath(e,r){let n=this.idToSlugMap.get(e);if(!n)return;let i=Pe.join(this.collectionsDir,n),s=db(i,r);if(s)return s;let a=this.load(e);if(a){let f=this.buildSlugPath(a.items,r);if(f)return Pe.join(i,...f)}let l=this.idToSlugMap.get(r);if(l)return fb(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 cb(e,r)}deleteItemFromTree(e,r){return ub(e,r)}}});var dt,Sl=oe(()=>{"use strict";dt=class{static parseSetCookie(e,r){let n=e.split(";").map(m=>m.trim());if(n.length===0)return null;let[i,...s]=n,a=i.indexOf("=");if(a===-1)return null;let l=i.substring(0,a).trim(),f=i.substring(a+1).trim(),d={name:l,value:f,domain:r};for(let m of s){let g=m.indexOf("="),y=(g===-1?m:m.substring(0,g)).toLowerCase(),w=g===-1?"":m.substring(g+1);switch(y){case"domain":d.domain=w.startsWith(".")?w.substring(1):w;break;case"path":d.path=w;break;case"expires":d.expires=w;break;case"max-age":d.maxAge=parseInt(w,10);break;case"httponly":d.httpOnly=!0;break;case"secure":d.secure=!0;break;case"samesite":d.sameSite=w;break}}return d}static parseCookieHeaders(e,r){let n=[],i=e["set-cookie"]||e["Set-Cookie"];if(!i)return n;let s=Array.isArray(i)?i:[i];for(let a of s){let l=this.parseSetCookie(a,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 As from"fs";import*as Lo from"path";function Yp(t){let e=t.toLowerCase();return e==="_global.json"||e==="_global.local.json"||e.endsWith(".local.json")}function _u(t){if(!As.existsSync(t))return gL();let e=Jp(Lo.join(t,"_global.json"))||{},r=e.globalVariables||e.variables||{},n=e.defaultHeaders||{},i=As.readdirSync(t).filter(d=>d.endsWith(".json")).filter(d=>!d.endsWith(".local.json")).filter(d=>!Yp(d)),s={};for(let d of i){let m=Jp(Lo.join(t,d))||{},g=Lo.basename(d,".json");s[g]={description:m.description,requiresConfirmation:m.requiresConfirmation,variables:m.variables||{},secretVariables:m.secretVariables}}let l=(Jp(Lo.join(t,"_global.local.json"))||{}).variables||{},f={};for(let d of Object.keys(s)){let m=Lo.join(t,`${d}.local.json`);if(As.existsSync(m)){let g=Jp(m)||{};f[d]={variables:g.variables||{}}}}return{globalVariables:r,defaultHeaders:n,environments:s,localVariables:l,localCredentials:f}}function gL(){return{globalVariables:{},defaultHeaders:{},environments:{},localVariables:{},localCredentials:{}}}function Jp(t){try{if(!As.existsSync(t))return null;let e=As.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 Gp=oe(()=>{"use strict"});var Hn,wl=oe(()=>{"use strict";Hn=class{buildUrl(e,r={},n={}){let i=e;return i=this.replacePathParams(i,r),i=this.appendQueryParams(i,n),i}replacePathParams(e,r){let n="",i="",s=e,a="",l=e.indexOf("?");l!==-1&&(a=e.substring(l),s=e.substring(0,l));let f=s.match(/^(https?:\/\/)([^\/]*)(\/.*)?$/);f&&(n=f[1],i=f[2],s=f[3]||"/");let d=/:(\w+)(?:\([^)]*\))?(\?)?/g,m=s.replace(d,(g,y,w)=>{let C=r[y];return C!==void 0&&C!==""?encodeURIComponent(C):w?"":(console.warn(`[UrlBuilder] Missing required path parameter: ${y}`),g)});return m=m.replace(/([^:])\/+/g,"$1/"),m.length>1&&m.endsWith("/")&&(m=m.slice(0,-1)),`${n}${i}${m}${a}`}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,d]=e.split("?");n=f,d&&new URLSearchParams(d).forEach((g,y)=>{i[y]=g})}let s={...i,...r},a=new URLSearchParams;for(let[f,d]of Object.entries(s))d!=null&&a.append(f,d);let l=a.toString();return l?`${n}?${l}`:n}}});function JC(t,e=0){return(Zt[t[e+0]]+Zt[t[e+1]]+Zt[t[e+2]]+Zt[t[e+3]]+"-"+Zt[t[e+4]]+Zt[t[e+5]]+"-"+Zt[t[e+6]]+Zt[t[e+7]]+"-"+Zt[t[e+8]]+Zt[t[e+9]]+"-"+Zt[t[e+10]]+Zt[t[e+11]]+Zt[t[e+12]]+Zt[t[e+13]]+Zt[t[e+14]]+Zt[t[e+15]]).toLowerCase()}var Zt,YC=oe(()=>{Zt=[];for(let t=0;t<256;++t)Zt.push((t+256).toString(16).slice(1))});function mb(){return crypto.getRandomValues(yL)}var yL,GC=oe(()=>{yL=new Uint8Array(16)});function vL(t,e,r){return!e&&!t&&crypto.randomUUID?crypto.randomUUID():bL(t,e,r)}function bL(t,e,r){t=t||{};let n=t.random??t.rng?.()??mb();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 JC(n)}var _l,KC=oe(()=>{GC();YC();_l=vL});var gb=oe(()=>{KC()});function SL(t=0,e=999){return Math.floor(Math.random()*(e-t+1))+t}function wL(){return Date.now()}function QC(){return _l()}function _L(){return _l()}function ZC(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 RL(){let t=ZC(8).toLowerCase(),e=["example.com","test.org","mail.dev","sample.net"];return`${t}@${e[Math.floor(Math.random()*e.length)]}`}function xL(){return Math.random()<.5}function CL(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 EL(){return Math.floor(Date.now()/1e3)}function OL(){return new Date().toISOString()}function IL(){return new Date().toISOString().split("T")[0]}function PL(){return new Date().toISOString().split("T")[1].split(".")[0]}function kL(){return new Date().toISOString()}function TL(t=""){return Buffer.from(String(t)).toString("base64")}function AL(t=""){return Buffer.from(String(t),"base64").toString("utf-8")}function qL(t=""){return encodeURIComponent(String(t))}function $L(t=""){return decodeURIComponent(String(t))}function ML(t){return t?t.split(",").map(e=>{let r=e.trim(),n=Number(r);return!isNaN(n)&&r!==""?n:r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'")?r.slice(1,-1):r}):[]}function Vi(t,e){let r=XC[t];return r?e&&e.length>0?r(...e):r():null}function NL(t){return!t||typeof t!="string"?t:t.replace(/\{\{\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?\}\}/g,(e,r,n)=>{try{let i=n?ML(n):void 0,s=Vi(r,i);return s===null?e:String(s)}catch{return e}})}function jo(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],a=i[1];if(!(s in e)){let l=Vi(a);l!==null&&(n||(n={...e}),n[s]=l)}}return n??e}var XC,Kp=oe(()=>{"use strict";gb();XC={randomInt:SL,timestamp:wL,guid:_L,uuid:QC,randomUUID:QC,randomString:ZC,randomHexadecimal:CL,randomEmail:RL,randomBoolean:xL,isoTimestamp:kL,timestamp_s:EL,datetime:OL,date:IL,time:PL,base64Encode:TL,base64Decode:AL,urlEncode:qL,urlDecode:$L}});import*as Qp from"vm";function Uo(t){let e=t.trim();return!e||/^(\$?)[a-zA-Z_][a-zA-Z0-9_]*(\([^)]*\))?$/.test(e)||/(?<!\|)\|(?!\|)/.test(e)?!1:/[+\-*/%<>=!&|?:~^()[\]{}.,`]/.test(e)}function Ho(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=Qp.createContext(r);return Qp.runInContext(t,n,{timeout:DL,displayErrors:!1})}catch{return}}var DL,Zp=oe(()=>{"use strict";DL=100});import*as Xp from"crypto";function FL(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function xu(t){if(!t||!t.includes("|"))return null;let e=LL(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 a=jL(s);a&&n.push(a)}return n.length===0?null:{input:r,filters:n}}function LL(t){let e=[],r="",n=0,i=!1,s=!1;for(let a=0;a<t.length;a++){let l=t[a],f=a>0?t[a-1]:"",d=a<t.length-1?t[a+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(d==="|"){r+="||",a++;continue}e.push(r),r="";continue}r+=l}return r&&e.push(r),e}function jL(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:UL(n)}}function UL(t){if(!t||!t.trim())return[];let e=[],r="",n=!1,i=!1;for(let s=0;s<t.length;s++){let a=t[s];if((s>0?t[s-1]:"")==="\\"){r+=a;continue}if(a==="'"&&!i){n=!n,r+=a;continue}else if(a==='"'&&!n){i=!i,r+=a;continue}else if(a===","&&!n&&!i){e.push(r.trim()),r="";continue}r+=a}return r.trim()&&e.push(r.trim()),e}function Pt(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=FL(e[t]),i=Number(n);return!isNaN(i)&&n!==""?i:n}return t}function Cu(t,e,r={}){let n=t;for(let i of e)n=HL(n,i.name,i.args,r);return n}function HL(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=Pt(r[0],n),s=r[1]!==void 0?Pt(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(Pt(r[0],n)):"",s=r[1]!==void 0?String(Pt(r[1],n)):"";return String(t).replace(new RegExp(VL(i),"g"),s)}case"split":{let i=r[0]!==void 0?String(Pt(r[0],n)):",";return String(t).split(i)}case"join":{let i=r[0]!==void 0?String(Pt(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(Pt(r[0],n)):"{0}";i=i.replace("{0}",String(t));for(let s=1;s<r.length;s++){let a=Pt(r[s],n);i=i.replace(`{${s}}`,String(a))}return i}case"add":{let i=Pt(r[0],n);return Number(t)+i}case"subtract":{let i=Pt(r[0],n);return Number(t)-i}case"multiply":{let i=Pt(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?Pt(r[0],n):"md5").toLowerCase(),s=String(r[1]!==void 0?Pt(r[1],n):"base64"),l={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[i]||"md5";return Xp.createHash(l).update(String(t)).digest(s)}case"hmac":{let i=r[0]?String(Pt(r[0],n)):"",s=String(r[1]!==void 0?Pt(r[1],n):"sha256").toLowerCase(),a=String(r[2]!==void 0?Pt(r[2],n):"base64"),f={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[s]||"sha256";return Xp.createHmac(f,i).update(String(t)).digest(a)}case"first":return Array.isArray(t)?t[0]:t;case"last":return Array.isArray(t)?t[t.length-1]:t;case"at":{let i=Pt(r[0],n);return Array.isArray(t)?t.at(i):t}case"slice":{let i=Pt(r[0],n),s=r[1]!==void 0?Pt(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:BL(t,r[0],n);case"map":{if(!Array.isArray(t))return t;let i=r.map(s=>String(Pt(s,n)));return i.length===1?t.map(s=>Ru(s,i[0])):t.map(s=>{let a={};for(let l of i){let f=Ru(s,l);f!==void 0&&(a[l]=f)}return a})}case"prop":{let i=r[0]!==void 0?String(Pt(r[0],n)):"";if(Array.isArray(t)){let s=t.map(a=>Ru(a,i)).filter(a=>a!==void 0);return s.length===1?s[0]:s.join(",")}return t&&typeof t=="object"?Ru(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 BL(t,e,r){let n=e.match(/^([\w.]+)\s*(>=|<=|!=|\*=|\^=|\$=|>|<|=)\s*(.+)$/);if(!n)return t;let[,i,s,a]=n,l=Pt(a,r);return t.filter(f=>{let d=Ru(f,i);if(d===void 0)return!1;switch(s){case">":return Number(d)>Number(l);case">=":return Number(d)>=Number(l);case"<":return Number(d)<Number(l);case"<=":return Number(d)<=Number(l);case"=":return String(d)===String(l);case"!=":return String(d)!==String(l);case"*=":return String(d).includes(String(l));case"^=":return String(d).startsWith(String(l));case"$=":return String(d).endsWith(String(l));default:return!0}})}function Ru(t,e){if(!(!t||typeof t!="object"))return e in t?t[e]:e.split(".").reduce((r,n)=>r?.[n],t)}function VL(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var eh=oe(()=>{"use strict"});function eE(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],a=Number(s);return!isNaN(a)&&s!==""?a:s}return n})}function WL(t){return new Bo(t)}var Bo,Vo,Eu=oe(()=>{"use strict";Kp();Zp();eh();Bo=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 a=this.resolveSinglePass(i,r,n);if(a===i)break;i=a}return i}resolveSinglePass(e,r,n){if(!n)return e.replace(/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,(f,d)=>this.resolveTemplateContent(d.trim(),r,f));let i="",s=0,a=/\{\{((?:[^}]|\}(?!\}))+)\}\}/g,l;for(;(l=a.exec(e))!==null;){let f=l[1].trim(),d=this.resolveTemplateContent(f,r,l[0]);if(d!==l[0]){i+=e.slice(s,l.index);let m=this.getStringContext(e,l.index);i+=m?this.escapeForString(String(d),m):String(d)}else i+=e.slice(s,l.index+l[0].length);s=l.index+l[0].length}return i+=e.slice(s),i}resolveObject(e,r=!1){if(typeof e=="string")return this.resolveString(e,r);if(Array.isArray(e))return e.map(n=>this.resolveObject(n,r));if(e!==null&&typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.resolveObject(s,r);return n}return e}resolveObjectWithExtra(e,r,n=!1){if(typeof e=="string")return this.resolveStringWithExtra(e,r,n);if(Array.isArray(e))return e.map(i=>this.resolveObjectWithExtra(i,r,n));if(e!==null&&typeof e=="object"){let i={};for(let[s,a]of Object.entries(e))i[s]=this.resolveObjectWithExtra(a,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=eE(i[2],r),f=Vi(i[1],l);return f!==null?String(f):n}let s=xu(e);if(s){let l=this.resolveFilterInput(s.input,r);if(l!==void 0){let f=Cu(l,s.filters,r);return f!==void 0?String(f):n}return n}let a=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(a){let l=a[1];if(r[l]!==void 0){let f=this.deserializeValue(r[l]),d=a[2],m=this.resolvePropertyAccess(f,d);if(m!==void 0)return typeof m=="object"?JSON.stringify(m):String(m)}}if(r[e]!==void 0){let l=r[e];return typeof l=="string"&&l.charCodeAt(0)===30?l.slice(1):String(l)}if(Uo(e)){let l=this.deserializeVariables(r),f=jo(e,l),d=Ho(e,f);if(d!==void 0)return String(d)}return n}resolveFilterInput(e,r){if(e==="@")return"";if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1);let n=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(n){let s=eE(n[2],r),a=Vi(n[1],s);return a!==null?a: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 a=this.deserializeValue(r[s]),l=this.resolvePropertyAccess(a,i[2]);if(l!==void 0)return l}}if(r[e]!==void 0)return this.deserializeValue(r[e]);if(Uo(e)){let s=this.deserializeVariables(r),a=jo(e,s),l=Ho(e,a);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 a=s[1];/^\d+$/.test(a)?n=n[Number(a)]:n=n[a.slice(1,-1)]}else s[2]!==void 0&&(n=n[s[2]])}return n}escapeForString(e,r){let n=e.replace(/\\/g,"\\\\");return r==='"'?n=n.replace(/"/g,'\\"'):n=n.replace(/'/g,"\\'"),n.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}getStringContext(e,r){let n=null;for(let i=0;i<r;i++){let s=e[i];(i>0?e[i-1]:"")!=="\\"&&(s==='"'||s==="'")&&(n===null?n=s:n===s&&(n=null))}return n}},Vo=class{interpolate(e,r){return!e||typeof e!="string"?e:new Bo({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 zL from"http";import*as Ou from"https";import{URL as tE}from"url";import*as th from"zlib";var Bn,Wo,Iu=oe(()=>{"use strict";Bn={timeout:3e4,followRedirects:!0,followOriginalMethod:!1,followAuthHeader:!1,maxRedirects:10,strictSSL:!0,decompress:!0,includeCookies:!1},Wo=class{settings;version;constructor(e){this.settings={...Bn,...e};try{this.version=it("../../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(),a=new tE(e.url),l=a.protocol==="https:",f=this.sanitizeHeaders(e.headers||{});Object.keys(f).some(g=>g.toLowerCase()==="user-agent")||(f["User-Agent"]=`HttpForge/${this.version}`);let m={hostname:a.hostname,port:a.port||(l?443:80),path:a.pathname+a.search,method:e.method,headers:{...f},timeout:r.timeout||void 0};return r.decompress&&!f["accept-encoding"]&&!f["Accept-Encoding"]&&(m.headers["Accept-Encoding"]="gzip, deflate"),l&&(m.rejectUnauthorized=r.strictSSL,r.strictSSL?m.agent=Ou.globalAgent:m.agent=new Ou.Agent({rejectUnauthorized:!1})),new Promise((g,y)=>{if(i?.aborted){let R=new Error("Request cancelled");R.name="AbortError",y(R);return}let C=(l?Ou:zL).request(m,async R=>{let T=R.statusCode||0;if(r.followRedirects&&[301,302,303,307,308].includes(T)){if(n>=r.maxRedirects){y(new Error(`Maximum redirects (${r.maxRedirects}) exceeded`));return}let U=R.headers.location;if(!U){y(new Error("Redirect response missing Location header"));return}let B=new tE(U,e.url).toString(),V=e.method;!r.followOriginalMethod&&[301,302,303].includes(T)&&(V="GET");let W={...e.headers};r.followAuthHeader||(delete W.authorization,delete W.Authorization);try{let X=await this.executeInternal({...e,url:B,method:V,headers:W,body:V==="GET"?void 0:e.body},r,n+1,i),P=Date.now();X.time=P-s,g(X)}catch(X){y(X)}return}let A=[];R.on("data",U=>A.push(U)),R.on("end",()=>{let U=Date.now(),B=Buffer.concat(A),V=R.headers["content-encoding"];if(r.decompress&&V)try{V==="gzip"?B=th.gunzipSync(B):V==="deflate"&&(B=th.inflateSync(B))}catch(k){console.warn("[NodeHttpClient] Decompression failed:",k)}let W=B.toString("utf-8"),X;try{X=JSON.parse(W)}catch{X=W}let P={};for(let[k,M]of Object.entries(R.headers))(typeof M=="string"||Array.isArray(M))&&(P[k]=M);let _=this.parseCookies(R.headers["set-cookie"],a.hostname);g({status:R.statusCode||0,statusText:R.statusMessage||"",headers:P,cookies:_,body:X,time:U-s,size:B.length})})});if(i&&i.addEventListener("abort",()=>{C.destroy();let R=new Error("Request cancelled");R.name="AbortError",y(R)}),C.on("error",R=>{y(R)}),C.on("timeout",()=>{C.destroy(),y(new Error("Request timeout"))}),e.body!==void 0&&e.body!==null){let R=typeof e.body=="string"?e.body:JSON.stringify(e.body);C.write(R)}C.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(m=>m.trim()),[s,...a]=i,[l,f]=s.split("="),d={name:l.trim(),value:f?.trim()||"",domain:r};for(let m of a){let[g,y]=m.split("=");switch(g.toLowerCase().trim()){case"domain":d.domain=y?.trim();break;case"path":d.path=y?.trim();break;case"expires":d.expires=y?.trim();break;case"httponly":d.httpOnly=!0;break;case"secure":d.secure=!0;break}}return d}):[]}}});function yb(t){return{timeout:t?.timeout??Bn.timeout,followRedirects:t?.followRedirects??Bn.followRedirects,followOriginalMethod:t?.followOriginalMethod??Bn.followOriginalMethod,followAuthHeader:t?.followAuthHeader??Bn.followAuthHeader,maxRedirects:t?.maxRedirects??Bn.maxRedirects,strictSSL:t?.strictSSL??Bn.strictSSL,decompress:t?.decompress??Bn.decompress,includeCookies:t?.includeCookies??Bn.includeCookies}}var vb=oe(()=>{"use strict";Iu()});var Wi,Pu=oe(()=>{"use strict";vb();Wi=class{constructor(e,r,n){this.urlBuilder=e;this.interceptors=r;this.httpClient=n}urlBuilder;interceptors;httpClient;async execute(e){let r=yb(e.settings),n={},i;try{i=await this.interceptors.executeRequestInterceptors(e,n)}catch(s){let a=await this.interceptors.executeErrorInterceptors(s,e,n);if(a)return a;throw s}try{let s=await this.httpClient.send({...i,settings:r});return await this.interceptors.executeResponseInterceptors(s,i,n)}catch(s){let a=await this.interceptors.executeErrorInterceptors(s,i,n);if(a)return a;throw s}}buildUrl(e,r={},n={}){return this.urlBuilder.buildUrl(e,r,n)}}});var zi,bb,Sb,wb,ku=oe(()=>{"use strict";zi=class{requestInterceptors=[];responseInterceptors=[];errorInterceptors=[];addRequestInterceptor(e){return this.requestInterceptors.push(e),this.sortByPriority(this.requestInterceptors),this}addResponseInterceptor(e){return this.responseInterceptors.push(e),this.sortByPriority(this.responseInterceptors),this}addErrorInterceptor(e){return this.errorInterceptors.push(e),this.sortByPriority(this.errorInterceptors),this}removeRequestInterceptor(e){let r=this.requestInterceptors.findIndex(n=>n.name===e);return r>=0?(this.requestInterceptors.splice(r,1),!0):!1}removeResponseInterceptor(e){let r=this.responseInterceptors.findIndex(n=>n.name===e);return r>=0?(this.responseInterceptors.splice(r,1),!0):!1}removeErrorInterceptor(e){let r=this.errorInterceptors.findIndex(n=>n.name===e);return r>=0?(this.errorInterceptors.splice(r,1),!0):!1}async executeRequestInterceptors(e,r){let n=e;for(let i of this.requestInterceptors)try{n=await i.intercept(n,r)}catch(s){throw console.error(`[InterceptorChain] Request interceptor '${i.name}' failed:`,s),s}return n}async executeResponseInterceptors(e,r,n){let i=e;for(let s of this.responseInterceptors)try{i=await s.intercept(i,r,n)}catch(a){throw console.error(`[InterceptorChain] Response interceptor '${s.name}' failed:`,a),a}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))}},bb=class{name="logging";priority=1e3;intercept(e,r){return e}},Sb=class{name="timing";priority=1;intercept(e,r,n){return e}},wb=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 rE=F((Rl,Tu)=>{(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`",a="Invalid `imports` option passed into `_.template`",l="__lodash_hash_undefined__",f=500,d="__lodash_placeholder__",m=1,g=2,y=4,w=1,C=2,R=1,T=2,A=4,U=8,B=16,V=32,W=64,X=128,P=256,_=512,k=30,M="...",j=800,$=16,Y=1,K=2,ne=3,ue=1/0,et=9007199254740991,_e=17976931348623157e292,he=NaN,Ce=4294967295,vt=Ce-1,Et=Ce>>>1,ce=[["ary",X],["bind",R],["bindKey",T],["curry",U],["curryRight",B],["flip",_],["partial",V],["partialRight",W],["rearg",P]],pr="[object Arguments]",ai="[object Array]",Rt="[object AsyncFunction]",zr="[object Boolean]",Or="[object Date]",ht="[object DOMException]",mt="[object Error]",on="[object Function]",oo="[object GeneratorFunction]",Jt="[object Map]",ao="[object Number]",Wg="[object Null]",In="[object Object]",Od="[object Promise]",Id="[object Proxy]",Yt="[object RegExp]",hr="[object Set]",lo="[object String]",Pa="[object Symbol]",Pd="[object Undefined]",Ut="[object WeakMap]",kd="[object WeakSet]",Oi="[object ArrayBuffer]",Pn="[object DataView]",ot="[object Float32Array]",ka="[object Float64Array]",Ta="[object Int8Array]",cs="[object Int16Array]",co="[object Int32Array]",us="[object Uint8Array]",li="[object Uint8ClampedArray]",fs="[object Uint16Array]",Mc="[object Uint32Array]",Aa=/\b__p \+= '';/g,zg=/\b(__p \+=) '' \+/g,uo=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ii=/&(?:amp|lt|gt|quot|#39);/g,qa=/[&<>"']/g,$a=RegExp(Ii.source),le=RegExp(qa.source),Jg=/<%-([\s\S]+?)%>/g,Yg=/<%([\s\S]+?)%>/g,an=/<%=([\s\S]+?)%>/g,Ir=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qe=/^\w*$/,Nc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ke=/[\\^$.*+?()[\]{}|]/g,fo=RegExp(Ke.source),Dc=/^\s+/,Ma=/\s/,Gt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,kn=/\{\n\/\* \[wrapped with (.+)\] \*/,ln=/,? & /,At=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Pr=/[()=,{}\[\]\/\s]/,Tn=/\\(\\)?/g,Pi=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Td=/\w*$/,Gg=/^[-+]0x[0-9a-f]+$/i,po=/^0b[01]+$/i,Ad=/^\[object .+?Constructor\]$/,Kg=/^0o[0-7]+$/i,ds=/^(?:0|[1-9]\d*)$/,ho=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,mo=/($^)/,Qg=/['\n\r\u2028\u2029\\]/g,Na="\\ud800-\\udfff",Zg="\\u0300-\\u036f",xt="\\ufe20-\\ufe2f",Fc="\\u20d0-\\u20ff",qd=Zg+xt+Fc,Lc="\\u2700-\\u27bf",jc="a-z\\xdf-\\xf6\\xf8-\\xff",Xg="\\xac\\xb1\\xd7\\xf7",ey="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ty="\\u2000-\\u206f",ry=" \\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",$d="A-Z\\xc0-\\xd6\\xd8-\\xde",Md="\\ufe0e\\ufe0f",Uc=Xg+ey+ty+ry,Da="['\u2019]",ny="["+Na+"]",Nd="["+Uc+"]",Fa="["+qd+"]",Hc="\\d+",iy="["+Lc+"]",ps="["+jc+"]",go="[^"+Na+Uc+Hc+Lc+jc+$d+"]",La="\\ud83c[\\udffb-\\udfff]",yo="(?:"+Fa+"|"+La+")",cn="[^"+Na+"]",Bc="(?:\\ud83c[\\udde6-\\uddff]){2}",Vc="[\\ud800-\\udbff][\\udc00-\\udfff]",hs="["+$d+"]",Dd="\\u200d",Fd="(?:"+ps+"|"+go+")",sy="(?:"+hs+"|"+go+")",Ld="(?:"+Da+"(?:d|ll|m|re|s|t|ve))?",jd="(?:"+Da+"(?:D|LL|M|RE|S|T|VE))?",ja=yo+"?",Ud="["+Md+"]?",Hd="(?:"+Dd+"(?:"+[cn,Bc,Vc].join("|")+")"+Ud+ja+")*",oy="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ay="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Bd=Ud+ja+Hd,ly="(?:"+[iy,Bc,Vc].join("|")+")"+Bd,cy="(?:"+[cn+Fa+"?",Fa,Bc,Vc,ny].join("|")+")",uy=RegExp(Da,"g"),fy=RegExp(Fa,"g"),Wc=RegExp(La+"(?="+La+")|"+cy+Bd,"g"),dy=RegExp([hs+"?"+ps+"+"+Ld+"(?="+[Nd,hs,"$"].join("|")+")",sy+"+"+jd+"(?="+[Nd,hs+Fd,"$"].join("|")+")",hs+"?"+Fd+"+"+Ld,hs+"+"+jd,ay,oy,Hc,ly].join("|"),"g"),py=RegExp("["+Dd+Na+qd+Md+"]"),hy=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,my=["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"],gy=-1,ut={};ut[ot]=ut[ka]=ut[Ta]=ut[cs]=ut[co]=ut[us]=ut[li]=ut[fs]=ut[Mc]=!0,ut[pr]=ut[ai]=ut[Oi]=ut[zr]=ut[Pn]=ut[Or]=ut[mt]=ut[on]=ut[Jt]=ut[ao]=ut[In]=ut[Yt]=ut[hr]=ut[lo]=ut[Ut]=!1;var at={};at[pr]=at[ai]=at[Oi]=at[Pn]=at[zr]=at[Or]=at[ot]=at[ka]=at[Ta]=at[cs]=at[co]=at[Jt]=at[ao]=at[In]=at[Yt]=at[hr]=at[lo]=at[Pa]=at[us]=at[li]=at[fs]=at[Mc]=!0,at[mt]=at[on]=at[Ut]=!1;var zc={\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"},Jc={"&":"&","<":"<",">":">",'"':""","'":"'"},yy={"&":"&","<":"<",">":">",""":'"',"'":"'"},Vd={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Wd=parseFloat,vy=parseInt,zd=typeof global=="object"&&global&&global.Object===Object&&global,by=typeof self=="object"&&self&&self.Object===Object&&self,Nt=zd||by||Function("return this")(),Ua=typeof Rl=="object"&&Rl&&!Rl.nodeType&&Rl,Qe=Ua&&typeof Tu=="object"&&Tu&&!Tu.nodeType&&Tu,ms=Qe&&Qe.exports===Ua,ki=ms&&zd.process,kr=(function(){try{var L=Qe&&Qe.require&&Qe.require("util").types;return L||ki&&ki.binding&&ki.binding("util")}catch{}})(),Yc=kr&&kr.isArrayBuffer,Jd=kr&&kr.isDate,Yd=kr&&kr.isMap,vo=kr&&kr.isRegExp,An=kr&&kr.isSet,Ha=kr&&kr.isTypedArray;function mr(L,G,z){switch(z.length){case 0:return L.call(G);case 1:return L.call(G,z[0]);case 2:return L.call(G,z[0],z[1]);case 3:return L.call(G,z[0],z[1],z[2])}return L.apply(G,z)}function qn(L,G,z,ae){for(var be=-1,Ye=L==null?0:L.length;++be<Ye;){var rt=L[be];G(ae,rt,z(rt),L)}return ae}function gr(L,G){for(var z=-1,ae=L==null?0:L.length;++z<ae&&G(L[z],z,L)!==!1;);return L}function Gc(L,G){for(var z=L==null?0:L.length;z--&&G(L[z],z,L)!==!1;);return L}function Gd(L,G){for(var z=-1,ae=L==null?0:L.length;++z<ae;)if(!G(L[z],z,L))return!1;return!0}function ci(L,G){for(var z=-1,ae=L==null?0:L.length,be=0,Ye=[];++z<ae;){var rt=L[z];G(rt,z,L)&&(Ye[be++]=rt)}return Ye}function Ba(L,G){var z=L==null?0:L.length;return!!z&&Ti(L,G,0)>-1}function gs(L,G,z){for(var ae=-1,be=L==null?0:L.length;++ae<be;)if(z(G,L[ae]))return!0;return!1}function lt(L,G){for(var z=-1,ae=L==null?0:L.length,be=Array(ae);++z<ae;)be[z]=G(L[z],z,L);return be}function ui(L,G){for(var z=-1,ae=G.length,be=L.length;++z<ae;)L[be+z]=G[z];return L}function Kc(L,G,z,ae){var be=-1,Ye=L==null?0:L.length;for(ae&&Ye&&(z=L[++be]);++be<Ye;)z=G(z,L[be],be,L);return z}function Sy(L,G,z,ae){var be=L==null?0:L.length;for(ae&&be&&(z=L[--be]);be--;)z=G(z,L[be],be,L);return z}function Va(L,G){for(var z=-1,ae=L==null?0:L.length;++z<ae;)if(G(L[z],z,L))return!0;return!1}var wy=bo("length");function _y(L){return L.split("")}function Ry(L){return L.match(At)||[]}function Kd(L,G,z){var ae;return z(L,function(be,Ye,rt){if(G(be,Ye,rt))return ae=Ye,!1}),ae}function Wa(L,G,z,ae){for(var be=L.length,Ye=z+(ae?1:-1);ae?Ye--:++Ye<be;)if(G(L[Ye],Ye,L))return Ye;return-1}function Ti(L,G,z){return G===G?Ay(L,G,z):Wa(L,Ai,z)}function xy(L,G,z,ae){for(var be=z-1,Ye=L.length;++be<Ye;)if(ae(L[be],G))return be;return-1}function Ai(L){return L!==L}function Qd(L,G){var z=L==null?0:L.length;return z?Zc(L,G)/z:he}function bo(L){return function(G){return G==null?t:G[L]}}function Qc(L){return function(G){return L==null?t:L[G]}}function za(L,G,z,ae,be){return be(L,function(Ye,rt,Ue){z=ae?(ae=!1,Ye):G(z,Ye,rt,Ue)}),z}function Cy(L,G){var z=L.length;for(L.sort(G);z--;)L[z]=L[z].value;return L}function Zc(L,G){for(var z,ae=-1,be=L.length;++ae<be;){var Ye=G(L[ae]);Ye!==t&&(z=z===t?Ye:z+Ye)}return z}function Xc(L,G){for(var z=-1,ae=Array(L);++z<L;)ae[z]=G(z);return ae}function Ey(L,G){return lt(G,function(z){return[z,L[z]]})}function eu(L){return L&&L.slice(0,rp(L)+1).replace(Dc,"")}function yr(L){return function(G){return L(G)}}function Ja(L,G){return lt(G,function(z){return L[z]})}function tt(L,G){return L.has(G)}function Zd(L,G){for(var z=-1,ae=L.length;++z<ae&&Ti(G,L[z],0)>-1;);return z}function Xd(L,G){for(var z=L.length;z--&&Ti(G,L[z],0)>-1;);return z}function ep(L,G){for(var z=L.length,ae=0;z--;)L[z]===G&&++ae;return ae}var Oy=Qc(zc),Iy=Qc(Jc);function Py(L){return"\\"+Vd[L]}function So(L,G){return L==null?t:L[G]}function ys(L){return py.test(L)}function ky(L){return hy.test(L)}function Ty(L){for(var G,z=[];!(G=L.next()).done;)z.push(G.value);return z}function vs(L){var G=-1,z=Array(L.size);return L.forEach(function(ae,be){z[++G]=[be,ae]}),z}function wo(L,G){return function(z){return L(G(z))}}function un(L,G){for(var z=-1,ae=L.length,be=0,Ye=[];++z<ae;){var rt=L[z];(rt===G||rt===d)&&(L[z]=d,Ye[be++]=z)}return Ye}function Ya(L){var G=-1,z=Array(L.size);return L.forEach(function(ae){z[++G]=ae}),z}function tp(L){var G=-1,z=Array(L.size);return L.forEach(function(ae){z[++G]=[ae,ae]}),z}function Ay(L,G,z){for(var ae=z-1,be=L.length;++ae<be;)if(L[ae]===G)return ae;return-1}function tu(L,G,z){for(var ae=z+1;ae--;)if(L[ae]===G)return ae;return ae}function fi(L){return ys(L)?$y(L):wy(L)}function vr(L){return ys(L)?My(L):_y(L)}function rp(L){for(var G=L.length;G--&&Ma.test(L.charAt(G)););return G}var qy=Qc(yy);function $y(L){for(var G=Wc.lastIndex=0;Wc.test(L);)++G;return G}function My(L){return L.match(Wc)||[]}function Ny(L){return L.match(dy)||[]}var Dy=(function L(G){G=G==null?Nt:di.defaults(Nt.Object(),G,di.pick(Nt,my));var z=G.Array,ae=G.Date,be=G.Error,Ye=G.Function,rt=G.Math,Ue=G.Object,Ga=G.RegExp,Fy=G.String,br=G.TypeError,_o=z.prototype,Ly=Ye.prototype,bs=Ue.prototype,Ro=G["__core-js_shared__"],Ka=Ly.toString,Ze=bs.hasOwnProperty,jy=0,np=(function(){var o=/[^.]+$/.exec(Ro&&Ro.keys&&Ro.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),Qa=bs.toString,Uy=Ka.call(Ue),Hy=Nt._,By=Ga("^"+Ka.call(Ze).replace(Ke,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Za=ms?G.Buffer:t,pi=G.Symbol,Xa=G.Uint8Array,ip=Za?Za.allocUnsafe:t,el=wo(Ue.getPrototypeOf,Ue),sp=Ue.create,xo=bs.propertyIsEnumerable,tl=_o.splice,op=pi?pi.isConcatSpreadable:t,Co=pi?pi.iterator:t,qi=pi?pi.toStringTag:t,rl=(function(){try{var o=Mo(Ue,"defineProperty");return o({},"",{}),o}catch{}})(),Vy=G.clearTimeout!==Nt.clearTimeout&&G.clearTimeout,Wy=ae&&ae.now!==Nt.Date.now&&ae.now,zy=G.setTimeout!==Nt.setTimeout&&G.setTimeout,Eo=rt.ceil,Oo=rt.floor,nl=Ue.getOwnPropertySymbols,il=Za?Za.isBuffer:t,$i=G.isFinite,sl=_o.join,ap=wo(Ue.keys,Ue),gt=rt.max,Ht=rt.min,lp=ae.now,Jy=G.parseInt,cp=rt.random,Yy=_o.reverse,ru=Mo(G,"DataView"),Io=Mo(G,"Map"),nu=Mo(G,"Promise"),Ss=Mo(G,"Set"),Po=Mo(G,"WeakMap"),ko=Mo(Ue,"create"),ol=Po&&new Po,ws={},Gy=No(ru),Ky=No(Io),Qy=No(nu),Zy=No(Ss),Xy=No(Po),al=pi?pi.prototype:t,To=al?al.valueOf:t,up=al?al.toString:t;function O(o){if(Ot(o)&&!Re(o)&&!(o instanceof $e)){if(o instanceof nr)return o;if(Ze.call(o,"__wrapped__"))return rC(o)}return new nr(o)}var _s=(function(){function o(){}return function(c){if(!Ct(c))return{};if(sp)return sp(c);o.prototype=c;var p=new o;return o.prototype=t,p}})();function ll(){}function nr(o,c){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=t}O.templateSettings={escape:Jg,evaluate:Yg,interpolate:an,variable:"",imports:{_:O}},O.prototype=ll.prototype,O.prototype.constructor=O,nr.prototype=_s(ll.prototype),nr.prototype.constructor=nr;function $e(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ce,this.__views__=[]}function ev(){var o=new $e(this.__wrapped__);return o.__actions__=Tr(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=Tr(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=Tr(this.__views__),o}function tv(){if(this.__filtered__){var o=new $e(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function iu(){var o=this.__wrapped__.value(),c=this.__dir__,p=Re(o),v=c<0,x=p?o.length:0,I=T$(0,x,this.__views__),q=I.start,D=I.end,H=D-q,Q=v?D:q-1,Z=this.__iteratees__,ee=Z.length,ie=0,fe=Ht(H,this.__takeCount__);if(!p||!v&&x==H&&fe==H)return Cx(o,this.__actions__);var ye=[];e:for(;H--&&ie<fe;){Q+=c;for(var Ie=-1,me=o[Q];++Ie<ee;){var Le=Z[Ie],He=Le.iteratee,Zr=Le.type,_r=He(me);if(Zr==K)me=_r;else if(!_r){if(Zr==Y)continue e;break e}}ye[ie++]=me}return ye}$e.prototype=_s(ll.prototype),$e.prototype.constructor=$e;function fn(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var v=o[c];this.set(v[0],v[1])}}function rv(){this.__data__=ko?ko(null):{},this.size=0}function nv(o){var c=this.has(o)&&delete this.__data__[o];return this.size-=c?1:0,c}function iv(o){var c=this.__data__;if(ko){var p=c[o];return p===l?t:p}return Ze.call(c,o)?c[o]:t}function sv(o){var c=this.__data__;return ko?c[o]!==t:Ze.call(c,o)}function ov(o,c){var p=this.__data__;return this.size+=this.has(o)?0:1,p[o]=ko&&c===t?l:c,this}fn.prototype.clear=rv,fn.prototype.delete=nv,fn.prototype.get=iv,fn.prototype.has=sv,fn.prototype.set=ov;function $n(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var v=o[c];this.set(v[0],v[1])}}function fp(){this.__data__=[],this.size=0}function av(o){var c=this.__data__,p=ul(c,o);if(p<0)return!1;var v=c.length-1;return p==v?c.pop():tl.call(c,p,1),--this.size,!0}function lv(o){var c=this.__data__,p=ul(c,o);return p<0?t:c[p][1]}function dp(o){return ul(this.__data__,o)>-1}function cv(o,c){var p=this.__data__,v=ul(p,o);return v<0?(++this.size,p.push([o,c])):p[v][1]=c,this}$n.prototype.clear=fp,$n.prototype.delete=av,$n.prototype.get=lv,$n.prototype.has=dp,$n.prototype.set=cv;function Mn(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var v=o[c];this.set(v[0],v[1])}}function uv(){this.size=0,this.__data__={hash:new fn,map:new(Io||$n),string:new fn}}function hi(o){var c=qp(this,o).delete(o);return this.size-=c?1:0,c}function pp(o){return qp(this,o).get(o)}function fv(o){return qp(this,o).has(o)}function dv(o,c){var p=qp(this,o),v=p.size;return p.set(o,c),this.size+=p.size==v?0:1,this}Mn.prototype.clear=uv,Mn.prototype.delete=hi,Mn.prototype.get=pp,Mn.prototype.has=fv,Mn.prototype.set=dv;function Mi(o){var c=-1,p=o==null?0:o.length;for(this.__data__=new Mn;++c<p;)this.add(o[c])}function te(o){return this.__data__.set(o,l),this}function pv(o){return this.__data__.has(o)}Mi.prototype.add=Mi.prototype.push=te,Mi.prototype.has=pv;function Jr(o){var c=this.__data__=new $n(o);this.size=c.size}function hp(){this.__data__=new $n,this.size=0}function Ve(o){var c=this.__data__,p=c.delete(o);return this.size=c.size,p}function cl(o){return this.__data__.get(o)}function mp(o){return this.__data__.has(o)}function su(o,c){var p=this.__data__;if(p instanceof $n){var v=p.__data__;if(!Io||v.length<r-1)return v.push([o,c]),this.size=++p.size,this;p=this.__data__=new Mn(v)}return p.set(o,c),this.size=p.size,this}Jr.prototype.clear=hp,Jr.prototype.delete=Ve,Jr.prototype.get=cl,Jr.prototype.has=mp,Jr.prototype.set=su;function gp(o,c){var p=Re(o),v=!p&&Do(o),x=!p&&!v&&Ps(o),I=!p&&!v&&!x&&gl(o),q=p||v||x||I,D=q?Xc(o.length,Fy):[],H=D.length;for(var Q in o)(c||Ze.call(o,Q))&&!(q&&(Q=="length"||x&&(Q=="offset"||Q=="parent")||I&&(Q=="buffer"||Q=="byteLength"||Q=="byteOffset")||Li(Q,H)))&&D.push(Q);return D}function yp(o){var c=o.length;return c?o[Ev(0,c-1)]:t}function hv(o,c){return $p(Tr(o),mi(c,0,o.length))}function mv(o){return $p(Tr(o))}function ou(o,c,p){(p!==t&&!jn(o[c],p)||p===t&&!(c in o))&&Yr(o,c,p)}function Sr(o,c,p){var v=o[c];(!(Ze.call(o,c)&&jn(v,p))||p===t&&!(c in o))&&Yr(o,c,p)}function ul(o,c){for(var p=o.length;p--;)if(jn(o[p][0],c))return p;return-1}function vp(o,c,p,v){return gi(o,function(x,I,q){c(v,x,p(x),q)}),v}function bp(o,c){return o&&yi(c,Kt(c),o)}function gv(o,c){return o&&yi(c,qr(c),o)}function Yr(o,c,p){c=="__proto__"&&rl?rl(o,c,{configurable:!0,enumerable:!0,value:p,writable:!0}):o[c]=p}function au(o,c){for(var p=-1,v=c.length,x=z(v),I=o==null;++p<v;)x[p]=I?t:Zv(o,c[p]);return x}function mi(o,c,p){return o===o&&(p!==t&&(o=o<=p?o:p),c!==t&&(o=o>=c?o:c)),o}function ir(o,c,p,v,x,I){var q,D=c&m,H=c&g,Q=c&y;if(p&&(q=x?p(o,v,x,I):p(o)),q!==t)return q;if(!Ct(o))return o;var Z=Re(o);if(Z){if(q=q$(o),!D)return Tr(o,q)}else{var ee=sr(o),ie=ee==on||ee==oo;if(Ps(o))return Ix(o,D);if(ee==In||ee==pr||ie&&!x){if(q=H||ie?{}:Jx(o),!D)return H?_$(o,gv(q,o)):w$(o,bp(q,o))}else{if(!at[ee])return x?o:{};q=$$(o,ee,D)}}I||(I=new Jr);var fe=I.get(o);if(fe)return fe;I.set(o,q),_C(o)?o.forEach(function(me){q.add(ir(me,c,p,me,o,I))}):SC(o)&&o.forEach(function(me,Le){q.set(Le,ir(me,c,p,Le,o,I))});var ye=Q?H?Dv:Nv:H?qr:Kt,Ie=Z?t:ye(o);return gr(Ie||o,function(me,Le){Ie&&(Le=me,me=o[Le]),Sr(q,Le,ir(me,c,p,Le,o,I))}),q}function yv(o){var c=Kt(o);return function(p){return dn(p,o,c)}}function dn(o,c,p){var v=p.length;if(o==null)return!v;for(o=Ue(o);v--;){var x=p[v],I=c[x],q=o[x];if(q===t&&!(x in o)||!I(q))return!1}return!0}function lu(o,c,p){if(typeof o!="function")throw new br(i);return mu(function(){o.apply(t,p)},c)}function Ao(o,c,p,v){var x=-1,I=Ba,q=!0,D=o.length,H=[],Q=c.length;if(!D)return H;p&&(c=lt(c,yr(p))),v?(I=gs,q=!1):c.length>=r&&(I=tt,q=!1,c=new Mi(c));e:for(;++x<D;){var Z=o[x],ee=p==null?Z:p(Z);if(Z=v||Z!==0?Z:0,q&&ee===ee){for(var ie=Q;ie--;)if(c[ie]===ee)continue e;H.push(Z)}else I(c,ee,v)||H.push(Z)}return H}var gi=qx(pn),Sp=qx(Nn,!0);function vv(o,c){var p=!0;return gi(o,function(v,x,I){return p=!!c(v,x,I),p}),p}function fl(o,c,p){for(var v=-1,x=o.length;++v<x;){var I=o[v],q=c(I);if(q!=null&&(D===t?q===q&&!Qr(q):p(q,D)))var D=q,H=I}return H}function bv(o,c,p,v){var x=o.length;for(p=Ee(p),p<0&&(p=-p>x?0:x+p),v=v===t||v>x?x:Ee(v),v<0&&(v+=x),v=p>v?0:xC(v);p<v;)o[p++]=c;return o}function wp(o,c){var p=[];return gi(o,function(v,x,I){c(v,x,I)&&p.push(v)}),p}function Bt(o,c,p,v,x){var I=-1,q=o.length;for(p||(p=N$),x||(x=[]);++I<q;){var D=o[I];c>0&&p(D)?c>1?Bt(D,c-1,p,v,x):ui(x,D):v||(x[x.length]=D)}return x}var cu=$x(),_p=$x(!0);function pn(o,c){return o&&cu(o,c,Kt)}function Nn(o,c){return o&&_p(o,c,Kt)}function dl(o,c){return ci(c,function(p){return ji(o[p])})}function Ni(o,c){c=Os(c,o);for(var p=0,v=c.length;o!=null&&p<v;)o=o[Ln(c[p++])];return p&&p==v?o:t}function Rp(o,c,p){var v=c(o);return Re(o)?v:ui(v,p(o))}function Qt(o){return o==null?o===t?Pd:Wg:qi&&qi in Ue(o)?k$(o):B$(o)}function uu(o,c){return o>c}function Sv(o,c){return o!=null&&Ze.call(o,c)}function wv(o,c){return o!=null&&c in Ue(o)}function _v(o,c,p){return o>=Ht(c,p)&&o<gt(c,p)}function Gr(o,c,p){for(var v=p?gs:Ba,x=o[0].length,I=o.length,q=I,D=z(I),H=1/0,Q=[];q--;){var Z=o[q];q&&c&&(Z=lt(Z,yr(c))),H=Ht(Z.length,H),D[q]=!p&&(c||x>=120&&Z.length>=120)?new Mi(q&&Z):t}Z=o[0];var ee=-1,ie=D[0];e:for(;++ee<x&&Q.length<H;){var fe=Z[ee],ye=c?c(fe):fe;if(fe=p||fe!==0?fe:0,!(ie?tt(ie,ye):v(Q,ye,p))){for(q=I;--q;){var Ie=D[q];if(!(Ie?tt(Ie,ye):v(o[q],ye,p)))continue e}ie&&ie.push(ye),Q.push(fe)}}return Q}function Rs(o,c,p,v){return pn(o,function(x,I,q){c(v,p(x),I,q)}),v}function qo(o,c,p){c=Os(c,o),o=Qx(o,c);var v=o==null?o:o[Ln(mn(c))];return v==null?t:mr(v,o,p)}function xp(o){return Ot(o)&&Qt(o)==pr}function Rv(o){return Ot(o)&&Qt(o)==Oi}function xv(o){return Ot(o)&&Qt(o)==Or}function $o(o,c,p,v,x){return o===c?!0:o==null||c==null||!Ot(o)&&!Ot(c)?o!==o&&c!==c:fu(o,c,p,v,$o,x)}function fu(o,c,p,v,x,I){var q=Re(o),D=Re(c),H=q?ai:sr(o),Q=D?ai:sr(c);H=H==pr?In:H,Q=Q==pr?In:Q;var Z=H==In,ee=Q==In,ie=H==Q;if(ie&&Ps(o)){if(!Ps(c))return!1;q=!0,Z=!1}if(ie&&!Z)return I||(I=new Jr),q||gl(o)?Vx(o,c,p,v,x,I):I$(o,c,H,p,v,x,I);if(!(p&w)){var fe=Z&&Ze.call(o,"__wrapped__"),ye=ee&&Ze.call(c,"__wrapped__");if(fe||ye){var Ie=fe?o.value():o,me=ye?c.value():c;return I||(I=new Jr),x(Ie,me,p,v,I)}}return ie?(I||(I=new Jr),P$(o,c,p,v,x,I)):!1}function xs(o){return Ot(o)&&sr(o)==Jt}function Cs(o,c,p,v){var x=p.length,I=x,q=!v;if(o==null)return!I;for(o=Ue(o);x--;){var D=p[x];if(q&&D[2]?D[1]!==o[D[0]]:!(D[0]in o))return!1}for(;++x<I;){D=p[x];var H=D[0],Q=o[H],Z=D[1];if(q&&D[2]){if(Q===t&&!(H in o))return!1}else{var ee=new Jr;if(v)var ie=v(Q,Z,H,o,c,ee);if(!(ie===t?$o(Z,Q,w|C,v,ee):ie))return!1}}return!0}function Fe(o){if(!Ct(o)||F$(o))return!1;var c=ji(o)?By:Ad;return c.test(No(o))}function u(o){return Ot(o)&&Qt(o)==Yt}function h(o){return Ot(o)&&sr(o)==hr}function b(o){return Ot(o)&&jp(o.length)&&!!ut[Qt(o)]}function S(o){return typeof o=="function"?o:o==null?$r:typeof o=="object"?Re(o)?Me(o[0],o[1]):ve(o):NC(o)}function E(o){if(!hu(o))return ap(o);var c=[];for(var p in Ue(o))Ze.call(o,p)&&p!="constructor"&&c.push(p);return c}function N(o){if(!Ct(o))return H$(o);var c=hu(o),p=[];for(var v in o)v=="constructor"&&(c||!Ze.call(o,v))||p.push(v);return p}function J(o,c){return o<c}function se(o,c){var p=-1,v=Ar(o)?z(o.length):[];return gi(o,function(x,I,q){v[++p]=c(x,I,q)}),v}function ve(o){var c=Lv(o);return c.length==1&&c[0][2]?Gx(c[0][0],c[0][1]):function(p){return p===o||Cs(p,o,c)}}function Me(o,c){return Uv(o)&&Yx(c)?Gx(Ln(o),c):function(p){var v=Zv(p,o);return v===t&&v===c?Xv(p,o):$o(c,v,w|C)}}function Dt(o,c,p,v,x){o!==c&&cu(c,function(I,q){if(x||(x=new Jr),Ct(I))Dn(o,c,q,p,Dt,v,x);else{var D=v?v(Bv(o,q),I,q+"",o,c,x):t;D===t&&(D=I),ou(o,q,D)}},qr)}function Dn(o,c,p,v,x,I,q){var D=Bv(o,p),H=Bv(c,p),Q=q.get(H);if(Q){ou(o,p,Q);return}var Z=I?I(D,H,p+"",o,c,q):t,ee=Z===t;if(ee){var ie=Re(H),fe=!ie&&Ps(H),ye=!ie&&!fe&&gl(H);Z=H,ie||fe||ye?Re(D)?Z=D:qt(D)?Z=Tr(D):fe?(ee=!1,Z=Ix(H,!0)):ye?(ee=!1,Z=Px(H,!0)):Z=[]:gu(H)||Do(H)?(Z=D,Do(D)?Z=CC(D):(!Ct(D)||ji(D))&&(Z=Jx(H))):ee=!1}ee&&(q.set(H,Z),x(Z,H,v,I,q),q.delete(H)),ou(o,p,Z)}function Fn(o,c){var p=o.length;if(p)return c+=c<0?p:0,Li(c,p)?o[c]:t}function vx(o,c,p){c.length?c=lt(c,function(I){return Re(I)?function(q){return Ni(q,I.length===1?I[0]:I)}:I}):c=[$r];var v=-1;c=lt(c,yr(ge()));var x=se(o,function(I,q,D){var H=lt(c,function(Q){return Q(I)});return{criteria:H,index:++v,value:I}});return Cy(x,function(I,q){return S$(I,q,p)})}function l$(o,c){return bx(o,c,function(p,v){return Xv(o,v)})}function bx(o,c,p){for(var v=-1,x=c.length,I={};++v<x;){var q=c[v],D=Ni(o,q);p(D,q)&&du(I,Os(q,o),D)}return I}function c$(o){return function(c){return Ni(c,o)}}function Cv(o,c,p,v){var x=v?xy:Ti,I=-1,q=c.length,D=o;for(o===c&&(c=Tr(c)),p&&(D=lt(o,yr(p)));++I<q;)for(var H=0,Q=c[I],Z=p?p(Q):Q;(H=x(D,Z,H,v))>-1;)D!==o&&tl.call(D,H,1),tl.call(o,H,1);return o}function Sx(o,c){for(var p=o?c.length:0,v=p-1;p--;){var x=c[p];if(p==v||x!==I){var I=x;Li(x)?tl.call(o,x,1):Pv(o,x)}}return o}function Ev(o,c){return o+Oo(cp()*(c-o+1))}function u$(o,c,p,v){for(var x=-1,I=gt(Eo((c-o)/(p||1)),0),q=z(I);I--;)q[v?I:++x]=o,o+=p;return q}function Ov(o,c){var p="";if(!o||c<1||c>et)return p;do c%2&&(p+=o),c=Oo(c/2),c&&(o+=o);while(c);return p}function Te(o,c){return Vv(Kx(o,c,$r),o+"")}function f$(o){return yp(yl(o))}function d$(o,c){var p=yl(o);return $p(p,mi(c,0,p.length))}function du(o,c,p,v){if(!Ct(o))return o;c=Os(c,o);for(var x=-1,I=c.length,q=I-1,D=o;D!=null&&++x<I;){var H=Ln(c[x]),Q=p;if(H==="__proto__"||H==="constructor"||H==="prototype")return o;if(x!=q){var Z=D[H];Q=v?v(Z,H,D):t,Q===t&&(Q=Ct(Z)?Z:Li(c[x+1])?[]:{})}Sr(D,H,Q),D=D[H]}return o}var wx=ol?function(o,c){return ol.set(o,c),o}:$r,p$=rl?function(o,c){return rl(o,"toString",{configurable:!0,enumerable:!1,value:tb(c),writable:!0})}:$r;function h$(o){return $p(yl(o))}function hn(o,c,p){var v=-1,x=o.length;c<0&&(c=-c>x?0:x+c),p=p>x?x:p,p<0&&(p+=x),x=c>p?0:p-c>>>0,c>>>=0;for(var I=z(x);++v<x;)I[v]=o[v+c];return I}function m$(o,c){var p;return gi(o,function(v,x,I){return p=c(v,x,I),!p}),!!p}function Cp(o,c,p){var v=0,x=o==null?v:o.length;if(typeof c=="number"&&c===c&&x<=Et){for(;v<x;){var I=v+x>>>1,q=o[I];q!==null&&!Qr(q)&&(p?q<=c:q<c)?v=I+1:x=I}return x}return Iv(o,c,$r,p)}function Iv(o,c,p,v){var x=0,I=o==null?0:o.length;if(I===0)return 0;c=p(c);for(var q=c!==c,D=c===null,H=Qr(c),Q=c===t;x<I;){var Z=Oo((x+I)/2),ee=p(o[Z]),ie=ee!==t,fe=ee===null,ye=ee===ee,Ie=Qr(ee);if(q)var me=v||ye;else Q?me=ye&&(v||ie):D?me=ye&&ie&&(v||!fe):H?me=ye&&ie&&!fe&&(v||!Ie):fe||Ie?me=!1:me=v?ee<=c:ee<c;me?x=Z+1:I=Z}return Ht(I,vt)}function _x(o,c){for(var p=-1,v=o.length,x=0,I=[];++p<v;){var q=o[p],D=c?c(q):q;if(!p||!jn(D,H)){var H=D;I[x++]=q===0?0:q}}return I}function Rx(o){return typeof o=="number"?o:Qr(o)?he:+o}function Kr(o){if(typeof o=="string")return o;if(Re(o))return lt(o,Kr)+"";if(Qr(o))return up?up.call(o):"";var c=o+"";return c=="0"&&1/o==-ue?"-0":c}function Es(o,c,p){var v=-1,x=Ba,I=o.length,q=!0,D=[],H=D;if(p)q=!1,x=gs;else if(I>=r){var Q=c?null:E$(o);if(Q)return Ya(Q);q=!1,x=tt,H=new Mi}else H=c?[]:D;e:for(;++v<I;){var Z=o[v],ee=c?c(Z):Z;if(Z=p||Z!==0?Z:0,q&&ee===ee){for(var ie=H.length;ie--;)if(H[ie]===ee)continue e;c&&H.push(ee),D.push(Z)}else x(H,ee,p)||(H!==D&&H.push(ee),D.push(Z))}return D}function Pv(o,c){c=Os(c,o);var p=-1,v=c.length;if(!v)return!0;for(;++p<v;){var x=Ln(c[p]);if(x==="__proto__"&&!Ze.call(o,"__proto__")||(x==="constructor"||x==="prototype")&&p<v-1)return!1}var I=Qx(o,c);return I==null||delete I[Ln(mn(c))]}function xx(o,c,p,v){return du(o,c,p(Ni(o,c)),v)}function Ep(o,c,p,v){for(var x=o.length,I=v?x:-1;(v?I--:++I<x)&&c(o[I],I,o););return p?hn(o,v?0:I,v?I+1:x):hn(o,v?I+1:0,v?x:I)}function Cx(o,c){var p=o;return p instanceof $e&&(p=p.value()),Kc(c,function(v,x){return x.func.apply(x.thisArg,ui([v],x.args))},p)}function kv(o,c,p){var v=o.length;if(v<2)return v?Es(o[0]):[];for(var x=-1,I=z(v);++x<v;)for(var q=o[x],D=-1;++D<v;)D!=x&&(I[x]=Ao(I[x]||q,o[D],c,p));return Es(Bt(I,1),c,p)}function Ex(o,c,p){for(var v=-1,x=o.length,I=c.length,q={};++v<x;){var D=v<I?c[v]:t;p(q,o[v],D)}return q}function Tv(o){return qt(o)?o:[]}function Av(o){return typeof o=="function"?o:$r}function Os(o,c){return Re(o)?o:Uv(o,c)?[o]:tC(nt(o))}var g$=Te;function Is(o,c,p){var v=o.length;return p=p===t?v:p,!c&&p>=v?o:hn(o,c,p)}var Ox=Vy||function(o){return Nt.clearTimeout(o)};function Ix(o,c){if(c)return o.slice();var p=o.length,v=ip?ip(p):new o.constructor(p);return o.copy(v),v}function qv(o){var c=new o.constructor(o.byteLength);return new Xa(c).set(new Xa(o)),c}function y$(o,c){var p=c?qv(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.byteLength)}function v$(o){var c=new o.constructor(o.source,Td.exec(o));return c.lastIndex=o.lastIndex,c}function b$(o){return To?Ue(To.call(o)):{}}function Px(o,c){var p=c?qv(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.length)}function kx(o,c){if(o!==c){var p=o!==t,v=o===null,x=o===o,I=Qr(o),q=c!==t,D=c===null,H=c===c,Q=Qr(c);if(!D&&!Q&&!I&&o>c||I&&q&&H&&!D&&!Q||v&&q&&H||!p&&H||!x)return 1;if(!v&&!I&&!Q&&o<c||Q&&p&&x&&!v&&!I||D&&p&&x||!q&&x||!H)return-1}return 0}function S$(o,c,p){for(var v=-1,x=o.criteria,I=c.criteria,q=x.length,D=p.length;++v<q;){var H=kx(x[v],I[v]);if(H){if(v>=D)return H;var Q=p[v];return H*(Q=="desc"?-1:1)}}return o.index-c.index}function Tx(o,c,p,v){for(var x=-1,I=o.length,q=p.length,D=-1,H=c.length,Q=gt(I-q,0),Z=z(H+Q),ee=!v;++D<H;)Z[D]=c[D];for(;++x<q;)(ee||x<I)&&(Z[p[x]]=o[x]);for(;Q--;)Z[D++]=o[x++];return Z}function Ax(o,c,p,v){for(var x=-1,I=o.length,q=-1,D=p.length,H=-1,Q=c.length,Z=gt(I-D,0),ee=z(Z+Q),ie=!v;++x<Z;)ee[x]=o[x];for(var fe=x;++H<Q;)ee[fe+H]=c[H];for(;++q<D;)(ie||x<I)&&(ee[fe+p[q]]=o[x++]);return ee}function Tr(o,c){var p=-1,v=o.length;for(c||(c=z(v));++p<v;)c[p]=o[p];return c}function yi(o,c,p,v){var x=!p;p||(p={});for(var I=-1,q=c.length;++I<q;){var D=c[I],H=v?v(p[D],o[D],D,p,o):t;H===t&&(H=o[D]),x?Yr(p,D,H):Sr(p,D,H)}return p}function w$(o,c){return yi(o,jv(o),c)}function _$(o,c){return yi(o,Wx(o),c)}function Op(o,c){return function(p,v){var x=Re(p)?qn:vp,I=c?c():{};return x(p,o,ge(v,2),I)}}function pl(o){return Te(function(c,p){var v=-1,x=p.length,I=x>1?p[x-1]:t,q=x>2?p[2]:t;for(I=o.length>3&&typeof I=="function"?(x--,I):t,q&&wr(p[0],p[1],q)&&(I=x<3?t:I,x=1),c=Ue(c);++v<x;){var D=p[v];D&&o(c,D,v,I)}return c})}function qx(o,c){return function(p,v){if(p==null)return p;if(!Ar(p))return o(p,v);for(var x=p.length,I=c?x:-1,q=Ue(p);(c?I--:++I<x)&&v(q[I],I,q)!==!1;);return p}}function $x(o){return function(c,p,v){for(var x=-1,I=Ue(c),q=v(c),D=q.length;D--;){var H=q[o?D:++x];if(p(I[H],H,I)===!1)break}return c}}function R$(o,c,p){var v=c&R,x=pu(o);function I(){var q=this&&this!==Nt&&this instanceof I?x:o;return q.apply(v?p:this,arguments)}return I}function Mx(o){return function(c){c=nt(c);var p=ys(c)?vr(c):t,v=p?p[0]:c.charAt(0),x=p?Is(p,1).join(""):c.slice(1);return v[o]()+x}}function hl(o){return function(c){return Kc($C(qC(c).replace(uy,"")),o,"")}}function pu(o){return function(){var c=arguments;switch(c.length){case 0:return new o;case 1:return new o(c[0]);case 2:return new o(c[0],c[1]);case 3:return new o(c[0],c[1],c[2]);case 4:return new o(c[0],c[1],c[2],c[3]);case 5:return new o(c[0],c[1],c[2],c[3],c[4]);case 6:return new o(c[0],c[1],c[2],c[3],c[4],c[5]);case 7:return new o(c[0],c[1],c[2],c[3],c[4],c[5],c[6])}var p=_s(o.prototype),v=o.apply(p,c);return Ct(v)?v:p}}function x$(o,c,p){var v=pu(o);function x(){for(var I=arguments.length,q=z(I),D=I,H=ml(x);D--;)q[D]=arguments[D];var Q=I<3&&q[0]!==H&&q[I-1]!==H?[]:un(q,H);if(I-=Q.length,I<p)return jx(o,c,Ip,x.placeholder,t,q,Q,t,t,p-I);var Z=this&&this!==Nt&&this instanceof x?v:o;return mr(Z,this,q)}return x}function Nx(o){return function(c,p,v){var x=Ue(c);if(!Ar(c)){var I=ge(p,3);c=Kt(c),p=function(D){return I(x[D],D,x)}}var q=o(c,p,v);return q>-1?x[I?c[q]:q]:t}}function Dx(o){return Fi(function(c){var p=c.length,v=p,x=nr.prototype.thru;for(o&&c.reverse();v--;){var I=c[v];if(typeof I!="function")throw new br(i);if(x&&!q&&Ap(I)=="wrapper")var q=new nr([],!0)}for(v=q?v:p;++v<p;){I=c[v];var D=Ap(I),H=D=="wrapper"?Fv(I):t;H&&Hv(H[0])&&H[1]==(X|U|V|P)&&!H[4].length&&H[9]==1?q=q[Ap(H[0])].apply(q,H[3]):q=I.length==1&&Hv(I)?q[D]():q.thru(I)}return function(){var Q=arguments,Z=Q[0];if(q&&Q.length==1&&Re(Z))return q.plant(Z).value();for(var ee=0,ie=p?c[ee].apply(this,Q):Z;++ee<p;)ie=c[ee].call(this,ie);return ie}})}function Ip(o,c,p,v,x,I,q,D,H,Q){var Z=c&X,ee=c&R,ie=c&T,fe=c&(U|B),ye=c&_,Ie=ie?t:pu(o);function me(){for(var Le=arguments.length,He=z(Le),Zr=Le;Zr--;)He[Zr]=arguments[Zr];if(fe)var _r=ml(me),Xr=ep(He,_r);if(v&&(He=Tx(He,v,x,fe)),I&&(He=Ax(He,I,q,fe)),Le-=Xr,fe&&Le<Q){var $t=un(He,_r);return jx(o,c,Ip,me.placeholder,p,He,$t,D,H,Q-Le)}var Un=ee?p:this,Hi=ie?Un[o]:o;return Le=He.length,D?He=V$(He,D):ye&&Le>1&&He.reverse(),Z&&H<Le&&(He.length=H),this&&this!==Nt&&this instanceof me&&(Hi=Ie||pu(Hi)),Hi.apply(Un,He)}return me}function Fx(o,c){return function(p,v){return Rs(p,o,c(v),{})}}function Pp(o,c){return function(p,v){var x;if(p===t&&v===t)return c;if(p!==t&&(x=p),v!==t){if(x===t)return v;typeof p=="string"||typeof v=="string"?(p=Kr(p),v=Kr(v)):(p=Rx(p),v=Rx(v)),x=o(p,v)}return x}}function $v(o){return Fi(function(c){return c=lt(c,yr(ge())),Te(function(p){var v=this;return o(c,function(x){return mr(x,v,p)})})})}function kp(o,c){c=c===t?" ":Kr(c);var p=c.length;if(p<2)return p?Ov(c,o):c;var v=Ov(c,Eo(o/fi(c)));return ys(c)?Is(vr(v),0,o).join(""):v.slice(0,o)}function C$(o,c,p,v){var x=c&R,I=pu(o);function q(){for(var D=-1,H=arguments.length,Q=-1,Z=v.length,ee=z(Z+H),ie=this&&this!==Nt&&this instanceof q?I:o;++Q<Z;)ee[Q]=v[Q];for(;H--;)ee[Q++]=arguments[++D];return mr(ie,x?p:this,ee)}return q}function Lx(o){return function(c,p,v){return v&&typeof v!="number"&&wr(c,p,v)&&(p=v=t),c=Ui(c),p===t?(p=c,c=0):p=Ui(p),v=v===t?c<p?1:-1:Ui(v),u$(c,p,v,o)}}function Tp(o){return function(c,p){return typeof c=="string"&&typeof p=="string"||(c=gn(c),p=gn(p)),o(c,p)}}function jx(o,c,p,v,x,I,q,D,H,Q){var Z=c&U,ee=Z?q:t,ie=Z?t:q,fe=Z?I:t,ye=Z?t:I;c|=Z?V:W,c&=~(Z?W:V),c&A||(c&=~(R|T));var Ie=[o,c,x,fe,ee,ye,ie,D,H,Q],me=p.apply(t,Ie);return Hv(o)&&Zx(me,Ie),me.placeholder=v,Xx(me,o,c)}function Mv(o){var c=rt[o];return function(p,v){if(p=gn(p),v=v==null?0:Ht(Ee(v),292),v&&$i(p)){var x=(nt(p)+"e").split("e"),I=c(x[0]+"e"+(+x[1]+v));return x=(nt(I)+"e").split("e"),+(x[0]+"e"+(+x[1]-v))}return c(p)}}var E$=Ss&&1/Ya(new Ss([,-0]))[1]==ue?function(o){return new Ss(o)}:ib;function Ux(o){return function(c){var p=sr(c);return p==Jt?vs(c):p==hr?tp(c):Ey(c,o(c))}}function Di(o,c,p,v,x,I,q,D){var H=c&T;if(!H&&typeof o!="function")throw new br(i);var Q=v?v.length:0;if(Q||(c&=~(V|W),v=x=t),q=q===t?q:gt(Ee(q),0),D=D===t?D:Ee(D),Q-=x?x.length:0,c&W){var Z=v,ee=x;v=x=t}var ie=H?t:Fv(o),fe=[o,c,p,v,x,Z,ee,I,q,D];if(ie&&U$(fe,ie),o=fe[0],c=fe[1],p=fe[2],v=fe[3],x=fe[4],D=fe[9]=fe[9]===t?H?0:o.length:gt(fe[9]-Q,0),!D&&c&(U|B)&&(c&=~(U|B)),!c||c==R)var ye=R$(o,c,p);else c==U||c==B?ye=x$(o,c,D):(c==V||c==(R|V))&&!x.length?ye=C$(o,c,p,v):ye=Ip.apply(t,fe);var Ie=ie?wx:Zx;return Xx(Ie(ye,fe),o,c)}function Hx(o,c,p,v){return o===t||jn(o,bs[p])&&!Ze.call(v,p)?c:o}function Bx(o,c,p,v,x,I){return Ct(o)&&Ct(c)&&(I.set(c,o),Dt(o,c,t,Bx,I),I.delete(c)),o}function O$(o){return gu(o)?t:o}function Vx(o,c,p,v,x,I){var q=p&w,D=o.length,H=c.length;if(D!=H&&!(q&&H>D))return!1;var Q=I.get(o),Z=I.get(c);if(Q&&Z)return Q==c&&Z==o;var ee=-1,ie=!0,fe=p&C?new Mi:t;for(I.set(o,c),I.set(c,o);++ee<D;){var ye=o[ee],Ie=c[ee];if(v)var me=q?v(Ie,ye,ee,c,o,I):v(ye,Ie,ee,o,c,I);if(me!==t){if(me)continue;ie=!1;break}if(fe){if(!Va(c,function(Le,He){if(!tt(fe,He)&&(ye===Le||x(ye,Le,p,v,I)))return fe.push(He)})){ie=!1;break}}else if(!(ye===Ie||x(ye,Ie,p,v,I))){ie=!1;break}}return I.delete(o),I.delete(c),ie}function I$(o,c,p,v,x,I,q){switch(p){case Pn:if(o.byteLength!=c.byteLength||o.byteOffset!=c.byteOffset)return!1;o=o.buffer,c=c.buffer;case Oi:return!(o.byteLength!=c.byteLength||!I(new Xa(o),new Xa(c)));case zr:case Or:case ao:return jn(+o,+c);case mt:return o.name==c.name&&o.message==c.message;case Yt:case lo:return o==c+"";case Jt:var D=vs;case hr:var H=v&w;if(D||(D=Ya),o.size!=c.size&&!H)return!1;var Q=q.get(o);if(Q)return Q==c;v|=C,q.set(o,c);var Z=Vx(D(o),D(c),v,x,I,q);return q.delete(o),Z;case Pa:if(To)return To.call(o)==To.call(c)}return!1}function P$(o,c,p,v,x,I){var q=p&w,D=Nv(o),H=D.length,Q=Nv(c),Z=Q.length;if(H!=Z&&!q)return!1;for(var ee=H;ee--;){var ie=D[ee];if(!(q?ie in c:Ze.call(c,ie)))return!1}var fe=I.get(o),ye=I.get(c);if(fe&&ye)return fe==c&&ye==o;var Ie=!0;I.set(o,c),I.set(c,o);for(var me=q;++ee<H;){ie=D[ee];var Le=o[ie],He=c[ie];if(v)var Zr=q?v(He,Le,ie,c,o,I):v(Le,He,ie,o,c,I);if(!(Zr===t?Le===He||x(Le,He,p,v,I):Zr)){Ie=!1;break}me||(me=ie=="constructor")}if(Ie&&!me){var _r=o.constructor,Xr=c.constructor;_r!=Xr&&"constructor"in o&&"constructor"in c&&!(typeof _r=="function"&&_r instanceof _r&&typeof Xr=="function"&&Xr instanceof Xr)&&(Ie=!1)}return I.delete(o),I.delete(c),Ie}function Fi(o){return Vv(Kx(o,t,sC),o+"")}function Nv(o){return Rp(o,Kt,jv)}function Dv(o){return Rp(o,qr,Wx)}var Fv=ol?function(o){return ol.get(o)}:ib;function Ap(o){for(var c=o.name+"",p=ws[c],v=Ze.call(ws,c)?p.length:0;v--;){var x=p[v],I=x.func;if(I==null||I==o)return x.name}return c}function ml(o){var c=Ze.call(O,"placeholder")?O:o;return c.placeholder}function ge(){var o=O.iteratee||rb;return o=o===rb?S:o,arguments.length?o(arguments[0],arguments[1]):o}function qp(o,c){var p=o.__data__;return D$(c)?p[typeof c=="string"?"string":"hash"]:p.map}function Lv(o){for(var c=Kt(o),p=c.length;p--;){var v=c[p],x=o[v];c[p]=[v,x,Yx(x)]}return c}function Mo(o,c){var p=So(o,c);return Fe(p)?p:t}function k$(o){var c=Ze.call(o,qi),p=o[qi];try{o[qi]=t;var v=!0}catch{}var x=Qa.call(o);return v&&(c?o[qi]=p:delete o[qi]),x}var jv=nl?function(o){return o==null?[]:(o=Ue(o),ci(nl(o),function(c){return xo.call(o,c)}))}:sb,Wx=nl?function(o){for(var c=[];o;)ui(c,jv(o)),o=el(o);return c}:sb,sr=Qt;(ru&&sr(new ru(new ArrayBuffer(1)))!=Pn||Io&&sr(new Io)!=Jt||nu&&sr(nu.resolve())!=Od||Ss&&sr(new Ss)!=hr||Po&&sr(new Po)!=Ut)&&(sr=function(o){var c=Qt(o),p=c==In?o.constructor:t,v=p?No(p):"";if(v)switch(v){case Gy:return Pn;case Ky:return Jt;case Qy:return Od;case Zy:return hr;case Xy:return Ut}return c});function T$(o,c,p){for(var v=-1,x=p.length;++v<x;){var I=p[v],q=I.size;switch(I.type){case"drop":o+=q;break;case"dropRight":c-=q;break;case"take":c=Ht(c,o+q);break;case"takeRight":o=gt(o,c-q);break}}return{start:o,end:c}}function A$(o){var c=o.match(kn);return c?c[1].split(ln):[]}function zx(o,c,p){c=Os(c,o);for(var v=-1,x=c.length,I=!1;++v<x;){var q=Ln(c[v]);if(!(I=o!=null&&p(o,q)))break;o=o[q]}return I||++v!=x?I:(x=o==null?0:o.length,!!x&&jp(x)&&Li(q,x)&&(Re(o)||Do(o)))}function q$(o){var c=o.length,p=new o.constructor(c);return c&&typeof o[0]=="string"&&Ze.call(o,"index")&&(p.index=o.index,p.input=o.input),p}function Jx(o){return typeof o.constructor=="function"&&!hu(o)?_s(el(o)):{}}function $$(o,c,p){var v=o.constructor;switch(c){case Oi:return qv(o);case zr:case Or:return new v(+o);case Pn:return y$(o,p);case ot:case ka:case Ta:case cs:case co:case us:case li:case fs:case Mc:return Px(o,p);case Jt:return new v;case ao:case lo:return new v(o);case Yt:return v$(o);case hr:return new v;case Pa:return b$(o)}}function M$(o,c){var p=c.length;if(!p)return o;var v=p-1;return c[v]=(p>1?"& ":"")+c[v],c=c.join(p>2?", ":" "),o.replace(Gt,`{
|
|
2
2
|
/* [wrapped with `+c+`] */
|
|
3
|
-
`)}function $$(a){return Re(a)||Do(a)||!!(op&&a&&a[op])}function Li(a,c){var p=typeof a;return c=c??et,!!c&&(p=="number"||p!="symbol"&&ds.test(a))&&a>-1&&a%1==0&&a<c}function wr(a,c,p){if(!Ct(p))return!1;var v=typeof c;return(v=="number"?Ar(p)&&Li(c,p.length):v=="string"&&c in p)?jn(p[c],a):!1}function Uv(a,c){if(Re(a))return!1;var p=typeof a;return p=="number"||p=="symbol"||p=="boolean"||a==null||Qr(a)?!0:qe.test(a)||!Ir.test(a)||c!=null&&a in Ue(c)}function M$(a){var c=typeof a;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?a!=="__proto__":a===null}function Hv(a){var c=Ap(a),p=O[c];if(typeof p!="function"||!(c in $e.prototype))return!1;if(a===p)return!0;var v=Fv(p);return!!v&&a===v[0]}function N$(a){return!!np&&np in a}var D$=Ro?ji:ob;function hu(a){var c=a&&a.constructor,p=typeof c=="function"&&c.prototype||bs;return a===p}function Yx(a){return a===a&&!Ct(a)}function Gx(a,c){return function(p){return p==null?!1:p[a]===c&&(c!==t||a in Ue(p))}}function F$(a){var c=Fp(a,function(v){return p.size===f&&p.clear(),v}),p=c.cache;return c}function L$(a,c){var p=a[1],v=c[1],x=p|v,I=x<(R|P|X),q=v==X&&p==U||v==X&&p==T&&a[7].length<=c[8]||v==(X|T)&&c[7].length<=c[8]&&p==U;if(!(I||q))return a;v&R&&(a[2]=c[2],x|=p&R?0:A);var D=c[3];if(D){var H=a[3];a[3]=H?Tx(H,D,c[4]):D,a[4]=H?un(a[3],d):c[4]}return D=c[5],D&&(H=a[5],a[5]=H?Ax(H,D,c[6]):D,a[6]=H?un(a[5],d):c[6]),D=c[7],D&&(a[7]=D),v&X&&(a[8]=a[8]==null?c[8]:Ht(a[8],c[8])),a[9]==null&&(a[9]=c[9]),a[0]=c[0],a[1]=x,a}function j$(a){var c=[];if(a!=null)for(var p in Ue(a))c.push(p);return c}function U$(a){return Qa.call(a)}function Kx(a,c,p){return c=gt(c===t?a.length-1:c,0),function(){for(var v=arguments,x=-1,I=gt(v.length-c,0),q=W(I);++x<I;)q[x]=v[c+x];x=-1;for(var D=W(c+1);++x<c;)D[x]=v[x];return D[c]=p(q),mr(a,this,D)}}function Qx(a,c){return c.length<2?a:Ni(a,hn(c,0,-1))}function H$(a,c){for(var p=a.length,v=Ht(c.length,p),x=Tr(a);v--;){var I=c[v];a[v]=Li(I,p)?x[I]:t}return a}function Bv(a,c){if(!(c==="constructor"&&typeof a[c]=="function")&&c!="__proto__")return a[c]}var Zx=eC(wx),mu=zy||function(a,c){return Nt.setTimeout(a,c)},Vv=eC(f$);function Xx(a,c,p){var v=c+"";return Vv(a,q$(v,B$(k$(v),p)))}function eC(a){var c=0,p=0;return function(){var v=lp(),x=$-(v-p);if(p=v,x>0){if(++c>=j)return arguments[0]}else c=0;return a.apply(t,arguments)}}function $p(a,c){var p=-1,v=a.length,x=v-1;for(c=c===t?v:c;++p<c;){var I=Ev(p,x),q=a[I];a[I]=a[p],a[p]=q}return a.length=c,a}var tC=F$(function(a){var c=[];return a.charCodeAt(0)===46&&c.push(""),a.replace(Nc,function(p,v,x,I){c.push(x?I.replace(Tn,"$1"):v||p)}),c});function Ln(a){if(typeof a=="string"||Qr(a))return a;var c=a+"";return c=="0"&&1/a==-ue?"-0":c}function No(a){if(a!=null){try{return Ka.call(a)}catch{}try{return a+""}catch{}}return""}function B$(a,c){return gr(ce,function(p){var v="_."+p[0];c&p[1]&&!Ba(a,v)&&a.push(v)}),a.sort()}function rC(a){if(a instanceof $e)return a.clone();var c=new nr(a.__wrapped__,a.__chain__);return c.__actions__=Tr(a.__actions__),c.__index__=a.__index__,c.__values__=a.__values__,c}function V$(a,c,p){(p?wr(a,c,p):c===t)?c=1:c=gt(Ee(c),0);var v=a==null?0:a.length;if(!v||c<1)return[];for(var x=0,I=0,q=W(Eo(v/c));x<v;)q[I++]=hn(a,x,x+=c);return q}function W$(a){for(var c=-1,p=a==null?0:a.length,v=0,x=[];++c<p;){var I=a[c];I&&(x[v++]=I)}return x}function z$(){var a=arguments.length;if(!a)return[];for(var c=W(a-1),p=arguments[0],v=a;v--;)c[v-1]=arguments[v];return ui(Re(p)?Tr(p):[p],Bt(c,1))}var J$=Te(function(a,c){return qt(a)?Ao(a,Bt(c,1,qt,!0)):[]}),Y$=Te(function(a,c){var p=mn(c);return qt(p)&&(p=t),qt(a)?Ao(a,Bt(c,1,qt,!0),ge(p,2)):[]}),G$=Te(function(a,c){var p=mn(c);return qt(p)&&(p=t),qt(a)?Ao(a,Bt(c,1,qt,!0),t,p):[]});function K$(a,c,p){var v=a==null?0:a.length;return v?(c=p||c===t?1:Ee(c),hn(a,c<0?0:c,v)):[]}function Q$(a,c,p){var v=a==null?0:a.length;return v?(c=p||c===t?1:Ee(c),c=v-c,hn(a,0,c<0?0:c)):[]}function Z$(a,c){return a&&a.length?Ep(a,ge(c,3),!0,!0):[]}function X$(a,c){return a&&a.length?Ep(a,ge(c,3),!0):[]}function eM(a,c,p,v){var x=a==null?0:a.length;return x?(p&&typeof p!="number"&&wr(a,c,p)&&(p=0,v=x),bv(a,c,p,v)):[]}function nC(a,c,p){var v=a==null?0:a.length;if(!v)return-1;var x=p==null?0:Ee(p);return x<0&&(x=gt(v+x,0)),Wa(a,ge(c,3),x)}function iC(a,c,p){var v=a==null?0:a.length;if(!v)return-1;var x=v-1;return p!==t&&(x=Ee(p),x=p<0?gt(v+x,0):Ht(x,v-1)),Wa(a,ge(c,3),x,!0)}function sC(a){var c=a==null?0:a.length;return c?Bt(a,1):[]}function tM(a){var c=a==null?0:a.length;return c?Bt(a,ue):[]}function rM(a,c){var p=a==null?0:a.length;return p?(c=c===t?1:Ee(c),Bt(a,c)):[]}function nM(a){for(var c=-1,p=a==null?0:a.length,v={};++c<p;){var x=a[c];Yr(v,x[0],x[1])}return v}function oC(a){return a&&a.length?a[0]:t}function iM(a,c,p){var v=a==null?0:a.length;if(!v)return-1;var x=p==null?0:Ee(p);return x<0&&(x=gt(v+x,0)),Ti(a,c,x)}function sM(a){var c=a==null?0:a.length;return c?hn(a,0,-1):[]}var oM=Te(function(a){var c=lt(a,Tv);return c.length&&c[0]===a[0]?Gr(c):[]}),aM=Te(function(a){var c=mn(a),p=lt(a,Tv);return c===mn(p)?c=t:p.pop(),p.length&&p[0]===a[0]?Gr(p,ge(c,2)):[]}),lM=Te(function(a){var c=mn(a),p=lt(a,Tv);return c=typeof c=="function"?c:t,c&&p.pop(),p.length&&p[0]===a[0]?Gr(p,t,c):[]});function cM(a,c){return a==null?"":sl.call(a,c)}function mn(a){var c=a==null?0:a.length;return c?a[c-1]:t}function uM(a,c,p){var v=a==null?0:a.length;if(!v)return-1;var x=v;return p!==t&&(x=Ee(p),x=x<0?gt(v+x,0):Ht(x,v-1)),c===c?tu(a,c,x):Wa(a,Ai,x,!0)}function fM(a,c){return a&&a.length?Fn(a,Ee(c)):t}var dM=Te(aC);function aC(a,c){return a&&a.length&&c&&c.length?Cv(a,c):a}function pM(a,c,p){return a&&a.length&&c&&c.length?Cv(a,c,ge(p,2)):a}function hM(a,c,p){return a&&a.length&&c&&c.length?Cv(a,c,t,p):a}var mM=Fi(function(a,c){var p=a==null?0:a.length,v=au(a,c);return Sx(a,lt(c,function(x){return Li(x,p)?+x:x}).sort(kx)),v});function gM(a,c){var p=[];if(!(a&&a.length))return p;var v=-1,x=[],I=a.length;for(c=ge(c,3);++v<I;){var q=a[v];c(q,v,a)&&(p.push(q),x.push(v))}return Sx(a,x),p}function Wv(a){return a==null?a:Yy.call(a)}function yM(a,c,p){var v=a==null?0:a.length;return v?(p&&typeof p!="number"&&wr(a,c,p)?(c=0,p=v):(c=c==null?0:Ee(c),p=p===t?v:Ee(p)),hn(a,c,p)):[]}function vM(a,c){return Cp(a,c)}function bM(a,c,p){return Iv(a,c,ge(p,2))}function SM(a,c){var p=a==null?0:a.length;if(p){var v=Cp(a,c);if(v<p&&jn(a[v],c))return v}return-1}function wM(a,c){return Cp(a,c,!0)}function _M(a,c,p){return Iv(a,c,ge(p,2),!0)}function RM(a,c){var p=a==null?0:a.length;if(p){var v=Cp(a,c,!0)-1;if(jn(a[v],c))return v}return-1}function xM(a){return a&&a.length?_x(a):[]}function CM(a,c){return a&&a.length?_x(a,ge(c,2)):[]}function EM(a){var c=a==null?0:a.length;return c?hn(a,1,c):[]}function OM(a,c,p){return a&&a.length?(c=p||c===t?1:Ee(c),hn(a,0,c<0?0:c)):[]}function IM(a,c,p){var v=a==null?0:a.length;return v?(c=p||c===t?1:Ee(c),c=v-c,hn(a,c<0?0:c,v)):[]}function PM(a,c){return a&&a.length?Ep(a,ge(c,3),!1,!0):[]}function kM(a,c){return a&&a.length?Ep(a,ge(c,3)):[]}var TM=Te(function(a){return Es(Bt(a,1,qt,!0))}),AM=Te(function(a){var c=mn(a);return qt(c)&&(c=t),Es(Bt(a,1,qt,!0),ge(c,2))}),qM=Te(function(a){var c=mn(a);return c=typeof c=="function"?c:t,Es(Bt(a,1,qt,!0),t,c)});function $M(a){return a&&a.length?Es(a):[]}function MM(a,c){return a&&a.length?Es(a,ge(c,2)):[]}function NM(a,c){return c=typeof c=="function"?c:t,a&&a.length?Es(a,t,c):[]}function zv(a){if(!(a&&a.length))return[];var c=0;return a=ci(a,function(p){if(qt(p))return c=gt(p.length,c),!0}),Xc(c,function(p){return lt(a,bo(p))})}function lC(a,c){if(!(a&&a.length))return[];var p=zv(a);return c==null?p:lt(p,function(v){return mr(c,t,v)})}var DM=Te(function(a,c){return qt(a)?Ao(a,c):[]}),FM=Te(function(a){return kv(ci(a,qt))}),LM=Te(function(a){var c=mn(a);return qt(c)&&(c=t),kv(ci(a,qt),ge(c,2))}),jM=Te(function(a){var c=mn(a);return c=typeof c=="function"?c:t,kv(ci(a,qt),t,c)}),UM=Te(zv);function HM(a,c){return Ex(a||[],c||[],Sr)}function BM(a,c){return Ex(a||[],c||[],du)}var VM=Te(function(a){var c=a.length,p=c>1?a[c-1]:t;return p=typeof p=="function"?(a.pop(),p):t,lC(a,p)});function cC(a){var c=O(a);return c.__chain__=!0,c}function WM(a,c){return c(a),a}function Mp(a,c){return c(a)}var zM=Fi(function(a){var c=a.length,p=c?a[0]:0,v=this.__wrapped__,x=function(I){return au(I,a)};return c>1||this.__actions__.length||!(v instanceof $e)||!Li(p)?this.thru(x):(v=v.slice(p,+p+(c?1:0)),v.__actions__.push({func:Mp,args:[x],thisArg:t}),new nr(v,this.__chain__).thru(function(I){return c&&!I.length&&I.push(t),I}))});function JM(){return cC(this)}function YM(){return new nr(this.value(),this.__chain__)}function GM(){this.__values__===t&&(this.__values__=RC(this.value()));var a=this.__index__>=this.__values__.length,c=a?t:this.__values__[this.__index__++];return{done:a,value:c}}function KM(){return this}function QM(a){for(var c,p=this;p instanceof ll;){var v=rC(p);v.__index__=0,v.__values__=t,c?x.__wrapped__=v:c=v;var x=v;p=p.__wrapped__}return x.__wrapped__=a,c}function ZM(){var a=this.__wrapped__;if(a instanceof $e){var c=a;return this.__actions__.length&&(c=new $e(this)),c=c.reverse(),c.__actions__.push({func:Mp,args:[Wv],thisArg:t}),new nr(c,this.__chain__)}return this.thru(Wv)}function XM(){return Cx(this.__wrapped__,this.__actions__)}var eN=Op(function(a,c,p){Ze.call(a,p)?++a[p]:Yr(a,p,1)});function tN(a,c,p){var v=Re(a)?Gd:vv;return p&&wr(a,c,p)&&(c=t),v(a,ge(c,3))}function rN(a,c){var p=Re(a)?ci:wp;return p(a,ge(c,3))}var nN=Nx(nC),iN=Nx(iC);function sN(a,c){return Bt(Np(a,c),1)}function oN(a,c){return Bt(Np(a,c),ue)}function aN(a,c,p){return p=p===t?1:Ee(p),Bt(Np(a,c),p)}function uC(a,c){var p=Re(a)?gr:gi;return p(a,ge(c,3))}function fC(a,c){var p=Re(a)?Gc:Sp;return p(a,ge(c,3))}var lN=Op(function(a,c,p){Ze.call(a,p)?a[p].push(c):Yr(a,p,[c])});function cN(a,c,p,v){a=Ar(a)?a:yl(a),p=p&&!v?Ee(p):0;var x=a.length;return p<0&&(p=gt(x+p,0)),Up(a)?p<=x&&a.indexOf(c,p)>-1:!!x&&Ti(a,c,p)>-1}var uN=Te(function(a,c,p){var v=-1,x=typeof c=="function",I=Ar(a)?W(a.length):[];return gi(a,function(q){I[++v]=x?mr(c,q,p):qo(q,c,p)}),I}),fN=Op(function(a,c,p){Yr(a,p,c)});function Np(a,c){var p=Re(a)?lt:se;return p(a,ge(c,3))}function dN(a,c,p,v){return a==null?[]:(Re(c)||(c=c==null?[]:[c]),p=v?t:p,Re(p)||(p=p==null?[]:[p]),vx(a,c,p))}var pN=Op(function(a,c,p){a[p?0:1].push(c)},function(){return[[],[]]});function hN(a,c,p){var v=Re(a)?Kc:za,x=arguments.length<3;return v(a,ge(c,4),p,x,gi)}function mN(a,c,p){var v=Re(a)?Sy:za,x=arguments.length<3;return v(a,ge(c,4),p,x,Sp)}function gN(a,c){var p=Re(a)?ci:wp;return p(a,Lp(ge(c,3)))}function yN(a){var c=Re(a)?yp:c$;return c(a)}function vN(a,c,p){(p?wr(a,c,p):c===t)?c=1:c=Ee(c);var v=Re(a)?hv:u$;return v(a,c)}function bN(a){var c=Re(a)?mv:d$;return c(a)}function SN(a){if(a==null)return 0;if(Ar(a))return Up(a)?fi(a):a.length;var c=sr(a);return c==Jt||c==hr?a.size:E(a).length}function wN(a,c,p){var v=Re(a)?Va:p$;return p&&wr(a,c,p)&&(c=t),v(a,ge(c,3))}var _N=Te(function(a,c){if(a==null)return[];var p=c.length;return p>1&&wr(a,c[0],c[1])?c=[]:p>2&&wr(c[0],c[1],c[2])&&(c=[c[0]]),vx(a,Bt(c,1),[])}),Dp=Wy||function(){return Nt.Date.now()};function RN(a,c){if(typeof c!="function")throw new br(i);return a=Ee(a),function(){if(--a<1)return c.apply(this,arguments)}}function dC(a,c,p){return c=p?t:c,c=a&&c==null?a.length:c,Di(a,X,t,t,t,t,c)}function pC(a,c){var p;if(typeof c!="function")throw new br(i);return a=Ee(a),function(){return--a>0&&(p=c.apply(this,arguments)),a<=1&&(c=t),p}}var Jv=Te(function(a,c,p){var v=R;if(p.length){var x=un(p,ml(Jv));v|=z}return Di(a,v,c,p,x)}),hC=Te(function(a,c,p){var v=R|P;if(p.length){var x=un(p,ml(hC));v|=z}return Di(c,v,a,p,x)});function mC(a,c,p){c=p?t:c;var v=Di(a,U,t,t,t,t,t,c);return v.placeholder=mC.placeholder,v}function gC(a,c,p){c=p?t:c;var v=Di(a,B,t,t,t,t,t,c);return v.placeholder=gC.placeholder,v}function yC(a,c,p){var v,x,I,q,D,H,Q=0,Z=!1,ee=!1,ie=!0;if(typeof a!="function")throw new br(i);c=gn(c)||0,Ct(p)&&(Z=!!p.leading,ee="maxWait"in p,I=ee?gt(gn(p.maxWait)||0,c):I,ie="trailing"in p?!!p.trailing:ie);function fe($t){var Un=v,Hi=x;return v=x=t,Q=$t,q=a.apply(Hi,Un),q}function ye($t){return Q=$t,D=mu(Le,c),Z?fe($t):q}function Ie($t){var Un=$t-H,Hi=$t-Q,DC=c-Un;return ee?Ht(DC,I-Hi):DC}function me($t){var Un=$t-H,Hi=$t-Q;return H===t||Un>=c||Un<0||ee&&Hi>=I}function Le(){var $t=Dp();if(me($t))return He($t);D=mu(Le,Ie($t))}function He($t){return D=t,ie&&v?fe($t):(v=x=t,q)}function Zr(){D!==t&&Ox(D),Q=0,v=H=x=D=t}function _r(){return D===t?q:He(Dp())}function Xr(){var $t=Dp(),Un=me($t);if(v=arguments,x=this,H=$t,Un){if(D===t)return ye(H);if(ee)return Ox(D),D=mu(Le,c),fe(H)}return D===t&&(D=mu(Le,c)),q}return Xr.cancel=Zr,Xr.flush=_r,Xr}var xN=Te(function(a,c){return lu(a,1,c)}),CN=Te(function(a,c,p){return lu(a,gn(c)||0,p)});function EN(a){return Di(a,_)}function Fp(a,c){if(typeof a!="function"||c!=null&&typeof c!="function")throw new br(i);var p=function(){var v=arguments,x=c?c.apply(this,v):v[0],I=p.cache;if(I.has(x))return I.get(x);var q=a.apply(this,v);return p.cache=I.set(x,q)||I,q};return p.cache=new(Fp.Cache||Mn),p}Fp.Cache=Mn;function Lp(a){if(typeof a!="function")throw new br(i);return function(){var c=arguments;switch(c.length){case 0:return!a.call(this);case 1:return!a.call(this,c[0]);case 2:return!a.call(this,c[0],c[1]);case 3:return!a.call(this,c[0],c[1],c[2])}return!a.apply(this,c)}}function ON(a){return pC(2,a)}var IN=h$(function(a,c){c=c.length==1&&Re(c[0])?lt(c[0],yr(ge())):lt(Bt(c,1),yr(ge()));var p=c.length;return Te(function(v){for(var x=-1,I=Ht(v.length,p);++x<I;)v[x]=c[x].call(this,v[x]);return mr(a,this,v)})}),Yv=Te(function(a,c){var p=un(c,ml(Yv));return Di(a,z,t,c,p)}),vC=Te(function(a,c){var p=un(c,ml(vC));return Di(a,V,t,c,p)}),PN=Fi(function(a,c){return Di(a,T,t,t,t,c)});function kN(a,c){if(typeof a!="function")throw new br(i);return c=c===t?c:Ee(c),Te(a,c)}function TN(a,c){if(typeof a!="function")throw new br(i);return c=c==null?0:gt(Ee(c),0),Te(function(p){var v=p[c],x=Is(p,0,c);return v&&ui(x,v),mr(a,this,x)})}function AN(a,c,p){var v=!0,x=!0;if(typeof a!="function")throw new br(i);return Ct(p)&&(v="leading"in p?!!p.leading:v,x="trailing"in p?!!p.trailing:x),yC(a,c,{leading:v,maxWait:c,trailing:x})}function qN(a){return dC(a,1)}function $N(a,c){return Yv(Av(c),a)}function MN(){if(!arguments.length)return[];var a=arguments[0];return Re(a)?a:[a]}function NN(a){return ir(a,y)}function DN(a,c){return c=typeof c=="function"?c:t,ir(a,y,c)}function FN(a){return ir(a,m|y)}function LN(a,c){return c=typeof c=="function"?c:t,ir(a,m|y,c)}function jN(a,c){return c==null||dn(a,c,Kt(c))}function jn(a,c){return a===c||a!==a&&c!==c}var UN=Tp(uu),HN=Tp(function(a,c){return a>=c}),Do=xp((function(){return arguments})())?xp:function(a){return Ot(a)&&Ze.call(a,"callee")&&!xo.call(a,"callee")},Re=W.isArray,BN=Yc?yr(Yc):Rv;function Ar(a){return a!=null&&jp(a.length)&&!ji(a)}function qt(a){return Ot(a)&&Ar(a)}function VN(a){return a===!0||a===!1||Ot(a)&&Qt(a)==zr}var Ps=il||ob,WN=Jd?yr(Jd):xv;function zN(a){return Ot(a)&&a.nodeType===1&&!gu(a)}function JN(a){if(a==null)return!0;if(Ar(a)&&(Re(a)||typeof a=="string"||typeof a.splice=="function"||Ps(a)||gl(a)||Do(a)))return!a.length;var c=sr(a);if(c==Jt||c==hr)return!a.size;if(hu(a))return!E(a).length;for(var p in a)if(Ze.call(a,p))return!1;return!0}function YN(a,c){return $o(a,c)}function GN(a,c,p){p=typeof p=="function"?p:t;var v=p?p(a,c):t;return v===t?$o(a,c,t,p):!!v}function Gv(a){if(!Ot(a))return!1;var c=Qt(a);return c==mt||c==ht||typeof a.message=="string"&&typeof a.name=="string"&&!gu(a)}function KN(a){return typeof a=="number"&&$i(a)}function ji(a){if(!Ct(a))return!1;var c=Qt(a);return c==on||c==oo||c==Rt||c==Id}function bC(a){return typeof a=="number"&&a==Ee(a)}function jp(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=et}function Ct(a){var c=typeof a;return a!=null&&(c=="object"||c=="function")}function Ot(a){return a!=null&&typeof a=="object"}var SC=Yd?yr(Yd):xs;function QN(a,c){return a===c||Cs(a,c,Lv(c))}function ZN(a,c,p){return p=typeof p=="function"?p:t,Cs(a,c,Lv(c),p)}function XN(a){return wC(a)&&a!=+a}function eD(a){if(D$(a))throw new be(n);return Fe(a)}function tD(a){return a===null}function rD(a){return a==null}function wC(a){return typeof a=="number"||Ot(a)&&Qt(a)==ao}function gu(a){if(!Ot(a)||Qt(a)!=In)return!1;var c=el(a);if(c===null)return!0;var p=Ze.call(c,"constructor")&&c.constructor;return typeof p=="function"&&p instanceof p&&Ka.call(p)==Uy}var Kv=vo?yr(vo):u;function nD(a){return bC(a)&&a>=-et&&a<=et}var _C=An?yr(An):h;function Up(a){return typeof a=="string"||!Re(a)&&Ot(a)&&Qt(a)==lo}function Qr(a){return typeof a=="symbol"||Ot(a)&&Qt(a)==Pa}var gl=Ha?yr(Ha):b;function iD(a){return a===t}function sD(a){return Ot(a)&&sr(a)==Ut}function oD(a){return Ot(a)&&Qt(a)==kd}var aD=Tp(J),lD=Tp(function(a,c){return a<=c});function RC(a){if(!a)return[];if(Ar(a))return Up(a)?vr(a):Tr(a);if(Co&&a[Co])return Ty(a[Co]());var c=sr(a),p=c==Jt?vs:c==hr?Ya:yl;return p(a)}function Ui(a){if(!a)return a===0?a:0;if(a=gn(a),a===ue||a===-ue){var c=a<0?-1:1;return c*_e}return a===a?a:0}function Ee(a){var c=Ui(a),p=c%1;return c===c?p?c-p:c:0}function xC(a){return a?mi(Ee(a),0,Ce):0}function gn(a){if(typeof a=="number")return a;if(Qr(a))return he;if(Ct(a)){var c=typeof a.valueOf=="function"?a.valueOf():a;a=Ct(c)?c+"":c}if(typeof a!="string")return a===0?a:+a;a=eu(a);var p=po.test(a);return p||Kg.test(a)?vy(a.slice(2),p?2:8):Gg.test(a)?he:+a}function CC(a){return yi(a,qr(a))}function cD(a){return a?mi(Ee(a),-et,et):a===0?a:0}function nt(a){return a==null?"":Kr(a)}var uD=pl(function(a,c){if(hu(c)||Ar(c)){yi(c,Kt(c),a);return}for(var p in c)Ze.call(c,p)&&Sr(a,p,c[p])}),EC=pl(function(a,c){yi(c,qr(c),a)}),OC=pl(function(a,c,p,v){yi(c,qr(c),a,v)}),Qv=pl(function(a,c,p,v){yi(c,Kt(c),a,v)}),fD=Fi(au);function dD(a,c){var p=_s(a);return c==null?p:bp(p,c)}var pD=Te(function(a,c){a=Ue(a);var p=-1,v=c.length,x=v>2?c[2]:t;for(x&&wr(c[0],c[1],x)&&(v=1);++p<v;)for(var I=c[p],q=qr(I),D=-1,H=q.length;++D<H;){var Q=q[D],Z=a[Q];(Z===t||jn(Z,bs[Q])&&!Ze.call(a,Q))&&(a[Q]=I[Q])}return a}),hD=Te(function(a){return a.push(t,Bx),mr(IC,t,a)});function mD(a,c){return Kd(a,ge(c,3),pn)}function gD(a,c){return Kd(a,ge(c,3),Nn)}function yD(a,c){return a==null?a:cu(a,ge(c,3),qr)}function vD(a,c){return a==null?a:_p(a,ge(c,3),qr)}function bD(a,c){return a&&pn(a,ge(c,3))}function SD(a,c){return a&&Nn(a,ge(c,3))}function wD(a){return a==null?[]:dl(a,Kt(a))}function _D(a){return a==null?[]:dl(a,qr(a))}function Zv(a,c,p){var v=a==null?t:Ni(a,c);return v===t?p:v}function RD(a,c){return a!=null&&zx(a,c,Sv)}function Xv(a,c){return a!=null&&zx(a,c,wv)}var xD=Fx(function(a,c,p){c!=null&&typeof c.toString!="function"&&(c=Qa.call(c)),a[c]=p},tb($r)),CD=Fx(function(a,c,p){c!=null&&typeof c.toString!="function"&&(c=Qa.call(c)),Ze.call(a,c)?a[c].push(p):a[c]=[p]},ge),ED=Te(qo);function Kt(a){return Ar(a)?gp(a):E(a)}function qr(a){return Ar(a)?gp(a,!0):N(a)}function OD(a,c){var p={};return c=ge(c,3),pn(a,function(v,x,I){Yr(p,c(v,x,I),v)}),p}function ID(a,c){var p={};return c=ge(c,3),pn(a,function(v,x,I){Yr(p,x,c(v,x,I))}),p}var PD=pl(function(a,c,p){Dt(a,c,p)}),IC=pl(function(a,c,p,v){Dt(a,c,p,v)}),kD=Fi(function(a,c){var p={};if(a==null)return p;var v=!1;c=lt(c,function(I){return I=Os(I,a),v||(v=I.length>1),I}),yi(a,Dv(a),p),v&&(p=ir(p,m|g|y,C$));for(var x=c.length;x--;)Pv(p,c[x]);return p});function TD(a,c){return PC(a,Lp(ge(c)))}var AD=Fi(function(a,c){return a==null?{}:o$(a,c)});function PC(a,c){if(a==null)return{};var p=lt(Dv(a),function(v){return[v]});return c=ge(c),bx(a,p,function(v,x){return c(v,x[0])})}function qD(a,c,p){c=Os(c,a);var v=-1,x=c.length;for(x||(x=1,a=t);++v<x;){var I=a==null?t:a[Ln(c[v])];I===t&&(v=x,I=p),a=ji(I)?I.call(a):I}return a}function $D(a,c,p){return a==null?a:du(a,c,p)}function MD(a,c,p,v){return v=typeof v=="function"?v:t,a==null?a:du(a,c,p,v)}var kC=Ux(Kt),TC=Ux(qr);function ND(a,c,p){var v=Re(a),x=v||Ps(a)||gl(a);if(c=ge(c,4),p==null){var I=a&&a.constructor;x?p=v?new I:[]:Ct(a)?p=ji(I)?_s(el(a)):{}:p={}}return(x?gr:pn)(a,function(q,D,H){return c(p,q,D,H)}),p}function DD(a,c){return a==null?!0:Pv(a,c)}function FD(a,c,p){return a==null?a:xx(a,c,Av(p))}function LD(a,c,p,v){return v=typeof v=="function"?v:t,a==null?a:xx(a,c,Av(p),v)}function yl(a){return a==null?[]:Ja(a,Kt(a))}function jD(a){return a==null?[]:Ja(a,qr(a))}function UD(a,c,p){return p===t&&(p=c,c=t),p!==t&&(p=gn(p),p=p===p?p:0),c!==t&&(c=gn(c),c=c===c?c:0),mi(gn(a),c,p)}function HD(a,c,p){return c=Ui(c),p===t?(p=c,c=0):p=Ui(p),a=gn(a),_v(a,c,p)}function BD(a,c,p){if(p&&typeof p!="boolean"&&wr(a,c,p)&&(c=p=t),p===t&&(typeof c=="boolean"?(p=c,c=t):typeof a=="boolean"&&(p=a,a=t)),a===t&&c===t?(a=0,c=1):(a=Ui(a),c===t?(c=a,a=0):c=Ui(c)),a>c){var v=a;a=c,c=v}if(p||a%1||c%1){var x=cp();return Ht(a+x*(c-a+Wd("1e-"+((x+"").length-1))),c)}return Ev(a,c)}var VD=hl(function(a,c,p){return c=c.toLowerCase(),a+(p?AC(c):c)});function AC(a){return eb(nt(a).toLowerCase())}function qC(a){return a=nt(a),a&&a.replace(ho,Oy).replace(fy,"")}function WD(a,c,p){a=nt(a),c=Kr(c);var v=a.length;p=p===t?v:mi(Ee(p),0,v);var x=p;return p-=c.length,p>=0&&a.slice(p,x)==c}function zD(a){return a=nt(a),a&&le.test(a)?a.replace(qa,Iy):a}function JD(a){return a=nt(a),a&&fo.test(a)?a.replace(Ke,"\\$&"):a}var YD=hl(function(a,c,p){return a+(p?"-":"")+c.toLowerCase()}),GD=hl(function(a,c,p){return a+(p?" ":"")+c.toLowerCase()}),KD=Mx("toLowerCase");function QD(a,c,p){a=nt(a),c=Ee(c);var v=c?fi(a):0;if(!c||v>=c)return a;var x=(c-v)/2;return kp(Oo(x),p)+a+kp(Eo(x),p)}function ZD(a,c,p){a=nt(a),c=Ee(c);var v=c?fi(a):0;return c&&v<c?a+kp(c-v,p):a}function XD(a,c,p){a=nt(a),c=Ee(c);var v=c?fi(a):0;return c&&v<c?kp(c-v,p)+a:a}function eF(a,c,p){return p||c==null?c=0:c&&(c=+c),Jy(nt(a).replace(Dc,""),c||0)}function tF(a,c,p){return(p?wr(a,c,p):c===t)?c=1:c=Ee(c),Ov(nt(a),c)}function rF(){var a=arguments,c=nt(a[0]);return a.length<3?c:c.replace(a[1],a[2])}var nF=hl(function(a,c,p){return a+(p?"_":"")+c.toLowerCase()});function iF(a,c,p){return p&&typeof p!="number"&&wr(a,c,p)&&(c=p=t),p=p===t?Ce:p>>>0,p?(a=nt(a),a&&(typeof c=="string"||c!=null&&!Kv(c))&&(c=Kr(c),!c&&ys(a))?Is(vr(a),0,p):a.split(c,p)):[]}var sF=hl(function(a,c,p){return a+(p?" ":"")+eb(c)});function oF(a,c,p){return a=nt(a),p=p==null?0:mi(Ee(p),0,a.length),c=Kr(c),a.slice(p,p+c.length)==c}function aF(a,c,p){var v=O.templateSettings;p&&wr(a,c,p)&&(c=t),a=nt(a),c=Qv({},c,v,Hx);var x=Qv({},c.imports,v.imports,Hx),I=Kt(x),q=Ja(x,I);gr(I,function(me){if(Pr.test(me))throw new be(o)});var D,H,Q=0,Z=c.interpolate||mo,ee="__p += '",ie=Ga((c.escape||mo).source+"|"+Z.source+"|"+(Z===an?Pi:mo).source+"|"+(c.evaluate||mo).source+"|$","g"),fe="//# sourceURL="+(Ze.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++gy+"]")+`
|
|
4
|
-
`;
|
|
3
|
+
`)}function N$(o){return Re(o)||Do(o)||!!(op&&o&&o[op])}function Li(o,c){var p=typeof o;return c=c??et,!!c&&(p=="number"||p!="symbol"&&ds.test(o))&&o>-1&&o%1==0&&o<c}function wr(o,c,p){if(!Ct(p))return!1;var v=typeof c;return(v=="number"?Ar(p)&&Li(c,p.length):v=="string"&&c in p)?jn(p[c],o):!1}function Uv(o,c){if(Re(o))return!1;var p=typeof o;return p=="number"||p=="symbol"||p=="boolean"||o==null||Qr(o)?!0:qe.test(o)||!Ir.test(o)||c!=null&&o in Ue(c)}function D$(o){var c=typeof o;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?o!=="__proto__":o===null}function Hv(o){var c=Ap(o),p=O[c];if(typeof p!="function"||!(c in $e.prototype))return!1;if(o===p)return!0;var v=Fv(p);return!!v&&o===v[0]}function F$(o){return!!np&&np in o}var L$=Ro?ji:ob;function hu(o){var c=o&&o.constructor,p=typeof c=="function"&&c.prototype||bs;return o===p}function Yx(o){return o===o&&!Ct(o)}function Gx(o,c){return function(p){return p==null?!1:p[o]===c&&(c!==t||o in Ue(p))}}function j$(o){var c=Fp(o,function(v){return p.size===f&&p.clear(),v}),p=c.cache;return c}function U$(o,c){var p=o[1],v=c[1],x=p|v,I=x<(R|T|X),q=v==X&&p==U||v==X&&p==P&&o[7].length<=c[8]||v==(X|P)&&c[7].length<=c[8]&&p==U;if(!(I||q))return o;v&R&&(o[2]=c[2],x|=p&R?0:A);var D=c[3];if(D){var H=o[3];o[3]=H?Tx(H,D,c[4]):D,o[4]=H?un(o[3],d):c[4]}return D=c[5],D&&(H=o[5],o[5]=H?Ax(H,D,c[6]):D,o[6]=H?un(o[5],d):c[6]),D=c[7],D&&(o[7]=D),v&X&&(o[8]=o[8]==null?c[8]:Ht(o[8],c[8])),o[9]==null&&(o[9]=c[9]),o[0]=c[0],o[1]=x,o}function H$(o){var c=[];if(o!=null)for(var p in Ue(o))c.push(p);return c}function B$(o){return Qa.call(o)}function Kx(o,c,p){return c=gt(c===t?o.length-1:c,0),function(){for(var v=arguments,x=-1,I=gt(v.length-c,0),q=z(I);++x<I;)q[x]=v[c+x];x=-1;for(var D=z(c+1);++x<c;)D[x]=v[x];return D[c]=p(q),mr(o,this,D)}}function Qx(o,c){return c.length<2?o:Ni(o,hn(c,0,-1))}function V$(o,c){for(var p=o.length,v=Ht(c.length,p),x=Tr(o);v--;){var I=c[v];o[v]=Li(I,p)?x[I]:t}return o}function Bv(o,c){if(!(c==="constructor"&&typeof o[c]=="function")&&c!="__proto__")return o[c]}var Zx=eC(wx),mu=zy||function(o,c){return Nt.setTimeout(o,c)},Vv=eC(p$);function Xx(o,c,p){var v=c+"";return Vv(o,M$(v,W$(A$(v),p)))}function eC(o){var c=0,p=0;return function(){var v=lp(),x=$-(v-p);if(p=v,x>0){if(++c>=j)return arguments[0]}else c=0;return o.apply(t,arguments)}}function $p(o,c){var p=-1,v=o.length,x=v-1;for(c=c===t?v:c;++p<c;){var I=Ev(p,x),q=o[I];o[I]=o[p],o[p]=q}return o.length=c,o}var tC=j$(function(o){var c=[];return o.charCodeAt(0)===46&&c.push(""),o.replace(Nc,function(p,v,x,I){c.push(x?I.replace(Tn,"$1"):v||p)}),c});function Ln(o){if(typeof o=="string"||Qr(o))return o;var c=o+"";return c=="0"&&1/o==-ue?"-0":c}function No(o){if(o!=null){try{return Ka.call(o)}catch{}try{return o+""}catch{}}return""}function W$(o,c){return gr(ce,function(p){var v="_."+p[0];c&p[1]&&!Ba(o,v)&&o.push(v)}),o.sort()}function rC(o){if(o instanceof $e)return o.clone();var c=new nr(o.__wrapped__,o.__chain__);return c.__actions__=Tr(o.__actions__),c.__index__=o.__index__,c.__values__=o.__values__,c}function z$(o,c,p){(p?wr(o,c,p):c===t)?c=1:c=gt(Ee(c),0);var v=o==null?0:o.length;if(!v||c<1)return[];for(var x=0,I=0,q=z(Eo(v/c));x<v;)q[I++]=hn(o,x,x+=c);return q}function J$(o){for(var c=-1,p=o==null?0:o.length,v=0,x=[];++c<p;){var I=o[c];I&&(x[v++]=I)}return x}function Y$(){var o=arguments.length;if(!o)return[];for(var c=z(o-1),p=arguments[0],v=o;v--;)c[v-1]=arguments[v];return ui(Re(p)?Tr(p):[p],Bt(c,1))}var G$=Te(function(o,c){return qt(o)?Ao(o,Bt(c,1,qt,!0)):[]}),K$=Te(function(o,c){var p=mn(c);return qt(p)&&(p=t),qt(o)?Ao(o,Bt(c,1,qt,!0),ge(p,2)):[]}),Q$=Te(function(o,c){var p=mn(c);return qt(p)&&(p=t),qt(o)?Ao(o,Bt(c,1,qt,!0),t,p):[]});function Z$(o,c,p){var v=o==null?0:o.length;return v?(c=p||c===t?1:Ee(c),hn(o,c<0?0:c,v)):[]}function X$(o,c,p){var v=o==null?0:o.length;return v?(c=p||c===t?1:Ee(c),c=v-c,hn(o,0,c<0?0:c)):[]}function eM(o,c){return o&&o.length?Ep(o,ge(c,3),!0,!0):[]}function tM(o,c){return o&&o.length?Ep(o,ge(c,3),!0):[]}function rM(o,c,p,v){var x=o==null?0:o.length;return x?(p&&typeof p!="number"&&wr(o,c,p)&&(p=0,v=x),bv(o,c,p,v)):[]}function nC(o,c,p){var v=o==null?0:o.length;if(!v)return-1;var x=p==null?0:Ee(p);return x<0&&(x=gt(v+x,0)),Wa(o,ge(c,3),x)}function iC(o,c,p){var v=o==null?0:o.length;if(!v)return-1;var x=v-1;return p!==t&&(x=Ee(p),x=p<0?gt(v+x,0):Ht(x,v-1)),Wa(o,ge(c,3),x,!0)}function sC(o){var c=o==null?0:o.length;return c?Bt(o,1):[]}function nM(o){var c=o==null?0:o.length;return c?Bt(o,ue):[]}function iM(o,c){var p=o==null?0:o.length;return p?(c=c===t?1:Ee(c),Bt(o,c)):[]}function sM(o){for(var c=-1,p=o==null?0:o.length,v={};++c<p;){var x=o[c];Yr(v,x[0],x[1])}return v}function oC(o){return o&&o.length?o[0]:t}function oM(o,c,p){var v=o==null?0:o.length;if(!v)return-1;var x=p==null?0:Ee(p);return x<0&&(x=gt(v+x,0)),Ti(o,c,x)}function aM(o){var c=o==null?0:o.length;return c?hn(o,0,-1):[]}var lM=Te(function(o){var c=lt(o,Tv);return c.length&&c[0]===o[0]?Gr(c):[]}),cM=Te(function(o){var c=mn(o),p=lt(o,Tv);return c===mn(p)?c=t:p.pop(),p.length&&p[0]===o[0]?Gr(p,ge(c,2)):[]}),uM=Te(function(o){var c=mn(o),p=lt(o,Tv);return c=typeof c=="function"?c:t,c&&p.pop(),p.length&&p[0]===o[0]?Gr(p,t,c):[]});function fM(o,c){return o==null?"":sl.call(o,c)}function mn(o){var c=o==null?0:o.length;return c?o[c-1]:t}function dM(o,c,p){var v=o==null?0:o.length;if(!v)return-1;var x=v;return p!==t&&(x=Ee(p),x=x<0?gt(v+x,0):Ht(x,v-1)),c===c?tu(o,c,x):Wa(o,Ai,x,!0)}function pM(o,c){return o&&o.length?Fn(o,Ee(c)):t}var hM=Te(aC);function aC(o,c){return o&&o.length&&c&&c.length?Cv(o,c):o}function mM(o,c,p){return o&&o.length&&c&&c.length?Cv(o,c,ge(p,2)):o}function gM(o,c,p){return o&&o.length&&c&&c.length?Cv(o,c,t,p):o}var yM=Fi(function(o,c){var p=o==null?0:o.length,v=au(o,c);return Sx(o,lt(c,function(x){return Li(x,p)?+x:x}).sort(kx)),v});function vM(o,c){var p=[];if(!(o&&o.length))return p;var v=-1,x=[],I=o.length;for(c=ge(c,3);++v<I;){var q=o[v];c(q,v,o)&&(p.push(q),x.push(v))}return Sx(o,x),p}function Wv(o){return o==null?o:Yy.call(o)}function bM(o,c,p){var v=o==null?0:o.length;return v?(p&&typeof p!="number"&&wr(o,c,p)?(c=0,p=v):(c=c==null?0:Ee(c),p=p===t?v:Ee(p)),hn(o,c,p)):[]}function SM(o,c){return Cp(o,c)}function wM(o,c,p){return Iv(o,c,ge(p,2))}function _M(o,c){var p=o==null?0:o.length;if(p){var v=Cp(o,c);if(v<p&&jn(o[v],c))return v}return-1}function RM(o,c){return Cp(o,c,!0)}function xM(o,c,p){return Iv(o,c,ge(p,2),!0)}function CM(o,c){var p=o==null?0:o.length;if(p){var v=Cp(o,c,!0)-1;if(jn(o[v],c))return v}return-1}function EM(o){return o&&o.length?_x(o):[]}function OM(o,c){return o&&o.length?_x(o,ge(c,2)):[]}function IM(o){var c=o==null?0:o.length;return c?hn(o,1,c):[]}function PM(o,c,p){return o&&o.length?(c=p||c===t?1:Ee(c),hn(o,0,c<0?0:c)):[]}function kM(o,c,p){var v=o==null?0:o.length;return v?(c=p||c===t?1:Ee(c),c=v-c,hn(o,c<0?0:c,v)):[]}function TM(o,c){return o&&o.length?Ep(o,ge(c,3),!1,!0):[]}function AM(o,c){return o&&o.length?Ep(o,ge(c,3)):[]}var qM=Te(function(o){return Es(Bt(o,1,qt,!0))}),$M=Te(function(o){var c=mn(o);return qt(c)&&(c=t),Es(Bt(o,1,qt,!0),ge(c,2))}),MM=Te(function(o){var c=mn(o);return c=typeof c=="function"?c:t,Es(Bt(o,1,qt,!0),t,c)});function NM(o){return o&&o.length?Es(o):[]}function DM(o,c){return o&&o.length?Es(o,ge(c,2)):[]}function FM(o,c){return c=typeof c=="function"?c:t,o&&o.length?Es(o,t,c):[]}function zv(o){if(!(o&&o.length))return[];var c=0;return o=ci(o,function(p){if(qt(p))return c=gt(p.length,c),!0}),Xc(c,function(p){return lt(o,bo(p))})}function lC(o,c){if(!(o&&o.length))return[];var p=zv(o);return c==null?p:lt(p,function(v){return mr(c,t,v)})}var LM=Te(function(o,c){return qt(o)?Ao(o,c):[]}),jM=Te(function(o){return kv(ci(o,qt))}),UM=Te(function(o){var c=mn(o);return qt(c)&&(c=t),kv(ci(o,qt),ge(c,2))}),HM=Te(function(o){var c=mn(o);return c=typeof c=="function"?c:t,kv(ci(o,qt),t,c)}),BM=Te(zv);function VM(o,c){return Ex(o||[],c||[],Sr)}function WM(o,c){return Ex(o||[],c||[],du)}var zM=Te(function(o){var c=o.length,p=c>1?o[c-1]:t;return p=typeof p=="function"?(o.pop(),p):t,lC(o,p)});function cC(o){var c=O(o);return c.__chain__=!0,c}function JM(o,c){return c(o),o}function Mp(o,c){return c(o)}var YM=Fi(function(o){var c=o.length,p=c?o[0]:0,v=this.__wrapped__,x=function(I){return au(I,o)};return c>1||this.__actions__.length||!(v instanceof $e)||!Li(p)?this.thru(x):(v=v.slice(p,+p+(c?1:0)),v.__actions__.push({func:Mp,args:[x],thisArg:t}),new nr(v,this.__chain__).thru(function(I){return c&&!I.length&&I.push(t),I}))});function GM(){return cC(this)}function KM(){return new nr(this.value(),this.__chain__)}function QM(){this.__values__===t&&(this.__values__=RC(this.value()));var o=this.__index__>=this.__values__.length,c=o?t:this.__values__[this.__index__++];return{done:o,value:c}}function ZM(){return this}function XM(o){for(var c,p=this;p instanceof ll;){var v=rC(p);v.__index__=0,v.__values__=t,c?x.__wrapped__=v:c=v;var x=v;p=p.__wrapped__}return x.__wrapped__=o,c}function eN(){var o=this.__wrapped__;if(o instanceof $e){var c=o;return this.__actions__.length&&(c=new $e(this)),c=c.reverse(),c.__actions__.push({func:Mp,args:[Wv],thisArg:t}),new nr(c,this.__chain__)}return this.thru(Wv)}function tN(){return Cx(this.__wrapped__,this.__actions__)}var rN=Op(function(o,c,p){Ze.call(o,p)?++o[p]:Yr(o,p,1)});function nN(o,c,p){var v=Re(o)?Gd:vv;return p&&wr(o,c,p)&&(c=t),v(o,ge(c,3))}function iN(o,c){var p=Re(o)?ci:wp;return p(o,ge(c,3))}var sN=Nx(nC),oN=Nx(iC);function aN(o,c){return Bt(Np(o,c),1)}function lN(o,c){return Bt(Np(o,c),ue)}function cN(o,c,p){return p=p===t?1:Ee(p),Bt(Np(o,c),p)}function uC(o,c){var p=Re(o)?gr:gi;return p(o,ge(c,3))}function fC(o,c){var p=Re(o)?Gc:Sp;return p(o,ge(c,3))}var uN=Op(function(o,c,p){Ze.call(o,p)?o[p].push(c):Yr(o,p,[c])});function fN(o,c,p,v){o=Ar(o)?o:yl(o),p=p&&!v?Ee(p):0;var x=o.length;return p<0&&(p=gt(x+p,0)),Up(o)?p<=x&&o.indexOf(c,p)>-1:!!x&&Ti(o,c,p)>-1}var dN=Te(function(o,c,p){var v=-1,x=typeof c=="function",I=Ar(o)?z(o.length):[];return gi(o,function(q){I[++v]=x?mr(c,q,p):qo(q,c,p)}),I}),pN=Op(function(o,c,p){Yr(o,p,c)});function Np(o,c){var p=Re(o)?lt:se;return p(o,ge(c,3))}function hN(o,c,p,v){return o==null?[]:(Re(c)||(c=c==null?[]:[c]),p=v?t:p,Re(p)||(p=p==null?[]:[p]),vx(o,c,p))}var mN=Op(function(o,c,p){o[p?0:1].push(c)},function(){return[[],[]]});function gN(o,c,p){var v=Re(o)?Kc:za,x=arguments.length<3;return v(o,ge(c,4),p,x,gi)}function yN(o,c,p){var v=Re(o)?Sy:za,x=arguments.length<3;return v(o,ge(c,4),p,x,Sp)}function vN(o,c){var p=Re(o)?ci:wp;return p(o,Lp(ge(c,3)))}function bN(o){var c=Re(o)?yp:f$;return c(o)}function SN(o,c,p){(p?wr(o,c,p):c===t)?c=1:c=Ee(c);var v=Re(o)?hv:d$;return v(o,c)}function wN(o){var c=Re(o)?mv:h$;return c(o)}function _N(o){if(o==null)return 0;if(Ar(o))return Up(o)?fi(o):o.length;var c=sr(o);return c==Jt||c==hr?o.size:E(o).length}function RN(o,c,p){var v=Re(o)?Va:m$;return p&&wr(o,c,p)&&(c=t),v(o,ge(c,3))}var xN=Te(function(o,c){if(o==null)return[];var p=c.length;return p>1&&wr(o,c[0],c[1])?c=[]:p>2&&wr(c[0],c[1],c[2])&&(c=[c[0]]),vx(o,Bt(c,1),[])}),Dp=Wy||function(){return Nt.Date.now()};function CN(o,c){if(typeof c!="function")throw new br(i);return o=Ee(o),function(){if(--o<1)return c.apply(this,arguments)}}function dC(o,c,p){return c=p?t:c,c=o&&c==null?o.length:c,Di(o,X,t,t,t,t,c)}function pC(o,c){var p;if(typeof c!="function")throw new br(i);return o=Ee(o),function(){return--o>0&&(p=c.apply(this,arguments)),o<=1&&(c=t),p}}var Jv=Te(function(o,c,p){var v=R;if(p.length){var x=un(p,ml(Jv));v|=V}return Di(o,v,c,p,x)}),hC=Te(function(o,c,p){var v=R|T;if(p.length){var x=un(p,ml(hC));v|=V}return Di(c,v,o,p,x)});function mC(o,c,p){c=p?t:c;var v=Di(o,U,t,t,t,t,t,c);return v.placeholder=mC.placeholder,v}function gC(o,c,p){c=p?t:c;var v=Di(o,B,t,t,t,t,t,c);return v.placeholder=gC.placeholder,v}function yC(o,c,p){var v,x,I,q,D,H,Q=0,Z=!1,ee=!1,ie=!0;if(typeof o!="function")throw new br(i);c=gn(c)||0,Ct(p)&&(Z=!!p.leading,ee="maxWait"in p,I=ee?gt(gn(p.maxWait)||0,c):I,ie="trailing"in p?!!p.trailing:ie);function fe($t){var Un=v,Hi=x;return v=x=t,Q=$t,q=o.apply(Hi,Un),q}function ye($t){return Q=$t,D=mu(Le,c),Z?fe($t):q}function Ie($t){var Un=$t-H,Hi=$t-Q,DC=c-Un;return ee?Ht(DC,I-Hi):DC}function me($t){var Un=$t-H,Hi=$t-Q;return H===t||Un>=c||Un<0||ee&&Hi>=I}function Le(){var $t=Dp();if(me($t))return He($t);D=mu(Le,Ie($t))}function He($t){return D=t,ie&&v?fe($t):(v=x=t,q)}function Zr(){D!==t&&Ox(D),Q=0,v=H=x=D=t}function _r(){return D===t?q:He(Dp())}function Xr(){var $t=Dp(),Un=me($t);if(v=arguments,x=this,H=$t,Un){if(D===t)return ye(H);if(ee)return Ox(D),D=mu(Le,c),fe(H)}return D===t&&(D=mu(Le,c)),q}return Xr.cancel=Zr,Xr.flush=_r,Xr}var EN=Te(function(o,c){return lu(o,1,c)}),ON=Te(function(o,c,p){return lu(o,gn(c)||0,p)});function IN(o){return Di(o,_)}function Fp(o,c){if(typeof o!="function"||c!=null&&typeof c!="function")throw new br(i);var p=function(){var v=arguments,x=c?c.apply(this,v):v[0],I=p.cache;if(I.has(x))return I.get(x);var q=o.apply(this,v);return p.cache=I.set(x,q)||I,q};return p.cache=new(Fp.Cache||Mn),p}Fp.Cache=Mn;function Lp(o){if(typeof o!="function")throw new br(i);return function(){var c=arguments;switch(c.length){case 0:return!o.call(this);case 1:return!o.call(this,c[0]);case 2:return!o.call(this,c[0],c[1]);case 3:return!o.call(this,c[0],c[1],c[2])}return!o.apply(this,c)}}function PN(o){return pC(2,o)}var kN=g$(function(o,c){c=c.length==1&&Re(c[0])?lt(c[0],yr(ge())):lt(Bt(c,1),yr(ge()));var p=c.length;return Te(function(v){for(var x=-1,I=Ht(v.length,p);++x<I;)v[x]=c[x].call(this,v[x]);return mr(o,this,v)})}),Yv=Te(function(o,c){var p=un(c,ml(Yv));return Di(o,V,t,c,p)}),vC=Te(function(o,c){var p=un(c,ml(vC));return Di(o,W,t,c,p)}),TN=Fi(function(o,c){return Di(o,P,t,t,t,c)});function AN(o,c){if(typeof o!="function")throw new br(i);return c=c===t?c:Ee(c),Te(o,c)}function qN(o,c){if(typeof o!="function")throw new br(i);return c=c==null?0:gt(Ee(c),0),Te(function(p){var v=p[c],x=Is(p,0,c);return v&&ui(x,v),mr(o,this,x)})}function $N(o,c,p){var v=!0,x=!0;if(typeof o!="function")throw new br(i);return Ct(p)&&(v="leading"in p?!!p.leading:v,x="trailing"in p?!!p.trailing:x),yC(o,c,{leading:v,maxWait:c,trailing:x})}function MN(o){return dC(o,1)}function NN(o,c){return Yv(Av(c),o)}function DN(){if(!arguments.length)return[];var o=arguments[0];return Re(o)?o:[o]}function FN(o){return ir(o,y)}function LN(o,c){return c=typeof c=="function"?c:t,ir(o,y,c)}function jN(o){return ir(o,m|y)}function UN(o,c){return c=typeof c=="function"?c:t,ir(o,m|y,c)}function HN(o,c){return c==null||dn(o,c,Kt(c))}function jn(o,c){return o===c||o!==o&&c!==c}var BN=Tp(uu),VN=Tp(function(o,c){return o>=c}),Do=xp((function(){return arguments})())?xp:function(o){return Ot(o)&&Ze.call(o,"callee")&&!xo.call(o,"callee")},Re=z.isArray,WN=Yc?yr(Yc):Rv;function Ar(o){return o!=null&&jp(o.length)&&!ji(o)}function qt(o){return Ot(o)&&Ar(o)}function zN(o){return o===!0||o===!1||Ot(o)&&Qt(o)==zr}var Ps=il||ob,JN=Jd?yr(Jd):xv;function YN(o){return Ot(o)&&o.nodeType===1&&!gu(o)}function GN(o){if(o==null)return!0;if(Ar(o)&&(Re(o)||typeof o=="string"||typeof o.splice=="function"||Ps(o)||gl(o)||Do(o)))return!o.length;var c=sr(o);if(c==Jt||c==hr)return!o.size;if(hu(o))return!E(o).length;for(var p in o)if(Ze.call(o,p))return!1;return!0}function KN(o,c){return $o(o,c)}function QN(o,c,p){p=typeof p=="function"?p:t;var v=p?p(o,c):t;return v===t?$o(o,c,t,p):!!v}function Gv(o){if(!Ot(o))return!1;var c=Qt(o);return c==mt||c==ht||typeof o.message=="string"&&typeof o.name=="string"&&!gu(o)}function ZN(o){return typeof o=="number"&&$i(o)}function ji(o){if(!Ct(o))return!1;var c=Qt(o);return c==on||c==oo||c==Rt||c==Id}function bC(o){return typeof o=="number"&&o==Ee(o)}function jp(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=et}function Ct(o){var c=typeof o;return o!=null&&(c=="object"||c=="function")}function Ot(o){return o!=null&&typeof o=="object"}var SC=Yd?yr(Yd):xs;function XN(o,c){return o===c||Cs(o,c,Lv(c))}function eD(o,c,p){return p=typeof p=="function"?p:t,Cs(o,c,Lv(c),p)}function tD(o){return wC(o)&&o!=+o}function rD(o){if(L$(o))throw new be(n);return Fe(o)}function nD(o){return o===null}function iD(o){return o==null}function wC(o){return typeof o=="number"||Ot(o)&&Qt(o)==ao}function gu(o){if(!Ot(o)||Qt(o)!=In)return!1;var c=el(o);if(c===null)return!0;var p=Ze.call(c,"constructor")&&c.constructor;return typeof p=="function"&&p instanceof p&&Ka.call(p)==Uy}var Kv=vo?yr(vo):u;function sD(o){return bC(o)&&o>=-et&&o<=et}var _C=An?yr(An):h;function Up(o){return typeof o=="string"||!Re(o)&&Ot(o)&&Qt(o)==lo}function Qr(o){return typeof o=="symbol"||Ot(o)&&Qt(o)==Pa}var gl=Ha?yr(Ha):b;function oD(o){return o===t}function aD(o){return Ot(o)&&sr(o)==Ut}function lD(o){return Ot(o)&&Qt(o)==kd}var cD=Tp(J),uD=Tp(function(o,c){return o<=c});function RC(o){if(!o)return[];if(Ar(o))return Up(o)?vr(o):Tr(o);if(Co&&o[Co])return Ty(o[Co]());var c=sr(o),p=c==Jt?vs:c==hr?Ya:yl;return p(o)}function Ui(o){if(!o)return o===0?o:0;if(o=gn(o),o===ue||o===-ue){var c=o<0?-1:1;return c*_e}return o===o?o:0}function Ee(o){var c=Ui(o),p=c%1;return c===c?p?c-p:c:0}function xC(o){return o?mi(Ee(o),0,Ce):0}function gn(o){if(typeof o=="number")return o;if(Qr(o))return he;if(Ct(o)){var c=typeof o.valueOf=="function"?o.valueOf():o;o=Ct(c)?c+"":c}if(typeof o!="string")return o===0?o:+o;o=eu(o);var p=po.test(o);return p||Kg.test(o)?vy(o.slice(2),p?2:8):Gg.test(o)?he:+o}function CC(o){return yi(o,qr(o))}function fD(o){return o?mi(Ee(o),-et,et):o===0?o:0}function nt(o){return o==null?"":Kr(o)}var dD=pl(function(o,c){if(hu(c)||Ar(c)){yi(c,Kt(c),o);return}for(var p in c)Ze.call(c,p)&&Sr(o,p,c[p])}),EC=pl(function(o,c){yi(c,qr(c),o)}),OC=pl(function(o,c,p,v){yi(c,qr(c),o,v)}),Qv=pl(function(o,c,p,v){yi(c,Kt(c),o,v)}),pD=Fi(au);function hD(o,c){var p=_s(o);return c==null?p:bp(p,c)}var mD=Te(function(o,c){o=Ue(o);var p=-1,v=c.length,x=v>2?c[2]:t;for(x&&wr(c[0],c[1],x)&&(v=1);++p<v;)for(var I=c[p],q=qr(I),D=-1,H=q.length;++D<H;){var Q=q[D],Z=o[Q];(Z===t||jn(Z,bs[Q])&&!Ze.call(o,Q))&&(o[Q]=I[Q])}return o}),gD=Te(function(o){return o.push(t,Bx),mr(IC,t,o)});function yD(o,c){return Kd(o,ge(c,3),pn)}function vD(o,c){return Kd(o,ge(c,3),Nn)}function bD(o,c){return o==null?o:cu(o,ge(c,3),qr)}function SD(o,c){return o==null?o:_p(o,ge(c,3),qr)}function wD(o,c){return o&&pn(o,ge(c,3))}function _D(o,c){return o&&Nn(o,ge(c,3))}function RD(o){return o==null?[]:dl(o,Kt(o))}function xD(o){return o==null?[]:dl(o,qr(o))}function Zv(o,c,p){var v=o==null?t:Ni(o,c);return v===t?p:v}function CD(o,c){return o!=null&&zx(o,c,Sv)}function Xv(o,c){return o!=null&&zx(o,c,wv)}var ED=Fx(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=Qa.call(c)),o[c]=p},tb($r)),OD=Fx(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=Qa.call(c)),Ze.call(o,c)?o[c].push(p):o[c]=[p]},ge),ID=Te(qo);function Kt(o){return Ar(o)?gp(o):E(o)}function qr(o){return Ar(o)?gp(o,!0):N(o)}function PD(o,c){var p={};return c=ge(c,3),pn(o,function(v,x,I){Yr(p,c(v,x,I),v)}),p}function kD(o,c){var p={};return c=ge(c,3),pn(o,function(v,x,I){Yr(p,x,c(v,x,I))}),p}var TD=pl(function(o,c,p){Dt(o,c,p)}),IC=pl(function(o,c,p,v){Dt(o,c,p,v)}),AD=Fi(function(o,c){var p={};if(o==null)return p;var v=!1;c=lt(c,function(I){return I=Os(I,o),v||(v=I.length>1),I}),yi(o,Dv(o),p),v&&(p=ir(p,m|g|y,O$));for(var x=c.length;x--;)Pv(p,c[x]);return p});function qD(o,c){return PC(o,Lp(ge(c)))}var $D=Fi(function(o,c){return o==null?{}:l$(o,c)});function PC(o,c){if(o==null)return{};var p=lt(Dv(o),function(v){return[v]});return c=ge(c),bx(o,p,function(v,x){return c(v,x[0])})}function MD(o,c,p){c=Os(c,o);var v=-1,x=c.length;for(x||(x=1,o=t);++v<x;){var I=o==null?t:o[Ln(c[v])];I===t&&(v=x,I=p),o=ji(I)?I.call(o):I}return o}function ND(o,c,p){return o==null?o:du(o,c,p)}function DD(o,c,p,v){return v=typeof v=="function"?v:t,o==null?o:du(o,c,p,v)}var kC=Ux(Kt),TC=Ux(qr);function FD(o,c,p){var v=Re(o),x=v||Ps(o)||gl(o);if(c=ge(c,4),p==null){var I=o&&o.constructor;x?p=v?new I:[]:Ct(o)?p=ji(I)?_s(el(o)):{}:p={}}return(x?gr:pn)(o,function(q,D,H){return c(p,q,D,H)}),p}function LD(o,c){return o==null?!0:Pv(o,c)}function jD(o,c,p){return o==null?o:xx(o,c,Av(p))}function UD(o,c,p,v){return v=typeof v=="function"?v:t,o==null?o:xx(o,c,Av(p),v)}function yl(o){return o==null?[]:Ja(o,Kt(o))}function HD(o){return o==null?[]:Ja(o,qr(o))}function BD(o,c,p){return p===t&&(p=c,c=t),p!==t&&(p=gn(p),p=p===p?p:0),c!==t&&(c=gn(c),c=c===c?c:0),mi(gn(o),c,p)}function VD(o,c,p){return c=Ui(c),p===t?(p=c,c=0):p=Ui(p),o=gn(o),_v(o,c,p)}function WD(o,c,p){if(p&&typeof p!="boolean"&&wr(o,c,p)&&(c=p=t),p===t&&(typeof c=="boolean"?(p=c,c=t):typeof o=="boolean"&&(p=o,o=t)),o===t&&c===t?(o=0,c=1):(o=Ui(o),c===t?(c=o,o=0):c=Ui(c)),o>c){var v=o;o=c,c=v}if(p||o%1||c%1){var x=cp();return Ht(o+x*(c-o+Wd("1e-"+((x+"").length-1))),c)}return Ev(o,c)}var zD=hl(function(o,c,p){return c=c.toLowerCase(),o+(p?AC(c):c)});function AC(o){return eb(nt(o).toLowerCase())}function qC(o){return o=nt(o),o&&o.replace(ho,Oy).replace(fy,"")}function JD(o,c,p){o=nt(o),c=Kr(c);var v=o.length;p=p===t?v:mi(Ee(p),0,v);var x=p;return p-=c.length,p>=0&&o.slice(p,x)==c}function YD(o){return o=nt(o),o&&le.test(o)?o.replace(qa,Iy):o}function GD(o){return o=nt(o),o&&fo.test(o)?o.replace(Ke,"\\$&"):o}var KD=hl(function(o,c,p){return o+(p?"-":"")+c.toLowerCase()}),QD=hl(function(o,c,p){return o+(p?" ":"")+c.toLowerCase()}),ZD=Mx("toLowerCase");function XD(o,c,p){o=nt(o),c=Ee(c);var v=c?fi(o):0;if(!c||v>=c)return o;var x=(c-v)/2;return kp(Oo(x),p)+o+kp(Eo(x),p)}function eF(o,c,p){o=nt(o),c=Ee(c);var v=c?fi(o):0;return c&&v<c?o+kp(c-v,p):o}function tF(o,c,p){o=nt(o),c=Ee(c);var v=c?fi(o):0;return c&&v<c?kp(c-v,p)+o:o}function rF(o,c,p){return p||c==null?c=0:c&&(c=+c),Jy(nt(o).replace(Dc,""),c||0)}function nF(o,c,p){return(p?wr(o,c,p):c===t)?c=1:c=Ee(c),Ov(nt(o),c)}function iF(){var o=arguments,c=nt(o[0]);return o.length<3?c:c.replace(o[1],o[2])}var sF=hl(function(o,c,p){return o+(p?"_":"")+c.toLowerCase()});function oF(o,c,p){return p&&typeof p!="number"&&wr(o,c,p)&&(c=p=t),p=p===t?Ce:p>>>0,p?(o=nt(o),o&&(typeof c=="string"||c!=null&&!Kv(c))&&(c=Kr(c),!c&&ys(o))?Is(vr(o),0,p):o.split(c,p)):[]}var aF=hl(function(o,c,p){return o+(p?" ":"")+eb(c)});function lF(o,c,p){return o=nt(o),p=p==null?0:mi(Ee(p),0,o.length),c=Kr(c),o.slice(p,p+c.length)==c}function cF(o,c,p){var v=O.templateSettings;p&&wr(o,c,p)&&(c=t),o=nt(o),c=Qv({},c,v,Hx);var x=Qv({},c.imports,v.imports,Hx),I=Kt(x),q=Ja(x,I);gr(I,function(me){if(Pr.test(me))throw new be(a)});var D,H,Q=0,Z=c.interpolate||mo,ee="__p += '",ie=Ga((c.escape||mo).source+"|"+Z.source+"|"+(Z===an?Pi:mo).source+"|"+(c.evaluate||mo).source+"|$","g"),fe="//# sourceURL="+(Ze.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++gy+"]")+`
|
|
4
|
+
`;o.replace(ie,function(me,Le,He,Zr,_r,Xr){return He||(He=Zr),ee+=o.slice(Q,Xr).replace(Qg,Py),Le&&(D=!0,ee+=`' +
|
|
5
5
|
__e(`+Le+`) +
|
|
6
6
|
'`),_r&&(H=!0,ee+=`';
|
|
7
7
|
`+_r+`;
|
|
@@ -17,27 +17,27 @@ __p += '`),He&&(ee+=`' +
|
|
|
17
17
|
function print() { __p += __j.call(arguments, '') }
|
|
18
18
|
`:`;
|
|
19
19
|
`)+ee+`return __p
|
|
20
|
-
}`;var Ie=MC(function(){return Ye(I,fe+"return "+ee).apply(t,q)});if(Ie.source=ee,Gv(Ie))throw Ie;return Ie}function lF(a){return nt(a).toLowerCase()}function cF(a){return nt(a).toUpperCase()}function uF(a,c,p){if(a=nt(a),a&&(p||c===t))return eu(a);if(!a||!(c=Kr(c)))return a;var v=vr(a),x=vr(c),I=Zd(v,x),q=Xd(v,x)+1;return Is(v,I,q).join("")}function fF(a,c,p){if(a=nt(a),a&&(p||c===t))return a.slice(0,rp(a)+1);if(!a||!(c=Kr(c)))return a;var v=vr(a),x=Xd(v,vr(c))+1;return Is(v,0,x).join("")}function dF(a,c,p){if(a=nt(a),a&&(p||c===t))return a.replace(Dc,"");if(!a||!(c=Kr(c)))return a;var v=vr(a),x=Zd(v,vr(c));return Is(v,x).join("")}function pF(a,c){var p=k,v=M;if(Ct(c)){var x="separator"in c?c.separator:x;p="length"in c?Ee(c.length):p,v="omission"in c?Kr(c.omission):v}a=nt(a);var I=a.length;if(ys(a)){var q=vr(a);I=q.length}if(p>=I)return a;var D=p-fi(v);if(D<1)return v;var H=q?Is(q,0,D).join(""):a.slice(0,D);if(x===t)return H+v;if(q&&(D+=H.length-D),Kv(x)){if(a.slice(D).search(x)){var Q,Z=H;for(x.global||(x=Ga(x.source,nt(Td.exec(x))+"g")),x.lastIndex=0;Q=x.exec(Z);)var ee=Q.index;H=H.slice(0,ee===t?D:ee)}}else if(a.indexOf(Kr(x),D)!=D){var ie=H.lastIndexOf(x);ie>-1&&(H=H.slice(0,ie))}return H+v}function hF(a){return a=nt(a),a&&$a.test(a)?a.replace(Ii,qy):a}var mF=hl(function(a,c,p){return a+(p?" ":"")+c.toUpperCase()}),eb=Mx("toUpperCase");function $C(a,c,p){return a=nt(a),c=p?t:c,c===t?ky(a)?Ny(a):Ry(a):a.match(c)||[]}var MC=Te(function(a,c){try{return mr(a,t,c)}catch(p){return Gv(p)?p:new be(p)}}),gF=Fi(function(a,c){return gr(c,function(p){p=Ln(p),Yr(a,p,Jv(a[p],a))}),a});function yF(a){var c=a==null?0:a.length,p=ge();return a=c?lt(a,function(v){if(typeof v[1]!="function")throw new br(i);return[p(v[0]),v[1]]}):[],Te(function(v){for(var x=-1;++x<c;){var I=a[x];if(mr(I[0],this,v))return mr(I[1],this,v)}})}function vF(a){return yv(ir(a,m))}function tb(a){return function(){return a}}function bF(a,c){return a==null||a!==a?c:a}var SF=Dx(),wF=Dx(!0);function $r(a){return a}function rb(a){return S(typeof a=="function"?a:ir(a,m))}function _F(a){return ve(ir(a,m))}function RF(a,c){return Me(a,ir(c,m))}var xF=Te(function(a,c){return function(p){return qo(p,a,c)}}),CF=Te(function(a,c){return function(p){return qo(a,p,c)}});function nb(a,c,p){var v=Kt(c),x=dl(c,v);p==null&&!(Ct(c)&&(x.length||!v.length))&&(p=c,c=a,a=this,x=dl(c,Kt(c)));var I=!(Ct(p)&&"chain"in p)||!!p.chain,q=ji(a);return gr(x,function(D){var H=c[D];a[D]=H,q&&(a.prototype[D]=function(){var Q=this.__chain__;if(I||Q){var Z=a(this.__wrapped__),ee=Z.__actions__=Tr(this.__actions__);return ee.push({func:H,args:arguments,thisArg:a}),Z.__chain__=Q,Z}return H.apply(a,ui([this.value()],arguments))})}),a}function EF(){return Nt._===this&&(Nt._=Hy),this}function ib(){}function OF(a){return a=Ee(a),Te(function(c){return Fn(c,a)})}var IF=$v(lt),PF=$v(Gd),kF=$v(Va);function NC(a){return Uv(a)?bo(Ln(a)):a$(a)}function TF(a){return function(c){return a==null?t:Ni(a,c)}}var AF=Lx(),qF=Lx(!0);function sb(){return[]}function ob(){return!1}function $F(){return{}}function MF(){return""}function NF(){return!0}function DF(a,c){if(a=Ee(a),a<1||a>et)return[];var p=Ce,v=Ht(a,Ce);c=ge(c),a-=Ce;for(var x=Xc(v,c);++p<a;)c(p);return x}function FF(a){return Re(a)?lt(a,Ln):Qr(a)?[a]:Tr(tC(nt(a)))}function LF(a){var c=++jy;return nt(a)+c}var jF=Pp(function(a,c){return a+c},0),UF=Mv("ceil"),HF=Pp(function(a,c){return a/c},1),BF=Mv("floor");function VF(a){return a&&a.length?fl(a,$r,uu):t}function WF(a,c){return a&&a.length?fl(a,ge(c,2),uu):t}function zF(a){return Qd(a,$r)}function JF(a,c){return Qd(a,ge(c,2))}function YF(a){return a&&a.length?fl(a,$r,J):t}function GF(a,c){return a&&a.length?fl(a,ge(c,2),J):t}var KF=Pp(function(a,c){return a*c},1),QF=Mv("round"),ZF=Pp(function(a,c){return a-c},0);function XF(a){return a&&a.length?Zc(a,$r):0}function eL(a,c){return a&&a.length?Zc(a,ge(c,2)):0}return O.after=RN,O.ary=dC,O.assign=uD,O.assignIn=EC,O.assignInWith=OC,O.assignWith=Qv,O.at=fD,O.before=pC,O.bind=Jv,O.bindAll=gF,O.bindKey=hC,O.castArray=MN,O.chain=cC,O.chunk=V$,O.compact=W$,O.concat=z$,O.cond=yF,O.conforms=vF,O.constant=tb,O.countBy=eN,O.create=dD,O.curry=mC,O.curryRight=gC,O.debounce=yC,O.defaults=pD,O.defaultsDeep=hD,O.defer=xN,O.delay=CN,O.difference=J$,O.differenceBy=Y$,O.differenceWith=G$,O.drop=K$,O.dropRight=Q$,O.dropRightWhile=Z$,O.dropWhile=X$,O.fill=eM,O.filter=rN,O.flatMap=sN,O.flatMapDeep=oN,O.flatMapDepth=aN,O.flatten=sC,O.flattenDeep=tM,O.flattenDepth=rM,O.flip=EN,O.flow=SF,O.flowRight=wF,O.fromPairs=nM,O.functions=wD,O.functionsIn=_D,O.groupBy=lN,O.initial=sM,O.intersection=oM,O.intersectionBy=aM,O.intersectionWith=lM,O.invert=xD,O.invertBy=CD,O.invokeMap=uN,O.iteratee=rb,O.keyBy=fN,O.keys=Kt,O.keysIn=qr,O.map=Np,O.mapKeys=OD,O.mapValues=ID,O.matches=_F,O.matchesProperty=RF,O.memoize=Fp,O.merge=PD,O.mergeWith=IC,O.method=xF,O.methodOf=CF,O.mixin=nb,O.negate=Lp,O.nthArg=OF,O.omit=kD,O.omitBy=TD,O.once=ON,O.orderBy=dN,O.over=IF,O.overArgs=IN,O.overEvery=PF,O.overSome=kF,O.partial=Yv,O.partialRight=vC,O.partition=pN,O.pick=AD,O.pickBy=PC,O.property=NC,O.propertyOf=TF,O.pull=dM,O.pullAll=aC,O.pullAllBy=pM,O.pullAllWith=hM,O.pullAt=mM,O.range=AF,O.rangeRight=qF,O.rearg=PN,O.reject=gN,O.remove=gM,O.rest=kN,O.reverse=Wv,O.sampleSize=vN,O.set=$D,O.setWith=MD,O.shuffle=bN,O.slice=yM,O.sortBy=_N,O.sortedUniq=xM,O.sortedUniqBy=CM,O.split=iF,O.spread=TN,O.tail=EM,O.take=OM,O.takeRight=IM,O.takeRightWhile=PM,O.takeWhile=kM,O.tap=WM,O.throttle=AN,O.thru=Mp,O.toArray=RC,O.toPairs=kC,O.toPairsIn=TC,O.toPath=FF,O.toPlainObject=CC,O.transform=ND,O.unary=qN,O.union=TM,O.unionBy=AM,O.unionWith=qM,O.uniq=$M,O.uniqBy=MM,O.uniqWith=NM,O.unset=DD,O.unzip=zv,O.unzipWith=lC,O.update=FD,O.updateWith=LD,O.values=yl,O.valuesIn=jD,O.without=DM,O.words=$C,O.wrap=$N,O.xor=FM,O.xorBy=LM,O.xorWith=jM,O.zip=UM,O.zipObject=HM,O.zipObjectDeep=BM,O.zipWith=VM,O.entries=kC,O.entriesIn=TC,O.extend=EC,O.extendWith=OC,nb(O,O),O.add=jF,O.attempt=MC,O.camelCase=VD,O.capitalize=AC,O.ceil=UF,O.clamp=UD,O.clone=NN,O.cloneDeep=FN,O.cloneDeepWith=LN,O.cloneWith=DN,O.conformsTo=jN,O.deburr=qC,O.defaultTo=bF,O.divide=HF,O.endsWith=WD,O.eq=jn,O.escape=zD,O.escapeRegExp=JD,O.every=tN,O.find=nN,O.findIndex=nC,O.findKey=mD,O.findLast=iN,O.findLastIndex=iC,O.findLastKey=gD,O.floor=BF,O.forEach=uC,O.forEachRight=fC,O.forIn=yD,O.forInRight=vD,O.forOwn=bD,O.forOwnRight=SD,O.get=Zv,O.gt=UN,O.gte=HN,O.has=RD,O.hasIn=Xv,O.head=oC,O.identity=$r,O.includes=cN,O.indexOf=iM,O.inRange=HD,O.invoke=ED,O.isArguments=Do,O.isArray=Re,O.isArrayBuffer=BN,O.isArrayLike=Ar,O.isArrayLikeObject=qt,O.isBoolean=VN,O.isBuffer=Ps,O.isDate=WN,O.isElement=zN,O.isEmpty=JN,O.isEqual=YN,O.isEqualWith=GN,O.isError=Gv,O.isFinite=KN,O.isFunction=ji,O.isInteger=bC,O.isLength=jp,O.isMap=SC,O.isMatch=QN,O.isMatchWith=ZN,O.isNaN=XN,O.isNative=eD,O.isNil=rD,O.isNull=tD,O.isNumber=wC,O.isObject=Ct,O.isObjectLike=Ot,O.isPlainObject=gu,O.isRegExp=Kv,O.isSafeInteger=nD,O.isSet=_C,O.isString=Up,O.isSymbol=Qr,O.isTypedArray=gl,O.isUndefined=iD,O.isWeakMap=sD,O.isWeakSet=oD,O.join=cM,O.kebabCase=YD,O.last=mn,O.lastIndexOf=uM,O.lowerCase=GD,O.lowerFirst=KD,O.lt=aD,O.lte=lD,O.max=VF,O.maxBy=WF,O.mean=zF,O.meanBy=JF,O.min=YF,O.minBy=GF,O.stubArray=sb,O.stubFalse=ob,O.stubObject=$F,O.stubString=MF,O.stubTrue=NF,O.multiply=KF,O.nth=fM,O.noConflict=EF,O.noop=ib,O.now=Dp,O.pad=QD,O.padEnd=ZD,O.padStart=XD,O.parseInt=eF,O.random=BD,O.reduce=hN,O.reduceRight=mN,O.repeat=tF,O.replace=rF,O.result=qD,O.round=QF,O.runInContext=L,O.sample=yN,O.size=SN,O.snakeCase=nF,O.some=wN,O.sortedIndex=vM,O.sortedIndexBy=bM,O.sortedIndexOf=SM,O.sortedLastIndex=wM,O.sortedLastIndexBy=_M,O.sortedLastIndexOf=RM,O.startCase=sF,O.startsWith=oF,O.subtract=ZF,O.sum=XF,O.sumBy=eL,O.template=aF,O.times=DF,O.toFinite=Ui,O.toInteger=Ee,O.toLength=xC,O.toLower=lF,O.toNumber=gn,O.toSafeInteger=cD,O.toString=nt,O.toUpper=cF,O.trim=uF,O.trimEnd=fF,O.trimStart=dF,O.truncate=pF,O.unescape=hF,O.uniqueId=LF,O.upperCase=mF,O.upperFirst=eb,O.each=uC,O.eachRight=fC,O.first=oC,nb(O,(function(){var a={};return pn(O,function(c,p){Ze.call(O.prototype,p)||(a[p]=c)}),a})(),{chain:!1}),O.VERSION=e,gr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){O[a].placeholder=O}),gr(["drop","take"],function(a,c){$e.prototype[a]=function(p){p=p===t?1:gt(Ee(p),0);var v=this.__filtered__&&!c?new $e(this):this.clone();return v.__filtered__?v.__takeCount__=Ht(p,v.__takeCount__):v.__views__.push({size:Ht(p,Ce),type:a+(v.__dir__<0?"Right":"")}),v},$e.prototype[a+"Right"]=function(p){return this.reverse()[a](p).reverse()}}),gr(["filter","map","takeWhile"],function(a,c){var p=c+1,v=p==Y||p==ne;$e.prototype[a]=function(x){var I=this.clone();return I.__iteratees__.push({iteratee:ge(x,3),type:p}),I.__filtered__=I.__filtered__||v,I}}),gr(["head","last"],function(a,c){var p="take"+(c?"Right":"");$e.prototype[a]=function(){return this[p](1).value()[0]}}),gr(["initial","tail"],function(a,c){var p="drop"+(c?"":"Right");$e.prototype[a]=function(){return this.__filtered__?new $e(this):this[p](1)}}),$e.prototype.compact=function(){return this.filter($r)},$e.prototype.find=function(a){return this.filter(a).head()},$e.prototype.findLast=function(a){return this.reverse().find(a)},$e.prototype.invokeMap=Te(function(a,c){return typeof a=="function"?new $e(this):this.map(function(p){return qo(p,a,c)})}),$e.prototype.reject=function(a){return this.filter(Lp(ge(a)))},$e.prototype.slice=function(a,c){a=Ee(a);var p=this;return p.__filtered__&&(a>0||c<0)?new $e(p):(a<0?p=p.takeRight(-a):a&&(p=p.drop(a)),c!==t&&(c=Ee(c),p=c<0?p.dropRight(-c):p.take(c-a)),p)},$e.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},$e.prototype.toArray=function(){return this.take(Ce)},pn($e.prototype,function(a,c){var p=/^(?:filter|find|map|reject)|While$/.test(c),v=/^(?:head|last)$/.test(c),x=O[v?"take"+(c=="last"?"Right":""):c],I=v||/^find/.test(c);x&&(O.prototype[c]=function(){var q=this.__wrapped__,D=v?[1]:arguments,H=q instanceof $e,Q=D[0],Z=H||Re(q),ee=function(Le){var He=x.apply(O,ui([Le],D));return v&&ie?He[0]:He};Z&&p&&typeof Q=="function"&&Q.length!=1&&(H=Z=!1);var ie=this.__chain__,fe=!!this.__actions__.length,ye=I&&!ie,Ie=H&&!fe;if(!I&&Z){q=Ie?q:new $e(this);var me=a.apply(q,D);return me.__actions__.push({func:Mp,args:[ee],thisArg:t}),new nr(me,ie)}return ye&&Ie?a.apply(this,D):(me=this.thru(ee),ye?v?me.value()[0]:me.value():me)})}),gr(["pop","push","shift","sort","splice","unshift"],function(a){var c=_o[a],p=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",v=/^(?:pop|shift)$/.test(a);O.prototype[a]=function(){var x=arguments;if(v&&!this.__chain__){var I=this.value();return c.apply(Re(I)?I:[],x)}return this[p](function(q){return c.apply(Re(q)?q:[],x)})}}),pn($e.prototype,function(a,c){var p=O[c];if(p){var v=p.name+"";Ze.call(ws,v)||(ws[v]=[]),ws[v].push({name:c,func:p})}}),ws[Ip(t,P).name]=[{name:"wrapper",func:t}],$e.prototype.clone=ev,$e.prototype.reverse=tv,$e.prototype.value=iu,O.prototype.at=zM,O.prototype.chain=JM,O.prototype.commit=YM,O.prototype.next=GM,O.prototype.plant=QM,O.prototype.reverse=ZM,O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=XM,O.prototype.first=O.prototype.head,Co&&(O.prototype[Co]=KM),O}),di=Dy();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Nt._=di,define(function(){return di})):Qe?((Qe.exports=di)._=di,Ua._=di):Nt._=di}).call(Rl)});var nE=F((_b,xl)=>{(function(t,e){typeof _b=="object"&&typeof xl<"u"?xl.exports=e():typeof define=="function"&&define.amd?define(e):t.moment=e()})(_b,(function(){"use strict";var t;function e(){return t.apply(null,arguments)}function r(u){t=u}function n(u){return u instanceof Array||Object.prototype.toString.call(u)==="[object Array]"}function i(u){return u!=null&&Object.prototype.toString.call(u)==="[object Object]"}function s(u,h){return Object.prototype.hasOwnProperty.call(u,h)}function o(u){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(u).length===0;var h;for(h in u)if(s(u,h))return!1;return!0}function l(u){return u===void 0}function f(u){return typeof u=="number"||Object.prototype.toString.call(u)==="[object Number]"}function d(u){return u instanceof Date||Object.prototype.toString.call(u)==="[object Date]"}function m(u,h){var b=[],S,E=u.length;for(S=0;S<E;++S)b.push(h(u[S],S));return b}function g(u,h){for(var b in h)s(h,b)&&(u[b]=h[b]);return s(h,"toString")&&(u.toString=h.toString),s(h,"valueOf")&&(u.valueOf=h.valueOf),u}function y(u,h,b,S){return Ja(u,h,b,S,!0).utc()}function w(){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 C(u){return u._pf==null&&(u._pf=w()),u._pf}var R;Array.prototype.some?R=Array.prototype.some:R=function(u){var h=Object(this),b=h.length>>>0,S;for(S=0;S<b;S++)if(S in h&&u.call(this,h[S],S,h))return!0;return!1};function P(u){var h=null,b=!1,S=u._d&&!isNaN(u._d.getTime());if(S&&(h=C(u),b=R.call(h.parsedDateParts,function(E){return E!=null}),S=h.overflow<0&&!h.empty&&!h.invalidEra&&!h.invalidMonth&&!h.invalidWeekday&&!h.weekdayMismatch&&!h.nullInput&&!h.invalidFormat&&!h.userInvalidated&&(!h.meridiem||h.meridiem&&b),u._strict&&(S=S&&h.charsLeftOver===0&&h.unusedTokens.length===0&&h.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(u))u._isValid=S;else return S;return u._isValid}function A(u){var h=y(NaN);return u!=null?g(C(h),u):C(h).userInvalidated=!0,h}var U=e.momentProperties=[],B=!1;function z(u,h){var b,S,E,N=U.length;if(l(h._isAMomentObject)||(u._isAMomentObject=h._isAMomentObject),l(h._i)||(u._i=h._i),l(h._f)||(u._f=h._f),l(h._l)||(u._l=h._l),l(h._strict)||(u._strict=h._strict),l(h._tzm)||(u._tzm=h._tzm),l(h._isUTC)||(u._isUTC=h._isUTC),l(h._offset)||(u._offset=h._offset),l(h._pf)||(u._pf=C(h)),l(h._locale)||(u._locale=h._locale),N>0)for(b=0;b<N;b++)S=U[b],E=h[S],l(E)||(u[S]=E);return u}function V(u){z(this,u),this._d=new Date(u._d!=null?u._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),B===!1&&(B=!0,e.updateOffset(this),B=!1)}function X(u){return u instanceof V||u!=null&&u._isAMomentObject!=null}function T(u){e.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+u)}function _(u,h){var b=!0;return g(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,u),b){var S=[],E,N,J,se=arguments.length;for(N=0;N<se;N++){if(E="",typeof arguments[N]=="object"){E+=`
|
|
21
|
-
[`+N+"] ";for(J in arguments[0])s(arguments[0],J)&&(E+=J+": "+arguments[0][J]+", ");E=E.slice(0,-2)}else E=arguments[N];S.push(E)}
|
|
20
|
+
}`;var Ie=MC(function(){return Ye(I,fe+"return "+ee).apply(t,q)});if(Ie.source=ee,Gv(Ie))throw Ie;return Ie}function uF(o){return nt(o).toLowerCase()}function fF(o){return nt(o).toUpperCase()}function dF(o,c,p){if(o=nt(o),o&&(p||c===t))return eu(o);if(!o||!(c=Kr(c)))return o;var v=vr(o),x=vr(c),I=Zd(v,x),q=Xd(v,x)+1;return Is(v,I,q).join("")}function pF(o,c,p){if(o=nt(o),o&&(p||c===t))return o.slice(0,rp(o)+1);if(!o||!(c=Kr(c)))return o;var v=vr(o),x=Xd(v,vr(c))+1;return Is(v,0,x).join("")}function hF(o,c,p){if(o=nt(o),o&&(p||c===t))return o.replace(Dc,"");if(!o||!(c=Kr(c)))return o;var v=vr(o),x=Zd(v,vr(c));return Is(v,x).join("")}function mF(o,c){var p=k,v=M;if(Ct(c)){var x="separator"in c?c.separator:x;p="length"in c?Ee(c.length):p,v="omission"in c?Kr(c.omission):v}o=nt(o);var I=o.length;if(ys(o)){var q=vr(o);I=q.length}if(p>=I)return o;var D=p-fi(v);if(D<1)return v;var H=q?Is(q,0,D).join(""):o.slice(0,D);if(x===t)return H+v;if(q&&(D+=H.length-D),Kv(x)){if(o.slice(D).search(x)){var Q,Z=H;for(x.global||(x=Ga(x.source,nt(Td.exec(x))+"g")),x.lastIndex=0;Q=x.exec(Z);)var ee=Q.index;H=H.slice(0,ee===t?D:ee)}}else if(o.indexOf(Kr(x),D)!=D){var ie=H.lastIndexOf(x);ie>-1&&(H=H.slice(0,ie))}return H+v}function gF(o){return o=nt(o),o&&$a.test(o)?o.replace(Ii,qy):o}var yF=hl(function(o,c,p){return o+(p?" ":"")+c.toUpperCase()}),eb=Mx("toUpperCase");function $C(o,c,p){return o=nt(o),c=p?t:c,c===t?ky(o)?Ny(o):Ry(o):o.match(c)||[]}var MC=Te(function(o,c){try{return mr(o,t,c)}catch(p){return Gv(p)?p:new be(p)}}),vF=Fi(function(o,c){return gr(c,function(p){p=Ln(p),Yr(o,p,Jv(o[p],o))}),o});function bF(o){var c=o==null?0:o.length,p=ge();return o=c?lt(o,function(v){if(typeof v[1]!="function")throw new br(i);return[p(v[0]),v[1]]}):[],Te(function(v){for(var x=-1;++x<c;){var I=o[x];if(mr(I[0],this,v))return mr(I[1],this,v)}})}function SF(o){return yv(ir(o,m))}function tb(o){return function(){return o}}function wF(o,c){return o==null||o!==o?c:o}var _F=Dx(),RF=Dx(!0);function $r(o){return o}function rb(o){return S(typeof o=="function"?o:ir(o,m))}function xF(o){return ve(ir(o,m))}function CF(o,c){return Me(o,ir(c,m))}var EF=Te(function(o,c){return function(p){return qo(p,o,c)}}),OF=Te(function(o,c){return function(p){return qo(o,p,c)}});function nb(o,c,p){var v=Kt(c),x=dl(c,v);p==null&&!(Ct(c)&&(x.length||!v.length))&&(p=c,c=o,o=this,x=dl(c,Kt(c)));var I=!(Ct(p)&&"chain"in p)||!!p.chain,q=ji(o);return gr(x,function(D){var H=c[D];o[D]=H,q&&(o.prototype[D]=function(){var Q=this.__chain__;if(I||Q){var Z=o(this.__wrapped__),ee=Z.__actions__=Tr(this.__actions__);return ee.push({func:H,args:arguments,thisArg:o}),Z.__chain__=Q,Z}return H.apply(o,ui([this.value()],arguments))})}),o}function IF(){return Nt._===this&&(Nt._=Hy),this}function ib(){}function PF(o){return o=Ee(o),Te(function(c){return Fn(c,o)})}var kF=$v(lt),TF=$v(Gd),AF=$v(Va);function NC(o){return Uv(o)?bo(Ln(o)):c$(o)}function qF(o){return function(c){return o==null?t:Ni(o,c)}}var $F=Lx(),MF=Lx(!0);function sb(){return[]}function ob(){return!1}function NF(){return{}}function DF(){return""}function FF(){return!0}function LF(o,c){if(o=Ee(o),o<1||o>et)return[];var p=Ce,v=Ht(o,Ce);c=ge(c),o-=Ce;for(var x=Xc(v,c);++p<o;)c(p);return x}function jF(o){return Re(o)?lt(o,Ln):Qr(o)?[o]:Tr(tC(nt(o)))}function UF(o){var c=++jy;return nt(o)+c}var HF=Pp(function(o,c){return o+c},0),BF=Mv("ceil"),VF=Pp(function(o,c){return o/c},1),WF=Mv("floor");function zF(o){return o&&o.length?fl(o,$r,uu):t}function JF(o,c){return o&&o.length?fl(o,ge(c,2),uu):t}function YF(o){return Qd(o,$r)}function GF(o,c){return Qd(o,ge(c,2))}function KF(o){return o&&o.length?fl(o,$r,J):t}function QF(o,c){return o&&o.length?fl(o,ge(c,2),J):t}var ZF=Pp(function(o,c){return o*c},1),XF=Mv("round"),eL=Pp(function(o,c){return o-c},0);function tL(o){return o&&o.length?Zc(o,$r):0}function rL(o,c){return o&&o.length?Zc(o,ge(c,2)):0}return O.after=CN,O.ary=dC,O.assign=dD,O.assignIn=EC,O.assignInWith=OC,O.assignWith=Qv,O.at=pD,O.before=pC,O.bind=Jv,O.bindAll=vF,O.bindKey=hC,O.castArray=DN,O.chain=cC,O.chunk=z$,O.compact=J$,O.concat=Y$,O.cond=bF,O.conforms=SF,O.constant=tb,O.countBy=rN,O.create=hD,O.curry=mC,O.curryRight=gC,O.debounce=yC,O.defaults=mD,O.defaultsDeep=gD,O.defer=EN,O.delay=ON,O.difference=G$,O.differenceBy=K$,O.differenceWith=Q$,O.drop=Z$,O.dropRight=X$,O.dropRightWhile=eM,O.dropWhile=tM,O.fill=rM,O.filter=iN,O.flatMap=aN,O.flatMapDeep=lN,O.flatMapDepth=cN,O.flatten=sC,O.flattenDeep=nM,O.flattenDepth=iM,O.flip=IN,O.flow=_F,O.flowRight=RF,O.fromPairs=sM,O.functions=RD,O.functionsIn=xD,O.groupBy=uN,O.initial=aM,O.intersection=lM,O.intersectionBy=cM,O.intersectionWith=uM,O.invert=ED,O.invertBy=OD,O.invokeMap=dN,O.iteratee=rb,O.keyBy=pN,O.keys=Kt,O.keysIn=qr,O.map=Np,O.mapKeys=PD,O.mapValues=kD,O.matches=xF,O.matchesProperty=CF,O.memoize=Fp,O.merge=TD,O.mergeWith=IC,O.method=EF,O.methodOf=OF,O.mixin=nb,O.negate=Lp,O.nthArg=PF,O.omit=AD,O.omitBy=qD,O.once=PN,O.orderBy=hN,O.over=kF,O.overArgs=kN,O.overEvery=TF,O.overSome=AF,O.partial=Yv,O.partialRight=vC,O.partition=mN,O.pick=$D,O.pickBy=PC,O.property=NC,O.propertyOf=qF,O.pull=hM,O.pullAll=aC,O.pullAllBy=mM,O.pullAllWith=gM,O.pullAt=yM,O.range=$F,O.rangeRight=MF,O.rearg=TN,O.reject=vN,O.remove=vM,O.rest=AN,O.reverse=Wv,O.sampleSize=SN,O.set=ND,O.setWith=DD,O.shuffle=wN,O.slice=bM,O.sortBy=xN,O.sortedUniq=EM,O.sortedUniqBy=OM,O.split=oF,O.spread=qN,O.tail=IM,O.take=PM,O.takeRight=kM,O.takeRightWhile=TM,O.takeWhile=AM,O.tap=JM,O.throttle=$N,O.thru=Mp,O.toArray=RC,O.toPairs=kC,O.toPairsIn=TC,O.toPath=jF,O.toPlainObject=CC,O.transform=FD,O.unary=MN,O.union=qM,O.unionBy=$M,O.unionWith=MM,O.uniq=NM,O.uniqBy=DM,O.uniqWith=FM,O.unset=LD,O.unzip=zv,O.unzipWith=lC,O.update=jD,O.updateWith=UD,O.values=yl,O.valuesIn=HD,O.without=LM,O.words=$C,O.wrap=NN,O.xor=jM,O.xorBy=UM,O.xorWith=HM,O.zip=BM,O.zipObject=VM,O.zipObjectDeep=WM,O.zipWith=zM,O.entries=kC,O.entriesIn=TC,O.extend=EC,O.extendWith=OC,nb(O,O),O.add=HF,O.attempt=MC,O.camelCase=zD,O.capitalize=AC,O.ceil=BF,O.clamp=BD,O.clone=FN,O.cloneDeep=jN,O.cloneDeepWith=UN,O.cloneWith=LN,O.conformsTo=HN,O.deburr=qC,O.defaultTo=wF,O.divide=VF,O.endsWith=JD,O.eq=jn,O.escape=YD,O.escapeRegExp=GD,O.every=nN,O.find=sN,O.findIndex=nC,O.findKey=yD,O.findLast=oN,O.findLastIndex=iC,O.findLastKey=vD,O.floor=WF,O.forEach=uC,O.forEachRight=fC,O.forIn=bD,O.forInRight=SD,O.forOwn=wD,O.forOwnRight=_D,O.get=Zv,O.gt=BN,O.gte=VN,O.has=CD,O.hasIn=Xv,O.head=oC,O.identity=$r,O.includes=fN,O.indexOf=oM,O.inRange=VD,O.invoke=ID,O.isArguments=Do,O.isArray=Re,O.isArrayBuffer=WN,O.isArrayLike=Ar,O.isArrayLikeObject=qt,O.isBoolean=zN,O.isBuffer=Ps,O.isDate=JN,O.isElement=YN,O.isEmpty=GN,O.isEqual=KN,O.isEqualWith=QN,O.isError=Gv,O.isFinite=ZN,O.isFunction=ji,O.isInteger=bC,O.isLength=jp,O.isMap=SC,O.isMatch=XN,O.isMatchWith=eD,O.isNaN=tD,O.isNative=rD,O.isNil=iD,O.isNull=nD,O.isNumber=wC,O.isObject=Ct,O.isObjectLike=Ot,O.isPlainObject=gu,O.isRegExp=Kv,O.isSafeInteger=sD,O.isSet=_C,O.isString=Up,O.isSymbol=Qr,O.isTypedArray=gl,O.isUndefined=oD,O.isWeakMap=aD,O.isWeakSet=lD,O.join=fM,O.kebabCase=KD,O.last=mn,O.lastIndexOf=dM,O.lowerCase=QD,O.lowerFirst=ZD,O.lt=cD,O.lte=uD,O.max=zF,O.maxBy=JF,O.mean=YF,O.meanBy=GF,O.min=KF,O.minBy=QF,O.stubArray=sb,O.stubFalse=ob,O.stubObject=NF,O.stubString=DF,O.stubTrue=FF,O.multiply=ZF,O.nth=pM,O.noConflict=IF,O.noop=ib,O.now=Dp,O.pad=XD,O.padEnd=eF,O.padStart=tF,O.parseInt=rF,O.random=WD,O.reduce=gN,O.reduceRight=yN,O.repeat=nF,O.replace=iF,O.result=MD,O.round=XF,O.runInContext=L,O.sample=bN,O.size=_N,O.snakeCase=sF,O.some=RN,O.sortedIndex=SM,O.sortedIndexBy=wM,O.sortedIndexOf=_M,O.sortedLastIndex=RM,O.sortedLastIndexBy=xM,O.sortedLastIndexOf=CM,O.startCase=aF,O.startsWith=lF,O.subtract=eL,O.sum=tL,O.sumBy=rL,O.template=cF,O.times=LF,O.toFinite=Ui,O.toInteger=Ee,O.toLength=xC,O.toLower=uF,O.toNumber=gn,O.toSafeInteger=fD,O.toString=nt,O.toUpper=fF,O.trim=dF,O.trimEnd=pF,O.trimStart=hF,O.truncate=mF,O.unescape=gF,O.uniqueId=UF,O.upperCase=yF,O.upperFirst=eb,O.each=uC,O.eachRight=fC,O.first=oC,nb(O,(function(){var o={};return pn(O,function(c,p){Ze.call(O.prototype,p)||(o[p]=c)}),o})(),{chain:!1}),O.VERSION=e,gr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){O[o].placeholder=O}),gr(["drop","take"],function(o,c){$e.prototype[o]=function(p){p=p===t?1:gt(Ee(p),0);var v=this.__filtered__&&!c?new $e(this):this.clone();return v.__filtered__?v.__takeCount__=Ht(p,v.__takeCount__):v.__views__.push({size:Ht(p,Ce),type:o+(v.__dir__<0?"Right":"")}),v},$e.prototype[o+"Right"]=function(p){return this.reverse()[o](p).reverse()}}),gr(["filter","map","takeWhile"],function(o,c){var p=c+1,v=p==Y||p==ne;$e.prototype[o]=function(x){var I=this.clone();return I.__iteratees__.push({iteratee:ge(x,3),type:p}),I.__filtered__=I.__filtered__||v,I}}),gr(["head","last"],function(o,c){var p="take"+(c?"Right":"");$e.prototype[o]=function(){return this[p](1).value()[0]}}),gr(["initial","tail"],function(o,c){var p="drop"+(c?"":"Right");$e.prototype[o]=function(){return this.__filtered__?new $e(this):this[p](1)}}),$e.prototype.compact=function(){return this.filter($r)},$e.prototype.find=function(o){return this.filter(o).head()},$e.prototype.findLast=function(o){return this.reverse().find(o)},$e.prototype.invokeMap=Te(function(o,c){return typeof o=="function"?new $e(this):this.map(function(p){return qo(p,o,c)})}),$e.prototype.reject=function(o){return this.filter(Lp(ge(o)))},$e.prototype.slice=function(o,c){o=Ee(o);var p=this;return p.__filtered__&&(o>0||c<0)?new $e(p):(o<0?p=p.takeRight(-o):o&&(p=p.drop(o)),c!==t&&(c=Ee(c),p=c<0?p.dropRight(-c):p.take(c-o)),p)},$e.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},$e.prototype.toArray=function(){return this.take(Ce)},pn($e.prototype,function(o,c){var p=/^(?:filter|find|map|reject)|While$/.test(c),v=/^(?:head|last)$/.test(c),x=O[v?"take"+(c=="last"?"Right":""):c],I=v||/^find/.test(c);x&&(O.prototype[c]=function(){var q=this.__wrapped__,D=v?[1]:arguments,H=q instanceof $e,Q=D[0],Z=H||Re(q),ee=function(Le){var He=x.apply(O,ui([Le],D));return v&&ie?He[0]:He};Z&&p&&typeof Q=="function"&&Q.length!=1&&(H=Z=!1);var ie=this.__chain__,fe=!!this.__actions__.length,ye=I&&!ie,Ie=H&&!fe;if(!I&&Z){q=Ie?q:new $e(this);var me=o.apply(q,D);return me.__actions__.push({func:Mp,args:[ee],thisArg:t}),new nr(me,ie)}return ye&&Ie?o.apply(this,D):(me=this.thru(ee),ye?v?me.value()[0]:me.value():me)})}),gr(["pop","push","shift","sort","splice","unshift"],function(o){var c=_o[o],p=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",v=/^(?:pop|shift)$/.test(o);O.prototype[o]=function(){var x=arguments;if(v&&!this.__chain__){var I=this.value();return c.apply(Re(I)?I:[],x)}return this[p](function(q){return c.apply(Re(q)?q:[],x)})}}),pn($e.prototype,function(o,c){var p=O[c];if(p){var v=p.name+"";Ze.call(ws,v)||(ws[v]=[]),ws[v].push({name:c,func:p})}}),ws[Ip(t,T).name]=[{name:"wrapper",func:t}],$e.prototype.clone=ev,$e.prototype.reverse=tv,$e.prototype.value=iu,O.prototype.at=YM,O.prototype.chain=GM,O.prototype.commit=KM,O.prototype.next=QM,O.prototype.plant=XM,O.prototype.reverse=eN,O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=tN,O.prototype.first=O.prototype.head,Co&&(O.prototype[Co]=ZM),O}),di=Dy();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Nt._=di,define(function(){return di})):Qe?((Qe.exports=di)._=di,Ua._=di):Nt._=di}).call(Rl)});var nE=F((_b,xl)=>{(function(t,e){typeof _b=="object"&&typeof xl<"u"?xl.exports=e():typeof define=="function"&&define.amd?define(e):t.moment=e()})(_b,(function(){"use strict";var t;function e(){return t.apply(null,arguments)}function r(u){t=u}function n(u){return u instanceof Array||Object.prototype.toString.call(u)==="[object Array]"}function i(u){return u!=null&&Object.prototype.toString.call(u)==="[object Object]"}function s(u,h){return Object.prototype.hasOwnProperty.call(u,h)}function a(u){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(u).length===0;var h;for(h in u)if(s(u,h))return!1;return!0}function l(u){return u===void 0}function f(u){return typeof u=="number"||Object.prototype.toString.call(u)==="[object Number]"}function d(u){return u instanceof Date||Object.prototype.toString.call(u)==="[object Date]"}function m(u,h){var b=[],S,E=u.length;for(S=0;S<E;++S)b.push(h(u[S],S));return b}function g(u,h){for(var b in h)s(h,b)&&(u[b]=h[b]);return s(h,"toString")&&(u.toString=h.toString),s(h,"valueOf")&&(u.valueOf=h.valueOf),u}function y(u,h,b,S){return Ja(u,h,b,S,!0).utc()}function w(){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 C(u){return u._pf==null&&(u._pf=w()),u._pf}var R;Array.prototype.some?R=Array.prototype.some:R=function(u){var h=Object(this),b=h.length>>>0,S;for(S=0;S<b;S++)if(S in h&&u.call(this,h[S],S,h))return!0;return!1};function T(u){var h=null,b=!1,S=u._d&&!isNaN(u._d.getTime());if(S&&(h=C(u),b=R.call(h.parsedDateParts,function(E){return E!=null}),S=h.overflow<0&&!h.empty&&!h.invalidEra&&!h.invalidMonth&&!h.invalidWeekday&&!h.weekdayMismatch&&!h.nullInput&&!h.invalidFormat&&!h.userInvalidated&&(!h.meridiem||h.meridiem&&b),u._strict&&(S=S&&h.charsLeftOver===0&&h.unusedTokens.length===0&&h.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(u))u._isValid=S;else return S;return u._isValid}function A(u){var h=y(NaN);return u!=null?g(C(h),u):C(h).userInvalidated=!0,h}var U=e.momentProperties=[],B=!1;function V(u,h){var b,S,E,N=U.length;if(l(h._isAMomentObject)||(u._isAMomentObject=h._isAMomentObject),l(h._i)||(u._i=h._i),l(h._f)||(u._f=h._f),l(h._l)||(u._l=h._l),l(h._strict)||(u._strict=h._strict),l(h._tzm)||(u._tzm=h._tzm),l(h._isUTC)||(u._isUTC=h._isUTC),l(h._offset)||(u._offset=h._offset),l(h._pf)||(u._pf=C(h)),l(h._locale)||(u._locale=h._locale),N>0)for(b=0;b<N;b++)S=U[b],E=h[S],l(E)||(u[S]=E);return u}function W(u){V(this,u),this._d=new Date(u._d!=null?u._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),B===!1&&(B=!0,e.updateOffset(this),B=!1)}function X(u){return u instanceof W||u!=null&&u._isAMomentObject!=null}function P(u){e.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+u)}function _(u,h){var b=!0;return g(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,u),b){var S=[],E,N,J,se=arguments.length;for(N=0;N<se;N++){if(E="",typeof arguments[N]=="object"){E+=`
|
|
21
|
+
[`+N+"] ";for(J in arguments[0])s(arguments[0],J)&&(E+=J+": "+arguments[0][J]+", ");E=E.slice(0,-2)}else E=arguments[N];S.push(E)}P(u+`
|
|
22
22
|
Arguments: `+Array.prototype.slice.call(S).join("")+`
|
|
23
|
-
`+new Error().stack),b=!1}return h.apply(this,arguments)},h)}var k={};function M(u,h){e.deprecationHandler!=null&&e.deprecationHandler(u,h),k[u]||(T(h),k[u]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function j(u){return typeof Function<"u"&&u instanceof Function||Object.prototype.toString.call(u)==="[object Function]"}function $(u){var h,b;for(b in u)s(u,b)&&(h=u[b],j(h)?this[b]=h:this["_"+b]=h);this._config=u,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function Y(u,h){var b=g({},u),S;for(S in h)s(h,S)&&(i(u[S])&&i(h[S])?(b[S]={},g(b[S],u[S]),g(b[S],h[S])):h[S]!=null?b[S]=h[S]:delete b[S]);for(S in u)s(u,S)&&!s(h,S)&&i(u[S])&&(b[S]=g({},b[S]));return b}function K(u){u!=null&&this.set(u)}var ne;Object.keys?ne=Object.keys:ne=function(u){var h,b=[];for(h in u)s(u,h)&&b.push(h);return b};var ue={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function et(u,h,b){var S=this._calendar[u]||this._calendar.sameElse;return j(S)?S.call(h,b):S}function _e(u,h,b){var S=""+Math.abs(u),E=h-S.length,N=u>=0;return(N?b?"+":"":"-")+Math.pow(10,Math.max(0,E)).toString().substr(1)+S}var he=/(\[[^\[]*\])|(\\)?([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,Ce=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,vt={},Et={};function ce(u,h,b,S){var E=S;typeof S=="string"&&(E=function(){return this[S]()}),u&&(Et[u]=E),h&&(Et[h[0]]=function(){return _e(E.apply(this,arguments),h[1],h[2])}),b&&(Et[b]=function(){return this.localeData().ordinal(E.apply(this,arguments),u)})}function pr(u){return u.match(/\[[\s\S]/)?u.replace(/^\[|\]$/g,""):u.replace(/\\/g,"")}function ai(u){var h=u.match(he),b,S;for(b=0,S=h.length;b<S;b++)Et[h[b]]?h[b]=Et[h[b]]:h[b]=pr(h[b]);return function(E){var N="",J;for(J=0;J<S;J++)N+=j(h[J])?h[J].call(E,u):h[J];return N}}function Rt(u,h){return u.isValid()?(h=zr(h,u.localeData()),vt[h]=vt[h]||ai(h),vt[h](u)):u.localeData().invalidDate()}function zr(u,h){var b=5;function S(E){return h.longDateFormat(E)||E}for(Ce.lastIndex=0;b>=0&&Ce.test(u);)u=u.replace(Ce,S),Ce.lastIndex=0,b-=1;return u}var Or={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 ht(u){var h=this._longDateFormat[u],b=this._longDateFormat[u.toUpperCase()];return h||!b?h:(this._longDateFormat[u]=b.match(he).map(function(S){return S==="MMMM"||S==="MM"||S==="DD"||S==="dddd"?S.slice(1):S}).join(""),this._longDateFormat[u])}var mt="Invalid date";function on(){return this._invalidDate}var oo="%d",Jt=/\d{1,2}/;function ao(u){return this._ordinal.replace("%d",u)}var Wg={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 In(u,h,b,S){var E=this._relativeTime[b];return j(E)?E(u,h,b,S):E.replace(/%d/i,u)}function Od(u,h){var b=this._relativeTime[u>0?"future":"past"];return j(b)?b(h):b.replace(/%s/i,h)}var Id={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 Yt(u){return typeof u=="string"?Id[u]||Id[u.toLowerCase()]:void 0}function hr(u){var h={},b,S;for(S in u)s(u,S)&&(b=Yt(S),b&&(h[b]=u[S]));return h}var lo={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 Pa(u){var h=[],b;for(b in u)s(u,b)&&h.push({unit:b,priority:lo[b]});return h.sort(function(S,E){return S.priority-E.priority}),h}var Pd=/\d/,Ut=/\d\d/,kd=/\d{3}/,Oi=/\d{4}/,Pn=/[+-]?\d{6}/,ot=/\d\d?/,ka=/\d\d\d\d?/,Ta=/\d\d\d\d\d\d?/,cs=/\d{1,3}/,co=/\d{1,4}/,us=/[+-]?\d{1,6}/,li=/\d+/,fs=/[+-]?\d+/,Mc=/Z|[+-]\d\d:?\d\d/gi,Aa=/Z|[+-]\d\d(?::?\d\d)?/gi,zg=/[+-]?\d+(\.\d{1,3})?/,uo=/[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,Ii=/^[1-9]\d?/,qa=/^([1-9]\d|\d)/,$a;$a={};function le(u,h,b){$a[u]=j(h)?h:function(S,E){return S&&b?b:h}}function Jg(u,h){return s($a,u)?$a[u](h._strict,h._locale):new RegExp(Yg(u))}function Yg(u){return an(u.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(h,b,S,E,N){return b||S||E||N}))}function an(u){return u.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Ir(u){return u<0?Math.ceil(u)||0:Math.floor(u)}function qe(u){var h=+u,b=0;return h!==0&&isFinite(h)&&(b=Ir(h)),b}var Nc={};function Ke(u,h){var b,S=h,E;for(typeof u=="string"&&(u=[u]),f(h)&&(S=function(N,J){J[h]=qe(N)}),E=u.length,b=0;b<E;b++)Nc[u[b]]=S}function fo(u,h){Ke(u,function(b,S,E,N){E._w=E._w||{},h(b,E._w,E,N)})}function Dc(u,h,b){h!=null&&s(Nc,u)&&Nc[u](h,b._a,b,u)}function Ma(u){return u%4===0&&u%100!==0||u%400===0}var Gt=0,kn=1,ln=2,At=3,Pr=4,Tn=5,Pi=6,Td=7,Gg=8;ce("Y",0,0,function(){var u=this.year();return u<=9999?_e(u,4):"+"+u}),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"),le("Y",fs),le("YY",ot,Ut),le("YYYY",co,Oi),le("YYYYY",us,Pn),le("YYYYYY",us,Pn),Ke(["YYYYY","YYYYYY"],Gt),Ke("YYYY",function(u,h){h[Gt]=u.length===2?e.parseTwoDigitYear(u):qe(u)}),Ke("YY",function(u,h){h[Gt]=e.parseTwoDigitYear(u)}),Ke("Y",function(u,h){h[Gt]=parseInt(u,10)});function po(u){return Ma(u)?366:365}e.parseTwoDigitYear=function(u){return qe(u)+(qe(u)>68?1900:2e3)};var Ad=ds("FullYear",!0);function Kg(){return Ma(this.year())}function ds(u,h){return function(b){return b!=null?(mo(this,u,b),e.updateOffset(this,h),this):ho(this,u)}}function ho(u,h){if(!u.isValid())return NaN;var b=u._d,S=u._isUTC;switch(h){case"Milliseconds":return S?b.getUTCMilliseconds():b.getMilliseconds();case"Seconds":return S?b.getUTCSeconds():b.getSeconds();case"Minutes":return S?b.getUTCMinutes():b.getMinutes();case"Hours":return S?b.getUTCHours():b.getHours();case"Date":return S?b.getUTCDate():b.getDate();case"Day":return S?b.getUTCDay():b.getDay();case"Month":return S?b.getUTCMonth():b.getMonth();case"FullYear":return S?b.getUTCFullYear():b.getFullYear();default:return NaN}}function mo(u,h,b){var S,E,N,J,se;if(!(!u.isValid()||isNaN(b))){switch(S=u._d,E=u._isUTC,h){case"Milliseconds":return void(E?S.setUTCMilliseconds(b):S.setMilliseconds(b));case"Seconds":return void(E?S.setUTCSeconds(b):S.setSeconds(b));case"Minutes":return void(E?S.setUTCMinutes(b):S.setMinutes(b));case"Hours":return void(E?S.setUTCHours(b):S.setHours(b));case"Date":return void(E?S.setUTCDate(b):S.setDate(b));case"FullYear":break;default:return}N=b,J=u.month(),se=u.date(),se=se===29&&J===1&&!Ma(N)?28:se,E?S.setUTCFullYear(N,J,se):S.setFullYear(N,J,se)}}function Qg(u){return u=Yt(u),j(this[u])?this[u]():this}function Na(u,h){if(typeof u=="object"){u=hr(u);var b=Pa(u),S,E=b.length;for(S=0;S<E;S++)this[b[S].unit](u[b[S].unit])}else if(u=Yt(u),j(this[u]))return this[u](h);return this}function Zg(u,h){return(u%h+h)%h}var xt;Array.prototype.indexOf?xt=Array.prototype.indexOf:xt=function(u){var h;for(h=0;h<this.length;++h)if(this[h]===u)return h;return-1};function Fc(u,h){if(isNaN(u)||isNaN(h))return NaN;var b=Zg(h,12);return u+=(h-b)/12,b===1?Ma(u)?29:28:31-b%7%2}ce("M",["MM",2],"Mo",function(){return this.month()+1}),ce("MMM",0,0,function(u){return this.localeData().monthsShort(this,u)}),ce("MMMM",0,0,function(u){return this.localeData().months(this,u)}),le("M",ot,Ii),le("MM",ot,Ut),le("MMM",function(u,h){return h.monthsShortRegex(u)}),le("MMMM",function(u,h){return h.monthsRegex(u)}),Ke(["M","MM"],function(u,h){h[kn]=qe(u)-1}),Ke(["MMM","MMMM"],function(u,h,b,S){var E=b._locale.monthsParse(u,S,b._strict);E!=null?h[kn]=E:C(b).invalidMonth=u});var qd="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Lc="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),jc=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Xg=uo,ey=uo;function ty(u,h){return u?n(this._months)?this._months[u.month()]:this._months[(this._months.isFormat||jc).test(h)?"format":"standalone"][u.month()]:n(this._months)?this._months:this._months.standalone}function ry(u,h){return u?n(this._monthsShort)?this._monthsShort[u.month()]:this._monthsShort[jc.test(h)?"format":"standalone"][u.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function $d(u,h,b){var S,E,N,J=u.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],S=0;S<12;++S)N=y([2e3,S]),this._shortMonthsParse[S]=this.monthsShort(N,"").toLocaleLowerCase(),this._longMonthsParse[S]=this.months(N,"").toLocaleLowerCase();return b?h==="MMM"?(E=xt.call(this._shortMonthsParse,J),E!==-1?E:null):(E=xt.call(this._longMonthsParse,J),E!==-1?E:null):h==="MMM"?(E=xt.call(this._shortMonthsParse,J),E!==-1?E:(E=xt.call(this._longMonthsParse,J),E!==-1?E:null)):(E=xt.call(this._longMonthsParse,J),E!==-1?E:(E=xt.call(this._shortMonthsParse,J),E!==-1?E:null))}function Md(u,h,b){var S,E,N;if(this._monthsParseExact)return $d.call(this,u,h,b);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),S=0;S<12;S++){if(E=y([2e3,S]),b&&!this._longMonthsParse[S]&&(this._longMonthsParse[S]=new RegExp("^"+this.months(E,"").replace(".","")+"$","i"),this._shortMonthsParse[S]=new RegExp("^"+this.monthsShort(E,"").replace(".","")+"$","i")),!b&&!this._monthsParse[S]&&(N="^"+this.months(E,"")+"|^"+this.monthsShort(E,""),this._monthsParse[S]=new RegExp(N.replace(".",""),"i")),b&&h==="MMMM"&&this._longMonthsParse[S].test(u))return S;if(b&&h==="MMM"&&this._shortMonthsParse[S].test(u))return S;if(!b&&this._monthsParse[S].test(u))return S}}function Uc(u,h){if(!u.isValid())return u;if(typeof h=="string"){if(/^\d+$/.test(h))h=qe(h);else if(h=u.localeData().monthsParse(h),!f(h))return u}var b=h,S=u.date();return S=S<29?S:Math.min(S,Fc(u.year(),b)),u._isUTC?u._d.setUTCMonth(b,S):u._d.setMonth(b,S),u}function Da(u){return u!=null?(Uc(this,u),e.updateOffset(this,!0),this):ho(this,"Month")}function ny(){return Fc(this.year(),this.month())}function Nd(u){return this._monthsParseExact?(s(this,"_monthsRegex")||Hc.call(this),u?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=Xg),this._monthsShortStrictRegex&&u?this._monthsShortStrictRegex:this._monthsShortRegex)}function Fa(u){return this._monthsParseExact?(s(this,"_monthsRegex")||Hc.call(this),u?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=ey),this._monthsStrictRegex&&u?this._monthsStrictRegex:this._monthsRegex)}function Hc(){function u(ve,Me){return Me.length-ve.length}var h=[],b=[],S=[],E,N,J,se;for(E=0;E<12;E++)N=y([2e3,E]),J=an(this.monthsShort(N,"")),se=an(this.months(N,"")),h.push(J),b.push(se),S.push(se),S.push(J);h.sort(u),b.sort(u),S.sort(u),this._monthsRegex=new RegExp("^("+S.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+b.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+h.join("|")+")","i")}function iy(u,h,b,S,E,N,J){var se;return u<100&&u>=0?(se=new Date(u+400,h,b,S,E,N,J),isFinite(se.getFullYear())&&se.setFullYear(u)):se=new Date(u,h,b,S,E,N,J),se}function ps(u){var h,b;return u<100&&u>=0?(b=Array.prototype.slice.call(arguments),b[0]=u+400,h=new Date(Date.UTC.apply(null,b)),isFinite(h.getUTCFullYear())&&h.setUTCFullYear(u)):h=new Date(Date.UTC.apply(null,arguments)),h}function go(u,h,b){var S=7+h-b,E=(7+ps(u,0,S).getUTCDay()-h)%7;return-E+S-1}function La(u,h,b,S,E){var N=(7+b-S)%7,J=go(u,S,E),se=1+7*(h-1)+N+J,ve,Me;return se<=0?(ve=u-1,Me=po(ve)+se):se>po(u)?(ve=u+1,Me=se-po(u)):(ve=u,Me=se),{year:ve,dayOfYear:Me}}function yo(u,h,b){var S=go(u.year(),h,b),E=Math.floor((u.dayOfYear()-S-1)/7)+1,N,J;return E<1?(J=u.year()-1,N=E+cn(J,h,b)):E>cn(u.year(),h,b)?(N=E-cn(u.year(),h,b),J=u.year()+1):(J=u.year(),N=E),{week:N,year:J}}function cn(u,h,b){var S=go(u,h,b),E=go(u+1,h,b);return(po(u)-S+E)/7}ce("w",["ww",2],"wo","week"),ce("W",["WW",2],"Wo","isoWeek"),le("w",ot,Ii),le("ww",ot,Ut),le("W",ot,Ii),le("WW",ot,Ut),fo(["w","ww","W","WW"],function(u,h,b,S){h[S.substr(0,1)]=qe(u)});function Bc(u){return yo(u,this._week.dow,this._week.doy).week}var Vc={dow:0,doy:6};function hs(){return this._week.dow}function Dd(){return this._week.doy}function Fd(u){var h=this.localeData().week(this);return u==null?h:this.add((u-h)*7,"d")}function sy(u){var h=yo(this,1,4).week;return u==null?h:this.add((u-h)*7,"d")}ce("d",0,"do","day"),ce("dd",0,0,function(u){return this.localeData().weekdaysMin(this,u)}),ce("ddd",0,0,function(u){return this.localeData().weekdaysShort(this,u)}),ce("dddd",0,0,function(u){return this.localeData().weekdays(this,u)}),ce("e",0,0,"weekday"),ce("E",0,0,"isoWeekday"),le("d",ot),le("e",ot),le("E",ot),le("dd",function(u,h){return h.weekdaysMinRegex(u)}),le("ddd",function(u,h){return h.weekdaysShortRegex(u)}),le("dddd",function(u,h){return h.weekdaysRegex(u)}),fo(["dd","ddd","dddd"],function(u,h,b,S){var E=b._locale.weekdaysParse(u,S,b._strict);E!=null?h.d=E:C(b).invalidWeekday=u}),fo(["d","e","E"],function(u,h,b,S){h[S]=qe(u)});function Ld(u,h){return typeof u!="string"?u:isNaN(u)?(u=h.weekdaysParse(u),typeof u=="number"?u:null):parseInt(u,10)}function jd(u,h){return typeof u=="string"?h.weekdaysParse(u)%7||7:isNaN(u)?null:u}function ja(u,h){return u.slice(h,7).concat(u.slice(0,h))}var Ud="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Hd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),oy="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ay=uo,Bd=uo,ly=uo;function cy(u,h){var b=n(this._weekdays)?this._weekdays:this._weekdays[u&&u!==!0&&this._weekdays.isFormat.test(h)?"format":"standalone"];return u===!0?ja(b,this._week.dow):u?b[u.day()]:b}function uy(u){return u===!0?ja(this._weekdaysShort,this._week.dow):u?this._weekdaysShort[u.day()]:this._weekdaysShort}function fy(u){return u===!0?ja(this._weekdaysMin,this._week.dow):u?this._weekdaysMin[u.day()]:this._weekdaysMin}function Wc(u,h,b){var S,E,N,J=u.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],S=0;S<7;++S)N=y([2e3,1]).day(S),this._minWeekdaysParse[S]=this.weekdaysMin(N,"").toLocaleLowerCase(),this._shortWeekdaysParse[S]=this.weekdaysShort(N,"").toLocaleLowerCase(),this._weekdaysParse[S]=this.weekdays(N,"").toLocaleLowerCase();return b?h==="dddd"?(E=xt.call(this._weekdaysParse,J),E!==-1?E:null):h==="ddd"?(E=xt.call(this._shortWeekdaysParse,J),E!==-1?E:null):(E=xt.call(this._minWeekdaysParse,J),E!==-1?E:null):h==="dddd"?(E=xt.call(this._weekdaysParse,J),E!==-1||(E=xt.call(this._shortWeekdaysParse,J),E!==-1)?E:(E=xt.call(this._minWeekdaysParse,J),E!==-1?E:null)):h==="ddd"?(E=xt.call(this._shortWeekdaysParse,J),E!==-1||(E=xt.call(this._weekdaysParse,J),E!==-1)?E:(E=xt.call(this._minWeekdaysParse,J),E!==-1?E:null)):(E=xt.call(this._minWeekdaysParse,J),E!==-1||(E=xt.call(this._weekdaysParse,J),E!==-1)?E:(E=xt.call(this._shortWeekdaysParse,J),E!==-1?E:null))}function dy(u,h,b){var S,E,N;if(this._weekdaysParseExact)return Wc.call(this,u,h,b);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),S=0;S<7;S++){if(E=y([2e3,1]).day(S),b&&!this._fullWeekdaysParse[S]&&(this._fullWeekdaysParse[S]=new RegExp("^"+this.weekdays(E,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[S]=new RegExp("^"+this.weekdaysShort(E,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[S]=new RegExp("^"+this.weekdaysMin(E,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[S]||(N="^"+this.weekdays(E,"")+"|^"+this.weekdaysShort(E,"")+"|^"+this.weekdaysMin(E,""),this._weekdaysParse[S]=new RegExp(N.replace(".",""),"i")),b&&h==="dddd"&&this._fullWeekdaysParse[S].test(u))return S;if(b&&h==="ddd"&&this._shortWeekdaysParse[S].test(u))return S;if(b&&h==="dd"&&this._minWeekdaysParse[S].test(u))return S;if(!b&&this._weekdaysParse[S].test(u))return S}}function py(u){if(!this.isValid())return u!=null?this:NaN;var h=ho(this,"Day");return u!=null?(u=Ld(u,this.localeData()),this.add(u-h,"d")):h}function hy(u){if(!this.isValid())return u!=null?this:NaN;var h=(this.day()+7-this.localeData()._week.dow)%7;return u==null?h:this.add(u-h,"d")}function my(u){if(!this.isValid())return u!=null?this:NaN;if(u!=null){var h=jd(u,this.localeData());return this.day(this.day()%7?h:h-7)}else return this.day()||7}function gy(u){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||zc.call(this),u?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=ay),this._weekdaysStrictRegex&&u?this._weekdaysStrictRegex:this._weekdaysRegex)}function ut(u){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||zc.call(this),u?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Bd),this._weekdaysShortStrictRegex&&u?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function at(u){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||zc.call(this),u?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ly),this._weekdaysMinStrictRegex&&u?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function zc(){function u(Dt,Dn){return Dn.length-Dt.length}var h=[],b=[],S=[],E=[],N,J,se,ve,Me;for(N=0;N<7;N++)J=y([2e3,1]).day(N),se=an(this.weekdaysMin(J,"")),ve=an(this.weekdaysShort(J,"")),Me=an(this.weekdays(J,"")),h.push(se),b.push(ve),S.push(Me),E.push(se),E.push(ve),E.push(Me);h.sort(u),b.sort(u),S.sort(u),E.sort(u),this._weekdaysRegex=new RegExp("^("+E.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+S.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+b.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+h.join("|")+")","i")}function Jc(){return this.hours()%12||12}function yy(){return this.hours()||24}ce("H",["HH",2],0,"hour"),ce("h",["hh",2],0,Jc),ce("k",["kk",2],0,yy),ce("hmm",0,0,function(){return""+Jc.apply(this)+_e(this.minutes(),2)}),ce("hmmss",0,0,function(){return""+Jc.apply(this)+_e(this.minutes(),2)+_e(this.seconds(),2)}),ce("Hmm",0,0,function(){return""+this.hours()+_e(this.minutes(),2)}),ce("Hmmss",0,0,function(){return""+this.hours()+_e(this.minutes(),2)+_e(this.seconds(),2)});function Vd(u,h){ce(u,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),h)})}Vd("a",!0),Vd("A",!1);function Wd(u,h){return h._meridiemParse}le("a",Wd),le("A",Wd),le("H",ot,qa),le("h",ot,Ii),le("k",ot,Ii),le("HH",ot,Ut),le("hh",ot,Ut),le("kk",ot,Ut),le("hmm",ka),le("hmmss",Ta),le("Hmm",ka),le("Hmmss",Ta),Ke(["H","HH"],At),Ke(["k","kk"],function(u,h,b){var S=qe(u);h[At]=S===24?0:S}),Ke(["a","A"],function(u,h,b){b._isPm=b._locale.isPM(u),b._meridiem=u}),Ke(["h","hh"],function(u,h,b){h[At]=qe(u),C(b).bigHour=!0}),Ke("hmm",function(u,h,b){var S=u.length-2;h[At]=qe(u.substr(0,S)),h[Pr]=qe(u.substr(S)),C(b).bigHour=!0}),Ke("hmmss",function(u,h,b){var S=u.length-4,E=u.length-2;h[At]=qe(u.substr(0,S)),h[Pr]=qe(u.substr(S,2)),h[Tn]=qe(u.substr(E)),C(b).bigHour=!0}),Ke("Hmm",function(u,h,b){var S=u.length-2;h[At]=qe(u.substr(0,S)),h[Pr]=qe(u.substr(S))}),Ke("Hmmss",function(u,h,b){var S=u.length-4,E=u.length-2;h[At]=qe(u.substr(0,S)),h[Pr]=qe(u.substr(S,2)),h[Tn]=qe(u.substr(E))});function vy(u){return(u+"").toLowerCase().charAt(0)==="p"}var zd=/[ap]\.?m?\.?/i,by=ds("Hours",!0);function Nt(u,h,b){return u>11?b?"pm":"PM":b?"am":"AM"}var Ua={calendar:ue,longDateFormat:Or,invalidDate:mt,ordinal:oo,dayOfMonthOrdinalParse:Jt,relativeTime:Wg,months:qd,monthsShort:Lc,week:Vc,weekdays:Ud,weekdaysMin:oy,weekdaysShort:Hd,meridiemParse:zd},Qe={},ms={},ki;function kr(u,h){var b,S=Math.min(u.length,h.length);for(b=0;b<S;b+=1)if(u[b]!==h[b])return b;return S}function Yc(u){return u&&u.toLowerCase().replace("_","-")}function Jd(u){for(var h=0,b,S,E,N;h<u.length;){for(N=Yc(u[h]).split("-"),b=N.length,S=Yc(u[h+1]),S=S?S.split("-"):null;b>0;){if(E=vo(N.slice(0,b).join("-")),E)return E;if(S&&S.length>=b&&kr(N,S)>=b-1)break;b--}h++}return ki}function Yd(u){return!!(u&&u.match("^[^/\\\\]*$"))}function vo(u){var h=null,b;if(Qe[u]===void 0&&typeof xl<"u"&&xl&&xl.exports&&Yd(u))try{h=ki._abbr,b=it,b("./locale/"+u),An(h)}catch{Qe[u]=null}return Qe[u]}function An(u,h){var b;return u&&(l(h)?b=qn(u):b=Ha(u,h),b?ki=b:typeof console<"u"&&console.warn&&console.warn("Locale "+u+" not found. Did you forget to load it?")),ki._abbr}function Ha(u,h){if(h!==null){var b,S=Ua;if(h.abbr=u,Qe[u]!=null)M("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."),S=Qe[u]._config;else if(h.parentLocale!=null)if(Qe[h.parentLocale]!=null)S=Qe[h.parentLocale]._config;else if(b=vo(h.parentLocale),b!=null)S=b._config;else return ms[h.parentLocale]||(ms[h.parentLocale]=[]),ms[h.parentLocale].push({name:u,config:h}),null;return Qe[u]=new K(Y(S,h)),ms[u]&&ms[u].forEach(function(E){Ha(E.name,E.config)}),An(u),Qe[u]}else return delete Qe[u],null}function mr(u,h){if(h!=null){var b,S,E=Ua;Qe[u]!=null&&Qe[u].parentLocale!=null?Qe[u].set(Y(Qe[u]._config,h)):(S=vo(u),S!=null&&(E=S._config),h=Y(E,h),S==null&&(h.abbr=u),b=new K(h),b.parentLocale=Qe[u],Qe[u]=b),An(u)}else Qe[u]!=null&&(Qe[u].parentLocale!=null?(Qe[u]=Qe[u].parentLocale,u===An()&&An(u)):Qe[u]!=null&&delete Qe[u]);return Qe[u]}function qn(u){var h;if(u&&u._locale&&u._locale._abbr&&(u=u._locale._abbr),!u)return ki;if(!n(u)){if(h=vo(u),h)return h;u=[u]}return Jd(u)}function gr(){return ne(Qe)}function Gc(u){var h,b=u._a;return b&&C(u).overflow===-2&&(h=b[kn]<0||b[kn]>11?kn:b[ln]<1||b[ln]>Fc(b[Gt],b[kn])?ln:b[At]<0||b[At]>24||b[At]===24&&(b[Pr]!==0||b[Tn]!==0||b[Pi]!==0)?At:b[Pr]<0||b[Pr]>59?Pr:b[Tn]<0||b[Tn]>59?Tn:b[Pi]<0||b[Pi]>999?Pi:-1,C(u)._overflowDayOfYear&&(h<Gt||h>ln)&&(h=ln),C(u)._overflowWeeks&&h===-1&&(h=Td),C(u)._overflowWeekday&&h===-1&&(h=Gg),C(u).overflow=h),u}var Gd=/^\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)?)?$/,ci=/^\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)?)?$/,Ba=/Z|[+-]\d\d(?::?\d\d)?/,gs=[["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]],lt=[["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/]],ui=/^\/?Date\((-?\d+)/i,Kc=/^(?:(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}))$/,Sy={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Va(u){var h,b,S=u._i,E=Gd.exec(S)||ci.exec(S),N,J,se,ve,Me=gs.length,Dt=lt.length;if(E){for(C(u).iso=!0,h=0,b=Me;h<b;h++)if(gs[h][1].exec(E[1])){J=gs[h][0],N=gs[h][2]!==!1;break}if(J==null){u._isValid=!1;return}if(E[3]){for(h=0,b=Dt;h<b;h++)if(lt[h][1].exec(E[3])){se=(E[2]||" ")+lt[h][0];break}if(se==null){u._isValid=!1;return}}if(!N&&se!=null){u._isValid=!1;return}if(E[4])if(Ba.exec(E[4]))ve="Z";else{u._isValid=!1;return}u._f=J+(se||"")+(ve||""),za(u)}else u._isValid=!1}function wy(u,h,b,S,E,N){var J=[_y(u),Lc.indexOf(h),parseInt(b,10),parseInt(S,10),parseInt(E,10)];return N&&J.push(parseInt(N,10)),J}function _y(u){var h=parseInt(u,10);return h<=49?2e3+h:h<=999?1900+h:h}function Ry(u){return u.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Kd(u,h,b){if(u){var S=Hd.indexOf(u),E=new Date(h[0],h[1],h[2]).getDay();if(S!==E)return C(b).weekdayMismatch=!0,b._isValid=!1,!1}return!0}function Wa(u,h,b){if(u)return Sy[u];if(h)return 0;var S=parseInt(b,10),E=S%100,N=(S-E)/100;return N*60+E}function Ti(u){var h=Kc.exec(Ry(u._i)),b;if(h){if(b=wy(h[4],h[3],h[2],h[5],h[6],h[7]),!Kd(h[1],b,u))return;u._a=b,u._tzm=Wa(h[8],h[9],h[10]),u._d=ps.apply(null,u._a),u._d.setUTCMinutes(u._d.getUTCMinutes()-u._tzm),C(u).rfc2822=!0}else u._isValid=!1}function xy(u){var h=ui.exec(u._i);if(h!==null){u._d=new Date(+h[1]);return}if(Va(u),u._isValid===!1)delete u._isValid;else return;if(Ti(u),u._isValid===!1)delete u._isValid;else return;u._strict?u._isValid=!1:e.createFromInputFallback(u)}e.createFromInputFallback=_("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(u){u._d=new Date(u._i+(u._useUTC?" UTC":""))});function Ai(u,h,b){return u??h??b}function Qd(u){var h=new Date(e.now());return u._useUTC?[h.getUTCFullYear(),h.getUTCMonth(),h.getUTCDate()]:[h.getFullYear(),h.getMonth(),h.getDate()]}function bo(u){var h,b,S=[],E,N,J;if(!u._d){for(E=Qd(u),u._w&&u._a[ln]==null&&u._a[kn]==null&&Qc(u),u._dayOfYear!=null&&(J=Ai(u._a[Gt],E[Gt]),(u._dayOfYear>po(J)||u._dayOfYear===0)&&(C(u)._overflowDayOfYear=!0),b=ps(J,0,u._dayOfYear),u._a[kn]=b.getUTCMonth(),u._a[ln]=b.getUTCDate()),h=0;h<3&&u._a[h]==null;++h)u._a[h]=S[h]=E[h];for(;h<7;h++)u._a[h]=S[h]=u._a[h]==null?h===2?1:0:u._a[h];u._a[At]===24&&u._a[Pr]===0&&u._a[Tn]===0&&u._a[Pi]===0&&(u._nextDay=!0,u._a[At]=0),u._d=(u._useUTC?ps:iy).apply(null,S),N=u._useUTC?u._d.getUTCDay():u._d.getDay(),u._tzm!=null&&u._d.setUTCMinutes(u._d.getUTCMinutes()-u._tzm),u._nextDay&&(u._a[At]=24),u._w&&typeof u._w.d<"u"&&u._w.d!==N&&(C(u).weekdayMismatch=!0)}}function Qc(u){var h,b,S,E,N,J,se,ve,Me;h=u._w,h.GG!=null||h.W!=null||h.E!=null?(N=1,J=4,b=Ai(h.GG,u._a[Gt],yo(tt(),1,4).year),S=Ai(h.W,1),E=Ai(h.E,1),(E<1||E>7)&&(ve=!0)):(N=u._locale._week.dow,J=u._locale._week.doy,Me=yo(tt(),N,J),b=Ai(h.gg,u._a[Gt],Me.year),S=Ai(h.w,Me.week),h.d!=null?(E=h.d,(E<0||E>6)&&(ve=!0)):h.e!=null?(E=h.e+N,(h.e<0||h.e>6)&&(ve=!0)):E=N),S<1||S>cn(b,N,J)?C(u)._overflowWeeks=!0:ve!=null?C(u)._overflowWeekday=!0:(se=La(b,S,E,N,J),u._a[Gt]=se.year,u._dayOfYear=se.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function za(u){if(u._f===e.ISO_8601){Va(u);return}if(u._f===e.RFC_2822){Ti(u);return}u._a=[],C(u).empty=!0;var h=""+u._i,b,S,E,N,J,se=h.length,ve=0,Me,Dt;for(E=zr(u._f,u._locale).match(he)||[],Dt=E.length,b=0;b<Dt;b++)N=E[b],S=(h.match(Jg(N,u))||[])[0],S&&(J=h.substr(0,h.indexOf(S)),J.length>0&&C(u).unusedInput.push(J),h=h.slice(h.indexOf(S)+S.length),ve+=S.length),Et[N]?(S?C(u).empty=!1:C(u).unusedTokens.push(N),Dc(N,S,u)):u._strict&&!S&&C(u).unusedTokens.push(N);C(u).charsLeftOver=se-ve,h.length>0&&C(u).unusedInput.push(h),u._a[At]<=12&&C(u).bigHour===!0&&u._a[At]>0&&(C(u).bigHour=void 0),C(u).parsedDateParts=u._a.slice(0),C(u).meridiem=u._meridiem,u._a[At]=Cy(u._locale,u._a[At],u._meridiem),Me=C(u).era,Me!==null&&(u._a[Gt]=u._locale.erasConvertYear(Me,u._a[Gt])),bo(u),Gc(u)}function Cy(u,h,b){var S;return b==null?h:u.meridiemHour!=null?u.meridiemHour(h,b):(u.isPM!=null&&(S=u.isPM(b),S&&h<12&&(h+=12),!S&&h===12&&(h=0)),h)}function Zc(u){var h,b,S,E,N,J,se=!1,ve=u._f.length;if(ve===0){C(u).invalidFormat=!0,u._d=new Date(NaN);return}for(E=0;E<ve;E++)N=0,J=!1,h=z({},u),u._useUTC!=null&&(h._useUTC=u._useUTC),h._f=u._f[E],za(h),P(h)&&(J=!0),N+=C(h).charsLeftOver,N+=C(h).unusedTokens.length*10,C(h).score=N,se?N<S&&(S=N,b=h):(S==null||N<S||J)&&(S=N,b=h,J&&(se=!0));g(u,b||h)}function Xc(u){if(!u._d){var h=hr(u._i),b=h.day===void 0?h.date:h.day;u._a=m([h.year,h.month,b,h.hour,h.minute,h.second,h.millisecond],function(S){return S&&parseInt(S,10)}),bo(u)}}function Ey(u){var h=new V(Gc(eu(u)));return h._nextDay&&(h.add(1,"d"),h._nextDay=void 0),h}function eu(u){var h=u._i,b=u._f;return u._locale=u._locale||qn(u._l),h===null||b===void 0&&h===""?A({nullInput:!0}):(typeof h=="string"&&(u._i=h=u._locale.preparse(h)),X(h)?new V(Gc(h)):(d(h)?u._d=h:n(b)?Zc(u):b?za(u):yr(u),P(u)||(u._d=null),u))}function yr(u){var h=u._i;l(h)?u._d=new Date(e.now()):d(h)?u._d=new Date(h.valueOf()):typeof h=="string"?xy(u):n(h)?(u._a=m(h.slice(0),function(b){return parseInt(b,10)}),bo(u)):i(h)?Xc(u):f(h)?u._d=new Date(h):e.createFromInputFallback(u)}function Ja(u,h,b,S,E){var N={};return(h===!0||h===!1)&&(S=h,h=void 0),(b===!0||b===!1)&&(S=b,b=void 0),(i(u)&&o(u)||n(u)&&u.length===0)&&(u=void 0),N._isAMomentObject=!0,N._useUTC=N._isUTC=E,N._l=b,N._i=u,N._f=h,N._strict=S,Ey(N)}function tt(u,h,b,S){return Ja(u,h,b,S,!1)}var Zd=_("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var u=tt.apply(null,arguments);return this.isValid()&&u.isValid()?u<this?this:u:A()}),Xd=_("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var u=tt.apply(null,arguments);return this.isValid()&&u.isValid()?u>this?this:u:A()});function ep(u,h){var b,S;if(h.length===1&&n(h[0])&&(h=h[0]),!h.length)return tt();for(b=h[0],S=1;S<h.length;++S)(!h[S].isValid()||h[S][u](b))&&(b=h[S]);return b}function Oy(){var u=[].slice.call(arguments,0);return ep("isBefore",u)}function Iy(){var u=[].slice.call(arguments,0);return ep("isAfter",u)}var Py=function(){return Date.now?Date.now():+new Date},So=["year","quarter","month","week","day","hour","minute","second","millisecond"];function ys(u){var h,b=!1,S,E=So.length;for(h in u)if(s(u,h)&&!(xt.call(So,h)!==-1&&(u[h]==null||!isNaN(u[h]))))return!1;for(S=0;S<E;++S)if(u[So[S]]){if(b)return!1;parseFloat(u[So[S]])!==qe(u[So[S]])&&(b=!0)}return!0}function ky(){return this._isValid}function Ty(){return rt(NaN)}function vs(u){var h=hr(u),b=h.year||0,S=h.quarter||0,E=h.month||0,N=h.week||h.isoWeek||0,J=h.day||0,se=h.hour||0,ve=h.minute||0,Me=h.second||0,Dt=h.millisecond||0;this._isValid=ys(h),this._milliseconds=+Dt+Me*1e3+ve*6e4+se*1e3*60*60,this._days=+J+N*7,this._months=+E+S*3+b*12,this._data={},this._locale=qn(),this._bubble()}function wo(u){return u instanceof vs}function un(u){return u<0?Math.round(-1*u)*-1:Math.round(u)}function Ya(u,h,b){var S=Math.min(u.length,h.length),E=Math.abs(u.length-h.length),N=0,J;for(J=0;J<S;J++)(b&&u[J]!==h[J]||!b&&qe(u[J])!==qe(h[J]))&&N++;return N+E}function tp(u,h){ce(u,0,0,function(){var b=this.utcOffset(),S="+";return b<0&&(b=-b,S="-"),S+_e(~~(b/60),2)+h+_e(~~b%60,2)})}tp("Z",":"),tp("ZZ",""),le("Z",Aa),le("ZZ",Aa),Ke(["Z","ZZ"],function(u,h,b){b._useUTC=!0,b._tzm=tu(Aa,u)});var Ay=/([\+\-]|\d\d)/gi;function tu(u,h){var b=(h||"").match(u),S,E,N;return b===null?null:(S=b[b.length-1]||[],E=(S+"").match(Ay)||["-",0,0],N=+(E[1]*60)+qe(E[2]),N===0?0:E[0]==="+"?N:-N)}function fi(u,h){var b,S;return h._isUTC?(b=h.clone(),S=(X(u)||d(u)?u.valueOf():tt(u).valueOf())-b.valueOf(),b._d.setTime(b._d.valueOf()+S),e.updateOffset(b,!1),b):tt(u).local()}function vr(u){return-Math.round(u._d.getTimezoneOffset())}e.updateOffset=function(){};function rp(u,h,b){var S=this._offset||0,E;if(!this.isValid())return u!=null?this:NaN;if(u!=null){if(typeof u=="string"){if(u=tu(Aa,u),u===null)return this}else Math.abs(u)<16&&!b&&(u=u*60);return!this._isUTC&&h&&(E=vr(this)),this._offset=u,this._isUTC=!0,E!=null&&this.add(E,"m"),S!==u&&(!h||this._changeInProgress?_o(this,rt(u-S,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?S:vr(this)}function qy(u,h){return u!=null?(typeof u!="string"&&(u=-u),this.utcOffset(u,h),this):-this.utcOffset()}function $y(u){return this.utcOffset(0,u)}function My(u){return this._isUTC&&(this.utcOffset(0,u),this._isUTC=!1,u&&this.subtract(vr(this),"m")),this}function Ny(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var u=tu(Mc,this._i);u!=null?this.utcOffset(u):this.utcOffset(0,!0)}return this}function Dy(u){return this.isValid()?(u=u?tt(u).utcOffset():0,(this.utcOffset()-u)%60===0):!1}function di(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function L(){if(!l(this._isDSTShifted))return this._isDSTShifted;var u={},h;return z(u,this),u=eu(u),u._a?(h=u._isUTC?y(u._a):tt(u._a),this._isDSTShifted=this.isValid()&&Ya(u._a,h.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function G(){return this.isValid()?!this._isUTC:!1}function W(){return this.isValid()?this._isUTC:!1}function oe(){return this.isValid()?this._isUTC&&this._offset===0:!1}var be=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Ye=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function rt(u,h){var b=u,S=null,E,N,J;return wo(u)?b={ms:u._milliseconds,d:u._days,M:u._months}:f(u)||!isNaN(+u)?(b={},h?b[h]=+u:b.milliseconds=+u):(S=be.exec(u))?(E=S[1]==="-"?-1:1,b={y:0,d:qe(S[ln])*E,h:qe(S[At])*E,m:qe(S[Pr])*E,s:qe(S[Tn])*E,ms:qe(un(S[Pi]*1e3))*E}):(S=Ye.exec(u))?(E=S[1]==="-"?-1:1,b={y:Ue(S[2],E),M:Ue(S[3],E),w:Ue(S[4],E),d:Ue(S[5],E),h:Ue(S[6],E),m:Ue(S[7],E),s:Ue(S[8],E)}):b==null?b={}:typeof b=="object"&&("from"in b||"to"in b)&&(J=Fy(tt(b.from),tt(b.to)),b={},b.ms=J.milliseconds,b.M=J.months),N=new vs(b),wo(u)&&s(u,"_locale")&&(N._locale=u._locale),wo(u)&&s(u,"_isValid")&&(N._isValid=u._isValid),N}rt.fn=vs.prototype,rt.invalid=Ty;function Ue(u,h){var b=u&&parseFloat(u.replace(",","."));return(isNaN(b)?0:b)*h}function Ga(u,h){var b={};return b.months=h.month()-u.month()+(h.year()-u.year())*12,u.clone().add(b.months,"M").isAfter(h)&&--b.months,b.milliseconds=+h-+u.clone().add(b.months,"M"),b}function Fy(u,h){var b;return u.isValid()&&h.isValid()?(h=fi(h,u),u.isBefore(h)?b=Ga(u,h):(b=Ga(h,u),b.milliseconds=-b.milliseconds,b.months=-b.months),b):{milliseconds:0,months:0}}function br(u,h){return function(b,S){var E,N;return S!==null&&!isNaN(+S)&&(M(h,"moment()."+h+"(period, number) is deprecated. Please use moment()."+h+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),N=b,b=S,S=N),E=rt(b,S),_o(this,E,u),this}}function _o(u,h,b,S){var E=h._milliseconds,N=un(h._days),J=un(h._months);u.isValid()&&(S=S??!0,J&&Uc(u,ho(u,"Month")+J*b),N&&mo(u,"Date",ho(u,"Date")+N*b),E&&u._d.setTime(u._d.valueOf()+E*b),S&&e.updateOffset(u,N||J))}var Ly=br(1,"add"),bs=br(-1,"subtract");function Ro(u){return typeof u=="string"||u instanceof String}function Ka(u){return X(u)||d(u)||Ro(u)||f(u)||jy(u)||Ze(u)||u===null||u===void 0}function Ze(u){var h=i(u)&&!o(u),b=!1,S=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],E,N,J=S.length;for(E=0;E<J;E+=1)N=S[E],b=b||s(u,N);return h&&b}function jy(u){var h=n(u),b=!1;return h&&(b=u.filter(function(S){return!f(S)&&Ro(u)}).length===0),h&&b}function np(u){var h=i(u)&&!o(u),b=!1,S=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],E,N;for(E=0;E<S.length;E+=1)N=S[E],b=b||s(u,N);return h&&b}function Qa(u,h){var b=u.diff(h,"days",!0);return b<-6?"sameElse":b<-1?"lastWeek":b<0?"lastDay":b<1?"sameDay":b<2?"nextDay":b<7?"nextWeek":"sameElse"}function Uy(u,h){arguments.length===1&&(arguments[0]?Ka(arguments[0])?(u=arguments[0],h=void 0):np(arguments[0])&&(h=arguments[0],u=void 0):(u=void 0,h=void 0));var b=u||tt(),S=fi(b,this).startOf("day"),E=e.calendarFormat(this,S)||"sameElse",N=h&&(j(h[E])?h[E].call(this,b):h[E]);return this.format(N||this.localeData().calendar(E,this,tt(b)))}function Hy(){return new V(this)}function By(u,h){var b=X(u)?u:tt(u);return this.isValid()&&b.isValid()?(h=Yt(h)||"millisecond",h==="millisecond"?this.valueOf()>b.valueOf():b.valueOf()<this.clone().startOf(h).valueOf()):!1}function Za(u,h){var b=X(u)?u:tt(u);return this.isValid()&&b.isValid()?(h=Yt(h)||"millisecond",h==="millisecond"?this.valueOf()<b.valueOf():this.clone().endOf(h).valueOf()<b.valueOf()):!1}function pi(u,h,b,S){var E=X(u)?u:tt(u),N=X(h)?h:tt(h);return this.isValid()&&E.isValid()&&N.isValid()?(S=S||"()",(S[0]==="("?this.isAfter(E,b):!this.isBefore(E,b))&&(S[1]===")"?this.isBefore(N,b):!this.isAfter(N,b))):!1}function Xa(u,h){var b=X(u)?u:tt(u),S;return this.isValid()&&b.isValid()?(h=Yt(h)||"millisecond",h==="millisecond"?this.valueOf()===b.valueOf():(S=b.valueOf(),this.clone().startOf(h).valueOf()<=S&&S<=this.clone().endOf(h).valueOf())):!1}function ip(u,h){return this.isSame(u,h)||this.isAfter(u,h)}function el(u,h){return this.isSame(u,h)||this.isBefore(u,h)}function sp(u,h,b){var S,E,N;if(!this.isValid())return NaN;if(S=fi(u,this),!S.isValid())return NaN;switch(E=(S.utcOffset()-this.utcOffset())*6e4,h=Yt(h),h){case"year":N=xo(this,S)/12;break;case"month":N=xo(this,S);break;case"quarter":N=xo(this,S)/3;break;case"second":N=(this-S)/1e3;break;case"minute":N=(this-S)/6e4;break;case"hour":N=(this-S)/36e5;break;case"day":N=(this-S-E)/864e5;break;case"week":N=(this-S-E)/6048e5;break;default:N=this-S}return b?N:Ir(N)}function xo(u,h){if(u.date()<h.date())return-xo(h,u);var b=(h.year()-u.year())*12+(h.month()-u.month()),S=u.clone().add(b,"months"),E,N;return h-S<0?(E=u.clone().add(b-1,"months"),N=(h-S)/(S-E)):(E=u.clone().add(b+1,"months"),N=(h-S)/(E-S)),-(b+N)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function tl(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function op(u){if(!this.isValid())return null;var h=u!==!0,b=h?this.clone().utc():this;return b.year()<0||b.year()>9999?Rt(b,h?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):j(Date.prototype.toISOString)?h?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Rt(b,"Z")):Rt(b,h?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Co(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var u="moment",h="",b,S,E,N;return this.isLocal()||(u=this.utcOffset()===0?"moment.utc":"moment.parseZone",h="Z"),b="["+u+'("]',S=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",E="-MM-DD[T]HH:mm:ss.SSS",N=h+'[")]',this.format(b+S+E+N)}function qi(u){u||(u=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var h=Rt(this,u);return this.localeData().postformat(h)}function rl(u,h){return this.isValid()&&(X(u)&&u.isValid()||tt(u).isValid())?rt({to:this,from:u}).locale(this.locale()).humanize(!h):this.localeData().invalidDate()}function Vy(u){return this.from(tt(),u)}function Wy(u,h){return this.isValid()&&(X(u)&&u.isValid()||tt(u).isValid())?rt({from:this,to:u}).locale(this.locale()).humanize(!h):this.localeData().invalidDate()}function zy(u){return this.to(tt(),u)}function Eo(u){var h;return u===void 0?this._locale._abbr:(h=qn(u),h!=null&&(this._locale=h),this)}var Oo=_("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(u){return u===void 0?this.localeData():this.locale(u)});function nl(){return this._locale}var il=1e3,$i=60*il,sl=60*$i,ap=(365*400+97)*24*sl;function gt(u,h){return(u%h+h)%h}function Ht(u,h,b){return u<100&&u>=0?new Date(u+400,h,b)-ap:new Date(u,h,b).valueOf()}function lp(u,h,b){return u<100&&u>=0?Date.UTC(u+400,h,b)-ap:Date.UTC(u,h,b)}function Jy(u){var h,b;if(u=Yt(u),u===void 0||u==="millisecond"||!this.isValid())return this;switch(b=this._isUTC?lp:Ht,u){case"year":h=b(this.year(),0,1);break;case"quarter":h=b(this.year(),this.month()-this.month()%3,1);break;case"month":h=b(this.year(),this.month(),1);break;case"week":h=b(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":h=b(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":h=b(this.year(),this.month(),this.date());break;case"hour":h=this._d.valueOf(),h-=gt(h+(this._isUTC?0:this.utcOffset()*$i),sl);break;case"minute":h=this._d.valueOf(),h-=gt(h,$i);break;case"second":h=this._d.valueOf(),h-=gt(h,il);break}return this._d.setTime(h),e.updateOffset(this,!0),this}function cp(u){var h,b;if(u=Yt(u),u===void 0||u==="millisecond"||!this.isValid())return this;switch(b=this._isUTC?lp:Ht,u){case"year":h=b(this.year()+1,0,1)-1;break;case"quarter":h=b(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":h=b(this.year(),this.month()+1,1)-1;break;case"week":h=b(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":h=b(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":h=b(this.year(),this.month(),this.date()+1)-1;break;case"hour":h=this._d.valueOf(),h+=sl-gt(h+(this._isUTC?0:this.utcOffset()*$i),sl)-1;break;case"minute":h=this._d.valueOf(),h+=$i-gt(h,$i)-1;break;case"second":h=this._d.valueOf(),h+=il-gt(h,il)-1;break}return this._d.setTime(h),e.updateOffset(this,!0),this}function Yy(){return this._d.valueOf()-(this._offset||0)*6e4}function ru(){return Math.floor(this.valueOf()/1e3)}function Io(){return new Date(this.valueOf())}function nu(){var u=this;return[u.year(),u.month(),u.date(),u.hour(),u.minute(),u.second(),u.millisecond()]}function Ss(){var u=this;return{years:u.year(),months:u.month(),date:u.date(),hours:u.hours(),minutes:u.minutes(),seconds:u.seconds(),milliseconds:u.milliseconds()}}function Po(){return this.isValid()?this.toISOString():null}function ko(){return P(this)}function ol(){return g({},C(this))}function ws(){return C(this).overflow}function Gy(){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"),le("N",nr),le("NN",nr),le("NNN",nr),le("NNNN",$e),le("NNNNN",ev),Ke(["N","NN","NNN","NNNN","NNNNN"],function(u,h,b,S){var E=b._locale.erasParse(u,S,b._strict);E?C(b).era=E:C(b).invalidEra=u}),le("y",li),le("yy",li),le("yyy",li),le("yyyy",li),le("yo",tv),Ke(["y","yy","yyy","yyyy"],Gt),Ke(["yo"],function(u,h,b,S){var E;b._locale._eraYearOrdinalRegex&&(E=u.match(b._locale._eraYearOrdinalRegex)),b._locale.eraYearOrdinalParse?h[Gt]=b._locale.eraYearOrdinalParse(u,E):h[Gt]=parseInt(u,10)});function Ky(u,h){var b,S,E,N=this._eras||qn("en")._eras;for(b=0,S=N.length;b<S;++b)switch(typeof N[b].since==="string"&&(E=e(N[b].since).startOf("day"),N[b].since=E.valueOf()),typeof N[b].until){case"undefined":N[b].until=1/0;break;case"string":E=e(N[b].until).startOf("day").valueOf(),N[b].until=E.valueOf();break}return N}function Qy(u,h,b){var S,E,N=this.eras(),J,se,ve;for(u=u.toUpperCase(),S=0,E=N.length;S<E;++S)if(J=N[S].name.toUpperCase(),se=N[S].abbr.toUpperCase(),ve=N[S].narrow.toUpperCase(),b)switch(h){case"N":case"NN":case"NNN":if(se===u)return N[S];break;case"NNNN":if(J===u)return N[S];break;case"NNNNN":if(ve===u)return N[S];break}else if([J,se,ve].indexOf(u)>=0)return N[S]}function Zy(u,h){var b=u.since<=u.until?1:-1;return h===void 0?e(u.since).year():e(u.since).year()+(h-u.offset)*b}function Xy(){var u,h,b,S=this.localeData().eras();for(u=0,h=S.length;u<h;++u)if(b=this.clone().startOf("day").valueOf(),S[u].since<=b&&b<=S[u].until||S[u].until<=b&&b<=S[u].since)return S[u].name;return""}function al(){var u,h,b,S=this.localeData().eras();for(u=0,h=S.length;u<h;++u)if(b=this.clone().startOf("day").valueOf(),S[u].since<=b&&b<=S[u].until||S[u].until<=b&&b<=S[u].since)return S[u].narrow;return""}function To(){var u,h,b,S=this.localeData().eras();for(u=0,h=S.length;u<h;++u)if(b=this.clone().startOf("day").valueOf(),S[u].since<=b&&b<=S[u].until||S[u].until<=b&&b<=S[u].since)return S[u].abbr;return""}function up(){var u,h,b,S,E=this.localeData().eras();for(u=0,h=E.length;u<h;++u)if(b=E[u].since<=E[u].until?1:-1,S=this.clone().startOf("day").valueOf(),E[u].since<=S&&S<=E[u].until||E[u].until<=S&&S<=E[u].since)return(this.year()-e(E[u].since).year())*b+E[u].offset;return this.year()}function O(u){return s(this,"_erasNameRegex")||iu.call(this),u?this._erasNameRegex:this._erasRegex}function _s(u){return s(this,"_erasAbbrRegex")||iu.call(this),u?this._erasAbbrRegex:this._erasRegex}function ll(u){return s(this,"_erasNarrowRegex")||iu.call(this),u?this._erasNarrowRegex:this._erasRegex}function nr(u,h){return h.erasAbbrRegex(u)}function $e(u,h){return h.erasNameRegex(u)}function ev(u,h){return h.erasNarrowRegex(u)}function tv(u,h){return h._eraYearOrdinalRegex||li}function iu(){var u=[],h=[],b=[],S=[],E,N,J,se,ve,Me=this.eras();for(E=0,N=Me.length;E<N;++E)J=an(Me[E].name),se=an(Me[E].abbr),ve=an(Me[E].narrow),h.push(J),u.push(se),b.push(ve),S.push(J),S.push(se),S.push(ve);this._erasRegex=new RegExp("^("+S.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+h.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+u.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+b.join("|")+")","i")}ce(0,["gg",2],0,function(){return this.weekYear()%100}),ce(0,["GG",2],0,function(){return this.isoWeekYear()%100});function fn(u,h){ce(0,[u,u.length],0,h)}fn("gggg","weekYear"),fn("ggggg","weekYear"),fn("GGGG","isoWeekYear"),fn("GGGGG","isoWeekYear"),le("G",fs),le("g",fs),le("GG",ot,Ut),le("gg",ot,Ut),le("GGGG",co,Oi),le("gggg",co,Oi),le("GGGGG",us,Pn),le("ggggg",us,Pn),fo(["gggg","ggggg","GGGG","GGGGG"],function(u,h,b,S){h[S.substr(0,2)]=qe(u)}),fo(["gg","GG"],function(u,h,b,S){h[S]=e.parseTwoDigitYear(u)});function rv(u){return fp.call(this,u,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function nv(u){return fp.call(this,u,this.isoWeek(),this.isoWeekday(),1,4)}function iv(){return cn(this.year(),1,4)}function sv(){return cn(this.isoWeekYear(),1,4)}function ov(){var u=this.localeData()._week;return cn(this.year(),u.dow,u.doy)}function $n(){var u=this.localeData()._week;return cn(this.weekYear(),u.dow,u.doy)}function fp(u,h,b,S,E){var N;return u==null?yo(this,S,E).year:(N=cn(u,S,E),h>N&&(h=N),av.call(this,u,h,b,S,E))}function av(u,h,b,S,E){var N=La(u,h,b,S,E),J=ps(N.year,0,N.dayOfYear);return this.year(J.getUTCFullYear()),this.month(J.getUTCMonth()),this.date(J.getUTCDate()),this}ce("Q",0,"Qo","quarter"),le("Q",Pd),Ke("Q",function(u,h){h[kn]=(qe(u)-1)*3});function lv(u){return u==null?Math.ceil((this.month()+1)/3):this.month((u-1)*3+this.month()%3)}ce("D",["DD",2],"Do","date"),le("D",ot,Ii),le("DD",ot,Ut),le("Do",function(u,h){return u?h._dayOfMonthOrdinalParse||h._ordinalParse:h._dayOfMonthOrdinalParseLenient}),Ke(["D","DD"],ln),Ke("Do",function(u,h){h[ln]=qe(u.match(ot)[0])});var dp=ds("Date",!0);ce("DDD",["DDDD",3],"DDDo","dayOfYear"),le("DDD",cs),le("DDDD",kd),Ke(["DDD","DDDD"],function(u,h,b){b._dayOfYear=qe(u)});function cv(u){var h=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return u==null?h:this.add(u-h,"d")}ce("m",["mm",2],0,"minute"),le("m",ot,qa),le("mm",ot,Ut),Ke(["m","mm"],Pr);var Mn=ds("Minutes",!1);ce("s",["ss",2],0,"second"),le("s",ot,qa),le("ss",ot,Ut),Ke(["s","ss"],Tn);var uv=ds("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}),le("S",cs,Pd),le("SS",cs,Ut),le("SSS",cs,kd);var hi,pp;for(hi="SSSS";hi.length<=9;hi+="S")le(hi,li);function fv(u,h){h[Pi]=qe(("0."+u)*1e3)}for(hi="S";hi.length<=9;hi+="S")Ke(hi,fv);pp=ds("Milliseconds",!1),ce("z",0,0,"zoneAbbr"),ce("zz",0,0,"zoneName");function dv(){return this._isUTC?"UTC":""}function Mi(){return this._isUTC?"Coordinated Universal Time":""}var te=V.prototype;te.add=Ly,te.calendar=Uy,te.clone=Hy,te.diff=sp,te.endOf=cp,te.format=qi,te.from=rl,te.fromNow=Vy,te.to=Wy,te.toNow=zy,te.get=Qg,te.invalidAt=ws,te.isAfter=By,te.isBefore=Za,te.isBetween=pi,te.isSame=Xa,te.isSameOrAfter=ip,te.isSameOrBefore=el,te.isValid=ko,te.lang=Oo,te.locale=Eo,te.localeData=nl,te.max=Xd,te.min=Zd,te.parsingFlags=ol,te.set=Na,te.startOf=Jy,te.subtract=bs,te.toArray=nu,te.toObject=Ss,te.toDate=Io,te.toISOString=op,te.inspect=Co,typeof Symbol<"u"&&Symbol.for!=null&&(te[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),te.toJSON=Po,te.toString=tl,te.unix=ru,te.valueOf=Yy,te.creationData=Gy,te.eraName=Xy,te.eraNarrow=al,te.eraAbbr=To,te.eraYear=up,te.year=Ad,te.isLeapYear=Kg,te.weekYear=rv,te.isoWeekYear=nv,te.quarter=te.quarters=lv,te.month=Da,te.daysInMonth=ny,te.week=te.weeks=Fd,te.isoWeek=te.isoWeeks=sy,te.weeksInYear=ov,te.weeksInWeekYear=$n,te.isoWeeksInYear=iv,te.isoWeeksInISOWeekYear=sv,te.date=dp,te.day=te.days=py,te.weekday=hy,te.isoWeekday=my,te.dayOfYear=cv,te.hour=te.hours=by,te.minute=te.minutes=Mn,te.second=te.seconds=uv,te.millisecond=te.milliseconds=pp,te.utcOffset=rp,te.utc=$y,te.local=My,te.parseZone=Ny,te.hasAlignedHourOffset=Dy,te.isDST=di,te.isLocal=G,te.isUtcOffset=W,te.isUtc=oe,te.isUTC=oe,te.zoneAbbr=dv,te.zoneName=Mi,te.dates=_("dates accessor is deprecated. Use date instead.",dp),te.months=_("months accessor is deprecated. Use month instead",Da),te.years=_("years accessor is deprecated. Use year instead",Ad),te.zone=_("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",qy),te.isDSTShifted=_("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",L);function pv(u){return tt(u*1e3)}function Jr(){return tt.apply(null,arguments).parseZone()}function hp(u){return u}var Ve=K.prototype;Ve.calendar=et,Ve.longDateFormat=ht,Ve.invalidDate=on,Ve.ordinal=ao,Ve.preparse=hp,Ve.postformat=hp,Ve.relativeTime=In,Ve.pastFuture=Od,Ve.set=$,Ve.eras=Ky,Ve.erasParse=Qy,Ve.erasConvertYear=Zy,Ve.erasAbbrRegex=_s,Ve.erasNameRegex=O,Ve.erasNarrowRegex=ll,Ve.months=ty,Ve.monthsShort=ry,Ve.monthsParse=Md,Ve.monthsRegex=Fa,Ve.monthsShortRegex=Nd,Ve.week=Bc,Ve.firstDayOfYear=Dd,Ve.firstDayOfWeek=hs,Ve.weekdays=cy,Ve.weekdaysMin=fy,Ve.weekdaysShort=uy,Ve.weekdaysParse=dy,Ve.weekdaysRegex=gy,Ve.weekdaysShortRegex=ut,Ve.weekdaysMinRegex=at,Ve.isPM=vy,Ve.meridiem=Nt;function cl(u,h,b,S){var E=qn(),N=y().set(S,h);return E[b](N,u)}function mp(u,h,b){if(f(u)&&(h=u,u=void 0),u=u||"",h!=null)return cl(u,h,b,"month");var S,E=[];for(S=0;S<12;S++)E[S]=cl(u,S,b,"month");return E}function su(u,h,b,S){typeof u=="boolean"?(f(h)&&(b=h,h=void 0),h=h||""):(h=u,b=h,u=!1,f(h)&&(b=h,h=void 0),h=h||"");var E=qn(),N=u?E._week.dow:0,J,se=[];if(b!=null)return cl(h,(b+N)%7,S,"day");for(J=0;J<7;J++)se[J]=cl(h,(J+N)%7,S,"day");return se}function gp(u,h){return mp(u,h,"months")}function yp(u,h){return mp(u,h,"monthsShort")}function hv(u,h,b){return su(u,h,b,"weekdays")}function mv(u,h,b){return su(u,h,b,"weekdaysShort")}function ou(u,h,b){return su(u,h,b,"weekdaysMin")}An("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(u){var h=u%10,b=qe(u%100/10)===1?"th":h===1?"st":h===2?"nd":h===3?"rd":"th";return u+b}}),e.lang=_("moment.lang is deprecated. Use moment.locale instead.",An),e.langData=_("moment.langData is deprecated. Use moment.localeData instead.",qn);var Sr=Math.abs;function ul(){var u=this._data;return this._milliseconds=Sr(this._milliseconds),this._days=Sr(this._days),this._months=Sr(this._months),u.milliseconds=Sr(u.milliseconds),u.seconds=Sr(u.seconds),u.minutes=Sr(u.minutes),u.hours=Sr(u.hours),u.months=Sr(u.months),u.years=Sr(u.years),this}function vp(u,h,b,S){var E=rt(h,b);return u._milliseconds+=S*E._milliseconds,u._days+=S*E._days,u._months+=S*E._months,u._bubble()}function bp(u,h){return vp(this,u,h,1)}function gv(u,h){return vp(this,u,h,-1)}function Yr(u){return u<0?Math.floor(u):Math.ceil(u)}function au(){var u=this._milliseconds,h=this._days,b=this._months,S=this._data,E,N,J,se,ve;return u>=0&&h>=0&&b>=0||u<=0&&h<=0&&b<=0||(u+=Yr(ir(b)+h)*864e5,h=0,b=0),S.milliseconds=u%1e3,E=Ir(u/1e3),S.seconds=E%60,N=Ir(E/60),S.minutes=N%60,J=Ir(N/60),S.hours=J%24,h+=Ir(J/24),ve=Ir(mi(h)),b+=ve,h-=Yr(ir(ve)),se=Ir(b/12),b%=12,S.days=h,S.months=b,S.years=se,this}function mi(u){return u*4800/146097}function ir(u){return u*146097/4800}function yv(u){if(!this.isValid())return NaN;var h,b,S=this._milliseconds;if(u=Yt(u),u==="month"||u==="quarter"||u==="year")switch(h=this._days+S/864e5,b=this._months+mi(h),u){case"month":return b;case"quarter":return b/3;case"year":return b/12}else switch(h=this._days+Math.round(ir(this._months)),u){case"week":return h/7+S/6048e5;case"day":return h+S/864e5;case"hour":return h*24+S/36e5;case"minute":return h*1440+S/6e4;case"second":return h*86400+S/1e3;case"millisecond":return Math.floor(h*864e5)+S;default:throw new Error("Unknown unit "+u)}}function dn(u){return function(){return this.as(u)}}var lu=dn("ms"),Ao=dn("s"),gi=dn("m"),Sp=dn("h"),vv=dn("d"),fl=dn("w"),bv=dn("M"),wp=dn("Q"),Bt=dn("y"),cu=lu;function _p(){return rt(this)}function pn(u){return u=Yt(u),this.isValid()?this[u+"s"]():NaN}function Nn(u){return function(){return this.isValid()?this._data[u]:NaN}}var dl=Nn("milliseconds"),Ni=Nn("seconds"),Rp=Nn("minutes"),Qt=Nn("hours"),uu=Nn("days"),Sv=Nn("months"),wv=Nn("years");function _v(){return Ir(this.days()/7)}var Gr=Math.round,Rs={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function qo(u,h,b,S,E){return E.relativeTime(h||1,!!b,u,S)}function xp(u,h,b,S){var E=rt(u).abs(),N=Gr(E.as("s")),J=Gr(E.as("m")),se=Gr(E.as("h")),ve=Gr(E.as("d")),Me=Gr(E.as("M")),Dt=Gr(E.as("w")),Dn=Gr(E.as("y")),Fn=N<=b.ss&&["s",N]||N<b.s&&["ss",N]||J<=1&&["m"]||J<b.m&&["mm",J]||se<=1&&["h"]||se<b.h&&["hh",se]||ve<=1&&["d"]||ve<b.d&&["dd",ve];return b.w!=null&&(Fn=Fn||Dt<=1&&["w"]||Dt<b.w&&["ww",Dt]),Fn=Fn||Me<=1&&["M"]||Me<b.M&&["MM",Me]||Dn<=1&&["y"]||["yy",Dn],Fn[2]=h,Fn[3]=+u>0,Fn[4]=S,qo.apply(null,Fn)}function Rv(u){return u===void 0?Gr:typeof u=="function"?(Gr=u,!0):!1}function xv(u,h){return Rs[u]===void 0?!1:h===void 0?Rs[u]:(Rs[u]=h,u==="s"&&(Rs.ss=h-1),!0)}function $o(u,h){if(!this.isValid())return this.localeData().invalidDate();var b=!1,S=Rs,E,N;return typeof u=="object"&&(h=u,u=!1),typeof u=="boolean"&&(b=u),typeof h=="object"&&(S=Object.assign({},Rs,h),h.s!=null&&h.ss==null&&(S.ss=h.s-1)),E=this.localeData(),N=xp(this,!b,S,E),b&&(N=E.pastFuture(+this,N)),E.postformat(N)}var fu=Math.abs;function xs(u){return(u>0)-(u<0)||+u}function Cs(){if(!this.isValid())return this.localeData().invalidDate();var u=fu(this._milliseconds)/1e3,h=fu(this._days),b=fu(this._months),S,E,N,J,se=this.asSeconds(),ve,Me,Dt,Dn;return se?(S=Ir(u/60),E=Ir(S/60),u%=60,S%=60,N=Ir(b/12),b%=12,J=u?u.toFixed(3).replace(/\.?0+$/,""):"",ve=se<0?"-":"",Me=xs(this._months)!==xs(se)?"-":"",Dt=xs(this._days)!==xs(se)?"-":"",Dn=xs(this._milliseconds)!==xs(se)?"-":"",ve+"P"+(N?Me+N+"Y":"")+(b?Me+b+"M":"")+(h?Dt+h+"D":"")+(E||S||u?"T":"")+(E?Dn+E+"H":"")+(S?Dn+S+"M":"")+(u?Dn+J+"S":"")):"P0D"}var Fe=vs.prototype;Fe.isValid=ky,Fe.abs=ul,Fe.add=bp,Fe.subtract=gv,Fe.as=yv,Fe.asMilliseconds=lu,Fe.asSeconds=Ao,Fe.asMinutes=gi,Fe.asHours=Sp,Fe.asDays=vv,Fe.asWeeks=fl,Fe.asMonths=bv,Fe.asQuarters=wp,Fe.asYears=Bt,Fe.valueOf=cu,Fe._bubble=au,Fe.clone=_p,Fe.get=pn,Fe.milliseconds=dl,Fe.seconds=Ni,Fe.minutes=Rp,Fe.hours=Qt,Fe.days=uu,Fe.weeks=_v,Fe.months=Sv,Fe.years=wv,Fe.humanize=$o,Fe.toISOString=Cs,Fe.toString=Cs,Fe.toJSON=Cs,Fe.locale=Eo,Fe.localeData=nl,Fe.toIsoString=_("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Cs),Fe.lang=Oo,ce("X",0,0,"unix"),ce("x",0,0,"valueOf"),le("x",fs),le("X",zg),Ke("X",function(u,h,b){b._d=new Date(parseFloat(u)*1e3)}),Ke("x",function(u,h,b){b._d=new Date(qe(u))});return e.version="2.30.1",r(tt),e.fn=te,e.min=Oy,e.max=Iy,e.now=Py,e.utc=y,e.unix=pv,e.months=gp,e.isDate=d,e.locale=An,e.invalid=A,e.duration=rt,e.isMoment=X,e.weekdays=hv,e.parseZone=Jr,e.localeData=qn,e.isDuration=wo,e.monthsShort=yp,e.weekdaysMin=ou,e.defineLocale=Ha,e.updateLocale=mr,e.locales=gr,e.weekdaysShort=mv,e.normalizeUnits=Yt,e.relativeTimeRounding=Rv,e.relativeTimeThreshold=xv,e.calendarFormat=Qa,e.prototype=te,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 sE=F((iE,rh)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof rh<"u"&&rh.exports?rh.exports=e():t.tv4=e()})(iE,function(){Object.keys||(Object.keys=(function(){var T=Object.prototype.hasOwnProperty,_=!{toString:null}.propertyIsEnumerable("toString"),k=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],M=k.length;return function(j){if(typeof j!="object"&&typeof j!="function"||j===null)throw new TypeError("Object.keys called on non-object");var $=[];for(var Y in j)T.call(j,Y)&&$.push(Y);if(_)for(var K=0;K<M;K++)T.call(j,k[K])&&$.push(k[K]);return $}})()),Object.create||(Object.create=(function(){function T(){}return function(_){if(arguments.length!==1)throw new Error("Object.create implementation only accepts one parameter.");return T.prototype=_,new T}})()),Array.isArray||(Array.isArray=function(T){return Object.prototype.toString.call(T)==="[object Array]"}),Array.prototype.indexOf||(Array.prototype.indexOf=function(T){if(this===null)throw new TypeError;var _=Object(this),k=_.length>>>0;if(k===0)return-1;var M=0;if(arguments.length>1&&(M=Number(arguments[1]),M!==M?M=0:M!==0&&M!==1/0&&M!==-1/0&&(M=(M>0||-1)*Math.floor(Math.abs(M)))),M>=k)return-1;for(var j=M>=0?M:Math.max(k-Math.abs(M),0);j<k;j++)if(j in _&&_[j]===T)return j;return-1}),Object.isFrozen||(Object.isFrozen=function(T){for(var _="tv4_test_frozen_key";T.hasOwnProperty(_);)_+=Math.random();try{return T[_]=!0,delete T[_],!1}catch{return!0}});var t={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},e={"*":!0};function r(T){return encodeURI(T).replace(/%25[0-9][0-9]/g,function(_){return"%"+_.substring(3)})}function n(T){var _="";t[T.charAt(0)]&&(_=T.charAt(0),T=T.substring(1));var k="",M="",j=!0,$=!1,Y=!1;_==="+"?j=!1:_==="."?(M=".",k="."):_==="/"?(M="/",k="/"):_==="#"?(M="#",j=!1):_===";"?(M=";",k=";",$=!0,Y=!0):_==="?"?(M="?",k="&",$=!0):_==="&"&&(M="&",k="&",$=!0);for(var K=[],ne=T.split(","),ue=[],et={},_e=0;_e<ne.length;_e++){var he=ne[_e],Ce=null;if(he.indexOf(":")!==-1){var vt=he.split(":");he=vt[0],Ce=parseInt(vt[1],10)}for(var Et={};e[he.charAt(he.length-1)];)Et[he.charAt(he.length-1)]=!0,he=he.substring(0,he.length-1);var ce={truncate:Ce,name:he,suffices:Et};ue.push(ce),et[he]=ce,K.push(he)}var pr=function(ai){for(var Rt="",zr=0,Or=0;Or<ue.length;Or++){var ht=ue[Or],mt=ai(ht.name);if(mt==null||Array.isArray(mt)&&mt.length===0||typeof mt=="object"&&Object.keys(mt).length===0){zr++;continue}if(Or===zr?Rt+=M:Rt+=k||",",Array.isArray(mt)){$&&(Rt+=ht.name+"=");for(var on=0;on<mt.length;on++)on>0&&(Rt+=ht.suffices["*"]&&k||",",ht.suffices["*"]&&$&&(Rt+=ht.name+"=")),Rt+=j?encodeURIComponent(mt[on]).replace(/!/g,"%21"):r(mt[on])}else if(typeof mt=="object"){$&&!ht.suffices["*"]&&(Rt+=ht.name+"=");var oo=!0;for(var Jt in mt)oo||(Rt+=ht.suffices["*"]&&k||","),oo=!1,Rt+=j?encodeURIComponent(Jt).replace(/!/g,"%21"):r(Jt),Rt+=ht.suffices["*"]?"=":",",Rt+=j?encodeURIComponent(mt[Jt]).replace(/!/g,"%21"):r(mt[Jt])}else $&&(Rt+=ht.name,(!Y||mt!=="")&&(Rt+="=")),ht.truncate!=null&&(mt=mt.substring(0,ht.truncate)),Rt+=j?encodeURIComponent(mt).replace(/!/g,"%21"):r(mt)}return Rt};return pr.varNames=K,{prefix:M,substitution:pr}}function i(T){if(!(this instanceof i))return new i(T);for(var _=T.split("{"),k=[_.shift()],M=[],j=[],$=[];_.length>0;){var Y=_.shift(),K=Y.split("}")[0],ne=Y.substring(K.length+1),ue=n(K);j.push(ue.substitution),M.push(ue.prefix),k.push(ne),$=$.concat(ue.substitution.varNames)}this.fill=function(et){for(var _e=k[0],he=0;he<j.length;he++){var Ce=j[he];_e+=Ce(et),_e+=k[he+1]}return _e},this.varNames=$,this.template=T}i.prototype={toString:function(){return this.template},fillFromObject:function(T){return this.fill(function(_){return T[_]})}};var s=function(_,k,M,j,$){if(this.missing=[],this.missingMap={},this.formatValidators=_?Object.create(_.formatValidators):{},this.schemas=_?Object.create(_.schemas):{},this.collectMultiple=k,this.errors=[],this.handleError=k?this.collectError:this.returnError,j&&(this.checkRecursive=!0,this.scanned=[],this.scannedFrozen=[],this.scannedFrozenSchemas=[],this.scannedFrozenValidationErrors=[],this.validatedSchemasKey="tv4_validation_id",this.validationErrorsKey="tv4_validation_errors_id"),$&&(this.trackUnknownProperties=!0,this.knownPropertyPaths={},this.unknownPropertyPaths={}),this.errorReporter=M||w("en"),typeof this.errorReporter=="string")throw new Error("debug");if(this.definedKeywords={},_)for(var Y in _.definedKeywords)this.definedKeywords[Y]=_.definedKeywords[Y].slice(0)};s.prototype.defineKeyword=function(T,_){this.definedKeywords[T]=this.definedKeywords[T]||[],this.definedKeywords[T].push(_)},s.prototype.createError=function(T,_,k,M,j,$,Y){var K=new U(T,_,k,M,j);return K.message=this.errorReporter(K,$,Y),K},s.prototype.returnError=function(T){return T},s.prototype.collectError=function(T){return T&&this.errors.push(T),null},s.prototype.prefixErrors=function(T,_,k){for(var M=T;M<this.errors.length;M++)this.errors[M]=this.errors[M].prefixWith(_,k);return this},s.prototype.banUnknownProperties=function(T,_){for(var k in this.unknownPropertyPaths){var M=this.createError(C.UNKNOWN_PROPERTY,{path:k},k,"",null,T,_),j=this.handleError(M);if(j)return j}return null},s.prototype.addFormat=function(T,_){if(typeof T=="object"){for(var k in T)this.addFormat(k,T[k]);return this}this.formatValidators[T]=_},s.prototype.resolveRefs=function(T,_){if(T.$ref!==void 0){if(_=_||{},_[T.$ref])return this.createError(C.CIRCULAR_REFERENCE,{urls:Object.keys(_).join(", ")},"","",null,void 0,T);_[T.$ref]=!0,T=this.getSchema(T.$ref,_)}return T},s.prototype.getSchema=function(T,_){var k;if(this.schemas[T]!==void 0)return k=this.schemas[T],this.resolveRefs(k,_);var M=T,j="";if(T.indexOf("#")!==-1&&(j=T.substring(T.indexOf("#")+1),M=T.substring(0,T.indexOf("#"))),typeof this.schemas[M]=="object"){k=this.schemas[M];var $=decodeURIComponent(j);if($==="")return this.resolveRefs(k,_);if($.charAt(0)!=="/")return;for(var Y=$.split("/").slice(1),K=0;K<Y.length;K++){var ne=Y[K].replace(/~1/g,"/").replace(/~0/g,"~");if(k[ne]===void 0){k=void 0;break}k=k[ne]}if(k!==void 0)return this.resolveRefs(k,_)}this.missing[M]===void 0&&(this.missing.push(M),this.missing[M]=M,this.missingMap[M]=M)},s.prototype.searchSchemas=function(T,_){if(Array.isArray(T))for(var k=0;k<T.length;k++)this.searchSchemas(T[k],_);else if(T&&typeof T=="object"){typeof T.id=="string"&&B(_,T.id)&&this.schemas[T.id]===void 0&&(this.schemas[T.id]=T);for(var M in T)if(M!=="enum"){if(typeof T[M]=="object")this.searchSchemas(T[M],_);else if(M==="$ref"){var j=g(T[M]);j&&this.schemas[j]===void 0&&this.missingMap[j]===void 0&&(this.missingMap[j]=j)}}}},s.prototype.addSchema=function(T,_){if(typeof T!="string"||typeof _>"u")if(typeof T=="object"&&typeof T.id=="string")_=T,T=_.id;else return;T===g(T)+"#"&&(T=g(T)),this.schemas[T]=_,delete this.missingMap[T],y(_,T),this.searchSchemas(_,T)},s.prototype.getSchemaMap=function(){var T={};for(var _ in this.schemas)T[_]=this.schemas[_];return T},s.prototype.getSchemaUris=function(T){var _=[];for(var k in this.schemas)(!T||T.test(k))&&_.push(k);return _},s.prototype.getMissingUris=function(T){var _=[];for(var k in this.missingMap)(!T||T.test(k))&&_.push(k);return _},s.prototype.dropSchemas=function(){this.schemas={},this.reset()},s.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},s.prototype.validateAll=function(T,_,k,M,j){var $;if(_=this.resolveRefs(_),_){if(_ instanceof U)return this.errors.push(_),_}else return null;var Y=this.errors.length,K,ne=null,ue=null;if(this.checkRecursive&&T&&typeof T=="object"){if($=!this.scanned.length,T[this.validatedSchemasKey]){var et=T[this.validatedSchemasKey].indexOf(_);if(et!==-1)return this.errors=this.errors.concat(T[this.validationErrorsKey][et]),null}if(Object.isFrozen(T)&&(K=this.scannedFrozen.indexOf(T),K!==-1)){var _e=this.scannedFrozenSchemas[K].indexOf(_);if(_e!==-1)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[K][_e]),null}if(this.scanned.push(T),Object.isFrozen(T))K===-1&&(K=this.scannedFrozen.length,this.scannedFrozen.push(T),this.scannedFrozenSchemas.push([])),ne=this.scannedFrozenSchemas[K].length,this.scannedFrozenSchemas[K][ne]=_,this.scannedFrozenValidationErrors[K][ne]=[];else{if(!T[this.validatedSchemasKey])try{Object.defineProperty(T,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(T,this.validationErrorsKey,{value:[],configurable:!0})}catch{T[this.validatedSchemasKey]=[],T[this.validationErrorsKey]=[]}ue=T[this.validatedSchemasKey].length,T[this.validatedSchemasKey][ue]=_,T[this.validationErrorsKey][ue]=[]}}var he=this.errors.length,Ce=this.validateBasic(T,_,j)||this.validateNumeric(T,_,j)||this.validateString(T,_,j)||this.validateArray(T,_,j)||this.validateObject(T,_,j)||this.validateCombinations(T,_,j)||this.validateHypermedia(T,_,j)||this.validateFormat(T,_,j)||this.validateDefinedKeywords(T,_,j)||null;if($){for(;this.scanned.length;){var vt=this.scanned.pop();delete vt[this.validatedSchemasKey]}this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(Ce||he!==this.errors.length)for(;k&&k.length||M&&M.length;){var Et=k&&k.length?""+k.pop():null,ce=M&&M.length?""+M.pop():null;Ce&&(Ce=Ce.prefixWith(Et,ce)),this.prefixErrors(he,Et,ce)}return ne!==null?this.scannedFrozenValidationErrors[K][ne]=this.errors.slice(Y):ue!==null&&(T[this.validationErrorsKey][ue]=this.errors.slice(Y)),this.handleError(Ce)},s.prototype.validateFormat=function(T,_){if(typeof _.format!="string"||!this.formatValidators[_.format])return null;var k=this.formatValidators[_.format].call(null,T,_);return typeof k=="string"||typeof k=="number"?this.createError(C.FORMAT_CUSTOM,{message:k},"","/format",null,T,_):k&&typeof k=="object"?this.createError(C.FORMAT_CUSTOM,{message:k.message||"?"},k.dataPath||"",k.schemaPath||"/format",null,T,_):null},s.prototype.validateDefinedKeywords=function(T,_,k){for(var M in this.definedKeywords)if(!(typeof _[M]>"u"))for(var j=this.definedKeywords[M],$=0;$<j.length;$++){var Y=j[$],K=Y(T,_[M],_,k);if(typeof K=="string"||typeof K=="number")return this.createError(C.KEYWORD_CUSTOM,{key:M,message:K},"","",null,T,_).prefixWith(null,M);if(K&&typeof K=="object"){var ne=K.code;if(typeof ne=="string"){if(!C[ne])throw new Error("Undefined error code (use defineError): "+ne);ne=C[ne]}else typeof ne!="number"&&(ne=C.KEYWORD_CUSTOM);var ue=typeof K.message=="object"?K.message:{key:M,message:K.message||"?"},et=K.schemaPath||"/"+M.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(ne,ue,K.dataPath||null,et,null,T,_)}}return null};function o(T,_){if(T===_)return!0;if(T&&_&&typeof T=="object"&&typeof _=="object"){if(Array.isArray(T)!==Array.isArray(_))return!1;if(Array.isArray(T)){if(T.length!==_.length)return!1;for(var k=0;k<T.length;k++)if(!o(T[k],_[k]))return!1}else{var M;for(M in T)if(_[M]===void 0&&T[M]!==void 0)return!1;for(M in _)if(T[M]===void 0&&_[M]!==void 0)return!1;for(M in T)if(!o(T[M],_[M]))return!1}return!0}return!1}s.prototype.validateBasic=function(_,k,M){var j;return(j=this.validateType(_,k,M))||(j=this.validateEnum(_,k,M))?j.prefixWith(null,"type"):null},s.prototype.validateType=function(_,k){if(k.type===void 0)return null;var M=typeof _;_===null?M="null":Array.isArray(_)&&(M="array");var j=k.type;Array.isArray(j)||(j=[j]);for(var $=0;$<j.length;$++){var Y=j[$];if(Y===M||Y==="integer"&&M==="number"&&_%1===0)return null}return this.createError(C.INVALID_TYPE,{type:M,expected:j.join("/")},"","",null,_,k)},s.prototype.validateEnum=function(_,k){if(k.enum===void 0)return null;for(var M=0;M<k.enum.length;M++){var j=k.enum[M];if(o(_,j))return null}return this.createError(C.ENUM_MISMATCH,{value:typeof JSON<"u"?JSON.stringify(_):_},"","",null,_,k)},s.prototype.validateNumeric=function(_,k,M){return this.validateMultipleOf(_,k,M)||this.validateMinMax(_,k,M)||this.validateNaN(_,k,M)||null};var l=Math.pow(2,-51),f=1-l;s.prototype.validateMultipleOf=function(_,k){var M=k.multipleOf||k.divisibleBy;if(M===void 0)return null;if(typeof _=="number"){var j=_/M%1;if(j>=l&&j<f)return this.createError(C.NUMBER_MULTIPLE_OF,{value:_,multipleOf:M},"","",null,_,k)}return null},s.prototype.validateMinMax=function(_,k){if(typeof _!="number")return null;if(k.minimum!==void 0){if(_<k.minimum)return this.createError(C.NUMBER_MINIMUM,{value:_,minimum:k.minimum},"","/minimum",null,_,k);if(k.exclusiveMinimum&&_===k.minimum)return this.createError(C.NUMBER_MINIMUM_EXCLUSIVE,{value:_,minimum:k.minimum},"","/exclusiveMinimum",null,_,k)}if(k.maximum!==void 0){if(_>k.maximum)return this.createError(C.NUMBER_MAXIMUM,{value:_,maximum:k.maximum},"","/maximum",null,_,k);if(k.exclusiveMaximum&&_===k.maximum)return this.createError(C.NUMBER_MAXIMUM_EXCLUSIVE,{value:_,maximum:k.maximum},"","/exclusiveMaximum",null,_,k)}return null},s.prototype.validateNaN=function(_,k){return typeof _!="number"?null:isNaN(_)===!0||_===1/0||_===-1/0?this.createError(C.NUMBER_NOT_A_NUMBER,{value:_},"","/type",null,_,k):null},s.prototype.validateString=function(_,k,M){return this.validateStringLength(_,k,M)||this.validateStringPattern(_,k,M)||null},s.prototype.validateStringLength=function(_,k){return typeof _!="string"?null:k.minLength!==void 0&&_.length<k.minLength?this.createError(C.STRING_LENGTH_SHORT,{length:_.length,minimum:k.minLength},"","/minLength",null,_,k):k.maxLength!==void 0&&_.length>k.maxLength?this.createError(C.STRING_LENGTH_LONG,{length:_.length,maximum:k.maxLength},"","/maxLength",null,_,k):null},s.prototype.validateStringPattern=function(_,k){if(typeof _!="string"||typeof k.pattern!="string"&&!(k.pattern instanceof RegExp))return null;var M;if(k.pattern instanceof RegExp)M=k.pattern;else{var j,$="",Y=k.pattern.match(/^\/(.+)\/([img]*)$/);Y?(j=Y[1],$=Y[2]):j=k.pattern,M=new RegExp(j,$)}return M.test(_)?null:this.createError(C.STRING_PATTERN,{pattern:k.pattern},"","/pattern",null,_,k)},s.prototype.validateArray=function(_,k,M){return Array.isArray(_)&&(this.validateArrayLength(_,k,M)||this.validateArrayUniqueItems(_,k,M)||this.validateArrayItems(_,k,M))||null},s.prototype.validateArrayLength=function(_,k){var M;return k.minItems!==void 0&&_.length<k.minItems&&(M=this.createError(C.ARRAY_LENGTH_SHORT,{length:_.length,minimum:k.minItems},"","/minItems",null,_,k),this.handleError(M))||k.maxItems!==void 0&&_.length>k.maxItems&&(M=this.createError(C.ARRAY_LENGTH_LONG,{length:_.length,maximum:k.maxItems},"","/maxItems",null,_,k),this.handleError(M))?M:null},s.prototype.validateArrayUniqueItems=function(_,k){if(k.uniqueItems){for(var M=0;M<_.length;M++)for(var j=M+1;j<_.length;j++)if(o(_[M],_[j])){var $=this.createError(C.ARRAY_UNIQUE,{match1:M,match2:j},"","/uniqueItems",null,_,k);if(this.handleError($))return $}}return null},s.prototype.validateArrayItems=function(_,k,M){if(k.items===void 0)return null;var j,$;if(Array.isArray(k.items)){for($=0;$<_.length;$++)if($<k.items.length){if(j=this.validateAll(_[$],k.items[$],[$],["items",$],M+"/"+$))return j}else if(k.additionalItems!==void 0){if(typeof k.additionalItems=="boolean"){if(!k.additionalItems&&(j=this.createError(C.ARRAY_ADDITIONAL_ITEMS,{},"/"+$,"/additionalItems",null,_,k),this.handleError(j)))return j}else if(j=this.validateAll(_[$],k.additionalItems,[$],["additionalItems"],M+"/"+$))return j}}else for($=0;$<_.length;$++)if(j=this.validateAll(_[$],k.items,[$],["items"],M+"/"+$))return j;return null},s.prototype.validateObject=function(_,k,M){return typeof _!="object"||_===null||Array.isArray(_)?null:this.validateObjectMinMaxProperties(_,k,M)||this.validateObjectRequiredProperties(_,k,M)||this.validateObjectProperties(_,k,M)||this.validateObjectDependencies(_,k,M)||null},s.prototype.validateObjectMinMaxProperties=function(_,k){var M=Object.keys(_),j;return k.minProperties!==void 0&&M.length<k.minProperties&&(j=this.createError(C.OBJECT_PROPERTIES_MINIMUM,{propertyCount:M.length,minimum:k.minProperties},"","/minProperties",null,_,k),this.handleError(j))||k.maxProperties!==void 0&&M.length>k.maxProperties&&(j=this.createError(C.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:M.length,maximum:k.maxProperties},"","/maxProperties",null,_,k),this.handleError(j))?j:null},s.prototype.validateObjectRequiredProperties=function(_,k){if(k.required!==void 0)for(var M=0;M<k.required.length;M++){var j=k.required[M];if(_[j]===void 0){var $=this.createError(C.OBJECT_REQUIRED,{key:j},"","/required/"+M,null,_,k);if(this.handleError($))return $}}return null},s.prototype.validateObjectProperties=function(_,k,M){var j;for(var $ in _){var Y=M+"/"+$.replace(/~/g,"~0").replace(/\//g,"~1"),K=!1;if(k.properties!==void 0&&k.properties[$]!==void 0&&(K=!0,j=this.validateAll(_[$],k.properties[$],[$],["properties",$],Y)))return j;if(k.patternProperties!==void 0)for(var ne in k.patternProperties){var ue=new RegExp(ne);if(ue.test($)&&(K=!0,j=this.validateAll(_[$],k.patternProperties[ne],[$],["patternProperties",ne],Y)))return j}if(K)this.trackUnknownProperties&&(this.knownPropertyPaths[Y]=!0,delete this.unknownPropertyPaths[Y]);else if(k.additionalProperties!==void 0){if(this.trackUnknownProperties&&(this.knownPropertyPaths[Y]=!0,delete this.unknownPropertyPaths[Y]),typeof k.additionalProperties=="boolean"){if(!k.additionalProperties&&(j=this.createError(C.OBJECT_ADDITIONAL_PROPERTIES,{key:$},"","/additionalProperties",null,_,k).prefixWith($,null),this.handleError(j)))return j}else if(j=this.validateAll(_[$],k.additionalProperties,[$],["additionalProperties"],Y))return j}else this.trackUnknownProperties&&!this.knownPropertyPaths[Y]&&(this.unknownPropertyPaths[Y]=!0)}return null},s.prototype.validateObjectDependencies=function(_,k,M){var j;if(k.dependencies!==void 0){for(var $ in k.dependencies)if(_[$]!==void 0){var Y=k.dependencies[$];if(typeof Y=="string"){if(_[Y]===void 0&&(j=this.createError(C.OBJECT_DEPENDENCY_KEY,{key:$,missing:Y},"","",null,_,k).prefixWith(null,$).prefixWith(null,"dependencies"),this.handleError(j)))return j}else if(Array.isArray(Y))for(var K=0;K<Y.length;K++){var ne=Y[K];if(_[ne]===void 0&&(j=this.createError(C.OBJECT_DEPENDENCY_KEY,{key:$,missing:ne},"","/"+K,null,_,k).prefixWith(null,$).prefixWith(null,"dependencies"),this.handleError(j)))return j}else if(j=this.validateAll(_,Y,[],["dependencies",$],M))return j}}return null},s.prototype.validateCombinations=function(_,k,M){return this.validateAllOf(_,k,M)||this.validateAnyOf(_,k,M)||this.validateOneOf(_,k,M)||this.validateNot(_,k,M)||null},s.prototype.validateAllOf=function(_,k,M){if(k.allOf===void 0)return null;for(var j,$=0;$<k.allOf.length;$++){var Y=k.allOf[$];if(j=this.validateAll(_,Y,[],["allOf",$],M))return j}return null},s.prototype.validateAnyOf=function(_,k,M){if(k.anyOf===void 0)return null;var j=[],$=this.errors.length,Y,K;this.trackUnknownProperties&&(Y=this.unknownPropertyPaths,K=this.knownPropertyPaths);for(var ne=!0,ue=0;ue<k.anyOf.length;ue++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var et=k.anyOf[ue],_e=this.errors.length,he=this.validateAll(_,et,[],["anyOf",ue],M);if(he===null&&_e===this.errors.length){if(this.errors=this.errors.slice(0,$),this.trackUnknownProperties){for(var Ce in this.knownPropertyPaths)K[Ce]=!0,delete Y[Ce];for(var vt in this.unknownPropertyPaths)K[vt]||(Y[vt]=!0);ne=!1;continue}return null}he&&j.push(he.prefixWith(null,""+ue).prefixWith(null,"anyOf"))}if(this.trackUnknownProperties&&(this.unknownPropertyPaths=Y,this.knownPropertyPaths=K),ne)return j=j.concat(this.errors.slice($)),this.errors=this.errors.slice(0,$),this.createError(C.ANY_OF_MISSING,{},"","/anyOf",j,_,k)},s.prototype.validateOneOf=function(_,k,M){if(k.oneOf===void 0)return null;var j=null,$=[],Y=this.errors.length,K,ne;this.trackUnknownProperties&&(K=this.unknownPropertyPaths,ne=this.knownPropertyPaths);for(var ue=0;ue<k.oneOf.length;ue++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var et=k.oneOf[ue],_e=this.errors.length,he=this.validateAll(_,et,[],["oneOf",ue],M);if(he===null&&_e===this.errors.length){if(j===null)j=ue;else return this.errors=this.errors.slice(0,Y),this.createError(C.ONE_OF_MULTIPLE,{index1:j,index2:ue},"","/oneOf",null,_,k);if(this.trackUnknownProperties){for(var Ce in this.knownPropertyPaths)ne[Ce]=!0,delete K[Ce];for(var vt in this.unknownPropertyPaths)ne[vt]||(K[vt]=!0)}}else he&&$.push(he)}return this.trackUnknownProperties&&(this.unknownPropertyPaths=K,this.knownPropertyPaths=ne),j===null?($=$.concat(this.errors.slice(Y)),this.errors=this.errors.slice(0,Y),this.createError(C.ONE_OF_MISSING,{},"","/oneOf",$,_,k)):(this.errors=this.errors.slice(0,Y),null)},s.prototype.validateNot=function(_,k,M){if(k.not===void 0)return null;var j=this.errors.length,$,Y;this.trackUnknownProperties&&($=this.unknownPropertyPaths,Y=this.knownPropertyPaths,this.unknownPropertyPaths={},this.knownPropertyPaths={});var K=this.validateAll(_,k.not,null,null,M),ne=this.errors.slice(j);return this.errors=this.errors.slice(0,j),this.trackUnknownProperties&&(this.unknownPropertyPaths=$,this.knownPropertyPaths=Y),K===null&&ne.length===0?this.createError(C.NOT_PASSED,{},"","/not",null,_,k):null},s.prototype.validateHypermedia=function(_,k,M){if(!k.links)return null;for(var j,$=0;$<k.links.length;$++){var Y=k.links[$];if(Y.rel==="describedby"){for(var K=new i(Y.href),ne=!0,ue=0;ue<K.varNames.length;ue++)if(!(K.varNames[ue]in _)){ne=!1;break}if(ne){var et=K.fillFromObject(_),_e={$ref:et};if(j=this.validateAll(_,_e,[],["links",$],M))return j}}}};function d(T){var _=String(T).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return _?{href:_[0]||"",protocol:_[1]||"",authority:_[2]||"",host:_[3]||"",hostname:_[4]||"",port:_[5]||"",pathname:_[6]||"",search:_[7]||"",hash:_[8]||""}:null}function m(T,_){function k(M){var j=[];return M.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function($){$==="/.."?j.pop():j.push($)}),j.join("").replace(/^\//,M.charAt(0)==="/"?"/":"")}return _=d(_||""),T=d(T||""),!_||!T?null:(_.protocol||T.protocol)+(_.protocol||_.authority?_.authority:T.authority)+k(_.protocol||_.authority||_.pathname.charAt(0)==="/"?_.pathname:_.pathname?(T.authority&&!T.pathname?"/":"")+T.pathname.slice(0,T.pathname.lastIndexOf("/")+1)+_.pathname:T.pathname)+(_.protocol||_.authority||_.pathname?_.search:_.search||T.search)+_.hash}function g(T){return T.split("#")[0]}function y(T,_){if(T&&typeof T=="object")if(_===void 0?_=T.id:typeof T.id=="string"&&(_=m(_,T.id),T.id=_),Array.isArray(T))for(var k=0;k<T.length;k++)y(T[k],_);else{typeof T.$ref=="string"&&(T.$ref=m(_,T.$ref));for(var M in T)M!=="enum"&&y(T[M],_)}}function w(T){T=T||"en";var _=z[T];return function(k){var M=_[k.code]||A[k.code];if(typeof M!="string")return"Unknown error code "+k.code+": "+JSON.stringify(k.messageParams);var j=k.params;return M.replace(/\{([^{}]*)\}/g,function($,Y){var K=j[Y];return typeof K=="string"||typeof K=="number"?K:$})}}var C={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},R={};for(var P in C)R[C[P]]=P;var A={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 U(T,_,k,M,j){if(Error.call(this),T===void 0)throw new Error("No error code supplied: "+M);this.message="",this.params=_,this.code=T,this.dataPath=k||"",this.schemaPath=M||"",this.subErrors=j||null;var $=new Error(this.message);if(this.stack=$.stack||$.stacktrace,!this.stack)try{throw $}catch(Y){this.stack=Y.stack||Y.stacktrace}}U.prototype=Object.create(Error.prototype),U.prototype.constructor=U,U.prototype.name="ValidationError",U.prototype.prefixWith=function(T,_){if(T!==null&&(T=T.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+T+this.dataPath),_!==null&&(_=_.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+_+this.schemaPath),this.subErrors!==null)for(var k=0;k<this.subErrors.length;k++)this.subErrors[k].prefixWith(T,_);return this};function B(T,_){if(_.substring(0,T.length)===T){var k=_.substring(T.length);if(_.length>0&&_.charAt(T.length-1)==="/"||k.charAt(0)==="#"||k.charAt(0)==="?")return!0}return!1}var z={};function V(T){var _=new s,k,M,j={setErrorReporter:function($){return typeof $=="string"?this.language($):(M=$,!0)},addFormat:function(){_.addFormat.apply(_,arguments)},language:function($){return $?(z[$]||($=$.split("-")[0]),z[$]?(k=$,$):!1):k},addLanguage:function($,Y){var K;for(K in C)Y[K]&&!Y[C[K]]&&(Y[C[K]]=Y[K]);var ne=$.split("-")[0];if(!z[ne])z[$]=Y,z[ne]=Y;else{z[$]=Object.create(z[ne]);for(K in Y)typeof z[ne][K]>"u"&&(z[ne][K]=Y[K]),z[$][K]=Y[K]}return this},freshApi:function($){var Y=V();return $&&Y.language($),Y},validate:function($,Y,K,ne){var ue=w(k),et=M?function(Ce,vt,Et){return M(Ce,vt,Et)||ue(Ce,vt,Et)}:ue,_e=new s(_,!1,et,K,ne);typeof Y=="string"&&(Y={$ref:Y}),_e.addSchema("",Y);var he=_e.validateAll($,Y,null,null,"");return!he&&ne&&(he=_e.banUnknownProperties($,Y)),this.error=he,this.missing=_e.missing,this.valid=he===null,this.valid},validateResult:function(){var $={toString:function(){return this.valid?"valid":this.error.message}};return this.validate.apply($,arguments),$},validateMultiple:function($,Y,K,ne){var ue=w(k),et=M?function(Ce,vt,Et){return M(Ce,vt,Et)||ue(Ce,vt,Et)}:ue,_e=new s(_,!0,et,K,ne);typeof Y=="string"&&(Y={$ref:Y}),_e.addSchema("",Y),_e.validateAll($,Y,null,null,""),ne&&_e.banUnknownProperties($,Y);var he={toString:function(){return this.valid?"valid":this.error.message}};return he.errors=_e.errors,he.missing=_e.missing,he.valid=he.errors.length===0,he},addSchema:function(){return _.addSchema.apply(_,arguments)},getSchema:function(){return _.getSchema.apply(_,arguments)},getSchemaMap:function(){return _.getSchemaMap.apply(_,arguments)},getSchemaUris:function(){return _.getSchemaUris.apply(_,arguments)},getMissingUris:function(){return _.getMissingUris.apply(_,arguments)},dropSchemas:function(){_.dropSchemas.apply(_,arguments)},defineKeyword:function(){_.defineKeyword.apply(_,arguments)},defineError:function($,Y,K){if(typeof $!="string"||!/^[A-Z]+(_[A-Z]+)*$/.test($))throw new Error("Code name must be a string in UPPER_CASE_WITH_UNDERSCORES");if(typeof Y!="number"||Y%1!==0||Y<1e4)throw new Error("Code number must be an integer > 10000");if(typeof C[$]<"u")throw new Error("Error already defined: "+$+" as "+C[$]);if(typeof R[Y]<"u")throw new Error("Error code already used: "+R[Y]+" as "+Y);C[$]=Y,R[Y]=$,A[$]=A[Y]=K;for(var ne in z){var ue=z[ne];ue[$]&&(ue[Y]=ue[Y]||ue[$])}},reset:function(){_.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:y,resolveUrl:m,getDocumentUri:g,errorCodes:C};return j.language(T||"en"),j}var X=V();return X.addLanguage("en-gb",A),X.tv4=X,X})});var $u=F(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.regexpCode=Ge.getEsmExportName=Ge.getProperty=Ge.safeStringify=Ge.stringify=Ge.strConcat=Ge.addCodeArg=Ge.str=Ge._=Ge.nil=Ge._Code=Ge.Name=Ge.IDENTIFIER=Ge._CodeOrName=void 0;var Au=class{};Ge._CodeOrName=Au;Ge.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var zo=class extends Au{constructor(e){if(super(),!Ge.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}}};Ge.Name=zo;var bn=class extends Au{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 zo&&(r[n.str]=(r[n.str]||0)+1),r),{})}};Ge._Code=bn;Ge.nil=new bn("");function oE(t,...e){let r=[t[0]],n=0;for(;n<e.length;)xb(r,e[n]),r.push(t[++n]);return new bn(r)}Ge._=oE;var Rb=new bn("+");function aE(t,...e){let r=[qu(t[0])],n=0;for(;n<e.length;)r.push(Rb),xb(r,e[n]),r.push(Rb,qu(t[++n]));return WL(r),new bn(r)}Ge.str=aE;function xb(t,e){e instanceof bn?t.push(...e._items):e instanceof zo?t.push(e):t.push(YL(e))}Ge.addCodeArg=xb;function WL(t){let e=1;for(;e<t.length-1;){if(t[e]===Rb){let r=zL(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function zL(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof zo||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 zo))return`"${t}${e.slice(1)}`}function JL(t,e){return e.emptyStr()?t:t.emptyStr()?e:aE`${t}${e}`}Ge.strConcat=JL;function YL(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:qu(Array.isArray(t)?t.join(","):t)}function GL(t){return new bn(qu(t))}Ge.stringify=GL;function qu(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Ge.safeStringify=qu;function KL(t){return typeof t=="string"&&Ge.IDENTIFIER.test(t)?new bn(`.${t}`):oE`[${t}]`}Ge.getProperty=KL;function QL(t){if(typeof t=="string"&&Ge.IDENTIFIER.test(t))return new bn(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}Ge.getEsmExportName=QL;function ZL(t){return new bn(t.toString())}Ge.regexpCode=ZL});var Ob=F(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.ValueScope=Nr.ValueScopeName=Nr.Scope=Nr.varKinds=Nr.UsedValueState=void 0;var Mr=$u(),Cb=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},nh;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(nh||(Nr.UsedValueState=nh={}));Nr.varKinds={const:new Mr.Name("const"),let:new Mr.Name("let"),var:new Mr.Name("var")};var ih=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Mr.Name?e:this.name(e)}name(e){return new Mr.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}}};Nr.Scope=ih;var sh=class extends Mr.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Mr._)`.${new Mr.Name(r)}[${n}]`}};Nr.ValueScopeName=sh;var XL=(0,Mr._)`\n`,Eb=class extends ih{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?XL:Mr.nil}}get(){return this._scope}name(e){return new sh(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 m=l.get(o);if(m)return m}else l=this._values[s]=new Map;l.set(o,i);let f=this._scope[s]||(this._scope[s]=[]),d=f.length;return f[d]=r.ref,i.setValue(r,{property:s,itemIndex:d}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Mr._)`${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=Mr.nil;for(let o in e){let l=e[o];if(!l)continue;let f=n[o]=n[o]||new Map;l.forEach(d=>{if(f.has(d))return;f.set(d,nh.Started);let m=r(d);if(m){let g=this.opts.es5?Nr.varKinds.var:Nr.varKinds.const;s=(0,Mr._)`${s}${g} ${d} = ${m};${this.opts._n}`}else if(m=i?.(d))s=(0,Mr._)`${s}${m}${this.opts._n}`;else throw new Cb(d);f.set(d,nh.Completed)})}return s}};Nr.ValueScope=Eb});var Ne=F(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.or=Ae.and=Ae.not=Ae.CodeGen=Ae.operators=Ae.varKinds=Ae.ValueScopeName=Ae.ValueScope=Ae.Scope=Ae.Name=Ae.regexpCode=Ae.stringify=Ae.getProperty=Ae.nil=Ae.strConcat=Ae.str=Ae._=void 0;var Be=$u(),Vn=Ob(),$s=$u();Object.defineProperty(Ae,"_",{enumerable:!0,get:function(){return $s._}});Object.defineProperty(Ae,"str",{enumerable:!0,get:function(){return $s.str}});Object.defineProperty(Ae,"strConcat",{enumerable:!0,get:function(){return $s.strConcat}});Object.defineProperty(Ae,"nil",{enumerable:!0,get:function(){return $s.nil}});Object.defineProperty(Ae,"getProperty",{enumerable:!0,get:function(){return $s.getProperty}});Object.defineProperty(Ae,"stringify",{enumerable:!0,get:function(){return $s.stringify}});Object.defineProperty(Ae,"regexpCode",{enumerable:!0,get:function(){return $s.regexpCode}});Object.defineProperty(Ae,"Name",{enumerable:!0,get:function(){return $s.Name}});var ch=Ob();Object.defineProperty(Ae,"Scope",{enumerable:!0,get:function(){return ch.Scope}});Object.defineProperty(Ae,"ValueScope",{enumerable:!0,get:function(){return ch.ValueScope}});Object.defineProperty(Ae,"ValueScopeName",{enumerable:!0,get:function(){return ch.ValueScopeName}});Object.defineProperty(Ae,"varKinds",{enumerable:!0,get:function(){return ch.varKinds}});Ae.operators={GT:new Be._Code(">"),GTE:new Be._Code(">="),LT:new Be._Code("<"),LTE:new Be._Code("<="),EQ:new Be._Code("==="),NEQ:new Be._Code("!=="),NOT:new Be._Code("!"),OR:new Be._Code("||"),AND:new Be._Code("&&"),ADD:new Be._Code("+")};var Ji=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},Ib=class extends Ji{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Vn.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=El(this.rhs,e,r)),this}get names(){return this.rhs instanceof Be._CodeOrName?this.rhs.names:{}}},oh=class extends Ji{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 Be.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=El(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Be.Name?{}:{...this.lhs.names};return lh(e,this.rhs)}},Pb=class extends oh{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},kb=class extends Ji{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Tb=class extends Ji{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Ab=class extends Ji{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},qb=class extends Ji{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=El(this.code,e,r),this}get names(){return this.code instanceof Be._CodeOrName?this.code.names:{}}},Mu=class extends Ji{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)||(ej(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Go(e,r.names),{})}},Yi=class extends Mu{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},$b=class extends Mu{},Cl=class extends Yi{};Cl.kind="else";var Jo=class t extends Yi{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 Cl(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(lE(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=El(this.condition,e,r),this}get names(){let e=super.names;return lh(e,this.condition),this.else&&Go(e,this.else.names),e}};Jo.kind="if";var Yo=class extends Yi{};Yo.kind="for";var Mb=class extends Yo{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=El(this.iteration,e,r),this}get names(){return Go(super.names,this.iteration.names)}},Nb=class extends Yo{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?Vn.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=lh(super.names,this.from);return lh(e,this.to)}},ah=class extends Yo{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=El(this.iterable,e,r),this}get names(){return Go(super.names,this.iterable.names)}},Nu=class extends Yi{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)}};Nu.kind="func";var Du=class extends Mu{render(e){return"return "+super.render(e)}};Du.kind="return";var Db=class extends Yi{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&&Go(e,this.catch.names),this.finally&&Go(e,this.finally.names),e}},Fu=class extends Yi{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Fu.kind="catch";var Lu=class extends Yi{render(e){return"finally"+super.render(e)}};Lu.kind="finally";var Fb=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
24
|
-
`:""},this._extScope=e,this._scope=new Vn.Scope({parent:e}),this._nodes=[new $b]}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 Ib(e,s,n)),s}const(e,r,n){return this._def(Vn.varKinds.const,e,r,n)}let(e,r,n){return this._def(Vn.varKinds.let,e,r,n)}var(e,r,n){return this._def(Vn.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new oh(e,r,n))}add(e,r){return this._leafNode(new Pb(e,Ae.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Be.nil&&this._leafNode(new qb(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,Be.addCodeArg)(r,i));return r.push("}"),new Be._Code(r)}if(e,r,n){if(this._blockNode(new Jo(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 Jo(e))}else(){return this._elseNode(new Cl)}endIf(){return this._endBlockNode(Jo,Cl)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Mb(e),r)}forRange(e,r,n,i,s=this.opts.es5?Vn.varKinds.var:Vn.varKinds.let){let o=this._scope.toName(e);return this._for(new Nb(s,o,r,n),()=>i(o))}forOf(e,r,n,i=Vn.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=r instanceof Be.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Be._)`${o}.length`,l=>{this.var(s,(0,Be._)`${o}[${l}]`),n(s)})}return this._for(new ah("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?Vn.varKinds.var:Vn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Be._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new ah("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(Yo)}label(e){return this._leafNode(new kb(e))}break(e){return this._leafNode(new Tb(e))}return(e){let r=new Du;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Du)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new Db;if(this._blockNode(i),this.code(e),r){let s=this.name("e");this._currNode=i.catch=new Fu(s),r(s)}return n&&(this._currNode=i.finally=new Lu,this.code(n)),this._endBlockNode(Fu,Lu)}throw(e){return this._leafNode(new Ab(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=Be.nil,n,i){return this._blockNode(new Nu(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Nu)}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 Jo))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}};Ae.CodeGen=Fb;function Go(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function lh(t,e){return e instanceof Be._CodeOrName?Go(t,e.names):t}function El(t,e,r){if(t instanceof Be.Name)return n(t);if(!i(t))return t;return new Be._Code(t._items.reduce((s,o)=>(o instanceof Be.Name&&(o=n(o)),o instanceof Be._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 Be._Code&&s._items.some(o=>o instanceof Be.Name&&e[o.str]===1&&r[o.str]!==void 0)}}function ej(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function lE(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Be._)`!${Lb(t)}`}Ae.not=lE;var tj=cE(Ae.operators.AND);function rj(...t){return t.reduce(tj)}Ae.and=rj;var nj=cE(Ae.operators.OR);function ij(...t){return t.reduce(nj)}Ae.or=ij;function cE(t){return(e,r)=>e===Be.nil?r:r===Be.nil?e:(0,Be._)`${Lb(e)} ${t} ${Lb(r)}`}function Lb(t){return t instanceof Be.Name?t:(0,Be._)`(${t})`}});var We=F(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.checkStrictMode=De.getErrorPath=De.Type=De.useFunc=De.setEvaluated=De.evaluatedPropsToName=De.mergeEvaluated=De.eachItem=De.unescapeJsonPointer=De.escapeJsonPointer=De.escapeFragment=De.unescapeFragment=De.schemaRefOrVal=De.schemaHasRulesButRef=De.schemaHasRules=De.checkUnknownRules=De.alwaysValidSchema=De.toHash=void 0;var pt=Ne(),sj=$u();function oj(t){let e={};for(let r of t)e[r]=!0;return e}De.toHash=oj;function aj(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(dE(t,e),!pE(e,t.self.RULES.all))}De.alwaysValidSchema=aj;function dE(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]||gE(t,`unknown keyword: "${s}"`)}De.checkUnknownRules=dE;function pE(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}De.schemaHasRules=pE;function lj(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}De.schemaHasRulesButRef=lj;function cj({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,pt._)`${r}`}return(0,pt._)`${t}${e}${(0,pt.getProperty)(n)}`}De.schemaRefOrVal=cj;function uj(t){return hE(decodeURIComponent(t))}De.unescapeFragment=uj;function fj(t){return encodeURIComponent(Ub(t))}De.escapeFragment=fj;function Ub(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}De.escapeJsonPointer=Ub;function hE(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}De.unescapeJsonPointer=hE;function dj(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}De.eachItem=dj;function uE({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,s,o,l)=>{let f=o===void 0?s:o instanceof pt.Name?(s instanceof pt.Name?t(i,s,o):e(i,s,o),o):s instanceof pt.Name?(e(i,o,s),s):r(s,o);return l===pt.Name&&!(f instanceof pt.Name)?n(i,f):f}}De.mergeEvaluated={props:uE({mergeNames:(t,e,r)=>t.if((0,pt._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,pt._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,pt._)`${r} || {}`).code((0,pt._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,pt._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,pt._)`${r} || {}`),Hb(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:mE}),items:uE({mergeNames:(t,e,r)=>t.if((0,pt._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,pt._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,pt._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,pt._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function mE(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,pt._)`{}`);return e!==void 0&&Hb(t,r,e),r}De.evaluatedPropsToName=mE;function Hb(t,e,r){Object.keys(r).forEach(n=>t.assign((0,pt._)`${e}${(0,pt.getProperty)(n)}`,!0))}De.setEvaluated=Hb;var fE={};function pj(t,e){return t.scopeValue("func",{ref:e,code:fE[e.code]||(fE[e.code]=new sj._Code(e.code))})}De.useFunc=pj;var jb;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(jb||(De.Type=jb={}));function hj(t,e,r){if(t instanceof pt.Name){let n=e===jb.Num;return r?n?(0,pt._)`"[" + ${t} + "]"`:(0,pt._)`"['" + ${t} + "']"`:n?(0,pt._)`"/" + ${t}`:(0,pt._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,pt.getProperty)(t).toString():"/"+Ub(t)}De.getErrorPath=hj;function gE(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}De.checkStrictMode=gE});var Gi=F(Bb=>{"use strict";Object.defineProperty(Bb,"__esModule",{value:!0});var or=Ne(),mj={data:new or.Name("data"),valCxt:new or.Name("valCxt"),instancePath:new or.Name("instancePath"),parentData:new or.Name("parentData"),parentDataProperty:new or.Name("parentDataProperty"),rootData:new or.Name("rootData"),dynamicAnchors:new or.Name("dynamicAnchors"),vErrors:new or.Name("vErrors"),errors:new or.Name("errors"),this:new or.Name("this"),self:new or.Name("self"),scope:new or.Name("scope"),json:new or.Name("json"),jsonPos:new or.Name("jsonPos"),jsonLen:new or.Name("jsonLen"),jsonPart:new or.Name("jsonPart")};Bb.default=mj});var ju=F(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.extendErrors=ar.resetErrorsCount=ar.reportExtraError=ar.reportError=ar.keyword$DataError=ar.keywordError=void 0;var ze=Ne(),uh=We(),xr=Gi();ar.keywordError={message:({keyword:t})=>(0,ze.str)`must pass "${t}" keyword validation`};ar.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,ze.str)`"${t}" keyword must be ${e} ($data)`:(0,ze.str)`"${t}" keyword is invalid ($data)`};function gj(t,e=ar.keywordError,r,n){let{it:i}=t,{gen:s,compositeRule:o,allErrors:l}=i,f=bE(t,e,r);n??(o||l)?yE(s,f):vE(i,(0,ze._)`[${f}]`)}ar.reportError=gj;function yj(t,e=ar.keywordError,r){let{it:n}=t,{gen:i,compositeRule:s,allErrors:o}=n,l=bE(t,e,r);yE(i,l),s||o||vE(n,xr.default.vErrors)}ar.reportExtraError=yj;function vj(t,e){t.assign(xr.default.errors,e),t.if((0,ze._)`${xr.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,ze._)`${xr.default.vErrors}.length`,e),()=>t.assign(xr.default.vErrors,null)))}ar.resetErrorsCount=vj;function bj({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,xr.default.errors,l=>{t.const(o,(0,ze._)`${xr.default.vErrors}[${l}]`),t.if((0,ze._)`${o}.instancePath === undefined`,()=>t.assign((0,ze._)`${o}.instancePath`,(0,ze.strConcat)(xr.default.instancePath,s.errorPath))),t.assign((0,ze._)`${o}.schemaPath`,(0,ze.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,ze._)`${o}.schema`,r),t.assign((0,ze._)`${o}.data`,n))})}ar.extendErrors=bj;function yE(t,e){let r=t.const("err",e);t.if((0,ze._)`${xr.default.vErrors} === null`,()=>t.assign(xr.default.vErrors,(0,ze._)`[${r}]`),(0,ze._)`${xr.default.vErrors}.push(${r})`),t.code((0,ze._)`${xr.default.errors}++`)}function vE(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,ze._)`new ${t.ValidationError}(${e})`):(r.assign((0,ze._)`${n}.errors`,e),r.return(!1))}var Ko={keyword:new ze.Name("keyword"),schemaPath:new ze.Name("schemaPath"),params:new ze.Name("params"),propertyName:new ze.Name("propertyName"),message:new ze.Name("message"),schema:new ze.Name("schema"),parentSchema:new ze.Name("parentSchema")};function bE(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,ze._)`{}`:Sj(t,e,r)}function Sj(t,e,r={}){let{gen:n,it:i}=t,s=[wj(i,r),_j(t,r)];return Rj(t,e,s),n.object(...s)}function wj({errorPath:t},{instancePath:e}){let r=e?(0,ze.str)`${t}${(0,uh.getErrorPath)(e,uh.Type.Str)}`:t;return[xr.default.instancePath,(0,ze.strConcat)(xr.default.instancePath,r)]}function _j({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,ze.str)`${e}/${t}`;return r&&(i=(0,ze.str)`${i}${(0,uh.getErrorPath)(r,uh.Type.Str)}`),[Ko.schemaPath,i]}function Rj(t,{params:e,message:r},n){let{keyword:i,data:s,schemaValue:o,it:l}=t,{opts:f,propertyName:d,topSchemaRef:m,schemaPath:g}=l;n.push([Ko.keyword,i],[Ko.params,typeof e=="function"?e(t):e||(0,ze._)`{}`]),f.messages&&n.push([Ko.message,typeof r=="function"?r(t):r]),f.verbose&&n.push([Ko.schema,o],[Ko.parentSchema,(0,ze._)`${m}${g}`],[xr.default.data,s]),d&&n.push([Ko.propertyName,d])}});var wE=F(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.boolOrEmptySchema=Ol.topBoolOrEmptySchema=void 0;var xj=ju(),Cj=Ne(),Ej=Gi(),Oj={message:"boolean schema is false"};function Ij(t){let{gen:e,schema:r,validateName:n}=t;r===!1?SE(t,!1):typeof r=="object"&&r.$async===!0?e.return(Ej.default.data):(e.assign((0,Cj._)`${n}.errors`,null),e.return(!0))}Ol.topBoolOrEmptySchema=Ij;function Pj(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),SE(t)):r.var(e,!0)}Ol.boolOrEmptySchema=Pj;function SE(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,xj.reportError)(i,Oj,void 0,e)}});var Vb=F(Il=>{"use strict";Object.defineProperty(Il,"__esModule",{value:!0});Il.getRules=Il.isJSONType=void 0;var kj=["string","number","integer","boolean","null","object","array"],Tj=new Set(kj);function Aj(t){return typeof t=="string"&&Tj.has(t)}Il.isJSONType=Aj;function qj(){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:{}}}Il.getRules=qj});var Wb=F(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.shouldUseRule=Ms.shouldUseGroup=Ms.schemaHasRulesForType=void 0;function $j({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&_E(t,n)}Ms.schemaHasRulesForType=$j;function _E(t,e){return e.rules.some(r=>RE(t,r))}Ms.shouldUseGroup=_E;function RE(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))}Ms.shouldUseRule=RE});var Uu=F(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.reportTypeError=lr.checkDataTypes=lr.checkDataType=lr.coerceAndCheckDataType=lr.getJSONTypes=lr.getSchemaTypes=lr.DataType=void 0;var Mj=Vb(),Nj=Wb(),Dj=ju(),Oe=Ne(),xE=We(),Pl;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Pl||(lr.DataType=Pl={}));function Fj(t){let e=CE(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}lr.getSchemaTypes=Fj;function CE(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(Mj.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}lr.getJSONTypes=CE;function Lj(t,e){let{gen:r,data:n,opts:i}=t,s=jj(e,i.coerceTypes),o=e.length>0&&!(s.length===0&&e.length===1&&(0,Nj.schemaHasRulesForType)(t,e[0]));if(o){let l=Jb(e,n,i.strictNumbers,Pl.Wrong);r.if(l,()=>{s.length?Uj(t,e,s):Yb(t)})}return o}lr.coerceAndCheckDataType=Lj;var EE=new Set(["string","number","integer","boolean","null"]);function jj(t,e){return e?t.filter(r=>EE.has(r)||e==="array"&&r==="array"):[]}function Uj(t,e,r){let{gen:n,data:i,opts:s}=t,o=n.let("dataType",(0,Oe._)`typeof ${i}`),l=n.let("coerced",(0,Oe._)`undefined`);s.coerceTypes==="array"&&n.if((0,Oe._)`${o} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,Oe._)`${i}[0]`).assign(o,(0,Oe._)`typeof ${i}`).if(Jb(e,i,s.strictNumbers),()=>n.assign(l,i))),n.if((0,Oe._)`${l} !== undefined`);for(let d of r)(EE.has(d)||d==="array"&&s.coerceTypes==="array")&&f(d);n.else(),Yb(t),n.endIf(),n.if((0,Oe._)`${l} !== undefined`,()=>{n.assign(i,l),Hj(t,l)});function f(d){switch(d){case"string":n.elseIf((0,Oe._)`${o} == "number" || ${o} == "boolean"`).assign(l,(0,Oe._)`"" + ${i}`).elseIf((0,Oe._)`${i} === null`).assign(l,(0,Oe._)`""`);return;case"number":n.elseIf((0,Oe._)`${o} == "boolean" || ${i} === null
|
|
25
|
-
|| (${
|
|
26
|
-
|| (${
|
|
27
|
-
|| ${o} === "boolean" || ${i} === null`).assign(l,(0,Oe._)`[${i}]`)}}}function Hj({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Oe._)`${e} !== undefined`,()=>t.assign((0,Oe._)`${e}[${r}]`,n))}function zb(t,e,r,n=Pl.Correct){let i=n===Pl.Correct?Oe.operators.EQ:Oe.operators.NEQ,s;switch(t){case"null":return(0,Oe._)`${e} ${i} null`;case"array":s=(0,Oe._)`Array.isArray(${e})`;break;case"object":s=(0,Oe._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=o((0,Oe._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=o();break;default:return(0,Oe._)`typeof ${e} ${i} ${t}`}return n===Pl.Correct?s:(0,Oe.not)(s);function o(l=Oe.nil){return(0,Oe.and)((0,Oe._)`typeof ${e} == "number"`,l,r?(0,Oe._)`isFinite(${e})`:Oe.nil)}}lr.checkDataType=zb;function Jb(t,e,r,n){if(t.length===1)return zb(t[0],e,r,n);let i,s=(0,xE.toHash)(t);if(s.array&&s.object){let o=(0,Oe._)`typeof ${e} != "object"`;i=s.null?o:(0,Oe._)`!${e} || ${o}`,delete s.null,delete s.array,delete s.object}else i=Oe.nil;s.number&&delete s.integer;for(let o in s)i=(0,Oe.and)(i,zb(o,e,r,n));return i}lr.checkDataTypes=Jb;var Bj={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Oe._)`{type: ${t}}`:(0,Oe._)`{type: ${e}}`};function Yb(t){let e=Vj(t);(0,Dj.reportError)(e,Bj)}lr.reportTypeError=Yb;function Vj(t){let{gen:e,data:r,schema:n}=t,i=(0,xE.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var IE=F(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:!0});fh.assignDefaults=void 0;var kl=Ne(),Wj=We();function zj(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)OE(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>OE(t,s,i.default))}fh.assignDefaults=zj;function OE(t,e,r){let{gen:n,compositeRule:i,data:s,opts:o}=t;if(r===void 0)return;let l=(0,kl._)`${s}${(0,kl.getProperty)(e)}`;if(i){(0,Wj.checkStrictMode)(t,`default is ignored for: ${l}`);return}let f=(0,kl._)`${l} === undefined`;o.useDefaults==="empty"&&(f=(0,kl._)`${f} || ${l} === null || ${l} === ""`),n.if(f,(0,kl._)`${l} = ${(0,kl.stringify)(r)}`)}});var Sn=F(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.validateUnion=ct.validateArray=ct.usePattern=ct.callValidateCode=ct.schemaProperties=ct.allSchemaProperties=ct.noPropertyInData=ct.propertyInData=ct.isOwnProperty=ct.hasPropFunc=ct.reportMissingProp=ct.checkMissingProp=ct.checkReportMissingProp=void 0;var bt=Ne(),Gb=We(),Ns=Gi(),Jj=We();function Yj(t,e){let{gen:r,data:n,it:i}=t;r.if(Qb(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,bt._)`${e}`},!0),t.error()})}ct.checkReportMissingProp=Yj;function Gj({gen:t,data:e,it:{opts:r}},n,i){return(0,bt.or)(...n.map(s=>(0,bt.and)(Qb(t,e,s,r.ownProperties),(0,bt._)`${i} = ${s}`)))}ct.checkMissingProp=Gj;function Kj(t,e){t.setParams({missingProperty:e},!0),t.error()}ct.reportMissingProp=Kj;function PE(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,bt._)`Object.prototype.hasOwnProperty`})}ct.hasPropFunc=PE;function Kb(t,e,r){return(0,bt._)`${PE(t)}.call(${e}, ${r})`}ct.isOwnProperty=Kb;function Qj(t,e,r,n){let i=(0,bt._)`${e}${(0,bt.getProperty)(r)} !== undefined`;return n?(0,bt._)`${i} && ${Kb(t,e,r)}`:i}ct.propertyInData=Qj;function Qb(t,e,r,n){let i=(0,bt._)`${e}${(0,bt.getProperty)(r)} === undefined`;return n?(0,bt.or)(i,(0,bt.not)(Kb(t,e,r))):i}ct.noPropertyInData=Qb;function kE(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}ct.allSchemaProperties=kE;function Zj(t,e){return kE(e).filter(r=>!(0,Gb.alwaysValidSchema)(t,e[r]))}ct.schemaProperties=Zj;function Xj({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:o},l,f,d){let m=d?(0,bt._)`${t}, ${e}, ${n}${i}`:e,g=[[Ns.default.instancePath,(0,bt.strConcat)(Ns.default.instancePath,s)],[Ns.default.parentData,o.parentData],[Ns.default.parentDataProperty,o.parentDataProperty],[Ns.default.rootData,Ns.default.rootData]];o.opts.dynamicRef&&g.push([Ns.default.dynamicAnchors,Ns.default.dynamicAnchors]);let y=(0,bt._)`${m}, ${r.object(...g)}`;return f!==bt.nil?(0,bt._)`${l}.call(${f}, ${y})`:(0,bt._)`${l}(${y})`}ct.callValidateCode=Xj;var e2=(0,bt._)`new RegExp`;function t2({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,bt._)`${i.code==="new RegExp"?e2:(0,Jj.useFunc)(t,i)}(${r}, ${n})`})}ct.usePattern=t2;function r2(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,bt._)`${r}.length`);e.forRange("i",0,f,d=>{t.subschema({keyword:n,dataProp:d,dataPropType:Gb.Type.Num},s),e.if((0,bt.not)(s),l)})}}ct.validateArray=r2;function n2(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,Gb.alwaysValidSchema)(i,f))&&!i.opts.unevaluated)return;let o=e.let("valid",!1),l=e.name("_valid");e.block(()=>r.forEach((f,d)=>{let m=t.subschema({keyword:n,schemaProp:d,compositeRule:!0},l);e.assign(o,(0,bt._)`${o} || ${l}`),t.mergeValidEvaluated(m,l)||e.if((0,bt.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}ct.validateUnion=n2});var qE=F(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.validateKeywordUsage=vi.validSchemaType=vi.funcKeywordCode=vi.macroKeywordCode=void 0;var Cr=Ne(),Qo=Gi(),i2=Sn(),s2=ju();function o2(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:o}=t,l=e.macro.call(o.self,i,s,o),f=AE(r,n,l);o.opts.validateSchema!==!1&&o.self.validateSchema(l,!0);let d=r.name("valid");t.subschema({schema:l,schemaPath:Cr.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:f,compositeRule:!0},d),t.pass(d,()=>t.error(!0))}vi.macroKeywordCode=o2;function a2(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:o,$data:l,it:f}=t;c2(f,e);let d=!l&&e.compile?e.compile.call(f.self,s,o,f):e.validate,m=AE(n,i,d),g=n.let("valid");t.block$data(g,y),t.ok((r=e.valid)!==null&&r!==void 0?r:g);function y(){if(e.errors===!1)R(),e.modifying&&TE(t),P(()=>t.error());else{let A=e.async?w():C();e.modifying&&TE(t),P(()=>l2(t,A))}}function w(){let A=n.let("ruleErrs",null);return n.try(()=>R((0,Cr._)`await `),U=>n.assign(g,!1).if((0,Cr._)`${U} instanceof ${f.ValidationError}`,()=>n.assign(A,(0,Cr._)`${U}.errors`),()=>n.throw(U))),A}function C(){let A=(0,Cr._)`${m}.errors`;return n.assign(A,null),R(Cr.nil),A}function R(A=e.async?(0,Cr._)`await `:Cr.nil){let U=f.opts.passContext?Qo.default.this:Qo.default.self,B=!("compile"in e&&!l||e.schema===!1);n.assign(g,(0,Cr._)`${A}${(0,i2.callValidateCode)(t,m,U,B)}`,e.modifying)}function P(A){var U;n.if((0,Cr.not)((U=e.valid)!==null&&U!==void 0?U:g),A)}}vi.funcKeywordCode=a2;function TE(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Cr._)`${n.parentData}[${n.parentDataProperty}]`))}function l2(t,e){let{gen:r}=t;r.if((0,Cr._)`Array.isArray(${e})`,()=>{r.assign(Qo.default.vErrors,(0,Cr._)`${Qo.default.vErrors} === null ? ${e} : ${Qo.default.vErrors}.concat(${e})`).assign(Qo.default.errors,(0,Cr._)`${Qo.default.vErrors}.length`),(0,s2.extendErrors)(t)},()=>t.error())}function c2({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function AE(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,Cr.stringify)(r)})}function u2(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")}vi.validSchemaType=u2;function f2({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)}}vi.validateKeywordUsage=f2});var ME=F(Ds=>{"use strict";Object.defineProperty(Ds,"__esModule",{value:!0});Ds.extendSubschemaMode=Ds.extendSubschemaData=Ds.getSubschema=void 0;var bi=Ne(),$E=We();function d2(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,bi._)`${t.schemaPath}${(0,bi.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,bi._)`${t.schemaPath}${(0,bi.getProperty)(e)}${(0,bi.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,$E.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')}Ds.getSubschema=d2;function p2(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:o}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:l}=e;if(r!==void 0){let{errorPath:d,dataPathArr:m,opts:g}=e,y=l.let("data",(0,bi._)`${e.data}${(0,bi.getProperty)(r)}`,!0);f(y),t.errorPath=(0,bi.str)`${d}${(0,$E.getErrorPath)(r,n,g.jsPropertySyntax)}`,t.parentDataProperty=(0,bi._)`${r}`,t.dataPathArr=[...m,t.parentDataProperty]}if(i!==void 0){let d=i instanceof bi.Name?i:l.let("data",i,!0);f(d),o!==void 0&&(t.propertyName=o)}s&&(t.dataTypes=s);function f(d){t.data=d,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,d]}}Ds.extendSubschemaData=p2;function h2(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}Ds.extendSubschemaMode=h2});var Zb=F((T5,NE)=>{"use strict";NE.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 FE=F((A5,DE)=>{"use strict";var Fs=DE.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(){};dh(e,n,i,t,"",t)};Fs.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Fs.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Fs.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Fs.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 dh(t,e,r,n,i,s,o,l,f,d){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,o,l,f,d);for(var m in n){var g=n[m];if(Array.isArray(g)){if(m in Fs.arrayKeywords)for(var y=0;y<g.length;y++)dh(t,e,r,g[y],i+"/"+m+"/"+y,s,i,m,n,y)}else if(m in Fs.propsKeywords){if(g&&typeof g=="object")for(var w in g)dh(t,e,r,g[w],i+"/"+m+"/"+m2(w),s,i,m,n,w)}else(m in Fs.keywords||t.allKeys&&!(m in Fs.skipKeywords))&&dh(t,e,r,g,i+"/"+m,s,i,m,n)}r(n,i,s,o,l,f,d)}}function m2(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Hu=F(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.getSchemaRefs=Dr.resolveUrl=Dr.normalizeId=Dr._getFullPath=Dr.getFullPath=Dr.inlineRef=void 0;var g2=We(),y2=Zb(),v2=FE(),b2=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function S2(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Xb(t):e?LE(t)<=e:!1}Dr.inlineRef=S2;var w2=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Xb(t){for(let e in t){if(w2.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Xb)||typeof r=="object"&&Xb(r))return!0}return!1}function LE(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!b2.has(r)&&(typeof t[r]=="object"&&(0,g2.eachItem)(t[r],n=>e+=LE(n)),e===1/0))return 1/0}return e}function jE(t,e="",r){r!==!1&&(e=Tl(e));let n=t.parse(e);return UE(t,n)}Dr.getFullPath=jE;function UE(t,e){return t.serialize(e).split("#")[0]+"#"}Dr._getFullPath=UE;var _2=/#\/?$/;function Tl(t){return t?t.replace(_2,""):""}Dr.normalizeId=Tl;function R2(t,e,r){return r=Tl(r),t.resolve(e,r)}Dr.resolveUrl=R2;var x2=/^[a-z_][-a-z0-9._]*$/i;function C2(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=Tl(t[r]||e),s={"":i},o=jE(n,i,!1),l={},f=new Set;return v2(t,{allKeys:!0},(g,y,w,C)=>{if(C===void 0)return;let R=o+y,P=s[C];typeof g[r]=="string"&&(P=A.call(this,g[r])),U.call(this,g.$anchor),U.call(this,g.$dynamicAnchor),s[y]=P;function A(B){let z=this.opts.uriResolver.resolve;if(B=Tl(P?z(P,B):B),f.has(B))throw m(B);f.add(B);let V=this.refs[B];return typeof V=="string"&&(V=this.refs[V]),typeof V=="object"?d(g,V.schema,B):B!==Tl(R)&&(B[0]==="#"?(d(g,l[B],B),l[B]=g):this.refs[B]=R),B}function U(B){if(typeof B=="string"){if(!x2.test(B))throw new Error(`invalid anchor "${B}"`);A.call(this,`#${B}`)}}}),l;function d(g,y,w){if(y!==void 0&&!y2(g,y))throw m(w)}function m(g){return new Error(`reference "${g}" resolves to more than one schema`)}}Dr.getSchemaRefs=C2});var Wu=F(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.getData=Ls.KeywordCxt=Ls.validateFunctionCode=void 0;var zE=wE(),HE=Uu(),tS=Wb(),ph=Uu(),E2=IE(),Vu=qE(),eS=ME(),pe=Ne(),Se=Gi(),O2=Hu(),Ki=We(),Bu=ju();function I2(t){if(GE(t)&&(KE(t),YE(t))){T2(t);return}JE(t,()=>(0,zE.topBoolOrEmptySchema)(t))}Ls.validateFunctionCode=I2;function JE({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,pe._)`${Se.default.data}, ${Se.default.valCxt}`,n.$async,()=>{t.code((0,pe._)`"use strict"; ${BE(r,i)}`),k2(t,i),t.code(s)}):t.func(e,(0,pe._)`${Se.default.data}, ${P2(i)}`,n.$async,()=>t.code(BE(r,i)).code(s))}function P2(t){return(0,pe._)`{${Se.default.instancePath}="", ${Se.default.parentData}, ${Se.default.parentDataProperty}, ${Se.default.rootData}=${Se.default.data}${t.dynamicRef?(0,pe._)`, ${Se.default.dynamicAnchors}={}`:pe.nil}}={}`}function k2(t,e){t.if(Se.default.valCxt,()=>{t.var(Se.default.instancePath,(0,pe._)`${Se.default.valCxt}.${Se.default.instancePath}`),t.var(Se.default.parentData,(0,pe._)`${Se.default.valCxt}.${Se.default.parentData}`),t.var(Se.default.parentDataProperty,(0,pe._)`${Se.default.valCxt}.${Se.default.parentDataProperty}`),t.var(Se.default.rootData,(0,pe._)`${Se.default.valCxt}.${Se.default.rootData}`),e.dynamicRef&&t.var(Se.default.dynamicAnchors,(0,pe._)`${Se.default.valCxt}.${Se.default.dynamicAnchors}`)},()=>{t.var(Se.default.instancePath,(0,pe._)`""`),t.var(Se.default.parentData,(0,pe._)`undefined`),t.var(Se.default.parentDataProperty,(0,pe._)`undefined`),t.var(Se.default.rootData,Se.default.data),e.dynamicRef&&t.var(Se.default.dynamicAnchors,(0,pe._)`{}`)})}function T2(t){let{schema:e,opts:r,gen:n}=t;JE(t,()=>{r.$comment&&e.$comment&&ZE(t),N2(t),n.let(Se.default.vErrors,null),n.let(Se.default.errors,0),r.unevaluated&&A2(t),QE(t),L2(t)})}function A2(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,pe._)`${r}.evaluated`),e.if((0,pe._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,pe._)`${t.evaluated}.props`,(0,pe._)`undefined`)),e.if((0,pe._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,pe._)`${t.evaluated}.items`,(0,pe._)`undefined`))}function BE(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,pe._)`/*# sourceURL=${r} */`:pe.nil}function q2(t,e){if(GE(t)&&(KE(t),YE(t))){$2(t,e);return}(0,zE.boolOrEmptySchema)(t,e)}function YE({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 GE(t){return typeof t.schema!="boolean"}function $2(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&ZE(t),D2(t),F2(t);let s=n.const("_errs",Se.default.errors);QE(t,s),n.var(e,(0,pe._)`${s} === ${Se.default.errors}`)}function KE(t){(0,Ki.checkUnknownRules)(t),M2(t)}function QE(t,e){if(t.opts.jtd)return VE(t,[],!1,e);let r=(0,HE.getSchemaTypes)(t.schema),n=(0,HE.coerceAndCheckDataType)(t,r);VE(t,r,!n,e)}function M2(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Ki.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function N2(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Ki.checkStrictMode)(t,"default is ignored in the schema root")}function D2(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,O2.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function F2(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function ZE({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,pe._)`${Se.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let o=(0,pe.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,pe._)`${Se.default.self}.opts.$comment(${s}, ${o}, ${l}.schema)`)}}function L2(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,pe._)`${Se.default.errors} === 0`,()=>e.return(Se.default.data),()=>e.throw((0,pe._)`new ${i}(${Se.default.vErrors})`)):(e.assign((0,pe._)`${n}.errors`,Se.default.vErrors),s.unevaluated&&j2(t),e.return((0,pe._)`${Se.default.errors} === 0`))}function j2({gen:t,evaluated:e,props:r,items:n}){r instanceof pe.Name&&t.assign((0,pe._)`${e}.props`,r),n instanceof pe.Name&&t.assign((0,pe._)`${e}.items`,n)}function VE(t,e,r,n){let{gen:i,schema:s,data:o,allErrors:l,opts:f,self:d}=t,{RULES:m}=d;if(s.$ref&&(f.ignoreKeywordsWithRef||!(0,Ki.schemaHasRulesButRef)(s,m))){i.block(()=>eO(t,"$ref",m.all.$ref.definition));return}f.jtd||U2(t,e),i.block(()=>{for(let y of m.rules)g(y);g(m.post)});function g(y){(0,tS.shouldUseGroup)(s,y)&&(y.type?(i.if((0,ph.checkDataType)(y.type,o,f.strictNumbers)),WE(t,y),e.length===1&&e[0]===y.type&&r&&(i.else(),(0,ph.reportTypeError)(t)),i.endIf()):WE(t,y),l||i.if((0,pe._)`${Se.default.errors} === ${n||0}`))}}function WE(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,E2.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,tS.shouldUseRule)(n,s)&&eO(t,s.keyword,s.definition,e.type)})}function U2(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(H2(t,e),t.opts.allowUnionTypes||B2(t,e),V2(t,t.dataTypes))}function H2(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{XE(t.dataTypes,r)||rS(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),z2(t,e)}}function B2(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&rS(t,"use allowUnionTypes to allow union type keyword")}function V2(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,tS.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(o=>W2(e,o))&&rS(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function W2(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function XE(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function z2(t,e){let r=[];for(let n of t.dataTypes)XE(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function rS(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Ki.checkStrictMode)(t,e,t.opts.strictTypes)}var hh=class{constructor(e,r,n){if((0,Vu.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,Ki.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",tO(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Vu.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",Se.default.errors))}result(e,r,n){this.failResult((0,pe.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,pe.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,pe._)`${r} !== undefined && (${(0,pe.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?Bu.reportExtraError:Bu.reportError)(this,this.def.error,r)}$dataError(){(0,Bu.reportError)(this,this.def.$dataError||Bu.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Bu.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=pe.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=pe.nil,r=pe.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:o}=this;n.if((0,pe.or)((0,pe._)`${i} === undefined`,r)),e!==pe.nil&&n.assign(e,!0),(s.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==pe.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,pe.or)(o(),l());function o(){if(n.length){if(!(r instanceof pe.Name))throw new Error("ajv implementation error");let f=Array.isArray(n)?n:[n];return(0,pe._)`${(0,ph.checkDataTypes)(f,r,s.opts.strictNumbers,ph.DataType.Wrong)}`}return pe.nil}function l(){if(i.validateSchema){let f=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,pe._)`!${f}(${r})`}return pe.nil}}subschema(e,r){let n=(0,eS.getSubschema)(this.it,e);(0,eS.extendSubschemaData)(n,this.it,e),(0,eS.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return q2(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Ki.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Ki.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,pe.Name)),!0}};Ls.KeywordCxt=hh;function eO(t,e,r,n){let i=new hh(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Vu.funcKeywordCode)(i,r):"macro"in r?(0,Vu.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Vu.funcKeywordCode)(i,r)}var J2=/^\/(?:[^~]|~0|~1)*$/,Y2=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function tO(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return Se.default.rootData;if(t[0]==="/"){if(!J2.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=Se.default.rootData}else{let d=Y2.exec(t);if(!d)throw new Error(`Invalid JSON-pointer: ${t}`);let m=+d[1];if(i=d[2],i==="#"){if(m>=e)throw new Error(f("property/index",m));return n[e-m]}if(m>e)throw new Error(f("data",m));if(s=r[e-m],!i)return s}let o=s,l=i.split("/");for(let d of l)d&&(s=(0,pe._)`${s}${(0,pe.getProperty)((0,Ki.unescapeJsonPointer)(d))}`,o=(0,pe._)`${o} && ${s}`);return o;function f(d,m){return`Cannot access ${d} ${m} levels up, current level is ${e}`}}Ls.getData=tO});var mh=F(iS=>{"use strict";Object.defineProperty(iS,"__esModule",{value:!0});var nS=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};iS.default=nS});var zu=F(aS=>{"use strict";Object.defineProperty(aS,"__esModule",{value:!0});var sS=Hu(),oS=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,sS.resolveUrl)(e,r,n),this.missingSchema=(0,sS.normalizeId)((0,sS.getFullPath)(e,this.missingRef))}};aS.default=oS});var yh=F(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.resolveSchema=wn.getCompilingSchema=wn.resolveRef=wn.compileSchema=wn.SchemaEnv=void 0;var Wn=Ne(),G2=mh(),Zo=Gi(),zn=Hu(),rO=We(),K2=Wu(),Al=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,zn.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};wn.SchemaEnv=Al;function cS(t){let e=nO.call(this,t);if(e)return e;let r=(0,zn.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,o=new Wn.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),l;t.$async&&(l=o.scopeValue("Error",{ref:G2.default,code:(0,Wn._)`require("ajv/dist/runtime/validation_error").default`}));let f=o.scopeName("validate");t.validateName=f;let d={gen:o,allErrors:this.opts.allErrors,data:Zo.default.data,parentData:Zo.default.parentData,parentDataProperty:Zo.default.parentDataProperty,dataNames:[Zo.default.data],dataPathArr:[Wn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Wn.stringify)(t.schema)}:{ref:t.schema}),validateName:f,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Wn.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Wn._)`""`,opts:this.opts,self:this},m;try{this._compilations.add(t),(0,K2.validateFunctionCode)(d),o.optimize(this.opts.code.optimize);let g=o.toString();m=`${o.scopeRefs(Zo.default.scope)}return ${g}`,this.opts.code.process&&(m=this.opts.code.process(m,t));let w=new Function(`${Zo.default.self}`,`${Zo.default.scope}`,m)(this,this.scope.get());if(this.scope.value(f,{ref:w}),w.errors=null,w.schema=t.schema,w.schemaEnv=t,t.$async&&(w.$async=!0),this.opts.code.source===!0&&(w.source={validateName:f,validateCode:g,scopeValues:o._values}),this.opts.unevaluated){let{props:C,items:R}=d;w.evaluated={props:C instanceof Wn.Name?void 0:C,items:R instanceof Wn.Name?void 0:R,dynamicProps:C instanceof Wn.Name,dynamicItems:R instanceof Wn.Name},w.source&&(w.source.evaluated=(0,Wn.stringify)(w.evaluated))}return t.validate=w,t}catch(g){throw delete t.validate,delete t.validateName,m&&this.logger.error("Error compiling schema, function code:",m),g}finally{this._compilations.delete(t)}}wn.compileSchema=cS;function Q2(t,e,r){var n;r=(0,zn.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=eU.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 Al({schema:o,schemaId:l,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=Z2.call(this,s)}wn.resolveRef=Q2;function Z2(t){return(0,zn.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:cS.call(this,t)}function nO(t){for(let e of this._compilations)if(X2(e,t))return e}wn.getCompilingSchema=nO;function X2(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function eU(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||gh.call(this,t,e)}function gh(t,e){let r=this.opts.uriResolver.parse(e),n=(0,zn._getFullPath)(this.opts.uriResolver,r),i=(0,zn.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return lS.call(this,r,t);let s=(0,zn.normalizeId)(n),o=this.refs[s]||this.schemas[s];if(typeof o=="string"){let l=gh.call(this,t,o);return typeof l?.schema!="object"?void 0:lS.call(this,r,l)}if(typeof o?.schema=="object"){if(o.validate||cS.call(this,o),s===(0,zn.normalizeId)(e)){let{schema:l}=o,{schemaId:f}=this.opts,d=l[f];return d&&(i=(0,zn.resolveUrl)(this.opts.uriResolver,i,d)),new Al({schema:l,schemaId:f,root:t,baseId:i})}return lS.call(this,r,o)}}wn.resolveSchema=gh;var tU=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function lS(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,rO.unescapeFragment)(l)];if(f===void 0)return;r=f;let d=typeof r=="object"&&r[this.opts.schemaId];!tU.has(l)&&d&&(e=(0,zn.resolveUrl)(this.opts.uriResolver,e,d))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,rO.schemaHasRulesButRef)(r,this.RULES)){let l=(0,zn.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=gh.call(this,n,l)}let{schemaId:o}=this.opts;if(s=s||new Al({schema:r,schemaId:o,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var iO=F((F5,rU)=>{rU.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 dS=F((L5,uO)=>{"use strict";var nU=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),oO=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),uS=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),aO=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),iU=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function fS(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 sU=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function sO(t){return t.length=0,!0}function oU(t,e,r){if(t.length){let n=fS(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function aU(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,o=!1,l=oU;for(let f=0;f<t.length;f++){let d=t[f];if(!(d==="["||d==="]"))if(d===":"){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(d==="%"){if(!l(i,n,r))break;l=sO}else{i.push(d);continue}}return i.length&&(l===sO?r.zone=i.join(""):o?n.push(i.join("")):n.push(fS(i))),r.address=n.join(""),r}function lO(t){if(lU(t,":")<2)return{host:t,isIPV6:!1};let e=aU(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 lU(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function cU(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 uU={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},fU=/[@/?#:]/g,dU=/[@/?#]/g;function cO(t,e){let r=e?dU:fU;return r.lastIndex=0,t.replace(r,n=>uU[n])}function pU(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(uS(i)){let s=i.toUpperCase(),o=String.fromCharCode(parseInt(s,16));e&&aO(o)?r+=o:r+="%"+s,n+=2;continue}}r+=t[n]}return r}function hU(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(uS(n)){let i=n.toUpperCase(),s=String.fromCharCode(parseInt(i,16));s!=="."&&aO(s)?e+=s:e+="%"+i,r+=2;continue}}iU(t[r])?e+=t[r]:e+=escape(t[r])}return e}function mU(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(uS(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function gU(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!oO(r)){let n=lO(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}uO.exports={nonSimpleDomain:sU,recomposeAuthority:gU,reescapeHostDelimiters:cO,normalizePercentEncoding:pU,normalizePathEncoding:hU,escapePreservingEscapes:mU,removeDotSegments:cU,isIPv4:oO,isUUID:nU,normalizeIPv6:lO,stringArrayToHexStripped:fS}});var mO=F((j5,hO)=>{"use strict";var{isUUID:yU}=dS(),vU=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,bU=["http","https","ws","wss","urn","urn:uuid"];function SU(t){return bU.indexOf(t)!==-1}function pS(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 fO(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function dO(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 wU(t){return t.secure=pS(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function _U(t){if((t.port===(pS(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 RU(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(vU);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=hS(i);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function xU(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=hS(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 CU(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!yU(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function EU(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var pO={scheme:"http",domainHost:!0,parse:fO,serialize:dO},OU={scheme:"https",domainHost:pO.domainHost,parse:fO,serialize:dO},vh={scheme:"ws",domainHost:!0,parse:wU,serialize:_U},IU={scheme:"wss",domainHost:vh.domainHost,parse:vh.parse,serialize:vh.serialize},PU={scheme:"urn",parse:RU,serialize:xU,skipNormalize:!0},kU={scheme:"urn:uuid",parse:CU,serialize:EU,skipNormalize:!0},bh={http:pO,https:OU,ws:vh,wss:IU,urn:PU,"urn:uuid":kU};Object.setPrototypeOf(bh,null);function hS(t){return t&&(bh[t]||bh[t.toLowerCase()])||void 0}hO.exports={wsIsSecure:pS,SCHEMES:bh,isValidSchemeName:SU,getSchemeHandler:hS}});var wO=F((U5,Sh)=>{"use strict";var{normalizeIPv6:TU,removeDotSegments:Ju,recomposeAuthority:AU,normalizePercentEncoding:qU,normalizePathEncoding:$U,escapePreservingEscapes:MU,reescapeHostDelimiters:NU,isIPv4:DU,nonSimpleDomain:FU}=dS(),{SCHEMES:LU,getSchemeHandler:yO}=mO();function jU(t,e){return typeof t=="string"?t=WU(t,e):typeof t=="object"&&(t=ql(Xo(t,e),e)),t}function UU(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=vO(ql(t,n),ql(e,n),n,!0);return n.skipEscape=!0,Xo(i,n)}function vO(t,e,r,n){let i={};return n||(t=ql(Xo(t,r),r),e=ql(Xo(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=Ju(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=Ju(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=Ju(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=Ju(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 HU(t,e,r){let n=gO(t,r),i=gO(e,r);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()}function Xo(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=yO(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=qU(r.path):(r.path=MU(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let o=AU(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=Ju(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 BU=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function VU(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 bO(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(BU);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=VU(n,o);if(l!==void 0&&(n.error=n.error||l,i=!0),n.host)if(DU(n.host)===!1){let m=TU(n.host);n.host=m.host.toLowerCase(),s=m.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=yO(r.scheme||n.scheme);if(!r.unicodeSupport&&(!f||!f.unicodeSupport)&&n.host&&(r.domainHost||f&&f.domainHost)&&s===!1&&FU(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(d){n.error=n.error||"Host's domain name can not be converted to ASCII: "+d}if((!f||f&&!f.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=NU(unescape(n.host),s))),n.path&&(n.path=$U(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 ql(t,e){return bO(t,e).parsed}function WU(t,e){return SO(t,e).normalized}function SO(t,e){let{parsed:r,malformedAuthorityOrPort:n}=bO(t,e);return{normalized:n?t:Xo(r,e),malformedAuthorityOrPort:n}}function gO(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=SO(t,e);return n?void 0:r}if(typeof t=="object")return Xo(t,e)}var mS={SCHEMES:LU,normalize:jU,resolve:UU,resolveComponent:vO,equal:HU,serialize:Xo,parse:ql};Sh.exports=mS;Sh.exports.default=mS;Sh.exports.fastUri=mS});var RO=F(gS=>{"use strict";Object.defineProperty(gS,"__esModule",{value:!0});var _O=wO();_O.code='require("ajv/dist/runtime/uri").default';gS.default=_O});var TO=F(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.CodeGen=Xt.Name=Xt.nil=Xt.stringify=Xt.str=Xt._=Xt.KeywordCxt=void 0;var zU=Wu();Object.defineProperty(Xt,"KeywordCxt",{enumerable:!0,get:function(){return zU.KeywordCxt}});var $l=Ne();Object.defineProperty(Xt,"_",{enumerable:!0,get:function(){return $l._}});Object.defineProperty(Xt,"str",{enumerable:!0,get:function(){return $l.str}});Object.defineProperty(Xt,"stringify",{enumerable:!0,get:function(){return $l.stringify}});Object.defineProperty(Xt,"nil",{enumerable:!0,get:function(){return $l.nil}});Object.defineProperty(Xt,"Name",{enumerable:!0,get:function(){return $l.Name}});Object.defineProperty(Xt,"CodeGen",{enumerable:!0,get:function(){return $l.CodeGen}});var JU=mh(),IO=zu(),YU=Vb(),Yu=yh(),GU=Ne(),Gu=Hu(),wh=Uu(),vS=We(),xO=iO(),KU=RO(),PO=(t,e)=>new RegExp(t,e);PO.code="new RegExp";var QU=["removeAdditional","useDefaults","coerceTypes"],ZU=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),XU={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."},eH={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},CO=200;function tH(t){var e,r,n,i,s,o,l,f,d,m,g,y,w,C,R,P,A,U,B,z,V,X,T,_,k;let M=t.strict,j=(e=t.code)===null||e===void 0?void 0:e.optimize,$=j===!0||j===void 0?1:j||0,Y=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:PO,K=(i=t.uriResolver)!==null&&i!==void 0?i:KU.default;return{strictSchema:(o=(s=t.strictSchema)!==null&&s!==void 0?s:M)!==null&&o!==void 0?o:!0,strictNumbers:(f=(l=t.strictNumbers)!==null&&l!==void 0?l:M)!==null&&f!==void 0?f:!0,strictTypes:(m=(d=t.strictTypes)!==null&&d!==void 0?d:M)!==null&&m!==void 0?m:"log",strictTuples:(y=(g=t.strictTuples)!==null&&g!==void 0?g:M)!==null&&y!==void 0?y:"log",strictRequired:(C=(w=t.strictRequired)!==null&&w!==void 0?w:M)!==null&&C!==void 0?C:!1,code:t.code?{...t.code,optimize:$,regExp:Y}:{optimize:$,regExp:Y},loopRequired:(R=t.loopRequired)!==null&&R!==void 0?R:CO,loopEnum:(P=t.loopEnum)!==null&&P!==void 0?P:CO,meta:(A=t.meta)!==null&&A!==void 0?A:!0,messages:(U=t.messages)!==null&&U!==void 0?U:!0,inlineRefs:(B=t.inlineRefs)!==null&&B!==void 0?B:!0,schemaId:(z=t.schemaId)!==null&&z!==void 0?z:"$id",addUsedSchema:(V=t.addUsedSchema)!==null&&V!==void 0?V:!0,validateSchema:(X=t.validateSchema)!==null&&X!==void 0?X:!0,validateFormats:(T=t.validateFormats)!==null&&T!==void 0?T:!0,unicodeRegExp:(_=t.unicodeRegExp)!==null&&_!==void 0?_:!0,int32range:(k=t.int32range)!==null&&k!==void 0?k:!0,uriResolver:K}}var Ku=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,...tH(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new GU.ValueScope({scope:{},prefixes:ZU,es5:r,lines:n}),this.logger=aH(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,YU.getRules)(),EO.call(this,XU,e,"NOT SUPPORTED"),EO.call(this,eH,e,"DEPRECATED","warn"),this._metaOpts=sH.call(this),e.formats&&nH.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&iH.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),rH.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=xO;n==="id"&&(i={...xO},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(m,g){await s.call(this,m.$schema);let y=this._addSchema(m,g);return y.validate||o.call(this,y)}async function s(m){m&&!this.getSchema(m)&&await i.call(this,{$ref:m},!0)}async function o(m){try{return this._compileSchemaEnv(m)}catch(g){if(!(g instanceof IO.default))throw g;return l.call(this,g),await f.call(this,g.missingSchema),o.call(this,m)}}function l({missingSchema:m,missingRef:g}){if(this.refs[m])throw new Error(`AnySchema ${m} is loaded but ${g} cannot be resolved`)}async function f(m){let g=await d.call(this,m);this.refs[m]||await s.call(this,g.$schema),this.refs[m]||this.addSchema(g,m,r)}async function d(m){let g=this._loading[m];if(g)return g;try{return await(this._loading[m]=n(m))}finally{delete this._loading[m]}}}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,Gu.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=OO.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Yu.SchemaEnv({schema:{},schemaId:n});if(r=Yu.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=OO.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,Gu.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(cH.call(this,n,r),!r)return(0,vS.eachItem)(n,s=>yS.call(this,s)),this;fH.call(this,r);let i={...r,type:(0,wh.getJSONTypes)(r.type),schemaType:(0,wh.getJSONTypes)(r.schemaType)};return(0,vS.eachItem)(n,i.type.length===0?s=>yS.call(this,s,i):s=>i.type.forEach(o=>yS.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:d}=f.definition,m=o[l];d&&m&&(o[l]=kO(m))}}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,Gu.normalizeId)(o||n);let d=Gu.getSchemaRefs.call(this,e,n);return f=new Yu.SchemaEnv({schema:e,schemaId:l,meta:r,baseId:n,localRefs:d}),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):Yu.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{Yu.compileSchema.call(this,e)}finally{this.opts=r}}};Ku.ValidationError=JU.default;Ku.MissingRefError=IO.default;Xt.default=Ku;function EO(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 OO(t){return t=(0,Gu.normalizeId)(t),this.schemas[t]||this.refs[t]}function rH(){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 nH(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function iH(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 sH(){let t={...this.opts};for(let e of QU)delete t[e];return t}var oH={log(){},warn(){},error(){}};function aH(t){if(t===!1)return oH;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 lH=/^[a-z_$][a-z0-9_$:-]*$/i;function cH(t,e){let{RULES:r}=this;if((0,vS.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!lH.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 yS(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,wh.getJSONTypes)(e.type),schemaType:(0,wh.getJSONTypes)(e.schemaType)}};e.before?uH.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 uH(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 fH(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=kO(e)),t.validateSchema=this.compile(e,!0))}var dH={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function kO(t){return{anyOf:[t,dH]}}});var AO=F(bS=>{"use strict";Object.defineProperty(bS,"__esModule",{value:!0});var pH={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};bS.default=pH});var NO=F(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.callRef=ea.getValidate=void 0;var hH=zu(),qO=Sn(),Fr=Ne(),Ml=Gi(),$O=yh(),_h=We(),mH={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:d}=s;if((r==="#"||r==="#/")&&i===d.baseId)return g();let m=$O.resolveRef.call(f,d,i,r);if(m===void 0)throw new hH.default(n.opts.uriResolver,i,r);if(m instanceof $O.SchemaEnv)return y(m);return w(m);function g(){if(s===d)return Rh(t,o,s,s.$async);let C=e.scopeValue("root",{ref:d});return Rh(t,(0,Fr._)`${C}.validate`,d,d.$async)}function y(C){let R=MO(t,C);Rh(t,R,C,C.$async)}function w(C){let R=e.scopeValue("schema",l.code.source===!0?{ref:C,code:(0,Fr.stringify)(C)}:{ref:C}),P=e.name("valid"),A=t.subschema({schema:C,dataTypes:[],schemaPath:Fr.nil,topSchemaRef:R,errSchemaPath:r},P);t.mergeEvaluated(A),t.ok(P)}}};function MO(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Fr._)`${r.scopeValue("wrapper",{ref:e})}.validate`}ea.getValidate=MO;function Rh(t,e,r,n){let{gen:i,it:s}=t,{allErrors:o,schemaEnv:l,opts:f}=s,d=f.passContext?Ml.default.this:Fr.nil;n?m():g();function m(){if(!l.$async)throw new Error("async schema referenced by sync schema");let C=i.let("valid");i.try(()=>{i.code((0,Fr._)`await ${(0,qO.callValidateCode)(t,e,d)}`),w(e),o||i.assign(C,!0)},R=>{i.if((0,Fr._)`!(${R} instanceof ${s.ValidationError})`,()=>i.throw(R)),y(R),o||i.assign(C,!1)}),t.ok(C)}function g(){t.result((0,qO.callValidateCode)(t,e,d),()=>w(e),()=>y(e))}function y(C){let R=(0,Fr._)`${C}.errors`;i.assign(Ml.default.vErrors,(0,Fr._)`${Ml.default.vErrors} === null ? ${R} : ${Ml.default.vErrors}.concat(${R})`),i.assign(Ml.default.errors,(0,Fr._)`${Ml.default.vErrors}.length`)}function w(C){var R;if(!s.opts.unevaluated)return;let P=(R=r?.validate)===null||R===void 0?void 0:R.evaluated;if(s.props!==!0)if(P&&!P.dynamicProps)P.props!==void 0&&(s.props=_h.mergeEvaluated.props(i,P.props,s.props));else{let A=i.var("props",(0,Fr._)`${C}.evaluated.props`);s.props=_h.mergeEvaluated.props(i,A,s.props,Fr.Name)}if(s.items!==!0)if(P&&!P.dynamicItems)P.items!==void 0&&(s.items=_h.mergeEvaluated.items(i,P.items,s.items));else{let A=i.var("items",(0,Fr._)`${C}.evaluated.items`);s.items=_h.mergeEvaluated.items(i,A,s.items,Fr.Name)}}}ea.callRef=Rh;ea.default=mH});var DO=F(SS=>{"use strict";Object.defineProperty(SS,"__esModule",{value:!0});var gH=AO(),yH=NO(),vH=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",gH.default,yH.default];SS.default=vH});var FO=F(wS=>{"use strict";Object.defineProperty(wS,"__esModule",{value:!0});var xh=Ne(),js=xh.operators,Ch={maximum:{okStr:"<=",ok:js.LTE,fail:js.GT},minimum:{okStr:">=",ok:js.GTE,fail:js.LT},exclusiveMaximum:{okStr:"<",ok:js.LT,fail:js.GTE},exclusiveMinimum:{okStr:">",ok:js.GT,fail:js.LTE}},bH={message:({keyword:t,schemaCode:e})=>(0,xh.str)`must be ${Ch[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,xh._)`{comparison: ${Ch[t].okStr}, limit: ${e}}`},SH={keyword:Object.keys(Ch),type:"number",schemaType:"number",$data:!0,error:bH,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,xh._)`${r} ${Ch[e].fail} ${n} || isNaN(${r})`)}};wS.default=SH});var LO=F(_S=>{"use strict";Object.defineProperty(_S,"__esModule",{value:!0});var Qu=Ne(),wH={message:({schemaCode:t})=>(0,Qu.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Qu._)`{multipleOf: ${t}}`},_H={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:wH,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,o=e.let("res"),l=s?(0,Qu._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${s}`:(0,Qu._)`${o} !== parseInt(${o})`;t.fail$data((0,Qu._)`(${n} === 0 || (${o} = ${r}/${n}, ${l}))`)}};_S.default=_H});var UO=F(RS=>{"use strict";Object.defineProperty(RS,"__esModule",{value:!0});function jO(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}RS.default=jO;jO.code='require("ajv/dist/runtime/ucs2length").default'});var HO=F(xS=>{"use strict";Object.defineProperty(xS,"__esModule",{value:!0});var ta=Ne(),RH=We(),xH=UO(),CH={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,ta.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,ta._)`{limit: ${t}}`},EH={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:CH,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?ta.operators.GT:ta.operators.LT,o=i.opts.unicode===!1?(0,ta._)`${r}.length`:(0,ta._)`${(0,RH.useFunc)(t.gen,xH.default)}(${r})`;t.fail$data((0,ta._)`${o} ${s} ${n}`)}};xS.default=EH});var BO=F(CS=>{"use strict";Object.defineProperty(CS,"__esModule",{value:!0});var OH=Sn(),IH=We(),Nl=Ne(),PH={message:({schemaCode:t})=>(0,Nl.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Nl._)`{pattern: ${t}}`},kH={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:PH,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,d=f.code==="new RegExp"?(0,Nl._)`new RegExp`:(0,IH.useFunc)(e,f),m=e.let("valid");e.try(()=>e.assign(m,(0,Nl._)`${d}(${s}, ${l}).test(${r})`),()=>e.assign(m,!1)),t.fail$data((0,Nl._)`!${m}`)}else{let f=(0,OH.usePattern)(t,i);t.fail$data((0,Nl._)`!${f}.test(${r})`)}}};CS.default=kH});var VO=F(ES=>{"use strict";Object.defineProperty(ES,"__esModule",{value:!0});var Zu=Ne(),TH={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Zu.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Zu._)`{limit: ${t}}`},AH={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:TH,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?Zu.operators.GT:Zu.operators.LT;t.fail$data((0,Zu._)`Object.keys(${r}).length ${i} ${n}`)}};ES.default=AH});var WO=F(OS=>{"use strict";Object.defineProperty(OS,"__esModule",{value:!0});var Xu=Sn(),ef=Ne(),qH=We(),$H={message:({params:{missingProperty:t}})=>(0,ef.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,ef._)`{missingProperty: ${t}}`},MH={keyword:"required",type:"object",schemaType:"array",$data:!0,error:$H,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?d():m(),l.strictRequired){let w=t.parentSchema.properties,{definedProperties:C}=t.it;for(let R of r)if(w?.[R]===void 0&&!C.has(R)){let P=o.schemaEnv.baseId+o.errSchemaPath,A=`required property "${R}" is not defined at "${P}" (strictRequired)`;(0,qH.checkStrictMode)(o,A,o.opts.strictRequired)}}function d(){if(f||s)t.block$data(ef.nil,g);else for(let w of r)(0,Xu.checkReportMissingProp)(t,w)}function m(){let w=e.let("missing");if(f||s){let C=e.let("valid",!0);t.block$data(C,()=>y(w,C)),t.ok(C)}else e.if((0,Xu.checkMissingProp)(t,r,w)),(0,Xu.reportMissingProp)(t,w),e.else()}function g(){e.forOf("prop",n,w=>{t.setParams({missingProperty:w}),e.if((0,Xu.noPropertyInData)(e,i,w,l.ownProperties),()=>t.error())})}function y(w,C){t.setParams({missingProperty:w}),e.forOf(w,n,()=>{e.assign(C,(0,Xu.propertyInData)(e,i,w,l.ownProperties)),e.if((0,ef.not)(C),()=>{t.error(),e.break()})},ef.nil)}}};OS.default=MH});var zO=F(IS=>{"use strict";Object.defineProperty(IS,"__esModule",{value:!0});var tf=Ne(),NH={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,tf.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,tf._)`{limit: ${t}}`},DH={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:NH,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?tf.operators.GT:tf.operators.LT;t.fail$data((0,tf._)`${r}.length ${i} ${n}`)}};IS.default=DH});var Eh=F(PS=>{"use strict";Object.defineProperty(PS,"__esModule",{value:!0});var JO=Zb();JO.code='require("ajv/dist/runtime/equal").default';PS.default=JO});var YO=F(TS=>{"use strict";Object.defineProperty(TS,"__esModule",{value:!0});var kS=Uu(),er=Ne(),FH=We(),LH=Eh(),jH={message:({params:{i:t,j:e}})=>(0,er.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,er._)`{i: ${t}, j: ${e}}`},UH={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:jH,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"),d=s.items?(0,kS.getSchemaTypes)(s.items):[];t.block$data(f,m,(0,er._)`${o} === false`),t.ok(f);function m(){let C=e.let("i",(0,er._)`${r}.length`),R=e.let("j");t.setParams({i:C,j:R}),e.assign(f,!0),e.if((0,er._)`${C} > 1`,()=>(g()?y:w)(C,R))}function g(){return d.length>0&&!d.some(C=>C==="object"||C==="array")}function y(C,R){let P=e.name("item"),A=(0,kS.checkDataTypes)(d,P,l.opts.strictNumbers,kS.DataType.Wrong),U=e.const("indices",(0,er._)`{}`);e.for((0,er._)`;${C}--;`,()=>{e.let(P,(0,er._)`${r}[${C}]`),e.if(A,(0,er._)`continue`),d.length>1&&e.if((0,er._)`typeof ${P} == "string"`,(0,er._)`${P} += "_"`),e.if((0,er._)`typeof ${U}[${P}] == "number"`,()=>{e.assign(R,(0,er._)`${U}[${P}]`),t.error(),e.assign(f,!1).break()}).code((0,er._)`${U}[${P}] = ${C}`)})}function w(C,R){let P=(0,FH.useFunc)(e,LH.default),A=e.name("outer");e.label(A).for((0,er._)`;${C}--;`,()=>e.for((0,er._)`${R} = ${C}; ${R}--;`,()=>e.if((0,er._)`${P}(${r}[${C}], ${r}[${R}])`,()=>{t.error(),e.assign(f,!1).break(A)})))}}};TS.default=UH});var GO=F(qS=>{"use strict";Object.defineProperty(qS,"__esModule",{value:!0});var AS=Ne(),HH=We(),BH=Eh(),VH={message:"must be equal to constant",params:({schemaCode:t})=>(0,AS._)`{allowedValue: ${t}}`},WH={keyword:"const",$data:!0,error:VH,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,AS._)`!${(0,HH.useFunc)(e,BH.default)}(${r}, ${i})`):t.fail((0,AS._)`${s} !== ${r}`)}};qS.default=WH});var KO=F($S=>{"use strict";Object.defineProperty($S,"__esModule",{value:!0});var rf=Ne(),zH=We(),JH=Eh(),YH={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,rf._)`{allowedValues: ${t}}`},GH={keyword:"enum",schemaType:"array",$data:!0,error:YH,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,d=()=>f??(f=(0,zH.useFunc)(e,JH.default)),m;if(l||n)m=e.let("valid"),t.block$data(m,g);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let w=e.const("vSchema",s);m=(0,rf.or)(...i.map((C,R)=>y(w,R)))}t.pass(m);function g(){e.assign(m,!1),e.forOf("v",s,w=>e.if((0,rf._)`${d()}(${r}, ${w})`,()=>e.assign(m,!0).break()))}function y(w,C){let R=i[C];return typeof R=="object"&&R!==null?(0,rf._)`${d()}(${r}, ${w}[${C}])`:(0,rf._)`${r} === ${R}`}}};$S.default=GH});var QO=F(MS=>{"use strict";Object.defineProperty(MS,"__esModule",{value:!0});var KH=FO(),QH=LO(),ZH=HO(),XH=BO(),eB=VO(),tB=WO(),rB=zO(),nB=YO(),iB=GO(),sB=KO(),oB=[KH.default,QH.default,ZH.default,XH.default,eB.default,tB.default,rB.default,nB.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},iB.default,sB.default];MS.default=oB});var DS=F(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});nf.validateAdditionalItems=void 0;var ra=Ne(),NS=We(),aB={message:({params:{len:t}})=>(0,ra.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,ra._)`{limit: ${t}}`},lB={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:aB,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,NS.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}ZO(t,n)}};function ZO(t,e){let{gen:r,schema:n,data:i,keyword:s,it:o}=t;o.items=!0;let l=r.const("len",(0,ra._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,ra._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,NS.alwaysValidSchema)(o,n)){let d=r.var("valid",(0,ra._)`${l} <= ${e.length}`);r.if((0,ra.not)(d),()=>f(d)),t.ok(d)}function f(d){r.forRange("i",e.length,l,m=>{t.subschema({keyword:s,dataProp:m,dataPropType:NS.Type.Num},d),o.allErrors||r.if((0,ra.not)(d),()=>r.break())})}}nf.validateAdditionalItems=ZO;nf.default=lB});var FS=F(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});sf.validateTuple=void 0;var XO=Ne(),Oh=We(),cB=Sn(),uB={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return eI(t,"additionalItems",e);r.items=!0,!(0,Oh.alwaysValidSchema)(r,e)&&t.ok((0,cB.validateArray)(t))}};function eI(t,e,r=t.schema){let{gen:n,parentSchema:i,data:s,keyword:o,it:l}=t;m(i),l.opts.unevaluated&&r.length&&l.items!==!0&&(l.items=Oh.mergeEvaluated.items(n,r.length,l.items));let f=n.name("valid"),d=n.const("len",(0,XO._)`${s}.length`);r.forEach((g,y)=>{(0,Oh.alwaysValidSchema)(l,g)||(n.if((0,XO._)`${d} > ${y}`,()=>t.subschema({keyword:o,schemaProp:y,dataProp:y},f)),t.ok(f))});function m(g){let{opts:y,errSchemaPath:w}=l,C=r.length,R=C===g.minItems&&(C===g.maxItems||g[e]===!1);if(y.strictTuples&&!R){let P=`"${o}" is ${C}-tuple, but minItems or maxItems/${e} are not specified or different at path "${w}"`;(0,Oh.checkStrictMode)(l,P,y.strictTuples)}}}sf.validateTuple=eI;sf.default=uB});var tI=F(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0});var fB=FS(),dB={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,fB.validateTuple)(t,"items")};LS.default=dB});var nI=F(jS=>{"use strict";Object.defineProperty(jS,"__esModule",{value:!0});var rI=Ne(),pB=We(),hB=Sn(),mB=DS(),gB={message:({params:{len:t}})=>(0,rI.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,rI._)`{limit: ${t}}`},yB={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:gB,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,pB.alwaysValidSchema)(n,e)&&(i?(0,mB.validateAdditionalItems)(t,i):t.ok((0,hB.validateArray)(t)))}};jS.default=yB});var iI=F(US=>{"use strict";Object.defineProperty(US,"__esModule",{value:!0});var _n=Ne(),Ih=We(),vB={message:({params:{min:t,max:e}})=>e===void 0?(0,_n.str)`must contain at least ${t} valid item(s)`:(0,_n.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,_n._)`{minContains: ${t}}`:(0,_n._)`{minContains: ${t}, maxContains: ${e}}`},bB={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:vB,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t,o,l,{minContains:f,maxContains:d}=n;s.opts.next?(o=f===void 0?1:f,l=d):o=1;let m=e.const("len",(0,_n._)`${i}.length`);if(t.setParams({min:o,max:l}),l===void 0&&o===0){(0,Ih.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&o>l){(0,Ih.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Ih.alwaysValidSchema)(s,r)){let R=(0,_n._)`${m} >= ${o}`;l!==void 0&&(R=(0,_n._)`${R} && ${m} <= ${l}`),t.pass(R);return}s.items=!0;let g=e.name("valid");l===void 0&&o===1?w(g,()=>e.if(g,()=>e.break())):o===0?(e.let(g,!0),l!==void 0&&e.if((0,_n._)`${i}.length > 0`,y)):(e.let(g,!1),y()),t.result(g,()=>t.reset());function y(){let R=e.name("_valid"),P=e.let("count",0);w(R,()=>e.if(R,()=>C(P)))}function w(R,P){e.forRange("i",0,m,A=>{t.subschema({keyword:"contains",dataProp:A,dataPropType:Ih.Type.Num,compositeRule:!0},R),P()})}function C(R){e.code((0,_n._)`${R}++`),l===void 0?e.if((0,_n._)`${R} >= ${o}`,()=>e.assign(g,!0).break()):(e.if((0,_n._)`${R} > ${l}`,()=>e.assign(g,!1).break()),o===1?e.assign(g,!0):e.if((0,_n._)`${R} >= ${o}`,()=>e.assign(g,!0)))}}};US.default=bB});var aI=F(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.validateSchemaDeps=Si.validatePropertyDeps=Si.error=void 0;var HS=Ne(),SB=We(),of=Sn();Si.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,HS.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,HS._)`{property: ${t},
|
|
23
|
+
`+new Error().stack),b=!1}return h.apply(this,arguments)},h)}var k={};function M(u,h){e.deprecationHandler!=null&&e.deprecationHandler(u,h),k[u]||(P(h),k[u]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function j(u){return typeof Function<"u"&&u instanceof Function||Object.prototype.toString.call(u)==="[object Function]"}function $(u){var h,b;for(b in u)s(u,b)&&(h=u[b],j(h)?this[b]=h:this["_"+b]=h);this._config=u,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function Y(u,h){var b=g({},u),S;for(S in h)s(h,S)&&(i(u[S])&&i(h[S])?(b[S]={},g(b[S],u[S]),g(b[S],h[S])):h[S]!=null?b[S]=h[S]:delete b[S]);for(S in u)s(u,S)&&!s(h,S)&&i(u[S])&&(b[S]=g({},b[S]));return b}function K(u){u!=null&&this.set(u)}var ne;Object.keys?ne=Object.keys:ne=function(u){var h,b=[];for(h in u)s(u,h)&&b.push(h);return b};var ue={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function et(u,h,b){var S=this._calendar[u]||this._calendar.sameElse;return j(S)?S.call(h,b):S}function _e(u,h,b){var S=""+Math.abs(u),E=h-S.length,N=u>=0;return(N?b?"+":"":"-")+Math.pow(10,Math.max(0,E)).toString().substr(1)+S}var he=/(\[[^\[]*\])|(\\)?([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,Ce=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,vt={},Et={};function ce(u,h,b,S){var E=S;typeof S=="string"&&(E=function(){return this[S]()}),u&&(Et[u]=E),h&&(Et[h[0]]=function(){return _e(E.apply(this,arguments),h[1],h[2])}),b&&(Et[b]=function(){return this.localeData().ordinal(E.apply(this,arguments),u)})}function pr(u){return u.match(/\[[\s\S]/)?u.replace(/^\[|\]$/g,""):u.replace(/\\/g,"")}function ai(u){var h=u.match(he),b,S;for(b=0,S=h.length;b<S;b++)Et[h[b]]?h[b]=Et[h[b]]:h[b]=pr(h[b]);return function(E){var N="",J;for(J=0;J<S;J++)N+=j(h[J])?h[J].call(E,u):h[J];return N}}function Rt(u,h){return u.isValid()?(h=zr(h,u.localeData()),vt[h]=vt[h]||ai(h),vt[h](u)):u.localeData().invalidDate()}function zr(u,h){var b=5;function S(E){return h.longDateFormat(E)||E}for(Ce.lastIndex=0;b>=0&&Ce.test(u);)u=u.replace(Ce,S),Ce.lastIndex=0,b-=1;return u}var Or={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 ht(u){var h=this._longDateFormat[u],b=this._longDateFormat[u.toUpperCase()];return h||!b?h:(this._longDateFormat[u]=b.match(he).map(function(S){return S==="MMMM"||S==="MM"||S==="DD"||S==="dddd"?S.slice(1):S}).join(""),this._longDateFormat[u])}var mt="Invalid date";function on(){return this._invalidDate}var oo="%d",Jt=/\d{1,2}/;function ao(u){return this._ordinal.replace("%d",u)}var Wg={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 In(u,h,b,S){var E=this._relativeTime[b];return j(E)?E(u,h,b,S):E.replace(/%d/i,u)}function Od(u,h){var b=this._relativeTime[u>0?"future":"past"];return j(b)?b(h):b.replace(/%s/i,h)}var Id={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 Yt(u){return typeof u=="string"?Id[u]||Id[u.toLowerCase()]:void 0}function hr(u){var h={},b,S;for(S in u)s(u,S)&&(b=Yt(S),b&&(h[b]=u[S]));return h}var lo={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 Pa(u){var h=[],b;for(b in u)s(u,b)&&h.push({unit:b,priority:lo[b]});return h.sort(function(S,E){return S.priority-E.priority}),h}var Pd=/\d/,Ut=/\d\d/,kd=/\d{3}/,Oi=/\d{4}/,Pn=/[+-]?\d{6}/,ot=/\d\d?/,ka=/\d\d\d\d?/,Ta=/\d\d\d\d\d\d?/,cs=/\d{1,3}/,co=/\d{1,4}/,us=/[+-]?\d{1,6}/,li=/\d+/,fs=/[+-]?\d+/,Mc=/Z|[+-]\d\d:?\d\d/gi,Aa=/Z|[+-]\d\d(?::?\d\d)?/gi,zg=/[+-]?\d+(\.\d{1,3})?/,uo=/[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,Ii=/^[1-9]\d?/,qa=/^([1-9]\d|\d)/,$a;$a={};function le(u,h,b){$a[u]=j(h)?h:function(S,E){return S&&b?b:h}}function Jg(u,h){return s($a,u)?$a[u](h._strict,h._locale):new RegExp(Yg(u))}function Yg(u){return an(u.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(h,b,S,E,N){return b||S||E||N}))}function an(u){return u.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Ir(u){return u<0?Math.ceil(u)||0:Math.floor(u)}function qe(u){var h=+u,b=0;return h!==0&&isFinite(h)&&(b=Ir(h)),b}var Nc={};function Ke(u,h){var b,S=h,E;for(typeof u=="string"&&(u=[u]),f(h)&&(S=function(N,J){J[h]=qe(N)}),E=u.length,b=0;b<E;b++)Nc[u[b]]=S}function fo(u,h){Ke(u,function(b,S,E,N){E._w=E._w||{},h(b,E._w,E,N)})}function Dc(u,h,b){h!=null&&s(Nc,u)&&Nc[u](h,b._a,b,u)}function Ma(u){return u%4===0&&u%100!==0||u%400===0}var Gt=0,kn=1,ln=2,At=3,Pr=4,Tn=5,Pi=6,Td=7,Gg=8;ce("Y",0,0,function(){var u=this.year();return u<=9999?_e(u,4):"+"+u}),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"),le("Y",fs),le("YY",ot,Ut),le("YYYY",co,Oi),le("YYYYY",us,Pn),le("YYYYYY",us,Pn),Ke(["YYYYY","YYYYYY"],Gt),Ke("YYYY",function(u,h){h[Gt]=u.length===2?e.parseTwoDigitYear(u):qe(u)}),Ke("YY",function(u,h){h[Gt]=e.parseTwoDigitYear(u)}),Ke("Y",function(u,h){h[Gt]=parseInt(u,10)});function po(u){return Ma(u)?366:365}e.parseTwoDigitYear=function(u){return qe(u)+(qe(u)>68?1900:2e3)};var Ad=ds("FullYear",!0);function Kg(){return Ma(this.year())}function ds(u,h){return function(b){return b!=null?(mo(this,u,b),e.updateOffset(this,h),this):ho(this,u)}}function ho(u,h){if(!u.isValid())return NaN;var b=u._d,S=u._isUTC;switch(h){case"Milliseconds":return S?b.getUTCMilliseconds():b.getMilliseconds();case"Seconds":return S?b.getUTCSeconds():b.getSeconds();case"Minutes":return S?b.getUTCMinutes():b.getMinutes();case"Hours":return S?b.getUTCHours():b.getHours();case"Date":return S?b.getUTCDate():b.getDate();case"Day":return S?b.getUTCDay():b.getDay();case"Month":return S?b.getUTCMonth():b.getMonth();case"FullYear":return S?b.getUTCFullYear():b.getFullYear();default:return NaN}}function mo(u,h,b){var S,E,N,J,se;if(!(!u.isValid()||isNaN(b))){switch(S=u._d,E=u._isUTC,h){case"Milliseconds":return void(E?S.setUTCMilliseconds(b):S.setMilliseconds(b));case"Seconds":return void(E?S.setUTCSeconds(b):S.setSeconds(b));case"Minutes":return void(E?S.setUTCMinutes(b):S.setMinutes(b));case"Hours":return void(E?S.setUTCHours(b):S.setHours(b));case"Date":return void(E?S.setUTCDate(b):S.setDate(b));case"FullYear":break;default:return}N=b,J=u.month(),se=u.date(),se=se===29&&J===1&&!Ma(N)?28:se,E?S.setUTCFullYear(N,J,se):S.setFullYear(N,J,se)}}function Qg(u){return u=Yt(u),j(this[u])?this[u]():this}function Na(u,h){if(typeof u=="object"){u=hr(u);var b=Pa(u),S,E=b.length;for(S=0;S<E;S++)this[b[S].unit](u[b[S].unit])}else if(u=Yt(u),j(this[u]))return this[u](h);return this}function Zg(u,h){return(u%h+h)%h}var xt;Array.prototype.indexOf?xt=Array.prototype.indexOf:xt=function(u){var h;for(h=0;h<this.length;++h)if(this[h]===u)return h;return-1};function Fc(u,h){if(isNaN(u)||isNaN(h))return NaN;var b=Zg(h,12);return u+=(h-b)/12,b===1?Ma(u)?29:28:31-b%7%2}ce("M",["MM",2],"Mo",function(){return this.month()+1}),ce("MMM",0,0,function(u){return this.localeData().monthsShort(this,u)}),ce("MMMM",0,0,function(u){return this.localeData().months(this,u)}),le("M",ot,Ii),le("MM",ot,Ut),le("MMM",function(u,h){return h.monthsShortRegex(u)}),le("MMMM",function(u,h){return h.monthsRegex(u)}),Ke(["M","MM"],function(u,h){h[kn]=qe(u)-1}),Ke(["MMM","MMMM"],function(u,h,b,S){var E=b._locale.monthsParse(u,S,b._strict);E!=null?h[kn]=E:C(b).invalidMonth=u});var qd="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Lc="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),jc=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Xg=uo,ey=uo;function ty(u,h){return u?n(this._months)?this._months[u.month()]:this._months[(this._months.isFormat||jc).test(h)?"format":"standalone"][u.month()]:n(this._months)?this._months:this._months.standalone}function ry(u,h){return u?n(this._monthsShort)?this._monthsShort[u.month()]:this._monthsShort[jc.test(h)?"format":"standalone"][u.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function $d(u,h,b){var S,E,N,J=u.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],S=0;S<12;++S)N=y([2e3,S]),this._shortMonthsParse[S]=this.monthsShort(N,"").toLocaleLowerCase(),this._longMonthsParse[S]=this.months(N,"").toLocaleLowerCase();return b?h==="MMM"?(E=xt.call(this._shortMonthsParse,J),E!==-1?E:null):(E=xt.call(this._longMonthsParse,J),E!==-1?E:null):h==="MMM"?(E=xt.call(this._shortMonthsParse,J),E!==-1?E:(E=xt.call(this._longMonthsParse,J),E!==-1?E:null)):(E=xt.call(this._longMonthsParse,J),E!==-1?E:(E=xt.call(this._shortMonthsParse,J),E!==-1?E:null))}function Md(u,h,b){var S,E,N;if(this._monthsParseExact)return $d.call(this,u,h,b);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),S=0;S<12;S++){if(E=y([2e3,S]),b&&!this._longMonthsParse[S]&&(this._longMonthsParse[S]=new RegExp("^"+this.months(E,"").replace(".","")+"$","i"),this._shortMonthsParse[S]=new RegExp("^"+this.monthsShort(E,"").replace(".","")+"$","i")),!b&&!this._monthsParse[S]&&(N="^"+this.months(E,"")+"|^"+this.monthsShort(E,""),this._monthsParse[S]=new RegExp(N.replace(".",""),"i")),b&&h==="MMMM"&&this._longMonthsParse[S].test(u))return S;if(b&&h==="MMM"&&this._shortMonthsParse[S].test(u))return S;if(!b&&this._monthsParse[S].test(u))return S}}function Uc(u,h){if(!u.isValid())return u;if(typeof h=="string"){if(/^\d+$/.test(h))h=qe(h);else if(h=u.localeData().monthsParse(h),!f(h))return u}var b=h,S=u.date();return S=S<29?S:Math.min(S,Fc(u.year(),b)),u._isUTC?u._d.setUTCMonth(b,S):u._d.setMonth(b,S),u}function Da(u){return u!=null?(Uc(this,u),e.updateOffset(this,!0),this):ho(this,"Month")}function ny(){return Fc(this.year(),this.month())}function Nd(u){return this._monthsParseExact?(s(this,"_monthsRegex")||Hc.call(this),u?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=Xg),this._monthsShortStrictRegex&&u?this._monthsShortStrictRegex:this._monthsShortRegex)}function Fa(u){return this._monthsParseExact?(s(this,"_monthsRegex")||Hc.call(this),u?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=ey),this._monthsStrictRegex&&u?this._monthsStrictRegex:this._monthsRegex)}function Hc(){function u(ve,Me){return Me.length-ve.length}var h=[],b=[],S=[],E,N,J,se;for(E=0;E<12;E++)N=y([2e3,E]),J=an(this.monthsShort(N,"")),se=an(this.months(N,"")),h.push(J),b.push(se),S.push(se),S.push(J);h.sort(u),b.sort(u),S.sort(u),this._monthsRegex=new RegExp("^("+S.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+b.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+h.join("|")+")","i")}function iy(u,h,b,S,E,N,J){var se;return u<100&&u>=0?(se=new Date(u+400,h,b,S,E,N,J),isFinite(se.getFullYear())&&se.setFullYear(u)):se=new Date(u,h,b,S,E,N,J),se}function ps(u){var h,b;return u<100&&u>=0?(b=Array.prototype.slice.call(arguments),b[0]=u+400,h=new Date(Date.UTC.apply(null,b)),isFinite(h.getUTCFullYear())&&h.setUTCFullYear(u)):h=new Date(Date.UTC.apply(null,arguments)),h}function go(u,h,b){var S=7+h-b,E=(7+ps(u,0,S).getUTCDay()-h)%7;return-E+S-1}function La(u,h,b,S,E){var N=(7+b-S)%7,J=go(u,S,E),se=1+7*(h-1)+N+J,ve,Me;return se<=0?(ve=u-1,Me=po(ve)+se):se>po(u)?(ve=u+1,Me=se-po(u)):(ve=u,Me=se),{year:ve,dayOfYear:Me}}function yo(u,h,b){var S=go(u.year(),h,b),E=Math.floor((u.dayOfYear()-S-1)/7)+1,N,J;return E<1?(J=u.year()-1,N=E+cn(J,h,b)):E>cn(u.year(),h,b)?(N=E-cn(u.year(),h,b),J=u.year()+1):(J=u.year(),N=E),{week:N,year:J}}function cn(u,h,b){var S=go(u,h,b),E=go(u+1,h,b);return(po(u)-S+E)/7}ce("w",["ww",2],"wo","week"),ce("W",["WW",2],"Wo","isoWeek"),le("w",ot,Ii),le("ww",ot,Ut),le("W",ot,Ii),le("WW",ot,Ut),fo(["w","ww","W","WW"],function(u,h,b,S){h[S.substr(0,1)]=qe(u)});function Bc(u){return yo(u,this._week.dow,this._week.doy).week}var Vc={dow:0,doy:6};function hs(){return this._week.dow}function Dd(){return this._week.doy}function Fd(u){var h=this.localeData().week(this);return u==null?h:this.add((u-h)*7,"d")}function sy(u){var h=yo(this,1,4).week;return u==null?h:this.add((u-h)*7,"d")}ce("d",0,"do","day"),ce("dd",0,0,function(u){return this.localeData().weekdaysMin(this,u)}),ce("ddd",0,0,function(u){return this.localeData().weekdaysShort(this,u)}),ce("dddd",0,0,function(u){return this.localeData().weekdays(this,u)}),ce("e",0,0,"weekday"),ce("E",0,0,"isoWeekday"),le("d",ot),le("e",ot),le("E",ot),le("dd",function(u,h){return h.weekdaysMinRegex(u)}),le("ddd",function(u,h){return h.weekdaysShortRegex(u)}),le("dddd",function(u,h){return h.weekdaysRegex(u)}),fo(["dd","ddd","dddd"],function(u,h,b,S){var E=b._locale.weekdaysParse(u,S,b._strict);E!=null?h.d=E:C(b).invalidWeekday=u}),fo(["d","e","E"],function(u,h,b,S){h[S]=qe(u)});function Ld(u,h){return typeof u!="string"?u:isNaN(u)?(u=h.weekdaysParse(u),typeof u=="number"?u:null):parseInt(u,10)}function jd(u,h){return typeof u=="string"?h.weekdaysParse(u)%7||7:isNaN(u)?null:u}function ja(u,h){return u.slice(h,7).concat(u.slice(0,h))}var Ud="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Hd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),oy="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ay=uo,Bd=uo,ly=uo;function cy(u,h){var b=n(this._weekdays)?this._weekdays:this._weekdays[u&&u!==!0&&this._weekdays.isFormat.test(h)?"format":"standalone"];return u===!0?ja(b,this._week.dow):u?b[u.day()]:b}function uy(u){return u===!0?ja(this._weekdaysShort,this._week.dow):u?this._weekdaysShort[u.day()]:this._weekdaysShort}function fy(u){return u===!0?ja(this._weekdaysMin,this._week.dow):u?this._weekdaysMin[u.day()]:this._weekdaysMin}function Wc(u,h,b){var S,E,N,J=u.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],S=0;S<7;++S)N=y([2e3,1]).day(S),this._minWeekdaysParse[S]=this.weekdaysMin(N,"").toLocaleLowerCase(),this._shortWeekdaysParse[S]=this.weekdaysShort(N,"").toLocaleLowerCase(),this._weekdaysParse[S]=this.weekdays(N,"").toLocaleLowerCase();return b?h==="dddd"?(E=xt.call(this._weekdaysParse,J),E!==-1?E:null):h==="ddd"?(E=xt.call(this._shortWeekdaysParse,J),E!==-1?E:null):(E=xt.call(this._minWeekdaysParse,J),E!==-1?E:null):h==="dddd"?(E=xt.call(this._weekdaysParse,J),E!==-1||(E=xt.call(this._shortWeekdaysParse,J),E!==-1)?E:(E=xt.call(this._minWeekdaysParse,J),E!==-1?E:null)):h==="ddd"?(E=xt.call(this._shortWeekdaysParse,J),E!==-1||(E=xt.call(this._weekdaysParse,J),E!==-1)?E:(E=xt.call(this._minWeekdaysParse,J),E!==-1?E:null)):(E=xt.call(this._minWeekdaysParse,J),E!==-1||(E=xt.call(this._weekdaysParse,J),E!==-1)?E:(E=xt.call(this._shortWeekdaysParse,J),E!==-1?E:null))}function dy(u,h,b){var S,E,N;if(this._weekdaysParseExact)return Wc.call(this,u,h,b);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),S=0;S<7;S++){if(E=y([2e3,1]).day(S),b&&!this._fullWeekdaysParse[S]&&(this._fullWeekdaysParse[S]=new RegExp("^"+this.weekdays(E,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[S]=new RegExp("^"+this.weekdaysShort(E,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[S]=new RegExp("^"+this.weekdaysMin(E,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[S]||(N="^"+this.weekdays(E,"")+"|^"+this.weekdaysShort(E,"")+"|^"+this.weekdaysMin(E,""),this._weekdaysParse[S]=new RegExp(N.replace(".",""),"i")),b&&h==="dddd"&&this._fullWeekdaysParse[S].test(u))return S;if(b&&h==="ddd"&&this._shortWeekdaysParse[S].test(u))return S;if(b&&h==="dd"&&this._minWeekdaysParse[S].test(u))return S;if(!b&&this._weekdaysParse[S].test(u))return S}}function py(u){if(!this.isValid())return u!=null?this:NaN;var h=ho(this,"Day");return u!=null?(u=Ld(u,this.localeData()),this.add(u-h,"d")):h}function hy(u){if(!this.isValid())return u!=null?this:NaN;var h=(this.day()+7-this.localeData()._week.dow)%7;return u==null?h:this.add(u-h,"d")}function my(u){if(!this.isValid())return u!=null?this:NaN;if(u!=null){var h=jd(u,this.localeData());return this.day(this.day()%7?h:h-7)}else return this.day()||7}function gy(u){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||zc.call(this),u?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=ay),this._weekdaysStrictRegex&&u?this._weekdaysStrictRegex:this._weekdaysRegex)}function ut(u){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||zc.call(this),u?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Bd),this._weekdaysShortStrictRegex&&u?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function at(u){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||zc.call(this),u?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ly),this._weekdaysMinStrictRegex&&u?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function zc(){function u(Dt,Dn){return Dn.length-Dt.length}var h=[],b=[],S=[],E=[],N,J,se,ve,Me;for(N=0;N<7;N++)J=y([2e3,1]).day(N),se=an(this.weekdaysMin(J,"")),ve=an(this.weekdaysShort(J,"")),Me=an(this.weekdays(J,"")),h.push(se),b.push(ve),S.push(Me),E.push(se),E.push(ve),E.push(Me);h.sort(u),b.sort(u),S.sort(u),E.sort(u),this._weekdaysRegex=new RegExp("^("+E.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+S.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+b.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+h.join("|")+")","i")}function Jc(){return this.hours()%12||12}function yy(){return this.hours()||24}ce("H",["HH",2],0,"hour"),ce("h",["hh",2],0,Jc),ce("k",["kk",2],0,yy),ce("hmm",0,0,function(){return""+Jc.apply(this)+_e(this.minutes(),2)}),ce("hmmss",0,0,function(){return""+Jc.apply(this)+_e(this.minutes(),2)+_e(this.seconds(),2)}),ce("Hmm",0,0,function(){return""+this.hours()+_e(this.minutes(),2)}),ce("Hmmss",0,0,function(){return""+this.hours()+_e(this.minutes(),2)+_e(this.seconds(),2)});function Vd(u,h){ce(u,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),h)})}Vd("a",!0),Vd("A",!1);function Wd(u,h){return h._meridiemParse}le("a",Wd),le("A",Wd),le("H",ot,qa),le("h",ot,Ii),le("k",ot,Ii),le("HH",ot,Ut),le("hh",ot,Ut),le("kk",ot,Ut),le("hmm",ka),le("hmmss",Ta),le("Hmm",ka),le("Hmmss",Ta),Ke(["H","HH"],At),Ke(["k","kk"],function(u,h,b){var S=qe(u);h[At]=S===24?0:S}),Ke(["a","A"],function(u,h,b){b._isPm=b._locale.isPM(u),b._meridiem=u}),Ke(["h","hh"],function(u,h,b){h[At]=qe(u),C(b).bigHour=!0}),Ke("hmm",function(u,h,b){var S=u.length-2;h[At]=qe(u.substr(0,S)),h[Pr]=qe(u.substr(S)),C(b).bigHour=!0}),Ke("hmmss",function(u,h,b){var S=u.length-4,E=u.length-2;h[At]=qe(u.substr(0,S)),h[Pr]=qe(u.substr(S,2)),h[Tn]=qe(u.substr(E)),C(b).bigHour=!0}),Ke("Hmm",function(u,h,b){var S=u.length-2;h[At]=qe(u.substr(0,S)),h[Pr]=qe(u.substr(S))}),Ke("Hmmss",function(u,h,b){var S=u.length-4,E=u.length-2;h[At]=qe(u.substr(0,S)),h[Pr]=qe(u.substr(S,2)),h[Tn]=qe(u.substr(E))});function vy(u){return(u+"").toLowerCase().charAt(0)==="p"}var zd=/[ap]\.?m?\.?/i,by=ds("Hours",!0);function Nt(u,h,b){return u>11?b?"pm":"PM":b?"am":"AM"}var Ua={calendar:ue,longDateFormat:Or,invalidDate:mt,ordinal:oo,dayOfMonthOrdinalParse:Jt,relativeTime:Wg,months:qd,monthsShort:Lc,week:Vc,weekdays:Ud,weekdaysMin:oy,weekdaysShort:Hd,meridiemParse:zd},Qe={},ms={},ki;function kr(u,h){var b,S=Math.min(u.length,h.length);for(b=0;b<S;b+=1)if(u[b]!==h[b])return b;return S}function Yc(u){return u&&u.toLowerCase().replace("_","-")}function Jd(u){for(var h=0,b,S,E,N;h<u.length;){for(N=Yc(u[h]).split("-"),b=N.length,S=Yc(u[h+1]),S=S?S.split("-"):null;b>0;){if(E=vo(N.slice(0,b).join("-")),E)return E;if(S&&S.length>=b&&kr(N,S)>=b-1)break;b--}h++}return ki}function Yd(u){return!!(u&&u.match("^[^/\\\\]*$"))}function vo(u){var h=null,b;if(Qe[u]===void 0&&typeof xl<"u"&&xl&&xl.exports&&Yd(u))try{h=ki._abbr,b=it,b("./locale/"+u),An(h)}catch{Qe[u]=null}return Qe[u]}function An(u,h){var b;return u&&(l(h)?b=qn(u):b=Ha(u,h),b?ki=b:typeof console<"u"&&console.warn&&console.warn("Locale "+u+" not found. Did you forget to load it?")),ki._abbr}function Ha(u,h){if(h!==null){var b,S=Ua;if(h.abbr=u,Qe[u]!=null)M("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."),S=Qe[u]._config;else if(h.parentLocale!=null)if(Qe[h.parentLocale]!=null)S=Qe[h.parentLocale]._config;else if(b=vo(h.parentLocale),b!=null)S=b._config;else return ms[h.parentLocale]||(ms[h.parentLocale]=[]),ms[h.parentLocale].push({name:u,config:h}),null;return Qe[u]=new K(Y(S,h)),ms[u]&&ms[u].forEach(function(E){Ha(E.name,E.config)}),An(u),Qe[u]}else return delete Qe[u],null}function mr(u,h){if(h!=null){var b,S,E=Ua;Qe[u]!=null&&Qe[u].parentLocale!=null?Qe[u].set(Y(Qe[u]._config,h)):(S=vo(u),S!=null&&(E=S._config),h=Y(E,h),S==null&&(h.abbr=u),b=new K(h),b.parentLocale=Qe[u],Qe[u]=b),An(u)}else Qe[u]!=null&&(Qe[u].parentLocale!=null?(Qe[u]=Qe[u].parentLocale,u===An()&&An(u)):Qe[u]!=null&&delete Qe[u]);return Qe[u]}function qn(u){var h;if(u&&u._locale&&u._locale._abbr&&(u=u._locale._abbr),!u)return ki;if(!n(u)){if(h=vo(u),h)return h;u=[u]}return Jd(u)}function gr(){return ne(Qe)}function Gc(u){var h,b=u._a;return b&&C(u).overflow===-2&&(h=b[kn]<0||b[kn]>11?kn:b[ln]<1||b[ln]>Fc(b[Gt],b[kn])?ln:b[At]<0||b[At]>24||b[At]===24&&(b[Pr]!==0||b[Tn]!==0||b[Pi]!==0)?At:b[Pr]<0||b[Pr]>59?Pr:b[Tn]<0||b[Tn]>59?Tn:b[Pi]<0||b[Pi]>999?Pi:-1,C(u)._overflowDayOfYear&&(h<Gt||h>ln)&&(h=ln),C(u)._overflowWeeks&&h===-1&&(h=Td),C(u)._overflowWeekday&&h===-1&&(h=Gg),C(u).overflow=h),u}var Gd=/^\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)?)?$/,ci=/^\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)?)?$/,Ba=/Z|[+-]\d\d(?::?\d\d)?/,gs=[["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]],lt=[["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/]],ui=/^\/?Date\((-?\d+)/i,Kc=/^(?:(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}))$/,Sy={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Va(u){var h,b,S=u._i,E=Gd.exec(S)||ci.exec(S),N,J,se,ve,Me=gs.length,Dt=lt.length;if(E){for(C(u).iso=!0,h=0,b=Me;h<b;h++)if(gs[h][1].exec(E[1])){J=gs[h][0],N=gs[h][2]!==!1;break}if(J==null){u._isValid=!1;return}if(E[3]){for(h=0,b=Dt;h<b;h++)if(lt[h][1].exec(E[3])){se=(E[2]||" ")+lt[h][0];break}if(se==null){u._isValid=!1;return}}if(!N&&se!=null){u._isValid=!1;return}if(E[4])if(Ba.exec(E[4]))ve="Z";else{u._isValid=!1;return}u._f=J+(se||"")+(ve||""),za(u)}else u._isValid=!1}function wy(u,h,b,S,E,N){var J=[_y(u),Lc.indexOf(h),parseInt(b,10),parseInt(S,10),parseInt(E,10)];return N&&J.push(parseInt(N,10)),J}function _y(u){var h=parseInt(u,10);return h<=49?2e3+h:h<=999?1900+h:h}function Ry(u){return u.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Kd(u,h,b){if(u){var S=Hd.indexOf(u),E=new Date(h[0],h[1],h[2]).getDay();if(S!==E)return C(b).weekdayMismatch=!0,b._isValid=!1,!1}return!0}function Wa(u,h,b){if(u)return Sy[u];if(h)return 0;var S=parseInt(b,10),E=S%100,N=(S-E)/100;return N*60+E}function Ti(u){var h=Kc.exec(Ry(u._i)),b;if(h){if(b=wy(h[4],h[3],h[2],h[5],h[6],h[7]),!Kd(h[1],b,u))return;u._a=b,u._tzm=Wa(h[8],h[9],h[10]),u._d=ps.apply(null,u._a),u._d.setUTCMinutes(u._d.getUTCMinutes()-u._tzm),C(u).rfc2822=!0}else u._isValid=!1}function xy(u){var h=ui.exec(u._i);if(h!==null){u._d=new Date(+h[1]);return}if(Va(u),u._isValid===!1)delete u._isValid;else return;if(Ti(u),u._isValid===!1)delete u._isValid;else return;u._strict?u._isValid=!1:e.createFromInputFallback(u)}e.createFromInputFallback=_("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(u){u._d=new Date(u._i+(u._useUTC?" UTC":""))});function Ai(u,h,b){return u??h??b}function Qd(u){var h=new Date(e.now());return u._useUTC?[h.getUTCFullYear(),h.getUTCMonth(),h.getUTCDate()]:[h.getFullYear(),h.getMonth(),h.getDate()]}function bo(u){var h,b,S=[],E,N,J;if(!u._d){for(E=Qd(u),u._w&&u._a[ln]==null&&u._a[kn]==null&&Qc(u),u._dayOfYear!=null&&(J=Ai(u._a[Gt],E[Gt]),(u._dayOfYear>po(J)||u._dayOfYear===0)&&(C(u)._overflowDayOfYear=!0),b=ps(J,0,u._dayOfYear),u._a[kn]=b.getUTCMonth(),u._a[ln]=b.getUTCDate()),h=0;h<3&&u._a[h]==null;++h)u._a[h]=S[h]=E[h];for(;h<7;h++)u._a[h]=S[h]=u._a[h]==null?h===2?1:0:u._a[h];u._a[At]===24&&u._a[Pr]===0&&u._a[Tn]===0&&u._a[Pi]===0&&(u._nextDay=!0,u._a[At]=0),u._d=(u._useUTC?ps:iy).apply(null,S),N=u._useUTC?u._d.getUTCDay():u._d.getDay(),u._tzm!=null&&u._d.setUTCMinutes(u._d.getUTCMinutes()-u._tzm),u._nextDay&&(u._a[At]=24),u._w&&typeof u._w.d<"u"&&u._w.d!==N&&(C(u).weekdayMismatch=!0)}}function Qc(u){var h,b,S,E,N,J,se,ve,Me;h=u._w,h.GG!=null||h.W!=null||h.E!=null?(N=1,J=4,b=Ai(h.GG,u._a[Gt],yo(tt(),1,4).year),S=Ai(h.W,1),E=Ai(h.E,1),(E<1||E>7)&&(ve=!0)):(N=u._locale._week.dow,J=u._locale._week.doy,Me=yo(tt(),N,J),b=Ai(h.gg,u._a[Gt],Me.year),S=Ai(h.w,Me.week),h.d!=null?(E=h.d,(E<0||E>6)&&(ve=!0)):h.e!=null?(E=h.e+N,(h.e<0||h.e>6)&&(ve=!0)):E=N),S<1||S>cn(b,N,J)?C(u)._overflowWeeks=!0:ve!=null?C(u)._overflowWeekday=!0:(se=La(b,S,E,N,J),u._a[Gt]=se.year,u._dayOfYear=se.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function za(u){if(u._f===e.ISO_8601){Va(u);return}if(u._f===e.RFC_2822){Ti(u);return}u._a=[],C(u).empty=!0;var h=""+u._i,b,S,E,N,J,se=h.length,ve=0,Me,Dt;for(E=zr(u._f,u._locale).match(he)||[],Dt=E.length,b=0;b<Dt;b++)N=E[b],S=(h.match(Jg(N,u))||[])[0],S&&(J=h.substr(0,h.indexOf(S)),J.length>0&&C(u).unusedInput.push(J),h=h.slice(h.indexOf(S)+S.length),ve+=S.length),Et[N]?(S?C(u).empty=!1:C(u).unusedTokens.push(N),Dc(N,S,u)):u._strict&&!S&&C(u).unusedTokens.push(N);C(u).charsLeftOver=se-ve,h.length>0&&C(u).unusedInput.push(h),u._a[At]<=12&&C(u).bigHour===!0&&u._a[At]>0&&(C(u).bigHour=void 0),C(u).parsedDateParts=u._a.slice(0),C(u).meridiem=u._meridiem,u._a[At]=Cy(u._locale,u._a[At],u._meridiem),Me=C(u).era,Me!==null&&(u._a[Gt]=u._locale.erasConvertYear(Me,u._a[Gt])),bo(u),Gc(u)}function Cy(u,h,b){var S;return b==null?h:u.meridiemHour!=null?u.meridiemHour(h,b):(u.isPM!=null&&(S=u.isPM(b),S&&h<12&&(h+=12),!S&&h===12&&(h=0)),h)}function Zc(u){var h,b,S,E,N,J,se=!1,ve=u._f.length;if(ve===0){C(u).invalidFormat=!0,u._d=new Date(NaN);return}for(E=0;E<ve;E++)N=0,J=!1,h=V({},u),u._useUTC!=null&&(h._useUTC=u._useUTC),h._f=u._f[E],za(h),T(h)&&(J=!0),N+=C(h).charsLeftOver,N+=C(h).unusedTokens.length*10,C(h).score=N,se?N<S&&(S=N,b=h):(S==null||N<S||J)&&(S=N,b=h,J&&(se=!0));g(u,b||h)}function Xc(u){if(!u._d){var h=hr(u._i),b=h.day===void 0?h.date:h.day;u._a=m([h.year,h.month,b,h.hour,h.minute,h.second,h.millisecond],function(S){return S&&parseInt(S,10)}),bo(u)}}function Ey(u){var h=new W(Gc(eu(u)));return h._nextDay&&(h.add(1,"d"),h._nextDay=void 0),h}function eu(u){var h=u._i,b=u._f;return u._locale=u._locale||qn(u._l),h===null||b===void 0&&h===""?A({nullInput:!0}):(typeof h=="string"&&(u._i=h=u._locale.preparse(h)),X(h)?new W(Gc(h)):(d(h)?u._d=h:n(b)?Zc(u):b?za(u):yr(u),T(u)||(u._d=null),u))}function yr(u){var h=u._i;l(h)?u._d=new Date(e.now()):d(h)?u._d=new Date(h.valueOf()):typeof h=="string"?xy(u):n(h)?(u._a=m(h.slice(0),function(b){return parseInt(b,10)}),bo(u)):i(h)?Xc(u):f(h)?u._d=new Date(h):e.createFromInputFallback(u)}function Ja(u,h,b,S,E){var N={};return(h===!0||h===!1)&&(S=h,h=void 0),(b===!0||b===!1)&&(S=b,b=void 0),(i(u)&&a(u)||n(u)&&u.length===0)&&(u=void 0),N._isAMomentObject=!0,N._useUTC=N._isUTC=E,N._l=b,N._i=u,N._f=h,N._strict=S,Ey(N)}function tt(u,h,b,S){return Ja(u,h,b,S,!1)}var Zd=_("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var u=tt.apply(null,arguments);return this.isValid()&&u.isValid()?u<this?this:u:A()}),Xd=_("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var u=tt.apply(null,arguments);return this.isValid()&&u.isValid()?u>this?this:u:A()});function ep(u,h){var b,S;if(h.length===1&&n(h[0])&&(h=h[0]),!h.length)return tt();for(b=h[0],S=1;S<h.length;++S)(!h[S].isValid()||h[S][u](b))&&(b=h[S]);return b}function Oy(){var u=[].slice.call(arguments,0);return ep("isBefore",u)}function Iy(){var u=[].slice.call(arguments,0);return ep("isAfter",u)}var Py=function(){return Date.now?Date.now():+new Date},So=["year","quarter","month","week","day","hour","minute","second","millisecond"];function ys(u){var h,b=!1,S,E=So.length;for(h in u)if(s(u,h)&&!(xt.call(So,h)!==-1&&(u[h]==null||!isNaN(u[h]))))return!1;for(S=0;S<E;++S)if(u[So[S]]){if(b)return!1;parseFloat(u[So[S]])!==qe(u[So[S]])&&(b=!0)}return!0}function ky(){return this._isValid}function Ty(){return rt(NaN)}function vs(u){var h=hr(u),b=h.year||0,S=h.quarter||0,E=h.month||0,N=h.week||h.isoWeek||0,J=h.day||0,se=h.hour||0,ve=h.minute||0,Me=h.second||0,Dt=h.millisecond||0;this._isValid=ys(h),this._milliseconds=+Dt+Me*1e3+ve*6e4+se*1e3*60*60,this._days=+J+N*7,this._months=+E+S*3+b*12,this._data={},this._locale=qn(),this._bubble()}function wo(u){return u instanceof vs}function un(u){return u<0?Math.round(-1*u)*-1:Math.round(u)}function Ya(u,h,b){var S=Math.min(u.length,h.length),E=Math.abs(u.length-h.length),N=0,J;for(J=0;J<S;J++)(b&&u[J]!==h[J]||!b&&qe(u[J])!==qe(h[J]))&&N++;return N+E}function tp(u,h){ce(u,0,0,function(){var b=this.utcOffset(),S="+";return b<0&&(b=-b,S="-"),S+_e(~~(b/60),2)+h+_e(~~b%60,2)})}tp("Z",":"),tp("ZZ",""),le("Z",Aa),le("ZZ",Aa),Ke(["Z","ZZ"],function(u,h,b){b._useUTC=!0,b._tzm=tu(Aa,u)});var Ay=/([\+\-]|\d\d)/gi;function tu(u,h){var b=(h||"").match(u),S,E,N;return b===null?null:(S=b[b.length-1]||[],E=(S+"").match(Ay)||["-",0,0],N=+(E[1]*60)+qe(E[2]),N===0?0:E[0]==="+"?N:-N)}function fi(u,h){var b,S;return h._isUTC?(b=h.clone(),S=(X(u)||d(u)?u.valueOf():tt(u).valueOf())-b.valueOf(),b._d.setTime(b._d.valueOf()+S),e.updateOffset(b,!1),b):tt(u).local()}function vr(u){return-Math.round(u._d.getTimezoneOffset())}e.updateOffset=function(){};function rp(u,h,b){var S=this._offset||0,E;if(!this.isValid())return u!=null?this:NaN;if(u!=null){if(typeof u=="string"){if(u=tu(Aa,u),u===null)return this}else Math.abs(u)<16&&!b&&(u=u*60);return!this._isUTC&&h&&(E=vr(this)),this._offset=u,this._isUTC=!0,E!=null&&this.add(E,"m"),S!==u&&(!h||this._changeInProgress?_o(this,rt(u-S,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?S:vr(this)}function qy(u,h){return u!=null?(typeof u!="string"&&(u=-u),this.utcOffset(u,h),this):-this.utcOffset()}function $y(u){return this.utcOffset(0,u)}function My(u){return this._isUTC&&(this.utcOffset(0,u),this._isUTC=!1,u&&this.subtract(vr(this),"m")),this}function Ny(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var u=tu(Mc,this._i);u!=null?this.utcOffset(u):this.utcOffset(0,!0)}return this}function Dy(u){return this.isValid()?(u=u?tt(u).utcOffset():0,(this.utcOffset()-u)%60===0):!1}function di(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function L(){if(!l(this._isDSTShifted))return this._isDSTShifted;var u={},h;return V(u,this),u=eu(u),u._a?(h=u._isUTC?y(u._a):tt(u._a),this._isDSTShifted=this.isValid()&&Ya(u._a,h.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function G(){return this.isValid()?!this._isUTC:!1}function z(){return this.isValid()?this._isUTC:!1}function ae(){return this.isValid()?this._isUTC&&this._offset===0:!1}var be=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Ye=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function rt(u,h){var b=u,S=null,E,N,J;return wo(u)?b={ms:u._milliseconds,d:u._days,M:u._months}:f(u)||!isNaN(+u)?(b={},h?b[h]=+u:b.milliseconds=+u):(S=be.exec(u))?(E=S[1]==="-"?-1:1,b={y:0,d:qe(S[ln])*E,h:qe(S[At])*E,m:qe(S[Pr])*E,s:qe(S[Tn])*E,ms:qe(un(S[Pi]*1e3))*E}):(S=Ye.exec(u))?(E=S[1]==="-"?-1:1,b={y:Ue(S[2],E),M:Ue(S[3],E),w:Ue(S[4],E),d:Ue(S[5],E),h:Ue(S[6],E),m:Ue(S[7],E),s:Ue(S[8],E)}):b==null?b={}:typeof b=="object"&&("from"in b||"to"in b)&&(J=Fy(tt(b.from),tt(b.to)),b={},b.ms=J.milliseconds,b.M=J.months),N=new vs(b),wo(u)&&s(u,"_locale")&&(N._locale=u._locale),wo(u)&&s(u,"_isValid")&&(N._isValid=u._isValid),N}rt.fn=vs.prototype,rt.invalid=Ty;function Ue(u,h){var b=u&&parseFloat(u.replace(",","."));return(isNaN(b)?0:b)*h}function Ga(u,h){var b={};return b.months=h.month()-u.month()+(h.year()-u.year())*12,u.clone().add(b.months,"M").isAfter(h)&&--b.months,b.milliseconds=+h-+u.clone().add(b.months,"M"),b}function Fy(u,h){var b;return u.isValid()&&h.isValid()?(h=fi(h,u),u.isBefore(h)?b=Ga(u,h):(b=Ga(h,u),b.milliseconds=-b.milliseconds,b.months=-b.months),b):{milliseconds:0,months:0}}function br(u,h){return function(b,S){var E,N;return S!==null&&!isNaN(+S)&&(M(h,"moment()."+h+"(period, number) is deprecated. Please use moment()."+h+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),N=b,b=S,S=N),E=rt(b,S),_o(this,E,u),this}}function _o(u,h,b,S){var E=h._milliseconds,N=un(h._days),J=un(h._months);u.isValid()&&(S=S??!0,J&&Uc(u,ho(u,"Month")+J*b),N&&mo(u,"Date",ho(u,"Date")+N*b),E&&u._d.setTime(u._d.valueOf()+E*b),S&&e.updateOffset(u,N||J))}var Ly=br(1,"add"),bs=br(-1,"subtract");function Ro(u){return typeof u=="string"||u instanceof String}function Ka(u){return X(u)||d(u)||Ro(u)||f(u)||jy(u)||Ze(u)||u===null||u===void 0}function Ze(u){var h=i(u)&&!a(u),b=!1,S=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],E,N,J=S.length;for(E=0;E<J;E+=1)N=S[E],b=b||s(u,N);return h&&b}function jy(u){var h=n(u),b=!1;return h&&(b=u.filter(function(S){return!f(S)&&Ro(u)}).length===0),h&&b}function np(u){var h=i(u)&&!a(u),b=!1,S=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],E,N;for(E=0;E<S.length;E+=1)N=S[E],b=b||s(u,N);return h&&b}function Qa(u,h){var b=u.diff(h,"days",!0);return b<-6?"sameElse":b<-1?"lastWeek":b<0?"lastDay":b<1?"sameDay":b<2?"nextDay":b<7?"nextWeek":"sameElse"}function Uy(u,h){arguments.length===1&&(arguments[0]?Ka(arguments[0])?(u=arguments[0],h=void 0):np(arguments[0])&&(h=arguments[0],u=void 0):(u=void 0,h=void 0));var b=u||tt(),S=fi(b,this).startOf("day"),E=e.calendarFormat(this,S)||"sameElse",N=h&&(j(h[E])?h[E].call(this,b):h[E]);return this.format(N||this.localeData().calendar(E,this,tt(b)))}function Hy(){return new W(this)}function By(u,h){var b=X(u)?u:tt(u);return this.isValid()&&b.isValid()?(h=Yt(h)||"millisecond",h==="millisecond"?this.valueOf()>b.valueOf():b.valueOf()<this.clone().startOf(h).valueOf()):!1}function Za(u,h){var b=X(u)?u:tt(u);return this.isValid()&&b.isValid()?(h=Yt(h)||"millisecond",h==="millisecond"?this.valueOf()<b.valueOf():this.clone().endOf(h).valueOf()<b.valueOf()):!1}function pi(u,h,b,S){var E=X(u)?u:tt(u),N=X(h)?h:tt(h);return this.isValid()&&E.isValid()&&N.isValid()?(S=S||"()",(S[0]==="("?this.isAfter(E,b):!this.isBefore(E,b))&&(S[1]===")"?this.isBefore(N,b):!this.isAfter(N,b))):!1}function Xa(u,h){var b=X(u)?u:tt(u),S;return this.isValid()&&b.isValid()?(h=Yt(h)||"millisecond",h==="millisecond"?this.valueOf()===b.valueOf():(S=b.valueOf(),this.clone().startOf(h).valueOf()<=S&&S<=this.clone().endOf(h).valueOf())):!1}function ip(u,h){return this.isSame(u,h)||this.isAfter(u,h)}function el(u,h){return this.isSame(u,h)||this.isBefore(u,h)}function sp(u,h,b){var S,E,N;if(!this.isValid())return NaN;if(S=fi(u,this),!S.isValid())return NaN;switch(E=(S.utcOffset()-this.utcOffset())*6e4,h=Yt(h),h){case"year":N=xo(this,S)/12;break;case"month":N=xo(this,S);break;case"quarter":N=xo(this,S)/3;break;case"second":N=(this-S)/1e3;break;case"minute":N=(this-S)/6e4;break;case"hour":N=(this-S)/36e5;break;case"day":N=(this-S-E)/864e5;break;case"week":N=(this-S-E)/6048e5;break;default:N=this-S}return b?N:Ir(N)}function xo(u,h){if(u.date()<h.date())return-xo(h,u);var b=(h.year()-u.year())*12+(h.month()-u.month()),S=u.clone().add(b,"months"),E,N;return h-S<0?(E=u.clone().add(b-1,"months"),N=(h-S)/(S-E)):(E=u.clone().add(b+1,"months"),N=(h-S)/(E-S)),-(b+N)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function tl(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function op(u){if(!this.isValid())return null;var h=u!==!0,b=h?this.clone().utc():this;return b.year()<0||b.year()>9999?Rt(b,h?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):j(Date.prototype.toISOString)?h?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Rt(b,"Z")):Rt(b,h?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Co(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var u="moment",h="",b,S,E,N;return this.isLocal()||(u=this.utcOffset()===0?"moment.utc":"moment.parseZone",h="Z"),b="["+u+'("]',S=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",E="-MM-DD[T]HH:mm:ss.SSS",N=h+'[")]',this.format(b+S+E+N)}function qi(u){u||(u=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var h=Rt(this,u);return this.localeData().postformat(h)}function rl(u,h){return this.isValid()&&(X(u)&&u.isValid()||tt(u).isValid())?rt({to:this,from:u}).locale(this.locale()).humanize(!h):this.localeData().invalidDate()}function Vy(u){return this.from(tt(),u)}function Wy(u,h){return this.isValid()&&(X(u)&&u.isValid()||tt(u).isValid())?rt({from:this,to:u}).locale(this.locale()).humanize(!h):this.localeData().invalidDate()}function zy(u){return this.to(tt(),u)}function Eo(u){var h;return u===void 0?this._locale._abbr:(h=qn(u),h!=null&&(this._locale=h),this)}var Oo=_("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(u){return u===void 0?this.localeData():this.locale(u)});function nl(){return this._locale}var il=1e3,$i=60*il,sl=60*$i,ap=(365*400+97)*24*sl;function gt(u,h){return(u%h+h)%h}function Ht(u,h,b){return u<100&&u>=0?new Date(u+400,h,b)-ap:new Date(u,h,b).valueOf()}function lp(u,h,b){return u<100&&u>=0?Date.UTC(u+400,h,b)-ap:Date.UTC(u,h,b)}function Jy(u){var h,b;if(u=Yt(u),u===void 0||u==="millisecond"||!this.isValid())return this;switch(b=this._isUTC?lp:Ht,u){case"year":h=b(this.year(),0,1);break;case"quarter":h=b(this.year(),this.month()-this.month()%3,1);break;case"month":h=b(this.year(),this.month(),1);break;case"week":h=b(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":h=b(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":h=b(this.year(),this.month(),this.date());break;case"hour":h=this._d.valueOf(),h-=gt(h+(this._isUTC?0:this.utcOffset()*$i),sl);break;case"minute":h=this._d.valueOf(),h-=gt(h,$i);break;case"second":h=this._d.valueOf(),h-=gt(h,il);break}return this._d.setTime(h),e.updateOffset(this,!0),this}function cp(u){var h,b;if(u=Yt(u),u===void 0||u==="millisecond"||!this.isValid())return this;switch(b=this._isUTC?lp:Ht,u){case"year":h=b(this.year()+1,0,1)-1;break;case"quarter":h=b(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":h=b(this.year(),this.month()+1,1)-1;break;case"week":h=b(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":h=b(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":h=b(this.year(),this.month(),this.date()+1)-1;break;case"hour":h=this._d.valueOf(),h+=sl-gt(h+(this._isUTC?0:this.utcOffset()*$i),sl)-1;break;case"minute":h=this._d.valueOf(),h+=$i-gt(h,$i)-1;break;case"second":h=this._d.valueOf(),h+=il-gt(h,il)-1;break}return this._d.setTime(h),e.updateOffset(this,!0),this}function Yy(){return this._d.valueOf()-(this._offset||0)*6e4}function ru(){return Math.floor(this.valueOf()/1e3)}function Io(){return new Date(this.valueOf())}function nu(){var u=this;return[u.year(),u.month(),u.date(),u.hour(),u.minute(),u.second(),u.millisecond()]}function Ss(){var u=this;return{years:u.year(),months:u.month(),date:u.date(),hours:u.hours(),minutes:u.minutes(),seconds:u.seconds(),milliseconds:u.milliseconds()}}function Po(){return this.isValid()?this.toISOString():null}function ko(){return T(this)}function ol(){return g({},C(this))}function ws(){return C(this).overflow}function Gy(){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"),le("N",nr),le("NN",nr),le("NNN",nr),le("NNNN",$e),le("NNNNN",ev),Ke(["N","NN","NNN","NNNN","NNNNN"],function(u,h,b,S){var E=b._locale.erasParse(u,S,b._strict);E?C(b).era=E:C(b).invalidEra=u}),le("y",li),le("yy",li),le("yyy",li),le("yyyy",li),le("yo",tv),Ke(["y","yy","yyy","yyyy"],Gt),Ke(["yo"],function(u,h,b,S){var E;b._locale._eraYearOrdinalRegex&&(E=u.match(b._locale._eraYearOrdinalRegex)),b._locale.eraYearOrdinalParse?h[Gt]=b._locale.eraYearOrdinalParse(u,E):h[Gt]=parseInt(u,10)});function Ky(u,h){var b,S,E,N=this._eras||qn("en")._eras;for(b=0,S=N.length;b<S;++b)switch(typeof N[b].since==="string"&&(E=e(N[b].since).startOf("day"),N[b].since=E.valueOf()),typeof N[b].until){case"undefined":N[b].until=1/0;break;case"string":E=e(N[b].until).startOf("day").valueOf(),N[b].until=E.valueOf();break}return N}function Qy(u,h,b){var S,E,N=this.eras(),J,se,ve;for(u=u.toUpperCase(),S=0,E=N.length;S<E;++S)if(J=N[S].name.toUpperCase(),se=N[S].abbr.toUpperCase(),ve=N[S].narrow.toUpperCase(),b)switch(h){case"N":case"NN":case"NNN":if(se===u)return N[S];break;case"NNNN":if(J===u)return N[S];break;case"NNNNN":if(ve===u)return N[S];break}else if([J,se,ve].indexOf(u)>=0)return N[S]}function Zy(u,h){var b=u.since<=u.until?1:-1;return h===void 0?e(u.since).year():e(u.since).year()+(h-u.offset)*b}function Xy(){var u,h,b,S=this.localeData().eras();for(u=0,h=S.length;u<h;++u)if(b=this.clone().startOf("day").valueOf(),S[u].since<=b&&b<=S[u].until||S[u].until<=b&&b<=S[u].since)return S[u].name;return""}function al(){var u,h,b,S=this.localeData().eras();for(u=0,h=S.length;u<h;++u)if(b=this.clone().startOf("day").valueOf(),S[u].since<=b&&b<=S[u].until||S[u].until<=b&&b<=S[u].since)return S[u].narrow;return""}function To(){var u,h,b,S=this.localeData().eras();for(u=0,h=S.length;u<h;++u)if(b=this.clone().startOf("day").valueOf(),S[u].since<=b&&b<=S[u].until||S[u].until<=b&&b<=S[u].since)return S[u].abbr;return""}function up(){var u,h,b,S,E=this.localeData().eras();for(u=0,h=E.length;u<h;++u)if(b=E[u].since<=E[u].until?1:-1,S=this.clone().startOf("day").valueOf(),E[u].since<=S&&S<=E[u].until||E[u].until<=S&&S<=E[u].since)return(this.year()-e(E[u].since).year())*b+E[u].offset;return this.year()}function O(u){return s(this,"_erasNameRegex")||iu.call(this),u?this._erasNameRegex:this._erasRegex}function _s(u){return s(this,"_erasAbbrRegex")||iu.call(this),u?this._erasAbbrRegex:this._erasRegex}function ll(u){return s(this,"_erasNarrowRegex")||iu.call(this),u?this._erasNarrowRegex:this._erasRegex}function nr(u,h){return h.erasAbbrRegex(u)}function $e(u,h){return h.erasNameRegex(u)}function ev(u,h){return h.erasNarrowRegex(u)}function tv(u,h){return h._eraYearOrdinalRegex||li}function iu(){var u=[],h=[],b=[],S=[],E,N,J,se,ve,Me=this.eras();for(E=0,N=Me.length;E<N;++E)J=an(Me[E].name),se=an(Me[E].abbr),ve=an(Me[E].narrow),h.push(J),u.push(se),b.push(ve),S.push(J),S.push(se),S.push(ve);this._erasRegex=new RegExp("^("+S.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+h.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+u.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+b.join("|")+")","i")}ce(0,["gg",2],0,function(){return this.weekYear()%100}),ce(0,["GG",2],0,function(){return this.isoWeekYear()%100});function fn(u,h){ce(0,[u,u.length],0,h)}fn("gggg","weekYear"),fn("ggggg","weekYear"),fn("GGGG","isoWeekYear"),fn("GGGGG","isoWeekYear"),le("G",fs),le("g",fs),le("GG",ot,Ut),le("gg",ot,Ut),le("GGGG",co,Oi),le("gggg",co,Oi),le("GGGGG",us,Pn),le("ggggg",us,Pn),fo(["gggg","ggggg","GGGG","GGGGG"],function(u,h,b,S){h[S.substr(0,2)]=qe(u)}),fo(["gg","GG"],function(u,h,b,S){h[S]=e.parseTwoDigitYear(u)});function rv(u){return fp.call(this,u,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function nv(u){return fp.call(this,u,this.isoWeek(),this.isoWeekday(),1,4)}function iv(){return cn(this.year(),1,4)}function sv(){return cn(this.isoWeekYear(),1,4)}function ov(){var u=this.localeData()._week;return cn(this.year(),u.dow,u.doy)}function $n(){var u=this.localeData()._week;return cn(this.weekYear(),u.dow,u.doy)}function fp(u,h,b,S,E){var N;return u==null?yo(this,S,E).year:(N=cn(u,S,E),h>N&&(h=N),av.call(this,u,h,b,S,E))}function av(u,h,b,S,E){var N=La(u,h,b,S,E),J=ps(N.year,0,N.dayOfYear);return this.year(J.getUTCFullYear()),this.month(J.getUTCMonth()),this.date(J.getUTCDate()),this}ce("Q",0,"Qo","quarter"),le("Q",Pd),Ke("Q",function(u,h){h[kn]=(qe(u)-1)*3});function lv(u){return u==null?Math.ceil((this.month()+1)/3):this.month((u-1)*3+this.month()%3)}ce("D",["DD",2],"Do","date"),le("D",ot,Ii),le("DD",ot,Ut),le("Do",function(u,h){return u?h._dayOfMonthOrdinalParse||h._ordinalParse:h._dayOfMonthOrdinalParseLenient}),Ke(["D","DD"],ln),Ke("Do",function(u,h){h[ln]=qe(u.match(ot)[0])});var dp=ds("Date",!0);ce("DDD",["DDDD",3],"DDDo","dayOfYear"),le("DDD",cs),le("DDDD",kd),Ke(["DDD","DDDD"],function(u,h,b){b._dayOfYear=qe(u)});function cv(u){var h=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return u==null?h:this.add(u-h,"d")}ce("m",["mm",2],0,"minute"),le("m",ot,qa),le("mm",ot,Ut),Ke(["m","mm"],Pr);var Mn=ds("Minutes",!1);ce("s",["ss",2],0,"second"),le("s",ot,qa),le("ss",ot,Ut),Ke(["s","ss"],Tn);var uv=ds("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}),le("S",cs,Pd),le("SS",cs,Ut),le("SSS",cs,kd);var hi,pp;for(hi="SSSS";hi.length<=9;hi+="S")le(hi,li);function fv(u,h){h[Pi]=qe(("0."+u)*1e3)}for(hi="S";hi.length<=9;hi+="S")Ke(hi,fv);pp=ds("Milliseconds",!1),ce("z",0,0,"zoneAbbr"),ce("zz",0,0,"zoneName");function dv(){return this._isUTC?"UTC":""}function Mi(){return this._isUTC?"Coordinated Universal Time":""}var te=W.prototype;te.add=Ly,te.calendar=Uy,te.clone=Hy,te.diff=sp,te.endOf=cp,te.format=qi,te.from=rl,te.fromNow=Vy,te.to=Wy,te.toNow=zy,te.get=Qg,te.invalidAt=ws,te.isAfter=By,te.isBefore=Za,te.isBetween=pi,te.isSame=Xa,te.isSameOrAfter=ip,te.isSameOrBefore=el,te.isValid=ko,te.lang=Oo,te.locale=Eo,te.localeData=nl,te.max=Xd,te.min=Zd,te.parsingFlags=ol,te.set=Na,te.startOf=Jy,te.subtract=bs,te.toArray=nu,te.toObject=Ss,te.toDate=Io,te.toISOString=op,te.inspect=Co,typeof Symbol<"u"&&Symbol.for!=null&&(te[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),te.toJSON=Po,te.toString=tl,te.unix=ru,te.valueOf=Yy,te.creationData=Gy,te.eraName=Xy,te.eraNarrow=al,te.eraAbbr=To,te.eraYear=up,te.year=Ad,te.isLeapYear=Kg,te.weekYear=rv,te.isoWeekYear=nv,te.quarter=te.quarters=lv,te.month=Da,te.daysInMonth=ny,te.week=te.weeks=Fd,te.isoWeek=te.isoWeeks=sy,te.weeksInYear=ov,te.weeksInWeekYear=$n,te.isoWeeksInYear=iv,te.isoWeeksInISOWeekYear=sv,te.date=dp,te.day=te.days=py,te.weekday=hy,te.isoWeekday=my,te.dayOfYear=cv,te.hour=te.hours=by,te.minute=te.minutes=Mn,te.second=te.seconds=uv,te.millisecond=te.milliseconds=pp,te.utcOffset=rp,te.utc=$y,te.local=My,te.parseZone=Ny,te.hasAlignedHourOffset=Dy,te.isDST=di,te.isLocal=G,te.isUtcOffset=z,te.isUtc=ae,te.isUTC=ae,te.zoneAbbr=dv,te.zoneName=Mi,te.dates=_("dates accessor is deprecated. Use date instead.",dp),te.months=_("months accessor is deprecated. Use month instead",Da),te.years=_("years accessor is deprecated. Use year instead",Ad),te.zone=_("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",qy),te.isDSTShifted=_("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",L);function pv(u){return tt(u*1e3)}function Jr(){return tt.apply(null,arguments).parseZone()}function hp(u){return u}var Ve=K.prototype;Ve.calendar=et,Ve.longDateFormat=ht,Ve.invalidDate=on,Ve.ordinal=ao,Ve.preparse=hp,Ve.postformat=hp,Ve.relativeTime=In,Ve.pastFuture=Od,Ve.set=$,Ve.eras=Ky,Ve.erasParse=Qy,Ve.erasConvertYear=Zy,Ve.erasAbbrRegex=_s,Ve.erasNameRegex=O,Ve.erasNarrowRegex=ll,Ve.months=ty,Ve.monthsShort=ry,Ve.monthsParse=Md,Ve.monthsRegex=Fa,Ve.monthsShortRegex=Nd,Ve.week=Bc,Ve.firstDayOfYear=Dd,Ve.firstDayOfWeek=hs,Ve.weekdays=cy,Ve.weekdaysMin=fy,Ve.weekdaysShort=uy,Ve.weekdaysParse=dy,Ve.weekdaysRegex=gy,Ve.weekdaysShortRegex=ut,Ve.weekdaysMinRegex=at,Ve.isPM=vy,Ve.meridiem=Nt;function cl(u,h,b,S){var E=qn(),N=y().set(S,h);return E[b](N,u)}function mp(u,h,b){if(f(u)&&(h=u,u=void 0),u=u||"",h!=null)return cl(u,h,b,"month");var S,E=[];for(S=0;S<12;S++)E[S]=cl(u,S,b,"month");return E}function su(u,h,b,S){typeof u=="boolean"?(f(h)&&(b=h,h=void 0),h=h||""):(h=u,b=h,u=!1,f(h)&&(b=h,h=void 0),h=h||"");var E=qn(),N=u?E._week.dow:0,J,se=[];if(b!=null)return cl(h,(b+N)%7,S,"day");for(J=0;J<7;J++)se[J]=cl(h,(J+N)%7,S,"day");return se}function gp(u,h){return mp(u,h,"months")}function yp(u,h){return mp(u,h,"monthsShort")}function hv(u,h,b){return su(u,h,b,"weekdays")}function mv(u,h,b){return su(u,h,b,"weekdaysShort")}function ou(u,h,b){return su(u,h,b,"weekdaysMin")}An("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(u){var h=u%10,b=qe(u%100/10)===1?"th":h===1?"st":h===2?"nd":h===3?"rd":"th";return u+b}}),e.lang=_("moment.lang is deprecated. Use moment.locale instead.",An),e.langData=_("moment.langData is deprecated. Use moment.localeData instead.",qn);var Sr=Math.abs;function ul(){var u=this._data;return this._milliseconds=Sr(this._milliseconds),this._days=Sr(this._days),this._months=Sr(this._months),u.milliseconds=Sr(u.milliseconds),u.seconds=Sr(u.seconds),u.minutes=Sr(u.minutes),u.hours=Sr(u.hours),u.months=Sr(u.months),u.years=Sr(u.years),this}function vp(u,h,b,S){var E=rt(h,b);return u._milliseconds+=S*E._milliseconds,u._days+=S*E._days,u._months+=S*E._months,u._bubble()}function bp(u,h){return vp(this,u,h,1)}function gv(u,h){return vp(this,u,h,-1)}function Yr(u){return u<0?Math.floor(u):Math.ceil(u)}function au(){var u=this._milliseconds,h=this._days,b=this._months,S=this._data,E,N,J,se,ve;return u>=0&&h>=0&&b>=0||u<=0&&h<=0&&b<=0||(u+=Yr(ir(b)+h)*864e5,h=0,b=0),S.milliseconds=u%1e3,E=Ir(u/1e3),S.seconds=E%60,N=Ir(E/60),S.minutes=N%60,J=Ir(N/60),S.hours=J%24,h+=Ir(J/24),ve=Ir(mi(h)),b+=ve,h-=Yr(ir(ve)),se=Ir(b/12),b%=12,S.days=h,S.months=b,S.years=se,this}function mi(u){return u*4800/146097}function ir(u){return u*146097/4800}function yv(u){if(!this.isValid())return NaN;var h,b,S=this._milliseconds;if(u=Yt(u),u==="month"||u==="quarter"||u==="year")switch(h=this._days+S/864e5,b=this._months+mi(h),u){case"month":return b;case"quarter":return b/3;case"year":return b/12}else switch(h=this._days+Math.round(ir(this._months)),u){case"week":return h/7+S/6048e5;case"day":return h+S/864e5;case"hour":return h*24+S/36e5;case"minute":return h*1440+S/6e4;case"second":return h*86400+S/1e3;case"millisecond":return Math.floor(h*864e5)+S;default:throw new Error("Unknown unit "+u)}}function dn(u){return function(){return this.as(u)}}var lu=dn("ms"),Ao=dn("s"),gi=dn("m"),Sp=dn("h"),vv=dn("d"),fl=dn("w"),bv=dn("M"),wp=dn("Q"),Bt=dn("y"),cu=lu;function _p(){return rt(this)}function pn(u){return u=Yt(u),this.isValid()?this[u+"s"]():NaN}function Nn(u){return function(){return this.isValid()?this._data[u]:NaN}}var dl=Nn("milliseconds"),Ni=Nn("seconds"),Rp=Nn("minutes"),Qt=Nn("hours"),uu=Nn("days"),Sv=Nn("months"),wv=Nn("years");function _v(){return Ir(this.days()/7)}var Gr=Math.round,Rs={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function qo(u,h,b,S,E){return E.relativeTime(h||1,!!b,u,S)}function xp(u,h,b,S){var E=rt(u).abs(),N=Gr(E.as("s")),J=Gr(E.as("m")),se=Gr(E.as("h")),ve=Gr(E.as("d")),Me=Gr(E.as("M")),Dt=Gr(E.as("w")),Dn=Gr(E.as("y")),Fn=N<=b.ss&&["s",N]||N<b.s&&["ss",N]||J<=1&&["m"]||J<b.m&&["mm",J]||se<=1&&["h"]||se<b.h&&["hh",se]||ve<=1&&["d"]||ve<b.d&&["dd",ve];return b.w!=null&&(Fn=Fn||Dt<=1&&["w"]||Dt<b.w&&["ww",Dt]),Fn=Fn||Me<=1&&["M"]||Me<b.M&&["MM",Me]||Dn<=1&&["y"]||["yy",Dn],Fn[2]=h,Fn[3]=+u>0,Fn[4]=S,qo.apply(null,Fn)}function Rv(u){return u===void 0?Gr:typeof u=="function"?(Gr=u,!0):!1}function xv(u,h){return Rs[u]===void 0?!1:h===void 0?Rs[u]:(Rs[u]=h,u==="s"&&(Rs.ss=h-1),!0)}function $o(u,h){if(!this.isValid())return this.localeData().invalidDate();var b=!1,S=Rs,E,N;return typeof u=="object"&&(h=u,u=!1),typeof u=="boolean"&&(b=u),typeof h=="object"&&(S=Object.assign({},Rs,h),h.s!=null&&h.ss==null&&(S.ss=h.s-1)),E=this.localeData(),N=xp(this,!b,S,E),b&&(N=E.pastFuture(+this,N)),E.postformat(N)}var fu=Math.abs;function xs(u){return(u>0)-(u<0)||+u}function Cs(){if(!this.isValid())return this.localeData().invalidDate();var u=fu(this._milliseconds)/1e3,h=fu(this._days),b=fu(this._months),S,E,N,J,se=this.asSeconds(),ve,Me,Dt,Dn;return se?(S=Ir(u/60),E=Ir(S/60),u%=60,S%=60,N=Ir(b/12),b%=12,J=u?u.toFixed(3).replace(/\.?0+$/,""):"",ve=se<0?"-":"",Me=xs(this._months)!==xs(se)?"-":"",Dt=xs(this._days)!==xs(se)?"-":"",Dn=xs(this._milliseconds)!==xs(se)?"-":"",ve+"P"+(N?Me+N+"Y":"")+(b?Me+b+"M":"")+(h?Dt+h+"D":"")+(E||S||u?"T":"")+(E?Dn+E+"H":"")+(S?Dn+S+"M":"")+(u?Dn+J+"S":"")):"P0D"}var Fe=vs.prototype;Fe.isValid=ky,Fe.abs=ul,Fe.add=bp,Fe.subtract=gv,Fe.as=yv,Fe.asMilliseconds=lu,Fe.asSeconds=Ao,Fe.asMinutes=gi,Fe.asHours=Sp,Fe.asDays=vv,Fe.asWeeks=fl,Fe.asMonths=bv,Fe.asQuarters=wp,Fe.asYears=Bt,Fe.valueOf=cu,Fe._bubble=au,Fe.clone=_p,Fe.get=pn,Fe.milliseconds=dl,Fe.seconds=Ni,Fe.minutes=Rp,Fe.hours=Qt,Fe.days=uu,Fe.weeks=_v,Fe.months=Sv,Fe.years=wv,Fe.humanize=$o,Fe.toISOString=Cs,Fe.toString=Cs,Fe.toJSON=Cs,Fe.locale=Eo,Fe.localeData=nl,Fe.toIsoString=_("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Cs),Fe.lang=Oo,ce("X",0,0,"unix"),ce("x",0,0,"valueOf"),le("x",fs),le("X",zg),Ke("X",function(u,h,b){b._d=new Date(parseFloat(u)*1e3)}),Ke("x",function(u,h,b){b._d=new Date(qe(u))});return e.version="2.30.1",r(tt),e.fn=te,e.min=Oy,e.max=Iy,e.now=Py,e.utc=y,e.unix=pv,e.months=gp,e.isDate=d,e.locale=An,e.invalid=A,e.duration=rt,e.isMoment=X,e.weekdays=hv,e.parseZone=Jr,e.localeData=qn,e.isDuration=wo,e.monthsShort=yp,e.weekdaysMin=ou,e.defineLocale=Ha,e.updateLocale=mr,e.locales=gr,e.weekdaysShort=mv,e.normalizeUnits=Yt,e.relativeTimeRounding=Rv,e.relativeTimeThreshold=xv,e.calendarFormat=Qa,e.prototype=te,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 sE=F((iE,rh)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof rh<"u"&&rh.exports?rh.exports=e():t.tv4=e()})(iE,function(){Object.keys||(Object.keys=(function(){var P=Object.prototype.hasOwnProperty,_=!{toString:null}.propertyIsEnumerable("toString"),k=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],M=k.length;return function(j){if(typeof j!="object"&&typeof j!="function"||j===null)throw new TypeError("Object.keys called on non-object");var $=[];for(var Y in j)P.call(j,Y)&&$.push(Y);if(_)for(var K=0;K<M;K++)P.call(j,k[K])&&$.push(k[K]);return $}})()),Object.create||(Object.create=(function(){function P(){}return function(_){if(arguments.length!==1)throw new Error("Object.create implementation only accepts one parameter.");return P.prototype=_,new P}})()),Array.isArray||(Array.isArray=function(P){return Object.prototype.toString.call(P)==="[object Array]"}),Array.prototype.indexOf||(Array.prototype.indexOf=function(P){if(this===null)throw new TypeError;var _=Object(this),k=_.length>>>0;if(k===0)return-1;var M=0;if(arguments.length>1&&(M=Number(arguments[1]),M!==M?M=0:M!==0&&M!==1/0&&M!==-1/0&&(M=(M>0||-1)*Math.floor(Math.abs(M)))),M>=k)return-1;for(var j=M>=0?M:Math.max(k-Math.abs(M),0);j<k;j++)if(j in _&&_[j]===P)return j;return-1}),Object.isFrozen||(Object.isFrozen=function(P){for(var _="tv4_test_frozen_key";P.hasOwnProperty(_);)_+=Math.random();try{return P[_]=!0,delete P[_],!1}catch{return!0}});var t={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},e={"*":!0};function r(P){return encodeURI(P).replace(/%25[0-9][0-9]/g,function(_){return"%"+_.substring(3)})}function n(P){var _="";t[P.charAt(0)]&&(_=P.charAt(0),P=P.substring(1));var k="",M="",j=!0,$=!1,Y=!1;_==="+"?j=!1:_==="."?(M=".",k="."):_==="/"?(M="/",k="/"):_==="#"?(M="#",j=!1):_===";"?(M=";",k=";",$=!0,Y=!0):_==="?"?(M="?",k="&",$=!0):_==="&"&&(M="&",k="&",$=!0);for(var K=[],ne=P.split(","),ue=[],et={},_e=0;_e<ne.length;_e++){var he=ne[_e],Ce=null;if(he.indexOf(":")!==-1){var vt=he.split(":");he=vt[0],Ce=parseInt(vt[1],10)}for(var Et={};e[he.charAt(he.length-1)];)Et[he.charAt(he.length-1)]=!0,he=he.substring(0,he.length-1);var ce={truncate:Ce,name:he,suffices:Et};ue.push(ce),et[he]=ce,K.push(he)}var pr=function(ai){for(var Rt="",zr=0,Or=0;Or<ue.length;Or++){var ht=ue[Or],mt=ai(ht.name);if(mt==null||Array.isArray(mt)&&mt.length===0||typeof mt=="object"&&Object.keys(mt).length===0){zr++;continue}if(Or===zr?Rt+=M:Rt+=k||",",Array.isArray(mt)){$&&(Rt+=ht.name+"=");for(var on=0;on<mt.length;on++)on>0&&(Rt+=ht.suffices["*"]&&k||",",ht.suffices["*"]&&$&&(Rt+=ht.name+"=")),Rt+=j?encodeURIComponent(mt[on]).replace(/!/g,"%21"):r(mt[on])}else if(typeof mt=="object"){$&&!ht.suffices["*"]&&(Rt+=ht.name+"=");var oo=!0;for(var Jt in mt)oo||(Rt+=ht.suffices["*"]&&k||","),oo=!1,Rt+=j?encodeURIComponent(Jt).replace(/!/g,"%21"):r(Jt),Rt+=ht.suffices["*"]?"=":",",Rt+=j?encodeURIComponent(mt[Jt]).replace(/!/g,"%21"):r(mt[Jt])}else $&&(Rt+=ht.name,(!Y||mt!=="")&&(Rt+="=")),ht.truncate!=null&&(mt=mt.substring(0,ht.truncate)),Rt+=j?encodeURIComponent(mt).replace(/!/g,"%21"):r(mt)}return Rt};return pr.varNames=K,{prefix:M,substitution:pr}}function i(P){if(!(this instanceof i))return new i(P);for(var _=P.split("{"),k=[_.shift()],M=[],j=[],$=[];_.length>0;){var Y=_.shift(),K=Y.split("}")[0],ne=Y.substring(K.length+1),ue=n(K);j.push(ue.substitution),M.push(ue.prefix),k.push(ne),$=$.concat(ue.substitution.varNames)}this.fill=function(et){for(var _e=k[0],he=0;he<j.length;he++){var Ce=j[he];_e+=Ce(et),_e+=k[he+1]}return _e},this.varNames=$,this.template=P}i.prototype={toString:function(){return this.template},fillFromObject:function(P){return this.fill(function(_){return P[_]})}};var s=function(_,k,M,j,$){if(this.missing=[],this.missingMap={},this.formatValidators=_?Object.create(_.formatValidators):{},this.schemas=_?Object.create(_.schemas):{},this.collectMultiple=k,this.errors=[],this.handleError=k?this.collectError:this.returnError,j&&(this.checkRecursive=!0,this.scanned=[],this.scannedFrozen=[],this.scannedFrozenSchemas=[],this.scannedFrozenValidationErrors=[],this.validatedSchemasKey="tv4_validation_id",this.validationErrorsKey="tv4_validation_errors_id"),$&&(this.trackUnknownProperties=!0,this.knownPropertyPaths={},this.unknownPropertyPaths={}),this.errorReporter=M||w("en"),typeof this.errorReporter=="string")throw new Error("debug");if(this.definedKeywords={},_)for(var Y in _.definedKeywords)this.definedKeywords[Y]=_.definedKeywords[Y].slice(0)};s.prototype.defineKeyword=function(P,_){this.definedKeywords[P]=this.definedKeywords[P]||[],this.definedKeywords[P].push(_)},s.prototype.createError=function(P,_,k,M,j,$,Y){var K=new U(P,_,k,M,j);return K.message=this.errorReporter(K,$,Y),K},s.prototype.returnError=function(P){return P},s.prototype.collectError=function(P){return P&&this.errors.push(P),null},s.prototype.prefixErrors=function(P,_,k){for(var M=P;M<this.errors.length;M++)this.errors[M]=this.errors[M].prefixWith(_,k);return this},s.prototype.banUnknownProperties=function(P,_){for(var k in this.unknownPropertyPaths){var M=this.createError(C.UNKNOWN_PROPERTY,{path:k},k,"",null,P,_),j=this.handleError(M);if(j)return j}return null},s.prototype.addFormat=function(P,_){if(typeof P=="object"){for(var k in P)this.addFormat(k,P[k]);return this}this.formatValidators[P]=_},s.prototype.resolveRefs=function(P,_){if(P.$ref!==void 0){if(_=_||{},_[P.$ref])return this.createError(C.CIRCULAR_REFERENCE,{urls:Object.keys(_).join(", ")},"","",null,void 0,P);_[P.$ref]=!0,P=this.getSchema(P.$ref,_)}return P},s.prototype.getSchema=function(P,_){var k;if(this.schemas[P]!==void 0)return k=this.schemas[P],this.resolveRefs(k,_);var M=P,j="";if(P.indexOf("#")!==-1&&(j=P.substring(P.indexOf("#")+1),M=P.substring(0,P.indexOf("#"))),typeof this.schemas[M]=="object"){k=this.schemas[M];var $=decodeURIComponent(j);if($==="")return this.resolveRefs(k,_);if($.charAt(0)!=="/")return;for(var Y=$.split("/").slice(1),K=0;K<Y.length;K++){var ne=Y[K].replace(/~1/g,"/").replace(/~0/g,"~");if(k[ne]===void 0){k=void 0;break}k=k[ne]}if(k!==void 0)return this.resolveRefs(k,_)}this.missing[M]===void 0&&(this.missing.push(M),this.missing[M]=M,this.missingMap[M]=M)},s.prototype.searchSchemas=function(P,_){if(Array.isArray(P))for(var k=0;k<P.length;k++)this.searchSchemas(P[k],_);else if(P&&typeof P=="object"){typeof P.id=="string"&&B(_,P.id)&&this.schemas[P.id]===void 0&&(this.schemas[P.id]=P);for(var M in P)if(M!=="enum"){if(typeof P[M]=="object")this.searchSchemas(P[M],_);else if(M==="$ref"){var j=g(P[M]);j&&this.schemas[j]===void 0&&this.missingMap[j]===void 0&&(this.missingMap[j]=j)}}}},s.prototype.addSchema=function(P,_){if(typeof P!="string"||typeof _>"u")if(typeof P=="object"&&typeof P.id=="string")_=P,P=_.id;else return;P===g(P)+"#"&&(P=g(P)),this.schemas[P]=_,delete this.missingMap[P],y(_,P),this.searchSchemas(_,P)},s.prototype.getSchemaMap=function(){var P={};for(var _ in this.schemas)P[_]=this.schemas[_];return P},s.prototype.getSchemaUris=function(P){var _=[];for(var k in this.schemas)(!P||P.test(k))&&_.push(k);return _},s.prototype.getMissingUris=function(P){var _=[];for(var k in this.missingMap)(!P||P.test(k))&&_.push(k);return _},s.prototype.dropSchemas=function(){this.schemas={},this.reset()},s.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},s.prototype.validateAll=function(P,_,k,M,j){var $;if(_=this.resolveRefs(_),_){if(_ instanceof U)return this.errors.push(_),_}else return null;var Y=this.errors.length,K,ne=null,ue=null;if(this.checkRecursive&&P&&typeof P=="object"){if($=!this.scanned.length,P[this.validatedSchemasKey]){var et=P[this.validatedSchemasKey].indexOf(_);if(et!==-1)return this.errors=this.errors.concat(P[this.validationErrorsKey][et]),null}if(Object.isFrozen(P)&&(K=this.scannedFrozen.indexOf(P),K!==-1)){var _e=this.scannedFrozenSchemas[K].indexOf(_);if(_e!==-1)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[K][_e]),null}if(this.scanned.push(P),Object.isFrozen(P))K===-1&&(K=this.scannedFrozen.length,this.scannedFrozen.push(P),this.scannedFrozenSchemas.push([])),ne=this.scannedFrozenSchemas[K].length,this.scannedFrozenSchemas[K][ne]=_,this.scannedFrozenValidationErrors[K][ne]=[];else{if(!P[this.validatedSchemasKey])try{Object.defineProperty(P,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(P,this.validationErrorsKey,{value:[],configurable:!0})}catch{P[this.validatedSchemasKey]=[],P[this.validationErrorsKey]=[]}ue=P[this.validatedSchemasKey].length,P[this.validatedSchemasKey][ue]=_,P[this.validationErrorsKey][ue]=[]}}var he=this.errors.length,Ce=this.validateBasic(P,_,j)||this.validateNumeric(P,_,j)||this.validateString(P,_,j)||this.validateArray(P,_,j)||this.validateObject(P,_,j)||this.validateCombinations(P,_,j)||this.validateHypermedia(P,_,j)||this.validateFormat(P,_,j)||this.validateDefinedKeywords(P,_,j)||null;if($){for(;this.scanned.length;){var vt=this.scanned.pop();delete vt[this.validatedSchemasKey]}this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(Ce||he!==this.errors.length)for(;k&&k.length||M&&M.length;){var Et=k&&k.length?""+k.pop():null,ce=M&&M.length?""+M.pop():null;Ce&&(Ce=Ce.prefixWith(Et,ce)),this.prefixErrors(he,Et,ce)}return ne!==null?this.scannedFrozenValidationErrors[K][ne]=this.errors.slice(Y):ue!==null&&(P[this.validationErrorsKey][ue]=this.errors.slice(Y)),this.handleError(Ce)},s.prototype.validateFormat=function(P,_){if(typeof _.format!="string"||!this.formatValidators[_.format])return null;var k=this.formatValidators[_.format].call(null,P,_);return typeof k=="string"||typeof k=="number"?this.createError(C.FORMAT_CUSTOM,{message:k},"","/format",null,P,_):k&&typeof k=="object"?this.createError(C.FORMAT_CUSTOM,{message:k.message||"?"},k.dataPath||"",k.schemaPath||"/format",null,P,_):null},s.prototype.validateDefinedKeywords=function(P,_,k){for(var M in this.definedKeywords)if(!(typeof _[M]>"u"))for(var j=this.definedKeywords[M],$=0;$<j.length;$++){var Y=j[$],K=Y(P,_[M],_,k);if(typeof K=="string"||typeof K=="number")return this.createError(C.KEYWORD_CUSTOM,{key:M,message:K},"","",null,P,_).prefixWith(null,M);if(K&&typeof K=="object"){var ne=K.code;if(typeof ne=="string"){if(!C[ne])throw new Error("Undefined error code (use defineError): "+ne);ne=C[ne]}else typeof ne!="number"&&(ne=C.KEYWORD_CUSTOM);var ue=typeof K.message=="object"?K.message:{key:M,message:K.message||"?"},et=K.schemaPath||"/"+M.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(ne,ue,K.dataPath||null,et,null,P,_)}}return null};function a(P,_){if(P===_)return!0;if(P&&_&&typeof P=="object"&&typeof _=="object"){if(Array.isArray(P)!==Array.isArray(_))return!1;if(Array.isArray(P)){if(P.length!==_.length)return!1;for(var k=0;k<P.length;k++)if(!a(P[k],_[k]))return!1}else{var M;for(M in P)if(_[M]===void 0&&P[M]!==void 0)return!1;for(M in _)if(P[M]===void 0&&_[M]!==void 0)return!1;for(M in P)if(!a(P[M],_[M]))return!1}return!0}return!1}s.prototype.validateBasic=function(_,k,M){var j;return(j=this.validateType(_,k,M))||(j=this.validateEnum(_,k,M))?j.prefixWith(null,"type"):null},s.prototype.validateType=function(_,k){if(k.type===void 0)return null;var M=typeof _;_===null?M="null":Array.isArray(_)&&(M="array");var j=k.type;Array.isArray(j)||(j=[j]);for(var $=0;$<j.length;$++){var Y=j[$];if(Y===M||Y==="integer"&&M==="number"&&_%1===0)return null}return this.createError(C.INVALID_TYPE,{type:M,expected:j.join("/")},"","",null,_,k)},s.prototype.validateEnum=function(_,k){if(k.enum===void 0)return null;for(var M=0;M<k.enum.length;M++){var j=k.enum[M];if(a(_,j))return null}return this.createError(C.ENUM_MISMATCH,{value:typeof JSON<"u"?JSON.stringify(_):_},"","",null,_,k)},s.prototype.validateNumeric=function(_,k,M){return this.validateMultipleOf(_,k,M)||this.validateMinMax(_,k,M)||this.validateNaN(_,k,M)||null};var l=Math.pow(2,-51),f=1-l;s.prototype.validateMultipleOf=function(_,k){var M=k.multipleOf||k.divisibleBy;if(M===void 0)return null;if(typeof _=="number"){var j=_/M%1;if(j>=l&&j<f)return this.createError(C.NUMBER_MULTIPLE_OF,{value:_,multipleOf:M},"","",null,_,k)}return null},s.prototype.validateMinMax=function(_,k){if(typeof _!="number")return null;if(k.minimum!==void 0){if(_<k.minimum)return this.createError(C.NUMBER_MINIMUM,{value:_,minimum:k.minimum},"","/minimum",null,_,k);if(k.exclusiveMinimum&&_===k.minimum)return this.createError(C.NUMBER_MINIMUM_EXCLUSIVE,{value:_,minimum:k.minimum},"","/exclusiveMinimum",null,_,k)}if(k.maximum!==void 0){if(_>k.maximum)return this.createError(C.NUMBER_MAXIMUM,{value:_,maximum:k.maximum},"","/maximum",null,_,k);if(k.exclusiveMaximum&&_===k.maximum)return this.createError(C.NUMBER_MAXIMUM_EXCLUSIVE,{value:_,maximum:k.maximum},"","/exclusiveMaximum",null,_,k)}return null},s.prototype.validateNaN=function(_,k){return typeof _!="number"?null:isNaN(_)===!0||_===1/0||_===-1/0?this.createError(C.NUMBER_NOT_A_NUMBER,{value:_},"","/type",null,_,k):null},s.prototype.validateString=function(_,k,M){return this.validateStringLength(_,k,M)||this.validateStringPattern(_,k,M)||null},s.prototype.validateStringLength=function(_,k){return typeof _!="string"?null:k.minLength!==void 0&&_.length<k.minLength?this.createError(C.STRING_LENGTH_SHORT,{length:_.length,minimum:k.minLength},"","/minLength",null,_,k):k.maxLength!==void 0&&_.length>k.maxLength?this.createError(C.STRING_LENGTH_LONG,{length:_.length,maximum:k.maxLength},"","/maxLength",null,_,k):null},s.prototype.validateStringPattern=function(_,k){if(typeof _!="string"||typeof k.pattern!="string"&&!(k.pattern instanceof RegExp))return null;var M;if(k.pattern instanceof RegExp)M=k.pattern;else{var j,$="",Y=k.pattern.match(/^\/(.+)\/([img]*)$/);Y?(j=Y[1],$=Y[2]):j=k.pattern,M=new RegExp(j,$)}return M.test(_)?null:this.createError(C.STRING_PATTERN,{pattern:k.pattern},"","/pattern",null,_,k)},s.prototype.validateArray=function(_,k,M){return Array.isArray(_)&&(this.validateArrayLength(_,k,M)||this.validateArrayUniqueItems(_,k,M)||this.validateArrayItems(_,k,M))||null},s.prototype.validateArrayLength=function(_,k){var M;return k.minItems!==void 0&&_.length<k.minItems&&(M=this.createError(C.ARRAY_LENGTH_SHORT,{length:_.length,minimum:k.minItems},"","/minItems",null,_,k),this.handleError(M))||k.maxItems!==void 0&&_.length>k.maxItems&&(M=this.createError(C.ARRAY_LENGTH_LONG,{length:_.length,maximum:k.maxItems},"","/maxItems",null,_,k),this.handleError(M))?M:null},s.prototype.validateArrayUniqueItems=function(_,k){if(k.uniqueItems){for(var M=0;M<_.length;M++)for(var j=M+1;j<_.length;j++)if(a(_[M],_[j])){var $=this.createError(C.ARRAY_UNIQUE,{match1:M,match2:j},"","/uniqueItems",null,_,k);if(this.handleError($))return $}}return null},s.prototype.validateArrayItems=function(_,k,M){if(k.items===void 0)return null;var j,$;if(Array.isArray(k.items)){for($=0;$<_.length;$++)if($<k.items.length){if(j=this.validateAll(_[$],k.items[$],[$],["items",$],M+"/"+$))return j}else if(k.additionalItems!==void 0){if(typeof k.additionalItems=="boolean"){if(!k.additionalItems&&(j=this.createError(C.ARRAY_ADDITIONAL_ITEMS,{},"/"+$,"/additionalItems",null,_,k),this.handleError(j)))return j}else if(j=this.validateAll(_[$],k.additionalItems,[$],["additionalItems"],M+"/"+$))return j}}else for($=0;$<_.length;$++)if(j=this.validateAll(_[$],k.items,[$],["items"],M+"/"+$))return j;return null},s.prototype.validateObject=function(_,k,M){return typeof _!="object"||_===null||Array.isArray(_)?null:this.validateObjectMinMaxProperties(_,k,M)||this.validateObjectRequiredProperties(_,k,M)||this.validateObjectProperties(_,k,M)||this.validateObjectDependencies(_,k,M)||null},s.prototype.validateObjectMinMaxProperties=function(_,k){var M=Object.keys(_),j;return k.minProperties!==void 0&&M.length<k.minProperties&&(j=this.createError(C.OBJECT_PROPERTIES_MINIMUM,{propertyCount:M.length,minimum:k.minProperties},"","/minProperties",null,_,k),this.handleError(j))||k.maxProperties!==void 0&&M.length>k.maxProperties&&(j=this.createError(C.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:M.length,maximum:k.maxProperties},"","/maxProperties",null,_,k),this.handleError(j))?j:null},s.prototype.validateObjectRequiredProperties=function(_,k){if(k.required!==void 0)for(var M=0;M<k.required.length;M++){var j=k.required[M];if(_[j]===void 0){var $=this.createError(C.OBJECT_REQUIRED,{key:j},"","/required/"+M,null,_,k);if(this.handleError($))return $}}return null},s.prototype.validateObjectProperties=function(_,k,M){var j;for(var $ in _){var Y=M+"/"+$.replace(/~/g,"~0").replace(/\//g,"~1"),K=!1;if(k.properties!==void 0&&k.properties[$]!==void 0&&(K=!0,j=this.validateAll(_[$],k.properties[$],[$],["properties",$],Y)))return j;if(k.patternProperties!==void 0)for(var ne in k.patternProperties){var ue=new RegExp(ne);if(ue.test($)&&(K=!0,j=this.validateAll(_[$],k.patternProperties[ne],[$],["patternProperties",ne],Y)))return j}if(K)this.trackUnknownProperties&&(this.knownPropertyPaths[Y]=!0,delete this.unknownPropertyPaths[Y]);else if(k.additionalProperties!==void 0){if(this.trackUnknownProperties&&(this.knownPropertyPaths[Y]=!0,delete this.unknownPropertyPaths[Y]),typeof k.additionalProperties=="boolean"){if(!k.additionalProperties&&(j=this.createError(C.OBJECT_ADDITIONAL_PROPERTIES,{key:$},"","/additionalProperties",null,_,k).prefixWith($,null),this.handleError(j)))return j}else if(j=this.validateAll(_[$],k.additionalProperties,[$],["additionalProperties"],Y))return j}else this.trackUnknownProperties&&!this.knownPropertyPaths[Y]&&(this.unknownPropertyPaths[Y]=!0)}return null},s.prototype.validateObjectDependencies=function(_,k,M){var j;if(k.dependencies!==void 0){for(var $ in k.dependencies)if(_[$]!==void 0){var Y=k.dependencies[$];if(typeof Y=="string"){if(_[Y]===void 0&&(j=this.createError(C.OBJECT_DEPENDENCY_KEY,{key:$,missing:Y},"","",null,_,k).prefixWith(null,$).prefixWith(null,"dependencies"),this.handleError(j)))return j}else if(Array.isArray(Y))for(var K=0;K<Y.length;K++){var ne=Y[K];if(_[ne]===void 0&&(j=this.createError(C.OBJECT_DEPENDENCY_KEY,{key:$,missing:ne},"","/"+K,null,_,k).prefixWith(null,$).prefixWith(null,"dependencies"),this.handleError(j)))return j}else if(j=this.validateAll(_,Y,[],["dependencies",$],M))return j}}return null},s.prototype.validateCombinations=function(_,k,M){return this.validateAllOf(_,k,M)||this.validateAnyOf(_,k,M)||this.validateOneOf(_,k,M)||this.validateNot(_,k,M)||null},s.prototype.validateAllOf=function(_,k,M){if(k.allOf===void 0)return null;for(var j,$=0;$<k.allOf.length;$++){var Y=k.allOf[$];if(j=this.validateAll(_,Y,[],["allOf",$],M))return j}return null},s.prototype.validateAnyOf=function(_,k,M){if(k.anyOf===void 0)return null;var j=[],$=this.errors.length,Y,K;this.trackUnknownProperties&&(Y=this.unknownPropertyPaths,K=this.knownPropertyPaths);for(var ne=!0,ue=0;ue<k.anyOf.length;ue++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var et=k.anyOf[ue],_e=this.errors.length,he=this.validateAll(_,et,[],["anyOf",ue],M);if(he===null&&_e===this.errors.length){if(this.errors=this.errors.slice(0,$),this.trackUnknownProperties){for(var Ce in this.knownPropertyPaths)K[Ce]=!0,delete Y[Ce];for(var vt in this.unknownPropertyPaths)K[vt]||(Y[vt]=!0);ne=!1;continue}return null}he&&j.push(he.prefixWith(null,""+ue).prefixWith(null,"anyOf"))}if(this.trackUnknownProperties&&(this.unknownPropertyPaths=Y,this.knownPropertyPaths=K),ne)return j=j.concat(this.errors.slice($)),this.errors=this.errors.slice(0,$),this.createError(C.ANY_OF_MISSING,{},"","/anyOf",j,_,k)},s.prototype.validateOneOf=function(_,k,M){if(k.oneOf===void 0)return null;var j=null,$=[],Y=this.errors.length,K,ne;this.trackUnknownProperties&&(K=this.unknownPropertyPaths,ne=this.knownPropertyPaths);for(var ue=0;ue<k.oneOf.length;ue++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var et=k.oneOf[ue],_e=this.errors.length,he=this.validateAll(_,et,[],["oneOf",ue],M);if(he===null&&_e===this.errors.length){if(j===null)j=ue;else return this.errors=this.errors.slice(0,Y),this.createError(C.ONE_OF_MULTIPLE,{index1:j,index2:ue},"","/oneOf",null,_,k);if(this.trackUnknownProperties){for(var Ce in this.knownPropertyPaths)ne[Ce]=!0,delete K[Ce];for(var vt in this.unknownPropertyPaths)ne[vt]||(K[vt]=!0)}}else he&&$.push(he)}return this.trackUnknownProperties&&(this.unknownPropertyPaths=K,this.knownPropertyPaths=ne),j===null?($=$.concat(this.errors.slice(Y)),this.errors=this.errors.slice(0,Y),this.createError(C.ONE_OF_MISSING,{},"","/oneOf",$,_,k)):(this.errors=this.errors.slice(0,Y),null)},s.prototype.validateNot=function(_,k,M){if(k.not===void 0)return null;var j=this.errors.length,$,Y;this.trackUnknownProperties&&($=this.unknownPropertyPaths,Y=this.knownPropertyPaths,this.unknownPropertyPaths={},this.knownPropertyPaths={});var K=this.validateAll(_,k.not,null,null,M),ne=this.errors.slice(j);return this.errors=this.errors.slice(0,j),this.trackUnknownProperties&&(this.unknownPropertyPaths=$,this.knownPropertyPaths=Y),K===null&&ne.length===0?this.createError(C.NOT_PASSED,{},"","/not",null,_,k):null},s.prototype.validateHypermedia=function(_,k,M){if(!k.links)return null;for(var j,$=0;$<k.links.length;$++){var Y=k.links[$];if(Y.rel==="describedby"){for(var K=new i(Y.href),ne=!0,ue=0;ue<K.varNames.length;ue++)if(!(K.varNames[ue]in _)){ne=!1;break}if(ne){var et=K.fillFromObject(_),_e={$ref:et};if(j=this.validateAll(_,_e,[],["links",$],M))return j}}}};function d(P){var _=String(P).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return _?{href:_[0]||"",protocol:_[1]||"",authority:_[2]||"",host:_[3]||"",hostname:_[4]||"",port:_[5]||"",pathname:_[6]||"",search:_[7]||"",hash:_[8]||""}:null}function m(P,_){function k(M){var j=[];return M.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function($){$==="/.."?j.pop():j.push($)}),j.join("").replace(/^\//,M.charAt(0)==="/"?"/":"")}return _=d(_||""),P=d(P||""),!_||!P?null:(_.protocol||P.protocol)+(_.protocol||_.authority?_.authority:P.authority)+k(_.protocol||_.authority||_.pathname.charAt(0)==="/"?_.pathname:_.pathname?(P.authority&&!P.pathname?"/":"")+P.pathname.slice(0,P.pathname.lastIndexOf("/")+1)+_.pathname:P.pathname)+(_.protocol||_.authority||_.pathname?_.search:_.search||P.search)+_.hash}function g(P){return P.split("#")[0]}function y(P,_){if(P&&typeof P=="object")if(_===void 0?_=P.id:typeof P.id=="string"&&(_=m(_,P.id),P.id=_),Array.isArray(P))for(var k=0;k<P.length;k++)y(P[k],_);else{typeof P.$ref=="string"&&(P.$ref=m(_,P.$ref));for(var M in P)M!=="enum"&&y(P[M],_)}}function w(P){P=P||"en";var _=V[P];return function(k){var M=_[k.code]||A[k.code];if(typeof M!="string")return"Unknown error code "+k.code+": "+JSON.stringify(k.messageParams);var j=k.params;return M.replace(/\{([^{}]*)\}/g,function($,Y){var K=j[Y];return typeof K=="string"||typeof K=="number"?K:$})}}var C={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},R={};for(var T in C)R[C[T]]=T;var A={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 U(P,_,k,M,j){if(Error.call(this),P===void 0)throw new Error("No error code supplied: "+M);this.message="",this.params=_,this.code=P,this.dataPath=k||"",this.schemaPath=M||"",this.subErrors=j||null;var $=new Error(this.message);if(this.stack=$.stack||$.stacktrace,!this.stack)try{throw $}catch(Y){this.stack=Y.stack||Y.stacktrace}}U.prototype=Object.create(Error.prototype),U.prototype.constructor=U,U.prototype.name="ValidationError",U.prototype.prefixWith=function(P,_){if(P!==null&&(P=P.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+P+this.dataPath),_!==null&&(_=_.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+_+this.schemaPath),this.subErrors!==null)for(var k=0;k<this.subErrors.length;k++)this.subErrors[k].prefixWith(P,_);return this};function B(P,_){if(_.substring(0,P.length)===P){var k=_.substring(P.length);if(_.length>0&&_.charAt(P.length-1)==="/"||k.charAt(0)==="#"||k.charAt(0)==="?")return!0}return!1}var V={};function W(P){var _=new s,k,M,j={setErrorReporter:function($){return typeof $=="string"?this.language($):(M=$,!0)},addFormat:function(){_.addFormat.apply(_,arguments)},language:function($){return $?(V[$]||($=$.split("-")[0]),V[$]?(k=$,$):!1):k},addLanguage:function($,Y){var K;for(K in C)Y[K]&&!Y[C[K]]&&(Y[C[K]]=Y[K]);var ne=$.split("-")[0];if(!V[ne])V[$]=Y,V[ne]=Y;else{V[$]=Object.create(V[ne]);for(K in Y)typeof V[ne][K]>"u"&&(V[ne][K]=Y[K]),V[$][K]=Y[K]}return this},freshApi:function($){var Y=W();return $&&Y.language($),Y},validate:function($,Y,K,ne){var ue=w(k),et=M?function(Ce,vt,Et){return M(Ce,vt,Et)||ue(Ce,vt,Et)}:ue,_e=new s(_,!1,et,K,ne);typeof Y=="string"&&(Y={$ref:Y}),_e.addSchema("",Y);var he=_e.validateAll($,Y,null,null,"");return!he&&ne&&(he=_e.banUnknownProperties($,Y)),this.error=he,this.missing=_e.missing,this.valid=he===null,this.valid},validateResult:function(){var $={toString:function(){return this.valid?"valid":this.error.message}};return this.validate.apply($,arguments),$},validateMultiple:function($,Y,K,ne){var ue=w(k),et=M?function(Ce,vt,Et){return M(Ce,vt,Et)||ue(Ce,vt,Et)}:ue,_e=new s(_,!0,et,K,ne);typeof Y=="string"&&(Y={$ref:Y}),_e.addSchema("",Y),_e.validateAll($,Y,null,null,""),ne&&_e.banUnknownProperties($,Y);var he={toString:function(){return this.valid?"valid":this.error.message}};return he.errors=_e.errors,he.missing=_e.missing,he.valid=he.errors.length===0,he},addSchema:function(){return _.addSchema.apply(_,arguments)},getSchema:function(){return _.getSchema.apply(_,arguments)},getSchemaMap:function(){return _.getSchemaMap.apply(_,arguments)},getSchemaUris:function(){return _.getSchemaUris.apply(_,arguments)},getMissingUris:function(){return _.getMissingUris.apply(_,arguments)},dropSchemas:function(){_.dropSchemas.apply(_,arguments)},defineKeyword:function(){_.defineKeyword.apply(_,arguments)},defineError:function($,Y,K){if(typeof $!="string"||!/^[A-Z]+(_[A-Z]+)*$/.test($))throw new Error("Code name must be a string in UPPER_CASE_WITH_UNDERSCORES");if(typeof Y!="number"||Y%1!==0||Y<1e4)throw new Error("Code number must be an integer > 10000");if(typeof C[$]<"u")throw new Error("Error already defined: "+$+" as "+C[$]);if(typeof R[Y]<"u")throw new Error("Error code already used: "+R[Y]+" as "+Y);C[$]=Y,R[Y]=$,A[$]=A[Y]=K;for(var ne in V){var ue=V[ne];ue[$]&&(ue[Y]=ue[Y]||ue[$])}},reset:function(){_.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:y,resolveUrl:m,getDocumentUri:g,errorCodes:C};return j.language(P||"en"),j}var X=W();return X.addLanguage("en-gb",A),X.tv4=X,X})});var $u=F(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.regexpCode=Ge.getEsmExportName=Ge.getProperty=Ge.safeStringify=Ge.stringify=Ge.strConcat=Ge.addCodeArg=Ge.str=Ge._=Ge.nil=Ge._Code=Ge.Name=Ge.IDENTIFIER=Ge._CodeOrName=void 0;var Au=class{};Ge._CodeOrName=Au;Ge.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var zo=class extends Au{constructor(e){if(super(),!Ge.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}}};Ge.Name=zo;var bn=class extends Au{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 zo&&(r[n.str]=(r[n.str]||0)+1),r),{})}};Ge._Code=bn;Ge.nil=new bn("");function oE(t,...e){let r=[t[0]],n=0;for(;n<e.length;)xb(r,e[n]),r.push(t[++n]);return new bn(r)}Ge._=oE;var Rb=new bn("+");function aE(t,...e){let r=[qu(t[0])],n=0;for(;n<e.length;)r.push(Rb),xb(r,e[n]),r.push(Rb,qu(t[++n]));return JL(r),new bn(r)}Ge.str=aE;function xb(t,e){e instanceof bn?t.push(...e._items):e instanceof zo?t.push(e):t.push(KL(e))}Ge.addCodeArg=xb;function JL(t){let e=1;for(;e<t.length-1;){if(t[e]===Rb){let r=YL(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function YL(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof zo||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 zo))return`"${t}${e.slice(1)}`}function GL(t,e){return e.emptyStr()?t:t.emptyStr()?e:aE`${t}${e}`}Ge.strConcat=GL;function KL(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:qu(Array.isArray(t)?t.join(","):t)}function QL(t){return new bn(qu(t))}Ge.stringify=QL;function qu(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Ge.safeStringify=qu;function ZL(t){return typeof t=="string"&&Ge.IDENTIFIER.test(t)?new bn(`.${t}`):oE`[${t}]`}Ge.getProperty=ZL;function XL(t){if(typeof t=="string"&&Ge.IDENTIFIER.test(t))return new bn(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}Ge.getEsmExportName=XL;function ej(t){return new bn(t.toString())}Ge.regexpCode=ej});var Ob=F(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.ValueScope=Nr.ValueScopeName=Nr.Scope=Nr.varKinds=Nr.UsedValueState=void 0;var Mr=$u(),Cb=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},nh;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(nh||(Nr.UsedValueState=nh={}));Nr.varKinds={const:new Mr.Name("const"),let:new Mr.Name("let"),var:new Mr.Name("var")};var ih=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Mr.Name?e:this.name(e)}name(e){return new Mr.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}}};Nr.Scope=ih;var sh=class extends Mr.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Mr._)`.${new Mr.Name(r)}[${n}]`}};Nr.ValueScopeName=sh;var tj=(0,Mr._)`\n`,Eb=class extends ih{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?tj:Mr.nil}}get(){return this._scope}name(e){return new sh(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,a=(n=r.key)!==null&&n!==void 0?n:r.ref,l=this._values[s];if(l){let m=l.get(a);if(m)return m}else l=this._values[s]=new Map;l.set(a,i);let f=this._scope[s]||(this._scope[s]=[]),d=f.length;return f[d]=r.ref,i.setValue(r,{property:s,itemIndex:d}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Mr._)`${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=Mr.nil;for(let a in e){let l=e[a];if(!l)continue;let f=n[a]=n[a]||new Map;l.forEach(d=>{if(f.has(d))return;f.set(d,nh.Started);let m=r(d);if(m){let g=this.opts.es5?Nr.varKinds.var:Nr.varKinds.const;s=(0,Mr._)`${s}${g} ${d} = ${m};${this.opts._n}`}else if(m=i?.(d))s=(0,Mr._)`${s}${m}${this.opts._n}`;else throw new Cb(d);f.set(d,nh.Completed)})}return s}};Nr.ValueScope=Eb});var Ne=F(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.or=Ae.and=Ae.not=Ae.CodeGen=Ae.operators=Ae.varKinds=Ae.ValueScopeName=Ae.ValueScope=Ae.Scope=Ae.Name=Ae.regexpCode=Ae.stringify=Ae.getProperty=Ae.nil=Ae.strConcat=Ae.str=Ae._=void 0;var Be=$u(),Vn=Ob(),$s=$u();Object.defineProperty(Ae,"_",{enumerable:!0,get:function(){return $s._}});Object.defineProperty(Ae,"str",{enumerable:!0,get:function(){return $s.str}});Object.defineProperty(Ae,"strConcat",{enumerable:!0,get:function(){return $s.strConcat}});Object.defineProperty(Ae,"nil",{enumerable:!0,get:function(){return $s.nil}});Object.defineProperty(Ae,"getProperty",{enumerable:!0,get:function(){return $s.getProperty}});Object.defineProperty(Ae,"stringify",{enumerable:!0,get:function(){return $s.stringify}});Object.defineProperty(Ae,"regexpCode",{enumerable:!0,get:function(){return $s.regexpCode}});Object.defineProperty(Ae,"Name",{enumerable:!0,get:function(){return $s.Name}});var ch=Ob();Object.defineProperty(Ae,"Scope",{enumerable:!0,get:function(){return ch.Scope}});Object.defineProperty(Ae,"ValueScope",{enumerable:!0,get:function(){return ch.ValueScope}});Object.defineProperty(Ae,"ValueScopeName",{enumerable:!0,get:function(){return ch.ValueScopeName}});Object.defineProperty(Ae,"varKinds",{enumerable:!0,get:function(){return ch.varKinds}});Ae.operators={GT:new Be._Code(">"),GTE:new Be._Code(">="),LT:new Be._Code("<"),LTE:new Be._Code("<="),EQ:new Be._Code("==="),NEQ:new Be._Code("!=="),NOT:new Be._Code("!"),OR:new Be._Code("||"),AND:new Be._Code("&&"),ADD:new Be._Code("+")};var Ji=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},Ib=class extends Ji{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Vn.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=El(this.rhs,e,r)),this}get names(){return this.rhs instanceof Be._CodeOrName?this.rhs.names:{}}},oh=class extends Ji{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 Be.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=El(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Be.Name?{}:{...this.lhs.names};return lh(e,this.rhs)}},Pb=class extends oh{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},kb=class extends Ji{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Tb=class extends Ji{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Ab=class extends Ji{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},qb=class extends Ji{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=El(this.code,e,r),this}get names(){return this.code instanceof Be._CodeOrName?this.code.names:{}}},Mu=class extends Ji{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)||(rj(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Go(e,r.names),{})}},Yi=class extends Mu{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},$b=class extends Mu{},Cl=class extends Yi{};Cl.kind="else";var Jo=class t extends Yi{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 Cl(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(lE(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=El(this.condition,e,r),this}get names(){let e=super.names;return lh(e,this.condition),this.else&&Go(e,this.else.names),e}};Jo.kind="if";var Yo=class extends Yi{};Yo.kind="for";var Mb=class extends Yo{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=El(this.iteration,e,r),this}get names(){return Go(super.names,this.iteration.names)}},Nb=class extends Yo{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?Vn.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=lh(super.names,this.from);return lh(e,this.to)}},ah=class extends Yo{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=El(this.iterable,e,r),this}get names(){return Go(super.names,this.iterable.names)}},Nu=class extends Yi{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)}};Nu.kind="func";var Du=class extends Mu{render(e){return"return "+super.render(e)}};Du.kind="return";var Db=class extends Yi{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&&Go(e,this.catch.names),this.finally&&Go(e,this.finally.names),e}},Fu=class extends Yi{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Fu.kind="catch";var Lu=class extends Yi{render(e){return"finally"+super.render(e)}};Lu.kind="finally";var Fb=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
24
|
+
`:""},this._extScope=e,this._scope=new Vn.Scope({parent:e}),this._nodes=[new $b]}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 Ib(e,s,n)),s}const(e,r,n){return this._def(Vn.varKinds.const,e,r,n)}let(e,r,n){return this._def(Vn.varKinds.let,e,r,n)}var(e,r,n){return this._def(Vn.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new oh(e,r,n))}add(e,r){return this._leafNode(new Pb(e,Ae.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Be.nil&&this._leafNode(new qb(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,Be.addCodeArg)(r,i));return r.push("}"),new Be._Code(r)}if(e,r,n){if(this._blockNode(new Jo(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 Jo(e))}else(){return this._elseNode(new Cl)}endIf(){return this._endBlockNode(Jo,Cl)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Mb(e),r)}forRange(e,r,n,i,s=this.opts.es5?Vn.varKinds.var:Vn.varKinds.let){let a=this._scope.toName(e);return this._for(new Nb(s,a,r,n),()=>i(a))}forOf(e,r,n,i=Vn.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let a=r instanceof Be.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Be._)`${a}.length`,l=>{this.var(s,(0,Be._)`${a}[${l}]`),n(s)})}return this._for(new ah("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?Vn.varKinds.var:Vn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Be._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new ah("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(Yo)}label(e){return this._leafNode(new kb(e))}break(e){return this._leafNode(new Tb(e))}return(e){let r=new Du;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Du)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new Db;if(this._blockNode(i),this.code(e),r){let s=this.name("e");this._currNode=i.catch=new Fu(s),r(s)}return n&&(this._currNode=i.finally=new Lu,this.code(n)),this._endBlockNode(Fu,Lu)}throw(e){return this._leafNode(new Ab(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=Be.nil,n,i){return this._blockNode(new Nu(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Nu)}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 Jo))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}};Ae.CodeGen=Fb;function Go(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function lh(t,e){return e instanceof Be._CodeOrName?Go(t,e.names):t}function El(t,e,r){if(t instanceof Be.Name)return n(t);if(!i(t))return t;return new Be._Code(t._items.reduce((s,a)=>(a instanceof Be.Name&&(a=n(a)),a instanceof Be._Code?s.push(...a._items):s.push(a),s),[]));function n(s){let a=r[s.str];return a===void 0||e[s.str]!==1?s:(delete e[s.str],a)}function i(s){return s instanceof Be._Code&&s._items.some(a=>a instanceof Be.Name&&e[a.str]===1&&r[a.str]!==void 0)}}function rj(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function lE(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Be._)`!${Lb(t)}`}Ae.not=lE;var nj=cE(Ae.operators.AND);function ij(...t){return t.reduce(nj)}Ae.and=ij;var sj=cE(Ae.operators.OR);function oj(...t){return t.reduce(sj)}Ae.or=oj;function cE(t){return(e,r)=>e===Be.nil?r:r===Be.nil?e:(0,Be._)`${Lb(e)} ${t} ${Lb(r)}`}function Lb(t){return t instanceof Be.Name?t:(0,Be._)`(${t})`}});var We=F(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.checkStrictMode=De.getErrorPath=De.Type=De.useFunc=De.setEvaluated=De.evaluatedPropsToName=De.mergeEvaluated=De.eachItem=De.unescapeJsonPointer=De.escapeJsonPointer=De.escapeFragment=De.unescapeFragment=De.schemaRefOrVal=De.schemaHasRulesButRef=De.schemaHasRules=De.checkUnknownRules=De.alwaysValidSchema=De.toHash=void 0;var pt=Ne(),aj=$u();function lj(t){let e={};for(let r of t)e[r]=!0;return e}De.toHash=lj;function cj(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(dE(t,e),!pE(e,t.self.RULES.all))}De.alwaysValidSchema=cj;function dE(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]||gE(t,`unknown keyword: "${s}"`)}De.checkUnknownRules=dE;function pE(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}De.schemaHasRules=pE;function uj(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}De.schemaHasRulesButRef=uj;function fj({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,pt._)`${r}`}return(0,pt._)`${t}${e}${(0,pt.getProperty)(n)}`}De.schemaRefOrVal=fj;function dj(t){return hE(decodeURIComponent(t))}De.unescapeFragment=dj;function pj(t){return encodeURIComponent(Ub(t))}De.escapeFragment=pj;function Ub(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}De.escapeJsonPointer=Ub;function hE(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}De.unescapeJsonPointer=hE;function hj(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}De.eachItem=hj;function uE({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,s,a,l)=>{let f=a===void 0?s:a instanceof pt.Name?(s instanceof pt.Name?t(i,s,a):e(i,s,a),a):s instanceof pt.Name?(e(i,a,s),s):r(s,a);return l===pt.Name&&!(f instanceof pt.Name)?n(i,f):f}}De.mergeEvaluated={props:uE({mergeNames:(t,e,r)=>t.if((0,pt._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,pt._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,pt._)`${r} || {}`).code((0,pt._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,pt._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,pt._)`${r} || {}`),Hb(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:mE}),items:uE({mergeNames:(t,e,r)=>t.if((0,pt._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,pt._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,pt._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,pt._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function mE(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,pt._)`{}`);return e!==void 0&&Hb(t,r,e),r}De.evaluatedPropsToName=mE;function Hb(t,e,r){Object.keys(r).forEach(n=>t.assign((0,pt._)`${e}${(0,pt.getProperty)(n)}`,!0))}De.setEvaluated=Hb;var fE={};function mj(t,e){return t.scopeValue("func",{ref:e,code:fE[e.code]||(fE[e.code]=new aj._Code(e.code))})}De.useFunc=mj;var jb;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(jb||(De.Type=jb={}));function gj(t,e,r){if(t instanceof pt.Name){let n=e===jb.Num;return r?n?(0,pt._)`"[" + ${t} + "]"`:(0,pt._)`"['" + ${t} + "']"`:n?(0,pt._)`"/" + ${t}`:(0,pt._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,pt.getProperty)(t).toString():"/"+Ub(t)}De.getErrorPath=gj;function gE(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}De.checkStrictMode=gE});var Gi=F(Bb=>{"use strict";Object.defineProperty(Bb,"__esModule",{value:!0});var or=Ne(),yj={data:new or.Name("data"),valCxt:new or.Name("valCxt"),instancePath:new or.Name("instancePath"),parentData:new or.Name("parentData"),parentDataProperty:new or.Name("parentDataProperty"),rootData:new or.Name("rootData"),dynamicAnchors:new or.Name("dynamicAnchors"),vErrors:new or.Name("vErrors"),errors:new or.Name("errors"),this:new or.Name("this"),self:new or.Name("self"),scope:new or.Name("scope"),json:new or.Name("json"),jsonPos:new or.Name("jsonPos"),jsonLen:new or.Name("jsonLen"),jsonPart:new or.Name("jsonPart")};Bb.default=yj});var ju=F(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.extendErrors=ar.resetErrorsCount=ar.reportExtraError=ar.reportError=ar.keyword$DataError=ar.keywordError=void 0;var ze=Ne(),uh=We(),xr=Gi();ar.keywordError={message:({keyword:t})=>(0,ze.str)`must pass "${t}" keyword validation`};ar.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,ze.str)`"${t}" keyword must be ${e} ($data)`:(0,ze.str)`"${t}" keyword is invalid ($data)`};function vj(t,e=ar.keywordError,r,n){let{it:i}=t,{gen:s,compositeRule:a,allErrors:l}=i,f=bE(t,e,r);n??(a||l)?yE(s,f):vE(i,(0,ze._)`[${f}]`)}ar.reportError=vj;function bj(t,e=ar.keywordError,r){let{it:n}=t,{gen:i,compositeRule:s,allErrors:a}=n,l=bE(t,e,r);yE(i,l),s||a||vE(n,xr.default.vErrors)}ar.reportExtraError=bj;function Sj(t,e){t.assign(xr.default.errors,e),t.if((0,ze._)`${xr.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,ze._)`${xr.default.vErrors}.length`,e),()=>t.assign(xr.default.vErrors,null)))}ar.resetErrorsCount=Sj;function wj({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let a=t.name("err");t.forRange("i",i,xr.default.errors,l=>{t.const(a,(0,ze._)`${xr.default.vErrors}[${l}]`),t.if((0,ze._)`${a}.instancePath === undefined`,()=>t.assign((0,ze._)`${a}.instancePath`,(0,ze.strConcat)(xr.default.instancePath,s.errorPath))),t.assign((0,ze._)`${a}.schemaPath`,(0,ze.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,ze._)`${a}.schema`,r),t.assign((0,ze._)`${a}.data`,n))})}ar.extendErrors=wj;function yE(t,e){let r=t.const("err",e);t.if((0,ze._)`${xr.default.vErrors} === null`,()=>t.assign(xr.default.vErrors,(0,ze._)`[${r}]`),(0,ze._)`${xr.default.vErrors}.push(${r})`),t.code((0,ze._)`${xr.default.errors}++`)}function vE(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,ze._)`new ${t.ValidationError}(${e})`):(r.assign((0,ze._)`${n}.errors`,e),r.return(!1))}var Ko={keyword:new ze.Name("keyword"),schemaPath:new ze.Name("schemaPath"),params:new ze.Name("params"),propertyName:new ze.Name("propertyName"),message:new ze.Name("message"),schema:new ze.Name("schema"),parentSchema:new ze.Name("parentSchema")};function bE(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,ze._)`{}`:_j(t,e,r)}function _j(t,e,r={}){let{gen:n,it:i}=t,s=[Rj(i,r),xj(t,r)];return Cj(t,e,s),n.object(...s)}function Rj({errorPath:t},{instancePath:e}){let r=e?(0,ze.str)`${t}${(0,uh.getErrorPath)(e,uh.Type.Str)}`:t;return[xr.default.instancePath,(0,ze.strConcat)(xr.default.instancePath,r)]}function xj({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,ze.str)`${e}/${t}`;return r&&(i=(0,ze.str)`${i}${(0,uh.getErrorPath)(r,uh.Type.Str)}`),[Ko.schemaPath,i]}function Cj(t,{params:e,message:r},n){let{keyword:i,data:s,schemaValue:a,it:l}=t,{opts:f,propertyName:d,topSchemaRef:m,schemaPath:g}=l;n.push([Ko.keyword,i],[Ko.params,typeof e=="function"?e(t):e||(0,ze._)`{}`]),f.messages&&n.push([Ko.message,typeof r=="function"?r(t):r]),f.verbose&&n.push([Ko.schema,a],[Ko.parentSchema,(0,ze._)`${m}${g}`],[xr.default.data,s]),d&&n.push([Ko.propertyName,d])}});var wE=F(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.boolOrEmptySchema=Ol.topBoolOrEmptySchema=void 0;var Ej=ju(),Oj=Ne(),Ij=Gi(),Pj={message:"boolean schema is false"};function kj(t){let{gen:e,schema:r,validateName:n}=t;r===!1?SE(t,!1):typeof r=="object"&&r.$async===!0?e.return(Ij.default.data):(e.assign((0,Oj._)`${n}.errors`,null),e.return(!0))}Ol.topBoolOrEmptySchema=kj;function Tj(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),SE(t)):r.var(e,!0)}Ol.boolOrEmptySchema=Tj;function SE(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,Ej.reportError)(i,Pj,void 0,e)}});var Vb=F(Il=>{"use strict";Object.defineProperty(Il,"__esModule",{value:!0});Il.getRules=Il.isJSONType=void 0;var Aj=["string","number","integer","boolean","null","object","array"],qj=new Set(Aj);function $j(t){return typeof t=="string"&&qj.has(t)}Il.isJSONType=$j;function Mj(){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:{}}}Il.getRules=Mj});var Wb=F(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.shouldUseRule=Ms.shouldUseGroup=Ms.schemaHasRulesForType=void 0;function Nj({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&_E(t,n)}Ms.schemaHasRulesForType=Nj;function _E(t,e){return e.rules.some(r=>RE(t,r))}Ms.shouldUseGroup=_E;function RE(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))}Ms.shouldUseRule=RE});var Uu=F(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.reportTypeError=lr.checkDataTypes=lr.checkDataType=lr.coerceAndCheckDataType=lr.getJSONTypes=lr.getSchemaTypes=lr.DataType=void 0;var Dj=Vb(),Fj=Wb(),Lj=ju(),Oe=Ne(),xE=We(),Pl;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Pl||(lr.DataType=Pl={}));function jj(t){let e=CE(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}lr.getSchemaTypes=jj;function CE(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(Dj.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}lr.getJSONTypes=CE;function Uj(t,e){let{gen:r,data:n,opts:i}=t,s=Hj(e,i.coerceTypes),a=e.length>0&&!(s.length===0&&e.length===1&&(0,Fj.schemaHasRulesForType)(t,e[0]));if(a){let l=Jb(e,n,i.strictNumbers,Pl.Wrong);r.if(l,()=>{s.length?Bj(t,e,s):Yb(t)})}return a}lr.coerceAndCheckDataType=Uj;var EE=new Set(["string","number","integer","boolean","null"]);function Hj(t,e){return e?t.filter(r=>EE.has(r)||e==="array"&&r==="array"):[]}function Bj(t,e,r){let{gen:n,data:i,opts:s}=t,a=n.let("dataType",(0,Oe._)`typeof ${i}`),l=n.let("coerced",(0,Oe._)`undefined`);s.coerceTypes==="array"&&n.if((0,Oe._)`${a} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,Oe._)`${i}[0]`).assign(a,(0,Oe._)`typeof ${i}`).if(Jb(e,i,s.strictNumbers),()=>n.assign(l,i))),n.if((0,Oe._)`${l} !== undefined`);for(let d of r)(EE.has(d)||d==="array"&&s.coerceTypes==="array")&&f(d);n.else(),Yb(t),n.endIf(),n.if((0,Oe._)`${l} !== undefined`,()=>{n.assign(i,l),Vj(t,l)});function f(d){switch(d){case"string":n.elseIf((0,Oe._)`${a} == "number" || ${a} == "boolean"`).assign(l,(0,Oe._)`"" + ${i}`).elseIf((0,Oe._)`${i} === null`).assign(l,(0,Oe._)`""`);return;case"number":n.elseIf((0,Oe._)`${a} == "boolean" || ${i} === null
|
|
25
|
+
|| (${a} == "string" && ${i} && ${i} == +${i})`).assign(l,(0,Oe._)`+${i}`);return;case"integer":n.elseIf((0,Oe._)`${a} === "boolean" || ${i} === null
|
|
26
|
+
|| (${a} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(l,(0,Oe._)`+${i}`);return;case"boolean":n.elseIf((0,Oe._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(l,!1).elseIf((0,Oe._)`${i} === "true" || ${i} === 1`).assign(l,!0);return;case"null":n.elseIf((0,Oe._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(l,null);return;case"array":n.elseIf((0,Oe._)`${a} === "string" || ${a} === "number"
|
|
27
|
+
|| ${a} === "boolean" || ${i} === null`).assign(l,(0,Oe._)`[${i}]`)}}}function Vj({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Oe._)`${e} !== undefined`,()=>t.assign((0,Oe._)`${e}[${r}]`,n))}function zb(t,e,r,n=Pl.Correct){let i=n===Pl.Correct?Oe.operators.EQ:Oe.operators.NEQ,s;switch(t){case"null":return(0,Oe._)`${e} ${i} null`;case"array":s=(0,Oe._)`Array.isArray(${e})`;break;case"object":s=(0,Oe._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=a((0,Oe._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=a();break;default:return(0,Oe._)`typeof ${e} ${i} ${t}`}return n===Pl.Correct?s:(0,Oe.not)(s);function a(l=Oe.nil){return(0,Oe.and)((0,Oe._)`typeof ${e} == "number"`,l,r?(0,Oe._)`isFinite(${e})`:Oe.nil)}}lr.checkDataType=zb;function Jb(t,e,r,n){if(t.length===1)return zb(t[0],e,r,n);let i,s=(0,xE.toHash)(t);if(s.array&&s.object){let a=(0,Oe._)`typeof ${e} != "object"`;i=s.null?a:(0,Oe._)`!${e} || ${a}`,delete s.null,delete s.array,delete s.object}else i=Oe.nil;s.number&&delete s.integer;for(let a in s)i=(0,Oe.and)(i,zb(a,e,r,n));return i}lr.checkDataTypes=Jb;var Wj={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Oe._)`{type: ${t}}`:(0,Oe._)`{type: ${e}}`};function Yb(t){let e=zj(t);(0,Lj.reportError)(e,Wj)}lr.reportTypeError=Yb;function zj(t){let{gen:e,data:r,schema:n}=t,i=(0,xE.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var IE=F(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:!0});fh.assignDefaults=void 0;var kl=Ne(),Jj=We();function Yj(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)OE(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>OE(t,s,i.default))}fh.assignDefaults=Yj;function OE(t,e,r){let{gen:n,compositeRule:i,data:s,opts:a}=t;if(r===void 0)return;let l=(0,kl._)`${s}${(0,kl.getProperty)(e)}`;if(i){(0,Jj.checkStrictMode)(t,`default is ignored for: ${l}`);return}let f=(0,kl._)`${l} === undefined`;a.useDefaults==="empty"&&(f=(0,kl._)`${f} || ${l} === null || ${l} === ""`),n.if(f,(0,kl._)`${l} = ${(0,kl.stringify)(r)}`)}});var Sn=F(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.validateUnion=ct.validateArray=ct.usePattern=ct.callValidateCode=ct.schemaProperties=ct.allSchemaProperties=ct.noPropertyInData=ct.propertyInData=ct.isOwnProperty=ct.hasPropFunc=ct.reportMissingProp=ct.checkMissingProp=ct.checkReportMissingProp=void 0;var bt=Ne(),Gb=We(),Ns=Gi(),Gj=We();function Kj(t,e){let{gen:r,data:n,it:i}=t;r.if(Qb(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,bt._)`${e}`},!0),t.error()})}ct.checkReportMissingProp=Kj;function Qj({gen:t,data:e,it:{opts:r}},n,i){return(0,bt.or)(...n.map(s=>(0,bt.and)(Qb(t,e,s,r.ownProperties),(0,bt._)`${i} = ${s}`)))}ct.checkMissingProp=Qj;function Zj(t,e){t.setParams({missingProperty:e},!0),t.error()}ct.reportMissingProp=Zj;function PE(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,bt._)`Object.prototype.hasOwnProperty`})}ct.hasPropFunc=PE;function Kb(t,e,r){return(0,bt._)`${PE(t)}.call(${e}, ${r})`}ct.isOwnProperty=Kb;function Xj(t,e,r,n){let i=(0,bt._)`${e}${(0,bt.getProperty)(r)} !== undefined`;return n?(0,bt._)`${i} && ${Kb(t,e,r)}`:i}ct.propertyInData=Xj;function Qb(t,e,r,n){let i=(0,bt._)`${e}${(0,bt.getProperty)(r)} === undefined`;return n?(0,bt.or)(i,(0,bt.not)(Kb(t,e,r))):i}ct.noPropertyInData=Qb;function kE(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}ct.allSchemaProperties=kE;function e2(t,e){return kE(e).filter(r=>!(0,Gb.alwaysValidSchema)(t,e[r]))}ct.schemaProperties=e2;function t2({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:a},l,f,d){let m=d?(0,bt._)`${t}, ${e}, ${n}${i}`:e,g=[[Ns.default.instancePath,(0,bt.strConcat)(Ns.default.instancePath,s)],[Ns.default.parentData,a.parentData],[Ns.default.parentDataProperty,a.parentDataProperty],[Ns.default.rootData,Ns.default.rootData]];a.opts.dynamicRef&&g.push([Ns.default.dynamicAnchors,Ns.default.dynamicAnchors]);let y=(0,bt._)`${m}, ${r.object(...g)}`;return f!==bt.nil?(0,bt._)`${l}.call(${f}, ${y})`:(0,bt._)`${l}(${y})`}ct.callValidateCode=t2;var r2=(0,bt._)`new RegExp`;function n2({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,bt._)`${i.code==="new RegExp"?r2:(0,Gj.useFunc)(t,i)}(${r}, ${n})`})}ct.usePattern=n2;function i2(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 a(()=>e.assign(l,!1)),l}return e.var(s,!0),a(()=>e.break()),s;function a(l){let f=e.const("len",(0,bt._)`${r}.length`);e.forRange("i",0,f,d=>{t.subschema({keyword:n,dataProp:d,dataPropType:Gb.Type.Num},s),e.if((0,bt.not)(s),l)})}}ct.validateArray=i2;function s2(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,Gb.alwaysValidSchema)(i,f))&&!i.opts.unevaluated)return;let a=e.let("valid",!1),l=e.name("_valid");e.block(()=>r.forEach((f,d)=>{let m=t.subschema({keyword:n,schemaProp:d,compositeRule:!0},l);e.assign(a,(0,bt._)`${a} || ${l}`),t.mergeValidEvaluated(m,l)||e.if((0,bt.not)(a))})),t.result(a,()=>t.reset(),()=>t.error(!0))}ct.validateUnion=s2});var qE=F(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.validateKeywordUsage=vi.validSchemaType=vi.funcKeywordCode=vi.macroKeywordCode=void 0;var Cr=Ne(),Qo=Gi(),o2=Sn(),a2=ju();function l2(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:a}=t,l=e.macro.call(a.self,i,s,a),f=AE(r,n,l);a.opts.validateSchema!==!1&&a.self.validateSchema(l,!0);let d=r.name("valid");t.subschema({schema:l,schemaPath:Cr.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:f,compositeRule:!0},d),t.pass(d,()=>t.error(!0))}vi.macroKeywordCode=l2;function c2(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:a,$data:l,it:f}=t;f2(f,e);let d=!l&&e.compile?e.compile.call(f.self,s,a,f):e.validate,m=AE(n,i,d),g=n.let("valid");t.block$data(g,y),t.ok((r=e.valid)!==null&&r!==void 0?r:g);function y(){if(e.errors===!1)R(),e.modifying&&TE(t),T(()=>t.error());else{let A=e.async?w():C();e.modifying&&TE(t),T(()=>u2(t,A))}}function w(){let A=n.let("ruleErrs",null);return n.try(()=>R((0,Cr._)`await `),U=>n.assign(g,!1).if((0,Cr._)`${U} instanceof ${f.ValidationError}`,()=>n.assign(A,(0,Cr._)`${U}.errors`),()=>n.throw(U))),A}function C(){let A=(0,Cr._)`${m}.errors`;return n.assign(A,null),R(Cr.nil),A}function R(A=e.async?(0,Cr._)`await `:Cr.nil){let U=f.opts.passContext?Qo.default.this:Qo.default.self,B=!("compile"in e&&!l||e.schema===!1);n.assign(g,(0,Cr._)`${A}${(0,o2.callValidateCode)(t,m,U,B)}`,e.modifying)}function T(A){var U;n.if((0,Cr.not)((U=e.valid)!==null&&U!==void 0?U:g),A)}}vi.funcKeywordCode=c2;function TE(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Cr._)`${n.parentData}[${n.parentDataProperty}]`))}function u2(t,e){let{gen:r}=t;r.if((0,Cr._)`Array.isArray(${e})`,()=>{r.assign(Qo.default.vErrors,(0,Cr._)`${Qo.default.vErrors} === null ? ${e} : ${Qo.default.vErrors}.concat(${e})`).assign(Qo.default.errors,(0,Cr._)`${Qo.default.vErrors}.length`),(0,a2.extendErrors)(t)},()=>t.error())}function f2({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function AE(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,Cr.stringify)(r)})}function d2(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")}vi.validSchemaType=d2;function p2({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 a=i.dependencies;if(a?.some(l=>!Object.prototype.hasOwnProperty.call(t,l)))throw new Error(`parent schema must have dependencies of ${s}: ${a.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)}}vi.validateKeywordUsage=p2});var ME=F(Ds=>{"use strict";Object.defineProperty(Ds,"__esModule",{value:!0});Ds.extendSubschemaMode=Ds.extendSubschemaData=Ds.getSubschema=void 0;var bi=Ne(),$E=We();function h2(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:a}){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,bi._)`${t.schemaPath}${(0,bi.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,bi._)`${t.schemaPath}${(0,bi.getProperty)(e)}${(0,bi.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,$E.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}Ds.getSubschema=h2;function m2(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:a}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:l}=e;if(r!==void 0){let{errorPath:d,dataPathArr:m,opts:g}=e,y=l.let("data",(0,bi._)`${e.data}${(0,bi.getProperty)(r)}`,!0);f(y),t.errorPath=(0,bi.str)`${d}${(0,$E.getErrorPath)(r,n,g.jsPropertySyntax)}`,t.parentDataProperty=(0,bi._)`${r}`,t.dataPathArr=[...m,t.parentDataProperty]}if(i!==void 0){let d=i instanceof bi.Name?i:l.let("data",i,!0);f(d),a!==void 0&&(t.propertyName=a)}s&&(t.dataTypes=s);function f(d){t.data=d,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,d]}}Ds.extendSubschemaData=m2;function g2(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}Ds.extendSubschemaMode=g2});var Zb=F((q5,NE)=>{"use strict";NE.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 a=s[i];if(!t(e[a],r[a]))return!1}return!0}return e!==e&&r!==r}});var FE=F(($5,DE)=>{"use strict";var Fs=DE.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(){};dh(e,n,i,t,"",t)};Fs.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Fs.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Fs.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Fs.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 dh(t,e,r,n,i,s,a,l,f,d){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,a,l,f,d);for(var m in n){var g=n[m];if(Array.isArray(g)){if(m in Fs.arrayKeywords)for(var y=0;y<g.length;y++)dh(t,e,r,g[y],i+"/"+m+"/"+y,s,i,m,n,y)}else if(m in Fs.propsKeywords){if(g&&typeof g=="object")for(var w in g)dh(t,e,r,g[w],i+"/"+m+"/"+y2(w),s,i,m,n,w)}else(m in Fs.keywords||t.allKeys&&!(m in Fs.skipKeywords))&&dh(t,e,r,g,i+"/"+m,s,i,m,n)}r(n,i,s,a,l,f,d)}}function y2(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Hu=F(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.getSchemaRefs=Dr.resolveUrl=Dr.normalizeId=Dr._getFullPath=Dr.getFullPath=Dr.inlineRef=void 0;var v2=We(),b2=Zb(),S2=FE(),w2=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function _2(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Xb(t):e?LE(t)<=e:!1}Dr.inlineRef=_2;var R2=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Xb(t){for(let e in t){if(R2.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Xb)||typeof r=="object"&&Xb(r))return!0}return!1}function LE(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!w2.has(r)&&(typeof t[r]=="object"&&(0,v2.eachItem)(t[r],n=>e+=LE(n)),e===1/0))return 1/0}return e}function jE(t,e="",r){r!==!1&&(e=Tl(e));let n=t.parse(e);return UE(t,n)}Dr.getFullPath=jE;function UE(t,e){return t.serialize(e).split("#")[0]+"#"}Dr._getFullPath=UE;var x2=/#\/?$/;function Tl(t){return t?t.replace(x2,""):""}Dr.normalizeId=Tl;function C2(t,e,r){return r=Tl(r),t.resolve(e,r)}Dr.resolveUrl=C2;var E2=/^[a-z_][-a-z0-9._]*$/i;function O2(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=Tl(t[r]||e),s={"":i},a=jE(n,i,!1),l={},f=new Set;return S2(t,{allKeys:!0},(g,y,w,C)=>{if(C===void 0)return;let R=a+y,T=s[C];typeof g[r]=="string"&&(T=A.call(this,g[r])),U.call(this,g.$anchor),U.call(this,g.$dynamicAnchor),s[y]=T;function A(B){let V=this.opts.uriResolver.resolve;if(B=Tl(T?V(T,B):B),f.has(B))throw m(B);f.add(B);let W=this.refs[B];return typeof W=="string"&&(W=this.refs[W]),typeof W=="object"?d(g,W.schema,B):B!==Tl(R)&&(B[0]==="#"?(d(g,l[B],B),l[B]=g):this.refs[B]=R),B}function U(B){if(typeof B=="string"){if(!E2.test(B))throw new Error(`invalid anchor "${B}"`);A.call(this,`#${B}`)}}}),l;function d(g,y,w){if(y!==void 0&&!b2(g,y))throw m(w)}function m(g){return new Error(`reference "${g}" resolves to more than one schema`)}}Dr.getSchemaRefs=O2});var Wu=F(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.getData=Ls.KeywordCxt=Ls.validateFunctionCode=void 0;var zE=wE(),HE=Uu(),tS=Wb(),ph=Uu(),I2=IE(),Vu=qE(),eS=ME(),pe=Ne(),Se=Gi(),P2=Hu(),Ki=We(),Bu=ju();function k2(t){if(GE(t)&&(KE(t),YE(t))){q2(t);return}JE(t,()=>(0,zE.topBoolOrEmptySchema)(t))}Ls.validateFunctionCode=k2;function JE({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,pe._)`${Se.default.data}, ${Se.default.valCxt}`,n.$async,()=>{t.code((0,pe._)`"use strict"; ${BE(r,i)}`),A2(t,i),t.code(s)}):t.func(e,(0,pe._)`${Se.default.data}, ${T2(i)}`,n.$async,()=>t.code(BE(r,i)).code(s))}function T2(t){return(0,pe._)`{${Se.default.instancePath}="", ${Se.default.parentData}, ${Se.default.parentDataProperty}, ${Se.default.rootData}=${Se.default.data}${t.dynamicRef?(0,pe._)`, ${Se.default.dynamicAnchors}={}`:pe.nil}}={}`}function A2(t,e){t.if(Se.default.valCxt,()=>{t.var(Se.default.instancePath,(0,pe._)`${Se.default.valCxt}.${Se.default.instancePath}`),t.var(Se.default.parentData,(0,pe._)`${Se.default.valCxt}.${Se.default.parentData}`),t.var(Se.default.parentDataProperty,(0,pe._)`${Se.default.valCxt}.${Se.default.parentDataProperty}`),t.var(Se.default.rootData,(0,pe._)`${Se.default.valCxt}.${Se.default.rootData}`),e.dynamicRef&&t.var(Se.default.dynamicAnchors,(0,pe._)`${Se.default.valCxt}.${Se.default.dynamicAnchors}`)},()=>{t.var(Se.default.instancePath,(0,pe._)`""`),t.var(Se.default.parentData,(0,pe._)`undefined`),t.var(Se.default.parentDataProperty,(0,pe._)`undefined`),t.var(Se.default.rootData,Se.default.data),e.dynamicRef&&t.var(Se.default.dynamicAnchors,(0,pe._)`{}`)})}function q2(t){let{schema:e,opts:r,gen:n}=t;JE(t,()=>{r.$comment&&e.$comment&&ZE(t),F2(t),n.let(Se.default.vErrors,null),n.let(Se.default.errors,0),r.unevaluated&&$2(t),QE(t),U2(t)})}function $2(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,pe._)`${r}.evaluated`),e.if((0,pe._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,pe._)`${t.evaluated}.props`,(0,pe._)`undefined`)),e.if((0,pe._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,pe._)`${t.evaluated}.items`,(0,pe._)`undefined`))}function BE(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,pe._)`/*# sourceURL=${r} */`:pe.nil}function M2(t,e){if(GE(t)&&(KE(t),YE(t))){N2(t,e);return}(0,zE.boolOrEmptySchema)(t,e)}function YE({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 GE(t){return typeof t.schema!="boolean"}function N2(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&ZE(t),L2(t),j2(t);let s=n.const("_errs",Se.default.errors);QE(t,s),n.var(e,(0,pe._)`${s} === ${Se.default.errors}`)}function KE(t){(0,Ki.checkUnknownRules)(t),D2(t)}function QE(t,e){if(t.opts.jtd)return VE(t,[],!1,e);let r=(0,HE.getSchemaTypes)(t.schema),n=(0,HE.coerceAndCheckDataType)(t,r);VE(t,r,!n,e)}function D2(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Ki.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function F2(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Ki.checkStrictMode)(t,"default is ignored in the schema root")}function L2(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,P2.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function j2(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function ZE({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,pe._)`${Se.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let a=(0,pe.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,pe._)`${Se.default.self}.opts.$comment(${s}, ${a}, ${l}.schema)`)}}function U2(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,pe._)`${Se.default.errors} === 0`,()=>e.return(Se.default.data),()=>e.throw((0,pe._)`new ${i}(${Se.default.vErrors})`)):(e.assign((0,pe._)`${n}.errors`,Se.default.vErrors),s.unevaluated&&H2(t),e.return((0,pe._)`${Se.default.errors} === 0`))}function H2({gen:t,evaluated:e,props:r,items:n}){r instanceof pe.Name&&t.assign((0,pe._)`${e}.props`,r),n instanceof pe.Name&&t.assign((0,pe._)`${e}.items`,n)}function VE(t,e,r,n){let{gen:i,schema:s,data:a,allErrors:l,opts:f,self:d}=t,{RULES:m}=d;if(s.$ref&&(f.ignoreKeywordsWithRef||!(0,Ki.schemaHasRulesButRef)(s,m))){i.block(()=>eO(t,"$ref",m.all.$ref.definition));return}f.jtd||B2(t,e),i.block(()=>{for(let y of m.rules)g(y);g(m.post)});function g(y){(0,tS.shouldUseGroup)(s,y)&&(y.type?(i.if((0,ph.checkDataType)(y.type,a,f.strictNumbers)),WE(t,y),e.length===1&&e[0]===y.type&&r&&(i.else(),(0,ph.reportTypeError)(t)),i.endIf()):WE(t,y),l||i.if((0,pe._)`${Se.default.errors} === ${n||0}`))}}function WE(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,I2.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,tS.shouldUseRule)(n,s)&&eO(t,s.keyword,s.definition,e.type)})}function B2(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(V2(t,e),t.opts.allowUnionTypes||W2(t,e),z2(t,t.dataTypes))}function V2(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{XE(t.dataTypes,r)||rS(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),Y2(t,e)}}function W2(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&rS(t,"use allowUnionTypes to allow union type keyword")}function z2(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,tS.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(a=>J2(e,a))&&rS(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function J2(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function XE(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function Y2(t,e){let r=[];for(let n of t.dataTypes)XE(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function rS(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Ki.checkStrictMode)(t,e,t.opts.strictTypes)}var hh=class{constructor(e,r,n){if((0,Vu.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,Ki.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",tO(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Vu.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",Se.default.errors))}result(e,r,n){this.failResult((0,pe.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,pe.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,pe._)`${r} !== undefined && (${(0,pe.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?Bu.reportExtraError:Bu.reportError)(this,this.def.error,r)}$dataError(){(0,Bu.reportError)(this,this.def.$dataError||Bu.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Bu.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=pe.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=pe.nil,r=pe.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:a}=this;n.if((0,pe.or)((0,pe._)`${i} === undefined`,r)),e!==pe.nil&&n.assign(e,!0),(s.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==pe.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,pe.or)(a(),l());function a(){if(n.length){if(!(r instanceof pe.Name))throw new Error("ajv implementation error");let f=Array.isArray(n)?n:[n];return(0,pe._)`${(0,ph.checkDataTypes)(f,r,s.opts.strictNumbers,ph.DataType.Wrong)}`}return pe.nil}function l(){if(i.validateSchema){let f=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,pe._)`!${f}(${r})`}return pe.nil}}subschema(e,r){let n=(0,eS.getSubschema)(this.it,e);(0,eS.extendSubschemaData)(n,this.it,e),(0,eS.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return M2(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Ki.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Ki.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,pe.Name)),!0}};Ls.KeywordCxt=hh;function eO(t,e,r,n){let i=new hh(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Vu.funcKeywordCode)(i,r):"macro"in r?(0,Vu.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Vu.funcKeywordCode)(i,r)}var G2=/^\/(?:[^~]|~0|~1)*$/,K2=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function tO(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return Se.default.rootData;if(t[0]==="/"){if(!G2.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=Se.default.rootData}else{let d=K2.exec(t);if(!d)throw new Error(`Invalid JSON-pointer: ${t}`);let m=+d[1];if(i=d[2],i==="#"){if(m>=e)throw new Error(f("property/index",m));return n[e-m]}if(m>e)throw new Error(f("data",m));if(s=r[e-m],!i)return s}let a=s,l=i.split("/");for(let d of l)d&&(s=(0,pe._)`${s}${(0,pe.getProperty)((0,Ki.unescapeJsonPointer)(d))}`,a=(0,pe._)`${a} && ${s}`);return a;function f(d,m){return`Cannot access ${d} ${m} levels up, current level is ${e}`}}Ls.getData=tO});var mh=F(iS=>{"use strict";Object.defineProperty(iS,"__esModule",{value:!0});var nS=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};iS.default=nS});var zu=F(aS=>{"use strict";Object.defineProperty(aS,"__esModule",{value:!0});var sS=Hu(),oS=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,sS.resolveUrl)(e,r,n),this.missingSchema=(0,sS.normalizeId)((0,sS.getFullPath)(e,this.missingRef))}};aS.default=oS});var yh=F(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.resolveSchema=wn.getCompilingSchema=wn.resolveRef=wn.compileSchema=wn.SchemaEnv=void 0;var Wn=Ne(),Q2=mh(),Zo=Gi(),zn=Hu(),rO=We(),Z2=Wu(),Al=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,zn.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};wn.SchemaEnv=Al;function cS(t){let e=nO.call(this,t);if(e)return e;let r=(0,zn.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,a=new Wn.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),l;t.$async&&(l=a.scopeValue("Error",{ref:Q2.default,code:(0,Wn._)`require("ajv/dist/runtime/validation_error").default`}));let f=a.scopeName("validate");t.validateName=f;let d={gen:a,allErrors:this.opts.allErrors,data:Zo.default.data,parentData:Zo.default.parentData,parentDataProperty:Zo.default.parentDataProperty,dataNames:[Zo.default.data],dataPathArr:[Wn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Wn.stringify)(t.schema)}:{ref:t.schema}),validateName:f,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Wn.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Wn._)`""`,opts:this.opts,self:this},m;try{this._compilations.add(t),(0,Z2.validateFunctionCode)(d),a.optimize(this.opts.code.optimize);let g=a.toString();m=`${a.scopeRefs(Zo.default.scope)}return ${g}`,this.opts.code.process&&(m=this.opts.code.process(m,t));let w=new Function(`${Zo.default.self}`,`${Zo.default.scope}`,m)(this,this.scope.get());if(this.scope.value(f,{ref:w}),w.errors=null,w.schema=t.schema,w.schemaEnv=t,t.$async&&(w.$async=!0),this.opts.code.source===!0&&(w.source={validateName:f,validateCode:g,scopeValues:a._values}),this.opts.unevaluated){let{props:C,items:R}=d;w.evaluated={props:C instanceof Wn.Name?void 0:C,items:R instanceof Wn.Name?void 0:R,dynamicProps:C instanceof Wn.Name,dynamicItems:R instanceof Wn.Name},w.source&&(w.source.evaluated=(0,Wn.stringify)(w.evaluated))}return t.validate=w,t}catch(g){throw delete t.validate,delete t.validateName,m&&this.logger.error("Error compiling schema, function code:",m),g}finally{this._compilations.delete(t)}}wn.compileSchema=cS;function X2(t,e,r){var n;r=(0,zn.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=rU.call(this,t,r);if(s===void 0){let a=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:l}=this.opts;a&&(s=new Al({schema:a,schemaId:l,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=eU.call(this,s)}wn.resolveRef=X2;function eU(t){return(0,zn.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:cS.call(this,t)}function nO(t){for(let e of this._compilations)if(tU(e,t))return e}wn.getCompilingSchema=nO;function tU(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function rU(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||gh.call(this,t,e)}function gh(t,e){let r=this.opts.uriResolver.parse(e),n=(0,zn._getFullPath)(this.opts.uriResolver,r),i=(0,zn.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return lS.call(this,r,t);let s=(0,zn.normalizeId)(n),a=this.refs[s]||this.schemas[s];if(typeof a=="string"){let l=gh.call(this,t,a);return typeof l?.schema!="object"?void 0:lS.call(this,r,l)}if(typeof a?.schema=="object"){if(a.validate||cS.call(this,a),s===(0,zn.normalizeId)(e)){let{schema:l}=a,{schemaId:f}=this.opts,d=l[f];return d&&(i=(0,zn.resolveUrl)(this.opts.uriResolver,i,d)),new Al({schema:l,schemaId:f,root:t,baseId:i})}return lS.call(this,r,a)}}wn.resolveSchema=gh;var nU=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function lS(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,rO.unescapeFragment)(l)];if(f===void 0)return;r=f;let d=typeof r=="object"&&r[this.opts.schemaId];!nU.has(l)&&d&&(e=(0,zn.resolveUrl)(this.opts.uriResolver,e,d))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,rO.schemaHasRulesButRef)(r,this.RULES)){let l=(0,zn.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=gh.call(this,n,l)}let{schemaId:a}=this.opts;if(s=s||new Al({schema:r,schemaId:a,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var iO=F((j5,iU)=>{iU.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 dS=F((U5,uO)=>{"use strict";var sU=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),oO=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),uS=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),aO=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),oU=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function fS(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 aU=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function sO(t){return t.length=0,!0}function lU(t,e,r){if(t.length){let n=fS(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function cU(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,a=!1,l=lU;for(let f=0;f<t.length;f++){let d=t[f];if(!(d==="["||d==="]"))if(d===":"){if(s===!0&&(a=!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(d==="%"){if(!l(i,n,r))break;l=sO}else{i.push(d);continue}}return i.length&&(l===sO?r.zone=i.join(""):a?n.push(i.join("")):n.push(fS(i))),r.address=n.join(""),r}function lO(t){if(uU(t,":")<2)return{host:t,isIPV6:!1};let e=cU(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 uU(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function fU(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 dU={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},pU=/[@/?#:]/g,hU=/[@/?#]/g;function cO(t,e){let r=e?hU:pU;return r.lastIndex=0,t.replace(r,n=>dU[n])}function mU(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(uS(i)){let s=i.toUpperCase(),a=String.fromCharCode(parseInt(s,16));e&&aO(a)?r+=a:r+="%"+s,n+=2;continue}}r+=t[n]}return r}function gU(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(uS(n)){let i=n.toUpperCase(),s=String.fromCharCode(parseInt(i,16));s!=="."&&aO(s)?e+=s:e+="%"+i,r+=2;continue}}oU(t[r])?e+=t[r]:e+=escape(t[r])}return e}function yU(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(uS(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function vU(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!oO(r)){let n=lO(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}uO.exports={nonSimpleDomain:aU,recomposeAuthority:vU,reescapeHostDelimiters:cO,normalizePercentEncoding:mU,normalizePathEncoding:gU,escapePreservingEscapes:yU,removeDotSegments:fU,isIPv4:oO,isUUID:sU,normalizeIPv6:lO,stringArrayToHexStripped:fS}});var mO=F((H5,hO)=>{"use strict";var{isUUID:bU}=dS(),SU=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,wU=["http","https","ws","wss","urn","urn:uuid"];function _U(t){return wU.indexOf(t)!==-1}function pS(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 fO(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function dO(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 RU(t){return t.secure=pS(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function xU(t){if((t.port===(pS(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 CU(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(SU);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=hS(i);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function EU(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=hS(i);s&&(t=s.serialize(t,e));let a=t,l=t.nss;return a.path=`${n||e.nid}:${l}`,e.skipEscape=!0,a}function OU(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!bU(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function IU(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var pO={scheme:"http",domainHost:!0,parse:fO,serialize:dO},PU={scheme:"https",domainHost:pO.domainHost,parse:fO,serialize:dO},vh={scheme:"ws",domainHost:!0,parse:RU,serialize:xU},kU={scheme:"wss",domainHost:vh.domainHost,parse:vh.parse,serialize:vh.serialize},TU={scheme:"urn",parse:CU,serialize:EU,skipNormalize:!0},AU={scheme:"urn:uuid",parse:OU,serialize:IU,skipNormalize:!0},bh={http:pO,https:PU,ws:vh,wss:kU,urn:TU,"urn:uuid":AU};Object.setPrototypeOf(bh,null);function hS(t){return t&&(bh[t]||bh[t.toLowerCase()])||void 0}hO.exports={wsIsSecure:pS,SCHEMES:bh,isValidSchemeName:_U,getSchemeHandler:hS}});var wO=F((B5,Sh)=>{"use strict";var{normalizeIPv6:qU,removeDotSegments:Ju,recomposeAuthority:$U,normalizePercentEncoding:MU,normalizePathEncoding:NU,escapePreservingEscapes:DU,reescapeHostDelimiters:FU,isIPv4:LU,nonSimpleDomain:jU}=dS(),{SCHEMES:UU,getSchemeHandler:yO}=mO();function HU(t,e){return typeof t=="string"?t=JU(t,e):typeof t=="object"&&(t=ql(Xo(t,e),e)),t}function BU(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=vO(ql(t,n),ql(e,n),n,!0);return n.skipEscape=!0,Xo(i,n)}function vO(t,e,r,n){let i={};return n||(t=ql(Xo(t,r),r),e=ql(Xo(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=Ju(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=Ju(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=Ju(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=Ju(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 VU(t,e,r){let n=gO(t,r),i=gO(e,r);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()}function Xo(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=yO(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=MU(r.path):(r.path=DU(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let a=$U(r);if(a!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(a),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let l=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(l=Ju(l)),a===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 WU=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function zU(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 bO(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 a=t.match(WU);if(a){n.scheme=a[1],n.userinfo=a[3],n.host=a[4],n.port=parseInt(a[5],10),n.path=a[6]||"",n.query=a[7],n.fragment=a[8],isNaN(n.port)&&(n.port=a[5]);let l=zU(n,a);if(l!==void 0&&(n.error=n.error||l,i=!0),n.host)if(LU(n.host)===!1){let m=qU(n.host);n.host=m.host.toLowerCase(),s=m.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=yO(r.scheme||n.scheme);if(!r.unicodeSupport&&(!f||!f.unicodeSupport)&&n.host&&(r.domainHost||f&&f.domainHost)&&s===!1&&jU(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(d){n.error=n.error||"Host's domain name can not be converted to ASCII: "+d}if((!f||f&&!f.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=FU(unescape(n.host),s))),n.path&&(n.path=NU(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 ql(t,e){return bO(t,e).parsed}function JU(t,e){return SO(t,e).normalized}function SO(t,e){let{parsed:r,malformedAuthorityOrPort:n}=bO(t,e);return{normalized:n?t:Xo(r,e),malformedAuthorityOrPort:n}}function gO(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=SO(t,e);return n?void 0:r}if(typeof t=="object")return Xo(t,e)}var mS={SCHEMES:UU,normalize:HU,resolve:BU,resolveComponent:vO,equal:VU,serialize:Xo,parse:ql};Sh.exports=mS;Sh.exports.default=mS;Sh.exports.fastUri=mS});var RO=F(gS=>{"use strict";Object.defineProperty(gS,"__esModule",{value:!0});var _O=wO();_O.code='require("ajv/dist/runtime/uri").default';gS.default=_O});var TO=F(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.CodeGen=Xt.Name=Xt.nil=Xt.stringify=Xt.str=Xt._=Xt.KeywordCxt=void 0;var YU=Wu();Object.defineProperty(Xt,"KeywordCxt",{enumerable:!0,get:function(){return YU.KeywordCxt}});var $l=Ne();Object.defineProperty(Xt,"_",{enumerable:!0,get:function(){return $l._}});Object.defineProperty(Xt,"str",{enumerable:!0,get:function(){return $l.str}});Object.defineProperty(Xt,"stringify",{enumerable:!0,get:function(){return $l.stringify}});Object.defineProperty(Xt,"nil",{enumerable:!0,get:function(){return $l.nil}});Object.defineProperty(Xt,"Name",{enumerable:!0,get:function(){return $l.Name}});Object.defineProperty(Xt,"CodeGen",{enumerable:!0,get:function(){return $l.CodeGen}});var GU=mh(),IO=zu(),KU=Vb(),Yu=yh(),QU=Ne(),Gu=Hu(),wh=Uu(),vS=We(),xO=iO(),ZU=RO(),PO=(t,e)=>new RegExp(t,e);PO.code="new RegExp";var XU=["removeAdditional","useDefaults","coerceTypes"],eH=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),tH={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."},rH={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},CO=200;function nH(t){var e,r,n,i,s,a,l,f,d,m,g,y,w,C,R,T,A,U,B,V,W,X,P,_,k;let M=t.strict,j=(e=t.code)===null||e===void 0?void 0:e.optimize,$=j===!0||j===void 0?1:j||0,Y=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:PO,K=(i=t.uriResolver)!==null&&i!==void 0?i:ZU.default;return{strictSchema:(a=(s=t.strictSchema)!==null&&s!==void 0?s:M)!==null&&a!==void 0?a:!0,strictNumbers:(f=(l=t.strictNumbers)!==null&&l!==void 0?l:M)!==null&&f!==void 0?f:!0,strictTypes:(m=(d=t.strictTypes)!==null&&d!==void 0?d:M)!==null&&m!==void 0?m:"log",strictTuples:(y=(g=t.strictTuples)!==null&&g!==void 0?g:M)!==null&&y!==void 0?y:"log",strictRequired:(C=(w=t.strictRequired)!==null&&w!==void 0?w:M)!==null&&C!==void 0?C:!1,code:t.code?{...t.code,optimize:$,regExp:Y}:{optimize:$,regExp:Y},loopRequired:(R=t.loopRequired)!==null&&R!==void 0?R:CO,loopEnum:(T=t.loopEnum)!==null&&T!==void 0?T:CO,meta:(A=t.meta)!==null&&A!==void 0?A:!0,messages:(U=t.messages)!==null&&U!==void 0?U:!0,inlineRefs:(B=t.inlineRefs)!==null&&B!==void 0?B:!0,schemaId:(V=t.schemaId)!==null&&V!==void 0?V:"$id",addUsedSchema:(W=t.addUsedSchema)!==null&&W!==void 0?W:!0,validateSchema:(X=t.validateSchema)!==null&&X!==void 0?X:!0,validateFormats:(P=t.validateFormats)!==null&&P!==void 0?P:!0,unicodeRegExp:(_=t.unicodeRegExp)!==null&&_!==void 0?_:!0,int32range:(k=t.int32range)!==null&&k!==void 0?k:!0,uriResolver:K}}var Ku=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,...nH(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new QU.ValueScope({scope:{},prefixes:eH,es5:r,lines:n}),this.logger=cH(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,KU.getRules)(),EO.call(this,tH,e,"NOT SUPPORTED"),EO.call(this,rH,e,"DEPRECATED","warn"),this._metaOpts=aH.call(this),e.formats&&sH.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&oH.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),iH.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=xO;n==="id"&&(i={...xO},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(m,g){await s.call(this,m.$schema);let y=this._addSchema(m,g);return y.validate||a.call(this,y)}async function s(m){m&&!this.getSchema(m)&&await i.call(this,{$ref:m},!0)}async function a(m){try{return this._compileSchemaEnv(m)}catch(g){if(!(g instanceof IO.default))throw g;return l.call(this,g),await f.call(this,g.missingSchema),a.call(this,m)}}function l({missingSchema:m,missingRef:g}){if(this.refs[m])throw new Error(`AnySchema ${m} is loaded but ${g} cannot be resolved`)}async function f(m){let g=await d.call(this,m);this.refs[m]||await s.call(this,g.$schema),this.refs[m]||this.addSchema(g,m,r)}async function d(m){let g=this._loading[m];if(g)return g;try{return await(this._loading[m]=n(m))}finally{delete this._loading[m]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let a of e)this.addSchema(a,void 0,n,i);return this}let s;if(typeof e=="object"){let{schemaId:a}=this.opts;if(s=e[a],s!==void 0&&typeof s!="string")throw new Error(`schema ${a} must be string`)}return r=(0,Gu.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=OO.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Yu.SchemaEnv({schema:{},schemaId:n});if(r=Yu.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=OO.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,Gu.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(fH.call(this,n,r),!r)return(0,vS.eachItem)(n,s=>yS.call(this,s)),this;pH.call(this,r);let i={...r,type:(0,wh.getJSONTypes)(r.type),schemaType:(0,wh.getJSONTypes)(r.schemaType)};return(0,vS.eachItem)(n,i.type.length===0?s=>yS.call(this,s,i):s=>i.type.forEach(a=>yS.call(this,s,i,a))),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),a=e;for(let l of s)a=a[l];for(let l in n){let f=n[l];if(typeof f!="object")continue;let{$data:d}=f.definition,m=a[l];d&&m&&(a[l]=kO(m))}}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 a,{schemaId:l}=this.opts;if(typeof e=="object")a=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,Gu.normalizeId)(a||n);let d=Gu.getSchemaRefs.call(this,e,n);return f=new Yu.SchemaEnv({schema:e,schemaId:l,meta:r,baseId:n,localRefs:d}),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):Yu.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{Yu.compileSchema.call(this,e)}finally{this.opts=r}}};Ku.ValidationError=GU.default;Ku.MissingRefError=IO.default;Xt.default=Ku;function EO(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 OO(t){return t=(0,Gu.normalizeId)(t),this.schemas[t]||this.refs[t]}function iH(){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 sH(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function oH(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 aH(){let t={...this.opts};for(let e of XU)delete t[e];return t}var lH={log(){},warn(){},error(){}};function cH(t){if(t===!1)return lH;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 uH=/^[a-z_$][a-z0-9_$:-]*$/i;function fH(t,e){let{RULES:r}=this;if((0,vS.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!uH.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 yS(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,a=i?s.post:s.rules.find(({type:f})=>f===r);if(a||(a={type:r,rules:[]},s.rules.push(a)),s.keywords[t]=!0,!e)return;let l={keyword:t,definition:{...e,type:(0,wh.getJSONTypes)(e.type),schemaType:(0,wh.getJSONTypes)(e.schemaType)}};e.before?dH.call(this,a,l,e.before):a.rules.push(l),s.all[t]=l,(n=e.implements)===null||n===void 0||n.forEach(f=>this.addKeyword(f))}function dH(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 pH(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=kO(e)),t.validateSchema=this.compile(e,!0))}var hH={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function kO(t){return{anyOf:[t,hH]}}});var AO=F(bS=>{"use strict";Object.defineProperty(bS,"__esModule",{value:!0});var mH={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};bS.default=mH});var NO=F(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});ea.callRef=ea.getValidate=void 0;var gH=zu(),qO=Sn(),Fr=Ne(),Ml=Gi(),$O=yh(),_h=We(),yH={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:s,validateName:a,opts:l,self:f}=n,{root:d}=s;if((r==="#"||r==="#/")&&i===d.baseId)return g();let m=$O.resolveRef.call(f,d,i,r);if(m===void 0)throw new gH.default(n.opts.uriResolver,i,r);if(m instanceof $O.SchemaEnv)return y(m);return w(m);function g(){if(s===d)return Rh(t,a,s,s.$async);let C=e.scopeValue("root",{ref:d});return Rh(t,(0,Fr._)`${C}.validate`,d,d.$async)}function y(C){let R=MO(t,C);Rh(t,R,C,C.$async)}function w(C){let R=e.scopeValue("schema",l.code.source===!0?{ref:C,code:(0,Fr.stringify)(C)}:{ref:C}),T=e.name("valid"),A=t.subschema({schema:C,dataTypes:[],schemaPath:Fr.nil,topSchemaRef:R,errSchemaPath:r},T);t.mergeEvaluated(A),t.ok(T)}}};function MO(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Fr._)`${r.scopeValue("wrapper",{ref:e})}.validate`}ea.getValidate=MO;function Rh(t,e,r,n){let{gen:i,it:s}=t,{allErrors:a,schemaEnv:l,opts:f}=s,d=f.passContext?Ml.default.this:Fr.nil;n?m():g();function m(){if(!l.$async)throw new Error("async schema referenced by sync schema");let C=i.let("valid");i.try(()=>{i.code((0,Fr._)`await ${(0,qO.callValidateCode)(t,e,d)}`),w(e),a||i.assign(C,!0)},R=>{i.if((0,Fr._)`!(${R} instanceof ${s.ValidationError})`,()=>i.throw(R)),y(R),a||i.assign(C,!1)}),t.ok(C)}function g(){t.result((0,qO.callValidateCode)(t,e,d),()=>w(e),()=>y(e))}function y(C){let R=(0,Fr._)`${C}.errors`;i.assign(Ml.default.vErrors,(0,Fr._)`${Ml.default.vErrors} === null ? ${R} : ${Ml.default.vErrors}.concat(${R})`),i.assign(Ml.default.errors,(0,Fr._)`${Ml.default.vErrors}.length`)}function w(C){var R;if(!s.opts.unevaluated)return;let T=(R=r?.validate)===null||R===void 0?void 0:R.evaluated;if(s.props!==!0)if(T&&!T.dynamicProps)T.props!==void 0&&(s.props=_h.mergeEvaluated.props(i,T.props,s.props));else{let A=i.var("props",(0,Fr._)`${C}.evaluated.props`);s.props=_h.mergeEvaluated.props(i,A,s.props,Fr.Name)}if(s.items!==!0)if(T&&!T.dynamicItems)T.items!==void 0&&(s.items=_h.mergeEvaluated.items(i,T.items,s.items));else{let A=i.var("items",(0,Fr._)`${C}.evaluated.items`);s.items=_h.mergeEvaluated.items(i,A,s.items,Fr.Name)}}}ea.callRef=Rh;ea.default=yH});var DO=F(SS=>{"use strict";Object.defineProperty(SS,"__esModule",{value:!0});var vH=AO(),bH=NO(),SH=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",vH.default,bH.default];SS.default=SH});var FO=F(wS=>{"use strict";Object.defineProperty(wS,"__esModule",{value:!0});var xh=Ne(),js=xh.operators,Ch={maximum:{okStr:"<=",ok:js.LTE,fail:js.GT},minimum:{okStr:">=",ok:js.GTE,fail:js.LT},exclusiveMaximum:{okStr:"<",ok:js.LT,fail:js.GTE},exclusiveMinimum:{okStr:">",ok:js.GT,fail:js.LTE}},wH={message:({keyword:t,schemaCode:e})=>(0,xh.str)`must be ${Ch[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,xh._)`{comparison: ${Ch[t].okStr}, limit: ${e}}`},_H={keyword:Object.keys(Ch),type:"number",schemaType:"number",$data:!0,error:wH,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,xh._)`${r} ${Ch[e].fail} ${n} || isNaN(${r})`)}};wS.default=_H});var LO=F(_S=>{"use strict";Object.defineProperty(_S,"__esModule",{value:!0});var Qu=Ne(),RH={message:({schemaCode:t})=>(0,Qu.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Qu._)`{multipleOf: ${t}}`},xH={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:RH,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,a=e.let("res"),l=s?(0,Qu._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:(0,Qu._)`${a} !== parseInt(${a})`;t.fail$data((0,Qu._)`(${n} === 0 || (${a} = ${r}/${n}, ${l}))`)}};_S.default=xH});var UO=F(RS=>{"use strict";Object.defineProperty(RS,"__esModule",{value:!0});function jO(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}RS.default=jO;jO.code='require("ajv/dist/runtime/ucs2length").default'});var HO=F(xS=>{"use strict";Object.defineProperty(xS,"__esModule",{value:!0});var ta=Ne(),CH=We(),EH=UO(),OH={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,ta.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,ta._)`{limit: ${t}}`},IH={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:OH,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?ta.operators.GT:ta.operators.LT,a=i.opts.unicode===!1?(0,ta._)`${r}.length`:(0,ta._)`${(0,CH.useFunc)(t.gen,EH.default)}(${r})`;t.fail$data((0,ta._)`${a} ${s} ${n}`)}};xS.default=IH});var BO=F(CS=>{"use strict";Object.defineProperty(CS,"__esModule",{value:!0});var PH=Sn(),kH=We(),Nl=Ne(),TH={message:({schemaCode:t})=>(0,Nl.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Nl._)`{pattern: ${t}}`},AH={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:TH,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:a}=t,l=a.opts.unicodeRegExp?"u":"";if(n){let{regExp:f}=a.opts.code,d=f.code==="new RegExp"?(0,Nl._)`new RegExp`:(0,kH.useFunc)(e,f),m=e.let("valid");e.try(()=>e.assign(m,(0,Nl._)`${d}(${s}, ${l}).test(${r})`),()=>e.assign(m,!1)),t.fail$data((0,Nl._)`!${m}`)}else{let f=(0,PH.usePattern)(t,i);t.fail$data((0,Nl._)`!${f}.test(${r})`)}}};CS.default=AH});var VO=F(ES=>{"use strict";Object.defineProperty(ES,"__esModule",{value:!0});var Zu=Ne(),qH={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Zu.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Zu._)`{limit: ${t}}`},$H={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:qH,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?Zu.operators.GT:Zu.operators.LT;t.fail$data((0,Zu._)`Object.keys(${r}).length ${i} ${n}`)}};ES.default=$H});var WO=F(OS=>{"use strict";Object.defineProperty(OS,"__esModule",{value:!0});var Xu=Sn(),ef=Ne(),MH=We(),NH={message:({params:{missingProperty:t}})=>(0,ef.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,ef._)`{missingProperty: ${t}}`},DH={keyword:"required",type:"object",schemaType:"array",$data:!0,error:NH,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:s,it:a}=t,{opts:l}=a;if(!s&&r.length===0)return;let f=r.length>=l.loopRequired;if(a.allErrors?d():m(),l.strictRequired){let w=t.parentSchema.properties,{definedProperties:C}=t.it;for(let R of r)if(w?.[R]===void 0&&!C.has(R)){let T=a.schemaEnv.baseId+a.errSchemaPath,A=`required property "${R}" is not defined at "${T}" (strictRequired)`;(0,MH.checkStrictMode)(a,A,a.opts.strictRequired)}}function d(){if(f||s)t.block$data(ef.nil,g);else for(let w of r)(0,Xu.checkReportMissingProp)(t,w)}function m(){let w=e.let("missing");if(f||s){let C=e.let("valid",!0);t.block$data(C,()=>y(w,C)),t.ok(C)}else e.if((0,Xu.checkMissingProp)(t,r,w)),(0,Xu.reportMissingProp)(t,w),e.else()}function g(){e.forOf("prop",n,w=>{t.setParams({missingProperty:w}),e.if((0,Xu.noPropertyInData)(e,i,w,l.ownProperties),()=>t.error())})}function y(w,C){t.setParams({missingProperty:w}),e.forOf(w,n,()=>{e.assign(C,(0,Xu.propertyInData)(e,i,w,l.ownProperties)),e.if((0,ef.not)(C),()=>{t.error(),e.break()})},ef.nil)}}};OS.default=DH});var zO=F(IS=>{"use strict";Object.defineProperty(IS,"__esModule",{value:!0});var tf=Ne(),FH={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,tf.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,tf._)`{limit: ${t}}`},LH={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:FH,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?tf.operators.GT:tf.operators.LT;t.fail$data((0,tf._)`${r}.length ${i} ${n}`)}};IS.default=LH});var Eh=F(PS=>{"use strict";Object.defineProperty(PS,"__esModule",{value:!0});var JO=Zb();JO.code='require("ajv/dist/runtime/equal").default';PS.default=JO});var YO=F(TS=>{"use strict";Object.defineProperty(TS,"__esModule",{value:!0});var kS=Uu(),er=Ne(),jH=We(),UH=Eh(),HH={message:({params:{i:t,j:e}})=>(0,er.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,er._)`{i: ${t}, j: ${e}}`},BH={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:HH,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:s,schemaCode:a,it:l}=t;if(!n&&!i)return;let f=e.let("valid"),d=s.items?(0,kS.getSchemaTypes)(s.items):[];t.block$data(f,m,(0,er._)`${a} === false`),t.ok(f);function m(){let C=e.let("i",(0,er._)`${r}.length`),R=e.let("j");t.setParams({i:C,j:R}),e.assign(f,!0),e.if((0,er._)`${C} > 1`,()=>(g()?y:w)(C,R))}function g(){return d.length>0&&!d.some(C=>C==="object"||C==="array")}function y(C,R){let T=e.name("item"),A=(0,kS.checkDataTypes)(d,T,l.opts.strictNumbers,kS.DataType.Wrong),U=e.const("indices",(0,er._)`{}`);e.for((0,er._)`;${C}--;`,()=>{e.let(T,(0,er._)`${r}[${C}]`),e.if(A,(0,er._)`continue`),d.length>1&&e.if((0,er._)`typeof ${T} == "string"`,(0,er._)`${T} += "_"`),e.if((0,er._)`typeof ${U}[${T}] == "number"`,()=>{e.assign(R,(0,er._)`${U}[${T}]`),t.error(),e.assign(f,!1).break()}).code((0,er._)`${U}[${T}] = ${C}`)})}function w(C,R){let T=(0,jH.useFunc)(e,UH.default),A=e.name("outer");e.label(A).for((0,er._)`;${C}--;`,()=>e.for((0,er._)`${R} = ${C}; ${R}--;`,()=>e.if((0,er._)`${T}(${r}[${C}], ${r}[${R}])`,()=>{t.error(),e.assign(f,!1).break(A)})))}}};TS.default=BH});var GO=F(qS=>{"use strict";Object.defineProperty(qS,"__esModule",{value:!0});var AS=Ne(),VH=We(),WH=Eh(),zH={message:"must be equal to constant",params:({schemaCode:t})=>(0,AS._)`{allowedValue: ${t}}`},JH={keyword:"const",$data:!0,error:zH,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,AS._)`!${(0,VH.useFunc)(e,WH.default)}(${r}, ${i})`):t.fail((0,AS._)`${s} !== ${r}`)}};qS.default=JH});var KO=F($S=>{"use strict";Object.defineProperty($S,"__esModule",{value:!0});var rf=Ne(),YH=We(),GH=Eh(),KH={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,rf._)`{allowedValues: ${t}}`},QH={keyword:"enum",schemaType:"array",$data:!0,error:KH,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:a}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let l=i.length>=a.opts.loopEnum,f,d=()=>f??(f=(0,YH.useFunc)(e,GH.default)),m;if(l||n)m=e.let("valid"),t.block$data(m,g);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let w=e.const("vSchema",s);m=(0,rf.or)(...i.map((C,R)=>y(w,R)))}t.pass(m);function g(){e.assign(m,!1),e.forOf("v",s,w=>e.if((0,rf._)`${d()}(${r}, ${w})`,()=>e.assign(m,!0).break()))}function y(w,C){let R=i[C];return typeof R=="object"&&R!==null?(0,rf._)`${d()}(${r}, ${w}[${C}])`:(0,rf._)`${r} === ${R}`}}};$S.default=QH});var QO=F(MS=>{"use strict";Object.defineProperty(MS,"__esModule",{value:!0});var ZH=FO(),XH=LO(),eB=HO(),tB=BO(),rB=VO(),nB=WO(),iB=zO(),sB=YO(),oB=GO(),aB=KO(),lB=[ZH.default,XH.default,eB.default,tB.default,rB.default,nB.default,iB.default,sB.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},oB.default,aB.default];MS.default=lB});var DS=F(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});nf.validateAdditionalItems=void 0;var ra=Ne(),NS=We(),cB={message:({params:{len:t}})=>(0,ra.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,ra._)`{limit: ${t}}`},uB={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:cB,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,NS.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}ZO(t,n)}};function ZO(t,e){let{gen:r,schema:n,data:i,keyword:s,it:a}=t;a.items=!0;let l=r.const("len",(0,ra._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,ra._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,NS.alwaysValidSchema)(a,n)){let d=r.var("valid",(0,ra._)`${l} <= ${e.length}`);r.if((0,ra.not)(d),()=>f(d)),t.ok(d)}function f(d){r.forRange("i",e.length,l,m=>{t.subschema({keyword:s,dataProp:m,dataPropType:NS.Type.Num},d),a.allErrors||r.if((0,ra.not)(d),()=>r.break())})}}nf.validateAdditionalItems=ZO;nf.default=uB});var FS=F(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});sf.validateTuple=void 0;var XO=Ne(),Oh=We(),fB=Sn(),dB={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return eI(t,"additionalItems",e);r.items=!0,!(0,Oh.alwaysValidSchema)(r,e)&&t.ok((0,fB.validateArray)(t))}};function eI(t,e,r=t.schema){let{gen:n,parentSchema:i,data:s,keyword:a,it:l}=t;m(i),l.opts.unevaluated&&r.length&&l.items!==!0&&(l.items=Oh.mergeEvaluated.items(n,r.length,l.items));let f=n.name("valid"),d=n.const("len",(0,XO._)`${s}.length`);r.forEach((g,y)=>{(0,Oh.alwaysValidSchema)(l,g)||(n.if((0,XO._)`${d} > ${y}`,()=>t.subschema({keyword:a,schemaProp:y,dataProp:y},f)),t.ok(f))});function m(g){let{opts:y,errSchemaPath:w}=l,C=r.length,R=C===g.minItems&&(C===g.maxItems||g[e]===!1);if(y.strictTuples&&!R){let T=`"${a}" is ${C}-tuple, but minItems or maxItems/${e} are not specified or different at path "${w}"`;(0,Oh.checkStrictMode)(l,T,y.strictTuples)}}}sf.validateTuple=eI;sf.default=dB});var tI=F(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0});var pB=FS(),hB={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,pB.validateTuple)(t,"items")};LS.default=hB});var nI=F(jS=>{"use strict";Object.defineProperty(jS,"__esModule",{value:!0});var rI=Ne(),mB=We(),gB=Sn(),yB=DS(),vB={message:({params:{len:t}})=>(0,rI.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,rI._)`{limit: ${t}}`},bB={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:vB,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,mB.alwaysValidSchema)(n,e)&&(i?(0,yB.validateAdditionalItems)(t,i):t.ok((0,gB.validateArray)(t)))}};jS.default=bB});var iI=F(US=>{"use strict";Object.defineProperty(US,"__esModule",{value:!0});var _n=Ne(),Ih=We(),SB={message:({params:{min:t,max:e}})=>e===void 0?(0,_n.str)`must contain at least ${t} valid item(s)`:(0,_n.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,_n._)`{minContains: ${t}}`:(0,_n._)`{minContains: ${t}, maxContains: ${e}}`},wB={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:SB,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t,a,l,{minContains:f,maxContains:d}=n;s.opts.next?(a=f===void 0?1:f,l=d):a=1;let m=e.const("len",(0,_n._)`${i}.length`);if(t.setParams({min:a,max:l}),l===void 0&&a===0){(0,Ih.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&a>l){(0,Ih.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Ih.alwaysValidSchema)(s,r)){let R=(0,_n._)`${m} >= ${a}`;l!==void 0&&(R=(0,_n._)`${R} && ${m} <= ${l}`),t.pass(R);return}s.items=!0;let g=e.name("valid");l===void 0&&a===1?w(g,()=>e.if(g,()=>e.break())):a===0?(e.let(g,!0),l!==void 0&&e.if((0,_n._)`${i}.length > 0`,y)):(e.let(g,!1),y()),t.result(g,()=>t.reset());function y(){let R=e.name("_valid"),T=e.let("count",0);w(R,()=>e.if(R,()=>C(T)))}function w(R,T){e.forRange("i",0,m,A=>{t.subschema({keyword:"contains",dataProp:A,dataPropType:Ih.Type.Num,compositeRule:!0},R),T()})}function C(R){e.code((0,_n._)`${R}++`),l===void 0?e.if((0,_n._)`${R} >= ${a}`,()=>e.assign(g,!0).break()):(e.if((0,_n._)`${R} > ${l}`,()=>e.assign(g,!1).break()),a===1?e.assign(g,!0):e.if((0,_n._)`${R} >= ${a}`,()=>e.assign(g,!0)))}}};US.default=wB});var aI=F(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.validateSchemaDeps=Si.validatePropertyDeps=Si.error=void 0;var HS=Ne(),_B=We(),of=Sn();Si.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,HS.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,HS._)`{property: ${t},
|
|
28
28
|
missingProperty: ${n},
|
|
29
29
|
depsCount: ${e},
|
|
30
|
-
deps: ${r}}`};var wB={keyword:"dependencies",type:"object",schemaType:"object",error:Si.error,code(t){let[e,r]=_B(t);sI(t,e),oI(t,r)}};function _B({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 sI(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,of.propertyInData)(r,n,o,i.opts.ownProperties);t.setParams({property:o,depsCount:l.length,deps:l.join(", ")}),i.allErrors?r.if(f,()=>{for(let d of l)(0,of.checkReportMissingProp)(t,d)}):(r.if((0,HS._)`${f} && (${(0,of.checkMissingProp)(t,l,s)})`),(0,of.reportMissingProp)(t,s),r.else())}}Si.validatePropertyDeps=sI;function oI(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,o=r.name("valid");for(let l in e)(0,SB.alwaysValidSchema)(s,e[l])||(r.if((0,of.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))}Si.validateSchemaDeps=oI;Si.default=wB});var cI=F(BS=>{"use strict";Object.defineProperty(BS,"__esModule",{value:!0});var lI=Ne(),RB=We(),xB={message:"property name must be valid",params:({params:t})=>(0,lI._)`{propertyName: ${t.propertyName}}`},CB={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:xB,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,RB.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,lI.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};BS.default=CB});var WS=F(VS=>{"use strict";Object.defineProperty(VS,"__esModule",{value:!0});var Ph=Sn(),Jn=Ne(),EB=Gi(),kh=We(),OB={message:"must NOT have additional properties",params:({params:t})=>(0,Jn._)`{additionalProperty: ${t.additionalProperty}}`},IB={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:OB,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,kh.alwaysValidSchema)(o,r))return;let d=(0,Ph.allSchemaProperties)(n.properties),m=(0,Ph.allSchemaProperties)(n.patternProperties);g(),t.ok((0,Jn._)`${s} === ${EB.default.errors}`);function g(){e.forIn("key",i,P=>{!d.length&&!m.length?C(P):e.if(y(P),()=>C(P))})}function y(P){let A;if(d.length>8){let U=(0,kh.schemaRefOrVal)(o,n.properties,"properties");A=(0,Ph.isOwnProperty)(e,U,P)}else d.length?A=(0,Jn.or)(...d.map(U=>(0,Jn._)`${P} === ${U}`)):A=Jn.nil;return m.length&&(A=(0,Jn.or)(A,...m.map(U=>(0,Jn._)`${(0,Ph.usePattern)(t,U)}.test(${P})`))),(0,Jn.not)(A)}function w(P){e.code((0,Jn._)`delete ${i}[${P}]`)}function C(P){if(f.removeAdditional==="all"||f.removeAdditional&&r===!1){w(P);return}if(r===!1){t.setParams({additionalProperty:P}),t.error(),l||e.break();return}if(typeof r=="object"&&!(0,kh.alwaysValidSchema)(o,r)){let A=e.name("valid");f.removeAdditional==="failing"?(R(P,A,!1),e.if((0,Jn.not)(A),()=>{t.reset(),w(P)})):(R(P,A),l||e.if((0,Jn.not)(A),()=>e.break()))}}function R(P,A,U){let B={keyword:"additionalProperties",dataProp:P,dataPropType:kh.Type.Str};U===!1&&Object.assign(B,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(B,A)}}};VS.default=IB});var dI=F(JS=>{"use strict";Object.defineProperty(JS,"__esModule",{value:!0});var PB=Wu(),uI=Sn(),zS=We(),fI=WS(),kB={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&&fI.default.code(new PB.KeywordCxt(s,fI.default,"additionalProperties"));let o=(0,uI.allSchemaProperties)(r);for(let g of o)s.definedProperties.add(g);s.opts.unevaluated&&o.length&&s.props!==!0&&(s.props=zS.mergeEvaluated.props(e,(0,zS.toHash)(o),s.props));let l=o.filter(g=>!(0,zS.alwaysValidSchema)(s,r[g]));if(l.length===0)return;let f=e.name("valid");for(let g of l)d(g)?m(g):(e.if((0,uI.propertyInData)(e,i,g,s.opts.ownProperties)),m(g),s.allErrors||e.else().var(f,!0),e.endIf()),t.it.definedProperties.add(g),t.ok(f);function d(g){return s.opts.useDefaults&&!s.compositeRule&&r[g].default!==void 0}function m(g){t.subschema({keyword:"properties",schemaProp:g,dataProp:g},f)}}};JS.default=kB});var gI=F(YS=>{"use strict";Object.defineProperty(YS,"__esModule",{value:!0});var pI=Sn(),Th=Ne(),hI=We(),mI=We(),TB={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,pI.allSchemaProperties)(r),f=l.filter(R=>(0,hI.alwaysValidSchema)(s,r[R]));if(l.length===0||f.length===l.length&&(!s.opts.unevaluated||s.props===!0))return;let d=o.strictSchema&&!o.allowMatchingProperties&&i.properties,m=e.name("valid");s.props!==!0&&!(s.props instanceof Th.Name)&&(s.props=(0,mI.evaluatedPropsToName)(e,s.props));let{props:g}=s;y();function y(){for(let R of l)d&&w(R),s.allErrors?C(R):(e.var(m,!0),C(R),e.if(m))}function w(R){for(let P in d)new RegExp(R).test(P)&&(0,hI.checkStrictMode)(s,`property ${P} matches pattern ${R} (use allowMatchingProperties)`)}function C(R){e.forIn("key",n,P=>{e.if((0,Th._)`${(0,pI.usePattern)(t,R)}.test(${P})`,()=>{let A=f.includes(R);A||t.subschema({keyword:"patternProperties",schemaProp:R,dataProp:P,dataPropType:mI.Type.Str},m),s.opts.unevaluated&&g!==!0?e.assign((0,Th._)`${g}[${P}]`,!0):!A&&!s.allErrors&&e.if((0,Th.not)(m),()=>e.break())})})}}};YS.default=TB});var yI=F(GS=>{"use strict";Object.defineProperty(GS,"__esModule",{value:!0});var AB=We(),qB={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,AB.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"}};GS.default=qB});var vI=F(KS=>{"use strict";Object.defineProperty(KS,"__esModule",{value:!0});var $B=Sn(),MB={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:$B.validateUnion,error:{message:"must match a schema in anyOf"}};KS.default=MB});var bI=F(QS=>{"use strict";Object.defineProperty(QS,"__esModule",{value:!0});var Ah=Ne(),NB=We(),DB={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Ah._)`{passingSchemas: ${t.passing}}`},FB={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:DB,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(d),t.result(o,()=>t.reset(),()=>t.error(!0));function d(){s.forEach((m,g)=>{let y;(0,NB.alwaysValidSchema)(i,m)?e.var(f,!0):y=t.subschema({keyword:"oneOf",schemaProp:g,compositeRule:!0},f),g>0&&e.if((0,Ah._)`${f} && ${o}`).assign(o,!1).assign(l,(0,Ah._)`[${l}, ${g}]`).else(),e.if(f,()=>{e.assign(o,!0),e.assign(l,g),y&&t.mergeEvaluated(y,Ah.Name)})})}}};QS.default=FB});var SI=F(ZS=>{"use strict";Object.defineProperty(ZS,"__esModule",{value:!0});var LB=We(),jB={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,LB.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:o},i);t.ok(i),t.mergeEvaluated(l)})}};ZS.default=jB});var RI=F(XS=>{"use strict";Object.defineProperty(XS,"__esModule",{value:!0});var qh=Ne(),_I=We(),UB={message:({params:t})=>(0,qh.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,qh._)`{failingKeyword: ${t.ifClause}}`},HB={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:UB,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,_I.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=wI(n,"then"),s=wI(n,"else");if(!i&&!s)return;let o=e.let("valid",!0),l=e.name("_valid");if(f(),t.reset(),i&&s){let m=e.let("ifClause");t.setParams({ifClause:m}),e.if(l,d("then",m),d("else",m))}else i?e.if(l,d("then")):e.if((0,qh.not)(l),d("else"));t.pass(o,()=>t.error(!0));function f(){let m=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);t.mergeEvaluated(m)}function d(m,g){return()=>{let y=t.subschema({keyword:m},l);e.assign(o,l),t.mergeValidEvaluated(y,o),g?e.assign(g,(0,qh._)`${m}`):t.setParams({ifClause:m})}}}};function wI(t,e){let r=t.schema[e];return r!==void 0&&!(0,_I.alwaysValidSchema)(t,r)}XS.default=HB});var xI=F(e0=>{"use strict";Object.defineProperty(e0,"__esModule",{value:!0});var BB=We(),VB={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,BB.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};e0.default=VB});var CI=F(t0=>{"use strict";Object.defineProperty(t0,"__esModule",{value:!0});var WB=DS(),zB=tI(),JB=FS(),YB=nI(),GB=iI(),KB=aI(),QB=cI(),ZB=WS(),XB=dI(),eV=gI(),tV=yI(),rV=vI(),nV=bI(),iV=SI(),sV=RI(),oV=xI();function aV(t=!1){let e=[tV.default,rV.default,nV.default,iV.default,sV.default,oV.default,QB.default,ZB.default,KB.default,XB.default,eV.default];return t?e.push(zB.default,YB.default):e.push(WB.default,JB.default),e.push(GB.default),e}t0.default=aV});var EI=F(r0=>{"use strict";Object.defineProperty(r0,"__esModule",{value:!0});var Mt=Ne(),lV={message:({schemaCode:t})=>(0,Mt.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Mt._)`{format: ${t}}`},cV={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:lV,code(t,e){let{gen:r,data:n,$data:i,schema:s,schemaCode:o,it:l}=t,{opts:f,errSchemaPath:d,schemaEnv:m,self:g}=l;if(!f.validateFormats)return;i?y():w();function y(){let C=r.scopeValue("formats",{ref:g.formats,code:f.code.formats}),R=r.const("fDef",(0,Mt._)`${C}[${o}]`),P=r.let("fType"),A=r.let("format");r.if((0,Mt._)`typeof ${R} == "object" && !(${R} instanceof RegExp)`,()=>r.assign(P,(0,Mt._)`${R}.type || "string"`).assign(A,(0,Mt._)`${R}.validate`),()=>r.assign(P,(0,Mt._)`"string"`).assign(A,R)),t.fail$data((0,Mt.or)(U(),B()));function U(){return f.strictSchema===!1?Mt.nil:(0,Mt._)`${o} && !${A}`}function B(){let z=m.$async?(0,Mt._)`(${R}.async ? await ${A}(${n}) : ${A}(${n}))`:(0,Mt._)`${A}(${n})`,V=(0,Mt._)`(typeof ${A} == "function" ? ${z} : ${A}.test(${n}))`;return(0,Mt._)`${A} && ${A} !== true && ${P} === ${e} && !${V}`}}function w(){let C=g.formats[s];if(!C){U();return}if(C===!0)return;let[R,P,A]=B(C);R===e&&t.pass(z());function U(){if(f.strictSchema===!1){g.logger.warn(V());return}throw new Error(V());function V(){return`unknown format "${s}" ignored in schema at path "${d}"`}}function B(V){let X=V instanceof RegExp?(0,Mt.regexpCode)(V):f.code.formats?(0,Mt._)`${f.code.formats}${(0,Mt.getProperty)(s)}`:void 0,T=r.scopeValue("formats",{key:s,ref:V,code:X});return typeof V=="object"&&!(V instanceof RegExp)?[V.type||"string",V.validate,(0,Mt._)`${T}.validate`]:["string",V,T]}function z(){if(typeof C=="object"&&!(C instanceof RegExp)&&C.async){if(!m.$async)throw new Error("async format in sync schema");return(0,Mt._)`await ${A}(${n})`}return typeof P=="function"?(0,Mt._)`${A}(${n})`:(0,Mt._)`${A}.test(${n})`}}}};r0.default=cV});var OI=F(n0=>{"use strict";Object.defineProperty(n0,"__esModule",{value:!0});var uV=EI(),fV=[uV.default];n0.default=fV});var II=F(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});Dl.contentVocabulary=Dl.metadataVocabulary=void 0;Dl.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Dl.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var kI=F(i0=>{"use strict";Object.defineProperty(i0,"__esModule",{value:!0});var dV=DO(),pV=QO(),hV=CI(),mV=OI(),PI=II(),gV=[dV.default,pV.default,(0,hV.default)(),mV.default,PI.metadataVocabulary,PI.contentVocabulary];i0.default=gV});var AI=F($h=>{"use strict";Object.defineProperty($h,"__esModule",{value:!0});$h.DiscrError=void 0;var TI;(function(t){t.Tag="tag",t.Mapping="mapping"})(TI||($h.DiscrError=TI={}))});var $I=F(o0=>{"use strict";Object.defineProperty(o0,"__esModule",{value:!0});var Fl=Ne(),s0=AI(),qI=yh(),yV=zu(),vV=We(),bV={message:({params:{discrError:t,tagName:e}})=>t===s0.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Fl._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},SV={keyword:"discriminator",type:"object",schemaType:"object",error:bV,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),d=e.const("tag",(0,Fl._)`${r}${(0,Fl.getProperty)(l)}`);e.if((0,Fl._)`typeof ${d} == "string"`,()=>m(),()=>t.error(!1,{discrError:s0.DiscrError.Tag,tag:d,tagName:l})),t.ok(f);function m(){let w=y();e.if(!1);for(let C in w)e.elseIf((0,Fl._)`${d} === ${C}`),e.assign(f,g(w[C]));e.else(),t.error(!1,{discrError:s0.DiscrError.Mapping,tag:d,tagName:l}),e.endIf()}function g(w){let C=e.name("valid"),R=t.subschema({keyword:"oneOf",schemaProp:w},C);return t.mergeEvaluated(R,Fl.Name),C}function y(){var w;let C={},R=A(i),P=!0;for(let z=0;z<o.length;z++){let V=o[z];if(V?.$ref&&!(0,vV.schemaHasRulesButRef)(V,s.self.RULES)){let T=V.$ref;if(V=qI.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,T),V instanceof qI.SchemaEnv&&(V=V.schema),V===void 0)throw new yV.default(s.opts.uriResolver,s.baseId,T)}let X=(w=V?.properties)===null||w===void 0?void 0:w[l];if(typeof X!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);P=P&&(R||A(V)),U(X,z)}if(!P)throw new Error(`discriminator: "${l}" must be required`);return C;function A({required:z}){return Array.isArray(z)&&z.includes(l)}function U(z,V){if(z.const)B(z.const,V);else if(z.enum)for(let X of z.enum)B(X,V);else throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`)}function B(z,V){if(typeof z!="string"||z in C)throw new Error(`discriminator: "${l}" values must be unique strings`);C[z]=V}}}};o0.default=SV});var MI=F((P7,wV)=>{wV.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 DI=F((St,a0)=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.MissingRefError=St.ValidationError=St.CodeGen=St.Name=St.nil=St.stringify=St.str=St._=St.KeywordCxt=St.Ajv=void 0;var _V=TO(),RV=kI(),xV=$I(),NI=MI(),CV=["/properties"],Mh="http://json-schema.org/draft-07/schema",Ll=class extends _V.default{_addVocabularies(){super._addVocabularies(),RV.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(xV.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(NI,CV):NI;this.addMetaSchema(e,Mh,!1),this.refs["http://json-schema.org/schema"]=Mh}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Mh)?Mh:void 0)}};St.Ajv=Ll;a0.exports=St=Ll;a0.exports.Ajv=Ll;Object.defineProperty(St,"__esModule",{value:!0});St.default=Ll;var EV=Wu();Object.defineProperty(St,"KeywordCxt",{enumerable:!0,get:function(){return EV.KeywordCxt}});var jl=Ne();Object.defineProperty(St,"_",{enumerable:!0,get:function(){return jl._}});Object.defineProperty(St,"str",{enumerable:!0,get:function(){return jl.str}});Object.defineProperty(St,"stringify",{enumerable:!0,get:function(){return jl.stringify}});Object.defineProperty(St,"nil",{enumerable:!0,get:function(){return jl.nil}});Object.defineProperty(St,"Name",{enumerable:!0,get:function(){return jl.Name}});Object.defineProperty(St,"CodeGen",{enumerable:!0,get:function(){return jl.CodeGen}});var OV=mh();Object.defineProperty(St,"ValidationError",{enumerable:!0,get:function(){return OV.default}});var IV=zu();Object.defineProperty(St,"MissingRefError",{enumerable:!0,get:function(){return IV.default}})});import*as PV from"crypto";import*as na from"fs";import{createRequire as kV}from"module";import*as Yn from"path";function Dh(){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 FI(){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 l0(t,e){return new Nh(t,e)}var Nh,c0=ae(()=>{"use strict";gb();Nh=class{availableModules=new Set;customModulesRequire;globalSetupExports;options;modulesPath=null;moduleCache=new Map;resolveStack=new Set;builtinModules={uuid:()=>({v4:_l}),crypto:()=>PV,path:()=>Yn,querystring:()=>it("querystring"),lodash:()=>this.loadOptionalModule("lodash",()=>rE(),FI),moment:()=>this.loadOptionalModule("moment",()=>nE(),Dh),tv4:()=>this.loadOptionalModule("tv4",()=>sE()),ajv:()=>this.loadOptionalModule("ajv",()=>DI()),"crypto-js":()=>this.loadOptionalModule("crypto-js",()=>it("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=Yn.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 RB={keyword:"dependencies",type:"object",schemaType:"object",error:Si.error,code(t){let[e,r]=xB(t);sI(t,e),oI(t,r)}};function xB({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 sI(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 a in e){let l=e[a];if(l.length===0)continue;let f=(0,of.propertyInData)(r,n,a,i.opts.ownProperties);t.setParams({property:a,depsCount:l.length,deps:l.join(", ")}),i.allErrors?r.if(f,()=>{for(let d of l)(0,of.checkReportMissingProp)(t,d)}):(r.if((0,HS._)`${f} && (${(0,of.checkMissingProp)(t,l,s)})`),(0,of.reportMissingProp)(t,s),r.else())}}Si.validatePropertyDeps=sI;function oI(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,a=r.name("valid");for(let l in e)(0,_B.alwaysValidSchema)(s,e[l])||(r.if((0,of.propertyInData)(r,n,l,s.opts.ownProperties),()=>{let f=t.subschema({keyword:i,schemaProp:l},a);t.mergeValidEvaluated(f,a)},()=>r.var(a,!0)),t.ok(a))}Si.validateSchemaDeps=oI;Si.default=RB});var cI=F(BS=>{"use strict";Object.defineProperty(BS,"__esModule",{value:!0});var lI=Ne(),CB=We(),EB={message:"property name must be valid",params:({params:t})=>(0,lI._)`{propertyName: ${t.propertyName}}`},OB={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:EB,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,CB.alwaysValidSchema)(i,r))return;let s=e.name("valid");e.forIn("key",n,a=>{t.setParams({propertyName:a}),t.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},s),e.if((0,lI.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};BS.default=OB});var WS=F(VS=>{"use strict";Object.defineProperty(VS,"__esModule",{value:!0});var Ph=Sn(),Jn=Ne(),IB=Gi(),kh=We(),PB={message:"must NOT have additional properties",params:({params:t})=>(0,Jn._)`{additionalProperty: ${t.additionalProperty}}`},kB={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:PB,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:s,it:a}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:l,opts:f}=a;if(a.props=!0,f.removeAdditional!=="all"&&(0,kh.alwaysValidSchema)(a,r))return;let d=(0,Ph.allSchemaProperties)(n.properties),m=(0,Ph.allSchemaProperties)(n.patternProperties);g(),t.ok((0,Jn._)`${s} === ${IB.default.errors}`);function g(){e.forIn("key",i,T=>{!d.length&&!m.length?C(T):e.if(y(T),()=>C(T))})}function y(T){let A;if(d.length>8){let U=(0,kh.schemaRefOrVal)(a,n.properties,"properties");A=(0,Ph.isOwnProperty)(e,U,T)}else d.length?A=(0,Jn.or)(...d.map(U=>(0,Jn._)`${T} === ${U}`)):A=Jn.nil;return m.length&&(A=(0,Jn.or)(A,...m.map(U=>(0,Jn._)`${(0,Ph.usePattern)(t,U)}.test(${T})`))),(0,Jn.not)(A)}function w(T){e.code((0,Jn._)`delete ${i}[${T}]`)}function C(T){if(f.removeAdditional==="all"||f.removeAdditional&&r===!1){w(T);return}if(r===!1){t.setParams({additionalProperty:T}),t.error(),l||e.break();return}if(typeof r=="object"&&!(0,kh.alwaysValidSchema)(a,r)){let A=e.name("valid");f.removeAdditional==="failing"?(R(T,A,!1),e.if((0,Jn.not)(A),()=>{t.reset(),w(T)})):(R(T,A),l||e.if((0,Jn.not)(A),()=>e.break()))}}function R(T,A,U){let B={keyword:"additionalProperties",dataProp:T,dataPropType:kh.Type.Str};U===!1&&Object.assign(B,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(B,A)}}};VS.default=kB});var dI=F(JS=>{"use strict";Object.defineProperty(JS,"__esModule",{value:!0});var TB=Wu(),uI=Sn(),zS=We(),fI=WS(),AB={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&&fI.default.code(new TB.KeywordCxt(s,fI.default,"additionalProperties"));let a=(0,uI.allSchemaProperties)(r);for(let g of a)s.definedProperties.add(g);s.opts.unevaluated&&a.length&&s.props!==!0&&(s.props=zS.mergeEvaluated.props(e,(0,zS.toHash)(a),s.props));let l=a.filter(g=>!(0,zS.alwaysValidSchema)(s,r[g]));if(l.length===0)return;let f=e.name("valid");for(let g of l)d(g)?m(g):(e.if((0,uI.propertyInData)(e,i,g,s.opts.ownProperties)),m(g),s.allErrors||e.else().var(f,!0),e.endIf()),t.it.definedProperties.add(g),t.ok(f);function d(g){return s.opts.useDefaults&&!s.compositeRule&&r[g].default!==void 0}function m(g){t.subschema({keyword:"properties",schemaProp:g,dataProp:g},f)}}};JS.default=AB});var gI=F(YS=>{"use strict";Object.defineProperty(YS,"__esModule",{value:!0});var pI=Sn(),Th=Ne(),hI=We(),mI=We(),qB={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:s}=t,{opts:a}=s,l=(0,pI.allSchemaProperties)(r),f=l.filter(R=>(0,hI.alwaysValidSchema)(s,r[R]));if(l.length===0||f.length===l.length&&(!s.opts.unevaluated||s.props===!0))return;let d=a.strictSchema&&!a.allowMatchingProperties&&i.properties,m=e.name("valid");s.props!==!0&&!(s.props instanceof Th.Name)&&(s.props=(0,mI.evaluatedPropsToName)(e,s.props));let{props:g}=s;y();function y(){for(let R of l)d&&w(R),s.allErrors?C(R):(e.var(m,!0),C(R),e.if(m))}function w(R){for(let T in d)new RegExp(R).test(T)&&(0,hI.checkStrictMode)(s,`property ${T} matches pattern ${R} (use allowMatchingProperties)`)}function C(R){e.forIn("key",n,T=>{e.if((0,Th._)`${(0,pI.usePattern)(t,R)}.test(${T})`,()=>{let A=f.includes(R);A||t.subschema({keyword:"patternProperties",schemaProp:R,dataProp:T,dataPropType:mI.Type.Str},m),s.opts.unevaluated&&g!==!0?e.assign((0,Th._)`${g}[${T}]`,!0):!A&&!s.allErrors&&e.if((0,Th.not)(m),()=>e.break())})})}}};YS.default=qB});var yI=F(GS=>{"use strict";Object.defineProperty(GS,"__esModule",{value:!0});var $B=We(),MB={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,$B.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"}};GS.default=MB});var vI=F(KS=>{"use strict";Object.defineProperty(KS,"__esModule",{value:!0});var NB=Sn(),DB={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:NB.validateUnion,error:{message:"must match a schema in anyOf"}};KS.default=DB});var bI=F(QS=>{"use strict";Object.defineProperty(QS,"__esModule",{value:!0});var Ah=Ne(),FB=We(),LB={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Ah._)`{passingSchemas: ${t.passing}}`},jB={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:LB,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,a=e.let("valid",!1),l=e.let("passing",null),f=e.name("_valid");t.setParams({passing:l}),e.block(d),t.result(a,()=>t.reset(),()=>t.error(!0));function d(){s.forEach((m,g)=>{let y;(0,FB.alwaysValidSchema)(i,m)?e.var(f,!0):y=t.subschema({keyword:"oneOf",schemaProp:g,compositeRule:!0},f),g>0&&e.if((0,Ah._)`${f} && ${a}`).assign(a,!1).assign(l,(0,Ah._)`[${l}, ${g}]`).else(),e.if(f,()=>{e.assign(a,!0),e.assign(l,g),y&&t.mergeEvaluated(y,Ah.Name)})})}}};QS.default=jB});var SI=F(ZS=>{"use strict";Object.defineProperty(ZS,"__esModule",{value:!0});var UB=We(),HB={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,a)=>{if((0,UB.alwaysValidSchema)(n,s))return;let l=t.subschema({keyword:"allOf",schemaProp:a},i);t.ok(i),t.mergeEvaluated(l)})}};ZS.default=HB});var RI=F(XS=>{"use strict";Object.defineProperty(XS,"__esModule",{value:!0});var qh=Ne(),_I=We(),BB={message:({params:t})=>(0,qh.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,qh._)`{failingKeyword: ${t.ifClause}}`},VB={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:BB,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,_I.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=wI(n,"then"),s=wI(n,"else");if(!i&&!s)return;let a=e.let("valid",!0),l=e.name("_valid");if(f(),t.reset(),i&&s){let m=e.let("ifClause");t.setParams({ifClause:m}),e.if(l,d("then",m),d("else",m))}else i?e.if(l,d("then")):e.if((0,qh.not)(l),d("else"));t.pass(a,()=>t.error(!0));function f(){let m=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);t.mergeEvaluated(m)}function d(m,g){return()=>{let y=t.subschema({keyword:m},l);e.assign(a,l),t.mergeValidEvaluated(y,a),g?e.assign(g,(0,qh._)`${m}`):t.setParams({ifClause:m})}}}};function wI(t,e){let r=t.schema[e];return r!==void 0&&!(0,_I.alwaysValidSchema)(t,r)}XS.default=VB});var xI=F(e0=>{"use strict";Object.defineProperty(e0,"__esModule",{value:!0});var WB=We(),zB={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,WB.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};e0.default=zB});var CI=F(t0=>{"use strict";Object.defineProperty(t0,"__esModule",{value:!0});var JB=DS(),YB=tI(),GB=FS(),KB=nI(),QB=iI(),ZB=aI(),XB=cI(),eV=WS(),tV=dI(),rV=gI(),nV=yI(),iV=vI(),sV=bI(),oV=SI(),aV=RI(),lV=xI();function cV(t=!1){let e=[nV.default,iV.default,sV.default,oV.default,aV.default,lV.default,XB.default,eV.default,ZB.default,tV.default,rV.default];return t?e.push(YB.default,KB.default):e.push(JB.default,GB.default),e.push(QB.default),e}t0.default=cV});var EI=F(r0=>{"use strict";Object.defineProperty(r0,"__esModule",{value:!0});var Mt=Ne(),uV={message:({schemaCode:t})=>(0,Mt.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Mt._)`{format: ${t}}`},fV={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:uV,code(t,e){let{gen:r,data:n,$data:i,schema:s,schemaCode:a,it:l}=t,{opts:f,errSchemaPath:d,schemaEnv:m,self:g}=l;if(!f.validateFormats)return;i?y():w();function y(){let C=r.scopeValue("formats",{ref:g.formats,code:f.code.formats}),R=r.const("fDef",(0,Mt._)`${C}[${a}]`),T=r.let("fType"),A=r.let("format");r.if((0,Mt._)`typeof ${R} == "object" && !(${R} instanceof RegExp)`,()=>r.assign(T,(0,Mt._)`${R}.type || "string"`).assign(A,(0,Mt._)`${R}.validate`),()=>r.assign(T,(0,Mt._)`"string"`).assign(A,R)),t.fail$data((0,Mt.or)(U(),B()));function U(){return f.strictSchema===!1?Mt.nil:(0,Mt._)`${a} && !${A}`}function B(){let V=m.$async?(0,Mt._)`(${R}.async ? await ${A}(${n}) : ${A}(${n}))`:(0,Mt._)`${A}(${n})`,W=(0,Mt._)`(typeof ${A} == "function" ? ${V} : ${A}.test(${n}))`;return(0,Mt._)`${A} && ${A} !== true && ${T} === ${e} && !${W}`}}function w(){let C=g.formats[s];if(!C){U();return}if(C===!0)return;let[R,T,A]=B(C);R===e&&t.pass(V());function U(){if(f.strictSchema===!1){g.logger.warn(W());return}throw new Error(W());function W(){return`unknown format "${s}" ignored in schema at path "${d}"`}}function B(W){let X=W instanceof RegExp?(0,Mt.regexpCode)(W):f.code.formats?(0,Mt._)`${f.code.formats}${(0,Mt.getProperty)(s)}`:void 0,P=r.scopeValue("formats",{key:s,ref:W,code:X});return typeof W=="object"&&!(W instanceof RegExp)?[W.type||"string",W.validate,(0,Mt._)`${P}.validate`]:["string",W,P]}function V(){if(typeof C=="object"&&!(C instanceof RegExp)&&C.async){if(!m.$async)throw new Error("async format in sync schema");return(0,Mt._)`await ${A}(${n})`}return typeof T=="function"?(0,Mt._)`${A}(${n})`:(0,Mt._)`${A}.test(${n})`}}}};r0.default=fV});var OI=F(n0=>{"use strict";Object.defineProperty(n0,"__esModule",{value:!0});var dV=EI(),pV=[dV.default];n0.default=pV});var II=F(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});Dl.contentVocabulary=Dl.metadataVocabulary=void 0;Dl.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Dl.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var kI=F(i0=>{"use strict";Object.defineProperty(i0,"__esModule",{value:!0});var hV=DO(),mV=QO(),gV=CI(),yV=OI(),PI=II(),vV=[hV.default,mV.default,(0,gV.default)(),yV.default,PI.metadataVocabulary,PI.contentVocabulary];i0.default=vV});var AI=F($h=>{"use strict";Object.defineProperty($h,"__esModule",{value:!0});$h.DiscrError=void 0;var TI;(function(t){t.Tag="tag",t.Mapping="mapping"})(TI||($h.DiscrError=TI={}))});var $I=F(o0=>{"use strict";Object.defineProperty(o0,"__esModule",{value:!0});var Fl=Ne(),s0=AI(),qI=yh(),bV=zu(),SV=We(),wV={message:({params:{discrError:t,tagName:e}})=>t===s0.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Fl._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},_V={keyword:"discriminator",type:"object",schemaType:"object",error:wV,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:s}=t,{oneOf:a}=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(!a)throw new Error("discriminator: requires oneOf keyword");let f=e.let("valid",!1),d=e.const("tag",(0,Fl._)`${r}${(0,Fl.getProperty)(l)}`);e.if((0,Fl._)`typeof ${d} == "string"`,()=>m(),()=>t.error(!1,{discrError:s0.DiscrError.Tag,tag:d,tagName:l})),t.ok(f);function m(){let w=y();e.if(!1);for(let C in w)e.elseIf((0,Fl._)`${d} === ${C}`),e.assign(f,g(w[C]));e.else(),t.error(!1,{discrError:s0.DiscrError.Mapping,tag:d,tagName:l}),e.endIf()}function g(w){let C=e.name("valid"),R=t.subschema({keyword:"oneOf",schemaProp:w},C);return t.mergeEvaluated(R,Fl.Name),C}function y(){var w;let C={},R=A(i),T=!0;for(let V=0;V<a.length;V++){let W=a[V];if(W?.$ref&&!(0,SV.schemaHasRulesButRef)(W,s.self.RULES)){let P=W.$ref;if(W=qI.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,P),W instanceof qI.SchemaEnv&&(W=W.schema),W===void 0)throw new bV.default(s.opts.uriResolver,s.baseId,P)}let X=(w=W?.properties)===null||w===void 0?void 0:w[l];if(typeof X!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);T=T&&(R||A(W)),U(X,V)}if(!T)throw new Error(`discriminator: "${l}" must be required`);return C;function A({required:V}){return Array.isArray(V)&&V.includes(l)}function U(V,W){if(V.const)B(V.const,W);else if(V.enum)for(let X of V.enum)B(X,W);else throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`)}function B(V,W){if(typeof V!="string"||V in C)throw new Error(`discriminator: "${l}" values must be unique strings`);C[V]=W}}}};o0.default=_V});var MI=F((T7,RV)=>{RV.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 DI=F((St,a0)=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.MissingRefError=St.ValidationError=St.CodeGen=St.Name=St.nil=St.stringify=St.str=St._=St.KeywordCxt=St.Ajv=void 0;var xV=TO(),CV=kI(),EV=$I(),NI=MI(),OV=["/properties"],Mh="http://json-schema.org/draft-07/schema",Ll=class extends xV.default{_addVocabularies(){super._addVocabularies(),CV.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(EV.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(NI,OV):NI;this.addMetaSchema(e,Mh,!1),this.refs["http://json-schema.org/schema"]=Mh}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Mh)?Mh:void 0)}};St.Ajv=Ll;a0.exports=St=Ll;a0.exports.Ajv=Ll;Object.defineProperty(St,"__esModule",{value:!0});St.default=Ll;var IV=Wu();Object.defineProperty(St,"KeywordCxt",{enumerable:!0,get:function(){return IV.KeywordCxt}});var jl=Ne();Object.defineProperty(St,"_",{enumerable:!0,get:function(){return jl._}});Object.defineProperty(St,"str",{enumerable:!0,get:function(){return jl.str}});Object.defineProperty(St,"stringify",{enumerable:!0,get:function(){return jl.stringify}});Object.defineProperty(St,"nil",{enumerable:!0,get:function(){return jl.nil}});Object.defineProperty(St,"Name",{enumerable:!0,get:function(){return jl.Name}});Object.defineProperty(St,"CodeGen",{enumerable:!0,get:function(){return jl.CodeGen}});var PV=mh();Object.defineProperty(St,"ValidationError",{enumerable:!0,get:function(){return PV.default}});var kV=zu();Object.defineProperty(St,"MissingRefError",{enumerable:!0,get:function(){return kV.default}})});import*as TV from"crypto";import*as na from"fs";import{createRequire as AV}from"module";import*as Yn from"path";function Dh(){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 FI(){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 l0(t,e){return new Nh(t,e)}var Nh,c0=oe(()=>{"use strict";gb();Nh=class{availableModules=new Set;customModulesRequire;globalSetupExports;options;modulesPath=null;moduleCache=new Map;resolveStack=new Set;builtinModules={uuid:()=>({v4:_l}),crypto:()=>TV,path:()=>Yn,querystring:()=>it("querystring"),lodash:()=>this.loadOptionalModule("lodash",()=>rE(),FI),moment:()=>this.loadOptionalModule("moment",()=>nE(),Dh),tv4:()=>this.loadOptionalModule("tv4",()=>sE()),ajv:()=>this.loadOptionalModule("ajv",()=>DI()),"crypto-js":()=>this.loadOptionalModule("crypto-js",()=>it("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=Yn.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=Yn.resolve(e,"package.json");if(!na.existsSync(r))return this.logDebug(`No modules/package.json found at ${e}`),!1;let n=na.realpathSync(r);return this.customModulesRequire=
|
|
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 u0(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],
|
|
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=Yn.resolve(e,"package.json");if(!na.existsSync(r))return this.logDebug(`No modules/package.json found at ${e}`),!1;let n=na.realpathSync(r);return this.customModulesRequire=AV(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=Yn.join(e,"package.json"),n=na.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||{},a=i.devDependencies||{};if(typeof s!="object"||typeof a!="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(a).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=Yn.join(e,"global-setup.js");if(na.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 a=this.builtinModules[e]();return this.cacheModule(e,a,"builtin",Date.now()-r),a}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 a=Yn.resolve(this.modulesPath,e),l=Yn.normalize(a),f=Yn.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 d=this.customModulesRequire(e);return this.cacheModule(e,d,"relative",Date.now()-r),d}catch(d){throw new Error(`Failed to load local module '${e}': ${d.message}`)}}if(this.availableModules.has(e)&&this.customModulesRequire)try{this.logDebug(`Loading workspace module: ${e}`);let a=this.customModulesRequire(e);return this.cacheModule(e,a,"workspace",Date.now()-r),a}catch(a){throw new Error(`Module '${e}' is in package.json but failed to load: ${a.message}`)}let i=this.getModuleSuggestions(e),s=`Module '${e}' is not available.`;throw i.length>0&&(s+=` Did you mean: ${i.join(", ")}?`),s+=`
|
|
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 LI(t){let e=new Set,r=new Set,n=(m,g)=>{try{m(...g)}catch(y){try{t(y)}catch{}}},i={setTimeout:(m,g,...y)=>{if(typeof m!="function")return setTimeout(()=>{},g);let w=setTimeout(()=>{e.delete(w),n(m,y)},g);return e.add(w),w},clearTimeout:m=>{m!=null&&(e.delete(m),clearTimeout(m))},setInterval:(m,g,...y)=>{if(typeof m!="function")return setInterval(()=>{},g);let w=setInterval(()=>{n(m,y)},g);return r.add(w),w},clearInterval:m=>{m!=null&&(r.delete(m),clearInterval(m))}},s=()=>e.size+r.size,a=()=>{for(let m of e)clearTimeout(m);for(let m of r)clearInterval(m);e.clear(),r.clear()},l=m=>new Promise(g=>setTimeout(g,m)),f=async m=>{let g=Date.now();for(await l(0);s()>0;){let y=Date.now()-g;if(y>=m)return a(),{timedOut:!0,elapsedMs:Date.now()-g};let w=m-y;await l(Math.min(15,w))}return await l(0),s()>0?d(g,m):{timedOut:!1,elapsedMs:Date.now()-g}},d=async(m,g)=>{for(;s()>0;){let y=Date.now()-m;if(y>=g)return a(),{timedOut:!0,elapsedMs:Date.now()-m};let w=g-y;await l(Math.min(15,w))}return{timedOut:!1,elapsedMs:Date.now()-m}};return{timers:i,pendingCount:s,clearAll:a,drain:f}}var jI=oe(()=>{"use strict"});function u0(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],a=i(t);if(!s.some(f=>f===a||f==="number"&&a==="integer"))return n.push(`${r}: expected type ${s.join("|")} but got ${a}`),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,a]of Object.entries(e.properties))s in t&&n.push(...u0(t[s],a,`${r}.${s}`));if(e.additionalProperties===!1&&e.properties){let s=new Set(Object.keys(e.properties));for(let a of Object.keys(t))s.has(a)||n.push(`${r}: additional property "${a}" is not allowed`)}}return Array.isArray(t)&&e.items&&typeof e.items=="object"&&t.forEach((s,a)=>{n.push(...u0(s,e.items,`${r}[${a}]`))}),n}function qV(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 Fh(t){let e=qV(t.headers);return{status:t.status,code:t.status,statusText:t.statusText,headers:e,body:t.body,cookies:t.cookies||{},responseTime:t.responseTime,responseSize:t.responseSize,getHeader(r){let n=r.toLowerCase();for(let[i,s]of Object.entries(t.headers))if(i.toLowerCase()===n)return s},getCookie(r){return t.cookies?.[r]},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)},cookie(r){return this.cookies?.[r]},hasCookie(r){return this.cookies?r in this.cookies:!1},to:{have:{status(r){if(t.status!==r)throw new Error(`Expected status ${r} but got ${t.status}`)},header(r,n){let i=t.headers[r]||t.headers[r.toLowerCase()];if(!i)throw new Error(`Expected header "${r}" to exist`);if(n!==void 0&&i!==n)throw new Error(`Expected header "${r}" to be "${n}" but got "${i}"`)},body(r){let n=typeof t.body=="string"?t.body:JSON.stringify(t.body);if(r!==void 0&&n!==r)throw new Error(`Expected body to be "${r}" but got "${n}"`)},jsonBody(r){let n=typeof t.body=="object"?t.body:JSON.parse(t.body);if(r!==void 0&&JSON.stringify(n)!==JSON.stringify(r))throw new Error("Expected JSON body to match")},jsonSchema(r){let n=typeof t.body=="object"?t.body:JSON.parse(t.body),i=u0(n,r);if(i.length>0)throw new Error(`Expected response body to match JSON schema:
|
|
39
39
|
- ${i.join(`
|
|
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)},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},property(r,n){let i=typeof this._value=="object"&&this._value!==null&&r in this._value;return n!==void 0?this._assert(i&&this._value[r]===n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have property "${r}" with value ${JSON.stringify(n)}`):this._assert(i,`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},contain(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},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},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(
|
|
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)},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},property(r,n){let i=typeof this._value=="object"&&this._value!==null&&r in this._value;return n!==void 0?this._assert(i&&this._value[r]===n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have property "${r}" with value ${JSON.stringify(n)}`):this._assert(i,`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},contain(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},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},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(a=>JSON.stringify(a)===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(a=>i.includes(a));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 Lh=oe(()=>{"use strict"});function jh(t,e=!1){let r=(typeof t=="string"?[t]:t).filter(i=>i&&i.trim());return r.length===0?"":e?`(async () => {
|
|
41
41
|
${r.map((i,s)=>`await (async () => {
|
|
42
42
|
/* --- script unit ${s+1} --- */
|
|
43
43
|
${i}
|
|
@@ -47,10 +47,10 @@ ${i}
|
|
|
47
47
|
|
|
48
48
|
// --- Next Script ---
|
|
49
49
|
|
|
50
|
-
`)}function lf(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function Ul(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 AV(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 f0(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 d0(t){let e={};for(let[r,n]of Object.entries(t))e[r]=Array.isArray(n)?n.join(", "):n;return e}var Uh=ae(()=>{"use strict"});import*as p0 from"vm";function qV(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 cf,h0=ae(()=>{"use strict";Lh();Uh();cf=class{constructor(e,r){this.deps=e;this.initialContext=r;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;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)}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 d of l)f[d.name]=d.value;return f},jar:()=>{let l=e.cookieJar;return{getAll(f,d){try{if(!l){d(null,[]);return}let m=l.getAll(f).map(g=>({name:g.name,value:g.value,domain:g.domain,path:g.path,httpOnly:g.httpOnly,secure:g.secure}));d(null,m)}catch(m){d(m,[])}},get(f,d,m){try{if(!l){m(null,void 0);return}let g=l.get(d,f);m(null,g?{name:g.name,value:g.value,domain:g.domain}:void 0)}catch(g){m(g,void 0)}},set(f,d,m,g){try{if(!l){(g||m)?.(null);return}typeof d=="string"&&typeof m=="string"?(l.set({name:d,value:m,domain:f}),g?.(null)):typeof d=="object"&&(l.set({...d,domain:f}),m?.(null))}catch(y){(g||m)?.(y)}},unset(f,d,m){try{if(!l){m?.(null);return}l.delete(d,f),m?.(null)}catch(g){m?.(g)}},clear(f){try{if(!l){f?.(null);return}l.clear(),f?.(null)}catch(d){f?.(d)}}}},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:f0(this.assertions),expect:af,cookies:s,execution:{setNextRequest(l){o._nextRequest=l},skipRequest(){o._skipRequest=!0},runRequest(l,f){let m=(async()=>{if(typeof n.sendRequest!="function")throw new Error("pm.execution.runRequest is not available \u2014 HTTP service not configured.");let g=typeof l=="string"?{url:l,method:"GET"}:l,y=await n.sendRequest(g),w={};if(Array.isArray(y?.cookies))for(let P of y.cookies)P?.name&&(w[P.name]=P.value);let C=y?.body,R=0;if(typeof C=="string")R=Buffer.byteLength(C,"utf8");else if(Buffer.isBuffer(C))R=C.length;else if(C!=null)try{R=Buffer.byteLength(JSON.stringify(C),"utf8")}catch{}return Fh({executedRequest:null,status:y?.status??0,statusText:y?.statusText??"",headers:y?.headers??{},body:C,cookies:w,responseTime:y?.time,responseSize:R})})();if(typeof f=="function"){m.then(g=>f(null,g),g=>f(g));return}return m},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,d]of Object.entries(e.headers))if(f.toLowerCase()===l.toLowerCase())return d},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,d]of Object.entries(e.headers))typeof d=="string"&&(l[f]=d);return l},each:l=>{for(let[f,d]of Object.entries(e.headers))typeof d=="string"&&l({key:f,value:d})}},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 qV(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[d,m]of Object.entries(e.headers))typeof m=="string"&&(f[d]=m);return f},addQueryParams(l){if(typeof l=="string"){let f=new URLSearchParams(l);for(let[d,m]of f)e.query||(e.query={}),e.query[d]=m}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 d=typeof f=="string"?f:f.key;d&&delete e.query[d]}))},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,d){e.body={type:f||e.body?.type||"raw",format:d||e.body?.format,content:l}}}}async executePreRequest(e){let r=jh(e,this.deps.isolateScripts);if(!r||!r.trim())return{success:!0};try{this.consoleMessages.length=0;let n=this.ctx.variables.replaceIn(r),i=p0.runInContext(n,this.vmContext,{timeout:5e3});this.deps.isolateScripts&&i&&typeof i.then=="function"&&await i;let s=Ul(this.consoleMessages),o=this.initialContext.request.body,l=!this.bodiesEqual(this.modifiedRequest.body,o);return{success:!0,modifiedRequest:{url:this.modifiedRequest.url!==this.initialContext.request.url?this.modifiedRequest.url:void 0,headers:lf(this.modifiedRequest.headers,this.initialContext.request.headers)?this.modifiedRequest.headers:void 0,body:l?this.modifiedRequest.body:void 0,params:lf(this.modifiedRequest.params,this.initialContext.request.params||{})?this.modifiedRequest.params:void 0,query:lf(this.modifiedRequest.query,this.initialContext.request.query||{})?this.modifiedRequest.query:void 0},modifiedVariables:this.ctx.variables.toObject(),modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,consoleOutput:s.length>0?s:void 0,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}catch(n){let i=[...Ul(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(),modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}}async executePostResponse(e,r){let n=jh(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=Fh(r),this.ctx.request=this.createRequestObject(r.executedRequest,this.initialContext),this.vmContext.responseBody=r.body??"";let i=this;this.vmContext.tests=new Proxy({},{set(f,d,m){return i.assertions.push({name:String(d),passed:!!m,message:m?void 0:`"${String(d)}" was false`}),!0}});let s=this.ctx.variables.replaceIn(n),o=p0.runInContext(s,this.vmContext,{timeout:5e3});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);let l=Ul(this.consoleMessages);return{testResults:[...this.assertions],consoleOutput:l.length>0?l: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=[...Ul(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.vmContext=null,this.ctx=null,this.assertions=[]}}});import*as tr from"crypto";import*as $V from"querystring";import*as jI from"vm";function UI(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 HI(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function MV(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=UI(r[2],e),i=Vi(r[1],n);return i!==null?i:void 0}if(e[t]!==void 0)return HI(e[t]);if(Uo(t)){let n=jo(t,e),i=Ho(t,n);if(i!==void 0)return i}}function LI(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=tr.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 m0(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 je?i.toBuffer():Buffer.from(String(i),"utf8");if(typeof s=="string"){let f=tr.randomBytes(8),{key:d,iv:m}=LI(s,e,r,f),g=tr.createCipheriv(n(e),d,m),y=Buffer.concat([g.update(l),g.final()]),w=Buffer.concat([Buffer.from("Salted__"),f,y]);return{ciphertext:new je(y),salt:new je(f),toString:C=>C?C.stringify(new je(w)):w.toString("base64")}}else{let f=s.toBuffer(),d=o?.iv&&o.iv instanceof je?o.iv.toBuffer():Buffer.alloc(r),m=tr.createCipheriv(n(f.length),f,d);o?.padding===!1&&m.setAutoPadding(!1);let g=Buffer.concat([m.update(l),m.final()]);return{ciphertext:new je(g),toString:y=>y?y.stringify(new je(g)):g.toString("base64")}}},decrypt(i,s,o){if(typeof s=="string"){let l=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext.toBuffer(),f,d;l.subarray(0,8).toString()==="Salted__"?(d=l.subarray(8,16),f=l.subarray(16)):(d=Buffer.alloc(0),f=l);let{key:m,iv:g}=LI(s,e,r,d),y=tr.createDecipheriv(n(e),m,g);return new je(Buffer.concat([y.update(f),y.final()]))}else{let l=s.toBuffer(),f=o?.iv&&o.iv instanceof je?o.iv.toBuffer():Buffer.alloc(r),d=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext?i.ciphertext.toBuffer():Buffer.from(i),m=tr.createDecipheriv(n(l.length),l,f);return o?.padding===!1&&m.setAutoPadding(!1),new je(Buffer.concat([m.update(d),m.final()]))}}}}function NV(){let t=r=>n=>{let i=n instanceof je?n.toBuffer():Buffer.from(String(n),"utf8");return new je(tr.createHash(r).update(i).digest())},e=r=>(n,i)=>{let s=n instanceof je?n.toBuffer():Buffer.from(String(n),"utf8"),o=i instanceof je?i.toBuffer():Buffer.from(String(i),"utf8");return new je(tr.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:m0("aes",32,16),DES:m0("des",8,8),TripleDES:m0("des-ede3",24,8),PBKDF2(r,n,i){let s=r instanceof je?r.toBuffer():Buffer.from(String(r),"utf8"),o=n instanceof je?n.toBuffer():Buffer.from(String(n),"utf8"),l=(i?.keySize||4)*4,f=i?.iterations||1;return new je(tr.pbkdf2Sync(s,o,f,l,"sha1"))},enc:{Base64:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).toString("base64"),parse:r=>je.fromBase64(r)},Utf8:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).toString("utf8"),parse:r=>je.fromUtf8(r)},Hex:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).toString("hex"),parse:r=>je.fromHex(r)},Latin1:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).toString("latin1"),parse:r=>new je(Buffer.from(r,"latin1"))},Utf16:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).toString("utf16le"),parse:r=>new je(Buffer.from(r,"utf16le"))},Utf16BE:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).swap16().toString("utf16le"),parse:r=>new je(Buffer.from(r,"utf16le").swap16())}},lib:{WordArray:{create:r=>r?typeof r=="string"?new je(Buffer.from(r,"utf8")):Buffer.isBuffer(r)?new je(r):new je(Buffer.from(String(r))):new je(Buffer.alloc(0)),random:r=>new je(tr.randomBytes(r))}},pad:{Pkcs7:{_name:"pkcs7"},NoPadding:{_name:"nopadding"},ZeroPadding:{_name:"zeropadding"}},mode:{CBC:{_name:"cbc"},ECB:{_name:"ecb"}}}}var je,Qi,uf=ae(()=>{"use strict";Kp();Zp();eh();c0();h0();Lh();je=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"))}};Qi=class t{constructor(e,r=[],n,i="shared"){this.httpService=e;this.secretRegistry=n;this.scopeMode=i;this.moduleLoader=l0(r)}httpService;secretRegistry;scopeMode;moduleLoader;createRequestSession(e){return new cf({createVM:this.createVM.bind(this),createCommonContext:this.createCommonContext.bind(this),isolateScripts:this.scopeMode==="isolated"},e)}createVM(e,r){let n=this.moduleLoader.getGlobalSetupExports(),i=this.moduleLoader.createRequireFunction();e.require=i,e.vault=this.createVault();let s={ctx:e,hf:e,pm:e,console:r,...n||{},global:n,setTimeout,setInterval,clearTimeout,clearInterval,URL,URLSearchParams,Buffer,atob:o=>Buffer.from(o,"base64").toString("binary"),btoa:o=>Buffer.from(o,"binary").toString("base64"),TextEncoder,TextDecoder,crypto:tr,_:i("lodash"),require:i,moment:Dh(),querystring:$V,CryptoJS:NV(),postman:{setNextRequest:o=>e.setNextRequest?.(o),setGlobalVariable:(o,l)=>e.globals?.set(o,l),getGlobalVariable:o=>e.globals?.get(o),clearGlobalVariable:o=>e.globals?.unset(o),setEnvironmentVariable:(o,l)=>e.environment?.set(o,l),getEnvironmentVariable:o=>e.environment?.get(o),clearEnvironmentVariable:o=>e.environment?.unset(o)},jsonStringify:(o,l,f)=>JSON.stringify(o,l,f),jsonParse:o=>JSON.parse(o),xml2Json:o=>{try{let l=this.moduleLoader.createRequireFunction()("xml2js"),f;return l.parseString(o,{explicitArray:!1},(d,m)=>{if(d)throw d;f=m}),f}catch{throw new Error("xml2Json() requires the xml2js module. Add it to your modules/package.json and run npm install.")}}};return jI.createContext(s)}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),d=this.createGlobalsScope(s,e.onGlobalsChange),m=this.createVariableScope(i),g=this.createEnvironmentScope(o,e.environmentName,e.onEnvironmentChange,!0),y={...g,set:(C,R)=>{let P=this.serializeValue(R);g.set(C,P),n[C]=P},unset(C){g.unset(C),delete n[C]},clear(){g.clear();for(let C of Object.keys(o))delete n[C]}};return d.replaceIn=f.replaceIn,m.replaceIn=f.replaceIn,y.replaceIn=f.replaceIn,{globals:d,collectionVariables:m,variables:f,environment:y,iterationData:{get:C=>l[C],has:C=>C 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}},replaceIn(l){if(!l||typeof l!="string")return l;let f=o.toObject();return l.replace(/\{\{([^}]+)\}\}/g,(d,m)=>{let g=m.trim(),y=g.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(y)try{let R=UI(y[2],f),P=Vi(y[1],R);return P!==null?String(P):d}catch{return d}let w=xu(g);if(w){let R=MV(w.input,f);if(R!==void 0){let P=Cu(R,w.filters,f);return P!==void 0?String(P):d}return d}let C=o.get(g);if(C!==void 0)return String(C);if(Uo(g)){let R={};for(let[U,B]of Object.entries(f))R[U]=HI(B);let P=jo(g,R),A=Ho(g,P);if(A!==void 0)return String(A)}return d})}};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 g0,ia,Hh=ae(()=>{"use strict";g0={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=g0["x-www-form-urlencoded"];break;case"raw":s=r.format?g0[r.format]:"text/plain",s||(s="text/plain");break;case"graphql":s=g0.graphql;break;case"binary":s="application/octet-stream";break}s&&(e["Content-Type"]=s)}}});var oa,Bh=ae(()=>{"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,d)=>{l[f]=o[d]||""}),i.push(l)}return i}parseCsvLine(e){let r=[],n="",i=!1;for(let s=0;s<e.length;s++){let o=e[s],l=e[s+1];o==='"'?i&&l==='"'?(n+='"',s++):i=!i:o===","&&!i?(r.push(n.trim()),n=""):n+=o}return r.push(n.trim()),r}}});import*as Vl from"crypto";var FV,hf,v0=ae(()=>{"use strict";FV=3e4,hf=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 d=await this.httpService.execute({method:"POST",url:i,headers:f,body:l.toString()}),m=this.parseTokenResponse(d.body,e);m.refreshToken||(m.refreshToken=r);let g=this.buildCacheKeyString(e);return this.tokenCache.set(g,m),m.refreshToken&&await this.storeRefreshToken(g,m.refreshToken),m}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,d,m,g;if(f){d=this.generateCodeVerifier();let X=e.pkceMethod||"S256";m=X==="S256"?this.generateCodeChallengeS256(d):d,g=X}let y=e.state||Vl.randomBytes(16).toString("hex"),w=await this.getCallbackUri(),C=new URL(n);if(C.searchParams.set("response_type","code"),C.searchParams.set("client_id",s),C.searchParams.set("redirect_uri",w),l&&C.searchParams.set("scope",l),C.searchParams.set("state",y),m&&(C.searchParams.set("code_challenge",m),C.searchParams.set("code_challenge_method",g)),e.audience&&C.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&C.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[X,T]of Object.entries(e.extraParams))C.searchParams.set(X,this.resolve(T,r));this.pendingAuthCallback&&(this.pendingAuthCallback.reject(new Error("OAuth2 authorization superseded by a new request")),this.pendingAuthCallback=null);let R=new Promise((X,T)=>{this.pendingAuthCallback={resolve:X,reject:T,state:y}});await this.browserService.openExternal(C.toString());let P;try{P=await Promise.race([R,new Promise((X,T)=>setTimeout(()=>{this.pendingAuthCallback=null,T(new Error("OAuth2 authorization timed out after 2 minutes"))},12e4))])}finally{this.pendingAuthCallback=null}if(P.state&&P.state!==y)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let A=new URLSearchParams;A.append("grant_type","authorization_code"),A.append("code",P.code),A.append("redirect_uri",w),d&&A.append("code_verifier",d);let U={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,U,A,s,o,r);let B=await this.httpService.execute({method:"POST",url:i,headers:U,body:A.toString()}),z=this.parseTokenResponse(B.body,e),V=this.buildCacheKeyString(e);return this.tokenCache.set(V,z),z.refreshToken&&await this.storeRefreshToken(V,z.refreshToken),z}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||Vl.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[w,C]of Object.entries(e.extraParams))f.searchParams.set(w,this.resolve(C,r));this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow superseded by a new request")),this.pendingImplicitCallback=null);let d=new Promise((w,C)=>{this.pendingImplicitCallback={resolve:w,reject:C,state:o}});await this.browserService.openExternal(f.toString());let m;try{m=await Promise.race([d,new Promise((w,C)=>setTimeout(()=>{this.pendingImplicitCallback=null,C(new Error("OAuth2 implicit flow timed out after 2 minutes"))},12e4))])}finally{this.pendingImplicitCallback=null}if(m.state&&m.state!==o)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let g={accessToken:m.accessToken,tokenType:m.tokenType||e.tokenPrefix||"Bearer",expiresAt:m.expiresIn?Date.now()+m.expiresIn*1e3:void 0,raw:{access_token:m.accessToken,token_type:m.tokenType,expires_in:m.expiresIn}},y=this.buildCacheKeyString(e);return this.tokenCache.set(y,g),g}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 g=this.resolve(e.username||"",r),y=this.resolve(e.password||"",r);if(!g)throw new Error("OAuth2 password grant requires username");f.append("username",g),f.append("password",y)}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[g,y]of Object.entries(e.extraParams))f.append(g,this.resolve(y,r));let d={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,d,f,s,o,r);let m=await this.httpService.execute({method:"POST",url:i,headers:d,body:f.toString()});return this.parseTokenResponse(m.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){if(!e||typeof e!="object")throw new Error("OAuth2 token response is not a valid JSON object");let n=e,i=r.tokenField||"access_token",s=n[i];if(!s)throw new Error(`OAuth2 token fetch failed: '${i}' not present in response`);let o=typeof n.expires_in=="number"?n.expires_in:void 0;return{accessToken:s,tokenType:n.token_type||r.tokenPrefix||"Bearer",expiresAt:o?Date.now()+o*1e3:void 0,refreshToken:n.refresh_token,scope:n.scope,raw:n}}isExpired(e){return e.expiresAt?Date.now()>=e.expiresAt-FV:!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 Vl.randomBytes(32).toString("base64url")}generateCodeChallengeS256(e){return Vl.createHash("sha256").update(e).digest("base64url")}async storeRefreshToken(e,r){try{await this.secretStore.store(`oauth2_refresh_${e}`,r)}catch{}}}});import*as aa from"fs";import*as Us from"path";function Wl(t,e={}){let r=[];Object.entries(e).forEach(([n,i])=>{r.push(`${n}=${i}`)}),r.length&&aa.writeFileSync(t,r.join(`
|
|
51
|
-
`),"utf-8")}function mf(t,e,r){r&&(r.preRequest&&r.preRequest.trim()&&aa.writeFileSync(Us.join(t,`${e}.pre.js`),r.preRequest,"utf-8"),r.postResponse&&r.postResponse.trim()&&aa.writeFileSync(Us.join(t,`${e}.post.js`),r.postResponse,"utf-8"))}function
|
|
52
|
-
`)}function HV(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 Wh=ae(()=>{"use strict";yn()});import*as cr from"fs";import*as b0 from"path";var zl,S0=ae(()=>{"use strict";yn();zl=class{collectionsDir;cache=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}ensureDirectory(){cr.existsSync(this.collectionsDir)||cr.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),!cr.existsSync(this.collectionsDir))return[];let e=cr.readdirSync(this.collectionsDir),r=[];for(let n of e)if(n.endsWith(".json"))try{let i=b0.join(this.collectionsDir,n),s=cr.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(cr.existsSync(r))try{let n=cr.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=ft(e.name));let r=this.getCollectionPath(e.id),n=JSON.stringify(e,null,2);await cr.promises.writeFile(r,n,"utf-8"),this.cache.set(e.id,e)}async delete(e){let r=this.getCollectionPath(e);if(!cr.existsSync(r))return!1;try{return await cr.promises.unlink(r),this.cache.delete(e),!0}catch(n){return console.error(`[JsonCollectionLoader] Failed to delete collection ${e}:`,n),!1}}exists(e){return cr.existsSync(this.getCollectionPath(e))}getCollectionPath(e){return b0.join(this.collectionsDir,`${e}.json`)}getItemPath(e,r){}async create(e,r){let n={id:r||ft(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 d=o.get(f);d&&(l.push(d),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 gf,w0=ae(()=>{"use strict";zp();S0();gf=class{static create(e){let r=e.getStorageConfig(),n=e.getCollectionsPath();return r.format==="folder"?new Ts(n):new zl(n)}static createForFormat(e,r){return e==="folder"?new Ts(r):new zl(r)}}});import*as wt from"fs";import*as Gn from"path";function BI(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 BV(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=>VI(e)),event:_0(t.scripts),variable:t.variables?Object.entries(t.variables).map(([e,r])=>({key:e,value:r})):[]}}function VI(t){if(t.type==="folder")return{name:t.name,item:t.items?t.items.map(VI):[],event:_0(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(VV),url:WV(e),body:zV(e),auth:JV(e.auth),description:e.description},event:_0(e.scripts),protocolProfileBehavior:YV(e.settings)}}}function VV(t){return{key:t.key,value:t.value,disabled:t.enabled===!1}}function WV(t){let e=t.url,r=t.url.replace(/^[a-zA-Z]+:\/\//,""),n=[],i=r.match(/^([^\/\?]+)/);if(i){let d=i[1];/^{{.*}}$/.test(d)?n=[d]:n=d.split(".")}let s=[],o=r.match(/^[^\/\?]+(\/[^\?]*)?/);if(o&&o[1]!==void 0){let d=o[1].replace(/^\//,"");d.endsWith("/")?(s=d.slice(0,-1).split("/"),s.push("")):s=d.length>0?d.split("/"):[]}let l;if(Array.isArray(t.query)&&t.query.length>0)l=t.query.map(d=>{let m={key:d.key,value:d.value};return d.enabled===!1&&(m.disabled=!0),m});else{let d=r.indexOf("?");d!==-1&&(l=r.substring(d+1).split("&").map(g=>{let[y,...w]=g.split("=");return{key:y,value:w.join("=")}}))}let f;return t.params&&typeof t.params=="object"&&(f=Object.entries(t.params).map(([d,m])=>({key:d,value:String(m)}))),{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 zV(t){if(!t.body)return;let e=t.body;if(typeof e=="string"){let s=BI(e);return{mode:"raw",raw:e,options:{raw:{language:s}}}}if(e.type==="raw"){let s=e.format||BI(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 JV(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 YV(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 _0(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 yf,R0=ae(()=>{"use strict";yn();Wh();w0();yf=class{constructor(e,r,n){this.workspaceRoot=e;this.configService=r;this.fileWatcherFactory=n;this.collectionsDir=r.getCollectionsPath(),this.loader=gf.create(r),this.ensureCollectionsDir(),this.loadCollections(),this.setupFileWatcher()}workspaceRoot;configService;fileWatcherFactory;collectionsDir;collections=new Map;fileWatcher;loader;debounceTimer=null;localCollectionValues=new Map;onCollectionsChanged;ensureCollectionsDir(){wt.existsSync(this.collectionsDir)||wt.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,this.loadCollections(),this.onCollectionsChanged?.()},200)};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=ft(e.name)),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;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;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,...d}=n;Object.assign(o,d)}}return s}async addRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;r.id||(r.id=ft(r.name));try{if(await this.loader.saveItem(e,r,n),n){let s=this.findItemRecursive(i.items,n);s&&s.type==="folder"&&(s.items=s.items||[],s.items.push(r))}else i.items.push(r);return!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;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:ft(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}`);let i=ft(r),s=this.loader.getCollectionPath(e),o=Gn.join(this.collectionsDir,i);if(!wt.existsSync(s))throw new Error(`Collection directory not found: ${s}`);this.copyDirRecursive(s,o);let l=Gn.join(o,"collection.json");if(wt.existsSync(l)){let d=JSON.parse(wt.readFileSync(l,"utf-8"));d.id=i,d.name=r,wt.writeFileSync(l,JSON.stringify(d,null,2))}else wt.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");let n={id:ft(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;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;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||!wt.existsSync(s))throw new Error(`Folder not found on disk: ${r}`);let o=Gn.dirname(s),l=ft(n),f=Gn.join(o,l);this.copyDirRecursive(s,f);let d=Gn.join(f,"folder.json");if(wt.existsSync(d)){let y=JSON.parse(wt.readFileSync(d,"utf-8"));y.id=l,y.name=n,wt.writeFileSync(d,JSON.stringify(y,null,2))}else wt.writeFileSync(d,JSON.stringify({id:l,name:n,type:"folder"},null,2));let m=this.loader.load(e);m&&this.collections.set(e,m);let g=this.findItemById(m?.items||[],l);return g||{id:l,type:"folder",name:n,items:[]}}async createRequest(e){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");let n={id:e.id||ft(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};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;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;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;let s=await this.loader.reorderItems(e,r,n);return s&&this.loadCollections(),s}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){wt.existsSync(r)||wt.mkdirSync(r,{recursive:!0});for(let n of wt.readdirSync(e,{withFileTypes:!0})){let i=Gn.join(e,n.name),s=Gn.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):wt.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=wt.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||ft(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=d=>{if(!d)return;switch(d.type?.toLowerCase()){case"bearer":return{type:"bearer",bearerToken:d.bearer?.find(A=>A.key==="token")?.value||""};case"basic":let y=d.basic?.find(A=>A.key==="username"),w=d.basic?.find(A=>A.key==="password");return{type:"basic",basicAuth:{username:y?.value||"",password:w?.value||""}};case"apikey":let C=d.apikey?.find(A=>A.key==="key"),R=d.apikey?.find(A=>A.key==="value"),P=d.apikey?.find(A=>A.key==="in");return{type:"apikey",apikey:{key:C?.value||"",value:R?.value||"",in:P?.value||"header"}};case"noauth":return{type:"none"};default:return}},n=d=>{if(!Array.isArray(d)||d.length===0)return;let m={};for(let g of d){let y=g.script?.exec;if(!y)continue;let w=Array.isArray(y)?y.join(`
|
|
53
|
-
`):y;g.listen==="prerequest"?m.preRequest=w:g.listen==="test"&&(m.postResponse=w)}return m.preRequest||m.postResponse?m:void 0},i=d=>{if(!d||typeof d!="object")return;let m={};return d.followRedirects===!1&&(m.followRedirects=!1),d.followOriginalHttpMethod===!0&&(m.followOriginalMethod=!0),d.followAuthorizationHeader===!1&&(m.followAuthHeader=!1),d.maxRedirects!==void 0&&(m.maxRedirects=d.maxRedirects),d.requestTimeout!==void 0&&(m.timeout=d.requestTimeout),Object.keys(m).length>0?m:void 0},s=d=>{if(!d||typeof d=="string")return;let m=d.query;if(!(!Array.isArray(m)||m.length===0))return m.map(g=>({key:g.key||"",value:g.value||"",enabled:g.disabled!==!0}))},o=d=>{if(typeof d=="string")return d;if(!d)return"";let m=new Set;if(Array.isArray(d.variable))for(let y of d.variable)y.key&&m.add(y.key);if(m.size===0&&d.raw)return d.raw;let g="";if(d.protocol&&(g+=d.protocol+"://"),d.host&&(g+=Array.isArray(d.host)?d.host.join("."):d.host),d.port&&(g+=":"+d.port),d.path){let w=(Array.isArray(d.path)?d.path:[d.path]).map(C=>{let R=C.startsWith(":")?C.substring(1):C;return m.has(R)?":"+R:(C.startsWith(":"),C)});g+="/"+w.join("/")}return!g&&d.raw?d.raw:g},l=d=>d.map(m=>{if(m.item)return{id:ft(m.name),type:"folder",name:m.name,description:m.description,auth:r(m.auth),scripts:n(m.event),items:l(m.item)};{let g=m.request||{};return{id:ft(m.name),type:"request",name:m.name,description:m.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(y=>({key:y.key||y.name||"",value:y.value||y.value||"",enabled:y.disabled!==!0})):[],body:(()=>{let y=g.body;if(y){if(y.mode==="raw"&&y.raw){let w=y.options?.raw?.language;return{type:"raw",format:w==="xml"?"xml":w==="html"?"html":w==="javascript"?"javascript":w==="text"?"text":"json",content:y.raw}}if(y.mode==="urlencoded"&&Array.isArray(y.urlencoded))return{type:"x-www-form-urlencoded",content:y.urlencoded.map(w=>({key:w.key||"",value:w.value||"",enabled:w.disabled!==!0}))};if(y.mode==="formdata"&&Array.isArray(y.formdata))return{type:"form-data",content:y.formdata.map(w=>({key:w.key||"",value:w.value||"",type:w.type||"text",enabled:w.disabled!==!0}))};if(y.mode==="graphql"&&y.graphql){let w;if(y.graphql.variables)try{w=JSON.parse(y.graphql.variables)}catch{w=void 0}return{type:"graphql",content:{query:y.graphql.query||"",variables:w}}}if(y.mode==="binary")return{type:"binary",content:""}}})(),auth:r(g.auth),scripts:n(m.event),settings:i(m.protocolProfileBehavior)}}}),f={id:ft(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),items:l(e.item||[])};return await this.saveCollection(f),f}async exportCollection(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=BV(n),s=JSON.stringify(i,null,2);wt.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=Gn.join(r,It(n.name));wt.mkdirSync(i,{recursive:!0});let s=n.variables||{};Wl(Gn.join(i,`${It(n.name)}.env`),s),mf(i,It(n.name),n.scripts),Vh(n.items,i,n)}dispose(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.fileWatcher?.dispose()}}});var Vt,Jl,la,x0=ae(()=>{"use strict";Vt={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"},runner:{resultsRetentionDays:7,indexPageSize:1e3,recentErrorsLimit:20},environments:{default:"dev"},restClientExport:{path:"collections-rest-client",mergeGlobals:!0},mcp:{excludedCollections:[],excludedSuites:[],toolPrefix:"",maxRequestsPerCall:50,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"}}}},Jl={config:"http-forge.config.json"},la={collections:"collections",environments:"environments",flows:"flows",suites:"suites"}});import*as Lr from"fs";import*as Rn from"path";var Yl,C0=ae(()=>{"use strict";x0();Yl=class{constructor(e,r,n){this.workspacePath=e;this.fileWatcherFactory=r;this.notifications=n;this.configPath=Rn.join(e,Jl.config),this.config=this.loadConfig(),this.setupFileWatcher()}workspacePath;fileWatcherFactory;notifications;config;configPath;fileWatcher;loadConfig(){if(!Lr.existsSync(this.configPath))return{...Vt};try{let e=Lr.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 ${Jl.config}. Using default configuration.`),{...Vt}}}mergeWithDefaults(e){return{version:e.version??Vt.version,storage:{...Vt.storage,...e.storage},request:{...Vt.request,...e.request},scripts:{...Vt.scripts,...e.scripts},runner:{...Vt.runner,...e.runner},environments:{...Vt.environments,...e.environments},restClientExport:{...Vt.restClientExport,...e.restClientExport},proxy:e.proxy!==void 0?e.proxy:Vt.proxy,mcp:{...Vt.mcp,...e.mcp,cors:{...Vt.mcp.cors,...e.mcp?.cors}},secrets:{...Vt.secrets,...e.secrets,providers:{...Vt.secrets?.providers,...e.secrets?.providers}}}}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.workspacePath,Jl.config);let e=()=>{this.reload()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}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 Rn.isAbsolute(e)?e:this.resolvePath(e)}getRestClientMergeGlobals(){return this.config.restClientExport?.mergeGlobals??!0}getProxyConfig(){return this.config.proxy??null}getMcpConfig(){return this.config.mcp??Vt.mcp}resolvePath(e){let r=e.startsWith("./")?e.slice(2):e;return Rn.join(this.workspacePath,...r.split("/"))}getRootPath(){return this.resolvePath(this.config.storage.root)}getCollectionsPath(){return Rn.join(this.getRootPath(),la.collections)}getEnvironmentsPath(){return Rn.join(this.getRootPath(),la.environments)}getFlowsPath(){return Rn.join(this.getRootPath(),la.flows)}getHistoryPath(){return this.resolvePath(this.config.storage.history)}getResultsPath(){return this.resolvePath(this.config.storage.results)}getSuitesPath(){return Rn.join(this.getRootPath(),la.suites)}getModulePaths(){return this.config.scripts.modulePaths.map(e=>this.resolvePath(e))}getScriptScope(){return this.config.scripts.scope??"shared"}getWorkspacePath(){return this.workspacePath}reload(){this.config=this.loadConfig()}configExists(){return Lr.existsSync(this.configPath)}async createDefaultConfig(){let e=JSON.stringify(Vt,null,2);await Lr.promises.writeFile(this.configPath,e,"utf-8");let r=[this.getCollectionsPath(),this.getEnvironmentsPath(),this.getFlowsPath(),this.getSuitesPath()];for(let i of r)Lr.existsSync(i)||await Lr.promises.mkdir(i,{recursive:!0});let n=[this.getHistoryPath(),this.getResultsPath()];for(let i of n)Lr.existsSync(i)||await Lr.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 Lr.promises.writeFile(Rn.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 Lr.promises.writeFile(Rn.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 Lr.promises.writeFile(Rn.join(e,"default-headers.json"),JSON.stringify(i,null,2),"utf-8")}dispose(){this.fileWatcher?.dispose()}}});var GV,vf,E0=ae(()=>{"use strict";Sl();GV="httpForge.cookies",vf=class{constructor(e,r=GV){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 dt.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 dt.parseCookieHeaders(e,r)}isExpired(e){return dt.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 dt.domainMatches(e,r)}get count(){return this.cookies.size}}});var bf,O0=ae(()=>{"use strict";Sl();bf=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=>!(dt.isExpired(s)||s.domain&&!dt.domainMatches(r,s.domain)||!s.domain||s.path&&!n.startsWith(s.path)));if(i.length!==0)return dt.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 zh(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,d=typeof l.enabled=="boolean"?l.enabled:!0;f&&d!==!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 KV(t,e){try{let r=await e.readFile(t);return zh(r)}catch{return null}}var I0=ae(()=>{"use strict"});import*as Wt from"fs";import*as nn from"path";var Sf,wf,P0=ae(()=>{"use strict";yn();I0();Wh();Gp();Eu();Sf={SELECTED_ENVIRONMENT:"httpForge.selectedEnvironment",ENV_OVERRIDES_PREFIX:"httpForge.envOverrides."},wf=class{constructor(e,r,n,i,s){this.workspaceFolder=e;this.workspaceStore=r;this.configService=n;this.fileWatcherFactory=i;this.secretStore=s;let o=n.getEnvironmentsPath();this.environmentsPath=o,this.sharedConfigPath=nn.join(o,"_global.json"),this.localConfigPath=nn.join(o,"_global.local.json"),this.historiesPath=n.getHistoryPath(),this.selectedEnvironment=r.get(Sf.SELECTED_ENVIRONMENT,"dev")??"dev",this.localGlobalValues={},this.localEnvironmentValues=new Map,this.loadPersistedEnvironmentOverrides(),this.loadSecretVariables(this.selectedEnvironment).catch(()=>{}),this.setupFileWatcher()}workspaceFolder;workspaceStore;configService;fileWatcherFactory;secretStore;environmentsPath;sharedConfigPath;localConfigPath;historiesPath;sharedConfig=null;localConfig=null;selectedEnvironment="dev";fileWatcher;localGlobalValues={};localEnvironmentValues=new Map;secretValuesCache=new Map;onEnvironmentsChanged;setupFileWatcher(){if(!this.fileWatcherFactory||!Wt.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(!Wt.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(Sf.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`${Sf.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){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.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||{},d=o&&o.headers||{},m=yu(n.defaultHeaders||{},d),g=this.localEnvironmentValues.get(r)||{},y=this.secretValuesCache.get(r)||{},w={...n.globalVariables||{},...s.variables||{},...l,...f,...g,...y};return{name:r,description:s.description,requiresConfirmation:s.requiresConfirmation,headers:m,variables:w}}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=nn.join(e,"globals.env");Wl(o,s)}n.forEach(o=>{let l=i?.environments?.[o];if(!l)return;let f={...l.variables||{}};r&&(f={...s,...f});let d=nn.join(e,`${It(o)}.env`);Wl(d,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 nn.join(this.environmentsPath,`${e}.json`)}localConfigExists(){return Wt.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=Wt.readFileSync(e,"utf-8"),n=zh(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 nn.join(this.environmentsPath,`${e}.local.json`)}loadFolderConfigs(){let e=_u(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||{}};return new Bo({globals:{},collectionVariables:{},environmentVariables:s,variables:{}})}saveFolderSharedConfig(e){Wt.existsSync(this.environmentsPath)||Wt.mkdirSync(this.environmentsPath,{recursive:!0});let r={variables:e.globalVariables||{},defaultHeaders:e.defaultHeaders||{}};this.saveJsonFile(this.sharedConfigPath,r);let n=Wt.readdirSync(this.environmentsPath).filter(s=>s.endsWith(".json")).filter(s=>!Yp(s)),i=new Set(Object.keys(e.environments||{}));for(let s of n){let o=nn.basename(s,".json");if(!i.has(o))try{Wt.unlinkSync(nn.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(nn.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(Sf.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(Sf.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(!Wt.existsSync(e))return null;let r=Wt.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=nn.dirname(e);Wt.existsSync(n)||Wt.mkdirSync(n,{recursive:!0}),Wt.writeFileSync(e,JSON.stringify(r,null,2),"utf-8")}catch(n){throw console.error(`Failed to save JSON to ${e}:`,n),n}}}});var Hs,Jh=ae(()=>{"use strict";Uh();Hs=class t{constructor(e,r,n,i,s,o,l,f,d,m,g,y){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=d;this.collectionName=m;this.iteration=g;this.iterationCount=y}httpService;scriptExecutor;envConfigService;requestPreparer;environment;cookieJar;collectionScripts;folderScriptsChain;onConsoleOutput;collectionName;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(),d={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(y,w,C)=>{y==="set"&&w&&C!==void 0?this.envConfigService.setEnvironmentVariable(w,C,this.environment):y==="unset"&&w?this.envConfigService.deleteEnvironmentVariable(w,this.environment):y==="clear"&&this.envConfigService.clearEnvironmentVariables(this.environment)},onGlobalsChange:(y,w,C)=>{y==="set"&&w&&C!==void 0?this.envConfigService.setGlobalVariable(w,C):y==="unset"&&w?this.envConfigService.deleteGlobalVariable(w):y==="clear"&&this.envConfigService.clearGlobalVariables()}},m=this.scriptExecutor.createRequestSession(d),g=null;try{let y={...r},w={...e},C;if(s.length>0){let $=await m.executePreRequest(s);if($.consoleOutput&&$.consoleOutput.length>0&&this.onConsoleOutput?.($.consoleOutput),$.nextRequest!==void 0&&(C=$.nextRequest),$.skipRequest){let Y={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:e.url||"",method:e.method||"GET",headers:{},body:Y,params:{},query:{}},response:{status:0,statusText:"Skipped",headers:{},body:null,time:0,cookies:[]},duration:Date.now()-i,timestamp:Date.now(),passed:!0,assertions:[],modifiedVariables:y,nextRequest:C}}$.success&&($.modifiedRequest&&($.modifiedRequest.url&&(w.url=$.modifiedRequest.url),$.modifiedRequest.headers&&(w.headers=$.modifiedRequest.headers),$.modifiedRequest.params&&(w.params=$.modifiedRequest.params),$.modifiedRequest.query&&(w.query=$.modifiedRequest.query),$.modifiedRequest.body!==void 0&&(w.body=$.modifiedRequest.body)),$.modifiedVariables&&(y=$.modifiedVariables))}g=await this.requestPreparer.prepareRequest(w,this.environment,l,y);let{url:R,headers:P,body:A,method:U}=g,B={};for(let $ in P)Object.prototype.hasOwnProperty.call(P,$)&&(B[$.toUpperCase()]=P[$]);if(!B.COOKIE&&w.settings?.includeCookies!==!1&&this.cookieJar){let Y=this.cookieJar.getCookieHeader(R);Y&&(B.COOKIE=Y)}let z={method:U,url:R,headers:B,body:A.content,signal:n,settings:w.settings?{timeout:w.settings.timeout,followRedirects:w.settings.followRedirects,maxRedirects:w.settings.maxRedirects,strictSSL:w.settings.strictSSL}:void 0},V=await this.httpService.execute(z);this.cookieJar&&V.headers&&await this.cookieJar.setCookiesFromResponse(R,V.headers);let X=Date.now()-i,T=[],_={},k;if(o.length>0){let $=0;if(V.body)if(typeof V.body=="string")$=Buffer.byteLength(V.body,"utf8");else if(Buffer.isBuffer(V.body))$=V.body.length;else try{$=Buffer.byteLength(JSON.stringify(V.body),"utf8")}catch{$=0}let Y={};V.cookies&&Array.isArray(V.cookies)&&V.cookies.forEach(ue=>{ue.name&&(Y[ue.name]=ue.value)});let K={executedRequest:g,status:V.status,statusText:V.statusText,headers:d0(V.headers||{}),body:V.body,cookies:Y,responseTime:V.time,responseSize:$},ne=await m.executePostResponse(o,K);T=ne.testResults,_=ne.modifiedEnvironmentVariables||{},k=ne.visualizerData,ne.nextRequest!==void 0&&(C=ne.nextRequest),ne.consoleOutput&&ne.consoleOutput.length>0&&this.onConsoleOutput?.(ne.consoleOutput)}let M=T.length===0||T.every($=>$.passed),j=T.length>0?M:V.status>=200&&V.status<=302;return{requestId:e.id,name:e.name,executedRequest:{...g,headers:B},response:{status:V.status,statusText:V.statusText,headers:V.headers||{},body:V.body,time:V.time||X,cookies:V.cookies||[]},duration:X,timestamp:Date.now(),passed:j,assertions:T,modifiedVariables:y,modifiedEnvironmentVariables:_,nextRequest:C,visualizerData:k}}catch(y){return this.handleError(e,g,y,i)}finally{m.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?.([`[error] ${e.name}: ${n.message||n}`]);let f=String(n.name==="AbortError"?"Request was aborted":n.message||n),d=n?.stack?String(n.stack):"",m=this.errorBodyFormat,g,y;m==="html"||m==="both"?(g=t.formatErrorAsHtml(f,d),y={"content-type":"text/html; charset=utf-8"}):(g=f,y={});let w={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:l||"",method:o||"GET",headers:r?.headers||{},body:r?.body||w,params:r?.params||{},query:r?.query||{}},response:{status:0,statusText:n.name==="AbortError"?"Aborted":n.code||n.message||"Request Error",headers:y,cookies:[],body:g,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,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");return`<!doctype html>
|
|
50
|
+
`)}function lf(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function Ul(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 $V(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 f0(t){let e=[],r=(n,i)=>{try{let s=i();if(s&&typeof s.then=="function"){let a=s.then(()=>{t.push({name:n,passed:!0})},l=>{t.push({name:n,passed:!1,message:l.message||String(l)})});e.push(a)}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 d0(t){let e={};for(let[r,n]of Object.entries(t))e[r]=Array.isArray(n)?n.join(", "):n;return e}var Uh=oe(()=>{"use strict"});import*as p0 from"vm";function MV(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 cf,h0=oe(()=>{"use strict";jI();Lh();Uh();cf=class{constructor(e,r){this.deps=e;this.initialContext=r;this.timerRegistry=LI(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 d of l)f[d.name]=d.value;return f},jar:()=>{let l=e.cookieJar;return{getAll(f,d){try{if(!l){d(null,[]);return}let m=l.getAll(f).map(g=>({name:g.name,value:g.value,domain:g.domain,path:g.path,httpOnly:g.httpOnly,secure:g.secure}));d(null,m)}catch(m){d(m,[])}},get(f,d,m){try{if(!l){m(null,void 0);return}let g=l.get(d,f);m(null,g?{name:g.name,value:g.value,domain:g.domain}:void 0)}catch(g){m(g,void 0)}},set(f,d,m,g){try{if(!l){(g||m)?.(null);return}typeof d=="string"&&typeof m=="string"?(l.set({name:d,value:m,domain:f}),g?.(null)):typeof d=="object"&&(l.set({...d,domain:f}),m?.(null))}catch(y){(g||m)?.(y)}},unset(f,d,m){try{if(!l){m?.(null);return}l.delete(d,f),m?.(null)}catch(g){m?.(g)}},clear(f){try{if(!l){f?.(null);return}l.clear(),f?.(null)}catch(d){f?.(d)}}}},remove:l=>{e.cookieJar&&e.cookieJar.delete(l,i)},unset:l=>{e.cookieJar&&e.cookieJar.delete(l,i)},clear:()=>{e.cookieJar&&e.cookieJar.clear()}},a=this;return{request:this.createRequestObject(r,e),response:null,test:f0(this.assertions),expect:af,cookies:s,execution:{setNextRequest(l){a._nextRequest=l},skipRequest(){a._skipRequest=!0},runRequest(l,f){let m=(async()=>{if(typeof n.sendRequest!="function")throw new Error("pm.execution.runRequest is not available \u2014 HTTP service not configured.");let g=typeof l=="string"?{url:l,method:"GET"}:l,y=await n.sendRequest(g),w={};if(Array.isArray(y?.cookies))for(let T of y.cookies)T?.name&&(w[T.name]=T.value);let C=y?.body,R=0;if(typeof C=="string")R=Buffer.byteLength(C,"utf8");else if(Buffer.isBuffer(C))R=C.length;else if(C!=null)try{R=Buffer.byteLength(JSON.stringify(C),"utf8")}catch{}return Fh({executedRequest:null,status:y?.status??0,statusText:y?.statusText??"",headers:y?.headers??{},body:C,cookies:w,responseTime:y?.time,responseSize:R})})();if(typeof f=="function"){m.then(g=>f(null,g),g=>f(g));return}return m},location:{current:n.info?.requestName||"",currentRequestName:n.info?.requestName||"",eventName:"prerequest",toString(){return n.info?.requestName||""}}},setNextRequest(l){a._nextRequest=l},visualizer:{set(l,f){a._visualizerData={template:l,data:f}},clear(){a._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,d]of Object.entries(e.headers))if(f.toLowerCase()===l.toLowerCase())return d},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,d]of Object.entries(e.headers))typeof d=="string"&&(l[f]=d);return l},each:l=>{for(let[f,d]of Object.entries(e.headers))typeof d=="string"&&l({key:f,value:d})}},a={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 MV(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 a},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[d,m]of Object.entries(e.headers))typeof m=="string"&&(f[d]=m);return f},addQueryParams(l){if(typeof l=="string"){let f=new URLSearchParams(l);for(let[d,m]of f)e.query||(e.query={}),e.query[d]=m}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 d=typeof f=="string"?f:f.key;d&&delete e.query[d]}))},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,d){e.body={type:f||e.body?.type||"raw",format:d||e.body?.format,content:l}}}}async executePreRequest(e){let r=jh(e,this.deps.isolateScripts);if(!r||!r.trim())return{success:!0};try{this.consoleMessages.length=0;let n=this.ctx.variables.replaceIn(r),i=this.deps.scriptTimeoutMs??5e3,s=p0.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=Ul(this.consoleMessages),f=this.initialContext.request.body,d=!this.bodiesEqual(this.modifiedRequest.body,f);return{success:!0,modifiedRequest:{url:this.modifiedRequest.url!==this.initialContext.request.url?this.modifiedRequest.url:void 0,headers:lf(this.modifiedRequest.headers,this.initialContext.request.headers)?this.modifiedRequest.headers:void 0,body:d?this.modifiedRequest.body:void 0,params:lf(this.modifiedRequest.params,this.initialContext.request.params||{})?this.modifiedRequest.params:void 0,query:lf(this.modifiedRequest.query,this.initialContext.request.query||{})?this.modifiedRequest.query:void 0},modifiedVariables:this.ctx.variables.toObject(),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=[...Ul(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(),modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}}async executePostResponse(e,r){let n=jh(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=Fh(r),this.ctx.request=this.createRequestObject(r.executedRequest,this.initialContext),this.vmContext.responseBody=r.body??"";let i=this;this.vmContext.tests=new Proxy({},{set(m,g,y){return i.assertions.push({name:String(g),passed:!!y,message:y?void 0:`"${String(g)}" was false`}),!0}});let s=this.ctx.variables.replaceIn(n),a=this.deps.scriptTimeoutMs??5e3,l=p0.runInContext(s,this.vmContext,{timeout:a});this.deps.isolateScripts&&l&&typeof l.then=="function"&&await l,this.ctx.test._pendingTests?.length>0&&(await Promise.all(this.ctx.test._pendingTests),this.ctx.test._pendingTests.length=0),(await this.timerRegistry.drain(a)).timedOut&&this.consoleMessages.push({level:"warn",args:[`Script timed out after ${a}ms; pending async work was cancelled.`]});let d=Ul(this.consoleMessages);return{testResults:[...this.assertions],consoleOutput:d.length>0?d: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=[...Ul(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 tr from"crypto";import*as NV from"querystring";import*as HI from"vm";function BI(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],a=Number(s);return!isNaN(a)&&s!==""?a:s}return n})}function VI(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function DV(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=BI(r[2],e),i=Vi(r[1],n);return i!==null?i:void 0}if(e[t]!==void 0)return VI(e[t]);if(Uo(t)){let n=jo(t,e),i=Ho(t,n);if(i!==void 0)return i}}function UI(t,e,r,n){let i=Buffer.concat([Buffer.from(t,"utf8"),n||Buffer.alloc(0)]),s=[],a=Buffer.alloc(0);for(;Buffer.concat(s).length<e+r;)a=tr.createHash("md5").update(Buffer.concat([a,i])).digest(),s.push(a);let l=Buffer.concat(s);return{key:l.subarray(0,e),iv:l.subarray(e,e+r)}}function m0(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,a){let l=i instanceof je?i.toBuffer():Buffer.from(String(i),"utf8");if(typeof s=="string"){let f=tr.randomBytes(8),{key:d,iv:m}=UI(s,e,r,f),g=tr.createCipheriv(n(e),d,m),y=Buffer.concat([g.update(l),g.final()]),w=Buffer.concat([Buffer.from("Salted__"),f,y]);return{ciphertext:new je(y),salt:new je(f),toString:C=>C?C.stringify(new je(w)):w.toString("base64")}}else{let f=s.toBuffer(),d=a?.iv&&a.iv instanceof je?a.iv.toBuffer():Buffer.alloc(r),m=tr.createCipheriv(n(f.length),f,d);a?.padding===!1&&m.setAutoPadding(!1);let g=Buffer.concat([m.update(l),m.final()]);return{ciphertext:new je(g),toString:y=>y?y.stringify(new je(g)):g.toString("base64")}}},decrypt(i,s,a){if(typeof s=="string"){let l=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext.toBuffer(),f,d;l.subarray(0,8).toString()==="Salted__"?(d=l.subarray(8,16),f=l.subarray(16)):(d=Buffer.alloc(0),f=l);let{key:m,iv:g}=UI(s,e,r,d),y=tr.createDecipheriv(n(e),m,g);return new je(Buffer.concat([y.update(f),y.final()]))}else{let l=s.toBuffer(),f=a?.iv&&a.iv instanceof je?a.iv.toBuffer():Buffer.alloc(r),d=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext?i.ciphertext.toBuffer():Buffer.from(i),m=tr.createDecipheriv(n(l.length),l,f);return a?.padding===!1&&m.setAutoPadding(!1),new je(Buffer.concat([m.update(d),m.final()]))}}}}function FV(){let t=r=>n=>{let i=n instanceof je?n.toBuffer():Buffer.from(String(n),"utf8");return new je(tr.createHash(r).update(i).digest())},e=r=>(n,i)=>{let s=n instanceof je?n.toBuffer():Buffer.from(String(n),"utf8"),a=i instanceof je?i.toBuffer():Buffer.from(String(i),"utf8");return new je(tr.createHmac(r,a).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:m0("aes",32,16),DES:m0("des",8,8),TripleDES:m0("des-ede3",24,8),PBKDF2(r,n,i){let s=r instanceof je?r.toBuffer():Buffer.from(String(r),"utf8"),a=n instanceof je?n.toBuffer():Buffer.from(String(n),"utf8"),l=(i?.keySize||4)*4,f=i?.iterations||1;return new je(tr.pbkdf2Sync(s,a,f,l,"sha1"))},enc:{Base64:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).toString("base64"),parse:r=>je.fromBase64(r)},Utf8:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).toString("utf8"),parse:r=>je.fromUtf8(r)},Hex:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).toString("hex"),parse:r=>je.fromHex(r)},Latin1:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).toString("latin1"),parse:r=>new je(Buffer.from(r,"latin1"))},Utf16:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).toString("utf16le"),parse:r=>new je(Buffer.from(r,"utf16le"))},Utf16BE:{stringify:r=>(r instanceof je?r.toBuffer():Buffer.from(String(r))).swap16().toString("utf16le"),parse:r=>new je(Buffer.from(r,"utf16le").swap16())}},lib:{WordArray:{create:r=>r?typeof r=="string"?new je(Buffer.from(r,"utf8")):Buffer.isBuffer(r)?new je(r):new je(Buffer.from(String(r))):new je(Buffer.alloc(0)),random:r=>new je(tr.randomBytes(r))}},pad:{Pkcs7:{_name:"pkcs7"},NoPadding:{_name:"nopadding"},ZeroPadding:{_name:"zeropadding"}},mode:{CBC:{_name:"cbc"},ECB:{_name:"ecb"}}}}var je,Qi,uf=oe(()=>{"use strict";Kp();Zp();eh();c0();h0();Lh();je=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"))}};Qi=class t{constructor(e,r=[],n,i="shared",s=5e3){this.httpService=e;this.secretRegistry=n;this.scopeMode=i;this.scriptTimeoutMs=s;this.moduleLoader=l0(r)}httpService;secretRegistry;scopeMode;scriptTimeoutMs;moduleLoader;createRequestSession(e){return new cf({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 a={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:tr,_:s("lodash"),require:s,moment:Dh(),querystring:NV,CryptoJS:FV(),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)},jsonStringify:(l,f,d)=>JSON.stringify(l,f,d),jsonParse:l=>JSON.parse(l),xml2Json:l=>{try{let f=this.moduleLoader.createRequireFunction()("xml2js"),d;return f.parseString(l,{explicitArray:!1},(m,g)=>{if(m)throw m;d=g}),d}catch{throw new Error("xml2Json() requires the xml2js module. Add it to your modules/package.json and run npm install.")}}};return HI.createContext(a)}createCommonContext(e,r){let n={...e.variables},i={...e.collectionVariables||{}},s={...e.globals||{}},a={...e.environmentVariables||{}},l=e.iterationData||{},f=this.createMergedVariableScope(n,a,i,s,l),d=this.createGlobalsScope(s,e.onGlobalsChange),m=this.createVariableScope(i),g=this.createEnvironmentScope(a,e.environmentName,e.onEnvironmentChange,!0),y={...g,set:(C,R)=>{let T=this.serializeValue(R);g.set(C,T),n[C]=T},unset(C){g.unset(C),delete n[C]},clear(){g.clear();for(let C of Object.keys(a))delete n[C]}};return d.replaceIn=f.replaceIn,m.replaceIn=f.replaceIn,y.replaceIn=f.replaceIn,{globals:d,collectionVariables:m,variables:f,environment:y,iterationData:{get:C=>l[C],has:C=>C 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,a)=>{r&&r(i,s,a)};return{get:i=>this.deserializeValue(e[i]),set:(i,s)=>{let a=this.serializeValue(s);e[i]=a,n("set",i,a)},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 a={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}},replaceIn(l){if(!l||typeof l!="string")return l;let f=a.toObject(),d=20,m=y=>y.replace(/\{\{([^}]+)\}\}/g,(w,C)=>{let R=C.trim(),T=R.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(T)try{let B=BI(T[2],f),V=Vi(T[1],B);return V!==null?String(V):w}catch{return w}let A=xu(R);if(A){let B=DV(A.input,f);if(B!==void 0){let V=Cu(B,A.filters,f);return V!==void 0?String(V):w}return w}let U=a.get(R);if(U!==void 0)return String(U);if(Uo(R)){let B={};for(let[X,P]of Object.entries(f))B[X]=VI(P);let V=jo(R,B),W=Ho(R,V);if(W!==void 0)return String(W)}return w}),g=l;for(let y=0;y<d;y++){let w=m(g);if(w===g)break;g=w}return g}};return a}createEnvironmentScope(e,r,n,i){let s=(a,l,f)=>{n&&(i?n(a,l,f):n(l||"",a==="set"?f:void 0))};return{name:r||"",get:a=>this.deserializeValue(e[a]),set:(a,l)=>{let f=this.serializeValue(l);e[a]=f,s("set",a,f)},has(a){return a in e},unset(a){delete e[a],s("unset",a)},clear(){Object.keys(e).forEach(a=>delete e[a]),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 g0,ia,Hh=oe(()=>{"use strict";g0={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(a=>a.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=g0["x-www-form-urlencoded"];break;case"raw":s=r.format?g0[r.format]:"text/plain",s||(s="text/plain");break;case"graphql":s=g0.graphql;break;case"binary":s="application/octet-stream";break}s&&(e["Content-Type"]=s)}}});var oa,Bh=oe(()=>{"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 a=this.parseCsvLine(r[s]),l={};n.forEach((f,d)=>{l[f]=a[d]||""}),i.push(l)}return i}parseCsvLine(e){let r=[],n="",i=!1;for(let s=0;s<e.length;s++){let a=e[s],l=e[s+1];a==='"'?i&&l==='"'?(n+='"',s++):i=!i:a===","&&!i?(r.push(n.trim()),n=""):n+=a}return r.push(n.trim()),r}}});import*as Vl from"crypto";var jV,hf,v0=oe(()=>{"use strict";jV=3e4,hf=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 a=await this.secretStore.get(`oauth2_refresh_${n}`);if(a)try{return await this.refreshToken(e,a,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),a=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,a,n);let d=await this.httpService.execute({method:"POST",url:i,headers:f,body:l.toString()}),m=this.parseTokenResponse(d.body,e);m.refreshToken||(m.refreshToken=r);let g=this.buildCacheKeyString(e);return this.tokenCache.set(g,m),m.refreshToken&&await this.storeRefreshToken(g,m.refreshToken),m}async authorizationCodeFlow(e,r){let n=this.resolve(e.authUrl||"",r),i=this.resolve(e.tokenUrl||"",r),s=this.resolve(e.clientId||"",r),a=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,d,m,g;if(f){d=this.generateCodeVerifier();let X=e.pkceMethod||"S256";m=X==="S256"?this.generateCodeChallengeS256(d):d,g=X}let y=e.state||Vl.randomBytes(16).toString("hex"),w=await this.getCallbackUri(),C=new URL(n);if(C.searchParams.set("response_type","code"),C.searchParams.set("client_id",s),C.searchParams.set("redirect_uri",w),l&&C.searchParams.set("scope",l),C.searchParams.set("state",y),m&&(C.searchParams.set("code_challenge",m),C.searchParams.set("code_challenge_method",g)),e.audience&&C.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&C.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[X,P]of Object.entries(e.extraParams))C.searchParams.set(X,this.resolve(P,r));this.pendingAuthCallback&&(this.pendingAuthCallback.reject(new Error("OAuth2 authorization superseded by a new request")),this.pendingAuthCallback=null);let R=new Promise((X,P)=>{this.pendingAuthCallback={resolve:X,reject:P,state:y}});await this.browserService.openExternal(C.toString());let T;try{T=await Promise.race([R,new Promise((X,P)=>setTimeout(()=>{this.pendingAuthCallback=null,P(new Error("OAuth2 authorization timed out after 2 minutes"))},12e4))])}finally{this.pendingAuthCallback=null}if(T.state&&T.state!==y)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let A=new URLSearchParams;A.append("grant_type","authorization_code"),A.append("code",T.code),A.append("redirect_uri",w),d&&A.append("code_verifier",d);let U={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,U,A,s,a,r);let B=await this.httpService.execute({method:"POST",url:i,headers:U,body:A.toString()}),V=this.parseTokenResponse(B.body,e),W=this.buildCacheKeyString(e);return this.tokenCache.set(W,V),V.refreshToken&&await this.storeRefreshToken(W,V.refreshToken),V}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 a=e.state||Vl.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",a),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[w,C]of Object.entries(e.extraParams))f.searchParams.set(w,this.resolve(C,r));this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow superseded by a new request")),this.pendingImplicitCallback=null);let d=new Promise((w,C)=>{this.pendingImplicitCallback={resolve:w,reject:C,state:a}});await this.browserService.openExternal(f.toString());let m;try{m=await Promise.race([d,new Promise((w,C)=>setTimeout(()=>{this.pendingImplicitCallback=null,C(new Error("OAuth2 implicit flow timed out after 2 minutes"))},12e4))])}finally{this.pendingImplicitCallback=null}if(m.state&&m.state!==a)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let g={accessToken:m.accessToken,tokenType:m.tokenType||e.tokenPrefix||"Bearer",expiresAt:m.expiresIn?Date.now()+m.expiresIn*1e3:void 0,raw:{access_token:m.accessToken,token_type:m.tokenType,expires_in:m.expiresIn}},y=this.buildCacheKeyString(e);return this.tokenCache.set(y,g),g}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),a=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 g=this.resolve(e.username||"",r),y=this.resolve(e.password||"",r);if(!g)throw new Error("OAuth2 password grant requires username");f.append("username",g),f.append("password",y)}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[g,y]of Object.entries(e.extraParams))f.append(g,this.resolve(y,r));let d={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,d,f,s,a,r);let m=await this.httpService.execute({method:"POST",url:i,headers:d,body:f.toString()});return this.parseTokenResponse(m.body,e)}applyClientAuth(e,r,n,i,s,a){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){if(!e||typeof e!="object")throw new Error("OAuth2 token response is not a valid JSON object");let n=e,i=r.tokenField||"access_token",s=n[i];if(!s)throw new Error(`OAuth2 token fetch failed: '${i}' not present in response`);let a=typeof n.expires_in=="number"?n.expires_in:void 0;return{accessToken:s,tokenType:n.token_type||r.tokenPrefix||"Bearer",expiresAt:a?Date.now()+a*1e3:void 0,refreshToken:n.refresh_token,scope:n.scope,raw:n}}isExpired(e){return e.expiresAt?Date.now()>=e.expiresAt-jV:!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 Vl.randomBytes(32).toString("base64url")}generateCodeChallengeS256(e){return Vl.createHash("sha256").update(e).digest("base64url")}async storeRefreshToken(e,r){try{await this.secretStore.store(`oauth2_refresh_${e}`,r)}catch{}}}});import*as aa from"fs";import*as Us from"path";function Wl(t,e={}){let r=[];Object.entries(e).forEach(([n,i])=>{r.push(`${n}=${i}`)}),r.length&&aa.writeFileSync(t,r.join(`
|
|
51
|
+
`),"utf-8")}function mf(t,e,r){r&&(r.preRequest&&r.preRequest.trim()&&aa.writeFileSync(Us.join(t,`${e}.pre.js`),r.preRequest,"utf-8"),r.postResponse&&r.postResponse.trim()&&aa.writeFileSync(Us.join(t,`${e}.post.js`),r.postResponse,"utf-8"))}function UV(t,e){let n=e&&e.trim()?e.trim():"collections-rest-client";return Us.isAbsolute(n)?n:Us.join(t,n)}async function HV(t,e,r,n,i){await t.exportCollectionAsRestClientFolder(r,n),e.exportEnvironmentsToFolder(n,i)}function Vh(t,e,r){t.forEach(n=>{if(n.type==="folder"){let i=Us.join(e,It(n.name));aa.mkdirSync(i,{recursive:!0}),mf(i,It(n.name),n.scripts),Vh(n.items||[],i,r)}else if(n.type==="request"){let i=n,s=It(i.name)+".http",a=Us.join(e,s),l=BV(i,r);aa.writeFileSync(a,l,"utf-8"),mf(e,It(i.name),i.scripts)}})}function BV(t,e){let r=[];r.push(`### ${e.name} / ${t.name}`),r.push(`# collection env: ${It(e.name)}.env`),r.push(`# request scripts: ${It(t.name)}.pre.js and .post.js`);let n=VV(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
|
+
`)}function VV(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 Wh=oe(()=>{"use strict";yn()});import*as cr from"fs";import*as b0 from"path";var zl,S0=oe(()=>{"use strict";yn();zl=class{collectionsDir;cache=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}ensureDirectory(){cr.existsSync(this.collectionsDir)||cr.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),!cr.existsSync(this.collectionsDir))return[];let e=cr.readdirSync(this.collectionsDir),r=[];for(let n of e)if(n.endsWith(".json"))try{let i=b0.join(this.collectionsDir,n),s=cr.readFileSync(i,"utf-8"),a=JSON.parse(s);a.id&&a.name&&(this.cache.set(a.id,a),r.push(a))}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(cr.existsSync(r))try{let n=cr.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=ft(e.name));let r=this.getCollectionPath(e.id),n=JSON.stringify(e,null,2);await cr.promises.writeFile(r,n,"utf-8"),this.cache.set(e.id,e)}async delete(e){let r=this.getCollectionPath(e);if(!cr.existsSync(r))return!1;try{return await cr.promises.unlink(r),this.cache.delete(e),!0}catch(n){return console.error(`[JsonCollectionLoader] Failed to delete collection ${e}:`,n),!1}}exists(e){return cr.existsSync(this.getCollectionPath(e))}getCollectionPath(e){return b0.join(this.collectionsDir,`${e}.json`)}getItemPath(e,r){}async create(e,r){let n={id:r||ft(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 a=this.findItemById(i.items,n);if(a&&a.type==="folder")a.items=a.items||[],a.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:a,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 a={...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(a);else return i.items.push(a),!1}else i.items.push(a);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 a=new Map(s.map(f=>[f.id,f])),l=[];for(let f of n){let d=a.get(f);d&&(l.push(d),a.delete(f))}for(let f of a.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 gf,w0=oe(()=>{"use strict";zp();S0();gf=class{static create(e){let r=e.getStorageConfig(),n=e.getCollectionsPath();return r.format==="folder"?new Ts(n):new zl(n)}static createForFormat(e,r){return e==="folder"?new Ts(r):new zl(r)}}});import*as wt from"fs";import*as Gn from"path";function WI(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 WV(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=>zI(e)),event:_0(t.scripts),variable:t.variables?Object.entries(t.variables).map(([e,r])=>({key:e,value:r})):[]}}function zI(t){if(t.type==="folder")return{name:t.name,item:t.items?t.items.map(zI):[],event:_0(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(zV),url:JV(e),body:YV(e),auth:GV(e.auth),description:e.description},event:_0(e.scripts),protocolProfileBehavior:KV(e.settings)}}}function zV(t){return{key:t.key,value:t.value,disabled:t.enabled===!1}}function JV(t){let e=t.url,r=t.url.replace(/^[a-zA-Z]+:\/\//,""),n=[],i=r.match(/^([^\/\?]+)/);if(i){let d=i[1];/^{{.*}}$/.test(d)?n=[d]:n=d.split(".")}let s=[],a=r.match(/^[^\/\?]+(\/[^\?]*)?/);if(a&&a[1]!==void 0){let d=a[1].replace(/^\//,"");d.endsWith("/")?(s=d.slice(0,-1).split("/"),s.push("")):s=d.length>0?d.split("/"):[]}let l;if(Array.isArray(t.query)&&t.query.length>0)l=t.query.map(d=>{let m={key:d.key,value:d.value};return d.enabled===!1&&(m.disabled=!0),m});else{let d=r.indexOf("?");d!==-1&&(l=r.substring(d+1).split("&").map(g=>{let[y,...w]=g.split("=");return{key:y,value:w.join("=")}}))}let f;return t.params&&typeof t.params=="object"&&(f=Object.entries(t.params).map(([d,m])=>({key:d,value:String(m)}))),{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 YV(t){if(!t.body)return;let e=t.body;if(typeof e=="string"){let s=WI(e);return{mode:"raw",raw:e,options:{raw:{language:s}}}}if(e.type==="raw"){let s=e.format||WI(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??"",a=i.variables;return{mode:"graphql",graphql:{query:s,variables:a?typeof a=="string"?a:JSON.stringify(a):void 0}}}if(e.content)return{mode:"raw",raw:e.content}}function GV(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 KV(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 _0(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 yf,R0=oe(()=>{"use strict";yn();Wh();w0();yf=class{constructor(e,r,n){this.workspaceRoot=e;this.configService=r;this.fileWatcherFactory=n;this.collectionsDir=r.getCollectionsPath(),this.loader=gf.create(r),this.ensureCollectionsDir(),this.loadCollections(),this.setupFileWatcher()}workspaceRoot;configService;fileWatcherFactory;collectionsDir;collections=new Map;fileWatcher;loader;debounceTimer=null;localCollectionValues=new Map;onCollectionsChanged;ensureCollectionsDir(){wt.existsSync(this.collectionsDir)||wt.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,this.loadCollections(),this.onCollectionsChanged?.()},200)};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=ft(e.name)),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;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;let s=await this.loader.updateItem(e,r,n);if(s){let a=this.findItemRecursive(i.items,r);if(a){let{id:l,type:f,...d}=n;Object.assign(a,d)}}return s}async addRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;r.id||(r.id=ft(r.name));try{if(await this.loader.saveItem(e,r,n),n){let s=this.findItemRecursive(i.items,n);s&&s.type==="folder"&&(s.items=s.items||[],s.items.push(r))}else i.items.push(r);return!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;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(a=>a.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:ft(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}`);let i=ft(r),s=this.loader.getCollectionPath(e),a=Gn.join(this.collectionsDir,i);if(!wt.existsSync(s))throw new Error(`Collection directory not found: ${s}`);this.copyDirRecursive(s,a);let l=Gn.join(a,"collection.json");if(wt.existsSync(l)){let d=JSON.parse(wt.readFileSync(l,"utf-8"));d.id=i,d.name=r,wt.writeFileSync(l,JSON.stringify(d,null,2))}else wt.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");let n={id:ft(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;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;let s=await this.loader.updateItem(e,r,{name:n});if(s){let a=this.findItemById(i.items,r);a&&(a.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||!wt.existsSync(s))throw new Error(`Folder not found on disk: ${r}`);let a=Gn.dirname(s),l=ft(n),f=Gn.join(a,l);this.copyDirRecursive(s,f);let d=Gn.join(f,"folder.json");if(wt.existsSync(d)){let y=JSON.parse(wt.readFileSync(d,"utf-8"));y.id=l,y.name=n,wt.writeFileSync(d,JSON.stringify(y,null,2))}else wt.writeFileSync(d,JSON.stringify({id:l,name:n,type:"folder"},null,2));let m=this.loader.load(e);m&&this.collections.set(e,m);let g=this.findItemById(m?.items||[],l);return g||{id:l,type:"folder",name:n,items:[]}}async createRequest(e){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");let n={id:e.id||ft(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};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;let s=await this.loader.updateItem(e,r,{name:n});if(s){let a=this.findItemById(i.items,r);a&&(a.name=n)}return s}async moveItem(e,r,n){if(!this.collections.get(e))return!1;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;let s=await this.loader.reorderItems(e,r,n);return s&&this.loadCollections(),s}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){wt.existsSync(r)||wt.mkdirSync(r,{recursive:!0});for(let n of wt.readdirSync(e,{withFileTypes:!0})){let i=Gn.join(e,n.name),s=Gn.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):wt.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=wt.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||ft(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=d=>{if(!d)return;switch(d.type?.toLowerCase()){case"bearer":return{type:"bearer",bearerToken:d.bearer?.find(A=>A.key==="token")?.value||""};case"basic":let y=d.basic?.find(A=>A.key==="username"),w=d.basic?.find(A=>A.key==="password");return{type:"basic",basicAuth:{username:y?.value||"",password:w?.value||""}};case"apikey":let C=d.apikey?.find(A=>A.key==="key"),R=d.apikey?.find(A=>A.key==="value"),T=d.apikey?.find(A=>A.key==="in");return{type:"apikey",apikey:{key:C?.value||"",value:R?.value||"",in:T?.value||"header"}};case"noauth":return{type:"none"};default:return}},n=d=>{if(!Array.isArray(d)||d.length===0)return;let m={};for(let g of d){let y=g.script?.exec;if(!y)continue;let w=Array.isArray(y)?y.join(`
|
|
53
|
+
`):y;g.listen==="prerequest"?m.preRequest=w:g.listen==="test"&&(m.postResponse=w)}return m.preRequest||m.postResponse?m:void 0},i=d=>{if(!d||typeof d!="object")return;let m={};return d.followRedirects===!1&&(m.followRedirects=!1),d.followOriginalHttpMethod===!0&&(m.followOriginalMethod=!0),d.followAuthorizationHeader===!1&&(m.followAuthHeader=!1),d.maxRedirects!==void 0&&(m.maxRedirects=d.maxRedirects),d.requestTimeout!==void 0&&(m.timeout=d.requestTimeout),Object.keys(m).length>0?m:void 0},s=d=>{if(!d||typeof d=="string")return;let m=d.query;if(!(!Array.isArray(m)||m.length===0))return m.map(g=>({key:g.key||"",value:g.value||"",enabled:g.disabled!==!0}))},a=d=>{if(typeof d=="string")return d;if(!d)return"";let m=new Set;if(Array.isArray(d.variable))for(let y of d.variable)y.key&&m.add(y.key);if(m.size===0&&d.raw)return d.raw;let g="";if(d.protocol&&(g+=d.protocol+"://"),d.host&&(g+=Array.isArray(d.host)?d.host.join("."):d.host),d.port&&(g+=":"+d.port),d.path){let w=(Array.isArray(d.path)?d.path:[d.path]).map(C=>{let R=C.startsWith(":")?C.substring(1):C;return m.has(R)?":"+R:(C.startsWith(":"),C)});g+="/"+w.join("/")}return!g&&d.raw?d.raw:g},l=d=>d.map(m=>{if(m.item)return{id:ft(m.name),type:"folder",name:m.name,description:m.description,auth:r(m.auth),scripts:n(m.event),items:l(m.item)};{let g=m.request||{};return{id:ft(m.name),type:"request",name:m.name,description:m.description||g.description,method:typeof g.method=="string"?g.method:"GET",url:a(g.url),query:s(g.url),headers:Array.isArray(g.header)?g.header.map(y=>({key:y.key||y.name||"",value:y.value||y.value||"",enabled:y.disabled!==!0})):[],body:(()=>{let y=g.body;if(y){if(y.mode==="raw"&&y.raw){let w=y.options?.raw?.language;return{type:"raw",format:w==="xml"?"xml":w==="html"?"html":w==="javascript"?"javascript":w==="text"?"text":"json",content:y.raw}}if(y.mode==="urlencoded"&&Array.isArray(y.urlencoded))return{type:"x-www-form-urlencoded",content:y.urlencoded.map(w=>({key:w.key||"",value:w.value||"",enabled:w.disabled!==!0}))};if(y.mode==="formdata"&&Array.isArray(y.formdata))return{type:"form-data",content:y.formdata.map(w=>({key:w.key||"",value:w.value||"",type:w.type||"text",enabled:w.disabled!==!0}))};if(y.mode==="graphql"&&y.graphql){let w;if(y.graphql.variables)try{w=JSON.parse(y.graphql.variables)}catch{w=void 0}return{type:"graphql",content:{query:y.graphql.query||"",variables:w}}}if(y.mode==="binary")return{type:"binary",content:""}}})(),auth:r(g.auth),scripts:n(m.event),settings:i(m.protocolProfileBehavior)}}}),f={id:ft(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),items:l(e.item||[])};return await this.saveCollection(f),f}async exportCollection(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=WV(n),s=JSON.stringify(i,null,2);wt.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=Gn.join(r,It(n.name));wt.mkdirSync(i,{recursive:!0});let s=n.variables||{};Wl(Gn.join(i,`${It(n.name)}.env`),s),mf(i,It(n.name),n.scripts),Vh(n.items,i,n)}dispose(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.fileWatcher?.dispose()}}});var Vt,Jl,la,x0=oe(()=>{"use strict";Vt={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:{excludedCollections:[],excludedSuites:[],toolPrefix:"",maxRequestsPerCall:50,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"}}}},Jl={config:"http-forge.config.json"},la={collections:"collections",environments:"environments",flows:"flows",suites:"suites"}});import*as Lr from"fs";import*as Rn from"path";var Yl,C0=oe(()=>{"use strict";x0();Yl=class{constructor(e,r,n){this.workspacePath=e;this.fileWatcherFactory=r;this.notifications=n;this.configPath=Rn.join(e,Jl.config),this.config=this.loadConfig(),this.setupFileWatcher()}workspacePath;fileWatcherFactory;notifications;config;configPath;fileWatcher;loadConfig(){if(!Lr.existsSync(this.configPath))return{...Vt};try{let e=Lr.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 ${Jl.config}. Using default configuration.`),{...Vt}}}mergeWithDefaults(e){return{version:e.version??Vt.version,storage:{...Vt.storage,...e.storage},request:{...Vt.request,...e.request},scripts:{...Vt.scripts,...e.scripts},runner:{...Vt.runner,...e.runner},environments:{...Vt.environments,...e.environments},restClientExport:{...Vt.restClientExport,...e.restClientExport},proxy:e.proxy!==void 0?e.proxy:Vt.proxy,mcp:{...Vt.mcp,...e.mcp,cors:{...Vt.mcp.cors,...e.mcp?.cors}},secrets:{...Vt.secrets,...e.secrets,providers:{...Vt.secrets?.providers,...e.secrets?.providers}}}}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.workspacePath,Jl.config);let e=()=>{this.reload()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}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 Rn.isAbsolute(e)?e:this.resolvePath(e)}getRestClientMergeGlobals(){return this.config.restClientExport?.mergeGlobals??!0}getProxyConfig(){return this.config.proxy??null}getMcpConfig(){return this.config.mcp??Vt.mcp}resolvePath(e){let r=e.startsWith("./")?e.slice(2):e;return Rn.join(this.workspacePath,...r.split("/"))}getRootPath(){return this.resolvePath(this.config.storage.root)}getCollectionsPath(){return Rn.join(this.getRootPath(),la.collections)}getEnvironmentsPath(){return Rn.join(this.getRootPath(),la.environments)}getFlowsPath(){return Rn.join(this.getRootPath(),la.flows)}getHistoryPath(){return this.resolvePath(this.config.storage.history)}getResultsPath(){return this.resolvePath(this.config.storage.results)}getSuitesPath(){return Rn.join(this.getRootPath(),la.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.config=this.loadConfig()}configExists(){return Lr.existsSync(this.configPath)}async createDefaultConfig(){let e=JSON.stringify(Vt,null,2);await Lr.promises.writeFile(this.configPath,e,"utf-8");let r=[this.getCollectionsPath(),this.getEnvironmentsPath(),this.getFlowsPath(),this.getSuitesPath()];for(let i of r)Lr.existsSync(i)||await Lr.promises.mkdir(i,{recursive:!0});let n=[this.getHistoryPath(),this.getResultsPath()];for(let i of n)Lr.existsSync(i)||await Lr.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 Lr.promises.writeFile(Rn.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 Lr.promises.writeFile(Rn.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 Lr.promises.writeFile(Rn.join(e,"default-headers.json"),JSON.stringify(i,null,2),"utf-8")}dispose(){this.fileWatcher?.dispose()}}});var QV,vf,E0=oe(()=>{"use strict";Sl();QV="httpForge.cookies",vf=class{constructor(e,r=QV){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),a=this.cookies.get(s);if(a&&!this.isExpired(a))return a}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 dt.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 dt.parseCookieHeaders(e,r)}isExpired(e){return dt.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 dt.domainMatches(e,r)}get count(){return this.cookies.size}}});var bf,O0=oe(()=>{"use strict";Sl();bf=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 a=this.localCache.findIndex(l=>l.name===s.name&&l.domain===(s.domain||n));a>=0?this.localCache[a]=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=>!(dt.isExpired(s)||s.domain&&!dt.domainMatches(r,s.domain)||!s.domain||s.path&&!n.startsWith(s.path)));if(i.length!==0)return dt.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 zh(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,d=typeof l.enabled=="boolean"?l.enabled:!0;f&&d!==!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 a=r._postman_exported_at?"Imported from Postman export":r.description||"";return{name:n,variables:s,description:a}}catch{return null}}async function ZV(t,e){try{let r=await e.readFile(t);return zh(r)}catch{return null}}var I0=oe(()=>{"use strict"});import*as Wt from"fs";import*as nn from"path";var Sf,wf,P0=oe(()=>{"use strict";yn();I0();Wh();Gp();Eu();Sf={SELECTED_ENVIRONMENT:"httpForge.selectedEnvironment",ENV_OVERRIDES_PREFIX:"httpForge.envOverrides."},wf=class{constructor(e,r,n,i,s){this.workspaceFolder=e;this.workspaceStore=r;this.configService=n;this.fileWatcherFactory=i;this.secretStore=s;let a=n.getEnvironmentsPath();this.environmentsPath=a,this.sharedConfigPath=nn.join(a,"_global.json"),this.localConfigPath=nn.join(a,"_global.local.json"),this.historiesPath=n.getHistoryPath(),this.selectedEnvironment=r.get(Sf.SELECTED_ENVIRONMENT,"dev")??"dev",this.localGlobalValues={},this.localEnvironmentValues=new Map,this.loadPersistedEnvironmentOverrides(),this.loadSecretVariables(this.selectedEnvironment).catch(()=>{}),this.setupFileWatcher()}workspaceFolder;workspaceStore;configService;fileWatcherFactory;secretStore;environmentsPath;sharedConfigPath;localConfigPath;historiesPath;sharedConfig=null;localConfig=null;selectedEnvironment="dev";fileWatcher;localGlobalValues={};localEnvironmentValues=new Map;secretValuesCache=new Map;onEnvironmentsChanged;setupFileWatcher(){if(!this.fileWatcherFactory||!Wt.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(!Wt.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(Sf.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`${Sf.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){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.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],a=i?.credentials?.[r],l=i?.variables||{},f=a?.variables||{},d=a&&a.headers||{},m=yu(n.defaultHeaders||{},d),g=this.localEnvironmentValues.get(r)||{},y=this.secretValuesCache.get(r)||{},w={...n.globalVariables||{},...s.variables||{},...l,...f,...g,...y};return{name:r,description:s.description,requiresConfirmation:s.requiresConfirmation,headers:m,variables:w}}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 a=await this.secretStore.get(`${r}:${s}`);a!==void 0&&(i[s]=a)})),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 a=nn.join(e,"globals.env");Wl(a,s)}n.forEach(a=>{let l=i?.environments?.[a];if(!l)return;let f={...l.variables||{}};r&&(f={...s,...f});let d=nn.join(e,`${It(a)}.env`);Wl(d,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 nn.join(this.environmentsPath,`${e}.json`)}localConfigExists(){return Wt.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),a={variables:i.variables||{}};this.saveJsonFile(s,a)}this.localConfig=e}importPostmanEnvironmentFile(e){try{let r=Wt.readFileSync(e,"utf-8"),n=zh(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 nn.join(this.environmentsPath,`${e}.local.json`)}loadFolderConfigs(){let e=_u(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||{}};return new Bo({globals:{},collectionVariables:{},environmentVariables:s,variables:{}})}saveFolderSharedConfig(e){Wt.existsSync(this.environmentsPath)||Wt.mkdirSync(this.environmentsPath,{recursive:!0});let r={variables:e.globalVariables||{},defaultHeaders:e.defaultHeaders||{}};this.saveJsonFile(this.sharedConfigPath,r);let n=Wt.readdirSync(this.environmentsPath).filter(s=>s.endsWith(".json")).filter(s=>!Yp(s)),i=new Set(Object.keys(e.environments||{}));for(let s of n){let a=nn.basename(s,".json");if(!i.has(a))try{Wt.unlinkSync(nn.join(this.environmentsPath,s))}catch{}}for(let[s,a]of Object.entries(e.environments||{})){let l={name:s,description:a.description,requiresConfirmation:a.requiresConfirmation,variables:a.variables||{}};this.saveJsonFile(nn.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(Sf.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(Sf.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(!Wt.existsSync(e))return null;let r=Wt.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=nn.dirname(e);Wt.existsSync(n)||Wt.mkdirSync(n,{recursive:!0}),Wt.writeFileSync(e,JSON.stringify(r,null,2),"utf-8")}catch(n){throw console.error(`Failed to save JSON to ${e}:`,n),n}}}});var Hs,Jh=oe(()=>{"use strict";Uh();Hs=class t{constructor(e,r,n,i,s,a,l,f,d,m,g,y){this.httpService=e;this.scriptExecutor=r;this.envConfigService=n;this.requestPreparer=i;this.environment=s;this.cookieJar=a;this.collectionScripts=l;this.folderScriptsChain=f;this.onConsoleOutput=d;this.collectionName=m;this.iteration=g;this.iterationCount=y}httpService;scriptExecutor;envConfigService;requestPreparer;environment;cookieJar;collectionScripts;folderScriptsChain;onConsoleOutput;collectionName;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),a=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(),d={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(y,w,C)=>{y==="set"&&w&&C!==void 0?this.envConfigService.setEnvironmentVariable(w,C,this.environment):y==="unset"&&w?this.envConfigService.deleteEnvironmentVariable(w,this.environment):y==="clear"&&this.envConfigService.clearEnvironmentVariables(this.environment)},onGlobalsChange:(y,w,C)=>{y==="set"&&w&&C!==void 0?this.envConfigService.setGlobalVariable(w,C):y==="unset"&&w?this.envConfigService.deleteGlobalVariable(w):y==="clear"&&this.envConfigService.clearGlobalVariables()}},m=this.scriptExecutor.createRequestSession(d),g=null;try{let y={...r},w={...e},C;if(s.length>0){let $=await m.executePreRequest(s);if($.consoleOutput&&$.consoleOutput.length>0&&this.onConsoleOutput?.($.consoleOutput),$.nextRequest!==void 0&&(C=$.nextRequest),$.skipRequest){let Y={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:e.url||"",method:e.method||"GET",headers:{},body:Y,params:{},query:{}},response:{status:0,statusText:"Skipped",headers:{},body:null,time:0,cookies:[]},duration:Date.now()-i,timestamp:Date.now(),passed:!0,assertions:[],modifiedVariables:y,nextRequest:C}}$.success&&($.modifiedRequest&&($.modifiedRequest.url&&(w.url=$.modifiedRequest.url),$.modifiedRequest.headers&&(w.headers=$.modifiedRequest.headers),$.modifiedRequest.params&&(w.params=$.modifiedRequest.params),$.modifiedRequest.query&&(w.query=$.modifiedRequest.query),$.modifiedRequest.body!==void 0&&(w.body=$.modifiedRequest.body)),$.modifiedVariables&&(y=$.modifiedVariables))}g=await this.requestPreparer.prepareRequest(w,this.environment,l,y);let{url:R,headers:T,body:A,method:U}=g,B={};for(let $ in T)Object.prototype.hasOwnProperty.call(T,$)&&(B[$.toUpperCase()]=T[$]);if(!B.COOKIE&&w.settings?.includeCookies!==!1&&this.cookieJar){let Y=this.cookieJar.getCookieHeader(R);Y&&(B.COOKIE=Y)}let V={method:U,url:R,headers:B,body:A.content,signal:n,settings:w.settings?{timeout:w.settings.timeout,followRedirects:w.settings.followRedirects,maxRedirects:w.settings.maxRedirects,strictSSL:w.settings.strictSSL}:void 0},W=await this.httpService.execute(V);this.cookieJar&&W.headers&&await this.cookieJar.setCookiesFromResponse(R,W.headers);let X=Date.now()-i,P=[],_={},k;if(a.length>0){let $=0;if(W.body)if(typeof W.body=="string")$=Buffer.byteLength(W.body,"utf8");else if(Buffer.isBuffer(W.body))$=W.body.length;else try{$=Buffer.byteLength(JSON.stringify(W.body),"utf8")}catch{$=0}let Y={};W.cookies&&Array.isArray(W.cookies)&&W.cookies.forEach(ue=>{ue.name&&(Y[ue.name]=ue.value)});let K={executedRequest:g,status:W.status,statusText:W.statusText,headers:d0(W.headers||{}),body:W.body,cookies:Y,responseTime:W.time,responseSize:$},ne=await m.executePostResponse(a,K);P=ne.testResults,_=ne.modifiedEnvironmentVariables||{},k=ne.visualizerData,ne.nextRequest!==void 0&&(C=ne.nextRequest),ne.consoleOutput&&ne.consoleOutput.length>0&&this.onConsoleOutput?.(ne.consoleOutput)}let M=P.length===0||P.every($=>$.passed),j=P.length>0?M:W.status>=200&&W.status<=302;return{requestId:e.id,name:e.name,executedRequest:{...g,headers:B},response:{status:W.status,statusText:W.statusText,headers:W.headers||{},body:W.body,time:W.time||X,cookies:W.cookies||[]},duration:X,timestamp:Date.now(),passed:j,assertions:P,modifiedVariables:y,modifiedEnvironmentVariables:_,nextRequest:C,visualizerData:k}}catch(y){return this.handleError(e,g,y,i)}finally{m.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,a=r?.method||e.method,l=r?.url||e.url;this.onConsoleOutput?.([`[error] ${e.name}: ${n.message||n}`]);let f=String(n.name==="AbortError"?"Request was aborted":n.message||n),d=n?.stack?String(n.stack):"",m=this.errorBodyFormat,g,y;m==="html"||m==="both"?(g=t.formatErrorAsHtml(f,d),y={"content-type":"text/html; charset=utf-8"}):(g=f,y={});let w={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:l||"",method:a||"GET",headers:r?.headers||{},body:r?.body||w,params:r?.params||{},query:r?.query||{}},response:{status:0,statusText:n.name==="AbortError"?"Aborted":n.code||n.message||"Request Error",headers:y,cookies:[],body:g,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,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");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>
|
|
@@ -59,7 +59,7 @@ ${i}
|
|
|
59
59
|
${n(r)}
|
|
60
60
|
</pre>`:""}
|
|
61
61
|
</body>
|
|
62
|
-
</html>`}}});var _f,k0=
|
|
62
|
+
</html>`}}});var _f,k0=oe(()=>{"use strict";yn();_f=class{constructor(e,r,n,i,s,a){this.envConfigService=e;this.httpService=r;this.preprocessor=n;this.tokenManager=i;this.appInfo=s;this.secretRegistry=a}envConfigService;httpService;preprocessor;tokenManager;appInfo;secretRegistry;async prepareRequest(e,r,n,i){if(this.secretRegistry?.hasProviders){let A=await this.secretRegistry.resolveSecretTokens(e);Object.keys(A).length>0&&(i={...A,...i??{}})}let s=i&&Object.keys(i).length>0,a=s?this.envConfigService.resolveVariablesInObjectWithExtra(e.params||{},i,r):this.envConfigService.resolveVariablesInObject(e.params||{},r),l=s?this.envConfigService.resolveVariablesInObjectWithExtra(e.query||{},i,r):this.envConfigService.resolveVariablesInObject(e.query||{},r),f=yu(n?.headers||{},e.headers||{}),d=s?this.envConfigService.resolveVariablesInObjectWithExtra(f,i,r):this.envConfigService.resolveVariablesInObject(f,r);if(d=this.preprocessor.sanitizeHeaders(d),!Object.keys(d).some(A=>A.toLowerCase()==="user-agent")){let A=this.appInfo?.version||"0.0.0",U=this.appInfo?.name||"HttpForge";d["User-Agent"]=`${U}/${A}`}if(e.auth?.type==="bearer"&&e.auth.bearerToken){let A=s?this.envConfigService.resolveVariablesWithExtra(e.auth.bearerToken,i,r):this.envConfigService.resolveVariables(e.auth.bearerToken,r);d.Authorization=`Bearer ${A}`}if(e.auth?.type==="basic"&&e.auth.basicAuth){let A=s?this.envConfigService.resolveVariablesWithExtra(e.auth.basicAuth.username||"",i,r):this.envConfigService.resolveVariables(e.auth.basicAuth.username||"",r),U=s?this.envConfigService.resolveVariablesWithExtra(e.auth.basicAuth.password||"",i,r):this.envConfigService.resolveVariables(e.auth.basicAuth.password||"",r),B=Buffer.from(`${A}:${U}`).toString("base64");d.Authorization=`Basic ${B}`}e.auth?.type==="apikey"&&e.auth.apikey&&this.applyApiKey(e.auth.apikey,d,l,r,i),e.auth?.type==="oauth2"&&e.auth.oauth2&&await this.applyOAuth2(e.auth.oauth2,d,r);let g=null;if(e.body&&e.body.type!=="none"){let A=i&&Object.keys(i).length>0?this.envConfigService.resolveVariablesInObjectWithExtra(e.body.content,i,r):this.envConfigService.resolveVariablesInObject(e.body.content,r);if((e.body.format==="json"||e.body.type==="graphql")&&typeof A=="string")try{A=JSON.parse(A)}catch{e.body.format==="json"&&console.warn("[RequestPreparer] Failed to parse JSON body after variable resolution, keeping as string")}let U={type:e.body.type,format:e.body.format,content:A};g=this.preprocessor.encodeBody(U)}this.preprocessor.setContentTypeHeader(d,e.body,e.bodyContentType);let y=e.method||"GET",w=e.url||"",C=i&&Object.keys(i).length>0?this.envConfigService.resolveVariablesWithExtra(w,i,r):this.envConfigService.resolveVariables(w,r),R=this.httpService.buildUrl(C,a,l),T={type:e.body?.type||"none",format:e.body?.format,content:g};return{url:R,method:y,headers:d,body:T,params:a,query:l}}async applyOAuth2(e,r,n){if(e.accessToken){let s=this.envConfigService.resolveVariables(e.accessToken,n),a=e.tokenPrefix||"Bearer";r.Authorization=`${a} ${s}`;return}if(!this.tokenManager)throw new Error("OAuth2 authentication requires IOAuth2TokenManager. Ensure the service is properly registered.");let i=await this.tokenManager.getToken(e,n);r.Authorization=`${i.tokenType} ${i.accessToken}`}applyApiKey(e,r,n,i,s){if(!e||!e.key)return;let a=s&&Object.keys(s).length>0,l=a?this.envConfigService.resolveVariablesWithExtra(e.key||"",s,i):this.envConfigService.resolveVariables(e.key||"",i),f=a?this.envConfigService.resolveVariablesWithExtra(e.value||"",s,i):this.envConfigService.resolveVariables(e.value||"",i);(e.in||"header").toLowerCase()==="query"?n[l]=f:r[l]=f}}});var XV,Rf,T0=oe(()=>{"use strict";XV=`
|
|
63
63
|
query IntrospectionQuery {
|
|
64
64
|
__schema {
|
|
65
65
|
queryType { name }
|
|
@@ -87,216 +87,216 @@ fragment TypeRef on __Type {
|
|
|
87
87
|
kind name
|
|
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
|
-
`.trim(),Rf=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:
|
|
91
|
-
`),i=/^\s*(query|mutation|subscription)\s+(\w+)/;for(let s=0;s<n.length;s++){let
|
|
92
|
-
`))return
|
|
93
|
-
`)){try{let n=new URLSearchParams(r);for(let[i,s]of n)sn.test(i)&&s&&!ur(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=>Yh(r,e));return}if(typeof t=="object")for(let[r,n]of Object.entries(t))sn.test(r)&&n&&typeof n=="string"&&!ur(n)?e.push({location:"body",field:r,message:`Body field "${r}" contains a hardcoded value. Use a {{variable}} instead.`}):typeof n=="object"&&n!==null&&Yh(n,e)}}function ca(t){return t.replace(/\./g,"_").replace(/[^a-zA-Z0-9_]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"").toLowerCase()}function
|
|
94
|
-
`)){try{let s=new URLSearchParams(i);for(let[
|
|
95
|
-
`)){let f=new URLSearchParams(l);if(f.get(e)===n){f.set(e,i);let d=f.toString();s?s.content=d:t.body=d}return}return}typeof o=="object"&&o!==null&&WI(o,e,r||e,n,i)}}function WI(t,e,r,n,i){let s=r.split("."),o=t;for(let f=0;f<s.length-1;f++){let d=s[f],m=d.match(/^(.+)\[(\d+)\]$/);if(m?o=o?.[m[1]]?.[parseInt(m[2])]:o=o?.[d],o==null)return}let l=s[s.length-1];o&&o[l]===n&&(o[l]=i)}function iW(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var ua,A0,sn,XV,xf=ae(()=>{"use strict";ua="***",A0=/^(authorization|proxy-authorization|www-authenticate)$|(token|cookie|secret|credential|api[_\-]?key|bearer|session[_\-]?id)/i,sn=/(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;XV=/\{\{[^}]+\}\}/});import*as ke from"fs";import*as jr from"path";var Cf,F0=ae(()=>{"use strict";yn();xf();Cf=class{historyPath;sharedHistoryPath;constructor(e,r){this.historyPath=e,this.sharedHistoryPath=r}getEnvironmentHistoryPath(e){return jr.join(this.historyPath,It(e))}getCollectionHistoryPath(e,r){return jr.join(this.getEnvironmentHistoryPath(e),r)}getRequestPath(e,r,n){return jr.join(this.getCollectionHistoryPath(e,r),It(n))}getSharedEnvironmentHistoryPath(e){return jr.join(this.sharedHistoryPath,It(e))}getSharedCollectionHistoryPath(e,r){return jr.join(this.getSharedEnvironmentHistoryPath(e),r)}getSharedRequestPath(e,r,n){return jr.join(this.getSharedCollectionHistoryPath(e,r),It(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(!ke.existsSync(i))return null;let s=ke.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(!ke.existsSync(i))return null;let s=ke.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{ke.existsSync(r)||ke.mkdirSync(r,{recursive:!0}),ke.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{ke.existsSync(r)||ke.mkdirSync(r,{recursive:!0}),ke.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=M0({...s,method:i,id:lb(),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 ke.existsSync(l)&&ke.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 ke.existsSync(l)&&ke.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(w=>w.id===i);if(f===-1)return!1;let[d]=l.requests.splice(f,1);this.saveHistory(l);let m=this.loadSharedHistory(e,r,n)||{environment:e,requestPath:r,requestId:n,method:l.method,requests:[]};if(!m.requests.some(w=>w.id===i)){let w={...d,ticket:null,branch:o};m.requests.unshift(w),m.requests.length>100&&(m.requests=m.requests.slice(0,100)),this.saveSharedHistory(m)}let g=this.getResponseFilePath(e,r,n,i),y=this.getSharedResponseFilePath(e,r,n,i);if(ke.existsSync(g)){let w=jr.dirname(y);ke.existsSync(w)||ke.mkdirSync(w,{recursive:!0});try{ke.renameSync(g,y)}catch{try{ke.copyFileSync(g,y)}catch(R){return console.error(`Failed to copy full response from ${g} to ${y}:`,R),!0}try{ke.unlinkSync(g)}catch(R){console.warn(`Failed to remove original full response after copy: ${g}`,R)}}}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(d=>d.id===i?(f=!0,{...d,ticket:null,branch:o}):d),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 d=!1;return f.requests=f.requests.map(m=>!m.ticket&&m.branch===o?(d=!0,{...m,branch:l}):m),d?(this.saveSharedHistory(f),!0):!1}clearHistory(e,r,n){let i=this.getRequestPath(e,r,n);if(ke.existsSync(i)){let s=ke.readdirSync(i);for(let o of s)ke.unlinkSync(jr.join(i,o));ke.rmdirSync(i)}}saveFullResponse(e,r,n,i,s){let o=this.getRequestPath(e,r,n),l=this.getResponseFilePath(e,r,n,i);try{ke.existsSync(o)||ke.mkdirSync(o,{recursive:!0});let f=N0(s);ke.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(!ke.existsSync(s))return null;let o=ke.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(!ke.existsSync(s))return null;let o=ke.readFileSync(s,"utf-8");return JSON.parse(o)}catch(o){return console.error(`Failed to load shared full response for ${i}:`,o),null}}}});var Gl,L0=ae(()=>{"use strict";Gl=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 d=f.slice(0,s),m=new Map;for(let y of d){let w=this.historyService.loadFullResponse(i,e,r,y.id);if(w||(w=this.historyService.loadSharedFullResponse(i,e,r,y.id)),w){let C=w.status;m.has(C)||m.set(C,[]),m.get(C).push(w)}}let g={};for(let[y,w]of m){let C=this.buildResponseDefinition(w);g[String(y)]=C}return{responses:g}}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,d]of Object.entries(l.headers)){let m=f.toLowerCase();r.has(m)||(n.set(m,(n.get(m)||0)+1),i.has(m)||i.set(m,Array.isArray(d)?d.join(", "):d))}let s=Math.ceil(e.length/2),o={};for(let[l,f]of n)if(f>=s){let d=i.get(l);o[l]={schema:this.inferHeaderSchema(d)}}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 Je=F(rr=>{"use strict";var j0=Symbol.for("yaml.alias"),zI=Symbol.for("yaml.document"),Zh=Symbol.for("yaml.map"),JI=Symbol.for("yaml.pair"),U0=Symbol.for("yaml.scalar"),Xh=Symbol.for("yaml.seq"),Xi=Symbol.for("yaml.node.type"),sW=t=>!!t&&typeof t=="object"&&t[Xi]===j0,oW=t=>!!t&&typeof t=="object"&&t[Xi]===zI,aW=t=>!!t&&typeof t=="object"&&t[Xi]===Zh,lW=t=>!!t&&typeof t=="object"&&t[Xi]===JI,YI=t=>!!t&&typeof t=="object"&&t[Xi]===U0,cW=t=>!!t&&typeof t=="object"&&t[Xi]===Xh;function GI(t){if(t&&typeof t=="object")switch(t[Xi]){case Zh:case Xh:return!0}return!1}function uW(t){if(t&&typeof t=="object")switch(t[Xi]){case j0:case Zh:case U0:case Xh:return!0}return!1}var fW=t=>(YI(t)||GI(t))&&!!t.anchor;rr.ALIAS=j0;rr.DOC=zI;rr.MAP=Zh;rr.NODE_TYPE=Xi;rr.PAIR=JI;rr.SCALAR=U0;rr.SEQ=Xh;rr.hasAnchor=fW;rr.isAlias=sW;rr.isCollection=GI;rr.isDocument=oW;rr.isMap=aW;rr.isNode=uW;rr.isPair=lW;rr.isScalar=YI;rr.isSeq=cW});var Ef=F(H0=>{"use strict";var zt=Je(),Ur=Symbol("break visit"),KI=Symbol("skip children"),wi=Symbol("remove node");function em(t,e){let r=QI(e);zt.isDocument(t)?Kl(null,t.contents,r,Object.freeze([t]))===wi&&(t.contents=null):Kl(null,t,r,Object.freeze([]))}em.BREAK=Ur;em.SKIP=KI;em.REMOVE=wi;function Kl(t,e,r,n){let i=ZI(t,e,r,n);if(zt.isNode(i)||zt.isPair(i))return XI(t,n,i),Kl(t,i,r,n);if(typeof i!="symbol"){if(zt.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let o=Kl(s,e.items[s],r,n);if(typeof o=="number")s=o-1;else{if(o===Ur)return Ur;o===wi&&(e.items.splice(s,1),s-=1)}}}else if(zt.isPair(e)){n=Object.freeze(n.concat(e));let s=Kl("key",e.key,r,n);if(s===Ur)return Ur;s===wi&&(e.key=null);let o=Kl("value",e.value,r,n);if(o===Ur)return Ur;o===wi&&(e.value=null)}}return i}async function tm(t,e){let r=QI(e);zt.isDocument(t)?await Ql(null,t.contents,r,Object.freeze([t]))===wi&&(t.contents=null):await Ql(null,t,r,Object.freeze([]))}tm.BREAK=Ur;tm.SKIP=KI;tm.REMOVE=wi;async function Ql(t,e,r,n){let i=await ZI(t,e,r,n);if(zt.isNode(i)||zt.isPair(i))return XI(t,n,i),Ql(t,i,r,n);if(typeof i!="symbol"){if(zt.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let o=await Ql(s,e.items[s],r,n);if(typeof o=="number")s=o-1;else{if(o===Ur)return Ur;o===wi&&(e.items.splice(s,1),s-=1)}}}else if(zt.isPair(e)){n=Object.freeze(n.concat(e));let s=await Ql("key",e.key,r,n);if(s===Ur)return Ur;s===wi&&(e.key=null);let o=await Ql("value",e.value,r,n);if(o===Ur)return Ur;o===wi&&(e.value=null)}}return i}function QI(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 ZI(t,e,r,n){if(typeof r=="function")return r(t,e,n);if(zt.isMap(e))return r.Map?.(t,e,n);if(zt.isSeq(e))return r.Seq?.(t,e,n);if(zt.isPair(e))return r.Pair?.(t,e,n);if(zt.isScalar(e))return r.Scalar?.(t,e,n);if(zt.isAlias(e))return r.Alias?.(t,e,n)}function XI(t,e,r){let n=e[e.length-1];if(zt.isCollection(n))n.items[t]=r;else if(zt.isPair(n))t==="key"?n.key=r:n.value=r;else if(zt.isDocument(n))n.contents=r;else{let i=zt.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}H0.visit=em;H0.visitAsync=tm});var B0=F(tP=>{"use strict";var eP=Je(),dW=Ef(),pW={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},hW=t=>t.replace(/[!,[\]{}]/g,e=>pW[e]),Of=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+hW(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&&eP.isNode(e.contents)){let s={};dW.visit(e.contents,(o,l)=>{eP.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
|
-
`)}};Of.defaultYaml={explicit:!1,version:"1.2"};Of.defaultTags={"!!":"tag:yaml.org,2002:"};
|
|
90
|
+
`.trim(),Rf=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:XV,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 a=this.parseSchema(s.data.__schema,e);return this.schemaCache.set(e,a),a}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 a=n[s].match(i);a&&r.push({type:a[1],name:a[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 a={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(a.name,a)}let i=(e.directives||[]).map(s=>({name:s.name,description:s.description||void 0,locations:s.locations||[],args:(s.args||[]).map(a=>this.parseArg(a))}));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 Zi(t){let e={};for(let[r,n]of Object.entries(t))A0.test(r)?e[r]=Array.isArray(n)?n.map(()=>ua):ua:e[r]=n;return e}function q0(t=[]){return t.map(e=>e&&typeof e=="object"&&e.name&&sn.test(e.name)?{...e,value:ua}:e)}function Kh(t){try{let e=new URL(t),r=!1;for(let[n]of e.searchParams)sn.test(n)&&(e.searchParams.set(n,ua),r=!0);return r?e.toString():t}catch{return t}}function Qh(t){if(t==null)return t;if(Array.isArray(t))return t.map(r=>Qh(r));if(typeof t!="object")return t;let e={};for(let[r,n]of Object.entries(t))sn.test(r)?e[r]=ua:typeof n=="object"&&n!==null?e[r]=Qh(n):e[r]=n;return e}function eW(t){try{let e=new URLSearchParams(t),r=!1;for(let[n]of e)sn.test(n)&&(e.set(n,ua),r=!0);return r?e.toString():t}catch{return t}}function $0(t){if(t==null)return t;if(typeof t=="object"&&!Buffer.isBuffer(t))return Qh(t);if(typeof t=="string"){let e=t.trim();if(e.startsWith("{")||e.startsWith("["))try{let r=JSON.parse(e),n=Qh(r);return JSON.stringify(n)}catch{}if(e.includes("=")&&!e.includes(`
|
|
92
|
+
`))return eW(e)}return t}function M0(t){return{...t,sentRequest:{...t.sentRequest,url:Kh(t.sentRequest.url),headers:Zi(t.sentRequest.headers),body:t.sentRequest.body!=null?$0(t.sentRequest.body):t.sentRequest.body}}}function N0(t){return{...t,headers:Zi(t.headers),cookies:t.cookies.map(e=>e&&typeof e=="object"&&e.name&&sn.test(e.name)?{...e,value:ua}:e)}}function D0(t){return{...t,url:Kh(t.url),request:{...t.request,url:Kh(t.request.url),headers:Zi(t.request.headers),query:Zi(t.request.query),params:Zi(t.request.params),body:t.request.body!=null?$0(t.request.body):t.request.body},response:{headers:Zi(t.response.headers),body:t.response.body,time:t.response.time,size:t.response.size,cookies:t.response.cookies?q0(t.response.cookies):t.response.cookies}}}function ur(t){return typeof t=="string"&&tW.test(t)}function rW(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)sn.test(n)&&i&&!ur(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)A0.test(n)&&i&&!ur(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)sn.test(n)&&i&&!ur(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&&!ur(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&&!ur(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&&!ur(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&&Yh(r,e)}return e}function Yh(t,e){if(t!=null){if(typeof t=="string"){let r=t.trim();if(r.startsWith("{")||r.startsWith("[")){try{Yh(JSON.parse(r),e)}catch{}return}if(r.includes("=")&&!r.includes(`
|
|
93
|
+
`)){try{let n=new URLSearchParams(r);for(let[i,s]of n)sn.test(i)&&s&&!ur(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=>Yh(r,e));return}if(typeof t=="object")for(let[r,n]of Object.entries(t))sn.test(r)&&n&&typeof n=="string"&&!ur(n)?e.push({location:"body",field:r,message:`Body field "${r}" contains a hardcoded value. Use a {{variable}} instead.`}):typeof n=="object"&&n!==null&&Yh(n,e)}}function ca(t){return t.replace(/\./g,"_").replace(/[^a-zA-Z0-9_]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"").toLowerCase()}function nW(t){let e=[],r=new Set;function n(i){let s=i,a=2;for(;r.has(s);)s=`${i}_${a++}`;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,a]of i.searchParams)sn.test(s)&&a&&!ur(a)&&e.push({location:"url",field:s,value:a,variableName:n(ca(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,a]of i)A0.test(s)&&a&&!ur(a)&&e.push({location:"header",field:s,value:a,variableName:n(ca(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,a]of i)sn.test(s)&&a&&!ur(a)&&e.push({location:"query",field:s,value:a,variableName:n(ca(s))})}if(t.auth){let i=t.auth;if(i.bearerToken&&!ur(i.bearerToken)&&e.push({location:"auth",field:"bearerToken",value:i.bearerToken,variableName:n("bearer_token")}),i.basicAuth&&i.basicAuth.password&&!ur(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&&!ur(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&&Gh(i,e,r,"")}return e}function Gh(t,e,r,n){if(t!=null){if(typeof t=="string"){let i=t.trim();if(i.startsWith("{")||i.startsWith("[")){try{Gh(JSON.parse(i),e,r,n)}catch{}return}if(i.includes("=")&&!i.includes(`
|
|
94
|
+
`)){try{let s=new URLSearchParams(i);for(let[a,l]of s)if(sn.test(a)&&l&&!ur(l)){let f=ca(a),d=2;for(;r.has(f);)f=`${ca(a)}_${d++}`;r.add(f),e.push({location:"body",field:a,path:n?`${n}.${a}`:a,value:l,variableName:f})}}catch{}return}return}if(Array.isArray(t)){t.forEach((i,s)=>Gh(i,e,r,`${n}[${s}]`));return}if(typeof t=="object")for(let[i,s]of Object.entries(t)){let a=n?`${n}.${i}`:i;if(sn.test(i)&&s&&typeof s=="string"&&!ur(s)){let l=ca(i),f=2;for(;r.has(l);)l=`${ca(i)}_${f++}`;r.add(l),e.push({location:"body",field:i,path:a,value:s,variableName:l})}else typeof s=="object"&&s!==null&&Gh(s,e,r,a)}}}function iW(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(`([?&])${oW(n.field)}=[^&]*`),`$1${n.field}=${i}`));break;case"header":if(Array.isArray(r.headers)){let s=r.headers.find(a=>a.key===n.field&&a.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(a=>a.key===n.field&&a.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":sW(r,n.field,n.path,n.value,i);break}}return r}function sW(t,e,r,n,i){let s=typeof t.body=="object"&&t.body!==null&&"content"in t.body?t.body:null,a=s?s.content:t.body;if(a){if(typeof a=="string"){let l=a.trim();if(l.startsWith("{")||l.startsWith("[")){try{let f=JSON.parse(l);JI(f,e,r||e,n,i);let d=JSON.stringify(f,null,2);s?s.content=d:t.body=d}catch{}return}if(l.includes("=")&&!l.includes(`
|
|
95
|
+
`)){let f=new URLSearchParams(l);if(f.get(e)===n){f.set(e,i);let d=f.toString();s?s.content=d:t.body=d}return}return}typeof a=="object"&&a!==null&&JI(a,e,r||e,n,i)}}function JI(t,e,r,n,i){let s=r.split("."),a=t;for(let f=0;f<s.length-1;f++){let d=s[f],m=d.match(/^(.+)\[(\d+)\]$/);if(m?a=a?.[m[1]]?.[parseInt(m[2])]:a=a?.[d],a==null)return}let l=s[s.length-1];a&&a[l]===n&&(a[l]=i)}function oW(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var ua,A0,sn,tW,xf=oe(()=>{"use strict";ua="***",A0=/^(authorization|proxy-authorization|www-authenticate)$|(token|cookie|secret|credential|api[_\-]?key|bearer|session[_\-]?id)/i,sn=/(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;tW=/\{\{[^}]+\}\}/});import*as ke from"fs";import*as jr from"path";var Cf,F0=oe(()=>{"use strict";yn();xf();Cf=class{historyPath;sharedHistoryPath;constructor(e,r){this.historyPath=e,this.sharedHistoryPath=r}getEnvironmentHistoryPath(e){return jr.join(this.historyPath,It(e))}getCollectionHistoryPath(e,r){return jr.join(this.getEnvironmentHistoryPath(e),r)}getRequestPath(e,r,n){return jr.join(this.getCollectionHistoryPath(e,r),It(n))}getSharedEnvironmentHistoryPath(e){return jr.join(this.sharedHistoryPath,It(e))}getSharedCollectionHistoryPath(e,r){return jr.join(this.getSharedEnvironmentHistoryPath(e),r)}getSharedRequestPath(e,r,n){return jr.join(this.getSharedCollectionHistoryPath(e,r),It(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(!ke.existsSync(i))return null;let s=ke.readFileSync(i,"utf-8"),a=JSON.parse(s);return{environment:e||a.environment,requestPath:r||a.requestPath,requestId:n||a.requestId,method:a.method,requests:a.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(!ke.existsSync(i))return null;let s=ke.readFileSync(i,"utf-8"),a=JSON.parse(s);return{environment:e||a.environment,requestPath:r||a.requestPath,requestId:n||a.requestId,method:a.method,requests:a.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 a of i){let l=a.ticket||a.branch||"";s.has(l)||s.set(l,[]),s.get(l).push(a)}return s}getSharedEntriesGroupedByTicket(e,r,n){let i=this.loadSharedHistory(e,r,n)?.requests??[],s=new Map;for(let a of i){let l=a.ticket||a.branch||"";s.has(l)||s.set(l,[]),s.get(l).push(a)}return s}saveHistory(e){let r=this.getRequestPath(e.environment,e.requestPath,e.requestId),n=this.getHistoryFilePath(e.environment,e.requestPath,e.requestId);try{ke.existsSync(r)||ke.mkdirSync(r,{recursive:!0}),ke.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{ke.existsSync(r)||ke.mkdirSync(r,{recursive:!0}),ke.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 a=this.loadHistory(e,r,n);a||(a={environment:e,requestPath:r,requestId:n,method:i,requests:[]});let l=M0({...s,method:i,id:lb(),timestamp:Date.now()});return a.requests.unshift(l),a.requests.length>100&&(a.requests=a.requests.slice(0,100)),this.saveHistory(a),l}deleteEntry(e,r,n,i){let s=this.loadHistory(e,r,n);if(!s)return!1;let a=s.requests.length;if(s.requests=s.requests.filter(l=>l.id!==i),s.requests.length!==a){this.saveHistory(s);let l=this.getResponseFilePath(e,r,n,i);return ke.existsSync(l)&&ke.unlinkSync(l),!0}return!1}deleteSharedEntry(e,r,n,i){let s=this.loadSharedHistory(e,r,n);if(!s)return!1;let a=s.requests.length;if(s.requests=s.requests.filter(l=>l.id!==i),s.requests.length!==a){this.saveSharedHistory(s);let l=this.getSharedResponseFilePath(e,r,n,i);return ke.existsSync(l)&&ke.unlinkSync(l),!0}return!1}shareEntry(e,r,n,i,s){let a=(s||"").trim();if(!a)return!1;let l=this.loadHistory(e,r,n);if(!l)return!1;let f=l.requests.findIndex(w=>w.id===i);if(f===-1)return!1;let[d]=l.requests.splice(f,1);this.saveHistory(l);let m=this.loadSharedHistory(e,r,n)||{environment:e,requestPath:r,requestId:n,method:l.method,requests:[]};if(!m.requests.some(w=>w.id===i)){let w={...d,ticket:null,branch:a};m.requests.unshift(w),m.requests.length>100&&(m.requests=m.requests.slice(0,100)),this.saveSharedHistory(m)}let g=this.getResponseFilePath(e,r,n,i),y=this.getSharedResponseFilePath(e,r,n,i);if(ke.existsSync(g)){let w=jr.dirname(y);ke.existsSync(w)||ke.mkdirSync(w,{recursive:!0});try{ke.renameSync(g,y)}catch{try{ke.copyFileSync(g,y)}catch(R){return console.error(`Failed to copy full response from ${g} to ${y}:`,R),!0}try{ke.unlinkSync(g)}catch(R){console.warn(`Failed to remove original full response after copy: ${g}`,R)}}}return!0}moveSharedEntry(e,r,n,i,s){let a=(s||"").trim();if(!a)return!1;let l=this.loadSharedHistory(e,r,n);if(!l)return!1;let f=!1;return l.requests=l.requests.map(d=>d.id===i?(f=!0,{...d,ticket:null,branch:a}):d),f?(this.saveSharedHistory(l),!0):!1}renameSharedGroup(e,r,n,i,s){let a=(i||"").trim(),l=(s||"").trim();if(!a||!l||a===l)return!1;let f=this.loadSharedHistory(e,r,n);if(!f)return!1;let d=!1;return f.requests=f.requests.map(m=>!m.ticket&&m.branch===a?(d=!0,{...m,branch:l}):m),d?(this.saveSharedHistory(f),!0):!1}clearHistory(e,r,n){let i=this.getRequestPath(e,r,n);if(ke.existsSync(i)){let s=ke.readdirSync(i);for(let a of s)ke.unlinkSync(jr.join(i,a));ke.rmdirSync(i)}}saveFullResponse(e,r,n,i,s){let a=this.getRequestPath(e,r,n),l=this.getResponseFilePath(e,r,n,i);try{ke.existsSync(a)||ke.mkdirSync(a,{recursive:!0});let f=N0(s);ke.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(!ke.existsSync(s))return null;let a=ke.readFileSync(s,"utf-8");return JSON.parse(a)}catch(a){return console.error(`Failed to load full response for ${i}:`,a),null}}loadSharedFullResponse(e,r,n,i){let s=this.getSharedResponseFilePath(e,r,n,i);try{if(!ke.existsSync(s))return null;let a=ke.readFileSync(s,"utf-8");return JSON.parse(a)}catch(a){return console.error(`Failed to load shared full response for ${i}:`,a),null}}}});var Gl,L0=oe(()=>{"use strict";Gl=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,a=this.historyService.loadHistory(i,e,r),l=this.historyService.loadSharedHistory(i,e,r),f=[...a?.requests||[],...l?.requests||[]];if(f.length===0)return{responses:{}};let d=f.slice(0,s),m=new Map;for(let y of d){let w=this.historyService.loadFullResponse(i,e,r,y.id);if(w||(w=this.historyService.loadSharedFullResponse(i,e,r,y.id)),w){let C=w.status;m.has(C)||m.set(C,[]),m.get(C).push(w)}}let g={};for(let[y,w]of m){let C=this.buildResponseDefinition(w);g[String(y)]=C}return{responses:g}}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 a=this.inferBodySchema(n);for(let l=1;l<e.length;l++){let f=this.inferBodySchema(e[l]);f&&a?a=this.inferrer.mergeSchemas(a,f):f&&(a=f)}if(a&&(r.schema=a),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,d]of Object.entries(l.headers)){let m=f.toLowerCase();r.has(m)||(n.set(m,(n.get(m)||0)+1),i.has(m)||i.set(m,Array.isArray(d)?d.join(", "):d))}let s=Math.ceil(e.length/2),a={};for(let[l,f]of n)if(f>=s){let d=i.get(l);a[l]={schema:this.inferHeaderSchema(d)}}return a}inferHeaderSchema(e){return e?/^\d+$/.test(e)?{type:"integer"}:{type:"string"}:{type:"string"}}tryParseJson(e){try{return JSON.parse(e)}catch{return}}}});var Je=F(rr=>{"use strict";var j0=Symbol.for("yaml.alias"),YI=Symbol.for("yaml.document"),Zh=Symbol.for("yaml.map"),GI=Symbol.for("yaml.pair"),U0=Symbol.for("yaml.scalar"),Xh=Symbol.for("yaml.seq"),Xi=Symbol.for("yaml.node.type"),aW=t=>!!t&&typeof t=="object"&&t[Xi]===j0,lW=t=>!!t&&typeof t=="object"&&t[Xi]===YI,cW=t=>!!t&&typeof t=="object"&&t[Xi]===Zh,uW=t=>!!t&&typeof t=="object"&&t[Xi]===GI,KI=t=>!!t&&typeof t=="object"&&t[Xi]===U0,fW=t=>!!t&&typeof t=="object"&&t[Xi]===Xh;function QI(t){if(t&&typeof t=="object")switch(t[Xi]){case Zh:case Xh:return!0}return!1}function dW(t){if(t&&typeof t=="object")switch(t[Xi]){case j0:case Zh:case U0:case Xh:return!0}return!1}var pW=t=>(KI(t)||QI(t))&&!!t.anchor;rr.ALIAS=j0;rr.DOC=YI;rr.MAP=Zh;rr.NODE_TYPE=Xi;rr.PAIR=GI;rr.SCALAR=U0;rr.SEQ=Xh;rr.hasAnchor=pW;rr.isAlias=aW;rr.isCollection=QI;rr.isDocument=lW;rr.isMap=cW;rr.isNode=dW;rr.isPair=uW;rr.isScalar=KI;rr.isSeq=fW});var Ef=F(H0=>{"use strict";var zt=Je(),Ur=Symbol("break visit"),ZI=Symbol("skip children"),wi=Symbol("remove node");function em(t,e){let r=XI(e);zt.isDocument(t)?Kl(null,t.contents,r,Object.freeze([t]))===wi&&(t.contents=null):Kl(null,t,r,Object.freeze([]))}em.BREAK=Ur;em.SKIP=ZI;em.REMOVE=wi;function Kl(t,e,r,n){let i=eP(t,e,r,n);if(zt.isNode(i)||zt.isPair(i))return tP(t,n,i),Kl(t,i,r,n);if(typeof i!="symbol"){if(zt.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let a=Kl(s,e.items[s],r,n);if(typeof a=="number")s=a-1;else{if(a===Ur)return Ur;a===wi&&(e.items.splice(s,1),s-=1)}}}else if(zt.isPair(e)){n=Object.freeze(n.concat(e));let s=Kl("key",e.key,r,n);if(s===Ur)return Ur;s===wi&&(e.key=null);let a=Kl("value",e.value,r,n);if(a===Ur)return Ur;a===wi&&(e.value=null)}}return i}async function tm(t,e){let r=XI(e);zt.isDocument(t)?await Ql(null,t.contents,r,Object.freeze([t]))===wi&&(t.contents=null):await Ql(null,t,r,Object.freeze([]))}tm.BREAK=Ur;tm.SKIP=ZI;tm.REMOVE=wi;async function Ql(t,e,r,n){let i=await eP(t,e,r,n);if(zt.isNode(i)||zt.isPair(i))return tP(t,n,i),Ql(t,i,r,n);if(typeof i!="symbol"){if(zt.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let a=await Ql(s,e.items[s],r,n);if(typeof a=="number")s=a-1;else{if(a===Ur)return Ur;a===wi&&(e.items.splice(s,1),s-=1)}}}else if(zt.isPair(e)){n=Object.freeze(n.concat(e));let s=await Ql("key",e.key,r,n);if(s===Ur)return Ur;s===wi&&(e.key=null);let a=await Ql("value",e.value,r,n);if(a===Ur)return Ur;a===wi&&(e.value=null)}}return i}function XI(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 eP(t,e,r,n){if(typeof r=="function")return r(t,e,n);if(zt.isMap(e))return r.Map?.(t,e,n);if(zt.isSeq(e))return r.Seq?.(t,e,n);if(zt.isPair(e))return r.Pair?.(t,e,n);if(zt.isScalar(e))return r.Scalar?.(t,e,n);if(zt.isAlias(e))return r.Alias?.(t,e,n)}function tP(t,e,r){let n=e[e.length-1];if(zt.isCollection(n))n.items[t]=r;else if(zt.isPair(n))t==="key"?n.key=r:n.value=r;else if(zt.isDocument(n))n.contents=r;else{let i=zt.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}H0.visit=em;H0.visitAsync=tm});var B0=F(nP=>{"use strict";var rP=Je(),hW=Ef(),mW={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},gW=t=>t.replace(/[!,[\]{}]/g,e=>mW[e]),Of=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,a]=n;return this.tags[s]=a,!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 a=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,a),!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 a=e.slice(2,-1);return a==="!"||a==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),a)}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(a){return r(String(a)),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+gW(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&&rP.isNode(e.contents)){let s={};hW.visit(e.contents,(a,l)=>{rP.isNode(l)&&l.tag&&(s[l.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,a]of n)s==="!!"&&a==="tag:yaml.org,2002:"||(!e||i.some(l=>l.startsWith(a)))&&r.push(`%TAG ${s} ${a}`);return r.join(`
|
|
96
|
+
`)}};Of.defaultYaml={explicit:!1,version:"1.2"};Of.defaultTags={"!!":"tag:yaml.org,2002:"};nP.Directives=Of});var rm=F(If=>{"use strict";var iP=Je(),yW=Ef();function vW(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 sP(t){let e=new Set;return yW.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function oP(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function bW(t,e){let r=[],n=new Map,i=null;return{onAnchor:s=>{r.push(s),i??(i=sP(t));let a=oP(e,i);return i.add(a),a},setAnchors:()=>{for(let s of r){let a=n.get(s);if(typeof a=="object"&&a.anchor&&(iP.isScalar(a.node)||iP.isCollection(a.node)))a.node.anchor=a.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},sourceObjects:n}}If.anchorIsValid=vW;If.anchorNames=sP;If.createNodeAnchors=bW;If.findNewAnchor=oP});var V0=F(aP=>{"use strict";function Pf(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,s=n.length;i<s;++i){let a=n[i],l=Pf(t,n,String(i),a);l===void 0?delete n[i]:l!==a&&(n[i]=l)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let s=n.get(i),a=Pf(t,n,i,s);a===void 0?n.delete(i):a!==s&&n.set(i,a)}else if(n instanceof Set)for(let i of Array.from(n)){let s=Pf(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 a=Pf(t,n,i,s);a===void 0?delete n[i]:a!==s&&(n[i]=a)}return t.call(e,r,n)}aP.applyReviver=Pf});var Bs=F(cP=>{"use strict";var SW=Je();function lP(t,e,r){if(Array.isArray(t))return t.map((n,i)=>lP(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!SW.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}cP.toJS=lP});var nm=F(fP=>{"use strict";var wW=V0(),uP=Je(),_W=Bs(),W0=class{constructor(e){Object.defineProperty(this,uP.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(!uP.isDocument(e))throw new TypeError("A document argument is required");let a={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},l=_W.toJS(this,"",a);if(typeof i=="function")for(let{count:f,res:d}of a.anchors.values())i(d,f);return typeof s=="function"?wW.applyReviver(s,{"":l},"",l):l}};fP.NodeBase=W0});var kf=F(dP=>{"use strict";var RW=rm(),xW=Ef(),Zl=Je(),CW=nm(),EW=Bs(),z0=class extends CW.NodeBase{constructor(e){super(Zl.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=[],xW.visit(e,{Node:(s,a)=>{(Zl.isAlias(a)||Zl.hasAnchor(a))&&n.push(a)}}),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,a=this.resolve(i,r);if(!a){let f=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(f)}let l=n.get(a);if(l||(EW.toJS(a,null,r),l=n.get(a)),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=im(i,a,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(RW.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 im(t,e,r){if(Zl.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(Zl.isCollection(e)){let n=0;for(let i of e.items){let s=im(t,i,r);s>n&&(n=s)}return n}else if(Zl.isPair(e)){let n=im(t,e.key,r),i=im(t,e.value,r);return Math.max(n,i)}return 1}dP.Alias=z0});var Ft=F(J0=>{"use strict";var OW=Je(),IW=nm(),PW=Bs(),kW=t=>!t||typeof t!="function"&&typeof t!="object",Vs=class extends IW.NodeBase{constructor(e){super(OW.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:PW.toJS(this.value,e,r)}toString(){return String(this.value)}};Vs.BLOCK_FOLDED="BLOCK_FOLDED";Vs.BLOCK_LITERAL="BLOCK_LITERAL";Vs.PLAIN="PLAIN";Vs.QUOTE_DOUBLE="QUOTE_DOUBLE";Vs.QUOTE_SINGLE="QUOTE_SINGLE";J0.Scalar=Vs;J0.isScalarValue=kW});var Tf=F(hP=>{"use strict";var TW=kf(),fa=Je(),pP=Ft(),AW="tag:yaml.org,2002:";function qW(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 $W(t,e,r){if(fa.isDocument(t)&&(t=t.contents),fa.isNode(t))return t;if(fa.isPair(t)){let g=r.schema[fa.MAP].createNode?.(r.schema,null,r);return g.items.push(t),g}(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:a,sourceObjects:l}=r,f;if(n&&t&&typeof t=="object"){if(f=l.get(t),f)return f.anchor??(f.anchor=i(t)),new TW.Alias(f.anchor);f={anchor:null,node:null},l.set(t,f)}e?.startsWith("!!")&&(e=AW+e.slice(2));let d=qW(t,e,a.tags);if(!d){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let g=new pP.Scalar(t);return f&&(f.node=g),g}d=t instanceof Map?a[fa.MAP]:Symbol.iterator in Object(t)?a[fa.SEQ]:a[fa.MAP]}s&&(s(d),delete r.onTagObj);let m=d?.createNode?d.createNode(r.schema,t,r):typeof d?.nodeClass?.from=="function"?d.nodeClass.from(r.schema,t,r):new pP.Scalar(t);return e?m.tag=e:d.default||(m.tag=d.tag),f&&(f.node=m),m}hP.createNode=$W});var om=F(sm=>{"use strict";var MW=Tf(),_i=Je(),NW=nm();function Y0(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 a=[];a[s]=n,n=a}else n=new Map([[s,n]])}return MW.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 mP=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,G0=class extends NW.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=>_i.isNode(n)||_i.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(mP(e))this.add(r);else{let[n,...i]=e,s=this.get(n,!0);if(_i.isCollection(s))s.addIn(i,r);else if(s===void 0&&this.schema)this.set(n,Y0(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(_i.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&&_i.isScalar(s)?s.value:s:_i.isCollection(s)?s.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!_i.isPair(r))return!1;let n=r.value;return n==null||e&&_i.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 _i.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(_i.isCollection(s))s.setIn(i,r);else if(s===void 0&&this.schema)this.set(n,Y0(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};sm.Collection=G0;sm.collectionFromPath=Y0;sm.isEmptyPath=mP});var Af=F(am=>{"use strict";var DW=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function K0(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var FW=(t,e,r)=>t.endsWith(`
|
|
97
97
|
`)?K0(r,e):r.includes(`
|
|
98
98
|
`)?`
|
|
99
|
-
`+K0(r,e):(t.endsWith(" ")?"":" ")+r;am.indentComment=K0;am.lineComment=
|
|
100
|
-
`)r===Q0&&(R=
|
|
101
|
-
`&&w!==" "){let
|
|
102
|
-
`&&
|
|
103
|
-
${e}${t.slice(0,
|
|
104
|
-
${e}${t.slice(
|
|
105
|
-
`);n=e,i=e+1,s=t[i]}return n}qf.FOLD_BLOCK=Q0;qf.FOLD_FLOW=
|
|
106
|
-
`){if(s-
|
|
107
|
-
|
|
108
|
-
`;r[f+2]==="\\"&&r[f+3]==="n"&&r[f+4]!=='"';)
|
|
109
|
-
`,f+=2;
|
|
99
|
+
`+K0(r,e):(t.endsWith(" ")?"":" ")+r;am.indentComment=K0;am.lineComment=FW;am.stringifyComment=DW});var yP=F(qf=>{"use strict";var LW="flow",Q0="block",lm="quoted";function jW(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:s=20,onFold:a,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 d=[],m={},g=i-e.length;typeof n=="number"&&(n>i-Math.max(2,s)?d.push(0):g=i-n);let y,w,C=!1,R=-1,T=-1,A=-1;r===Q0&&(R=gP(t,R,e.length),R!==-1&&(g=R+f));for(let B;B=t[R+=1];){if(r===lm&&B==="\\"){switch(T=R,t[R+1]){case"x":R+=3;break;case"u":R+=5;break;case"U":R+=9;break;default:R+=1}A=R}if(B===`
|
|
100
|
+
`)r===Q0&&(R=gP(t,R,e.length)),g=R+e.length+f,y=void 0;else{if(B===" "&&w&&w!==" "&&w!==`
|
|
101
|
+
`&&w!==" "){let V=t[R+1];V&&V!==" "&&V!==`
|
|
102
|
+
`&&V!==" "&&(y=R)}if(R>=g)if(y)d.push(y),g=y+f,y=void 0;else if(r===lm){for(;w===" "||w===" ";)w=B,B=t[R+=1],C=!0;let V=R>A+1?R-2:T-1;if(m[V])return t;d.push(V),m[V]=!0,g=V+f,y=void 0}else C=!0}w=B}if(C&&l&&l(),d.length===0)return t;a&&a();let U=t.slice(0,d[0]);for(let B=0;B<d.length;++B){let V=d[B],W=d[B+1]||t.length;V===0?U=`
|
|
103
|
+
${e}${t.slice(0,W)}`:(r===lm&&m[V]&&(U+=`${t[V]}\\`),U+=`
|
|
104
|
+
${e}${t.slice(V+1,W)}`)}return U}function gP(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}qf.FOLD_BLOCK=Q0;qf.FOLD_FLOW=LW;qf.FOLD_QUOTED=lm;qf.foldFlowLines=jW});var Mf=F(vP=>{"use strict";var Kn=Ft(),Ws=yP(),um=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),fm=t=>/^(%|---|\.\.\.)/m.test(t);function UW(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,a=0;s<i;++s)if(t[s]===`
|
|
106
|
+
`){if(s-a>n)return!0;if(a=s+1,i-a<=n)return!1}return!0}function $f(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(fm(t)?" ":""),a="",l=0;for(let f=0,d=r[f];d;d=r[++f])if(d===" "&&r[f+1]==="\\"&&r[f+2]==="n"&&(a+=r.slice(l,f)+"\\ ",f+=1,l=f,d="\\"),d==="\\")switch(r[f+1]){case"u":{a+=r.slice(l,f);let m=r.substr(f+2,4);switch(m){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:m.substr(0,2)==="00"?a+="\\x"+m.substr(2):a+=r.substr(f,6)}f+=5,l=f+1}break;case"n":if(n||r[f+2]==='"'||r.length<i)f+=1;else{for(a+=r.slice(l,f)+`
|
|
107
|
+
|
|
108
|
+
`;r[f+2]==="\\"&&r[f+3]==="n"&&r[f+4]!=='"';)a+=`
|
|
109
|
+
`,f+=2;a+=s,r[f+2]===" "&&(a+="\\"),f+=1,l=f+1}break;default:f+=1}return a=l?a+r.slice(l):r,n?a:Ws.foldFlowLines(a,s,Ws.FOLD_QUOTED,um(e,!1))}function Z0(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
|
|
110
110
|
`)||/[ \t]\n|\n[ \t]/.test(t))return $f(t,e);let r=e.indent||(fm(t)?" ":""),n="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
111
111
|
${r}`)+"'";return e.implicitKey?n:Ws.foldFlowLines(n,r,Ws.FOLD_FLOW,um(e,!1))}function Xl(t,e){let{singleQuote:r}=e.options,n;if(r===!1)n=$f;else{let i=t.includes('"'),s=t.includes("'");i&&!s?n=Z0:s&&!i?n=$f:n=r?Z0:$f}return n(t,e)}var X0;try{X0=new RegExp(`(^|(?<!
|
|
112
112
|
))
|
|
113
113
|
+(?!
|
|
114
|
-
|$)`,"g")}catch{X0=/\n+(?!\n|$)/g}function cm({comment:t,type:e,value:r},n,i,s){let{blockQuote:
|
|
114
|
+
|$)`,"g")}catch{X0=/\n+(?!\n|$)/g}function cm({comment:t,type:e,value:r},n,i,s){let{blockQuote:a,commentString:l,lineWidth:f}=n.options;if(!a||/\n[\t ]+$/.test(r))return Xl(r,n);let d=n.indent||(n.forceBlockIndent||fm(r)?" ":""),m=a==="literal"?!0:a==="folded"||e===Kn.Scalar.BLOCK_FOLDED?!1:e===Kn.Scalar.BLOCK_LITERAL?!0:!UW(r,f,d.length);if(!r)return m?`|
|
|
115
115
|
`:`>
|
|
116
|
-
`;let g,y;for(y=r.length;y>0;--y){let
|
|
117
|
-
`&&
|
|
116
|
+
`;let g,y;for(y=r.length;y>0;--y){let W=r[y-1];if(W!==`
|
|
117
|
+
`&&W!==" "&&W!==" ")break}let w=r.substring(y),C=w.indexOf(`
|
|
118
118
|
`);C===-1?g="-":r===w||C!==w.length-1?(g="+",s&&s()):g="",w&&(r=r.slice(0,-w.length),w[w.length-1]===`
|
|
119
|
-
`&&(w=w.slice(0,-1)),w=w.replace(X0,`$&${d}`));let R=!1,
|
|
120
|
-
`)A=
|
|
121
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${d}`),X=!1,
|
|
122
|
-
${d}${_}`}return r=r.replace(/\n+/g,`$&${d}`),`|${
|
|
123
|
-
${d}${U}${r}${w}`}function
|
|
119
|
+
`&&(w=w.slice(0,-1)),w=w.replace(X0,`$&${d}`));let R=!1,T,A=-1;for(T=0;T<r.length;++T){let W=r[T];if(W===" ")R=!0;else if(W===`
|
|
120
|
+
`)A=T;else break}let U=r.substring(0,A<T?A+1:T);U&&(r=r.substring(U.length),U=U.replace(/\n+/g,`$&${d}`));let V=(R?d?"2":"1":"")+g;if(t&&(V+=" "+l(t.replace(/ ?[\r\n]+/g," ")),i&&i()),!m){let W=r.replace(/\n+/g,`
|
|
121
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${d}`),X=!1,P=um(n,!0);a!=="folded"&&e!==Kn.Scalar.BLOCK_FOLDED&&(P.onOverflow=()=>{X=!0});let _=Ws.foldFlowLines(`${U}${W}${w}`,d,Ws.FOLD_BLOCK,P);if(!X)return`>${V}
|
|
122
|
+
${d}${_}`}return r=r.replace(/\n+/g,`$&${d}`),`|${V}
|
|
123
|
+
${d}${U}${r}${w}`}function HW(t,e,r,n){let{type:i,value:s}=t,{actualString:a,implicitKey:l,indent:f,indentStep:d,inFlow:m}=e;if(l&&s.includes(`
|
|
124
124
|
`)||m&&/[[\]{},]/.test(s))return Xl(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||m||!s.includes(`
|
|
125
125
|
`)?Xl(s,e):cm(t,e,r,n);if(!l&&!m&&i!==Kn.Scalar.PLAIN&&s.includes(`
|
|
126
126
|
`))return cm(t,e,r,n);if(fm(s)){if(f==="")return e.forceBlockIndent=!0,cm(t,e,r,n);if(l&&f===d)return Xl(s,e)}let g=s.replace(/\n+/g,`$&
|
|
127
|
-
${f}`);if(
|
|
128
|
-
${e.indent}${l}`:l}ew.createStringifyContext=
|
|
129
|
-
${l}:`):(
|
|
130
|
-
`:"",U){let
|
|
131
|
-
${Df.indentComment(
|
|
127
|
+
${f}`);if(a){let y=R=>R.default&&R.tag!=="tag:yaml.org,2002:str"&&R.test?.test(g),{compat:w,tags:C}=e.doc.schema;if(C.some(y)||w?.some(y))return Xl(s,e)}return l?g:Ws.foldFlowLines(g,f,Ws.FOLD_FLOW,um(e,!1))}function BW(t,e,r,n){let{implicitKey:i,inFlow:s}=e,a=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:l}=t;l!==Kn.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(l=Kn.Scalar.QUOTE_DOUBLE);let f=m=>{switch(m){case Kn.Scalar.BLOCK_FOLDED:case Kn.Scalar.BLOCK_LITERAL:return i||s?Xl(a.value,e):cm(a,e,r,n);case Kn.Scalar.QUOTE_DOUBLE:return $f(a.value,e);case Kn.Scalar.QUOTE_SINGLE:return Z0(a.value,e);case Kn.Scalar.PLAIN:return HW(a,e,r,n);default:return null}},d=f(l);if(d===null){let{defaultKeyType:m,defaultStringType:g}=e.options,y=i&&m||g;if(d=f(y),d===null)throw new Error(`Unsupported default string type ${y}`)}return d}vP.stringifyString=BW});var Nf=F(ew=>{"use strict";var VW=rm(),zs=Je(),WW=Af(),zW=Mf();function JW(t,e){let r=Object.assign({blockQuote:!0,commentString:WW.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 YW(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(zs.isScalar(e)){n=e.value;let i=t.filter(s=>s.identify?.(n));if(i.length>1){let s=i.filter(a=>a.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 GW(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],s=(zs.isScalar(t)||zs.isCollection(t))&&t.anchor;s&&VW.anchorIsValid(s)&&(r.add(s),i.push(`&${s}`));let a=t.tag??(e.default?null:e.tag);return a&&i.push(n.directives.tagString(a)),i.join(" ")}function KW(t,e,r,n){if(zs.isPair(t))return t.toString(e,r,n);if(zs.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=zs.isNode(t)?t:e.doc.createNode(t,{onTagObj:f=>i=f});i??(i=YW(e.doc.schema.tags,s));let a=GW(s,i,e);a.length>0&&(e.indentAtStart=(e.indentAtStart??0)+a.length+1);let l=typeof i.stringify=="function"?i.stringify(s,e,r,n):zs.isScalar(s)?zW.stringifyString(s,e,r,n):s.toString(e,r,n);return a?zs.isScalar(s)||l[0]==="{"||l[0]==="["?`${a} ${l}`:`${a}
|
|
128
|
+
${e.indent}${l}`:l}ew.createStringifyContext=JW;ew.stringify=KW});var _P=F(wP=>{"use strict";var es=Je(),bP=Ft(),SP=Nf(),Df=Af();function QW({key:t,value:e},r,n,i){let{allNullValues:s,doc:a,indent:l,indentStep:f,options:{commentString:d,indentSeq:m,simpleKeys:g}}=r,y=es.isNode(t)&&t.comment||null;if(g){if(y)throw new Error("With simple keys, key nodes cannot have comments");if(es.isCollection(t)||!es.isNode(t)&&typeof t=="object"){let P="With simple keys, collection cannot be used as a key value";throw new Error(P)}}let w=!g&&(!t||y&&e==null&&!r.inFlow||es.isCollection(t)||(es.isScalar(t)?t.type===bP.Scalar.BLOCK_FOLDED||t.type===bP.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!w&&(g||!s),indent:l+f});let C=!1,R=!1,T=SP.stringify(t,r,()=>C=!0,()=>R=!0);if(!w&&!r.inFlow&&T.length>1024){if(g)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");w=!0}if(r.inFlow){if(s||e==null)return C&&n&&n(),T===""?"?":w?`? ${T}`:T}else if(s&&!g||e==null&&w)return T=`? ${T}`,y&&!C?T+=Df.lineComment(T,r.indent,d(y)):R&&i&&i(),T;C&&(y=null),w?(y&&(T+=Df.lineComment(T,r.indent,d(y))),T=`? ${T}
|
|
129
|
+
${l}:`):(T=`${T}:`,y&&(T+=Df.lineComment(T,r.indent,d(y))));let A,U,B;es.isNode(e)?(A=!!e.spaceBefore,U=e.commentBefore,B=e.comment):(A=!1,U=null,B=null,e&&typeof e=="object"&&(e=a.createNode(e))),r.implicitKey=!1,!w&&!y&&es.isScalar(e)&&(r.indentAtStart=T.length+1),R=!1,!m&&f.length>=2&&!r.inFlow&&!w&&es.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let V=!1,W=SP.stringify(e,r,()=>V=!0,()=>R=!0),X=" ";if(y||A||U){if(X=A?`
|
|
130
|
+
`:"",U){let P=d(U);X+=`
|
|
131
|
+
${Df.indentComment(P,r.indent)}`}W===""&&!r.inFlow?X===`
|
|
132
132
|
`&&B&&(X=`
|
|
133
133
|
|
|
134
134
|
`):X+=`
|
|
135
|
-
${r.indent}`}else if(!w&&es.isCollection(e)){let
|
|
136
|
-
`),k=_!==-1,M=r.inFlow??e.flow??e.items.length===0;if(k||!M){let j=!1;if(k&&(
|
|
137
|
-
${r.indent}`)}}else(
|
|
138
|
-
`)&&(X="");return
|
|
135
|
+
${r.indent}`}else if(!w&&es.isCollection(e)){let P=W[0],_=W.indexOf(`
|
|
136
|
+
`),k=_!==-1,M=r.inFlow??e.flow??e.items.length===0;if(k||!M){let j=!1;if(k&&(P==="&"||P==="!")){let $=W.indexOf(" ");P==="&"&&$!==-1&&$<_&&W[$+1]==="!"&&($=W.indexOf(" ",$+1)),($===-1||_<$)&&(j=!0)}j||(X=`
|
|
137
|
+
${r.indent}`)}}else(W===""||W[0]===`
|
|
138
|
+
`)&&(X="");return T+=X+W,r.inFlow?V&&n&&n():B&&!V?T+=Df.lineComment(T,r.indent,d(B)):R&&i&&i(),T}wP.stringifyPair=QW});var rw=F(tw=>{"use strict";var RP=it("process");function ZW(t,...e){t==="debug"&&console.log(...e)}function XW(t,e){(t==="debug"||t==="warn")&&(typeof RP.emitWarning=="function"?RP.emitWarning(e):console.warn(e))}tw.debug=ZW;tw.warn=XW});var gm=F(mm=>{"use strict";var hm=Je(),xP=Ft(),dm="<<",pm={identify:t=>t===dm||typeof t=="symbol"&&t.description===dm,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new xP.Scalar(Symbol(dm)),{addToJSMap:CP}),stringify:()=>dm},ez=(t,e)=>(pm.identify(e)||hm.isScalar(e)&&(!e.type||e.type===xP.Scalar.PLAIN)&&pm.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===pm.tag&&r.default);function CP(t,e,r){let n=EP(t,r);if(hm.isSeq(n))for(let i of n.items)nw(t,e,i);else if(Array.isArray(n))for(let i of n)nw(t,e,i);else nw(t,e,n)}function nw(t,e,r){let n=EP(t,r);if(!hm.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[s,a]of i)e instanceof Map?e.has(s)||e.set(s,a):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0});return e}function EP(t,e){return t&&hm.isAlias(e)?e.resolve(t.doc,t):e}mm.addMergeToJSMap=CP;mm.isMergeKey=ez;mm.merge=pm});var sw=F(PP=>{"use strict";var tz=rw(),OP=gm(),rz=Nf(),IP=Je(),iw=Bs();function nz(t,e,{key:r,value:n}){if(IP.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(OP.isMergeKey(t,r))OP.addMergeToJSMap(t,e,n);else{let i=iw.toJS(r,"",t);if(e instanceof Map)e.set(i,iw.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let s=iz(r,i,t),a=iw.toJS(n,s,t);s in e?Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0}):e[s]=a}}return e}function iz(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(IP.isNode(t)&&r?.doc){let n=rz.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)+'..."'),tz.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)}PP.addPairToJSMap=nz});var Js=F(ow=>{"use strict";var kP=Tf(),sz=_P(),oz=sw(),ym=Je();function az(t,e,r){let n=kP.createNode(t,void 0,r),i=kP.createNode(e,void 0,r);return new vm(n,i)}var vm=class t{constructor(e,r=null){Object.defineProperty(this,ym.NODE_TYPE,{value:ym.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return ym.isNode(r)&&(r=r.clone(e)),ym.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return oz.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?sz.stringifyPair(this,e,r,n):JSON.stringify(this)}};ow.Pair=vm;ow.createPair=az});var aw=F(AP=>{"use strict";var da=Je(),TP=Nf(),bm=Af();function lz(t,e,r){return(e.inFlow??t.flow?uz:cz)(t,e,r)}function cz({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:s,onChompKeep:a,onComment:l}){let{indent:f,options:{commentString:d}}=r,m=Object.assign({},r,{indent:s,type:null}),g=!1,y=[];for(let C=0;C<e.length;++C){let R=e[C],T=null;if(da.isNode(R))!g&&R.spaceBefore&&y.push(""),Sm(r,y,R.commentBefore,g),R.comment&&(T=R.comment);else if(da.isPair(R)){let U=da.isNode(R.key)?R.key:null;U&&(!g&&U.spaceBefore&&y.push(""),Sm(r,y,U.commentBefore,g))}g=!1;let A=TP.stringify(R,m,()=>T=null,()=>g=!0);T&&(A+=bm.lineComment(A,s,d(T))),g&&T&&(g=!1),y.push(n+A)}let w;if(y.length===0)w=i.start+i.end;else{w=y[0];for(let C=1;C<y.length;++C){let R=y[C];w+=R?`
|
|
139
139
|
${f}${R}`:`
|
|
140
140
|
`}}return t?(w+=`
|
|
141
|
-
`+bm.indentComment(d(t),f),l&&l()):g&&
|
|
142
|
-
`)),C<t.length-1?A+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(d||(d=g.reduce((U,B)=>U+B.length+2,2)+(A.length+2)>e.options.lineWidth)),d&&(A+=",")),
|
|
141
|
+
`+bm.indentComment(d(t),f),l&&l()):g&&a&&a(),w}function uz({items:t},e,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:s,flowCollectionPadding:a,options:{commentString:l}}=e;n+=s;let f=Object.assign({},e,{indent:n,inFlow:!0,type:null}),d=!1,m=0,g=[];for(let C=0;C<t.length;++C){let R=t[C],T=null;if(da.isNode(R))R.spaceBefore&&g.push(""),Sm(e,g,R.commentBefore,!1),R.comment&&(T=R.comment);else if(da.isPair(R)){let U=da.isNode(R.key)?R.key:null;U&&(U.spaceBefore&&g.push(""),Sm(e,g,U.commentBefore,!1),U.comment&&(d=!0));let B=da.isNode(R.value)?R.value:null;B?(B.comment&&(T=B.comment),B.commentBefore&&(d=!0)):R.value==null&&U?.comment&&(T=U.comment)}T&&(d=!0);let A=TP.stringify(R,f,()=>T=null);d||(d=g.length>m||A.includes(`
|
|
142
|
+
`)),C<t.length-1?A+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(d||(d=g.reduce((U,B)=>U+B.length+2,2)+(A.length+2)>e.options.lineWidth)),d&&(A+=",")),T&&(A+=bm.lineComment(A,n,l(T))),g.push(A),m=g.length}let{start:y,end:w}=r;if(g.length===0)return y+w;if(!d){let C=g.reduce((R,T)=>R+T.length+2,2);d=e.options.lineWidth>0&&C>e.options.lineWidth}if(d){let C=y;for(let R of g)C+=R?`
|
|
143
143
|
${s}${i}${R}`:`
|
|
144
144
|
`;return`${C}
|
|
145
|
-
${i}${w}`}else return`${y}${
|
|
146
|
-
`:" ")}return
|
|
145
|
+
${i}${w}`}else return`${y}${a}${g.join(" ")}${a}${w}`}function Sm({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let s=bm.indentComment(e(n),t);r.push(s.trimStart())}}AP.stringifyCollection=lz});var Gs=F(cw=>{"use strict";var fz=aw(),dz=sw(),pz=om(),Ys=Je(),wm=Js(),hz=Ft();function Ff(t,e){let r=Ys.isScalar(e)?e.value:e;for(let n of t)if(Ys.isPair(n)&&(n.key===e||n.key===r||Ys.isScalar(n.key)&&n.key.value===r))return n}var lw=class extends pz.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Ys.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:s}=n,a=new this(e),l=(f,d)=>{if(typeof s=="function")d=s.call(r,f,d);else if(Array.isArray(s)&&!s.includes(f))return;(d!==void 0||i)&&a.items.push(wm.createPair(f,d,n))};if(r instanceof Map)for(let[f,d]of r)l(f,d);else if(r&&typeof r=="object")for(let f of Object.keys(r))l(f,r[f]);return typeof e.sortMapEntries=="function"&&a.items.sort(e.sortMapEntries),a}add(e,r){let n;Ys.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new wm.Pair(e,e?.value):n=new wm.Pair(e.key,e.value);let i=Ff(this.items,n.key),s=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);Ys.isScalar(i.value)&&hz.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(s){let a=this.items.findIndex(l=>s(n,l)<0);a===-1?this.items.push(n):this.items.splice(a,0,n)}else this.items.push(n)}delete(e){let r=Ff(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=Ff(this.items,e)?.value;return(!r&&Ys.isScalar(i)?i.value:i)??void 0}has(e){return!!Ff(this.items,e)}set(e,r){this.add(new wm.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)dz.addPairToJSMap(r,i,s);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!Ys.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})),fz.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};cw.YAMLMap=lw;cw.findPair=Ff});var ec=F($P=>{"use strict";var mz=Je(),qP=Gs(),gz={collection:"map",default:!0,nodeClass:qP.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return mz.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>qP.YAMLMap.from(t,e,r)};$P.map=gz});var Ks=F(MP=>{"use strict";var yz=Tf(),vz=aw(),bz=om(),Rm=Je(),Sz=Ft(),wz=Bs(),uw=class extends bz.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Rm.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=_m(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=_m(e);if(typeof n!="number")return;let i=this.items[n];return!r&&Rm.isScalar(i)?i.value:i}has(e){let r=_m(e);return typeof r=="number"&&r<this.items.length}set(e,r){let n=_m(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];Rm.isScalar(i)&&Sz.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(wz.toJS(s,String(i++),r));return n}toString(e,r,n){return e?vz.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 a=0;for(let l of r){if(typeof i=="function"){let f=r instanceof Set?l:String(a++);l=i.call(r,f,l)}s.items.push(yz.createNode(l,void 0,n))}}return s}};function _m(t){let e=Rm.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}MP.YAMLSeq=uw});var tc=F(DP=>{"use strict";var _z=Je(),NP=Ks(),Rz={collection:"seq",default:!0,nodeClass:NP.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return _z.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>NP.YAMLSeq.from(t,e,r)};DP.seq=Rz});var Lf=F(FP=>{"use strict";var xz=Mf(),Cz={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),xz.stringifyString(t,e,r,n)}};FP.string=Cz});var xm=F(UP=>{"use strict";var LP=Ft(),jP={identify:t=>t==null,createNode:()=>new LP.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new LP.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&jP.test.test(t)?t:e.options.nullStr};UP.nullTag=jP});var fw=F(BP=>{"use strict";var Ez=Ft(),HP={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new Ez.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&HP.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};BP.boolTag=HP});var rc=F(VP=>{"use strict";function Oz({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 a=s.indexOf(".");a<0&&(a=s.length,s+=".");let l=e-(s.length-a-1);for(;l-- >0;)s+="0"}return s}VP.stringifyNumber=Oz});var pw=F(Cm=>{"use strict";var Iz=Ft(),dw=rc(),Pz={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:dw.stringifyNumber},kz={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():dw.stringifyNumber(t)}},Tz={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 Iz.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:dw.stringifyNumber};Cm.float=Tz;Cm.floatExp=kz;Cm.floatNaN=Pz});var mw=F(Om=>{"use strict";var WP=rc(),Em=t=>typeof t=="bigint"||Number.isInteger(t),hw=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function zP(t,e,r){let{value:n}=t;return Em(n)&&n>=0?r+n.toString(e):WP.stringifyNumber(t)}var Az={identify:t=>Em(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>hw(t,2,8,r),stringify:t=>zP(t,8,"0o")},qz={identify:Em,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>hw(t,0,10,r),stringify:WP.stringifyNumber},$z={identify:t=>Em(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>hw(t,2,16,r),stringify:t=>zP(t,16,"0x")};Om.int=qz;Om.intHex=$z;Om.intOct=Az});var YP=F(JP=>{"use strict";var Mz=ec(),Nz=xm(),Dz=tc(),Fz=Lf(),Lz=fw(),gw=pw(),yw=mw(),jz=[Mz.map,Dz.seq,Fz.string,Nz.nullTag,Lz.boolTag,yw.intOct,yw.int,yw.intHex,gw.floatNaN,gw.floatExp,gw.float];JP.schema=jz});var QP=F(KP=>{"use strict";var Uz=Ft(),Hz=ec(),Bz=tc();function GP(t){return typeof t=="bigint"||Number.isInteger(t)}var Im=({value:t})=>JSON.stringify(t),Vz=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Im},{identify:t=>t==null,createNode:()=>new Uz.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Im},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Im},{identify:GP,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})=>GP(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:Im}],Wz={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},zz=[Hz.map,Bz.seq].concat(Vz,Wz);KP.schema=zz});var bw=F(ZP=>{"use strict";var jf=it("buffer"),vw=Ft(),Jz=Mf(),Yz={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof jf.Buffer=="function")return jf.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 a=r,l;if(typeof jf.Buffer=="function")l=a instanceof jf.Buffer?a.toString("base64"):jf.Buffer.from(a.buffer).toString("base64");else if(typeof btoa=="function"){let f="";for(let d=0;d<a.length;++d)f+=String.fromCharCode(a[d]);l=btoa(f)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=vw.Scalar.BLOCK_LITERAL),e!==vw.Scalar.QUOTE_DOUBLE){let f=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),d=Math.ceil(l.length/f),m=new Array(d);for(let g=0,y=0;g<d;++g,y+=f)m[g]=l.substr(y,f);l=m.join(e===vw.Scalar.BLOCK_LITERAL?`
|
|
146
|
+
`:" ")}return Jz.stringifyString({comment:t,type:e,value:l},n,i,s)}};ZP.binary=Yz});var Tm=F(km=>{"use strict";var Pm=Je(),Sw=Js(),Gz=Ft(),Kz=Ks();function XP(t,e){if(Pm.isSeq(t))for(let r=0;r<t.items.length;++r){let n=t.items[r];if(!Pm.isPair(n)){if(Pm.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new Sw.Pair(new Gz.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]=Pm.isPair(n)?n:new Sw.Pair(n)}}else e("Expected a sequence for this tag");return t}function ZP(t,e,r){let{replacer:n}=r,i=new Yz.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 d=Object.keys(o);if(d.length===1)l=d[0],f=o[l];else throw new TypeError(`Expected tuple with one key, not ${d.length} keys`)}else l=o;i.items.push(Sw.createPair(l,f,r))}return i}var Gz={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:QP,createNode:ZP};km.createPairs=ZP;km.pairs=Gz;km.resolvePairs=QP});var Rw=F(_w=>{"use strict";var XP=Je(),ww=Bs(),Uf=Gs(),Kz=Ks(),ek=Tm(),pa=class t extends Kz.YAMLSeq{constructor(){super(),this.add=Uf.YAMLMap.prototype.add.bind(this),this.delete=Uf.YAMLMap.prototype.delete.bind(this),this.get=Uf.YAMLMap.prototype.get.bind(this),this.has=Uf.YAMLMap.prototype.has.bind(this),this.set=Uf.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(XP.isPair(i)?(s=ww.toJS(i.key,"",r),o=ww.toJS(i.value,s,r)):s=ww.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=ek.createPairs(e,r,n),s=new this;return s.items=i.items,s}};pa.tag="tag:yaml.org,2002:omap";var Qz={collection:"seq",identify:t=>t instanceof Map,nodeClass:pa,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=ek.resolvePairs(t,e),n=[];for(let{key:i}of r.items)XP.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new pa,r)},createNode:(t,e,r)=>pa.from(t,e,r)};_w.YAMLOMap=pa;_w.omap=Qz});var sk=F(xw=>{"use strict";var tk=Ft();function rk({value:t,source:e},r){return e&&(t?nk:ik).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var nk={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 tk.Scalar(!0),stringify:rk},ik={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 tk.Scalar(!1),stringify:rk};xw.falseTag=ik;xw.trueTag=nk});var ok=F(Am=>{"use strict";var Zz=Ft(),Cw=rc(),Xz={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:Cw.stringifyNumber},eJ={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():Cw.stringifyNumber(t)}},tJ={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 Zz.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:Cw.stringifyNumber};Am.float=tJ;Am.floatExp=eJ;Am.floatNaN=Xz});var lk=F(Bf=>{"use strict";var ak=rc(),Hf=t=>typeof t=="bigint"||Number.isInteger(t);function qm(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 Ew(t,e,r){let{value:n}=t;if(Hf(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return ak.stringifyNumber(t)}var rJ={identify:Hf,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>qm(t,2,2,r),stringify:t=>Ew(t,2,"0b")},nJ={identify:Hf,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>qm(t,1,8,r),stringify:t=>Ew(t,8,"0")},iJ={identify:Hf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>qm(t,0,10,r),stringify:ak.stringifyNumber},sJ={identify:Hf,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>qm(t,2,16,r),stringify:t=>Ew(t,16,"0x")};Bf.int=iJ;Bf.intBin=rJ;Bf.intHex=sJ;Bf.intOct=nJ});var Iw=F(Ow=>{"use strict";var Nm=Je(),$m=Js(),Mm=Gs(),ha=class t extends Mm.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;Nm.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new $m.Pair(e.key,null):r=new $m.Pair(e,null),Mm.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Mm.findPair(this.items,e);return!r&&Nm.isPair(n)?Nm.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=Mm.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new $m.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($m.createPair(o,null,n));return s}};ha.tag="tag:yaml.org,2002:set";var oJ={collection:"map",identify:t=>t instanceof Set,nodeClass:ha,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>ha.from(t,e,r),resolve(t,e){if(Nm.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new ha,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Ow.YAMLSet=ha;Ow.set=oJ});var kw=F(Dm=>{"use strict";var aJ=rc();function Pw(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 ck(t){let{value:e}=t,r=o=>o;if(typeof e=="bigint")r=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return aJ.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 lJ={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})=>Pw(t,r),stringify:ck},cJ={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=>Pw(t,!1),stringify:ck},uk={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(uk.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,d=Date.UTC(r,n-1,i,s||0,o||0,l||0,f),m=e[8];if(m&&m!=="Z"){let g=Pw(m,!1);Math.abs(g)<30&&(g*=60),d-=6e4*g}return new Date(d)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Dm.floatTime=cJ;Dm.intTime=lJ;Dm.timestamp=uk});var pk=F(dk=>{"use strict";var uJ=ec(),fJ=xm(),dJ=tc(),pJ=Lf(),hJ=bw(),fk=sk(),Tw=ok(),Fm=lk(),mJ=gm(),gJ=Rw(),yJ=Tm(),vJ=Iw(),Aw=kw(),bJ=[uJ.map,dJ.seq,pJ.string,fJ.nullTag,fk.trueTag,fk.falseTag,Fm.intBin,Fm.intOct,Fm.int,Fm.intHex,Tw.floatNaN,Tw.floatExp,Tw.float,hJ.binary,mJ.merge,gJ.omap,yJ.pairs,vJ.set,Aw.intTime,Aw.floatTime,Aw.timestamp];dk.schema=bJ});var Rk=F(Mw=>{"use strict";var yk=ec(),SJ=xm(),vk=tc(),wJ=Lf(),_J=fw(),qw=pw(),$w=mw(),RJ=zP(),xJ=GP(),bk=bw(),Vf=gm(),Sk=Rw(),wk=Tm(),hk=pk(),_k=Iw(),Lm=kw(),mk=new Map([["core",RJ.schema],["failsafe",[yk.map,vk.seq,wJ.string]],["json",xJ.schema],["yaml11",hk.schema],["yaml-1.1",hk.schema]]),gk={binary:bk.binary,bool:_J.boolTag,float:qw.float,floatExp:qw.floatExp,floatNaN:qw.floatNaN,floatTime:Lm.floatTime,int:$w.int,intHex:$w.intHex,intOct:$w.intOct,intTime:Lm.intTime,map:yk.map,merge:Vf.merge,null:SJ.nullTag,omap:Sk.omap,pairs:wk.pairs,seq:vk.seq,set:_k.set,timestamp:Lm.timestamp},CJ={"tag:yaml.org,2002:binary":bk.binary,"tag:yaml.org,2002:merge":Vf.merge,"tag:yaml.org,2002:omap":Sk.omap,"tag:yaml.org,2002:pairs":wk.pairs,"tag:yaml.org,2002:set":_k.set,"tag:yaml.org,2002:timestamp":Lm.timestamp};function EJ(t,e,r){let n=mk.get(e);if(n&&!t)return r&&!n.includes(Vf.merge)?n.concat(Vf.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(mk.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(Vf.merge)),i.reduce((s,o)=>{let l=typeof o=="string"?gk[o]:o;if(!l){let f=JSON.stringify(o),d=Object.keys(gk).map(m=>JSON.stringify(m)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${d}`)}return s.includes(l)||s.push(l),s},[])}Mw.coreKnownTags=CJ;Mw.getTags=EJ});var Fw=F(xk=>{"use strict";var Nw=Je(),OJ=ec(),IJ=tc(),PJ=Lf(),jm=Rk(),kJ=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,Dw=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(e)?jm.getTags(e,"compat"):e?jm.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?jm.coreKnownTags:{},this.tags=jm.getTags(r,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,Nw.MAP,{value:OJ.map}),Object.defineProperty(this,Nw.SCALAR,{value:PJ.string}),Object.defineProperty(this,Nw.SEQ,{value:IJ.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?kJ:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};xk.Schema=Dw});var Ek=F(Ck=>{"use strict";var TJ=Je(),Lw=Nf(),Wf=Af();function AJ(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=Lw.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let f=s(t.commentBefore);r.unshift(Wf.indentComment(f,""))}let o=!1,l=null;if(t.contents){if(TJ.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let m=s(t.contents.commentBefore);r.push(Wf.indentComment(m,""))}i.forceBlockIndent=!!t.comment,l=t.contents.comment}let f=l?void 0:()=>o=!0,d=Lw.stringify(t.contents,i,()=>l=null,f);l&&(d+=Wf.lineComment(d,"",s(l))),(d[0]==="|"||d[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${d}`:r.push(d)}else r.push(Lw.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let f=s(t.comment);f.includes(`
|
|
149
|
-
`)?(r.push("..."),r.push(Wf.indentComment(f,""))):r.push(`... ${f}`)}else r.push("...");else{let f=t.comment;f&&
|
|
148
|
+
${s.comment}`:n.comment}n=i}t.items[r]=Pm.isPair(n)?n:new Sw.Pair(n)}}else e("Expected a sequence for this tag");return t}function ek(t,e,r){let{replacer:n}=r,i=new Kz.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let a of e){typeof n=="function"&&(a=n.call(e,String(s++),a));let l,f;if(Array.isArray(a))if(a.length===2)l=a[0],f=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){let d=Object.keys(a);if(d.length===1)l=d[0],f=a[l];else throw new TypeError(`Expected tuple with one key, not ${d.length} keys`)}else l=a;i.items.push(Sw.createPair(l,f,r))}return i}var Qz={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:XP,createNode:ek};km.createPairs=ek;km.pairs=Qz;km.resolvePairs=XP});var Rw=F(_w=>{"use strict";var tk=Je(),ww=Bs(),Uf=Gs(),Zz=Ks(),rk=Tm(),pa=class t extends Zz.YAMLSeq{constructor(){super(),this.add=Uf.YAMLMap.prototype.add.bind(this),this.delete=Uf.YAMLMap.prototype.delete.bind(this),this.get=Uf.YAMLMap.prototype.get.bind(this),this.has=Uf.YAMLMap.prototype.has.bind(this),this.set=Uf.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,a;if(tk.isPair(i)?(s=ww.toJS(i.key,"",r),a=ww.toJS(i.value,s,r)):s=ww.toJS(i,"",r),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,a)}return n}static from(e,r,n){let i=rk.createPairs(e,r,n),s=new this;return s.items=i.items,s}};pa.tag="tag:yaml.org,2002:omap";var Xz={collection:"seq",identify:t=>t instanceof Map,nodeClass:pa,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=rk.resolvePairs(t,e),n=[];for(let{key:i}of r.items)tk.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new pa,r)},createNode:(t,e,r)=>pa.from(t,e,r)};_w.YAMLOMap=pa;_w.omap=Xz});var ak=F(xw=>{"use strict";var nk=Ft();function ik({value:t,source:e},r){return e&&(t?sk:ok).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var sk={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 nk.Scalar(!0),stringify:ik},ok={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 nk.Scalar(!1),stringify:ik};xw.falseTag=ok;xw.trueTag=sk});var lk=F(Am=>{"use strict";var eJ=Ft(),Cw=rc(),tJ={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:Cw.stringifyNumber},rJ={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():Cw.stringifyNumber(t)}},nJ={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 eJ.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:Cw.stringifyNumber};Am.float=nJ;Am.floatExp=rJ;Am.floatNaN=tJ});var uk=F(Bf=>{"use strict";var ck=rc(),Hf=t=>typeof t=="bigint"||Number.isInteger(t);function qm(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 a=BigInt(t);return i==="-"?BigInt(-1)*a:a}let s=parseInt(t,r);return i==="-"?-1*s:s}function Ew(t,e,r){let{value:n}=t;if(Hf(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return ck.stringifyNumber(t)}var iJ={identify:Hf,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>qm(t,2,2,r),stringify:t=>Ew(t,2,"0b")},sJ={identify:Hf,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>qm(t,1,8,r),stringify:t=>Ew(t,8,"0")},oJ={identify:Hf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>qm(t,0,10,r),stringify:ck.stringifyNumber},aJ={identify:Hf,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>qm(t,2,16,r),stringify:t=>Ew(t,16,"0x")};Bf.int=oJ;Bf.intBin=iJ;Bf.intHex=aJ;Bf.intOct=sJ});var Iw=F(Ow=>{"use strict";var Nm=Je(),$m=Js(),Mm=Gs(),ha=class t extends Mm.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;Nm.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new $m.Pair(e.key,null):r=new $m.Pair(e,null),Mm.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=Mm.findPair(this.items,e);return!r&&Nm.isPair(n)?Nm.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=Mm.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new $m.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 a of r)typeof i=="function"&&(a=i.call(r,a,a)),s.items.push($m.createPair(a,null,n));return s}};ha.tag="tag:yaml.org,2002:set";var lJ={collection:"map",identify:t=>t instanceof Set,nodeClass:ha,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>ha.from(t,e,r),resolve(t,e){if(Nm.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new ha,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Ow.YAMLSet=ha;Ow.set=lJ});var kw=F(Dm=>{"use strict";var cJ=rc();function Pw(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=a=>e?BigInt(a):Number(a),s=n.replace(/_/g,"").split(":").reduce((a,l)=>a*i(60)+i(l),i(0));return r==="-"?i(-1)*s:s}function fk(t){let{value:e}=t,r=a=>a;if(typeof e=="bigint")r=a=>BigInt(a);else if(isNaN(e)||!isFinite(e))return cJ.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(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var uJ={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})=>Pw(t,r),stringify:fk},fJ={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=>Pw(t,!1),stringify:fk},dk={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(dk.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,s,a,l]=e.map(Number),f=e[7]?Number((e[7]+"00").substr(1,3)):0,d=Date.UTC(r,n-1,i,s||0,a||0,l||0,f),m=e[8];if(m&&m!=="Z"){let g=Pw(m,!1);Math.abs(g)<30&&(g*=60),d-=6e4*g}return new Date(d)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};Dm.floatTime=fJ;Dm.intTime=uJ;Dm.timestamp=dk});var mk=F(hk=>{"use strict";var dJ=ec(),pJ=xm(),hJ=tc(),mJ=Lf(),gJ=bw(),pk=ak(),Tw=lk(),Fm=uk(),yJ=gm(),vJ=Rw(),bJ=Tm(),SJ=Iw(),Aw=kw(),wJ=[dJ.map,hJ.seq,mJ.string,pJ.nullTag,pk.trueTag,pk.falseTag,Fm.intBin,Fm.intOct,Fm.int,Fm.intHex,Tw.floatNaN,Tw.floatExp,Tw.float,gJ.binary,yJ.merge,vJ.omap,bJ.pairs,SJ.set,Aw.intTime,Aw.floatTime,Aw.timestamp];hk.schema=wJ});var Ck=F(Mw=>{"use strict";var bk=ec(),_J=xm(),Sk=tc(),RJ=Lf(),xJ=fw(),qw=pw(),$w=mw(),CJ=YP(),EJ=QP(),wk=bw(),Vf=gm(),_k=Rw(),Rk=Tm(),gk=mk(),xk=Iw(),Lm=kw(),yk=new Map([["core",CJ.schema],["failsafe",[bk.map,Sk.seq,RJ.string]],["json",EJ.schema],["yaml11",gk.schema],["yaml-1.1",gk.schema]]),vk={binary:wk.binary,bool:xJ.boolTag,float:qw.float,floatExp:qw.floatExp,floatNaN:qw.floatNaN,floatTime:Lm.floatTime,int:$w.int,intHex:$w.intHex,intOct:$w.intOct,intTime:Lm.intTime,map:bk.map,merge:Vf.merge,null:_J.nullTag,omap:_k.omap,pairs:Rk.pairs,seq:Sk.seq,set:xk.set,timestamp:Lm.timestamp},OJ={"tag:yaml.org,2002:binary":wk.binary,"tag:yaml.org,2002:merge":Vf.merge,"tag:yaml.org,2002:omap":_k.omap,"tag:yaml.org,2002:pairs":Rk.pairs,"tag:yaml.org,2002:set":xk.set,"tag:yaml.org,2002:timestamp":Lm.timestamp};function IJ(t,e,r){let n=yk.get(e);if(n&&!t)return r&&!n.includes(Vf.merge)?n.concat(Vf.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(yk.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).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(Vf.merge)),i.reduce((s,a)=>{let l=typeof a=="string"?vk[a]:a;if(!l){let f=JSON.stringify(a),d=Object.keys(vk).map(m=>JSON.stringify(m)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${d}`)}return s.includes(l)||s.push(l),s},[])}Mw.coreKnownTags=OJ;Mw.getTags=IJ});var Fw=F(Ek=>{"use strict";var Nw=Je(),PJ=ec(),kJ=tc(),TJ=Lf(),jm=Ck(),AJ=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,Dw=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:a,toStringDefaults:l}){this.compat=Array.isArray(e)?jm.getTags(e,"compat"):e?jm.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?jm.coreKnownTags:{},this.tags=jm.getTags(r,this.name,n),this.toStringOptions=l??null,Object.defineProperty(this,Nw.MAP,{value:PJ.map}),Object.defineProperty(this,Nw.SCALAR,{value:TJ.string}),Object.defineProperty(this,Nw.SEQ,{value:kJ.seq}),this.sortMapEntries=typeof a=="function"?a:a===!0?AJ:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Ek.Schema=Dw});var Ik=F(Ok=>{"use strict";var qJ=Je(),Lw=Nf(),Wf=Af();function $J(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=Lw.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let f=s(t.commentBefore);r.unshift(Wf.indentComment(f,""))}let a=!1,l=null;if(t.contents){if(qJ.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let m=s(t.contents.commentBefore);r.push(Wf.indentComment(m,""))}i.forceBlockIndent=!!t.comment,l=t.contents.comment}let f=l?void 0:()=>a=!0,d=Lw.stringify(t.contents,i,()=>l=null,f);l&&(d+=Wf.lineComment(d,"",s(l))),(d[0]==="|"||d[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${d}`:r.push(d)}else r.push(Lw.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let f=s(t.comment);f.includes(`
|
|
149
|
+
`)?(r.push("..."),r.push(Wf.indentComment(f,""))):r.push(`... ${f}`)}else r.push("...");else{let f=t.comment;f&&a&&(f=f.replace(/^\n+/,"")),f&&((!a||l)&&r[r.length-1]!==""&&r.push(""),r.push(Wf.indentComment(s(f),"")))}return r.join(`
|
|
150
150
|
`)+`
|
|
151
|
-
`}
|
|
152
|
-
`),
|
|
151
|
+
`}Ok.stringifyDocument=$J});var zf=F(Pk=>{"use strict";var MJ=kf(),nc=om(),xn=Je(),NJ=Js(),DJ=Bs(),FJ=Fw(),LJ=Ik(),jw=rm(),jJ=V0(),UJ=Tf(),Uw=B0(),Hw=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,xn.NODE_TYPE,{value:xn.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:a}=s;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new Uw.Directives({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[xn.NODE_TYPE]:{value:xn.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=xn.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){ic(this.contents)&&this.contents.add(e)}addIn(e,r){ic(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=jw.anchorNames(this);e.anchor=!r||n.has(r)?jw.findNewAnchor(r||"a",n):r}return new MJ.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 T=U=>typeof U=="number"||U instanceof String||U instanceof Number,A=r.filter(T).map(String);A.length>0&&(r=r.concat(A)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:s,anchorPrefix:a,flow:l,keepUndefined:f,onTagObj:d,tag:m}=n??{},{onAnchor:g,setAnchors:y,sourceObjects:w}=jw.createNodeAnchors(this,a||"a"),C={aliasDuplicateObjects:s??!0,keepUndefined:f??!1,onAnchor:g,onTagObj:d,replacer:i,schema:this.schema,sourceObjects:w},R=UJ.createNode(e,m,C);return l&&xn.isCollection(R)&&(R.flow=!0),y(),R}createPair(e,r,n={}){let i=this.createNode(e,null,n),s=this.createNode(r,null,n);return new NJ.Pair(i,s)}delete(e){return ic(this.contents)?this.contents.delete(e):!1}deleteIn(e){return nc.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):ic(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return xn.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return nc.isEmptyPath(e)?!r&&xn.isScalar(this.contents)?this.contents.value:this.contents:xn.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return xn.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return nc.isEmptyPath(e)?this.contents!==void 0:xn.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=nc.collectionFromPath(this.schema,[e],r):ic(this.contents)&&this.contents.set(e,r)}setIn(e,r){nc.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=nc.collectionFromPath(this.schema,Array.from(e),r):ic(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 Uw.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 Uw.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 FJ.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:a}={}){let l={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},f=DJ.toJS(this.contents,r??"",l);if(typeof s=="function")for(let{count:d,res:m}of l.anchors.values())s(m,d);return typeof a=="function"?jJ.applyReviver(a,{"":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 LJ.stringifyDocument(this,e)}};function ic(t){if(xn.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}Pk.Document=Hw});var Gf=F(Yf=>{"use strict";var Jf=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},Bw=class extends Jf{constructor(e,r,n){super("YAMLParseError",e,r,n)}},Vw=class extends Jf{constructor(e,r,n){super("YAMLWarning",e,r,n)}},HJ=(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,a=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(s>=60&&a.length>80){let l=Math.min(s-39,a.length-79);a="\u2026"+a.substring(l),s-=l-1}if(a.length>80&&(a=a.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(a.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
|
+
`),a=l+a}if(/[^ ]/.test(a)){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 d=" ".repeat(s)+"^".repeat(l);r.message+=`:
|
|
153
153
|
|
|
154
|
-
${
|
|
154
|
+
${a}
|
|
155
155
|
${d}
|
|
156
|
-
`}};Yf.YAMLError=Jf;Yf.YAMLParseError=Bw;Yf.YAMLWarning=Vw;Yf.prettifyError=
|
|
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(Ww(e.key)||Ww(e.value))return!0}return!1;default:return!0}}
|
|
158
|
-
`+R.comment:l.comment=R.comment);continue}(R.newlineAfterProp||
|
|
159
|
-
`+B.comment:U.comment=B.comment);let
|
|
160
|
-
`+X.comment:d.comment=X.comment),g=X.end;continue}!
|
|
161
|
-
`+
|
|
162
|
-
`+k.comment:_.comment=k.comment);let j=new
|
|
163
|
-
`+
|
|
164
|
-
`.repeat(Math.max(1,
|
|
165
|
-
`;for(let R=m;R<l;++R){let[
|
|
166
|
-
`):
|
|
156
|
+
`}};Yf.YAMLError=Jf;Yf.YAMLParseError=Bw;Yf.YAMLWarning=Vw;Yf.prettifyError=HJ});var Kf=F(kk=>{"use strict";function BJ(t,{flow:e,indicator:r,next:n,offset:i,onError:s,parentIndent:a,startOnNewline:l}){let f=!1,d=l,m=l,g="",y="",w=!1,C=!1,R=null,T=null,A=null,U=null,B=null,V=null,W=null;for(let _ of t)switch(C&&(_.type!=="space"&&_.type!=="newline"&&_.type!=="comma"&&s(_.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),C=!1),R&&(d&&_.type!=="comment"&&_.type!=="newline"&&s(R,"TAB_AS_INDENT","Tabs are not allowed as indentation"),R=null),_.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&_.source.includes(" ")&&(R=_),m=!0;break;case"comment":{m||s(_,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let k=_.source.substring(1)||" ";g?g+=y+k:g=k,y="",d=!1;break}case"newline":d?g?g+=_.source:(!V||r!=="seq-item-ind")&&(f=!0):y+=_.source,d=!0,w=!0,(T||A)&&(U=_),m=!0;break;case"anchor":T&&s(_,"MULTIPLE_ANCHORS","A node can have at most one anchor"),_.source.endsWith(":")&&s(_.offset+_.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),T=_,W??(W=_.offset),d=!1,m=!1,C=!0;break;case"tag":{A&&s(_,"MULTIPLE_TAGS","A node can have at most one tag"),A=_,W??(W=_.offset),d=!1,m=!1,C=!0;break}case r:(T||A)&&s(_,"BAD_PROP_ORDER",`Anchors and tags must be after the ${_.source} indicator`),V&&s(_,"UNEXPECTED_TOKEN",`Unexpected ${_.source} in ${e??"collection"}`),V=_,d=r==="seq-item-ind"||r==="explicit-key-ind",m=!1;break;case"comma":if(e){B&&s(_,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),B=_,d=!1,m=!1;break}default:s(_,"UNEXPECTED_TOKEN",`Unexpected ${_.type} token`),d=!1,m=!1}let X=t[t.length-1],P=X?X.offset+X.source.length:i;return C&&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"),R&&(d&&R.indent<=a||n?.type==="block-map"||n?.type==="block-seq")&&s(R,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:B,found:V,spaceBefore:f,comment:g,hasNewline:w,anchor:T,tag:A,newlineAfterProp:U,end:P,start:W??P}}kk.resolveProps=BJ});var Um=F(Tk=>{"use strict";function Ww(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(Ww(e.key)||Ww(e.value))return!0}return!1;default:return!0}}Tk.containsNewline=Ww});var zw=F(Ak=>{"use strict";var VJ=Um();function WJ(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&VJ.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Ak.flowIndentCheck=WJ});var Jw=F($k=>{"use strict";var qk=Je();function zJ(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(s,a)=>s===a||qk.isScalar(s)&&qk.isScalar(a)&&s.value===a.value;return e.some(s=>i(s.key,r))}$k.mapIncludes=zJ});var jk=F(Lk=>{"use strict";var Mk=Js(),JJ=Gs(),Nk=Kf(),YJ=Um(),Dk=zw(),GJ=Jw(),Fk="All mapping items must start at the same column";function KJ({composeNode:t,composeEmptyNode:e},r,n,i,s){let a=s?.nodeClass??JJ.YAMLMap,l=new a(r.schema);r.atRoot&&(r.atRoot=!1);let f=n.offset,d=null;for(let m of n.items){let{start:g,key:y,sep:w,value:C}=m,R=Nk.resolveProps(g,{indicator:"explicit-key-ind",next:y??w?.[0],offset:f,onError:i,parentIndent:n.indent,startOnNewline:!0}),T=!R.found;if(T){if(y&&(y.type==="block-seq"?i(f,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==n.indent&&i(f,"BAD_INDENT",Fk)),!R.anchor&&!R.tag&&!w){d=R.end,R.comment&&(l.comment?l.comment+=`
|
|
158
|
+
`+R.comment:l.comment=R.comment);continue}(R.newlineAfterProp||YJ.containsNewline(y))&&i(y??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else R.found?.indent!==n.indent&&i(f,"BAD_INDENT",Fk);r.atKey=!0;let A=R.end,U=y?t(r,y,R,i):e(r,A,g,null,R,i);r.schema.compat&&Dk.flowIndentCheck(n.indent,y,i),r.atKey=!1,GJ.mapIncludes(r,l.items,U)&&i(A,"DUPLICATE_KEY","Map keys must be unique");let B=Nk.resolveProps(w??[],{indicator:"map-value-ind",next:C,offset:U.range[2],onError:i,parentIndent:n.indent,startOnNewline:!y||y.type==="block-scalar"});if(f=B.end,B.found){T&&(C?.type==="block-map"&&!B.hasNewline&&i(f,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&R.start<B.found.offset-1024&&i(U.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let V=C?t(r,C,B,i):e(r,f,w,null,B,i);r.schema.compat&&Dk.flowIndentCheck(n.indent,C,i),f=V.range[2];let W=new Mk.Pair(U,V);r.options.keepSourceTokens&&(W.srcToken=m),l.items.push(W)}else{T&&i(U.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),B.comment&&(U.comment?U.comment+=`
|
|
159
|
+
`+B.comment:U.comment=B.comment);let V=new Mk.Pair(U);r.options.keepSourceTokens&&(V.srcToken=m),l.items.push(V)}}return d&&d<f&&i(d,"IMPOSSIBLE","Map comment with trailing content"),l.range=[n.offset,f,d??f],l}Lk.resolveBlockMap=KJ});var Hk=F(Uk=>{"use strict";var QJ=Ks(),ZJ=Kf(),XJ=zw();function eY({composeNode:t,composeEmptyNode:e},r,n,i,s){let a=s?.nodeClass??QJ.YAMLSeq,l=new a(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let f=n.offset,d=null;for(let{start:m,value:g}of n.items){let y=ZJ.resolveProps(m,{indicator:"seq-item-ind",next:g,offset:f,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||g)g?.type==="block-seq"?i(y.end,"BAD_INDENT","All sequence items must start at the same column"):i(f,"MISSING_CHAR","Sequence item without - indicator");else{d=y.end,y.comment&&(l.comment=y.comment);continue}let w=g?t(r,g,y,i):e(r,y.end,m,null,y,i);r.schema.compat&&XJ.flowIndentCheck(n.indent,g,i),f=w.range[2],l.items.push(w)}return l.range=[n.offset,f,d??f],l}Uk.resolveBlockSeq=eY});var sc=F(Bk=>{"use strict";function tY(t,e,r,n){let i="";if(t){let s=!1,a="";for(let l of t){let{source:f,type:d}=l;switch(d){case"space":s=!0;break;case"comment":{r&&!s&&n(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let m=f.substring(1)||" ";i?i+=a+m:i=m,a="";break}case"newline":i&&(a+=f),s=!0;break;default:n(l,"UNEXPECTED_TOKEN",`Unexpected ${d} at node end`)}e+=f.length}}return{comment:i,offset:e}}Bk.resolveEnd=tY});var Jk=F(zk=>{"use strict";var rY=Je(),nY=Js(),Vk=Gs(),iY=Ks(),sY=sc(),Wk=Kf(),oY=Um(),aY=Jw(),Yw="Block collections are not allowed within flow collections",Gw=t=>t&&(t.type==="block-map"||t.type==="block-seq");function lY({composeNode:t,composeEmptyNode:e},r,n,i,s){let a=n.start.source==="{",l=a?"flow map":"flow sequence",f=s?.nodeClass??(a?Vk.YAMLMap:iY.YAMLSeq),d=new f(r.schema);d.flow=!0;let m=r.atRoot;m&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let g=n.offset+n.start.source.length;for(let T=0;T<n.items.length;++T){let A=n.items[T],{start:U,key:B,sep:V,value:W}=A,X=Wk.resolveProps(U,{flow:l,indicator:"explicit-key-ind",next:B??V?.[0],offset:g,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!X.found){if(!X.anchor&&!X.tag&&!V&&!W){T===0&&X.comma?i(X.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):T<n.items.length-1&&i(X.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),X.comment&&(d.comment?d.comment+=`
|
|
160
|
+
`+X.comment:d.comment=X.comment),g=X.end;continue}!a&&r.options.strict&&oY.containsNewline(B)&&i(B,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(T===0)X.comma&&i(X.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(X.comma||i(X.start,"MISSING_CHAR",`Missing , between ${l} items`),X.comment){let P="";e:for(let _ of U)switch(_.type){case"comma":case"space":break;case"comment":P=_.source.substring(1);break e;default:break e}if(P){let _=d.items[d.items.length-1];rY.isPair(_)&&(_=_.value??_.key),_.comment?_.comment+=`
|
|
161
|
+
`+P:_.comment=P,X.comment=X.comment.substring(P.length+1)}}if(!a&&!V&&!X.found){let P=W?t(r,W,X,i):e(r,X.end,V,null,X,i);d.items.push(P),g=P.range[2],Gw(W)&&i(P.range,"BLOCK_IN_FLOW",Yw)}else{r.atKey=!0;let P=X.end,_=B?t(r,B,X,i):e(r,P,U,null,X,i);Gw(B)&&i(_.range,"BLOCK_IN_FLOW",Yw),r.atKey=!1;let k=Wk.resolveProps(V??[],{flow:l,indicator:"map-value-ind",next:W,offset:_.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(k.found){if(!a&&!X.found&&r.options.strict){if(V)for(let $ of V){if($===k.found)break;if($.type==="newline"){i($,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}X.start<k.found.offset-1024&&i(k.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else W&&("source"in W&&W.source?.[0]===":"?i(W,"MISSING_CHAR",`Missing space after : in ${l}`):i(k.start,"MISSING_CHAR",`Missing , or : between ${l} items`));let M=W?t(r,W,k,i):k.found?e(r,k.end,V,null,k,i):null;M?Gw(W)&&i(M.range,"BLOCK_IN_FLOW",Yw):k.comment&&(_.comment?_.comment+=`
|
|
162
|
+
`+k.comment:_.comment=k.comment);let j=new nY.Pair(_,M);if(r.options.keepSourceTokens&&(j.srcToken=A),a){let $=d;aY.mapIncludes(r,$.items,_)&&i(P,"DUPLICATE_KEY","Map keys must be unique"),$.items.push(j)}else{let $=new Vk.YAMLMap(r.schema);$.flow=!0,$.items.push(j);let Y=(M??_).range;$.range=[_.range[0],Y[1],Y[2]],d.items.push($)}g=M?M.range[2]:k.end}}let y=a?"}":"]",[w,...C]=n.end,R=g;if(w?.source===y)R=w.offset+w.source.length;else{let T=l[0].toUpperCase()+l.substring(1),A=m?`${T} must end with a ${y}`:`${T} in block collection must be sufficiently indented and end with a ${y}`;i(g,m?"MISSING_CHAR":"BAD_INDENT",A),w&&w.source.length!==1&&C.unshift(w)}if(C.length>0){let T=sY.resolveEnd(C,R,r.options.strict,i);T.comment&&(d.comment?d.comment+=`
|
|
163
|
+
`+T.comment:d.comment=T.comment),d.range=[n.offset,R,T.offset]}else d.range=[n.offset,R,R];return d}zk.resolveFlowCollection=lY});var Gk=F(Yk=>{"use strict";var cY=Je(),uY=Ft(),fY=Gs(),dY=Ks(),pY=jk(),hY=Hk(),mY=Jk();function Kw(t,e,r,n,i,s){let a=r.type==="block-map"?pY.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?hY.resolveBlockSeq(t,e,r,n,s):mY.resolveFlowCollection(t,e,r,n,s),l=a.constructor;return i==="!"||i===l.tagName?(a.tag=l.tagName,a):(i&&(a.tag=i),a)}function gY(t,e,r,n,i){let s=n.tag,a=s?e.directives.tagName(s.source,y=>i(s,"TAG_RESOLVE_FAILED",y)):null;if(r.type==="block-seq"){let{anchor:y,newlineAfterProp:w}=n,C=y&&s?y.offset>s.offset?y:s:y??s;C&&(!w||w.offset<C.offset)&&i(C,"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||!a||a==="!"||a===fY.YAMLMap.tagName&&l==="map"||a===dY.YAMLSeq.tagName&&l==="seq")return Kw(t,e,r,i,a);let f=e.schema.tags.find(y=>y.tag===a&&y.collection===l);if(!f){let y=e.schema.knownTags[a];if(y?.collection===l)e.schema.tags.push(Object.assign({},y,{default:!1})),f=y;else return y?i(s,"BAD_COLLECTION_TYPE",`${y.tag} used for ${l} collection, but expects ${y.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),Kw(t,e,r,i,a)}let d=Kw(t,e,r,i,a,f),m=f.resolve?.(d,y=>i(s,"TAG_RESOLVE_FAILED",y),e.options)??d,g=cY.isNode(m)?m:new uY.Scalar(m);return g.range=d.range,g.tag=a,f?.format&&(g.format=f.format),g}Yk.composeCollection=gY});var Zw=F(Kk=>{"use strict";var Qw=Ft();function yY(t,e,r){let n=e.offset,i=vY(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let s=i.mode===">"?Qw.Scalar.BLOCK_FOLDED:Qw.Scalar.BLOCK_LITERAL,a=e.source?bY(e.source):[],l=a.length;for(let R=a.length-1;R>=0;--R){let T=a[R][1];if(T===""||T==="\r")l=R;else break}if(l===0){let R=i.chomp==="+"&&a.length>0?`
|
|
164
|
+
`.repeat(Math.max(1,a.length-1)):"",T=n+i.length;return e.source&&(T+=e.source.length),{value:R,type:s,comment:i.comment,range:[n,T,T]}}let f=e.indent+i.indent,d=e.offset+i.length,m=0;for(let R=0;R<l;++R){let[T,A]=a[R];if(A===""||A==="\r")i.indent===0&&T.length>f&&(f=T.length);else{T.length<f&&r(d+T.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(f=T.length),m=R,f===0&&!t.atRoot&&r(d,"BAD_INDENT","Block scalar values in collections must be indented");break}d+=T.length+A.length+1}for(let R=a.length-1;R>=l;--R)a[R][0].length>f&&(l=R+1);let g="",y="",w=!1;for(let R=0;R<m;++R)g+=a[R][0].slice(f)+`
|
|
165
|
+
`;for(let R=m;R<l;++R){let[T,A]=a[R];d+=T.length+A.length+1;let U=A[A.length-1]==="\r";if(U&&(A=A.slice(0,-1)),A&&T.length<f){let V=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(d-A.length-(U?2:1),"BAD_INDENT",V),T=""}s===Qw.Scalar.BLOCK_LITERAL?(g+=y+T.slice(f)+A,y=`
|
|
166
|
+
`):T.length>f||A[0]===" "?(y===" "?y=`
|
|
167
167
|
`:!w&&y===`
|
|
168
168
|
`&&(y=`
|
|
169
169
|
|
|
170
|
-
`),g+=y+
|
|
170
|
+
`),g+=y+T.slice(f)+A,y=`
|
|
171
171
|
`,w=!0):A===""?y===`
|
|
172
172
|
`?g+=`
|
|
173
173
|
`:y=`
|
|
174
|
-
`:(g+=y+A,y=" ",w=!1)}switch(i.chomp){case"-":break;case"+":for(let R=l;R<
|
|
175
|
-
`+
|
|
174
|
+
`:(g+=y+A,y=" ",w=!1)}switch(i.chomp){case"-":break;case"+":for(let R=l;R<a.length;++R)g+=`
|
|
175
|
+
`+a[R][0].slice(f);g[g.length-1]!==`
|
|
176
176
|
`&&(g+=`
|
|
177
177
|
`);break;default:g+=`
|
|
178
|
-
`}let C=n+i.length+e.source.length;return{value:g,type:s,comment:i.comment,range:[n,C,C]}}function
|
|
178
|
+
`}let C=n+i.length+e.source.length;return{value:g,type:s,comment:i.comment,range:[n,C,C]}}function vY({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],a=0,l="",f=-1;for(let y=1;y<i.length;++y){let w=i[y];if(!l&&(w==="-"||w==="+"))l=w;else{let C=Number(w);!a&&C?a=C:f===-1&&(f=t+y)}}f!==-1&&n(f,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let d=!1,m="",g=i.length;for(let y=1;y<e.length;++y){let w=e[y];switch(w.type){case"space":d=!0;case"newline":g+=w.source.length;break;case"comment":r&&!d&&n(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),g+=w.source.length,m=w.source.substring(1);break;case"error":n(w,"UNEXPECTED_TOKEN",w.message),g+=w.source.length;break;default:{let C=`Unexpected token in block scalar header: ${w.type}`;n(w,"UNEXPECTED_TOKEN",C);let R=w.source;R&&typeof R=="string"&&(g+=R.length)}}}return{mode:s,indent:a,chomp:l,comment:m,length:g}}function bY(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 a=1;a<e.length;a+=2)s.push([e[a],e[a+1]]);return s}Kk.resolveBlockScalar=yY});var e_=F(Zk=>{"use strict";var Xw=Ft(),SY=sc();function wY(t,e,r){let{offset:n,type:i,source:s,end:a}=t,l,f,d=(y,w,C)=>r(n+y,w,C);switch(i){case"scalar":l=Xw.Scalar.PLAIN,f=_Y(s,d);break;case"single-quoted-scalar":l=Xw.Scalar.QUOTE_SINGLE,f=RY(s,d);break;case"double-quoted-scalar":l=Xw.Scalar.QUOTE_DOUBLE,f=xY(s,d);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 m=n+s.length,g=SY.resolveEnd(a,m,e,r);return{value:f,type:l,comment:g.comment,range:[n,m,g.offset]}}function _Y(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}`),Qk(t)}function RY(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Qk(t.slice(1,-1)).replace(/''/g,"'")}function Qk(t){let e,r;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
179
179
|
`,"sy"),r=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
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=" ",
|
|
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=" ",a=e.lastIndex;for(r.lastIndex=a;n=r.exec(t);)n[1]===""?s===`
|
|
181
181
|
`?i+=s:s=`
|
|
182
|
-
`:(i+=s+n[1],s=" "),
|
|
182
|
+
`:(i+=s+n[1],s=" "),a=r.lastIndex;let l=/[ \t]*(.*)/sy;return l.lastIndex=a,n=l.exec(t),i+s+(n?.[1]??"")}function xY(t,e){let r="";for(let n=1;n<t.length-1;++n){let i=t[n];if(!(i==="\r"&&t[n+1]===`
|
|
183
183
|
`))if(i===`
|
|
184
|
-
`){let{fold:s,offset:
|
|
184
|
+
`){let{fold:s,offset:a}=CY(t,n);r+=s,n=a}else if(i==="\\"){let s=t[++n],a=EY[s];if(a)r+=a;else if(s===`
|
|
185
185
|
`)for(s=t[n+1];s===" "||s===" ";)s=t[++n+1];else if(s==="\r"&&t[n+1]===`
|
|
186
|
-
`)for(s=t[++n+1];s===" "||s===" ";)s=t[++n+1];else if(s==="x"||s==="u"||s==="U"){let l=s==="x"?2:s==="u"?4:8;r+=
|
|
187
|
-
`&&!(
|
|
188
|
-
`)&&(r+=n>s?t.slice(s,n+1):i)}else r+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function
|
|
186
|
+
`)for(s=t[++n+1];s===" "||s===" ";)s=t[++n+1];else if(s==="x"||s==="u"||s==="U"){let l=s==="x"?2:s==="u"?4:8;r+=OY(t,n+1,l,e),n+=l}else{let l=t.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),r+=l}}else if(i===" "||i===" "){let s=n,a=t[n+1];for(;a===" "||a===" ";)a=t[++n+1];a!==`
|
|
187
|
+
`&&!(a==="\r"&&t[n+2]===`
|
|
188
|
+
`)&&(r+=n>s?t.slice(s,n+1):i)}else r+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function CY(t,e){let r="",n=t[e+1];for(;(n===" "||n===" "||n===`
|
|
189
189
|
`||n==="\r")&&!(n==="\r"&&t[e+2]!==`
|
|
190
190
|
`);)n===`
|
|
191
191
|
`&&(r+=`
|
|
192
|
-
`),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}var
|
|
193
|
-
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
192
|
+
`),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}var EY={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 OY(t,e,r,n){let i=t.substr(e,r),a=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let l=t.substr(e-2,r+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}Zk.resolveFlowScalar=wY});var t1=F(e1=>{"use strict";var ma=Je(),Xk=Ft(),IY=Zw(),PY=e_();function kY(t,e,r,n){let{value:i,type:s,comment:a,range:l}=e.type==="block-scalar"?IY.resolveBlockScalar(t,e,n):PY.resolveFlowScalar(e,t.options.strict,n),f=r?t.directives.tagName(r.source,g=>n(r,"TAG_RESOLVE_FAILED",g)):null,d;t.options.stringKeys&&t.atKey?d=t.schema[ma.SCALAR]:f?d=TY(t.schema,i,f,r,n):e.type==="scalar"?d=AY(t,i,e,n):d=t.schema[ma.SCALAR];let m;try{let g=d.resolve(i,y=>n(r??e,"TAG_RESOLVE_FAILED",y),t.options);m=ma.isScalar(g)?g:new Xk.Scalar(g)}catch(g){let y=g instanceof Error?g.message:String(g);n(r??e,"TAG_RESOLVE_FAILED",y),m=new Xk.Scalar(i)}return m.range=l,m.source=i,s&&(m.type=s),f&&(m.tag=f),d.format&&(m.format=d.format),a&&(m.comment=a),m}function TY(t,e,r,n,i){if(r==="!")return t[ma.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 a=t.knownTags[r];return a&&!a.collection?(t.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[ma.SCALAR])}function AY({atKey:t,directives:e,schema:r},n,i,s){let a=r.tags.find(l=>(l.default===!0||t&&l.default==="key")&&l.test?.test(n))||r[ma.SCALAR];if(r.compat){let l=r.compat.find(f=>f.default&&f.test?.test(n))??r[ma.SCALAR];if(a.tag!==l.tag){let f=e.tagString(a.tag),d=e.tagString(l.tag),m=`Value may be parsed as either ${f} or ${d}`;s(i,"TAG_RESOLVE_FAILED",m,!0)}}return a}e1.composeScalar=kY});var n1=F(r1=>{"use strict";function qY(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}r1.emptyScalarPosition=qY});var o1=F(r_=>{"use strict";var $Y=kf(),MY=Je(),NY=Gk(),i1=t1(),DY=sc(),FY=n1(),LY={composeNode:s1,composeEmptyNode:t_};function s1(t,e,r,n){let i=t.atKey,{spaceBefore:s,comment:a,anchor:l,tag:f}=r,d,m=!0;switch(e.type){case"alias":d=jY(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":d=i1.composeScalar(t,e,f,n),l&&(d.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{d=NY.composeCollection(LY,t,e,r,n),l&&(d.anchor=l.source.substring(1))}catch(g){let y=g instanceof Error?g.message:String(g);n(e,"RESOURCE_EXHAUSTION",y)}break;default:{let g=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",g),m=!1}}return d??(d=t_(t,e.offset,void 0,null,r,n)),l&&d.anchor===""&&n(l,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!MY.isScalar(d)||typeof d.value!="string"||d.tag&&d.tag!=="tag:yaml.org,2002:str")&&n(f??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(d.spaceBefore=!0),a&&(e.type==="scalar"&&e.source===""?d.comment=a:d.commentBefore=a),t.options.keepSourceTokens&&m&&(d.srcToken=e),d}function t_(t,e,r,n,{spaceBefore:i,comment:s,anchor:a,tag:l,end:f},d){let m={type:"scalar",offset:FY.emptyScalarPosition(e,r,n),indent:-1,source:""},g=i1.composeScalar(t,m,l,d);return a&&(g.anchor=a.source.substring(1),g.anchor===""&&d(a,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(g.spaceBefore=!0),s&&(g.comment=s,g.range[2]=f),g}function jY({options:t},{offset:e,source:r,end:n},i){let s=new $Y.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 a=e+r.length,l=DY.resolveEnd(n,a,t.strict,i);return s.range=[e,a,l.offset],l.comment&&(s.comment=l.comment),s}r_.composeEmptyNode=t_;r_.composeNode=s1});var c1=F(l1=>{"use strict";var UY=zf(),a1=o1(),HY=sc(),BY=Kf();function VY(t,e,{offset:r,start:n,value:i,end:s},a){let l=Object.assign({_directives:e},t),f=new UY.Document(void 0,l),d={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},m=BY.resolveProps(n,{indicator:"doc-start",next:i??s?.[0],offset:r,onError:a,parentIndent:0,startOnNewline:!0});m.found&&(f.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!m.hasNewline&&a(m.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),f.contents=i?a1.composeNode(d,i,m,a):a1.composeEmptyNode(d,m.end,n,null,m,a);let g=f.contents.range[2],y=HY.resolveEnd(s,g,!1,a);return y.comment&&(f.comment=y.comment),f.range=[r,g,y.offset],f}l1.composeDoc=VY});var i_=F(d1=>{"use strict";var WY=it("process"),zY=B0(),JY=zf(),Qf=Gf(),u1=Je(),YY=c1(),GY=sc();function Zf(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 f1(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
|
-
`)+(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 n_=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,i,s)=>{let
|
|
197
|
-
${n}`:n;else if(i||e.directives.docStart||!s)e.commentBefore=n;else if(
|
|
198
|
-
${l}`:n}else{let
|
|
199
|
-
${
|
|
200
|
-
${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Qf.YAMLParseError(Zf(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new
|
|
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 n_=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,i,s)=>{let a=Zf(r);s?this.warnings.push(new Qf.YAMLWarning(a,n,i)):this.errors.push(new Qf.YAMLParseError(a,n,i))},this.directives=new zY.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=f1(this.prelude);if(n){let s=e.contents;if(r)e.comment=e.comment?`${e.comment}
|
|
197
|
+
${n}`:n;else if(i||e.directives.docStart||!s)e.commentBefore=n;else if(u1.isCollection(s)&&!s.flow&&s.items.length>0){let a=s.items[0];u1.isPair(a)&&(a=a.key);let l=a.commentBefore;a.commentBefore=l?`${n}
|
|
198
|
+
${l}`:n}else{let a=s.commentBefore;s.commentBefore=a?`${n}
|
|
199
|
+
${a}`:n}}if(r){for(let s=0;s<this.errors.length;++s)e.errors.push(this.errors[s]);for(let s=0;s<this.warnings.length;++s)e.warnings.push(this.warnings[s])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:f1(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(r,n)}*next(e){switch(WY.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,i)=>{let s=Zf(e);s[0]+=r,this.onError(s,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=YY.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Qf.YAMLParseError(Zf(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new Qf.YAMLParseError(Zf(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=GY.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
|
|
200
|
+
${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Qf.YAMLParseError(Zf(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new JY.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};d1.Composer=n_});var m1=F(Hm=>{"use strict";var KY=Zw(),QY=e_(),ZY=Gf(),p1=Mf();function XY(t,e=!0,r){if(t){let n=(i,s,a)=>{let l=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(l,s,a);else throw new ZY.YAMLParseError([l,l+1],s,a)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return QY.resolveFlowScalar(t,e,n);case"block-scalar":return KY.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function eG(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:s=-1,type:a="PLAIN"}=e,l=p1.stringifyString({type:a,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),f=e.end??[{type:"newline",offset:-1,indent:n,source:`
|
|
201
201
|
`}];switch(l[0]){case"|":case">":{let d=l.indexOf(`
|
|
202
202
|
`),m=l.substring(0,d),g=l.substring(d+1)+`
|
|
203
|
-
`,y=[{type:"block-scalar-header",offset:s,indent:n,source:m}];return
|
|
204
|
-
`}),{type:"block-scalar",offset:s,indent:n,props:y,source:g}}case'"':return{type:"double-quoted-scalar",offset:s,indent:n,source:l,end:f};case"'":return{type:"single-quoted-scalar",offset:s,indent:n,source:l,end:f};default:return{type:"scalar",offset:s,indent:n,source:l,end:f}}}function
|
|
203
|
+
`,y=[{type:"block-scalar-header",offset:s,indent:n,source:m}];return h1(y,f)||y.push({type:"newline",offset:-1,indent:n,source:`
|
|
204
|
+
`}),{type:"block-scalar",offset:s,indent:n,props:y,source:g}}case'"':return{type:"double-quoted-scalar",offset:s,indent:n,source:l,end:f};case"'":return{type:"single-quoted-scalar",offset:s,indent:n,source:l,end:f};default:return{type:"scalar",offset:s,indent:n,source:l,end:f}}}function tG(t,e,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:s=!1,type:a}=r,l="indent"in t?t.indent:null;if(n&&typeof l=="number"&&(l+=2),!a)switch(t.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{let d=t.props[0];if(d.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a=d.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}let f=p1.stringifyString({type:a,value:e},{implicitKey:i||l===null,indent:l!==null&&l>0?" ".repeat(l):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(f[0]){case"|":case">":rG(t,f);break;case'"':s_(t,f,"double-quoted-scalar");break;case"'":s_(t,f,"single-quoted-scalar");break;default:s_(t,f,"scalar")}}function rG(t,e){let r=e.indexOf(`
|
|
205
205
|
`),n=e.substring(0,r),i=e.substring(r+1)+`
|
|
206
|
-
`;if(t.type==="block-scalar"){let s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=n,t.source=i}else{let{offset:s}=t,
|
|
207
|
-
`});for(let f of Object.keys(t))f!=="type"&&f!=="offset"&&delete t[f];Object.assign(t,{type:"block-scalar",indent:
|
|
208
|
-
`};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}Hm.createScalarToken=
|
|
206
|
+
`;if(t.type==="block-scalar"){let s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=n,t.source=i}else{let{offset:s}=t,a="indent"in t?t.indent:-1,l=[{type:"block-scalar-header",offset:s,indent:a,source:n}];h1(l,"end"in t?t.end:void 0)||l.push({type:"newline",offset:-1,indent:a,source:`
|
|
207
|
+
`});for(let f of Object.keys(t))f!=="type"&&f!=="offset"&&delete t[f];Object.assign(t,{type:"block-scalar",indent:a,props:l,source:i})}}function h1(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}function s_(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let s of n)s.offset+=i;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
|
|
208
|
+
`};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}Hm.createScalarToken=eG;Hm.resolveAsScalar=XY;Hm.setScalarValue=tG});var y1=F(g1=>{"use strict";var nG=t=>"type"in t?Vm(t):Bm(t);function Vm(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Vm(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=Bm(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=Bm(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=Bm(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function Bm({start:t,key:e,sep:r,value:n}){let i="";for(let s of t)i+=s.source;if(e&&(i+=Vm(e)),r)for(let s of r)i+=s.source;return n&&(i+=Vm(n)),i}g1.stringify=nG});var w1=F(S1=>{"use strict";var o_=Symbol("break visit"),iG=Symbol("skip children"),v1=Symbol("remove item");function ga(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),b1(Object.freeze([]),t,e)}ga.BREAK=o_;ga.SKIP=iG;ga.REMOVE=v1;ga.itemAtPath=(t,e)=>{let r=t;for(let[n,i]of e){let s=r?.[n];if(s&&"items"in s)r=s.items[i];else return}return r};ga.parentCollection=(t,e)=>{let r=ga.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function b1(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;for(let i of["key","value"]){let s=e[i];if(s&&"items"in s){for(let a=0;a<s.items.length;++a){let l=b1(Object.freeze(t.concat([[i,a]])),s.items[a],r);if(typeof l=="number")a=l-1;else{if(l===o_)return o_;l===v1&&(s.items.splice(a,1),a-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,t))}}return typeof n=="function"?n(e,t):n}S1.visit=ga});var Wm=F(Hr=>{"use strict";var a_=m1(),sG=y1(),oG=w1(),l_="\uFEFF",c_="",u_="",f_="",aG=t=>!!t&&"items"in t,lG=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function cG(t){switch(t){case l_:return"<BOM>";case c_:return"<DOC>";case u_:return"<FLOW_END>";case f_:return"<SCALAR>";default:return JSON.stringify(t)}}function uG(t){switch(t){case l_:return"byte-order-mark";case c_:return"doc-mode";case u_:return"flow-error-end";case f_:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
209
209
|
`:case`\r
|
|
210
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Hr.createScalarToken=a_.createScalarToken;Hr.resolveAsScalar=a_.resolveAsScalar;Hr.setScalarValue=a_.setScalarValue;Hr.stringify=
|
|
211
|
-
`:case"\r":case" ":return!0;default:return!1}}var
|
|
212
|
-
\r `),d_=t=>!t||
|
|
210
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Hr.createScalarToken=a_.createScalarToken;Hr.resolveAsScalar=a_.resolveAsScalar;Hr.setScalarValue=a_.setScalarValue;Hr.stringify=sG.stringify;Hr.visit=oG.visit;Hr.BOM=l_;Hr.DOCUMENT=c_;Hr.FLOW_END=u_;Hr.SCALAR=f_;Hr.isCollection=aG;Hr.isScalar=lG;Hr.prettyToken=cG;Hr.tokenType=uG});var h_=F(R1=>{"use strict";var Xf=Wm();function Qn(t){switch(t){case void 0:case" ":case`
|
|
211
|
+
`:case"\r":case" ":return!0;default:return!1}}var _1=new Set("0123456789ABCDEFabcdef"),fG=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),zm=new Set(",[]{}"),dG=new Set(` ,[]{}
|
|
212
|
+
\r `),d_=t=>!t||dG.has(t),p_=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===`
|
|
213
213
|
`?!0:r==="\r"?this.buffer[e+1]===`
|
|
214
214
|
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let r=this.buffer[e];if(this.indentNext>0){let n=0;for(;r===" ";)r=this.buffer[++n+e];if(r==="\r"){let i=this.buffer[n+e+1];if(i===`
|
|
215
215
|
`||!i&&!this.atEnd)return e+n+1}return r===`
|
|
216
216
|
`||n>=this.indentNext||!r&&!this.atEnd?e+n:-1}if(r==="-"||r==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&Qn(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
217
|
-
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Xf.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let r=e.length,n=e.indexOf("#");for(;n!==-1;){let s=e[n-1];if(s===" "||s===" "){r=n-1;break}else n=e.indexOf("#",n+1)}for(;;){let s=e[r-1];if(s===" "||s===" ")r-=1;else break}let i=(yield*this.pushCount(r))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let r=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-r),yield*this.pushNewline(),"stream"}return yield Xf.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let r=this.peek(3);if((r==="---"||r==="...")&&Qn(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,r==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Qn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Qn(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(d_),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&Qn(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield Xf.FLOW_END,yield*this.parseLineStart();let s=0;for(;i[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),i[s]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(d_),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let
|
|
217
|
+
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Xf.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let r=e.length,n=e.indexOf("#");for(;n!==-1;){let s=e[n-1];if(s===" "||s===" "){r=n-1;break}else n=e.indexOf("#",n+1)}for(;;){let s=e[r-1];if(s===" "||s===" ")r-=1;else break}let i=(yield*this.pushCount(r))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let r=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-r),yield*this.pushNewline(),"stream"}return yield Xf.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let r=this.peek(3);if((r==="---"||r==="...")&&Qn(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,r==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Qn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Qn(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(d_),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&Qn(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield Xf.FLOW_END,yield*this.parseLineStart();let s=0;for(;i[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),i[s]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(d_),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let a=this.charAt(1);if(this.flowKey||Qn(a)||a===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),r=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;r!==-1&&this.buffer[r+1]==="'";)r=this.buffer.indexOf("'",r+2);else for(;r!==-1;){let s=0;for(;this.buffer[r-1-s]==="\\";)s+=1;if(s%2===0)break;r=this.buffer.indexOf('"',r+1)}let n=this.buffer.substring(0,r),i=n.indexOf(`
|
|
218
218
|
`,this.pos);if(i!==-1){for(;i!==-1;){let s=this.continueScalar(i+1);if(s===-1)break;i=n.indexOf(`
|
|
219
219
|
`,s)}i!==-1&&(r=i-(n[i-1]==="\r"?2:1))}if(r===-1){if(!this.atEnd)return this.setNext("quoted-scalar");r=this.buffer.length}return yield*this.pushToIndex(r+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let r=this.buffer[++e];if(r==="+")this.blockScalarKeep=!0;else if(r>"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>Qn(r)||r==="#")}*parseBlockScalar(){let e=this.pos-1,r=0,n;e:for(let s=this.pos;n=this.buffer[s];++s)switch(n){case" ":r+=1;break;case`
|
|
220
|
-
`:e=s,r=0;break;case"\r":{let
|
|
220
|
+
`:e=s,r=0;break;case"\r":{let a=this.buffer[s+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
|
|
221
221
|
`)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=r:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(`
|
|
222
222
|
`,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
|
|
223
|
-
`;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let s=e-1,
|
|
223
|
+
`;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let s=e-1,a=this.buffer[s];a==="\r"&&(a=this.buffer[--s]);let l=s;for(;a===" ";)a=this.buffer[--s];if(a===`
|
|
224
224
|
`&&s>=this.pos&&s+1+r>l)e=s;else break}while(!0);return yield Xf.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let s=this.buffer[n+1];if(Qn(s)||e&&zm.has(s))break;r=n}else if(Qn(i)){let s=this.buffer[n+1];if(i==="\r"&&(s===`
|
|
225
225
|
`?(n+=1,i=`
|
|
226
226
|
`,s=this.buffer[n+1]):r=n),s==="#"||e&&zm.has(s))break;if(i===`
|
|
227
|
-
`){let
|
|
227
|
+
`){let a=this.continueScalar(n+1);if(a===-1)break;n=Math.max(n,a-2)}}else{if(e&&zm.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield Xf.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(d_),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,n=this.charAt(1);if(Qn(n)||r&&zm.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(;!Qn(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(fG.has(r))r=this.buffer[++e];else if(r==="%"&&_1.has(this.buffer[e+1])&&_1.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)}};
|
|
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)}};R1.Lexer=p_});var g_=F(x1=>{"use strict";var m_=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}}}};x1.LineCounter=m_});var v_=F(P1=>{"use strict";var pG=it("process"),C1=Wm(),hG=h_();function Qs(t,e){for(let r=0;r<t.length;++r)if(t[r].type===e)return!0;return!1}function E1(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 I1(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 Jm(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 oc(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 Ym(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 O1(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!Qs(e.start,"explicit-key-ind")&&!Qs(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,I1(e.value)?e.value.end?Ym(e.value.end,e.sep):e.value.end=e.sep:Ym(e.start,e.sep),delete e.sep)}var y_=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 hG.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,pG.env.LOG_TOKENS&&console.log("|",C1.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=C1.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"&&O1(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&&E1(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":{E1(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=Jm(this.peek(2)),n=oc(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)){Ym(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
|
|
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)){Ym(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 a=[];for(let l=0;l<r.sep.length;++l){let f=r.sep[l];switch(f.type){case"newline":a.push(l);break;case"space":break;case"comment":f.indent>e.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(s=r.sep.splice(a[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(Qs(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(I1(r.key)&&!Qs(r.sep,"newline")){let a=oc(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:a,key:l,sep:f}]})}else s.length>0?r.sep=r.sep.concat(s,this.sourceToken):r.sep.push(this.sourceToken);else if(Qs(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let a=oc(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?e.items.push({start:s,key:null,sep:[this.sourceToken]}):Qs(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 a=this.flowScalar(this.type);i||r.value?(e.items.push({start:s,key:a,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(a):(Object.assign(r,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{let a=this.startBlockValue(e);if(a){if(a.type==="block-seq"){if(!r.explicitKey&&r.sep&&!Qs(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(a);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)){Ym(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||Qs(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=Jm(n),s=oc(i);O1(e);let a=e.end.splice(1,e.end.length);a.push(this.sourceToken);let l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:a}]};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=Jm(e),n=oc(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=Jm(e),n=oc(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())}}};
|
|
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=Jm(e),n=oc(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=Jm(e),n=oc(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())}}};P1.Parser=y_});var $1=F(td=>{"use strict";var k1=i_(),mG=zf(),ed=Gf(),gG=rw(),yG=Je(),vG=g_(),T1=v_();function A1(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new vG.LineCounter||null,prettyErrors:e}}function bG(t,e={}){let{lineCounter:r,prettyErrors:n}=A1(e),i=new T1.Parser(r?.addNewLine),s=new k1.Composer(e),a=Array.from(s.compose(i.parse(t)));if(n&&r)for(let l of a)l.errors.forEach(ed.prettifyError(t,r)),l.warnings.forEach(ed.prettifyError(t,r));return a.length>0?a:Object.assign([],{empty:!0},s.streamInfo())}function q1(t,e={}){let{lineCounter:r,prettyErrors:n}=A1(e),i=new T1.Parser(r?.addNewLine),s=new k1.Composer(e),a=null;for(let l of s.compose(i.parse(t),!0,t.length))if(!a)a=l;else if(a.options.logLevel!=="silent"){a.errors.push(new ed.YAMLParseError(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(a.errors.forEach(ed.prettifyError(t,r)),a.warnings.forEach(ed.prettifyError(t,r))),a}function SG(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=q1(t,r);if(!i)return null;if(i.warnings.forEach(s=>gG.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 wG(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 yG.isDocument(t)&&!n?t.toString(r):new mG.Document(t,n,r).toString(r)}td.parse=SG;td.parseAllDocuments=bG;td.parseDocument=q1;td.stringify=wG});var S_=F(st=>{"use strict";var _G=i_(),RG=zf(),xG=Fw(),b_=Gf(),CG=kf(),Zs=Je(),EG=Js(),OG=Ft(),IG=Gs(),PG=Ks(),kG=Wm(),TG=h_(),AG=g_(),qG=v_(),Gm=$1(),M1=Ef();st.Composer=_G.Composer;st.Document=RG.Document;st.Schema=xG.Schema;st.YAMLError=b_.YAMLError;st.YAMLParseError=b_.YAMLParseError;st.YAMLWarning=b_.YAMLWarning;st.Alias=CG.Alias;st.isAlias=Zs.isAlias;st.isCollection=Zs.isCollection;st.isDocument=Zs.isDocument;st.isMap=Zs.isMap;st.isNode=Zs.isNode;st.isPair=Zs.isPair;st.isScalar=Zs.isScalar;st.isSeq=Zs.isSeq;st.Pair=EG.Pair;st.Scalar=OG.Scalar;st.YAMLMap=IG.YAMLMap;st.YAMLSeq=PG.YAMLSeq;st.CST=kG;st.Lexer=TG.Lexer;st.LineCounter=AG.LineCounter;st.Parser=qG.Parser;st.parse=Gm.parse;st.parseAllDocuments=Gm.parseAllDocuments;st.parseDocument=Gm.parseDocument;st.stringify=Gm.stringify;st.visit=M1.visit;st.visitAsync=M1.visitAsync});var $G,MG,NG,DG,FG,LG,jG,Xs,Km=oe(()=>{"use strict";$G=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,MG=/^\d{4}-\d{2}-\d{2}$/,NG=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,DG=/^https?:\/\/[^\s]+$/,FG=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,LG=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,jG=/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/,Xs=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($G.test(e))return"date-time";if(MG.test(e))return"date";if(NG.test(e))return"email";if(FG.test(e))return"uuid";if(DG.test(e))return"uri";if(LG.test(e))return"ipv4";if(jG.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||{},a=r.properties||{},l=new Set([...Object.keys(s),...Object.keys(a)]);for(let g of l)s[g]&&a[g]?i.properties[g]=this.mergeSchemas(s[g],a[g]):s[g]?i.properties[g]={...s[g]}:i.properties[g]={...a[g]};let f=new Set(e.required||Object.keys(s)),d=new Set(r.required||Object.keys(a)),m=[...l].filter(g=>f.has(g)&&d.has(g));return m.length>0&&(i.required=m),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 N1,UG,ac,w_=oe(()=>{"use strict";N1=ab(S_());Km();UG=new Set(["content-type","authorization","accept","cookie","host","content-length"]),ac=class{constructor(e,r,n){this.collectionService=e;this.envConfigService=r;this.inferenceService=n;this.inferrer=new Xs}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:d,scheme:m,requirement:g}=f;s.set(d,m),i.security=[g]}}let a=new Set,l=new Set;if(await this.processItems(n.items,i,s,a,l,void 0,n,r),this.augmentServersFromHostVars(l,i.servers,r),s.size>0)for(let[f,d]of s)i.components.securitySchemes[f]=d;else delete i.components.securitySchemes;return i.tags=[...a].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"?N1.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 a=this.envConfigService.resolveVariables("{{baseUrl}}",s);a&&a!=="{{baseUrl}}"&&!i.has(a)&&(i.add(a),r.push({url:a,description:s}))}}return r.length===0&&r.push({url:"http://localhost",description:"Default server"}),r}async processItems(e,r,n,i,s,a,l,f){for(let d of e)if(d.type==="folder"){let m=d,g=a||m.name;i.add(g),m.items&&await this.processItems(m.items,r,n,i,s,g,l,f)}else{let m=d;await this.processRequest(m,r,n,i,s,a,l,f)}}async processRequest(e,r,n,i,s,a,l,f){let{path:d,hostVar:m}=this.normalizeUrl(e.url);m&&s.add(m);let g=(e.method||"GET").toLowerCase();r.paths[d]||(r.paths[d]={});let y={};y.operationId=this.generateOperationId(e,g,d,r),y.summary=this.cleanSummary(e.name),e.description&&(y.description=e.description),(e.deprecated||this.hasDeprecatedPrefix(e.name))&&(y.deprecated=!0,this.hasDeprecatedPrefix(e.name)&&(y.summary=e.name.replace(/^\[DEPRECATED\]\s*/i,""))),a&&(y.tags=[a]);let w=this.buildParameters(e);w.length>0&&(y.parameters=w);let C=await this.buildRequestBody(e,f);C&&(y.requestBody=C);let R=await this.buildResponses(e,l.id,f);y.responses=R;let T=this.buildOperationSecurity(e,l,n);T!==void 0&&(y.security=T);let A=r.paths[d][g];A?this.mergeOperation(A,y,e.name):r.paths[d][g]=y}mergeOperation(e,r,n){if(r.summary&&r.summary!==e.summary&&(e.description=(e.description||e.summary||"")+`
|
|
234
234
|
|
|
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(d=>JSON.stringify(d)===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),d=this.buildVariantSchema(s);i.oneOf=[f,d]}this.stripConstraints(i)}if(r.description&&r.description!==e.description&&(e.description=(e.description||"")+(e.description?"; ":"")+r.description),r.example!==void 0&&r.example!==e.example){e.examples||(e.examples={},e.example!==void 0&&(e.examples.variant1={value:e.example}));let 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||LG.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[g,y]of Object.entries(e.bodySchema.content)){let w={};y.schema&&(w.schema=y.schema),y.examples&&(w.examples=y.examples),y.encoding&&(w.encoding=y.encoding),i.content[g]=w}let m=e.bodySchema.contentType||Object.keys(e.bodySchema.content)[0];if(m&&n.content){let g=this.tryParseBodyContent(n);g!==void 0&&i.content[m]&&(i.content[m].example=g)}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 m=this.tryParseBodyContent(n);m!==void 0?(o=this.inferrer.inferFromValue(m),l=m):o={type:"string"}}else o={type:"string"},l=typeof n.content=="string"?n.content:void 0;break}case"form-data":{o=this.buildFormDataSchemaFromBody(n);break}case"x-www-form-urlencoded":{o=this.buildFormDataSchemaFromBody(n);break}case"binary":{o={type:"string",format:"binary"};break}case"graphql":{o={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},l=this.tryParseBodyContent(n);break}default:return null}let d={};return o&&(d.schema=o),l!==void 0&&(d.example=l),f&&(d.encoding=f),i.content[s]=d,i}getContentType(e){if(!e)return"application/json";switch(e.type){case"raw":switch(e.format){case"json":return"application/json";case"xml":return"application/xml";case"html":return"text/html";case"text":return"text/plain";default:return"text/plain"}case"form-data":return"multipart/form-data";case"x-www-form-urlencoded":return"application/x-www-form-urlencoded";case"binary":return"application/octet-stream";case"graphql":return"application/json";default:return"application/json"}}tryParseBodyContent(e){if(!e||!e.content)return;let r;if(typeof e.content=="string")try{r=JSON.parse(e.content)}catch{r=e.content}else r=e.content;return this.sanitizeObjectExamples(r)}buildFormDataSchemaFromBody(e){let r={type:"object",properties:{}},n=e.formData||e.urlencoded||[];for(let i of n)i.enabled!==!1&&(i.type==="file"?r.properties[i.key]={type:"string",format:"binary"}:r.properties[i.key]={type:"string"});return r}async buildResponses(e,r,n){let i={};if(e.responseSchema)for(let[s,o]of Object.entries(e.responseSchema.responses)){let l={description:o.description||`Status ${s}`};if(o.content){l.content={};for(let[f,d]of Object.entries(o.content)){let m={};d.schema&&(m.schema=d.schema),d.examples&&(m.examples=d.examples),l.content[f]=m}}else if(o.schema){let f=o.contentType||"application/json",d={schema:o.schema};o.examples&&(d.examples=o.examples),l.content={[f]:d}}if(o.headers){l.headers={};for(let[f,d]of Object.entries(o.headers))l.headers[f]={...d.description&&{description:d.description},schema:d.schema}}i[s]=l}return Object.keys(i).length===0&&(i[200]={description:"Successful response"}),i}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[d,m]of Object.entries(f.responses))if(m.content)for(let g of Object.values(m.content))g.schema&&this.trackSchema(g.schema,`${o}${i}Response${d}`,r,n)}if(f.requestBody?.content)for(let d of Object.values(f.requestBody.content))d.schema&&this.trackSchema(d.schema,`${o}${i}Request`,r,n)}for(let[i,s]of r)if((n.get(i)||0)>=2){let l=this.sanitizeComponentName(s.name);e.components.schemas[l]=s.schema,this.replaceInlineSchema(e,s.schema,`#/components/schemas/${l}`)}}trackSchema(e,r,n,i){if(!e||e.type!=="object"||!e.properties)return;let s=JSON.stringify(e);n.has(s)||n.set(s,{name:r,schema:e}),i.set(s,(i.get(s)||0)+1)}replaceInlineSchema(e,r,n){let i=JSON.stringify(r);if(e.paths)for(let s of Object.values(e.paths))for(let o of Object.values(s)){if(o.responses){for(let l of Object.values(o.responses))if(l.content)for(let 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 d of s){let m=this.envConfigService.resolveVariables(l,d);m&&m!==l&&!i.has(m)&&(r.push({url:m,description:d}),i.add(m),f=!0)}if(!f){let d=`{${o}}`;i.has(d)||(r.push({url:d,variables:{[o]:{default:""}}}),i.add(d))}}}}});var lc,__=ae(()=>{"use strict";lc=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 Qm=F(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.getDeepKeys=cc.toJSON=void 0;var jG=["function","symbol","undefined"],UG=["constructor","prototype","__proto__"],HG=Object.getPrototypeOf({});function BG(){let t={},e=this;for(let r of M1(e))if(typeof r=="string"){let n=e[r],i=typeof n;jG.includes(i)||(t[r]=n)}return t}cc.toJSON=BG;function M1(t,e=[]){let r=[];for(;t&&t!==HG;)r=r.concat(Object.getOwnPropertyNames(t),Object.getOwnPropertySymbols(t)),t=Object.getPrototypeOf(t);let n=new Set(r);for(let i of e.concat(UG))n.delete(i);return n}cc.getDeepKeys=M1});var R_=F(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.addInspectMethod=uc.format=void 0;var N1=it("util"),VG=Qm(),D1=N1.inspect.custom||Symbol.for("nodejs.util.inspect.custom");uc.format=N1.format;function WG(t){t[D1]=zG}uc.addInspectMethod=WG;function zG(){let t={},e=this;for(let r of VG.getDeepKeys(e)){let n=e[r];t[r]=n}return delete t[D1],t}});var j1=F(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.lazyJoinStacks=Ri.joinStacks=Ri.isWritableStack=Ri.isLazyStack=void 0;var JG=/\r?\n/,YG=/\bono[ @]/;function GG(t){return!!(t&&t.configurable&&typeof t.get=="function")}Ri.isLazyStack=GG;function KG(t){return!!(!t||t.writable||typeof t.set=="function")}Ri.isWritableStack=KG;function F1(t,e){let r=L1(t.stack),n=e?e.stack:void 0;return r&&n?r+`
|
|
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(a=>a.name===i.name&&a.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||{},a=this.getConstraintKind(i),l=this.getConstraintKind(s);if(a==="none"&&l==="none")this.widenType(i,s);else if(a==="none")Object.assign(i,this.extractConstraints(s)),this.widenType(i,s);else if(l==="none")this.widenType(i,s);else if(a===l)this.mergeSameKindConstraints(i,s,a),this.widenType(i,s);else{if(i.oneOf){let f=this.buildVariantSchema(s);i.oneOf.some(d=>JSON.stringify(d)===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),d=this.buildVariantSchema(s);i.oneOf=[f,d]}this.stripConstraints(i)}if(r.description&&r.description!==e.description&&(e.description=(e.description||"")+(e.description?"; ":"")+r.description),r.example!==void 0&&r.example!==e.example){e.examples||(e.examples={},e.example!==void 0&&(e.examples.variant1={value:e.example}));let 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),a=this.collectOperationIds(i);if(a.has(s)&&(s=`${s}${r.charAt(0).toUpperCase()}${r.slice(1)}`),!s||a.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 a=i;a.oneOf?(s.schema={oneOf:a.oneOf},a.type&&(s.schema.type=a.type)):(s.schema={type:a.type||this.inferTypeFromValue(a.value)},a.format&&(s.schema.format=a.format),a.enum&&(s.schema.enum=a.enum),a.pattern&&(s.schema.pattern=a.pattern),a.minimum!==void 0&&(s.schema.minimum=a.minimum),a.maximum!==void 0&&(s.schema.maximum=a.maximum),a.exclusiveMinimum!==void 0&&(s.schema.exclusiveMinimum=a.exclusiveMinimum),a.exclusiveMaximum!==void 0&&(s.schema.exclusiveMaximum=a.exclusiveMaximum),a.multipleOf!==void 0&&(s.schema.multipleOf=a.multipleOf),a.minLength!==void 0&&(s.schema.minLength=a.minLength),a.maxLength!==void 0&&(s.schema.maxLength=a.maxLength),a.minItems!==void 0&&(s.schema.minItems=a.minItems),a.maxItems!==void 0&&(s.schema.maxItems=a.maxItems),a.uniqueItems&&(s.schema.uniqueItems=!0),a.nullable&&(s.schema.nullable=!0)),a.description&&(s.description=a.description),a.deprecated&&(s.deprecated=!0),s.example=this.coerceExample(a.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||UG.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 a=i.substring(0,s).trim(),l=i.substring(s+1).trim();r.push({name:a,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,a,l,f;if(e.bodySchema){if(e.bodySchema.content){for(let[g,y]of Object.entries(e.bodySchema.content)){let w={};y.schema&&(w.schema=y.schema),y.examples&&(w.examples=y.examples),y.encoding&&(w.encoding=y.encoding),i.content[g]=w}let m=e.bodySchema.contentType||Object.keys(e.bodySchema.content)[0];if(m&&n.content){let g=this.tryParseBodyContent(n);g!==void 0&&i.content[m]&&(i.content[m].example=g)}return i}s=e.bodySchema.contentType||this.getContentType(n),a=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 m=this.tryParseBodyContent(n);m!==void 0?(a=this.inferrer.inferFromValue(m),l=m):a={type:"string"}}else a={type:"string"},l=typeof n.content=="string"?n.content:void 0;break}case"form-data":{a=this.buildFormDataSchemaFromBody(n);break}case"x-www-form-urlencoded":{a=this.buildFormDataSchemaFromBody(n);break}case"binary":{a={type:"string",format:"binary"};break}case"graphql":{a={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},l=this.tryParseBodyContent(n);break}default:return null}let d={};return a&&(d.schema=a),l!==void 0&&(d.example=l),f&&(d.encoding=f),i.content[s]=d,i}getContentType(e){if(!e)return"application/json";switch(e.type){case"raw":switch(e.format){case"json":return"application/json";case"xml":return"application/xml";case"html":return"text/html";case"text":return"text/plain";default:return"text/plain"}case"form-data":return"multipart/form-data";case"x-www-form-urlencoded":return"application/x-www-form-urlencoded";case"binary":return"application/octet-stream";case"graphql":return"application/json";default:return"application/json"}}tryParseBodyContent(e){if(!e||!e.content)return;let r;if(typeof e.content=="string")try{r=JSON.parse(e.content)}catch{r=e.content}else r=e.content;return this.sanitizeObjectExamples(r)}buildFormDataSchemaFromBody(e){let r={type:"object",properties:{}},n=e.formData||e.urlencoded||[];for(let i of n)i.enabled!==!1&&(i.type==="file"?r.properties[i.key]={type:"string",format:"binary"}:r.properties[i.key]={type:"string"});return r}async buildResponses(e,r,n){let i={};if(e.responseSchema)for(let[s,a]of Object.entries(e.responseSchema.responses)){let l={description:a.description||`Status ${s}`};if(a.content){l.content={};for(let[f,d]of Object.entries(a.content)){let m={};d.schema&&(m.schema=d.schema),d.examples&&(m.examples=d.examples),l.content[f]=m}}else if(a.schema){let f=a.contentType||"application/json",d={schema:a.schema};a.examples&&(d.examples=a.examples),l.content={[f]:d}}if(a.headers){l.headers={};for(let[f,d]of Object.entries(a.headers))l.headers[f]={...d.description&&{description:d.description},schema:d.schema}}i[s]=l}return Object.keys(i).length===0&&(i[200]={description:"Successful response"}),i}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:a,requirement:l}=i;return n.set(s,a),[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[a,l]of Object.entries(s)){let f=l;if(f.responses){for(let[d,m]of Object.entries(f.responses))if(m.content)for(let g of Object.values(m.content))g.schema&&this.trackSchema(g.schema,`${a}${i}Response${d}`,r,n)}if(f.requestBody?.content)for(let d of Object.values(f.requestBody.content))d.schema&&this.trackSchema(d.schema,`${a}${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 a of Object.values(s)){if(a.responses){for(let l of Object.values(a.responses))if(l.content)for(let f of Object.values(l.content))f.schema&&JSON.stringify(f.schema)===i&&(f.schema={$ref:n})}if(a.requestBody?.content)for(let l of Object.values(a.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(a=>a.url)),s=n.environments?.length?n.environments:[this.envConfigService.getSelectedEnvironment()].filter(a=>!!a);for(let a of e){let l=`{{${a}}}`,f=!1;for(let d of s){let m=this.envConfigService.resolveVariables(l,d);m&&m!==l&&!i.has(m)&&(r.push({url:m,description:d}),i.add(m),f=!0)}if(!f){let d=`{${a}}`;i.has(d)||(r.push({url:d,variables:{[a]:{default:""}}}),i.add(d))}}}}});var lc,__=oe(()=>{"use strict";lc=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,a]of Object.entries(i))r.omitReadOnly&&a.readOnly||(n[s]=this.generate(a,r));return n}generateFromAllOf(e,r,n){let i={type:"object",properties:{},required:[]};for(let a of e){let l=a.$ref?this.resolveLocalRef(a.$ref,n.components)||{}:a;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 Qm=F(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.getDeepKeys=cc.toJSON=void 0;var HG=["function","symbol","undefined"],BG=["constructor","prototype","__proto__"],VG=Object.getPrototypeOf({});function WG(){let t={},e=this;for(let r of D1(e))if(typeof r=="string"){let n=e[r],i=typeof n;HG.includes(i)||(t[r]=n)}return t}cc.toJSON=WG;function D1(t,e=[]){let r=[];for(;t&&t!==VG;)r=r.concat(Object.getOwnPropertyNames(t),Object.getOwnPropertySymbols(t)),t=Object.getPrototypeOf(t);let n=new Set(r);for(let i of e.concat(BG))n.delete(i);return n}cc.getDeepKeys=D1});var R_=F(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.addInspectMethod=uc.format=void 0;var F1=it("util"),zG=Qm(),L1=F1.inspect.custom||Symbol.for("nodejs.util.inspect.custom");uc.format=F1.format;function JG(t){t[L1]=YG}uc.addInspectMethod=JG;function YG(){let t={},e=this;for(let r of zG.getDeepKeys(e)){let n=e[r];t[r]=n}return delete t[L1],t}});var H1=F(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.lazyJoinStacks=Ri.joinStacks=Ri.isWritableStack=Ri.isLazyStack=void 0;var GG=/\r?\n/,KG=/\bono[ @]/;function QG(t){return!!(t&&t.configurable&&typeof t.get=="function")}Ri.isLazyStack=QG;function ZG(t){return!!(!t||t.writable||typeof t.set=="function")}Ri.isWritableStack=ZG;function j1(t,e){let r=U1(t.stack),n=e?e.stack:void 0;return r&&n?r+`
|
|
236
236
|
|
|
237
|
-
`+n:r||n}Ri.joinStacks=
|
|
238
|
-
`)}return t}function
|
|
239
|
-
`:"")+r.message),{originalError:r,props:n,message:s}}fc.normalizeArgs=sK});var C_=F(tg=>{"use strict";Object.defineProperty(tg,"__esModule",{value:!0});tg.Ono=void 0;var eg=B1(),W1=V1(),oK=Qm(),aK=x_;tg.Ono=aK;function x_(t,e){e=W1.normalizeOptions(e);function r(...n){let{originalError:i,props:s,message:o}=W1.normalizeArgs(n,e),l=new t(o);return eg.extendError(l,i,s)}return r[Symbol.species]=t,r}x_.toJSON=function(e){return oK.toJSON.call(e)};x_.extend=function(e,r,n){return n||r instanceof Error?eg.extendError(e,r,n):r?eg.extendError(e,void 0,r):eg.extendError(e)}});var z1=F(rg=>{"use strict";Object.defineProperty(rg,"__esModule",{value:!0});rg.ono=void 0;var ya=C_(),lK=xi;rg.ono=lK;xi.error=new ya.Ono(Error);xi.eval=new ya.Ono(EvalError);xi.range=new ya.Ono(RangeError);xi.reference=new ya.Ono(ReferenceError);xi.syntax=new ya.Ono(SyntaxError);xi.type=new ya.Ono(TypeError);xi.uri=new ya.Ono(URIError);var cK=xi;function xi(...t){let e=t[0];if(typeof e=="object"&&typeof e.name=="string"){for(let r of Object.values(cK))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 xi.error.apply(void 0,t)}});var Y1=F(J1=>{"use strict";Object.defineProperty(J1,"__esModule",{value:!0});var zX=it("util")});var eo=F((Zn,dc)=>{"use strict";var uK=Zn&&Zn.__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]})),fK=Zn&&Zn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&uK(e,t,r)};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.ono=void 0;var G1=z1();Object.defineProperty(Zn,"ono",{enumerable:!0,get:function(){return G1.ono}});var dK=C_();Object.defineProperty(Zn,"Ono",{enumerable:!0,get:function(){return dK.Ono}});fK(Y1(),Zn);Zn.default=G1.ono;typeof dc=="object"&&typeof dc.exports=="object"&&(dc.exports=Object.assign(dc.exports.default,dc.exports))});var E_=F(rd=>{"use strict";var pK=rd&&rd.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(rd,"__esModule",{value:!0});rd.default=hK;var K1=pK(it("path"));function hK(t){return t.startsWith("\\\\?\\")?t:t.split(K1.default?.win32?.sep).join(K1.default?.posix?.sep??"/")}});var Q1=F(ng=>{"use strict";Object.defineProperty(ng,"__esModule",{value:!0});ng.isWindows=void 0;var mK=/^win/.test(globalThis.process?globalThis.process.platform:""),gK=()=>mK;ng.isWindows=gK});var Cn=F(_t=>{"use strict";var yK=_t&&_t.__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]})),vK=_t&&_t.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),bK=_t&&_t.__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"&&yK(r,e,n[i]);return vK(r,e),r}})(),SK=_t&&_t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_t,"__esModule",{value:!0});_t.parse=void 0;_t.resolve=Z1;_t.cwd=X1;_t.getProtocol=T_;_t.getExtension=IK;_t.stripQuery=eT;_t.getHash=tT;_t.stripHash=P_;_t.isHttp=PK;_t.isFileSystemPath=k_;_t.fromFileSystemPath=kK;_t.toFileSystemPath=TK;_t.safePointerToPath=AK;_t.relative=qK;var sg=SK(E_()),I_=bK(it("path")),wK=/\//g,_K=/^(\w{2,}):\/\//i,RK=/~1/g,xK=/~0/g,CK=it("path"),ig=Q1(),EK=[[/\?/g,"%3F"],[/#/g,"%23"]],O_=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],OK=t=>new URL(t);_t.parse=OK;function Z1(t,e){let r=new URL((0,sg.default)(t),"https://aaa.nonexistanturl.com"),n=new URL((0,sg.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 X1(){if(typeof window<"u")return location.href;let t=process.cwd(),e=t.slice(-1);return e==="/"||e==="\\"?t:t+"/"}function T_(t){let e=_K.exec(t||"");if(e)return e[1].toLowerCase()}function IK(t){let e=t.lastIndexOf(".");return e>=0?eT(t.substr(e).toLowerCase()):""}function eT(t){let e=t.indexOf("?");return e>=0&&(t=t.substr(0,e)),t}function tT(t){if(!t)return"#";let e=t.indexOf("#");return e>=0?t.substring(e):"#"}function P_(t){if(!t)return"";let e=t.indexOf("#");return e>=0&&(t=t.substring(0,e)),t}function PK(t){let e=T_(t);return e==="http"||e==="https"?!0:e===void 0?typeof window<"u":!1}function k_(t){if(typeof window<"u"||typeof process<"u"&&process.browser)return!1;let e=T_(t);return e===void 0||e==="file"}function kK(t){if((0,ig.isWindows)()){let e=X1(),r=t.toUpperCase(),i=(0,sg.default)(e).toUpperCase(),s=r.includes(i),o=r.includes(i),l=I_.win32?.isAbsolute(t)||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("file://");!(s||o||l)&&!e.startsWith("http")&&(t=(0,CK.join)(e,t)),t=(0,sg.default)(t)}t=encodeURI(t);for(let e of EK)t=t.replace(e[0],e[1]);return t}function TK(t,e){t=decodeURI(t);for(let n=0;n<O_.length;n+=2)t=t.replace(O_[n],O_[n+1]);let r=t.substr(0,7).toLowerCase()==="file://";return r&&(t=t[7]==="/"?t.substr(8):t.substr(7),(0,ig.isWindows)()&&t[1]==="/"&&(t=t[0]+":"+t.substr(1)),e?t="file:///"+t:(r=!1,t=(0,ig.isWindows)()?t:"/"+t)),(0,ig.isWindows)()&&!r&&(t=t.replace(wK,"\\"),t.substr(1,2)===":\\"&&(t=t[0].toUpperCase()+t.substr(1))),t}function AK(t){return t.length<=1||t[0]!=="#"||t[1]!=="/"?[]:t.slice(2).split("/").map(e=>decodeURIComponent(e).replace(RK,"/").replace(xK,"~"))}function qK(t,e){if(!k_(t)||!k_(e))return Z1(t,e);let r=I_.default.dirname(P_(t)),n=P_(e);return I_.default.relative(r,n)+tT(e)}});var En=F(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.InvalidPointerError=kt.TimeoutError=kt.MissingPointerError=kt.UnmatchedResolverError=kt.ResolverError=kt.UnmatchedParserError=kt.ParserError=kt.JSONParserErrorGroup=kt.JSONParserError=void 0;kt.isHandledError=$K;kt.normalizeError=MK;var rT=eo(),og=Cn(),Xn=class extends Error{constructor(e,r){super(),this.code="EUNKNOWN",this.name="JSONParserError",this.message=e,this.source=r,this.path=null,rT.Ono.extend(this)}get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};kt.JSONParserError=Xn;var ag=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,og.toFileSystemPath)(e.$refs._root$Ref.path)}'`,rT.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)}};kt.JSONParserErrorGroup=ag;var A_=class extends Xn{constructor(e,r){super(`Error parsing ${r}: ${e}`,r),this.code="EPARSER",this.name="ParserError"}};kt.ParserError=A_;var q_=class extends Xn{constructor(e){super(`Could not find parser for "${e}"`,e),this.code="EUNMATCHEDPARSER",this.name="UnmatchedParserError"}};kt.UnmatchedParserError=q_;var $_=class extends Xn{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))}};kt.ResolverError=$_;var M_=class extends Xn{constructor(e){super(`Could not find resolver for "${e}"`,e),this.code="EUNMATCHEDRESOLVER",this.name="UnmatchedResolverError"}};kt.UnmatchedResolverError=M_;var N_=class extends Xn{constructor(e,r,n,i,s){super(`Missing $ref pointer "${(0,og.getHash)(r)}". Token "${e}" does not exist.`,(0,og.stripHash)(r)),this.code="EMISSINGPOINTER",this.name="MissingPointerError",this.targetToken=e,this.targetRef=n,this.targetFound=i,this.parentPath=s}};kt.MissingPointerError=N_;var D_=class extends Xn{constructor(e){super(`Dereferencing timeout reached: ${e}ms`),this.code="ETIMEOUT",this.name="TimeoutError"}};kt.TimeoutError=D_;var F_=class extends Xn{constructor(e,r){super(`Invalid $ref pointer "${e}". Pointers must begin with "#/"`,(0,og.stripHash)(r)),this.code="EUNMATCHEDRESOLVER",this.name="InvalidPointerError"}};kt.InvalidPointerError=F_;function $K(t){return t instanceof Xn||t instanceof ag}function MK(t){return t.path===null&&(t.path=[]),t}});var nd=F(Br=>{"use strict";var NK=Br&&Br.__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]})),DK=Br&&Br.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),FK=Br&&Br.__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"&&NK(r,e,n[i]);return DK(r,e),r}})(),LK=Br&&Br.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Br,"__esModule",{value:!0});Br.nullSymbol=void 0;var L_=LK(pc()),j_=FK(Cn()),cg=En();Br.nullSymbol=Symbol("null");var jK=/\//g,UK=/~/g,HK=/~1/g,BK=/~0/g,VK=t=>{try{return decodeURIComponent(t)}catch{return t}},ug=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=iT(e);for(let o=0;o<i.length;o++){if(lg(this,r,n)&&(this.path=t.join(this.path,i.slice(o))),typeof this.value=="object"&&this.value!==null&&!sT(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 w=i.length-1;w>o;w--){let C=i.slice(o,w+1).join("/");if(this.value[C]!==void 0){this.value=this.value[C],o=w,f=!0;break}}if(f)continue;if(l in this.value&&this.value[l]===null){this.value=Br.nullSymbol;continue}this.value=null;let d=this.$ref.path||"",m=this.path.replace(d,""),g=t.join("",s),y=n?.replace(d,"");throw new cg.MissingPointerError(l,decodeURI(this.originalPath),m,g,y)}else this.value=this.value[l];s.push(l)}return(!this.value||this.value.$ref&&j_.resolve(this.path,this.value.$ref)!==n)&&lg(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=iT(e);for(let o=0;o<i.length-1;o++)lg(this,n),s=i[o],this.value&&this.value[s]!==void 0?this.value=this.value[s]:this.value=nT(this,s,{});return lg(this,n),s=i[i.length-1],nT(this,s,r),e}static parse(e,r){let n=j_.getHash(e).substring(1);if(!n)return[];let i=n.split("/");for(let s=0;s<i.length;s++)i[s]=VK(i[s].replace(HK,"/").replace(BK,"~"));if(i[0]!=="")throw new cg.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(UK,"~0").replace(jK,"~1"))}return e}};function lg(t,e,r){if(L_.default.isAllowed$Ref(t.value,e)){let n=j_.resolve(t.path,t.value.$ref);if(n===t.path&&!sT(r))t.circular=!0;else{let i=t.$ref.$refs._resolve(n,t.path,e);return i===null?!1:(t.indirections+=i.indirections+1,L_.default.isExtended$Ref(t.value)?(t.value=L_.default.dereference(t.value,i.value),!1):(t.$ref=i.$ref,t.path=i.path,t.value=i.value,!0))}}}Br.default=ug;function nT(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 cg.JSONParserError(`Error assigning $ref pointer "${t.path}".
|
|
240
|
-
Cannot set "${e}" of a non-object.`);return r}function
|
|
241
|
-
"${i}" not found.`);s.set(n,r)}_get$Ref(e){e=to.resolve(this._root$Ref.path,e);let r=to.stripHash(e);return this._$refs[r]}_add(e){let r=to.stripHash(e),n=new
|
|
242
|
-
"${s}" not found.`);return
|
|
243
|
-
Parsed value is empty`);return
|
|
237
|
+
`+n:r||n}Ri.joinStacks=j1;function XG(t,e,r){r?Object.defineProperty(e,"stack",{get:()=>{let n=t.get.apply(e);return j1({stack:n},r)},enumerable:!1,configurable:!0}):eK(e,t)}Ri.lazyJoinStacks=XG;function U1(t){if(t){let e=t.split(GG),r;for(let n=0;n<e.length;n++){let i=e[n];if(KG.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
|
+
`)}return t}function eK(t,e){Object.defineProperty(t,"stack",{get:()=>U1(e.get.apply(t)),enumerable:!1,configurable:!0})}});var W1=F(Xm=>{"use strict";Object.defineProperty(Xm,"__esModule",{value:!0});Xm.extendError=void 0;var B1=R_(),Zm=H1(),V1=Qm(),tK=["name","message","stack"];function rK(t,e,r){let n=t;return nK(n,e),e&&typeof e=="object"&&iK(n,e),n.toJSON=V1.toJSON,B1.addInspectMethod&&B1.addInspectMethod(n),r&&typeof r=="object"&&Object.assign(n,r),n}Xm.extendError=rK;function nK(t,e){let r=Object.getOwnPropertyDescriptor(t,"stack");Zm.isLazyStack(r)?Zm.lazyJoinStacks(r,t,e):Zm.isWritableStack(r)&&(t.stack=Zm.joinStacks(t,e))}function iK(t,e){let r=V1.getDeepKeys(e,tK),n=t,i=e;for(let s of r)if(n[s]===void 0)try{n[s]=i[s]}catch{}}});var z1=F(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.normalizeArgs=fc.normalizeOptions=void 0;var sK=R_();function oK(t){return t=t||{},{concatMessages:t.concatMessages===void 0?!0:!!t.concatMessages,format:t.format===void 0?sK.format:typeof t.format=="function"?t.format:!1}}fc.normalizeOptions=oK;function aK(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}}fc.normalizeArgs=aK});var C_=F(tg=>{"use strict";Object.defineProperty(tg,"__esModule",{value:!0});tg.Ono=void 0;var eg=W1(),J1=z1(),lK=Qm(),cK=x_;tg.Ono=cK;function x_(t,e){e=J1.normalizeOptions(e);function r(...n){let{originalError:i,props:s,message:a}=J1.normalizeArgs(n,e),l=new t(a);return eg.extendError(l,i,s)}return r[Symbol.species]=t,r}x_.toJSON=function(e){return lK.toJSON.call(e)};x_.extend=function(e,r,n){return n||r instanceof Error?eg.extendError(e,r,n):r?eg.extendError(e,void 0,r):eg.extendError(e)}});var Y1=F(rg=>{"use strict";Object.defineProperty(rg,"__esModule",{value:!0});rg.ono=void 0;var ya=C_(),uK=xi;rg.ono=uK;xi.error=new ya.Ono(Error);xi.eval=new ya.Ono(EvalError);xi.range=new ya.Ono(RangeError);xi.reference=new ya.Ono(ReferenceError);xi.syntax=new ya.Ono(SyntaxError);xi.type=new ya.Ono(TypeError);xi.uri=new ya.Ono(URIError);var fK=xi;function xi(...t){let e=t[0];if(typeof e=="object"&&typeof e.name=="string"){for(let r of Object.values(fK))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 xi.error.apply(void 0,t)}});var K1=F(G1=>{"use strict";Object.defineProperty(G1,"__esModule",{value:!0});var ZX=it("util")});var eo=F((Zn,dc)=>{"use strict";var dK=Zn&&Zn.__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]})),pK=Zn&&Zn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&dK(e,t,r)};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.ono=void 0;var Q1=Y1();Object.defineProperty(Zn,"ono",{enumerable:!0,get:function(){return Q1.ono}});var hK=C_();Object.defineProperty(Zn,"Ono",{enumerable:!0,get:function(){return hK.Ono}});pK(K1(),Zn);Zn.default=Q1.ono;typeof dc=="object"&&typeof dc.exports=="object"&&(dc.exports=Object.assign(dc.exports.default,dc.exports))});var E_=F(rd=>{"use strict";var mK=rd&&rd.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(rd,"__esModule",{value:!0});rd.default=gK;var Z1=mK(it("path"));function gK(t){return t.startsWith("\\\\?\\")?t:t.split(Z1.default?.win32?.sep).join(Z1.default?.posix?.sep??"/")}});var X1=F(ng=>{"use strict";Object.defineProperty(ng,"__esModule",{value:!0});ng.isWindows=void 0;var yK=/^win/.test(globalThis.process?globalThis.process.platform:""),vK=()=>yK;ng.isWindows=vK});var Cn=F(_t=>{"use strict";var bK=_t&&_t.__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]})),SK=_t&&_t.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),wK=_t&&_t.__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"&&bK(r,e,n[i]);return SK(r,e),r}})(),_K=_t&&_t.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_t,"__esModule",{value:!0});_t.parse=void 0;_t.resolve=eT;_t.cwd=tT;_t.getProtocol=T_;_t.getExtension=kK;_t.stripQuery=rT;_t.getHash=nT;_t.stripHash=P_;_t.isHttp=TK;_t.isFileSystemPath=k_;_t.fromFileSystemPath=AK;_t.toFileSystemPath=qK;_t.safePointerToPath=$K;_t.relative=MK;var sg=_K(E_()),I_=wK(it("path")),RK=/\//g,xK=/^(\w{2,}):\/\//i,CK=/~1/g,EK=/~0/g,OK=it("path"),ig=X1(),IK=[[/\?/g,"%3F"],[/#/g,"%23"]],O_=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],PK=t=>new URL(t);_t.parse=PK;function eT(t,e){let r=new URL((0,sg.default)(t),"https://aaa.nonexistanturl.com"),n=new URL((0,sg.default)(e),r),i=e.match(/(\s*)$/)?.[1]||"";if(n.hostname==="aaa.nonexistanturl.com"){let{pathname:s,search:a,hash:l}=n;return s+a+l+i}return n.toString()+i}function tT(){if(typeof window<"u")return location.href;let t=process.cwd(),e=t.slice(-1);return e==="/"||e==="\\"?t:t+"/"}function T_(t){let e=xK.exec(t||"");if(e)return e[1].toLowerCase()}function kK(t){let e=t.lastIndexOf(".");return e>=0?rT(t.substr(e).toLowerCase()):""}function rT(t){let e=t.indexOf("?");return e>=0&&(t=t.substr(0,e)),t}function nT(t){if(!t)return"#";let e=t.indexOf("#");return e>=0?t.substring(e):"#"}function P_(t){if(!t)return"";let e=t.indexOf("#");return e>=0&&(t=t.substring(0,e)),t}function TK(t){let e=T_(t);return e==="http"||e==="https"?!0:e===void 0?typeof window<"u":!1}function k_(t){if(typeof window<"u"||typeof process<"u"&&process.browser)return!1;let e=T_(t);return e===void 0||e==="file"}function AK(t){if((0,ig.isWindows)()){let e=tT(),r=t.toUpperCase(),i=(0,sg.default)(e).toUpperCase(),s=r.includes(i),a=r.includes(i),l=I_.win32?.isAbsolute(t)||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("file://");!(s||a||l)&&!e.startsWith("http")&&(t=(0,OK.join)(e,t)),t=(0,sg.default)(t)}t=encodeURI(t);for(let e of IK)t=t.replace(e[0],e[1]);return t}function qK(t,e){t=decodeURI(t);for(let n=0;n<O_.length;n+=2)t=t.replace(O_[n],O_[n+1]);let r=t.substr(0,7).toLowerCase()==="file://";return r&&(t=t[7]==="/"?t.substr(8):t.substr(7),(0,ig.isWindows)()&&t[1]==="/"&&(t=t[0]+":"+t.substr(1)),e?t="file:///"+t:(r=!1,t=(0,ig.isWindows)()?t:"/"+t)),(0,ig.isWindows)()&&!r&&(t=t.replace(RK,"\\"),t.substr(1,2)===":\\"&&(t=t[0].toUpperCase()+t.substr(1))),t}function $K(t){return t.length<=1||t[0]!=="#"||t[1]!=="/"?[]:t.slice(2).split("/").map(e=>decodeURIComponent(e).replace(CK,"/").replace(EK,"~"))}function MK(t,e){if(!k_(t)||!k_(e))return eT(t,e);let r=I_.default.dirname(P_(t)),n=P_(e);return I_.default.relative(r,n)+nT(e)}});var En=F(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.InvalidPointerError=kt.TimeoutError=kt.MissingPointerError=kt.UnmatchedResolverError=kt.ResolverError=kt.UnmatchedParserError=kt.ParserError=kt.JSONParserErrorGroup=kt.JSONParserError=void 0;kt.isHandledError=NK;kt.normalizeError=DK;var iT=eo(),og=Cn(),Xn=class extends Error{constructor(e,r){super(),this.code="EUNKNOWN",this.name="JSONParserError",this.message=e,this.source=r,this.path=null,iT.Ono.extend(this)}get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};kt.JSONParserError=Xn;var ag=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,og.toFileSystemPath)(e.$refs._root$Ref.path)}'`,iT.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)}};kt.JSONParserErrorGroup=ag;var A_=class extends Xn{constructor(e,r){super(`Error parsing ${r}: ${e}`,r),this.code="EPARSER",this.name="ParserError"}};kt.ParserError=A_;var q_=class extends Xn{constructor(e){super(`Could not find parser for "${e}"`,e),this.code="EUNMATCHEDPARSER",this.name="UnmatchedParserError"}};kt.UnmatchedParserError=q_;var $_=class extends Xn{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))}};kt.ResolverError=$_;var M_=class extends Xn{constructor(e){super(`Could not find resolver for "${e}"`,e),this.code="EUNMATCHEDRESOLVER",this.name="UnmatchedResolverError"}};kt.UnmatchedResolverError=M_;var N_=class extends Xn{constructor(e,r,n,i,s){super(`Missing $ref pointer "${(0,og.getHash)(r)}". Token "${e}" does not exist.`,(0,og.stripHash)(r)),this.code="EMISSINGPOINTER",this.name="MissingPointerError",this.targetToken=e,this.targetRef=n,this.targetFound=i,this.parentPath=s}};kt.MissingPointerError=N_;var D_=class extends Xn{constructor(e){super(`Dereferencing timeout reached: ${e}ms`),this.code="ETIMEOUT",this.name="TimeoutError"}};kt.TimeoutError=D_;var F_=class extends Xn{constructor(e,r){super(`Invalid $ref pointer "${e}". Pointers must begin with "#/"`,(0,og.stripHash)(r)),this.code="EUNMATCHEDRESOLVER",this.name="InvalidPointerError"}};kt.InvalidPointerError=F_;function NK(t){return t instanceof Xn||t instanceof ag}function DK(t){return t.path===null&&(t.path=[]),t}});var nd=F(Br=>{"use strict";var FK=Br&&Br.__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]})),LK=Br&&Br.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),jK=Br&&Br.__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"&&FK(r,e,n[i]);return LK(r,e),r}})(),UK=Br&&Br.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Br,"__esModule",{value:!0});Br.nullSymbol=void 0;var L_=UK(pc()),j_=jK(Cn()),cg=En();Br.nullSymbol=Symbol("null");var HK=/\//g,BK=/~/g,VK=/~1/g,WK=/~0/g,zK=t=>{try{return decodeURIComponent(t)}catch{return t}},ug=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=oT(e);for(let a=0;a<i.length;a++){if(lg(this,r,n)&&(this.path=t.join(this.path,i.slice(a))),typeof this.value=="object"&&this.value!==null&&!aT(n)&&"$ref"in this.value)return this;let l=i[a];if(this.value[l]===void 0||this.value[l]===null&&a===i.length-1){let f=!1;for(let w=i.length-1;w>a;w--){let C=i.slice(a,w+1).join("/");if(this.value[C]!==void 0){this.value=this.value[C],a=w,f=!0;break}}if(f)continue;if(l in this.value&&this.value[l]===null){this.value=Br.nullSymbol;continue}this.value=null;let d=this.$ref.path||"",m=this.path.replace(d,""),g=t.join("",s),y=n?.replace(d,"");throw new cg.MissingPointerError(l,decodeURI(this.originalPath),m,g,y)}else this.value=this.value[l];s.push(l)}return(!this.value||this.value.$ref&&j_.resolve(this.path,this.value.$ref)!==n)&&lg(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=oT(e);for(let a=0;a<i.length-1;a++)lg(this,n),s=i[a],this.value&&this.value[s]!==void 0?this.value=this.value[s]:this.value=sT(this,s,{});return lg(this,n),s=i[i.length-1],sT(this,s,r),e}static parse(e,r){let n=j_.getHash(e).substring(1);if(!n)return[];let i=n.split("/");for(let s=0;s<i.length;s++)i[s]=zK(i[s].replace(VK,"/").replace(WK,"~"));if(i[0]!=="")throw new cg.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(BK,"~0").replace(HK,"~1"))}return e}};function lg(t,e,r){if(L_.default.isAllowed$Ref(t.value,e)){let n=j_.resolve(t.path,t.value.$ref);if(n===t.path&&!aT(r))t.circular=!0;else{let i=t.$ref.$refs._resolve(n,t.path,e);return i===null?!1:(t.indirections+=i.indirections+1,L_.default.isExtended$Ref(t.value)?(t.value=L_.default.dereference(t.value,i.value),!1):(t.$ref=i.$ref,t.path=i.path,t.value=i.value,!0))}}}Br.default=ug;function sT(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 cg.JSONParserError(`Error assigning $ref pointer "${t.path}".
|
|
240
|
+
Cannot set "${e}" of a non-object.`);return r}function oT(t){if((0,cg.isHandledError)(t))throw t;return t}function aT(t){return typeof t=="string"&&ug.parse(t).length==0}});var pc=F(ts=>{"use strict";var JK=ts&&ts.__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]})),YK=ts&&ts.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),GK=ts&&ts.__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"&&JK(r,e,n[i]);return YK(r,e),r}})();Object.defineProperty(ts,"__esModule",{value:!0});var fg=GK(nd()),dg=En(),U_=Cn(),H_=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(dg.normalizeError).filter(({footprint:n})=>!r.includes(n))):(!("footprint"in e)||!r.includes(e.footprint))&&this.errors.push((0,dg.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 fg.default(this,e,n);try{let a=s.resolve(this.value,r,i);return a.value===fg.nullSymbol&&(a.value=null),a}catch(a){if(!r||!r.continueOnError||!(0,dg.isHandledError)(a))throw a;return a.path===null&&(a.path=(0,U_.safePointerToPath)((0,U_.getHash)(i))),a instanceof dg.InvalidPointerError&&(a.source=decodeURI((0,U_.stripHash)(i))),this.addError(a),null}}set(e,r){let n=new fg.default(this,e);this.value=n.set(this.value,r),this.value===fg.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}};ts.default=H_});var dT=F(ei=>{"use strict";var KK=ei&&ei.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),QK=ei&&ei.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ZK=ei&&ei.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&KK(r,e,n[i]);return QK(r,e),r}})(),fT=ei&&ei.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ei,"__esModule",{value:!0});var lT=eo(),XK=fT(pc()),to=ZK(Cn()),cT=fT(E_()),B_=class{paths(...e){return uT(this._$refs,e.flat()).map(n=>(0,cT.default)(n.decoded))}values(...e){let r=this._$refs;return uT(r,e.flat()).reduce((i,s)=>(i[(0,cT.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=to.resolve(this._root$Ref.path,e),i=to.stripHash(n),s=this._$refs[i];if(!s)throw(0,lT.ono)(`Error resolving $ref pointer "${e}".
|
|
241
|
+
"${i}" not found.`);s.set(n,r)}_get$Ref(e){e=to.resolve(this._root$Ref.path,e);let r=to.stripHash(e);return this._$refs[r]}_add(e){let r=to.stripHash(e),n=new XK.default(this);return n.path=r,this._$refs[r]=n,this._root$Ref=this._root$Ref||n,n}_resolve(e,r,n){let i=to.resolve(this._root$Ref.path,e),s=to.stripHash(i),a=this._$refs[s];if(!a)throw(0,lT.ono)(`Error resolving $ref pointer "${e}".
|
|
242
|
+
"${s}" not found.`);return a.resolve(i,n,e,r)}constructor(){this._$refs={},this.toJSON=this.values,this.circular=!1,this._$refs={},this._root$Ref=null}};ei.default=B_;function uT(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"?to.toFileSystemPath(n,!0):n}))}});var hT=F(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});hc.all=e6;hc.filter=t6;hc.sort=r6;hc.run=n6;function e6(t){return Object.keys(t||{}).filter(e=>typeof t[e]=="object").map(e=>(t[e].name=e,t[e]))}function t6(t,e,r){return t.filter(n=>!!pT(n,e,r))}function r6(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 n6(t,e,r,n){let i,s,a=0;return new Promise((l,f)=>{d();function d(){if(i=t[a++],!i)return f(s);try{let w=pT(i,e,r,m,n);if(w&&typeof w.then=="function")w.then(g,y);else if(w!==void 0)g(w);else if(a===t.length)throw new Error("No promise has been returned or callback has been called.")}catch(w){y(w)}}function m(w,C){w?y(w):g(C)}function g(w){l({plugin:i,result:w})}function y(w){s={plugin:i,error:w},d()}})}function pT(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 W_=F(rs=>{"use strict";var i6=rs&&rs.__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]})),s6=rs&&rs.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),mT=rs&&rs.__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"&&i6(r,e,n[i]);return s6(r,e),r}})();Object.defineProperty(rs,"__esModule",{value:!0});var V_=eo(),o6=mT(Cn()),ro=mT(hT()),va=En();async function a6(t,e,r){let n=t.indexOf("#"),i="";n>=0&&(i=t.substring(n),t=t.substring(0,n));let s=e._add(t),a={url:t,hash:i,extension:o6.getExtension(t)};try{let l=await l6(a,r,e);s.pathType=l.plugin.name,a.data=l.result;let f=await c6(a,r,e);return s.value=f.result,f.result}catch(l){throw(0,va.isHandledError)(l)&&(s.value=l),l}}async function l6(t,e,r){let n=ro.all(e.resolve);n=ro.filter(n,"canRead",t),ro.sort(n);try{return await ro.run(n,"read",t,r)}catch(i){throw!i&&e.continueOnError?new va.UnmatchedResolverError(t.url):!i||!("error"in i)?V_.ono.syntax(`Unable to resolve $ref pointer "${t.url}"`):i.error instanceof va.ResolverError?i.error:new va.ResolverError(i,t.url)}}async function c6(t,e,r){let n=ro.all(e.parse),i=ro.filter(n,"canParse",t),s=i.length>0?i:n;ro.sort(s);try{let a=await ro.run(s,"parse",t,r);if(!a.plugin.allowEmpty&&u6(a.result))throw V_.ono.syntax(`Error parsing "${t.url}" as ${a.plugin.name}.
|
|
243
|
+
Parsed value is empty`);return a}catch(a){throw!a&&e.continueOnError?new va.UnmatchedParserError(t.url):a&&a.message&&a.message.startsWith("Error parsing")?a:!a||!("error"in a)?V_.ono.syntax(`Unable to parse ${t.url}`):a.error instanceof va.ParserError?a.error:new va.ParserError(a.error.message,t.url)}}function u6(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}rs.default=a6});var yT=F(z_=>{"use strict";Object.defineProperty(z_,"__esModule",{value:!0});var gT=En();z_.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 gT.ParserError(n.message,t.url)}throw new gT.ParserError(r.message,t.url)}}else return e}}});var mc=F((uee,ba)=>{"use strict";function vT(t){return typeof t>"u"||t===null}function f6(t){return typeof t=="object"&&t!==null}function d6(t){return Array.isArray(t)?t:vT(t)?[]:[t]}function p6(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 h6(t,e){let r="";for(let n=0;n<e;n+=1)r+=t;return r}function m6(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}ba.exports.isNothing=vT;ba.exports.isObject=f6;ba.exports.toArray=d6;ba.exports.repeat=h6;ba.exports.isNegativeZero=m6;ba.exports.extend=p6});var gc=F((fee,ST)=>{"use strict";function bT(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
|
-
`+t.mark.snippet),n+" "+r):n}function id(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=
|
|
246
|
-
`+l}let m=J_(t.buffer,n[
|
|
245
|
+
`+t.mark.snippet),n+" "+r):n}function id(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=bT(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}id.prototype=Object.create(Error.prototype);id.prototype.constructor=id;id.prototype.toString=function(e){return this.name+": "+bT(this,e)};ST.exports=id});var _T=F((dee,wT)=>{"use strict";var sd=mc();function J_(t,e,r,n,i){let s="",a="",l=Math.floor(i/2)-1;return n-e>l&&(s=" ... ",e=n-l+s.length),r-n>l&&(a=" ...",r=n+l-a.length),{str:s+t.slice(e,r).replace(/\t/g,"\u2192")+a,pos:n-e+s.length}}function Y_(t,e){return sd.repeat(" ",e-t.length)+t}function g6(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,a=-1;for(;s=r.exec(t.buffer);)i.push(s.index),n.push(s.index+s[0].length),t.position<=s.index&&a<0&&(a=n.length-2);a<0&&(a=n.length-1);let l="",f=Math.min(t.line+e.linesAfter,i.length).toString().length,d=e.maxLength-(e.indent+f+3);for(let g=1;g<=e.linesBefore&&!(a-g<0);g++){let y=J_(t.buffer,n[a-g],i[a-g],t.position-(n[a]-n[a-g]),d);l=sd.repeat(" ",e.indent)+Y_((t.line-g+1).toString(),f)+" | "+y.str+`
|
|
246
|
+
`+l}let m=J_(t.buffer,n[a],i[a],t.position,d);l+=sd.repeat(" ",e.indent)+Y_((t.line+1).toString(),f)+" | "+m.str+`
|
|
247
247
|
`,l+=sd.repeat("-",e.indent+f+3+m.pos)+`^
|
|
248
|
-
`;for(let g=1;g<=e.linesAfter&&!(
|
|
249
|
-
`}return l.replace(/\n$/,"")}
|
|
250
|
-
\r`;function
|
|
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
|
|
252
|
-
`,e-1))}function
|
|
248
|
+
`;for(let g=1;g<=e.linesAfter&&!(a+g>=i.length);g++){let y=J_(t.buffer,n[a+g],i[a+g],t.position-(n[a]-n[a+g]),d);l+=sd.repeat(" ",e.indent)+Y_((t.line+g+1).toString(),f)+" | "+y.str+`
|
|
249
|
+
`}return l.replace(/\n$/,"")}wT.exports=g6});var fr=F((pee,xT)=>{"use strict";var RT=gc(),y6=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],v6=["scalar","sequence","mapping"];function b6(t){let e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}function S6(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(y6.indexOf(r)===-1)throw new RT('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=b6(e.styleAliases||null),v6.indexOf(this.kind)===-1)throw new RT('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}xT.exports=S6});var Q_=F((hee,ET)=>{"use strict";var od=gc(),G_=fr();function CT(t,e){let r=[];return t[e].forEach(function(n){let i=r.length;r.forEach(function(s,a){s.tag===n.tag&&s.kind===n.kind&&s.multi===n.multi&&(i=a)}),r[i]=n}),r}function w6(){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 K_(t){return this.extend(t)}K_.prototype.extend=function(e){let r=[],n=[];if(e instanceof G_)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 od("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(s){if(!(s instanceof G_))throw new od("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new od("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 od("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 G_))throw new od("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let i=Object.create(K_.prototype);return i.implicit=(this.implicit||[]).concat(r),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=CT(i,"implicit"),i.compiledExplicit=CT(i,"explicit"),i.compiledTypeMap=w6(i.compiledImplicit,i.compiledExplicit),i};ET.exports=K_});var Z_=F((mee,OT)=>{"use strict";var _6=fr();OT.exports=new _6("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}})});var X_=F((gee,IT)=>{"use strict";var R6=fr();IT.exports=new R6("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}})});var eR=F((yee,PT)=>{"use strict";var x6=fr();PT.exports=new x6("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}})});var tR=F((vee,kT)=>{"use strict";var C6=Q_();kT.exports=new C6({explicit:[Z_(),X_(),eR()]})});var rR=F((bee,TT)=>{"use strict";var E6=fr();function O6(t){if(t===null)return!0;let e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}function I6(){return null}function P6(t){return t===null}TT.exports=new E6("tag:yaml.org,2002:null",{kind:"scalar",resolve:O6,construct:I6,predicate:P6,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"})});var nR=F((See,AT)=>{"use strict";var k6=fr();function T6(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 A6(t){return t==="true"||t==="True"||t==="TRUE"}function q6(t){return Object.prototype.toString.call(t)==="[object Boolean]"}AT.exports=new k6("tag:yaml.org,2002:bool",{kind:"scalar",resolve:T6,construct:A6,predicate:q6,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"})});var iR=F((wee,qT)=>{"use strict";var $6=mc(),M6=fr();function N6(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function D6(t){return t>=48&&t<=55}function F6(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(ad(t))}if(i==="x"){for(r++;r<e;r++){if(!N6(t.charCodeAt(r)))return!1;n=!0}return n&&Number.isFinite(ad(t))}if(i==="o"){for(r++;r<e;r++){if(!D6(t.charCodeAt(r)))return!1;n=!0}return n&&Number.isFinite(ad(t))}}for(;r<e;r++){if(!F6(t.charCodeAt(r)))return!1;n=!0}return n?Number.isFinite(ad(t)):!1}function ad(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 j6(t){return ad(t)}function U6(t){return Object.prototype.toString.call(t)==="[object Number]"&&t%1===0&&!$6.isNegativeZero(t)}qT.exports=new M6("tag:yaml.org,2002:int",{kind:"scalar",resolve:L6,construct:j6,predicate:U6,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 sR=F((_ee,MT)=>{"use strict";var $T=mc(),H6=fr(),B6=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),V6=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function W6(t){return t===null||!B6.test(t)?!1:Number.isFinite(parseFloat(t,10))?!0:V6.test(t)}function z6(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 J6=/^[-+]?[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($T.isNegativeZero(t))return"-0.0";let r=t.toString(10);return J6.test(r)?r.replace("e",".e"):r}function G6(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||$T.isNegativeZero(t))}MT.exports=new H6("tag:yaml.org,2002:float",{kind:"scalar",resolve:W6,construct:z6,predicate:G6,represent:Y6,defaultStyle:"lowercase"})});var oR=F((Ree,NT)=>{"use strict";NT.exports=tR().extend({implicit:[rR(),nR(),iR(),sR()]})});var aR=F((xee,DT)=>{"use strict";DT.exports=oR()});var lR=F((Cee,jT)=>{"use strict";var K6=fr(),FT=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),LT=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 Q6(t){return t===null?!1:FT.exec(t)!==null||LT.exec(t)!==null}function Z6(t){let e=0,r=null,n=FT.exec(t);if(n===null&&(n=LT.exec(t)),n===null)throw new Error("Date resolve error");let i=+n[1],s=+n[2]-1,a=+n[3];if(!n[4])return new Date(Date.UTC(i,s,a));let l=+n[4],f=+n[5],d=+n[6];if(n[7]){for(e=n[7].slice(0,3);e.length<3;)e+="0";e=+e}if(n[9]){let g=+n[10],y=+(n[11]||0);r=(g*60+y)*6e4,n[9]==="-"&&(r=-r)}let m=new Date(Date.UTC(i,s,a,l,f,d,e));return r&&m.setTime(m.getTime()-r),m}function X6(t){return t.toISOString()}jT.exports=new K6("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Q6,construct:Z6,instanceOf:Date,represent:X6})});var cR=F((Eee,UT)=>{"use strict";var e4=fr();function t4(t){return t==="<<"||t===null}UT.exports=new e4("tag:yaml.org,2002:merge",{kind:"scalar",resolve:t4})});var fR=F((Oee,HT)=>{"use strict";var r4=fr(),uR=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
250
|
+
\r`;function n4(t){if(t===null)return!1;let e=0,r=t.length,n=uR;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 i4(t){let e=t.replace(/[\r\n=]/g,""),r=e.length,n=uR,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 a=r%4*6;return a===0?(s.push(i>>16&255),s.push(i>>8&255),s.push(i&255)):a===18?(s.push(i>>10&255),s.push(i>>2&255)):a===12&&s.push(i>>4&255),new Uint8Array(s)}function s4(t){let e="",r=0,n=t.length,i=uR;for(let a=0;a<n;a++)a%3===0&&a&&(e+=i[r>>18&63],e+=i[r>>12&63],e+=i[r>>6&63],e+=i[r&63]),r=(r<<8)+t[a];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 o4(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}HT.exports=new r4("tag:yaml.org,2002:binary",{kind:"scalar",resolve:n4,construct:i4,predicate:o4,represent:s4})});var dR=F((Iee,BT)=>{"use strict";var a4=fr(),l4=Object.prototype.hasOwnProperty,c4=Object.prototype.toString;function u4(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],a=!1;if(c4.call(s)!=="[object Object]")return!1;let l;for(l in s)if(l4.call(s,l))if(!a)a=!0;else return!1;if(!a)return!1;if(e.indexOf(l)===-1)e.push(l);else return!1}return!0}function f4(t){return t!==null?t:[]}BT.exports=new a4("tag:yaml.org,2002:omap",{kind:"sequence",resolve:u4,construct:f4})});var pR=F((Pee,VT)=>{"use strict";var d4=fr(),p4=Object.prototype.toString;function h4(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(p4.call(s)!=="[object Object]")return!1;let a=Object.keys(s);if(a.length!==1)return!1;r[n]=[a[0],s[a[0]]]}return!0}function m4(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],a=Object.keys(s);r[n]=[a[0],s[a[0]]]}return r}VT.exports=new d4("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:h4,construct:m4})});var hR=F((kee,WT)=>{"use strict";var g4=fr(),y4=Object.prototype.hasOwnProperty;function v4(t){if(t===null)return!0;let e=t;for(let r in e)if(y4.call(e,r)&&e[r]!==null)return!1;return!0}function b4(t){return t!==null?t:{}}WT.exports=new g4("tag:yaml.org,2002:set",{kind:"mapping",resolve:v4,construct:b4})});var pg=F((Tee,zT)=>{"use strict";zT.exports=aR().extend({implicit:[lR(),cR()],explicit:[fR(),dR(),pR(),hR()]})});var dA=F((Aee,vR)=>{"use strict";var Sa=mc(),eA=gc(),S4=_T(),w4=pg(),ti=Object.prototype.hasOwnProperty,hg=1,tA=2,rA=3,mg=4,mR=1,_4=2,JT=3,R4=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,x4=/[\x85\u2028\u2029]/,C4=/[,\[\]{}]/,nA=/^(?:!|!!|![0-9A-Za-z-]+!)$/,iA=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function YT(t){return Object.prototype.toString.call(t)}function Ci(t){return t===10||t===13}function ns(t){return t===9||t===32}function Vr(t){return t===9||t===32||t===10||t===13}function yc(t){return t===44||t===91||t===93||t===123||t===125}function E4(t){if(t>=48&&t<=57)return t-48;let e=t|32;return e>=97&&e<=102?e-97+10:-1}function O4(t){return t===120?2:t===117?4:t===85?8:0}function I4(t){return t>=48&&t<=57?t-48:-1}function GT(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 P4(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}function sA(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}var oA=new Array(256),aA=new Array(256);for(let t=0;t<256;t++)oA[t]=GT(t)?1:0,aA[t]=GT(t);function k4(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||w4,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 lA(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=S4(r),new eA(e,r)}function de(t,e){throw lA(t,e)}function gg(t,e){t.onWarning&&t.onWarning.call(null,lA(t,e))}function wa(t,e,r){let n=t.anchorMapTransactions;if(n.length!==0){let i=n[n.length-1];ti.call(i,e)||(i[e]={existed:ti.call(t.anchorMap,e),value:t.anchorMap[e]})}t.anchorMap[e]=r}function T4(t){t.anchorMapTransactions.push(Object.create(null))}function A4(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,a=i.length;s<a;s+=1){let l=i[s];ti.call(n,l)||(n[l]=e[l])}}function q4(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 cA(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 KT(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 QT={YAML:function(e,r,n){e.version!==null&&de(e,"duplication of %YAML directive"),n.length!==1&&de(e,"YAML directive accepts exactly one argument");let i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]);i===null&&de(e,"ill-formed argument of the YAML directive");let s=parseInt(i[1],10),a=parseInt(i[2],10);s!==1&&de(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=a<2,a!==1&&a!==2&&gg(e,"unsupported YAML version of the document")},TAG:function(e,r,n){let i;n.length!==2&&de(e,"TAG directive accepts exactly two arguments");let s=n[0];i=n[1],nA.test(s)||de(e,"ill-formed tag handle (first argument) of the TAG directive"),ti.call(e.tagMap,s)&&de(e,'there is a previously declared suffix for "'+s+'" tag handle'),iA.test(i)||de(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch{de(e,"tag prefix is malformed: "+i)}e.tagMap[s]=i}};function no(t,e,r,n){if(e<r){let i=t.input.slice(e,r);if(n)for(let s=0,a=i.length;s<a;s+=1){let l=i.charCodeAt(s);l===9||l>=32&&l<=1114111||de(t,"expected valid JSON character")}else R4.test(i)&&de(t,"the stream contains non-printable characters");t.result+=i}}function ZT(t,e,r,n){Sa.isObject(r)||de(t,"cannot merge mappings; the provided source object is unacceptable");let i=Object.keys(r);for(let s=0,a=i.length;s<a;s+=1){let l=i[s];ti.call(e,l)||(sA(e,l,r[l]),n[l]=!0)}}function vc(t,e,r,n,i,s,a,l,f){if(Array.isArray(i)){i=Array.prototype.slice.call(i);for(let d=0,m=i.length;d<m;d+=1)Array.isArray(i[d])&&de(t,"nested arrays are not supported inside keys"),typeof i=="object"&&YT(i[d])==="[object Object]"&&(i[d]="[object Object]")}if(typeof i=="object"&&YT(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&&de(t,"merge sequence length exceeded maxMergeSeqLength ("+t.maxMergeSeqLength+")");let d=new Set;for(let m=0,g=s.length;m<g;m+=1){let y=s[m];d.has(y)||(d.add(y),ZT(t,e,y,r))}}else ZT(t,e,s,r);else!t.json&&!ti.call(r,i)&&ti.call(e,i)&&(t.line=a||t.line,t.lineStart=l||t.lineStart,t.position=f||t.position,de(t,"duplicated mapping key")),sA(e,i,s),delete r[i];return e}function gR(t){let e=t.input.charCodeAt(t.position);e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):de(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function Lt(t,e,r){let n=0,i=t.input.charCodeAt(t.position);for(;i!==0;){for(;ns(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(Ci(i))for(gR(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&&gg(t,"deficient indentation"),n}function yg(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||Vr(r)))}function yR(t,e){e===1?t.result+=" ":e>1&&(t.result+=Sa.repeat(`
|
|
252
|
+
`,e-1))}function $4(t,e,r){let n,i,s,a,l,f,d=t.kind,m=t.result,g=t.input.charCodeAt(t.position);if(Vr(g)||yc(g)||g===35||g===38||g===42||g===33||g===124||g===62||g===39||g===34||g===37||g===64||g===96)return!1;if(g===63||g===45){let y=t.input.charCodeAt(t.position+1);if(Vr(y)||r&&yc(y))return!1}for(t.kind="scalar",t.result="",n=i=t.position,s=!1;g!==0;){if(g===58){let y=t.input.charCodeAt(t.position+1);if(Vr(y)||r&&yc(y))break}else if(g===35){let y=t.input.charCodeAt(t.position-1);if(Vr(y))break}else{if(t.position===t.lineStart&&yg(t)||r&&yc(g))break;if(Ci(g))if(a=t.line,l=t.lineStart,f=t.lineIndent,Lt(t,!1,-1),t.lineIndent>=e){s=!0,g=t.input.charCodeAt(t.position);continue}else{t.position=i,t.line=a,t.lineStart=l,t.lineIndent=f;break}}s&&(no(t,n,i,!1),yR(t,t.line-a),n=i=t.position,s=!1),ns(g)||(i=t.position+1),g=t.input.charCodeAt(++t.position)}return no(t,n,i,!1),t.result?!0:(t.kind=d,t.result=m,!1)}function M4(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(no(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 Ci(i)?(no(t,r,n,!0),yR(t,Lt(t,!1,e)),r=n=t.position):t.position===t.lineStart&&yg(t)?de(t,"unexpected end of the document within a single quoted scalar"):(t.position++,ns(i)||(n=t.position));de(t,"unexpected end of the stream within a single quoted scalar")}function N4(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 no(t,r,t.position,!0),t.position++,!0;if(s===92){if(no(t,r,t.position,!0),s=t.input.charCodeAt(++t.position),Ci(s))Lt(t,!1,e);else if(s<256&&oA[s])t.result+=aA[s],t.position++;else if((i=O4(s))>0){let a=i,l=0;for(;a>0;a--)s=t.input.charCodeAt(++t.position),(i=E4(s))>=0?l=(l<<4)+i:de(t,"expected hexadecimal character");t.result+=P4(l),t.position++}else de(t,"unknown escape sequence");r=n=t.position}else Ci(s)?(no(t,r,n,!0),yR(t,Lt(t,!1,e)),r=n=t.position):t.position===t.lineStart&&yg(t)?de(t,"unexpected end of the document within a double quoted scalar"):(t.position++,ns(s)||(n=t.position))}de(t,"unexpected end of the stream within a double quoted scalar")}function D4(t,e){let r=!0,n,i,s,a=t.tag,l,f=t.anchor,d,m,g,y,w=Object.create(null),C,R,T,A=t.input.charCodeAt(t.position);if(A===91)d=93,y=!1,l=[];else if(A===123)d=125,y=!0,l={};else return!1;for(t.anchor!==null&&wa(t,t.anchor,l),A=t.input.charCodeAt(++t.position);A!==0;){if(Lt(t,!0,e),A=t.input.charCodeAt(t.position),A===d)return t.position++,t.tag=a,t.anchor=f,t.kind=y?"mapping":"sequence",t.result=l,!0;if(r?A===44&&de(t,"expected the node content, but found ','"):de(t,"missed comma between flow collection entries"),R=C=T=null,m=g=!1,A===63){let U=t.input.charCodeAt(t.position+1);Vr(U)&&(m=g=!0,t.position++,Lt(t,!0,e))}n=t.line,i=t.lineStart,s=t.position,bc(t,e,hg,!1,!0),R=t.tag,C=t.result,Lt(t,!0,e),A=t.input.charCodeAt(t.position),(g||t.line===n)&&A===58&&(m=!0,A=t.input.charCodeAt(++t.position),Lt(t,!0,e),bc(t,e,hg,!1,!0),T=t.result),y?vc(t,l,w,R,C,T,n,i,s):m?l.push(vc(t,null,w,R,C,T,n,i,s)):l.push(C),Lt(t,!0,e),A=t.input.charCodeAt(t.position),A===44?(r=!0,A=t.input.charCodeAt(++t.position)):r=!1}de(t,"unexpected end of the stream within a flow collection")}function F4(t,e){let r,n=mR,i=!1,s=!1,a=e,l=0,f=!1,d,m=t.input.charCodeAt(t.position);if(m===124)r=!1;else if(m===62)r=!0;else return!1;for(t.kind="scalar",t.result="";m!==0;)if(m=t.input.charCodeAt(++t.position),m===43||m===45)mR===n?n=m===43?JT:_4:de(t,"repeat of a chomping mode identifier");else if((d=I4(m))>=0)d===0?de(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?de(t,"repeat of an indentation width identifier"):(a=e+d-1,s=!0);else break;if(ns(m)){do m=t.input.charCodeAt(++t.position);while(ns(m));if(m===35)do m=t.input.charCodeAt(++t.position);while(!Ci(m)&&m!==0)}for(;m!==0;){for(gR(t),t.lineIndent=0,m=t.input.charCodeAt(t.position);(!s||t.lineIndent<a)&&m===32;)t.lineIndent++,m=t.input.charCodeAt(++t.position);if(!s&&t.lineIndent>a&&(a=t.lineIndent),Ci(m)){l++;continue}if(!s&&a===0&&de(t,"missing indentation for block scalar"),t.lineIndent<a){n===JT?t.result+=Sa.repeat(`
|
|
253
253
|
`,i?1+l:l):n===mR&&i&&(t.result+=`
|
|
254
254
|
`);break}r?ns(m)?(f=!0,t.result+=Sa.repeat(`
|
|
255
255
|
`,i?1+l:l)):f?(f=!1,t.result+=Sa.repeat(`
|
|
256
256
|
`,l+1)):l===0?i&&(t.result+=" "):t.result+=Sa.repeat(`
|
|
257
257
|
`,l):t.result+=Sa.repeat(`
|
|
258
|
-
`,i?1+l:l),i=!0,s=!0,l=0;let g=t.position;for(;!Ci(m)&&m!==0;)m=t.input.charCodeAt(++t.position);no(t,g,t.position,!1)}return!0}function
|
|
259
|
-
`),t.charCodeAt(0)===65279&&(t=t.slice(1)));let r=new
|
|
260
|
-
`,n);l===-1?(
|
|
261
|
-
`&&(i+=r),i+=
|
|
262
|
-
`+Sg.repeat(" ",t.indent*e)}function
|
|
258
|
+
`,i?1+l:l),i=!0,s=!0,l=0;let g=t.position;for(;!Ci(m)&&m!==0;)m=t.input.charCodeAt(++t.position);no(t,g,t.position,!1)}return!0}function XT(t,e){let r=t.tag,n=t.anchor,i=[],s=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&wa(t,t.anchor,i);let a=t.input.charCodeAt(t.position);for(;a!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,de(t,"tab characters must not be used in indentation")),a===45);){let l=t.input.charCodeAt(t.position+1);if(!Vr(l))break;if(s=!0,t.position++,Lt(t,!0,-1)&&t.lineIndent<=e){i.push(null),a=t.input.charCodeAt(t.position);continue}let f=t.line;if(bc(t,e,rA,!1,!0),i.push(t.result),Lt(t,!0,-1),a=t.input.charCodeAt(t.position),(t.line===f||t.lineIndent>e)&&a!==0)de(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 uA(t,e,r){let n,i,s,a,l=t.tag,f=t.anchor,d={},m=Object.create(null),g=null,y=null,w=null,C=!1,R=!1;if(t.firstTabInLine!==-1)return!1;t.anchor!==null&&wa(t,t.anchor,d);let T=t.input.charCodeAt(t.position);for(;T!==0;){!C&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,de(t,"tab characters must not be used in indentation"));let A=t.input.charCodeAt(t.position+1),U=t.line;if((T===63||T===58)&&Vr(A))T===63?(C&&(vc(t,d,m,g,y,null,i,s,a),g=y=w=null),R=!0,C=!0,n=!0):C?(C=!1,n=!0):de(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,T=A;else{if(i=t.line,s=t.lineStart,a=t.position,!bc(t,r,tA,!1,!0))break;if(t.line===U){for(T=t.input.charCodeAt(t.position);ns(T);)T=t.input.charCodeAt(++t.position);if(T===58)T=t.input.charCodeAt(++t.position),Vr(T)||de(t,"a whitespace character is expected after the key-value separator within a block mapping"),C&&(vc(t,d,m,g,y,null,i,s,a),g=y=w=null),R=!0,C=!1,n=!1,g=t.tag,y=t.result;else if(R)de(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=l,t.anchor=f,!0}else if(R)de(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===U||t.lineIndent>e)&&(C&&(i=t.line,s=t.lineStart,a=t.position),bc(t,e,mg,!0,n)&&(C?y=t.result:w=t.result),C||(vc(t,d,m,g,y,w,i,s,a),g=y=w=null),Lt(t,!0,-1),T=t.input.charCodeAt(t.position)),(t.line===U||t.lineIndent>e)&&T!==0)de(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return C&&vc(t,d,m,g,y,null,i,s,a),R&&(t.tag=l,t.anchor=f,t.kind="mapping",t.result=d),R}function L4(t){let e=!1,r=!1,n,i,s=t.input.charCodeAt(t.position);if(s!==33)return!1;t.tag!==null&&de(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 a=t.position;if(e){do s=t.input.charCodeAt(++t.position);while(s!==0&&s!==62);t.position<t.length?(i=t.input.slice(a,t.position),s=t.input.charCodeAt(++t.position)):de(t,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!Vr(s);)s===33&&(r?de(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(a-1,t.position+1),nA.test(n)||de(t,"named tag handle cannot contain such characters"),r=!0,a=t.position+1)),s=t.input.charCodeAt(++t.position);i=t.input.slice(a,t.position),C4.test(i)&&de(t,"tag suffix cannot contain flow indicator characters")}i&&!iA.test(i)&&de(t,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{de(t,"tag name is malformed: "+i)}return e?t.tag=i:ti.call(t.tagMap,n)?t.tag=t.tagMap[n]+i:n==="!"?t.tag="!"+i:n==="!!"?t.tag="tag:yaml.org,2002:"+i:de(t,'undeclared tag handle "'+n+'"'),!0}function j4(t){let e=t.input.charCodeAt(t.position);if(e!==38)return!1;t.anchor!==null&&de(t,"duplication of an anchor property"),e=t.input.charCodeAt(++t.position);let r=t.position;for(;e!==0&&!Vr(e)&&!yc(e);)e=t.input.charCodeAt(++t.position);return t.position===r&&de(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(r,t.position),!0}function U4(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&&!Vr(e)&&!yc(e);)e=t.input.charCodeAt(++t.position);t.position===r&&de(t,"name of an alias node must contain at least one character");let n=t.input.slice(r,t.position);return ti.call(t.anchorMap,n)||de(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],Lt(t,!0,-1),!0}function H4(t,e,r,n){let i=cA(t);return T4(t),KT(t,e),t.tag=null,t.anchor=null,t.kind=null,t.result=null,uA(t,r,n)&&t.kind==="mapping"?(A4(t),!0):(q4(t),KT(t,i),!1)}function bc(t,e,r,n,i){let s,a,l=1,f=!1,d=!1,m=null,g,y,w;t.depth>=t.maxDepth&&de(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 C=s=a=mg===r||rA===r;if(n&&Lt(t,!0,-1)&&(f=!0,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)),l===1)for(;;){let R=t.input.charCodeAt(t.position),T=cA(t);if(f&&(R===33&&t.tag!==null||R===38&&t.anchor!==null)||!L4(t)&&!j4(t))break;m===null&&(m=T),Lt(t,!0,-1)?(f=!0,a=C,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)):a=!1}if(a&&(a=f||i),l===1||mg===r)if(hg===r||tA===r?y=e:y=e+1,w=t.position-t.lineStart,l===1)if(a&&(XT(t,w)||uA(t,w,y))||D4(t,y))d=!0;else{let R=t.input.charCodeAt(t.position);m!==null&&C&&!a&&R!==124&&R!==62&&H4(t,m,m.position-m.lineStart,y)||s&&F4(t,y)||M4(t,y)||N4(t,y)?d=!0:U4(t)?(d=!0,(t.tag!==null||t.anchor!==null)&&de(t,"alias node should not have any properties")):$4(t,y,hg===r)&&(d=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&wa(t,t.anchor,t.result)}else l===0&&(d=a&&XT(t,w));if(t.tag===null)t.anchor!==null&&wa(t,t.anchor,t.result);else if(t.tag==="?"){t.result!==null&&t.kind!=="scalar"&&de(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"');for(let R=0,T=t.implicitTypes.length;R<T;R+=1)if(g=t.implicitTypes[R],g.resolve(t.result)){t.result=g.construct(t.result),t.tag=g.tag,t.anchor!==null&&wa(t,t.anchor,t.result);break}}else if(t.tag!=="!"){if(ti.call(t.typeMap[t.kind||"fallback"],t.tag))g=t.typeMap[t.kind||"fallback"][t.tag];else{g=null;let R=t.typeMap.multi[t.kind||"fallback"];for(let T=0,A=R.length;T<A;T+=1)if(t.tag.slice(0,R[T].tag.length)===R[T].tag){g=R[T];break}}g||de(t,"unknown tag !<"+t.tag+">"),t.result!==null&&g.kind!==t.kind&&de(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+g.kind+'", not "'+t.kind+'"'),g.resolve(t.result,t.tag)?(t.result=g.construct(t.result,t.tag),t.anchor!==null&&wa(t,t.anchor,t.result)):de(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.depth-=1,t.tag!==null||t.anchor!==null||d}function B4(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&&(Lt(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&&!Vr(n);)n=t.input.charCodeAt(++t.position);let s=t.input.slice(i,t.position),a=[];for(s.length<1&&de(t,"directive name must not be less than one character in length");n!==0;){for(;ns(n);)n=t.input.charCodeAt(++t.position);if(n===35){do n=t.input.charCodeAt(++t.position);while(n!==0&&!Ci(n));break}if(Ci(n))break;for(i=t.position;n!==0&&!Vr(n);)n=t.input.charCodeAt(++t.position);a.push(t.input.slice(i,t.position))}n!==0&&gR(t),ti.call(QT,s)?QT[s](t,s,a):gg(t,'unknown document directive "'+s+'"')}if(Lt(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,Lt(t,!0,-1)):r&&de(t,"directives end mark is expected"),bc(t,t.lineIndent-1,mg,!1,!0),Lt(t,!0,-1),t.checkLineBreaks&&x4.test(t.input.slice(e,t.position))&&gg(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&yg(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Lt(t,!0,-1));return}t.position<t.length-1&&de(t,"end of the stream or a document separator is expected")}function fA(t,e){t=String(t),e=e||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
|
|
259
|
+
`),t.charCodeAt(0)===65279&&(t=t.slice(1)));let r=new k4(t,e),n=t.indexOf("\0");for(n!==-1&&(r.position=n,de(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;)B4(r);return r.documents}function V4(t,e,r){e!==null&&typeof e=="object"&&typeof r>"u"&&(r=e,e=null);let n=fA(t,r);if(typeof e!="function")return n;for(let i=0,s=n.length;i<s;i+=1)e(n[i])}function W4(t,e){let r=fA(t,e);if(r.length!==0){if(r.length===1)return r[0];throw new eA("expected a single document in the stream, but found more")}}vR.exports.loadAll=V4;vR.exports.load=W4});var qA=F((qee,AA)=>{"use strict";var Sg=mc(),dd=gc(),z4=pg(),wA=Object.prototype.toString,_A=Object.prototype.hasOwnProperty,RR=65279,J4=9,cd=10,Y4=13,G4=32,K4=33,Q4=34,bR=35,Z4=37,X4=38,e3=39,t3=42,RA=44,r3=45,vg=58,n3=61,i3=62,s3=63,o3=64,xA=91,CA=93,a3=96,EA=123,l3=124,OA=125,dr={};dr[0]="\\0";dr[7]="\\a";dr[8]="\\b";dr[9]="\\t";dr[10]="\\n";dr[11]="\\v";dr[12]="\\f";dr[13]="\\r";dr[27]="\\e";dr[34]='\\"';dr[92]="\\\\";dr[133]="\\N";dr[160]="\\_";dr[8232]="\\L";dr[8233]="\\P";var c3=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],u3=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function f3(t,e){if(e===null)return{};let r={},n=Object.keys(e);for(let i=0,s=n.length;i<s;i+=1){let a=n[i],l=String(e[a]);a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2));let f=t.compiledTypeMap.fallback[a];f&&_A.call(f.styleAliases,l)&&(l=f.styleAliases[l]),r[a]=l}return r}function d3(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 dd("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+e+Sg.repeat("0",r-n.length)+n}var p3=1,ud=2;function h3(t){this.schema=t.schema||z4,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=Sg.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=f3(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==='"'?ud:p3,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 pA(t,e){let r=Sg.repeat(" ",e),n=0,i="",s=t.length;for(;n<s;){let a,l=t.indexOf(`
|
|
260
|
+
`,n);l===-1?(a=t.slice(n),n=s):(a=t.slice(n,l+1),n=l+1),a.length&&a!==`
|
|
261
|
+
`&&(i+=r),i+=a}return i}function SR(t,e){return`
|
|
262
|
+
`+Sg.repeat(" ",t.indent*e)}function m3(t,e){for(let r=0,n=t.implicitTypes.length;r<n;r+=1)if(t.implicitTypes[r].resolve(e))return!0;return!1}function bg(t){return t===G4||t===J4}function fd(t){return t>=32&&t<=126||t>=161&&t<=55295&&t!==8232&&t!==8233||t>=57344&&t<=65533&&t!==RR||t>=65536&&t<=1114111}function hA(t){return fd(t)&&t!==RR&&t!==Y4&&t!==cd}function mA(t,e,r){let n=hA(t),i=n&&!bg(t);return(r?n:n&&t!==RA&&t!==xA&&t!==CA&&t!==EA&&t!==OA)&&t!==bR&&!(e===vg&&!i)||hA(e)&&!bg(e)&&t===bR||e===vg&&i}function g3(t){return fd(t)&&t!==RR&&!bg(t)&&t!==r3&&t!==s3&&t!==vg&&t!==RA&&t!==xA&&t!==CA&&t!==EA&&t!==OA&&t!==bR&&t!==X4&&t!==t3&&t!==K4&&t!==l3&&t!==n3&&t!==i3&&t!==e3&&t!==Q4&&t!==Z4&&t!==o3&&t!==a3}function y3(t){return!bg(t)&&t!==vg}function ld(t,e){let r=t.charCodeAt(e),n;return r>=55296&&r<=56319&&e+1<t.length&&(n=t.charCodeAt(e+1),n>=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}function IA(t){return/^\n* /.test(t)}var PA=1,wR=2,kA=3,TA=4,Sc=5;function v3(t,e,r,n,i,s,a,l){let f,d=0,m=null,g=!1,y=!1,w=n!==-1,C=-1,R=g3(ld(t,0))&&y3(ld(t,t.length-1));if(e||a)for(f=0;f<t.length;d>=65536?f+=2:f++){if(d=ld(t,f),!fd(d))return Sc;R=R&&mA(d,m,l),m=d}else{for(f=0;f<t.length;d>=65536?f+=2:f++){if(d=ld(t,f),d===cd)g=!0,w&&(y=y||f-C-1>n&&t[C+1]!==" ",C=f);else if(!fd(d))return Sc;R=R&&mA(d,m,l),m=d}y=y||w&&f-C-1>n&&t[C+1]!==" "}return!g&&!y?R&&!a&&!i(t)?PA:s===ud?Sc:wR:r>9&&IA(t)?Sc:a?s===ud?Sc:wR:y?TA:kA}function b3(t,e,r,n,i){t.dump=(function(){if(e.length===0)return t.quotingType===ud?'""':"''";if(!t.noCompatMode&&(c3.indexOf(e)!==-1||u3.test(e)))return t.quotingType===ud?'"'+e+'"':"'"+e+"'";let s=t.indent*Math.max(1,r),a=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-s),l=n||t.flowLevel>-1&&r>=t.flowLevel;function f(d){return m3(t,d)}switch(v3(e,l,t.indent,a,f,t.quotingType,t.forceQuotes&&!n,i)){case PA:return e;case wR:return"'"+e.replace(/'/g,"''")+"'";case kA:return"|"+gA(e,t.indent)+yA(pA(e,s));case TA:return">"+gA(e,t.indent)+yA(pA(S3(e,a),s));case Sc:return'"'+w3(e,a)+'"';default:throw new dd("impossible error: invalid scalar style")}})()}function gA(t,e){let r=IA(t)?String(e):"",n=t[t.length-1]===`
|
|
263
263
|
`,s=n&&(t[t.length-2]===`
|
|
264
264
|
`||t===`
|
|
265
265
|
`)?"+":n?"":"-";return r+s+`
|
|
266
|
-
`}function
|
|
267
|
-
`?t.slice(0,-1):t}function
|
|
268
|
-
`);return l=l!==-1?l:t.length,r.lastIndex=l,
|
|
269
|
-
`||t[0]===" ",s,
|
|
270
|
-
`:"")+
|
|
271
|
-
`+t.slice(i,s),i=s+1),
|
|
272
|
-
`,t.length-i>e&&
|
|
273
|
-
`+t.slice(
|
|
274
|
-
`:""}
|
|
266
|
+
`}function yA(t){return t[t.length-1]===`
|
|
267
|
+
`?t.slice(0,-1):t}function S3(t,e){let r=/(\n+)([^\n]*)/g,n=(function(){let l=t.indexOf(`
|
|
268
|
+
`);return l=l!==-1?l:t.length,r.lastIndex=l,vA(t.slice(0,l),e)})(),i=t[0]===`
|
|
269
|
+
`||t[0]===" ",s,a;for(;a=r.exec(t);){let l=a[1],f=a[2];s=f[0]===" ",n+=l+(!i&&!s&&f!==""?`
|
|
270
|
+
`:"")+vA(f,e),i=s}return n}function vA(t,e){if(t===""||t[0]===" ")return t;let r=/ [^ ]/g,n,i=0,s,a=0,l=0,f="";for(;n=r.exec(t);)l=n.index,l-i>e&&(s=a>i?a:l,f+=`
|
|
271
|
+
`+t.slice(i,s),i=s+1),a=l;return f+=`
|
|
272
|
+
`,t.length-i>e&&a>i?f+=t.slice(i,a)+`
|
|
273
|
+
`+t.slice(a+1):f+=t.slice(i),f.slice(1)}function w3(t){let e="",r=0;for(let n=0;n<t.length;r>=65536?n+=2:n++){r=ld(t,n);let i=dr[r];!i&&fd(r)?(e+=t[n],r>=65536&&(e+=t[n+1])):e+=i||d3(r)}return e}function _3(t,e,r){let n="",i=t.tag;for(let s=0,a=r.length;s<a;s+=1){let l=r[s];t.replacer&&(l=t.replacer.call(r,String(s),l)),(is(t,e,l,!1,!1)||typeof l>"u"&&is(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump)}t.tag=i,t.dump="["+n+"]"}function bA(t,e,r,n){let i="",s=t.tag;for(let a=0,l=r.length;a<l;a+=1){let f=r[a];t.replacer&&(f=t.replacer.call(r,String(a),f)),(is(t,e+1,f,!0,!0,!1,!0)||typeof f>"u"&&is(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=SR(t,e)),t.dump&&cd===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump)}t.tag=s,t.dump=i||"[]"}function R3(t,e,r){let n="",i=t.tag,s=Object.keys(r);for(let a=0,l=s.length;a<l;a+=1){let f="";n!==""&&(f+=", "),t.condenseFlow&&(f+='"');let d=s[a],m=r[d];t.replacer&&(m=t.replacer.call(r,d,m)),is(t,e,d,!1,!1)&&(t.dump.length>1024&&(f+="? "),f+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),is(t,e,m,!1,!1)&&(f+=t.dump,n+=f))}t.tag=i,t.dump="{"+n+"}"}function x3(t,e,r,n){let i="",s=t.tag,a=Object.keys(r);if(t.sortKeys===!0)a.sort();else if(typeof t.sortKeys=="function")a.sort(t.sortKeys);else if(t.sortKeys)throw new dd("sortKeys must be a boolean or a function");for(let l=0,f=a.length;l<f;l+=1){let d="";(!n||i!=="")&&(d+=SR(t,e));let m=a[l],g=r[m];if(t.replacer&&(g=t.replacer.call(r,m,g)),!is(t,e+1,m,!0,!0,!0))continue;let y=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024;y&&(t.dump&&cd===t.dump.charCodeAt(0)?d+="?":d+="? "),d+=t.dump,y&&(d+=SR(t,e)),is(t,e+1,g,!0,y)&&(t.dump&&cd===t.dump.charCodeAt(0)?d+=":":d+=": ",d+=t.dump,i+=d)}t.tag=s,t.dump=i||"{}"}function SA(t,e,r){let n=r?t.explicitTypes:t.implicitTypes;for(let i=0,s=n.length;i<s;i+=1){let a=n[i];if((a.instanceOf||a.predicate)&&(!a.instanceOf||typeof e=="object"&&e instanceof a.instanceOf)&&(!a.predicate||a.predicate(e))){if(r?a.multi&&a.representName?t.tag=a.representName(e):t.tag=a.tag:t.tag="?",a.represent){let l=t.styleMap[a.tag]||a.defaultStyle,f;if(wA.call(a.represent)==="[object Function]")f=a.represent(e,l);else if(_A.call(a.represent,l))f=a.represent[l](e,l);else throw new dd("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');t.dump=f}return!0}}return!1}function is(t,e,r,n,i,s,a){t.tag=null,t.dump=r,SA(t,r,!1)||SA(t,r,!0);let l=wA.call(t.dump),f=n;n&&(n=t.flowLevel<0||t.flowLevel>e);let d=l==="[object Object]"||l==="[object Array]",m,g;if(d&&(m=t.duplicates.indexOf(r),g=m!==-1),(t.tag!==null&&t.tag!=="?"||g||t.indent!==2&&e>0)&&(i=!1),g&&t.usedDuplicates[m])t.dump="*ref_"+m;else{if(d&&g&&!t.usedDuplicates[m]&&(t.usedDuplicates[m]=!0),l==="[object Object]")n&&Object.keys(t.dump).length!==0?(x3(t,e,t.dump,i),g&&(t.dump="&ref_"+m+t.dump)):(R3(t,e,t.dump),g&&(t.dump="&ref_"+m+" "+t.dump));else if(l==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!a&&e>0?bA(t,e-1,t.dump,i):bA(t,e,t.dump,i),g&&(t.dump="&ref_"+m+t.dump)):(_3(t,e,t.dump),g&&(t.dump="&ref_"+m+" "+t.dump));else if(l==="[object String]")t.tag!=="?"&&b3(t,t.dump,e,s,f);else{if(l==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new dd("unacceptable kind of an object to dump "+l)}if(t.tag!==null&&t.tag!=="?"){let y=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21");t.tag[0]==="!"?y="!"+y:y.slice(0,18)==="tag:yaml.org,2002:"?y="!!"+y.slice(18):y="!<"+y+">",t.dump=y+" "+t.dump}}return!0}function C3(t,e){let r=[],n=[];_R(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 _R(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)_R(t[i],e,r);else{let i=Object.keys(t);for(let s=0,a=i.length;s<a;s+=1)_R(t[i[s]],e,r)}}}function E3(t,e){e=e||{};let r=new h3(e);r.noRefs||C3(t,r);let n=t;return r.replacer&&(n=r.replacer.call({"":n},"",n)),is(r,0,n,!0,!0)?r.dump+`
|
|
274
|
+
`:""}AA.exports.dump=E3});var CR=F(($ee,Er)=>{"use strict";var $A=dA(),O3=qA();function xR(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.")}}Er.exports.Type=fr();Er.exports.Schema=Q_();Er.exports.FAILSAFE_SCHEMA=tR();Er.exports.JSON_SCHEMA=oR();Er.exports.CORE_SCHEMA=aR();Er.exports.DEFAULT_SCHEMA=pg();Er.exports.load=$A.load;Er.exports.loadAll=$A.loadAll;Er.exports.dump=O3.dump;Er.exports.YAMLException=gc();Er.exports.types={binary:fR(),float:sR(),map:eR(),null:rR(),pairs:pR(),set:hR(),timestamp:lR(),bool:nR(),int:iR(),merge:cR(),omap:dR(),seq:X_(),str:Z_()};Er.exports.safeLoad=xR("safeLoad","load");Er.exports.safeLoadAll=xR("safeLoadAll","loadAll");Er.exports.safeDump=xR("safeDump","dump")});var MA=F(pd=>{"use strict";var I3=pd&&pd.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pd,"__esModule",{value:!0});var P3=En(),k3=I3(CR()),T3=CR();pd.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 k3.default.load(e,{schema:T3.JSON_SCHEMA})}catch(r){throw new P3.ParserError(r?.message||"Parser Error",t.url)}else return e}}});var NA=F(ER=>{"use strict";Object.defineProperty(ER,"__esModule",{value:!0});var A3=En(),q3=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i;ER.default={order:300,allowEmpty:!0,encoding:"utf8",canParse(t){return(typeof t.data=="string"||Buffer.isBuffer(t.data))&&q3.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 A3.ParserError("data is not text",t.url)}}});var DA=F(OR=>{"use strict";Object.defineProperty(OR,"__esModule",{value:!0});var $3=/\.(jpeg|jpg|gif|png|bmp|ico)$/i;OR.default={order:400,allowEmpty:!0,canParse(t){return Buffer.isBuffer(t.data)&&$3.test(t.url)},parse(t){return Buffer.isBuffer(t.data)?t.data:Buffer.from(t.data)}}});var UA=F(ri=>{"use strict";var M3=ri&&ri.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),N3=ri&&ri.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),D3=ri&&ri.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&M3(r,e,n[i]);return N3(r,e),r}})(),F3=ri&&ri.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ri,"__esModule",{value:!0});var L3=F3(it("fs")),FA=eo(),LA=D3(Cn()),jA=En();ri.default={order:100,canRead(t){return LA.isFileSystemPath(t.url)},async read(t){let e;try{e=LA.toFileSystemPath(t.url)}catch(r){throw new jA.ResolverError(FA.ono.uri(r,`Malformed URI: ${t.url}`),t.url)}try{return await L3.default.promises.readFile(e)}catch(r){throw new jA.ResolverError((0,FA.ono)(r,`Error opening file "${e}"`),e)}}}});var VA=F(ss=>{"use strict";var j3=ss&&ss.__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]})),U3=ss&&ss.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),H3=ss&&ss.__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"&&j3(r,e,n[i]);return U3(r,e),r}})();Object.defineProperty(ss,"__esModule",{value:!0});var wg=eo(),hd=H3(Cn()),HA=En();ss.default={order:200,headers:null,timeout:6e4,redirects:5,withCredentials:!1,canRead(t){return hd.isHttp(t.url)},read(t){let e=hd.parse(t.url);return typeof window<"u"&&!e.protocol&&(e.protocol=hd.parse(location.href).protocol),BA(e,this)}};async function BA(t,e,r){t=hd.parse(t);let n=r||[];n.push(t.href);try{let i=await B3(t,e);if(i.status>=400)throw(0,wg.ono)({status:i.status},`HTTP ERROR ${i.status}`);if(i.status>=300){if(!Number.isNaN(e.redirects)&&n.length>e.redirects)throw new HA.ResolverError((0,wg.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,wg.ono)({status:i.status},`HTTP ${i.status} redirect with no location header`);{let s=hd.resolve(t.href,i.headers.location);return UA(s,e,n)}}else{if(i.body){let s=await i.arrayBuffer();return Buffer.from(s)}return Buffer.alloc(0)}}catch(i){throw new jA.ResolverError((0,wg.ono)(i,`Error downloading ${t.href}`),t.href)}}async function U3(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 IR=F(os=>{"use strict";var wc=os&&os.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(os,"__esModule",{value:!0});os.getNewOptions=os.getJsonSchemaRefParserDefaultOptions=void 0;var H3=wc(mT()),B3=wc(qA()),V3=wc($A()),W3=wc(MA()),z3=wc(LA()),J3=wc(HA()),Y3=()=>({parse:{json:{...H3.default},yaml:{...B3.default},text:{...V3.default},binary:{...W3.default}},resolve:{file:{...z3.default},http:{...J3.default},external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative"},mutateInputSchema:!0});os.getJsonSchemaRefParserDefaultOptions=Y3;var G3=t=>{let e=(0,os.getJsonSchemaRefParserDefaultOptions)();return t&&VA(e,t),e};os.getNewOptions=G3;function VA(t,e){if(BA(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];BA(s)?t[i]=VA(o||{},s):s!==void 0&&(t[i]=s)}}return t}function BA(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}});var zA=F(_g=>{"use strict";Object.defineProperty(_g,"__esModule",{value:!0});_g.normalizeArgs=WA;var K3=IR();function WA(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,K3.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}}_g.default=WA});var JA=F(ni=>{"use strict";var Q3=ni&&ni.__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]})),Z3=ni&&ni.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),X3=ni&&ni.__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"&&Q3(r,e,n[i]);return Z3(r,e),r}})(),PR=ni&&ni.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ni,"__esModule",{value:!0});var e9=PR(pc()),t9=PR(nd()),r9=PR(W_()),_c=X3(Cn()),n9=En();function i9(t,e){if(!e.resolve?.external)return Promise.resolve();try{let r=kR(t.schema,t.$refs._root$Ref.path+"#",t.$refs,e);return Promise.all(r)}catch(r){return Promise.reject(r)}}function kR(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),e9.default.isExternal$Ref(t)&&o.push(s9(t,e,r,n));let l=Object.keys(t);for(let f of l){let d=t9.default.join(e,f),m=t[f];o=o.concat(kR(m,d,r,n,i,s))}}return o}async function s9(t,e,r,n){let i=n.dereference?.externalReferenceResolution==="root",s=_c.resolve(i?_c.cwd():e,t.$ref),o=_c.stripHash(s),l=r._$refs[o];if(l)return Promise.resolve(l.value);try{let f=await(0,r9.default)(s,r,n),d=kR(f,o+"#",r,n,new Set,!0);return Promise.all(d)}catch(f){if(!n?.continueOnError||!(0,n9.isHandledError)(f))throw f;return r._$refs[o]&&(f.source=decodeURI(_c.stripHash(e)),f.path=_c.safePointerToPath(_c.getHash(e))),[]}}ni.default=i9});var KA=F(ii=>{"use strict";var o9=ii&&ii.__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]})),a9=ii&&ii.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),l9=ii&&ii.__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"&&o9(r,e,n[i]);return a9(r,e),r}})(),GA=ii&&ii.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ii,"__esModule",{value:!0});var Rg=GA(pc()),md=GA(nd()),TR=l9(Cn());function c9(t,e){let r=[];AR(t,"schema",t.$refs._root$Ref.path+"#","#",0,r,t.$refs,e),u9(r)}function AR(t,e,r,n,i,s,o,l){let f=e===null?t:t[e];if(f&&typeof f=="object"&&!ArrayBuffer.isView(f))if(Rg.default.isAllowed$Ref(f))YA(t,e,r,n,i,s,o,l);else{let d=Object.keys(f).sort((m,g)=>m==="definitions"?-1:g==="definitions"?1:m.length-g.length);for(let m of d){let g=md.default.join(r,m),y=md.default.join(n,m),w=f[m];Rg.default.isAllowed$Ref(w)?YA(f,m,r,y,i,s,o,l):AR(f,m,g,y,i,s,o,l)}}}function YA(t,e,r,n,i,s,o,l){let f=e===null?t:t[e],d=TR.resolve(r,f.$ref),m=o._resolve(d,n,l);if(m===null)return;let y=md.default.parse(n).length,w=TR.stripHash(m.path),C=TR.getHash(m.path),R=w!==o._root$Ref.path,P=Rg.default.isExtended$Ref(f);i+=m.indirections;let A=f9(s,t,e);if(A)if(y<A.depth||i<A.indirections)d9(s,A);else return;s.push({$ref:f,parent:t,key:e,pathFromRoot:n,depth:y,file:w,hash:C,value:m.value,circular:m.circular,extended:P,external:R,indirections:i}),(!A||R)&&AR(m.value,null,m.path,n,i+1,s,o,l)}function u9(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=md.default.join(n,md.default.parse(i.hash.replace(r,"#"))):(e=i.file,r=i.hash,n=i.pathFromRoot,i.$ref=i.parent[i.key]=Rg.default.dereference(i.$ref,i.value),i.circular&&(i.$ref.$ref=i.pathFromRoot)):i.$ref.$ref=i.hash}function f9(t,e,r){for(let n of t)if(n&&n.parent===e&&n.key===r)return n}function d9(t,e){let r=t.indexOf(e);t.splice(r,1)}ii.default=c9});var rq=F(si=>{"use strict";var p9=si&&si.__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]})),h9=si&&si.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),m9=si&&si.__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"&&p9(r,e,n[i]);return h9(r,e),r}})(),eq=si&&si.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(si,"__esModule",{value:!0});var xg=eq(pc()),QA=eq(nd()),g9=eo(),ZA=m9(Cn()),y9=En();si.default=v9;function v9(t,e){let r=Date.now(),n=qR(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 qR(t,e,r,n,i,s,o,l,f){let d,m={value:t,circular:!1};if(l&&l.timeoutMs&&Date.now()-f>l.timeoutMs)throw new y9.TimeoutError(l.timeoutMs);let g=l.dereference||{},y=g.excludedPathMatcher||(()=>!1);if((g?.circular==="ignore"||!i.has(t))&&t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!y(r)){if(n.add(t),i.add(t),xg.default.isAllowed$Ref(t,l))d=XA(t,e,r,n,i,s,o,l,f),m.circular=d.circular,m.value=d.value;else for(let w of Object.keys(t)){let C=QA.default.join(e,w),R=QA.default.join(r,w);if(y(R))continue;let P=t[w],A=!1;if(xg.default.isAllowed$Ref(P,l)){if(d=XA(P,C,R,n,i,s,o,l,f),A=d.circular,t[w]!==d.value){let U=new Map;g?.preservedProperties&&typeof t[w]=="object"&&!Array.isArray(t[w])&&g?.preservedProperties.forEach(B=>{B in t[w]&&U.set(B,t[w][B])}),t[w]=d.value,g?.preservedProperties&&U.size&&typeof t[w]=="object"&&!Array.isArray(t[w])&&U.forEach((B,z)=>{t[w][z]=B}),g?.onDereference?.(P.$ref,t[w],t,w)}}else n.has(P)?A=tq(C,o,l):(d=qR(P,C,R,n,i,s,o,l,f),A=d.circular,t[w]!==d.value&&(t[w]=d.value));m.circular=m.circular||A}n.delete(t)}return m}function XA(t,e,r,n,i,s,o,l,f){let m=xg.default.isExternal$Ref(t)&&l?.dereference?.externalReferenceResolution==="root",g=ZA.resolve(m?ZA.cwd():e,t.$ref),y=s.get(g);if(y&&!y.circular){let U=Object.keys(t);if(U.length>1){let B={};for(let z of U)z!=="$ref"&&!(z in y.value)&&(B[z]=t[z]);return{circular:y.circular,value:Object.assign({},y.value,B)}}return y}let w=o._resolve(g,e,l);if(w===null)return{circular:!1,value:null};let C=w.circular,R=C||n.has(w.value);R&&tq(e,o,l);let P=xg.default.dereference(t,w.value);if(!R){let U=qR(P,w.path,r,n,i,s,o,l,f);R=U.circular,P=U.value}R&&!C&&l.dereference?.circular==="ignore"&&(P=t),C&&(P.$ref=r);let A={circular:R,value:P};return Object.keys(t).length===1&&s.set(g,A),A}function tq(t,e,r){if(e.circular=!0,r?.dereference?.onCircular?.(t),!r.dereference.circular)throw g9.ono.reference(`Circular $ref pointer found at ${t}`);return!0}});var nq=F($R=>{"use strict";Object.defineProperty($R,"__esModule",{value:!0});function b9(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(e){setTimeout(e,0)}}$R.default=b9()});var sq=F(gd=>{"use strict";var S9=gd&&gd.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gd,"__esModule",{value:!0});gd.default=w9;var iq=S9(nq());function w9(t,e){if(t){e.then(function(r){(0,iq.default)(function(){t(null,r)})},function(r){(0,iq.default)(function(){t(r)})});return}else return e}});var cq=F(we=>{"use strict";var _9=we&&we.__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]})),R9=we&&we.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),x9=we&&we.__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"&&_9(r,e,n[i]);return R9(r,e),r}})(),Ra=we&&we.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(we,"__esModule",{value:!0});we.getJsonSchemaRefParserDefaultOptions=we.jsonSchemaParserNormalizeArgs=we.dereferenceInternal=we.JSONParserErrorGroup=we.isHandledError=we.UnmatchedParserError=we.ParserError=we.ResolverError=we.MissingPointerError=we.InvalidPointerError=we.JSONParserError=we.UnmatchedResolverError=we.dereference=we.bundle=we.resolve=we.parse=we.$RefParser=void 0;var oq=Ra(uT()),C9=Ra(W_()),yd=Ra(zA());we.jsonSchemaParserNormalizeArgs=yd.default;var E9=Ra(JA()),O9=Ra(KA()),lq=Ra(rq());we.dereferenceInternal=lq.default;var _a=x9(Cn()),On=En();Object.defineProperty(we,"JSONParserError",{enumerable:!0,get:function(){return On.JSONParserError}});Object.defineProperty(we,"InvalidPointerError",{enumerable:!0,get:function(){return On.InvalidPointerError}});Object.defineProperty(we,"MissingPointerError",{enumerable:!0,get:function(){return On.MissingPointerError}});Object.defineProperty(we,"ResolverError",{enumerable:!0,get:function(){return On.ResolverError}});Object.defineProperty(we,"ParserError",{enumerable:!0,get:function(){return On.ParserError}});Object.defineProperty(we,"UnmatchedParserError",{enumerable:!0,get:function(){return On.UnmatchedParserError}});Object.defineProperty(we,"UnmatchedResolverError",{enumerable:!0,get:function(){return On.UnmatchedResolverError}});Object.defineProperty(we,"isHandledError",{enumerable:!0,get:function(){return On.isHandledError}});Object.defineProperty(we,"JSONParserErrorGroup",{enumerable:!0,get:function(){return On.JSONParserErrorGroup}});var aq=eo(),oi=Ra(sq()),I9=IR();Object.defineProperty(we,"getJsonSchemaRefParserDefaultOptions",{enumerable:!0,get:function(){return I9.getJsonSchemaRefParserDefaultOptions}});var io=class t{constructor(){this.schema=null,this.$refs=new oq.default}async parse(){let e=(0,yd.default)(arguments),r;if(!e.path&&!e.schema){let i=(0,aq.ono)(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return(0,oi.default)(e.callback,Promise.reject(i))}this.schema=null,this.$refs=new oq.default;let n="http";if(_a.isFileSystemPath(e.path))e.path=_a.fromFileSystemPath(e.path),n="file";else if(!e.path&&e.schema&&"$id"in e.schema&&e.schema.$id){let i=_a.parse(e.schema.$id),s=i.protocol==="https:"?443:80;e.path=`${i.protocol}//${i.hostname}:${s}`}if(e.path=_a.resolve(_a.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,C9.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,oi.default)(e.callback,Promise.resolve(this.schema));if(e.options.continueOnError)return this.schema=null,(0,oi.default)(e.callback,Promise.resolve(this.schema));throw aq.ono.syntax(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(i){return!e.options.continueOnError||!(0,On.isHandledError)(i)?(0,oi.default)(e.callback,Promise.reject(i)):(this.$refs._$refs[_a.stripHash(e.path)]&&this.$refs._$refs[_a.stripHash(e.path)].addError(i),(0,oi.default)(e.callback,Promise.resolve(null)))}}static parse(){let e=new t;return e.parse.apply(e,arguments)}async resolve(){let e=(0,yd.default)(arguments);try{return await this.parse(e.path,e.schema,e.options),await(0,E9.default)(this,e.options),MR(this),(0,oi.default)(e.callback,Promise.resolve(this.$refs))}catch(r){return(0,oi.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,yd.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,O9.default)(this,e.options),MR(this),(0,oi.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,oi.default)(e.callback,Promise.reject(r))}}static dereference(){let e=new t;return e.dereference.apply(e,arguments)}async dereference(){let e=(0,yd.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,lq.default)(this,e.options),MR(this),(0,oi.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,oi.default)(e.callback,Promise.reject(r))}}};we.$RefParser=io;we.default=io;function MR(t){if(On.JSONParserErrorGroup.getParserErrors(t).length>0)throw new On.JSONParserErrorGroup(t)}we.parse=io.parse;we.resolve=io.resolve;we.bundle=io.bundle;we.dereference=io.dereference});var Cg,Rc,NR=ae(()=>{"use strict";Cg=ab(cq()),Rc=class{async resolve(e){try{return await Cg.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 Cg.default.bundle(e)}catch(r){return console.error("[RefResolver] Failed to bundle $ref pointers:",r),e}}async resolveFile(e){try{return await Cg.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){throw console.error(`[RefResolver] Failed to resolve file ${e}:`,r),r}}}});import*as uq from"fs";var fq,P9,xc,DR=ae(()=>{"use strict";fq=ab(S_());yn();__();NR();P9=["application/json","text/plain","text/html","multipart/form-data","application/x-www-form-urlencoded"],xc=class{constructor(e,r){this.collectionService=e;this.envConfigService=r;this.exampleGenerator=new lc,this.refResolver=new Rc}collectionService;envConfigService;exampleGenerator;refResolver;async import(e,r){let n=await uq.promises.readFile(e,"utf-8"),i;e.endsWith(".yaml")||e.endsWith(".yml")?i=fq.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:ft(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 g=this.mapSecurityToAuth(i.security[0],i.components.securitySchemes);g&&(f.auth=g)}let d=new Map;if(i.tags)for(let g of i.tags){let y={type:"folder",id:ft(g.name),name:g.name,description:g.description,items:[]};d.set(g.name,y),f.items.push(y)}if(i.paths)for(let[g,y]of Object.entries(i.paths))for(let w of["get","post","put","patch","delete","head","options","trace"]){let C=y[w];if(!C)continue;let R=this.processOperation(w,g,C,y,i,s),P=C.tags?.[0];if(P&&d.has(P))d.get(P).items.push(R);else if(P){let A={type:"folder",id:ft(P),name:P,items:[R]};d.set(P,A),f.items.push(A)}else f.items.push(R)}await this.collectionService.saveCollection(f);let m;return r?.environmentName&&i.servers&&(m=await this.createEnvironmentFromServers(i.servers,r.environmentName)),{collection:f,environmentCreated:m}}processOperation(e,r,n,i,s,o){let l=ft(n.operationId||`${e}-${r}`),f=`{{baseUrl}}${this.convertPathParams(r)}`,d=n.summary||n.operationId||`${e.toUpperCase()} ${r}`,m=n.deprecated===!0;m&&(d=`[DEPRECATED] ${d}`);let g={type:"request",id:l,name:d,method:e.toUpperCase(),url:f,description:n.description||"",deprecated:m},y=[...i.parameters||[],...n.parameters||[]];if(this.processParameters(g,y,o),n.requestBody&&this.processRequestBody(g,n.requestBody,o),n.responses&&(g.responseSchema=this.processResponses(n.responses,o)),n.security!==void 0&&s.components?.securitySchemes){if(Array.isArray(n.security)&&n.security.length===0)g.auth={type:"none"};else if(n.security&&n.security.length>0){let w=this.mapSecurityToAuth(n.security[0],s.components.securitySchemes);w&&(g.auth=w)}}return g}convertPathParams(e){return e.replace(/\{(\w+)\}/g,":$1")}processParameters(e,r,n){let i=[],s=[],o={},l=[];for(let f of r){let d=f.name,m=f.in,g=f.schema||{},y=f.example!==void 0?String(f.example):this.generateExampleForParam(g,n),w=f.deprecated===!0;switch(m){case"path":{if(f.description||g.type||g.format||g.enum||w||g.pattern||g.minimum!==void 0||g.maximum!==void 0||g.minLength!==void 0||g.maxLength!==void 0||g.multipleOf!==void 0||g.minItems!==void 0||g.maxItems!==void 0||g.uniqueItems||g.nullable||g.oneOf){let R={value:y};g.oneOf?(R.oneOf=g.oneOf,this.applyOneOfHints(R,g.oneOf)):(g.type&&(R.type=g.type),g.format&&(R.format=g.format),g.enum&&(R.enum=g.enum.map(String)),g.pattern&&(R.pattern=g.pattern),g.minimum!==void 0&&(R.minimum=g.minimum),g.maximum!==void 0&&(R.maximum=g.maximum),g.exclusiveMinimum!==void 0&&(R.exclusiveMinimum=g.exclusiveMinimum),g.exclusiveMaximum!==void 0&&(R.exclusiveMaximum=g.exclusiveMaximum),g.multipleOf!==void 0&&(R.multipleOf=g.multipleOf),g.minLength!==void 0&&(R.minLength=g.minLength),g.maxLength!==void 0&&(R.maxLength=g.maxLength),g.minItems!==void 0&&(R.minItems=g.minItems),g.maxItems!==void 0&&(R.maxItems=g.maxItems),g.uniqueItems&&(R.uniqueItems=!0),g.nullable&&(R.nullable=!0)),f.description&&(R.description=f.description),w&&(R.deprecated=!0),o[d]=R}else o[d]=y;break}case"query":{let C={key:d,value:y};this.applySchemaConstraints(C,g,f,w),s.push(C);break}case"header":{let C={key:d,value:y};this.applySchemaConstraints(C,g,f,w),i.push(C);break}case"cookie":{l.push(`${d}={{${d}}}`);break}}}l.length>0&&i.push({key:"Cookie",value:l.join("; ")}),Object.keys(o).length>0&&(e.params=o),s.length>0&&(e.query=s),i.length>0&&(e.headers=i)}applySchemaConstraints(e,r,n,i){r.oneOf?(e.oneOf=r.oneOf,this.applyOneOfHints(e,r.oneOf)):(r.type&&(e.type=r.type),r.format&&(e.format=r.format),r.enum&&(e.enum=r.enum.map(String)),r.pattern&&(e.pattern=r.pattern),r.minimum!==void 0&&(e.minimum=r.minimum),r.maximum!==void 0&&(e.maximum=r.maximum),r.exclusiveMinimum!==void 0&&(e.exclusiveMinimum=r.exclusiveMinimum),r.exclusiveMaximum!==void 0&&(e.exclusiveMaximum=r.exclusiveMaximum),r.multipleOf!==void 0&&(e.multipleOf=r.multipleOf),r.minLength!==void 0&&(e.minLength=r.minLength),r.maxLength!==void 0&&(e.maxLength=r.maxLength),r.minItems!==void 0&&(e.minItems=r.minItems),r.maxItems!==void 0&&(e.maxItems=r.maxItems),r.uniqueItems&&(e.uniqueItems=!0),r.nullable&&(e.nullable=!0)),n.required&&(e.required=!0),n.description&&(e.description=n.description),i&&(e.deprecated=!0)}applyOneOfHints(e,r){let n=[],i=new Set;for(let s of r)s.type&&i.add(s.type),s.enum&&n.push(...s.enum.map(String));i.size===1&&(e.type=[...i][0]),n.length>0&&(e.enum=[...new Set(n)])}generateExampleForParam(e,r){if(!e)return"";let n=this.exampleGenerator.generate(e,{components:r});return n==null?"":String(n)}processRequestBody(e,r,n){if(!r.content)return;let i=Object.keys(r.content);if(i.length===0)return;let s=this.selectPrimaryContentType(i),o=r.content[s],{bodyType:l,bodyFormat:f}=this.mapContentTypeToBodyType(s);if(e.body={type:l,...f&&{format:f},content:""},o){let m=this.generateBodyContent(o,s,n);m!==void 0&&(e.body.content=typeof m=="string"?m:JSON.stringify(m,null,2)),l==="form-data"&&o.schema?.properties&&(e.body.content=this.buildFormDataEntries(o.schema,n)),l==="x-www-form-urlencoded"&&o.schema?.properties&&(e.body.content=this.buildFormDataEntries(o.schema,n))}let d=this.buildBodySchema(r,s,n);d&&(e.bodySchema=d)}selectPrimaryContentType(e){for(let i of P9)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,d=f.type==="string"&&f.format==="binary",m={key:o,value:d?"":String(this.exampleGenerator.generate(f,{components:r})||""),type:d?"file":"text",enabled:!0};n.push(m)}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 d=e.content[f],m={};d.schema&&(m.schema=d.schema),d.examples&&(m.examples=d.examples),d.encoding&&(m.encoding=d.encoding),o.content[f]=m}}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 d=Object.keys(l.content);if(d.length===1){let m=d[0],g=l.content[m];f.contentType=m,g.schema&&(f.schema=g.schema),g.examples&&(f.examples=g.examples),g.schema&&Object.assign(i,this.extractUsedComponents(g.schema,r))}else{f.content={};for(let m of d){let g=l.content[m],y={};g.schema&&(y.schema=g.schema),g.examples&&(y.examples=g.examples),f.content[m]=y,g.schema&&Object.assign(i,this.extractUsedComponents(g.schema,r))}}}if(l.headers){f.headers={};for(let[d,m]of Object.entries(l.headers)){let g=m;f.headers[d]={...g.description&&{description:g.description},schema:g.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 Cc,FR=ae(()=>{"use strict";Cc=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,d=r.slice(1);if(!e.properties[l])if(o)e.properties[l]={type:"array",items:{type:"object"}};else if(d.length>0)e.properties[l]={type:"object",properties:{}};else{let m=n.typeHints[f];e.properties[l]={type:m||"string"};return}if(d.length>0){let m=o?e.properties[l].items:e.properties[l];m&&this.ensureFieldPath(m,d,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 dq,Eg,pq,hq,mq,gq,yq,Ec,LR=ae(()=>{"use strict";dq=/(?:jsonData|responseJson|data|json|body|response\.json\(\))\.([a-zA-Z_][\w.\[\]]*)/g,Eg="(?:pm|hf|ctx)",pq=new RegExp(`${Eg}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(?:a|an)\\(['"](\\w+)['"]\\)`,"g"),hq=new RegExp(`${Eg}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.(?:equal|eql)\\((.+?)\\)`,"g"),mq=/(?:to\.have\.status|response\.code.*?equal)\((\d+)\)/g,gq=new RegExp(`${Eg}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(true|false)`,"g"),yq=new RegExp(`${Eg}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.have\\.(?:lengthOf|length\\.above|length\\.below)`,"g"),Ec=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(dq.source,dq.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(pq.source,pq.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(hq.source,hq.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(gq.source,gq.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(yq.source,yq.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(mq.source,mq.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 vq={};ks(vq,{AwsSecretResolver:()=>Og});var Og,jR=ae(()=>{"use strict";Og=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=>it(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})),d=f.SecretString??(f.SecretBinary?Buffer.from(f.SecretBinary).toString("utf-8"):void 0);if(d===void 0)return;if(i)try{let m=JSON.parse(d);return m[i]!==void 0?String(m[i]):void 0}catch{return}return d}catch(s){throw s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND"?new Error("[HTTP Forge] AWS secret resolver requires @aws-sdk/client-secrets-manager. Install it in your project: npm install @aws-sdk/client-secrets-manager"):s}}}});var bq={};ks(bq,{AzureKeyVaultResolver:()=>Ig});var Ig,UR=ae(()=>{"use strict";Ig=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=>it(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 Sq={};ks(Sq,{HashiCorpVaultResolver:()=>Pg});var Pg,HR=ae(()=>{"use strict";Pg=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(y){throw new Error(`[HTTP Forge] Vault request failed: ${y?.message??y}`)}if(f.status===404)return;if(!f.ok)throw new Error(`[HTTP Forge] Vault returned HTTP ${f.status} for path: ${n}`);let m=(await f.json())?.data?.data;if(!m)return;if(i)return m[i]!==void 0?String(m[i]):void 0;if("value"in m)return String(m.value);let g=Object.keys(m);return g.length===1?String(m[g[0]]):void 0}}});var wq={};ks(wq,{OnePasswordResolver:()=>kg});import{execFile as k9}from"child_process";import{promisify as T9}from"util";var A9,kg,BR=ae(()=>{"use strict";A9=T9(k9),kg=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}=it("@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 A9("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 _q={};ks(_q,{GcpSecretResolver:()=>Tg});var Tg,VR=ae(()=>{"use strict";Tg=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=>it(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}),d=f.payload?.data;return d?Buffer.isBuffer(d)?d.toString("utf-8"):Buffer.from(d).toString("utf-8"):void 0}catch(s){throw s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND"?new Error("[HTTP Forge] GCP secret resolver requires @google-cloud/secret-manager. Install it: npm install @google-cloud/secret-manager"):s}}}});var xq={};ks(xq,{DopplerResolver:()=>Ag});import*as Rq from"https";var Ag,WR=ae(()=>{"use strict";Ag=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=Rq.request(i,{method:"GET",headers:{Authorization:`Bearer ${n}`,Accept:"application/json"}},f=>{let d=[];f.on("data",m=>d.push(m)),f.on("end",()=>{let m=Buffer.concat(d).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}": ${m}`));return}try{let y=JSON.parse(m)?.value?.computed;s(y!=null?String(y):void 0)}catch{o(new Error(`[HTTP Forge] Doppler API returned non-JSON response for secret "${r}"`))}})});l.on("error",o),l.end()})}}});import*as qg from"fs";import{createRequire as q9}from"module";import*as Cq from"path";var vd,zR=ae(()=>{"use strict";vd=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 d=l.slice(0,f),m=l.slice(f+1),g=this.resolvers.get(d);if(g)try{let y=await g.resolve(m);y!==void 0&&n.set(o,y)}catch(y){let w=y?.message??String(y);console.warn(`[HTTP Forge] {{${o}}} could not be resolved: ${w}`)}}));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}=(jR(),vl(vq));return new r(e,this.moduleRequire)}case"azure":{let{AzureKeyVaultResolver:r}=(UR(),vl(bq));return new r(e,this.moduleRequire)}case"vault":{let{HashiCorpVaultResolver:r}=(HR(),vl(Sq));return new r(e)}case"1password":{let{OnePasswordResolver:r}=(BR(),vl(wq));return new r(e)}case"gcp":{let{GcpSecretResolver:r}=(VR(),vl(_q));return new r(e,this.moduleRequire)}case"doppler":{let{DopplerResolver:r}=(WR(),vl(xq));return new r(e)}default:return}}buildModuleRequire(e){let r=i=>it(i);if(!e)return r;let n=[];try{n=e.getModulePaths()??[]}catch{return r}for(let i of n)try{let s=Cq.resolve(i,"package.json");if(qg.existsSync(s)){let o=qg.realpathSync(s),l=q9(o);return f=>{try{return l(f)}catch{return r(f)}}}}catch{}return r}}});var bd,JR=ae(()=>{"use strict";bd={iterations:1,delayBetweenRequests:0,stopOnError:!1,readFromSharedSession:!1,writeToSharedSession:!1}});import*as Tt from"fs";import*as so from"path";var Sd,YR=ae(()=>{"use strict";yn();JR();Sd=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(){Tt.existsSync(this.suitesDir)||Tt.mkdirSync(this.suitesDir,{recursive:!0})}setupFileWatcher(){try{this.fileWatcher=Tt.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(),!Tt.existsSync(this.suitesDir))return;let e=Tt.readdirSync(this.suitesDir);for(let r of e)if(r.endsWith(".suite.json"))try{let n=so.join(this.suitesDir,r),i=Tt.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:ft(e),name:e,requests:r,config:{...bd},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=so.join(this.suitesDir,e),o=so.join(this.suitesDir,i.id);return Tt.existsSync(s)&&this.copyDirRecursive(s,o),await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}copyDirRecursive(e,r){Tt.existsSync(r)||Tt.mkdirSync(r,{recursive:!0});for(let n of Tt.readdirSync(e,{withFileTypes:!0})){let i=so.join(e,n.name),s=so.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):Tt.copyFileSync(i,s)}}async deleteSuite(e){let r=this.suites.get(e);if(!r)return!1;let n=`${r.id}.suite.json`,i=so.join(this.suitesDir,n);try{return Tt.existsSync(i)&&Tt.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:{...bd},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(m=>n?m.folderPath===o||m.folderPath.startsWith(`${o}/`):m.folderPath===o);if(l.length===0){console.error(`[TestSuiteService] No requests under folder "${r}" in collection: ${e}`);return}let f=Date.now();return{id:`temp-${e}-${this.slugifyFolderPath(o)}`,name:`${i.name} / ${o}`,requests:l,config:{...bd},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:ft(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}/${o.name}`: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}/${o.name}`:o.name;this.extractRequestsFromCollection(o,r,n,l,s)}}async saveSuiteToDisk(e){this.ensureSuitesDir();let r=`${e.id}.suite.json`,n=so.join(this.suitesDir,r),i=JSON.stringify(e,null,2);Tt.writeFileSync(n,i,"utf-8")}}});var re,$g=ae(()=>{"use strict";re={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 Eq from"path";function Mg(t,e){let{workspaceFolder:r,fileWatcherFactory:n,notificationService:i,workspaceStore:s,globalStore:o,secretStore:l,browserService:f,applicationInfo:d,consoleService:m}=e;t.registerValue(re.WorkspaceFolder,r),t.registerSingleton(re.Config,()=>new Yl(r,n,i)),t.registerSingleton(re.Console,()=>m??$9),t.registerSingleton(re.EnvironmentConfig,y=>new wf(r,s,y.resolve(re.Config),n,l)),t.registerSingleton(re.Cookie,()=>new vf(o)),t.registerSingleton(re.Collection,y=>new yf(r,y.resolve(re.Config),n)),t.registerSingleton(re.TestSuite,y=>new Sd(y.resolve(re.Collection),y.resolve(re.Config))),t.registerSingleton(re.HttpClient,()=>new Wo),t.registerSingleton(re.UrlBuilder,()=>new Hn),t.registerSingleton(re.InterceptorChain,()=>new zi),t.registerSingleton(re.HttpRequest,y=>new Wi(y.resolve(re.UrlBuilder),y.resolve(re.InterceptorChain),y.resolve(re.HttpClient))),t.registerSingleton(re.RequestPreprocessor,()=>new ia),t.registerSingleton(re.RequestHistory,y=>{let w=y.resolve(re.EnvironmentConfig);return new Cf(w.getHistoriesPath(),Eq.join(w.getRootPath(),"shared-histories"))}),l&&f&&t.registerSingleton(re.OAuth2TokenManager,y=>new hf(l,f,y.resolve(re.EnvironmentConfig),y.resolve(re.HttpRequest))),t.registerSingleton(re.GraphQLSchemaService,y=>new Rf(y.resolve(re.HttpClient))),t.registerSingleton(re.SecretResolverRegistry,y=>new vd(y.resolve(re.Config)));let g=d??{name:"HttpForge",version:"0.0.0"};t.registerSingleton(re.RequestPreparer,y=>new _f(y.resolve(re.EnvironmentConfig),y.resolve(re.HttpRequest),y.resolve(re.RequestPreprocessor),y.has(re.OAuth2TokenManager)?y.resolve(re.OAuth2TokenManager):void 0,g,y.resolve(re.SecretResolverRegistry))),t.registerSingleton(re.ScriptExecutor,y=>{let w=y.resolve(re.Config);return new Qi(y.resolve(re.HttpRequest),w.getModulePaths(),y.resolve(re.SecretResolverRegistry),w.getScriptScope())}),t.registerSingleton(re.DataFileParser,()=>new oa),t.registerSingleton(re.CollectionRequestExecutor,y=>new Hs(y.resolve(re.HttpRequest),y.resolve(re.ScriptExecutor),y.resolve(re.EnvironmentConfig),y.resolve(re.RequestPreparer),"")),t.registerSingleton(re.PersistentCookieJar,y=>new bf(y.resolve(re.Cookie))),t.registerSingleton(re.SchemaInferrer,()=>new Xs),t.registerSingleton(re.HistoryAnalyzer,y=>new Gl(y.resolve(re.RequestHistory),y.resolve(re.SchemaInferrer))),t.registerSingleton(re.ScriptAnalyzer,()=>new Ec),t.registerSingleton(re.SchemaInferenceService,y=>new Cc(y.resolve(re.HistoryAnalyzer),y.resolve(re.ScriptAnalyzer),y.resolve(re.SchemaInferrer))),t.registerSingleton(re.OpenApiExporter,y=>new ac(y.resolve(re.Collection),y.resolve(re.EnvironmentConfig),y.resolve(re.SchemaInferenceService))),t.registerSingleton(re.OpenApiImporter,y=>new xc(y.resolve(re.Collection),y.resolve(re.EnvironmentConfig)))}var $9,GR=ae(()=>{"use strict";v0();R0();C0();E0();O0();P0();Jh();k0();T0();F0();Pu();ku();Iu();Hh();wl();L0();w_();DR();FR();Km();LR();Bh();uf();zR();YR();$g();$9={log:()=>{},trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},logBatch:()=>{},logRawLines:()=>{},show:()=>{},clear:()=>{},dispose:()=>{}}});function Oq(){return xa.instance}var xa,KR=ae(()=>{"use strict";$g();xa=class t{static _instance;services=new Map;primitives=new Map;constructor(){}static get instance(){return t._instance||(t._instance=new t),t._instance}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(re.Config)}get console(){return this.resolve(re.Console)}get environmentConfig(){return this.resolve(re.EnvironmentConfig)}get collection(){return this.resolve(re.Collection)}get httpRequest(){return this.resolve(re.HttpRequest)}get httpClient(){return this.resolve(re.HttpClient)}get cookie(){return this.resolve(re.Cookie)}get requestHistory(){return this.resolve(re.RequestHistory)}get dataFileParser(){return this.resolve(re.DataFileParser)}get scriptExecutor(){return this.resolve(re.ScriptExecutor)}get requestPreparer(){return this.resolve(re.RequestPreparer)}get persistentCookieJar(){return this.resolve(re.PersistentCookieJar)}get oauth2TokenManager(){return this.has(re.OAuth2TokenManager)?this.resolve(re.OAuth2TokenManager):void 0}get graphqlSchemaService(){return this.resolve(re.GraphQLSchemaService)}get testSuite(){return this.resolve(re.TestSuite)}}});var Oc,QR=ae(()=>{"use strict";Sl();Oc=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}getCookiesForDomain(e){let r=[];for(let n of this.cookies.values())dt.isExpired(n)||(!n.domain||dt.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&&!dt.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())dt.isExpired(n)||r.push(n);return r}setCookiesFromResponse(e,r){let n=dt.extractDomain(e),i=dt.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=dt.extractDomain(e),n=dt.extractPath(e),s=this.getCookiesForDomain(r).filter(o=>o.path?n.startsWith(o.path):!0);if(s.length!==0)return dt.formatCookieHeader(s)}clear(){this.cookies.clear()}}});function Ng(t,e,r){let n=String(t).padStart(6,"0"),i=String(e).padStart(4,"0");return`result-${n}-iter-${i}-${r}.json`}function M9(t){return{index:t.i,iteration:t.it,name:t.n,method:Ic[t.m]||"GET",status:t.s,duration:t.d,passed:t.p,assertionsPassed:t.ap,assertionsFailed:t.af,requestId:t.r,resultFile:Ng(t.i,t.it,t.r),error:t.e}}var ZR,Ic,Dg=ae(()=>{"use strict";ZR={GET:0,POST:1,PUT:2,DELETE:3,PATCH:4,HEAD:5,OPTIONS:6,TRACE:7,CONNECT:8},Ic={0:"GET",1:"POST",2:"PUT",3:"DELETE",4:"PATCH",5:"HEAD",6:"OPTIONS",7:"TRACE",8:"CONNECT"}});import*as kc from"fs/promises";import*as Pc from"path";function yt(t){return String(t??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Ca(t){return t>=1e3?`${(t/1e3).toFixed(2)}s`:`${t}ms`}function XR(t){try{return new Date(t).toLocaleString()}catch{return t}}function Fg(t){return t>=200&&t<300?"status-2xx":t>=300&&t<400?"status-3xx":t>=400&&t<500?"status-4xx":"status-5xx"}function N9(t,e){return e===0?"\u2014":`${Math.round(t/e*100)}%`}function kq(t){try{return typeof t=="string"&&(t=JSON.parse(t)),JSON.stringify(t,null,2)}catch{return String(t??"")}}function Iq(t){return!t||Object.keys(t).length===0?'<span class="dim">\u2014</span>':`<table class="kv-table">${Object.entries(t).map(([r,n])=>{let i=Array.isArray(n)?n.join(", "):String(n??"");return`<tr><td class="kv-key">${yt(r)}</td><td class="kv-val">${yt(i)}</td></tr>`}).join("")}</table>`}function D9(t){return t==null||t===""?'<span class="dim">\u2014</span>':typeof t=="string"?yt(t):typeof t=="number"||typeof t=="boolean"?yt(String(t)):`<pre class="code">${yt(kq(t))}</pre>`}function ex(t){return!t||Object.keys(t).length===0?'<span class="dim">\u2014</span>':`<table class="kv-table meta-table">${Object.entries(t).map(([r,n])=>`
|
|
277
|
+
`)}`));if(!("location"in i.headers)||!i.headers.location)throw(0,wg.ono)({status:i.status},`HTTP ${i.status} redirect with no location header`);{let s=hd.resolve(t.href,i.headers.location);return BA(s,e,n)}}else{if(i.body){let s=await i.arrayBuffer();return Buffer.from(s)}return Buffer.alloc(0)}}catch(i){throw new HA.ResolverError((0,wg.ono)(i,`Error downloading ${t.href}`),t.href)}}async function B3(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 IR=F(os=>{"use strict";var wc=os&&os.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(os,"__esModule",{value:!0});os.getNewOptions=os.getJsonSchemaRefParserDefaultOptions=void 0;var V3=wc(yT()),W3=wc(MA()),z3=wc(NA()),J3=wc(DA()),Y3=wc(UA()),G3=wc(VA()),K3=()=>({parse:{json:{...V3.default},yaml:{...W3.default},text:{...z3.default},binary:{...J3.default}},resolve:{file:{...Y3.default},http:{...G3.default},external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative"},mutateInputSchema:!0});os.getJsonSchemaRefParserDefaultOptions=K3;var Q3=t=>{let e=(0,os.getJsonSchemaRefParserDefaultOptions)();return t&&zA(e,t),e};os.getNewOptions=Q3;function zA(t,e){if(WA(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],a=t[i];WA(s)?t[i]=zA(a||{},s):s!==void 0&&(t[i]=s)}}return t}function WA(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}});var YA=F(_g=>{"use strict";Object.defineProperty(_g,"__esModule",{value:!0});_g.normalizeArgs=JA;var Z3=IR();function JA(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,Z3.getNewOptions)(n)}catch(a){console.error(`JSON Schema Ref Parser: Error normalizing options: ${a}`)}return!n.mutateInputSchema&&typeof r=="object"&&(r=JSON.parse(JSON.stringify(r))),{path:e,schema:r,options:n,callback:i}}_g.default=JA});var GA=F(ni=>{"use strict";var X3=ni&&ni.__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]})),e9=ni&&ni.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),t9=ni&&ni.__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"&&X3(r,e,n[i]);return e9(r,e),r}})(),PR=ni&&ni.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ni,"__esModule",{value:!0});var r9=PR(pc()),n9=PR(nd()),i9=PR(W_()),_c=t9(Cn()),s9=En();function o9(t,e){if(!e.resolve?.external)return Promise.resolve();try{let r=kR(t.schema,t.$refs._root$Ref.path+"#",t.$refs,e);return Promise.all(r)}catch(r){return Promise.reject(r)}}function kR(t,e,r,n,i,s){i||(i=new Set);let a=[];if(t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!i.has(t)){i.add(t),r9.default.isExternal$Ref(t)&&a.push(a9(t,e,r,n));let l=Object.keys(t);for(let f of l){let d=n9.default.join(e,f),m=t[f];a=a.concat(kR(m,d,r,n,i,s))}}return a}async function a9(t,e,r,n){let i=n.dereference?.externalReferenceResolution==="root",s=_c.resolve(i?_c.cwd():e,t.$ref),a=_c.stripHash(s),l=r._$refs[a];if(l)return Promise.resolve(l.value);try{let f=await(0,i9.default)(s,r,n),d=kR(f,a+"#",r,n,new Set,!0);return Promise.all(d)}catch(f){if(!n?.continueOnError||!(0,s9.isHandledError)(f))throw f;return r._$refs[a]&&(f.source=decodeURI(_c.stripHash(e)),f.path=_c.safePointerToPath(_c.getHash(e))),[]}}ni.default=o9});var ZA=F(ii=>{"use strict";var l9=ii&&ii.__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]})),c9=ii&&ii.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),u9=ii&&ii.__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"&&l9(r,e,n[i]);return c9(r,e),r}})(),QA=ii&&ii.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ii,"__esModule",{value:!0});var Rg=QA(pc()),md=QA(nd()),TR=u9(Cn());function f9(t,e){let r=[];AR(t,"schema",t.$refs._root$Ref.path+"#","#",0,r,t.$refs,e),d9(r)}function AR(t,e,r,n,i,s,a,l){let f=e===null?t:t[e];if(f&&typeof f=="object"&&!ArrayBuffer.isView(f))if(Rg.default.isAllowed$Ref(f))KA(t,e,r,n,i,s,a,l);else{let d=Object.keys(f).sort((m,g)=>m==="definitions"?-1:g==="definitions"?1:m.length-g.length);for(let m of d){let g=md.default.join(r,m),y=md.default.join(n,m),w=f[m];Rg.default.isAllowed$Ref(w)?KA(f,m,r,y,i,s,a,l):AR(f,m,g,y,i,s,a,l)}}}function KA(t,e,r,n,i,s,a,l){let f=e===null?t:t[e],d=TR.resolve(r,f.$ref),m=a._resolve(d,n,l);if(m===null)return;let y=md.default.parse(n).length,w=TR.stripHash(m.path),C=TR.getHash(m.path),R=w!==a._root$Ref.path,T=Rg.default.isExtended$Ref(f);i+=m.indirections;let A=p9(s,t,e);if(A)if(y<A.depth||i<A.indirections)h9(s,A);else return;s.push({$ref:f,parent:t,key:e,pathFromRoot:n,depth:y,file:w,hash:C,value:m.value,circular:m.circular,extended:T,external:R,indirections:i}),(!A||R)&&AR(m.value,null,m.path,n,i+1,s,a,l)}function d9(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 a=i.pathFromRoot.lastIndexOf("/definitions"),l=s.pathFromRoot.lastIndexOf("/definitions");return a!==l?l-a: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=md.default.join(n,md.default.parse(i.hash.replace(r,"#"))):(e=i.file,r=i.hash,n=i.pathFromRoot,i.$ref=i.parent[i.key]=Rg.default.dereference(i.$ref,i.value),i.circular&&(i.$ref.$ref=i.pathFromRoot)):i.$ref.$ref=i.hash}function p9(t,e,r){for(let n of t)if(n&&n.parent===e&&n.key===r)return n}function h9(t,e){let r=t.indexOf(e);t.splice(r,1)}ii.default=f9});var iq=F(si=>{"use strict";var m9=si&&si.__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]})),g9=si&&si.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),y9=si&&si.__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"&&m9(r,e,n[i]);return g9(r,e),r}})(),rq=si&&si.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(si,"__esModule",{value:!0});var xg=rq(pc()),XA=rq(nd()),v9=eo(),eq=y9(Cn()),b9=En();si.default=S9;function S9(t,e){let r=Date.now(),n=qR(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 qR(t,e,r,n,i,s,a,l,f){let d,m={value:t,circular:!1};if(l&&l.timeoutMs&&Date.now()-f>l.timeoutMs)throw new b9.TimeoutError(l.timeoutMs);let g=l.dereference||{},y=g.excludedPathMatcher||(()=>!1);if((g?.circular==="ignore"||!i.has(t))&&t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!y(r)){if(n.add(t),i.add(t),xg.default.isAllowed$Ref(t,l))d=tq(t,e,r,n,i,s,a,l,f),m.circular=d.circular,m.value=d.value;else for(let w of Object.keys(t)){let C=XA.default.join(e,w),R=XA.default.join(r,w);if(y(R))continue;let T=t[w],A=!1;if(xg.default.isAllowed$Ref(T,l)){if(d=tq(T,C,R,n,i,s,a,l,f),A=d.circular,t[w]!==d.value){let U=new Map;g?.preservedProperties&&typeof t[w]=="object"&&!Array.isArray(t[w])&&g?.preservedProperties.forEach(B=>{B in t[w]&&U.set(B,t[w][B])}),t[w]=d.value,g?.preservedProperties&&U.size&&typeof t[w]=="object"&&!Array.isArray(t[w])&&U.forEach((B,V)=>{t[w][V]=B}),g?.onDereference?.(T.$ref,t[w],t,w)}}else n.has(T)?A=nq(C,a,l):(d=qR(T,C,R,n,i,s,a,l,f),A=d.circular,t[w]!==d.value&&(t[w]=d.value));m.circular=m.circular||A}n.delete(t)}return m}function tq(t,e,r,n,i,s,a,l,f){let m=xg.default.isExternal$Ref(t)&&l?.dereference?.externalReferenceResolution==="root",g=eq.resolve(m?eq.cwd():e,t.$ref),y=s.get(g);if(y&&!y.circular){let U=Object.keys(t);if(U.length>1){let B={};for(let V of U)V!=="$ref"&&!(V in y.value)&&(B[V]=t[V]);return{circular:y.circular,value:Object.assign({},y.value,B)}}return y}let w=a._resolve(g,e,l);if(w===null)return{circular:!1,value:null};let C=w.circular,R=C||n.has(w.value);R&&nq(e,a,l);let T=xg.default.dereference(t,w.value);if(!R){let U=qR(T,w.path,r,n,i,s,a,l,f);R=U.circular,T=U.value}R&&!C&&l.dereference?.circular==="ignore"&&(T=t),C&&(T.$ref=r);let A={circular:R,value:T};return Object.keys(t).length===1&&s.set(g,A),A}function nq(t,e,r){if(e.circular=!0,r?.dereference?.onCircular?.(t),!r.dereference.circular)throw v9.ono.reference(`Circular $ref pointer found at ${t}`);return!0}});var sq=F($R=>{"use strict";Object.defineProperty($R,"__esModule",{value:!0});function w9(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(e){setTimeout(e,0)}}$R.default=w9()});var aq=F(gd=>{"use strict";var _9=gd&&gd.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gd,"__esModule",{value:!0});gd.default=R9;var oq=_9(sq());function R9(t,e){if(t){e.then(function(r){(0,oq.default)(function(){t(null,r)})},function(r){(0,oq.default)(function(){t(r)})});return}else return e}});var fq=F(we=>{"use strict";var x9=we&&we.__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]})),C9=we&&we.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),E9=we&&we.__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"&&x9(r,e,n[i]);return C9(r,e),r}})(),Ra=we&&we.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(we,"__esModule",{value:!0});we.getJsonSchemaRefParserDefaultOptions=we.jsonSchemaParserNormalizeArgs=we.dereferenceInternal=we.JSONParserErrorGroup=we.isHandledError=we.UnmatchedParserError=we.ParserError=we.ResolverError=we.MissingPointerError=we.InvalidPointerError=we.JSONParserError=we.UnmatchedResolverError=we.dereference=we.bundle=we.resolve=we.parse=we.$RefParser=void 0;var lq=Ra(dT()),O9=Ra(W_()),yd=Ra(YA());we.jsonSchemaParserNormalizeArgs=yd.default;var I9=Ra(GA()),P9=Ra(ZA()),uq=Ra(iq());we.dereferenceInternal=uq.default;var _a=E9(Cn()),On=En();Object.defineProperty(we,"JSONParserError",{enumerable:!0,get:function(){return On.JSONParserError}});Object.defineProperty(we,"InvalidPointerError",{enumerable:!0,get:function(){return On.InvalidPointerError}});Object.defineProperty(we,"MissingPointerError",{enumerable:!0,get:function(){return On.MissingPointerError}});Object.defineProperty(we,"ResolverError",{enumerable:!0,get:function(){return On.ResolverError}});Object.defineProperty(we,"ParserError",{enumerable:!0,get:function(){return On.ParserError}});Object.defineProperty(we,"UnmatchedParserError",{enumerable:!0,get:function(){return On.UnmatchedParserError}});Object.defineProperty(we,"UnmatchedResolverError",{enumerable:!0,get:function(){return On.UnmatchedResolverError}});Object.defineProperty(we,"isHandledError",{enumerable:!0,get:function(){return On.isHandledError}});Object.defineProperty(we,"JSONParserErrorGroup",{enumerable:!0,get:function(){return On.JSONParserErrorGroup}});var cq=eo(),oi=Ra(aq()),k9=IR();Object.defineProperty(we,"getJsonSchemaRefParserDefaultOptions",{enumerable:!0,get:function(){return k9.getJsonSchemaRefParserDefaultOptions}});var io=class t{constructor(){this.schema=null,this.$refs=new lq.default}async parse(){let e=(0,yd.default)(arguments),r;if(!e.path&&!e.schema){let i=(0,cq.ono)(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return(0,oi.default)(e.callback,Promise.reject(i))}this.schema=null,this.$refs=new lq.default;let n="http";if(_a.isFileSystemPath(e.path))e.path=_a.fromFileSystemPath(e.path),n="file";else if(!e.path&&e.schema&&"$id"in e.schema&&e.schema.$id){let i=_a.parse(e.schema.$id),s=i.protocol==="https:"?443:80;e.path=`${i.protocol}//${i.hostname}:${s}`}if(e.path=_a.resolve(_a.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,O9.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,oi.default)(e.callback,Promise.resolve(this.schema));if(e.options.continueOnError)return this.schema=null,(0,oi.default)(e.callback,Promise.resolve(this.schema));throw cq.ono.syntax(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(i){return!e.options.continueOnError||!(0,On.isHandledError)(i)?(0,oi.default)(e.callback,Promise.reject(i)):(this.$refs._$refs[_a.stripHash(e.path)]&&this.$refs._$refs[_a.stripHash(e.path)].addError(i),(0,oi.default)(e.callback,Promise.resolve(null)))}}static parse(){let e=new t;return e.parse.apply(e,arguments)}async resolve(){let e=(0,yd.default)(arguments);try{return await this.parse(e.path,e.schema,e.options),await(0,I9.default)(this,e.options),MR(this),(0,oi.default)(e.callback,Promise.resolve(this.$refs))}catch(r){return(0,oi.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,yd.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,P9.default)(this,e.options),MR(this),(0,oi.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,oi.default)(e.callback,Promise.reject(r))}}static dereference(){let e=new t;return e.dereference.apply(e,arguments)}async dereference(){let e=(0,yd.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,uq.default)(this,e.options),MR(this),(0,oi.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,oi.default)(e.callback,Promise.reject(r))}}};we.$RefParser=io;we.default=io;function MR(t){if(On.JSONParserErrorGroup.getParserErrors(t).length>0)throw new On.JSONParserErrorGroup(t)}we.parse=io.parse;we.resolve=io.resolve;we.bundle=io.bundle;we.dereference=io.dereference});var Cg,Rc,NR=oe(()=>{"use strict";Cg=ab(fq()),Rc=class{async resolve(e){try{return await Cg.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 Cg.default.bundle(e)}catch(r){return console.error("[RefResolver] Failed to bundle $ref pointers:",r),e}}async resolveFile(e){try{return await Cg.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){throw console.error(`[RefResolver] Failed to resolve file ${e}:`,r),r}}}});import*as dq from"fs";var pq,T9,xc,DR=oe(()=>{"use strict";pq=ab(S_());yn();__();NR();T9=["application/json","text/plain","text/html","multipart/form-data","application/x-www-form-urlencoded"],xc=class{constructor(e,r){this.collectionService=e;this.envConfigService=r;this.exampleGenerator=new lc,this.refResolver=new Rc}collectionService;envConfigService;exampleGenerator;refResolver;async import(e,r){let n=await dq.promises.readFile(e,"utf-8"),i;e.endsWith(".yaml")||e.endsWith(".yml")?i=pq.parse(n):i=JSON.parse(n),i=await this.refResolver.resolve(i);let s=i.components?.schemas||{},a=r?.collectionName||i.info?.title||"Imported API",f={id:ft(a),name:a,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 g=this.mapSecurityToAuth(i.security[0],i.components.securitySchemes);g&&(f.auth=g)}let d=new Map;if(i.tags)for(let g of i.tags){let y={type:"folder",id:ft(g.name),name:g.name,description:g.description,items:[]};d.set(g.name,y),f.items.push(y)}if(i.paths)for(let[g,y]of Object.entries(i.paths))for(let w of["get","post","put","patch","delete","head","options","trace"]){let C=y[w];if(!C)continue;let R=this.processOperation(w,g,C,y,i,s),T=C.tags?.[0];if(T&&d.has(T))d.get(T).items.push(R);else if(T){let A={type:"folder",id:ft(T),name:T,items:[R]};d.set(T,A),f.items.push(A)}else f.items.push(R)}await this.collectionService.saveCollection(f);let m;return r?.environmentName&&i.servers&&(m=await this.createEnvironmentFromServers(i.servers,r.environmentName)),{collection:f,environmentCreated:m}}processOperation(e,r,n,i,s,a){let l=ft(n.operationId||`${e}-${r}`),f=`{{baseUrl}}${this.convertPathParams(r)}`,d=n.summary||n.operationId||`${e.toUpperCase()} ${r}`,m=n.deprecated===!0;m&&(d=`[DEPRECATED] ${d}`);let g={type:"request",id:l,name:d,method:e.toUpperCase(),url:f,description:n.description||"",deprecated:m},y=[...i.parameters||[],...n.parameters||[]];if(this.processParameters(g,y,a),n.requestBody&&this.processRequestBody(g,n.requestBody,a),n.responses&&(g.responseSchema=this.processResponses(n.responses,a)),n.security!==void 0&&s.components?.securitySchemes){if(Array.isArray(n.security)&&n.security.length===0)g.auth={type:"none"};else if(n.security&&n.security.length>0){let w=this.mapSecurityToAuth(n.security[0],s.components.securitySchemes);w&&(g.auth=w)}}return g}convertPathParams(e){return e.replace(/\{(\w+)\}/g,":$1")}processParameters(e,r,n){let i=[],s=[],a={},l=[];for(let f of r){let d=f.name,m=f.in,g=f.schema||{},y=f.example!==void 0?String(f.example):this.generateExampleForParam(g,n),w=f.deprecated===!0;switch(m){case"path":{if(f.description||g.type||g.format||g.enum||w||g.pattern||g.minimum!==void 0||g.maximum!==void 0||g.minLength!==void 0||g.maxLength!==void 0||g.multipleOf!==void 0||g.minItems!==void 0||g.maxItems!==void 0||g.uniqueItems||g.nullable||g.oneOf){let R={value:y};g.oneOf?(R.oneOf=g.oneOf,this.applyOneOfHints(R,g.oneOf)):(g.type&&(R.type=g.type),g.format&&(R.format=g.format),g.enum&&(R.enum=g.enum.map(String)),g.pattern&&(R.pattern=g.pattern),g.minimum!==void 0&&(R.minimum=g.minimum),g.maximum!==void 0&&(R.maximum=g.maximum),g.exclusiveMinimum!==void 0&&(R.exclusiveMinimum=g.exclusiveMinimum),g.exclusiveMaximum!==void 0&&(R.exclusiveMaximum=g.exclusiveMaximum),g.multipleOf!==void 0&&(R.multipleOf=g.multipleOf),g.minLength!==void 0&&(R.minLength=g.minLength),g.maxLength!==void 0&&(R.maxLength=g.maxLength),g.minItems!==void 0&&(R.minItems=g.minItems),g.maxItems!==void 0&&(R.maxItems=g.maxItems),g.uniqueItems&&(R.uniqueItems=!0),g.nullable&&(R.nullable=!0)),f.description&&(R.description=f.description),w&&(R.deprecated=!0),a[d]=R}else a[d]=y;break}case"query":{let C={key:d,value:y};this.applySchemaConstraints(C,g,f,w),s.push(C);break}case"header":{let C={key:d,value:y};this.applySchemaConstraints(C,g,f,w),i.push(C);break}case"cookie":{l.push(`${d}={{${d}}}`);break}}}l.length>0&&i.push({key:"Cookie",value:l.join("; ")}),Object.keys(a).length>0&&(e.params=a),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),a=r.content[s],{bodyType:l,bodyFormat:f}=this.mapContentTypeToBodyType(s);if(e.body={type:l,...f&&{format:f},content:""},a){let m=this.generateBodyContent(a,s,n);m!==void 0&&(e.body.content=typeof m=="string"?m:JSON.stringify(m,null,2)),l==="form-data"&&a.schema?.properties&&(e.body.content=this.buildFormDataEntries(a.schema,n)),l==="x-www-form-urlencoded"&&a.schema?.properties&&(e.body.content=this.buildFormDataEntries(a.schema,n))}let d=this.buildBodySchema(r,s,n);d&&(e.bodySchema=d)}selectPrimaryContentType(e){for(let i of T9)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[a,l]of Object.entries(i)){let f=l,d=f.type==="string"&&f.format==="binary",m={key:a,value:d?"":String(this.exampleGenerator.generate(f,{components:r})||""),type:d?"file":"text",enabled:!0};n.push(m)}return n}buildBodySchema(e,r,n){let i=Object.keys(e.content),s=e.content[r];if(!s?.schema)return;let a={contentType:r,schema:s.schema};if(i.length>1){a.content={};for(let f of i){let d=e.content[f],m={};d.schema&&(m.schema=d.schema),d.examples&&(m.examples=d.examples),d.encoding&&(m.encoding=d.encoding),a.content[f]=m}}s.encoding&&(a.encoding=s.encoding);let l=this.extractUsedComponents(s.schema,n);return Object.keys(l).length>0&&(a.components=l),a}processResponses(e,r){let n={responses:{}},i={};for(let[s,a]of Object.entries(e)){let l=a,f={description:l.description||`Status ${s}`};if(l.content){let d=Object.keys(l.content);if(d.length===1){let m=d[0],g=l.content[m];f.contentType=m,g.schema&&(f.schema=g.schema),g.examples&&(f.examples=g.examples),g.schema&&Object.assign(i,this.extractUsedComponents(g.schema,r))}else{f.content={};for(let m of d){let g=l.content[m],y={};g.schema&&(y.schema=g.schema),g.examples&&(y.examples=g.examples),f.content[m]=y,g.schema&&Object.assign(i,this.extractUsedComponents(g.schema,r))}}}if(l.headers){f.headers={};for(let[d,m]of Object.entries(l.headers)){let g=m;f.headers[d]={...g.description&&{description:g.description},schema:g.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||{},a=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:a.tokenUrl||"",authUrl:a.authorizationUrl||"",clientId:"",clientSecret:"",scope:Object.keys(a.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 a of e[s])this.extractUsedComponents(a,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 Cc,FR=oe(()=>{"use strict";Cc=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}),a;return i?.postResponseScript&&(a=this.scriptAnalyzer.analyze(i.postResponseScript)),this.mergeResponseSchemas(n,s,a)}async inferBodySchema(e,r,n,i,s){let a,l;if(r==="raw"&&n==="json"&&e){let f=e;if(typeof e=="string")try{f=JSON.parse(e)}catch{return}a=this.inferrer.inferFromValue(f),l="application/json"}else r==="form-data"&&i?(a=this.buildFormDataSchema(i),l="multipart/form-data"):r==="x-www-form-urlencoded"&&i?(a=this.buildFormDataSchema(i),l="application/x-www-form-urlencoded"):r==="raw"&&n==="xml"?(a={type:"string"},l="application/xml"):r==="raw"&&(n==="text"||n==="html")?(a={type:"string"},l=n==="html"?"text/html":"text/plain"):r==="binary"?(a={type:"string",format:"binary"},l="application/octet-stream"):r==="graphql"&&(a={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},l="application/json");if(a)return s?this.mergeBodySchemaWithExisting(a,s):{contentType:l,schema:a}}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,a]of Object.entries(r.responses))i.responses[s]={...a};if(n&&this.applyScriptHints(i,n),e){for(let[s,a]of Object.entries(e.responses))i.responses[s]?i.responses[s]=this.mergeResponseDefinitions(i.responses[s],a):i.responses[s]={...a};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],a=s.endsWith("[]"),l=a?s.slice(0,-2):s,f=i?`${i}.${s}`:s,d=r.slice(1);if(!e.properties[l])if(a)e.properties[l]={type:"array",items:{type:"object"}};else if(d.length>0)e.properties[l]={type:"object",properties:{}};else{let m=n.typeHints[f];e.properties[l]={type:m||"string"};return}if(d.length>0){let m=a?e.properties[l].items:e.properties[l];m&&this.ensureFieldPath(m,d,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 hq,Eg,mq,gq,yq,vq,bq,Ec,LR=oe(()=>{"use strict";hq=/(?:jsonData|responseJson|data|json|body|response\.json\(\))\.([a-zA-Z_][\w.\[\]]*)/g,Eg="(?:pm|hf|ctx)",mq=new RegExp(`${Eg}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(?:a|an)\\(['"](\\w+)['"]\\)`,"g"),gq=new RegExp(`${Eg}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.(?:equal|eql)\\((.+?)\\)`,"g"),yq=/(?:to\.have\.status|response\.code.*?equal)\((\d+)\)/g,vq=new RegExp(`${Eg}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.be\\.(true|false)`,"g"),bq=new RegExp(`${Eg}\\.expect\\(.*?\\.([a-zA-Z_][\\w.]*)\\)\\.to\\.have\\.(?:lengthOf|length\\.above|length\\.below)`,"g"),Ec=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(hq.source,hq.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(mq.source,mq.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),a=n[2].toLowerCase();s&&(r.typeHints[s]=this.mapAssertionType(a),r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractEqualityAssertions(e,r){let n,i=new RegExp(gq.source,gq.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),a=n[2].trim();if(s){let l=this.parseAssertionValue(a);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(vq.source,vq.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(bq.source,bq.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(yq.source,yq.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 Sq={};ks(Sq,{AwsSecretResolver:()=>Og});var Og,jR=oe(()=>{"use strict";Og=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=>it(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:a}=this.moduleRequire("@aws-sdk/client-secrets-manager"),f=await new s(this.region?{region:this.region}:{}).send(new a({SecretId:n})),d=f.SecretString??(f.SecretBinary?Buffer.from(f.SecretBinary).toString("utf-8"):void 0);if(d===void 0)return;if(i)try{let m=JSON.parse(d);return m[i]!==void 0?String(m[i]):void 0}catch{return}return d}catch(s){throw s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND"?new Error("[HTTP Forge] AWS secret resolver requires @aws-sdk/client-secrets-manager. Install it in your project: npm install @aws-sdk/client-secrets-manager"):s}}}});var wq={};ks(wq,{AzureKeyVaultResolver:()=>Ig});var Ig,UR=oe(()=>{"use strict";Ig=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=>it(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:a}=this.moduleRequire("@azure/identity"),l=new a;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 _q={};ks(_q,{HashiCorpVaultResolver:()=>Pg});var Pg,HR=oe(()=>{"use strict";Pg=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 a=`${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(a,{headers:l})}catch(y){throw new Error(`[HTTP Forge] Vault request failed: ${y?.message??y}`)}if(f.status===404)return;if(!f.ok)throw new Error(`[HTTP Forge] Vault returned HTTP ${f.status} for path: ${n}`);let m=(await f.json())?.data?.data;if(!m)return;if(i)return m[i]!==void 0?String(m[i]):void 0;if("value"in m)return String(m.value);let g=Object.keys(m);return g.length===1?String(m[g[0]]):void 0}}});var Rq={};ks(Rq,{OnePasswordResolver:()=>kg});import{execFile as A9}from"child_process";import{promisify as q9}from"util";var $9,kg,BR=oe(()=>{"use strict";$9=q9(A9),kg=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 a=await this.tryResolveSdk(n,i,s);return a!==null?a: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}=it("@1password/sdk"),a=await s({auth:i,integrationName:"HTTP Forge",integrationVersion:"1.0.0"}),l=`op://${e}/${r}/${n}`;return await a.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 $9("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 xq={};ks(xq,{GcpSecretResolver:()=>Tg});var Tg,VR=oe(()=>{"use strict";Tg=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=>it(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"),a=new s,l=`projects/${this.projectId}/secrets/${n}/versions/${i}`,[f]=await a.accessSecretVersion({name:l}),d=f.payload?.data;return d?Buffer.isBuffer(d)?d.toString("utf-8"):Buffer.from(d).toString("utf-8"):void 0}catch(s){throw s?.name==="MODULE_NOT_FOUND"||s?.code==="MODULE_NOT_FOUND"?new Error("[HTTP Forge] GCP secret resolver requires @google-cloud/secret-manager. Install it: npm install @google-cloud/secret-manager"):s}}}});var Eq={};ks(Eq,{DopplerResolver:()=>Ag});import*as Cq from"https";var Ag,WR=oe(()=>{"use strict";Ag=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,a)=>{let l=Cq.request(i,{method:"GET",headers:{Authorization:`Bearer ${n}`,Accept:"application/json"}},f=>{let d=[];f.on("data",m=>d.push(m)),f.on("end",()=>{let m=Buffer.concat(d).toString("utf-8");if(f.statusCode===404){s(void 0);return}if(f.statusCode!==200){a(new Error(`[HTTP Forge] Doppler API returned ${f.statusCode} for secret "${r}": ${m}`));return}try{let y=JSON.parse(m)?.value?.computed;s(y!=null?String(y):void 0)}catch{a(new Error(`[HTTP Forge] Doppler API returned non-JSON response for secret "${r}"`))}})});l.on("error",a),l.end()})}}});import*as qg from"fs";import{createRequire as M9}from"module";import*as Oq from"path";var vd,zR=oe(()=>{"use strict";vd=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 a=>{if(n.has(a))return;let l=a.slice(7),f=l.indexOf("/");if(f<0)return;let d=l.slice(0,f),m=l.slice(f+1),g=this.resolvers.get(d);if(g)try{let y=await g.resolve(m);y!==void 0&&n.set(a,y)}catch(y){let w=y?.message??String(y);console.warn(`[HTTP Forge] {{${a}}} could not be resolved: ${w}`)}}));let s={};for(let[a,l]of n.entries())s[a]=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}=(jR(),vl(Sq));return new r(e,this.moduleRequire)}case"azure":{let{AzureKeyVaultResolver:r}=(UR(),vl(wq));return new r(e,this.moduleRequire)}case"vault":{let{HashiCorpVaultResolver:r}=(HR(),vl(_q));return new r(e)}case"1password":{let{OnePasswordResolver:r}=(BR(),vl(Rq));return new r(e)}case"gcp":{let{GcpSecretResolver:r}=(VR(),vl(xq));return new r(e,this.moduleRequire)}case"doppler":{let{DopplerResolver:r}=(WR(),vl(Eq));return new r(e)}default:return}}buildModuleRequire(e){let r=i=>it(i);if(!e)return r;let n=[];try{n=e.getModulePaths()??[]}catch{return r}for(let i of n)try{let s=Oq.resolve(i,"package.json");if(qg.existsSync(s)){let a=qg.realpathSync(s),l=M9(a);return f=>{try{return l(f)}catch{return r(f)}}}}catch{}return r}}});var bd,JR=oe(()=>{"use strict";bd={iterations:1,delayBetweenRequests:0,stopOnError:!1,readFromSharedSession:!1,writeToSharedSession:!1}});import*as Tt from"fs";import*as so from"path";var Sd,YR=oe(()=>{"use strict";yn();JR();Sd=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(){Tt.existsSync(this.suitesDir)||Tt.mkdirSync(this.suitesDir,{recursive:!0})}setupFileWatcher(){try{this.fileWatcher=Tt.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(),!Tt.existsSync(this.suitesDir))return;let e=Tt.readdirSync(this.suitesDir);for(let r of e)if(r.endsWith(".suite.json"))try{let n=so.join(this.suitesDir,r),i=Tt.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:ft(e),name:e,requests:r,config:{...bd},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=so.join(this.suitesDir,e),a=so.join(this.suitesDir,i.id);return Tt.existsSync(s)&&this.copyDirRecursive(s,a),await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}copyDirRecursive(e,r){Tt.existsSync(r)||Tt.mkdirSync(r,{recursive:!0});for(let n of Tt.readdirSync(e,{withFileTypes:!0})){let i=so.join(e,n.name),s=so.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):Tt.copyFileSync(i,s)}}async deleteSuite(e){let r=this.suites.get(e);if(!r)return!1;let n=`${r.id}.suite.json`,i=so.join(this.suitesDir,n);try{return Tt.existsSync(i)&&Tt.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:{...bd},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 a=r.replace(/\/+$/,""),l=s.filter(m=>n?m.folderPath===a||m.folderPath.startsWith(`${a}/`):m.folderPath===a);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(a)}`,name:`${i.name} / ${a}`,requests:l,config:{...bd},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:ft(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 a of e.requests)s.push({collectionId:r,collectionName:n,requestId:a.id,name:a.name||"Unnamed Request",method:a.method||"GET",folderPath:i});if(e.items)for(let a of e.items)if(a.items||a.folders||a.requests){let l=i?`${i}/${a.name}`:a.name;this.extractRequestsFromCollection(a,r,n,l,s)}else s.push({collectionId:r,collectionName:n,requestId:a.id,name:a.name||"Unnamed Request",method:a.method||"GET",folderPath:i});if(e.folders)for(let a of e.folders){let l=i?`${i}/${a.name}`:a.name;this.extractRequestsFromCollection(a,r,n,l,s)}}async saveSuiteToDisk(e){this.ensureSuitesDir();let r=`${e.id}.suite.json`,n=so.join(this.suitesDir,r),i=JSON.stringify(e,null,2);Tt.writeFileSync(n,i,"utf-8")}}});var re,$g=oe(()=>{"use strict";re={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 Iq from"path";function Mg(t,e){let{workspaceFolder:r,fileWatcherFactory:n,notificationService:i,workspaceStore:s,globalStore:a,secretStore:l,browserService:f,applicationInfo:d,consoleService:m}=e;t.registerValue(re.WorkspaceFolder,r),t.registerSingleton(re.Config,()=>new Yl(r,n,i)),t.registerSingleton(re.Console,()=>m??N9),t.registerSingleton(re.EnvironmentConfig,y=>new wf(r,s,y.resolve(re.Config),n,l)),t.registerSingleton(re.Cookie,()=>new vf(a)),t.registerSingleton(re.Collection,y=>new yf(r,y.resolve(re.Config),n)),t.registerSingleton(re.TestSuite,y=>new Sd(y.resolve(re.Collection),y.resolve(re.Config))),t.registerSingleton(re.HttpClient,()=>new Wo),t.registerSingleton(re.UrlBuilder,()=>new Hn),t.registerSingleton(re.InterceptorChain,()=>new zi),t.registerSingleton(re.HttpRequest,y=>new Wi(y.resolve(re.UrlBuilder),y.resolve(re.InterceptorChain),y.resolve(re.HttpClient))),t.registerSingleton(re.RequestPreprocessor,()=>new ia),t.registerSingleton(re.RequestHistory,y=>{let w=y.resolve(re.EnvironmentConfig);return new Cf(w.getHistoriesPath(),Iq.join(w.getRootPath(),"shared-histories"))}),l&&f&&t.registerSingleton(re.OAuth2TokenManager,y=>new hf(l,f,y.resolve(re.EnvironmentConfig),y.resolve(re.HttpRequest))),t.registerSingleton(re.GraphQLSchemaService,y=>new Rf(y.resolve(re.HttpClient))),t.registerSingleton(re.SecretResolverRegistry,y=>new vd(y.resolve(re.Config)));let g=d??{name:"HttpForge",version:"0.0.0"};t.registerSingleton(re.RequestPreparer,y=>new _f(y.resolve(re.EnvironmentConfig),y.resolve(re.HttpRequest),y.resolve(re.RequestPreprocessor),y.has(re.OAuth2TokenManager)?y.resolve(re.OAuth2TokenManager):void 0,g,y.resolve(re.SecretResolverRegistry))),t.registerSingleton(re.ScriptExecutor,y=>{let w=y.resolve(re.Config);return new Qi(y.resolve(re.HttpRequest),w.getModulePaths(),y.resolve(re.SecretResolverRegistry),w.getScriptScope(),w.getScriptTimeout())}),t.registerSingleton(re.DataFileParser,()=>new oa),t.registerSingleton(re.CollectionRequestExecutor,y=>new Hs(y.resolve(re.HttpRequest),y.resolve(re.ScriptExecutor),y.resolve(re.EnvironmentConfig),y.resolve(re.RequestPreparer),"")),t.registerSingleton(re.PersistentCookieJar,y=>new bf(y.resolve(re.Cookie))),t.registerSingleton(re.SchemaInferrer,()=>new Xs),t.registerSingleton(re.HistoryAnalyzer,y=>new Gl(y.resolve(re.RequestHistory),y.resolve(re.SchemaInferrer))),t.registerSingleton(re.ScriptAnalyzer,()=>new Ec),t.registerSingleton(re.SchemaInferenceService,y=>new Cc(y.resolve(re.HistoryAnalyzer),y.resolve(re.ScriptAnalyzer),y.resolve(re.SchemaInferrer))),t.registerSingleton(re.OpenApiExporter,y=>new ac(y.resolve(re.Collection),y.resolve(re.EnvironmentConfig),y.resolve(re.SchemaInferenceService))),t.registerSingleton(re.OpenApiImporter,y=>new xc(y.resolve(re.Collection),y.resolve(re.EnvironmentConfig)))}var N9,GR=oe(()=>{"use strict";v0();R0();C0();E0();O0();P0();Jh();k0();T0();F0();Pu();ku();Iu();Hh();wl();L0();w_();DR();FR();Km();LR();Bh();uf();zR();YR();$g();N9={log:()=>{},trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},logBatch:()=>{},logRawLines:()=>{},show:()=>{},clear:()=>{},dispose:()=>{}}});function Pq(){return xa.instance}var xa,KR=oe(()=>{"use strict";$g();xa=class t{static _instance;services=new Map;primitives=new Map;constructor(){}static get instance(){return t._instance||(t._instance=new t),t._instance}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(re.Config)}get console(){return this.resolve(re.Console)}get environmentConfig(){return this.resolve(re.EnvironmentConfig)}get collection(){return this.resolve(re.Collection)}get httpRequest(){return this.resolve(re.HttpRequest)}get httpClient(){return this.resolve(re.HttpClient)}get cookie(){return this.resolve(re.Cookie)}get requestHistory(){return this.resolve(re.RequestHistory)}get dataFileParser(){return this.resolve(re.DataFileParser)}get scriptExecutor(){return this.resolve(re.ScriptExecutor)}get requestPreparer(){return this.resolve(re.RequestPreparer)}get persistentCookieJar(){return this.resolve(re.PersistentCookieJar)}get oauth2TokenManager(){return this.has(re.OAuth2TokenManager)?this.resolve(re.OAuth2TokenManager):void 0}get graphqlSchemaService(){return this.resolve(re.GraphQLSchemaService)}get testSuite(){return this.resolve(re.TestSuite)}}});var Oc,QR=oe(()=>{"use strict";Sl();Oc=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}getCookiesForDomain(e){let r=[];for(let n of this.cookies.values())dt.isExpired(n)||(!n.domain||dt.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&&!dt.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())dt.isExpired(n)||r.push(n);return r}setCookiesFromResponse(e,r){let n=dt.extractDomain(e),i=dt.parseCookieHeaders(r,n);for(let s of i){let a=this.getCookieKey(s.name,s.domain,s.path);this.cookies.set(a,s)}}getCookieHeader(e){let r=dt.extractDomain(e),n=dt.extractPath(e),s=this.getCookiesForDomain(r).filter(a=>a.path?n.startsWith(a.path):!0);if(s.length!==0)return dt.formatCookieHeader(s)}clear(){this.cookies.clear()}}});function Ng(t,e,r){let n=String(t).padStart(6,"0"),i=String(e).padStart(4,"0");return`result-${n}-iter-${i}-${r}.json`}function D9(t){return{index:t.i,iteration:t.it,name:t.n,method:Ic[t.m]||"GET",status:t.s,duration:t.d,passed:t.p,assertionsPassed:t.ap,assertionsFailed:t.af,requestId:t.r,resultFile:Ng(t.i,t.it,t.r),error:t.e}}var ZR,Ic,Dg=oe(()=>{"use strict";ZR={GET:0,POST:1,PUT:2,DELETE:3,PATCH:4,HEAD:5,OPTIONS:6,TRACE:7,CONNECT:8},Ic={0:"GET",1:"POST",2:"PUT",3:"DELETE",4:"PATCH",5:"HEAD",6:"OPTIONS",7:"TRACE",8:"CONNECT"}});import*as kc from"fs/promises";import*as Pc from"path";function yt(t){return String(t??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Ca(t){return t>=1e3?`${(t/1e3).toFixed(2)}s`:`${t}ms`}function XR(t){try{return new Date(t).toLocaleString()}catch{return t}}function Fg(t){return t>=200&&t<300?"status-2xx":t>=300&&t<400?"status-3xx":t>=400&&t<500?"status-4xx":"status-5xx"}function F9(t,e){return e===0?"\u2014":`${Math.round(t/e*100)}%`}function Aq(t){try{return typeof t=="string"&&(t=JSON.parse(t)),JSON.stringify(t,null,2)}catch{return String(t??"")}}function kq(t){return!t||Object.keys(t).length===0?'<span class="dim">\u2014</span>':`<table class="kv-table">${Object.entries(t).map(([r,n])=>{let i=Array.isArray(n)?n.join(", "):String(n??"");return`<tr><td class="kv-key">${yt(r)}</td><td class="kv-val">${yt(i)}</td></tr>`}).join("")}</table>`}function L9(t){return t==null||t===""?'<span class="dim">\u2014</span>':typeof t=="string"?yt(t):typeof t=="number"||typeof t=="boolean"?yt(String(t)):`<pre class="code">${yt(Aq(t))}</pre>`}function ex(t){return!t||Object.keys(t).length===0?'<span class="dim">\u2014</span>':`<table class="kv-table meta-table">${Object.entries(t).map(([r,n])=>`
|
|
278
278
|
<tr>
|
|
279
279
|
<td class="kv-key">${yt(r)}</td>
|
|
280
|
-
<td class="kv-val">${
|
|
281
|
-
</tr>`).join("")}</table>`}function
|
|
280
|
+
<td class="kv-val">${L9(n)}</td>
|
|
281
|
+
</tr>`).join("")}</table>`}function j9(t){return!t||t.length===0?'<span class="dim">\u2014</span>':`<table class="kv-table">${t.map(r=>`
|
|
282
282
|
<tr>
|
|
283
283
|
<td class="kv-key">${yt(r.name??"(unnamed)")}</td>
|
|
284
284
|
<td class="kv-val">${yt(r.value??"")}</td>
|
|
285
|
-
</tr>`).join("")}</table>`}function
|
|
285
|
+
</tr>`).join("")}</table>`}function Tq(t,e){if(t==null||t==="")return'<span class="dim">\u2014 empty \u2014</span>';let r=Aq(t);return`<pre class="code">${yt(r)}</pre>`}var wd,tx=oe(()=>{"use strict";Dg();wd=class{constructor(e){this.basePath=e}basePath;async generate(e,r){let n=Pc.join(this.basePath,e,r),i=JSON.parse(await kc.readFile(Pc.join(n,"manifest.json"),"utf-8")),s=await this.loadAllSummaries(n,i.totalIndexPages),a=await this.loadAllDetails(n,s),l=this.buildHtml(i,s,a),f=Pc.join(n,"report.html");return await kc.writeFile(f,l,"utf-8"),f}async loadAllSummaries(e,r){let n=[];for(let i=1;i<=r;i++){let s=Pc.join(e,"index",`page-${String(i).padStart(4,"0")}.json`);try{let a=JSON.parse(await kc.readFile(s,"utf-8"));n.push(...a.summaries)}catch{}}return n}async loadAllDetails(e,r){let n=new Map;for(let i of r){let s=Ng(i.i,i.it,i.r),a=`${i.i}-${i.it}`;try{let l=JSON.parse(await kc.readFile(Pc.join(e,"results",s),"utf-8"));n.set(a,l)}catch{}}return n}groupByIterCollectionFolder(e){let r=[],n=new Map;for(let i of e){n.has(i.it)||(n.set(i.it,{order:[],map:new Map}),r.push(i.it));let s=n.get(i.it),a=i.cn||"",l=i.fp||"",f=`${a}\0${l}`;s.map.has(f)||(s.map.set(f,{cn:a,fp:l,items:[]}),s.order.push(f)),s.map.get(f).items.push(i)}return r.map(i=>{let s=n.get(i);return{it:i,groups:s.order.map(a=>s.map.get(a))}})}groupLabel(e,r,n){let i=String(n).padStart(2,"0"),s=e?yt(e):"";if(r){let a=r.split("/").map(l=>yt(l.replace(/^\s*\d+\s*-\s*/,""))).join("/");s=s?`${s}: ${a}`:a}return s||(s="(root)"),`${i} - ${s}`}renderGroupedDetails(e,r,n){let i=r.config.iterations>1;return this.groupByIterCollectionFolder(e).map(s=>{let a=s.groups.map((d,m)=>{let g=d.items.filter(R=>R.p).length,y=d.items.length,w=g<y,C=d.items.map(n).join("");return`
|
|
286
286
|
<details class="group-block${w?" group-fail":""}" open>
|
|
287
287
|
<summary class="group-head">
|
|
288
288
|
<span class="group-title">\u{1F4C1} ${this.groupLabel(d.cn,d.fp,m+1)}</span>
|
|
289
289
|
<span class="group-count ${w?"fail":"dim"}">(${g}/${y})</span>
|
|
290
290
|
</summary>
|
|
291
291
|
<div class="group-body">${C}</div>
|
|
292
|
-
</details>`}).join("");if(!i)return
|
|
292
|
+
</details>`}).join("");if(!i)return a;let l=s.groups.reduce((d,m)=>d+m.items.filter(g=>g.p).length,0),f=s.groups.reduce((d,m)=>d+m.items.length,0);return`
|
|
293
293
|
<details class="iter-block" open>
|
|
294
294
|
<summary class="iter-head">
|
|
295
295
|
<span class="iter-title">Iteration ${s.it}</span>
|
|
296
296
|
<span class="dim iter-count">(${l}/${f} passed)</span>
|
|
297
297
|
</summary>
|
|
298
|
-
<div class="iter-body">${
|
|
299
|
-
</details>`}).join("")}renderGroupedTimeline(e,r,n){let i=r.config.iterations>1,s=8;return this.groupByIterCollectionFolder(e).map(
|
|
298
|
+
<div class="iter-body">${a}</div>
|
|
299
|
+
</details>`}).join("")}renderGroupedTimeline(e,r,n){let i=r.config.iterations>1,s=8;return this.groupByIterCollectionFolder(e).map(a=>{let l="";return i&&(l+=`<tr class="group-row iter-row"><td colspan="${s}">Iteration ${a.it}</td></tr>`),a.groups.forEach((f,d)=>{l+=`<tr class="group-row folder-row"><td colspan="${s}">\u{1F4C1} ${this.groupLabel(f.cn,f.fp,d+1)}</td></tr>`,l+=f.items.map(n).join("")}),l}).join("")}buildHtml(e,r,n){let i=Ca(e.stats.totalDuration),s=e.stats.failed===0,a=Object.entries(e.requestStats).map(([,w])=>{let C=F9(w.passed,w.count);return`
|
|
300
300
|
<tr${w.failed>0?' class="row-fail"':""}>
|
|
301
301
|
<td>${yt(w.name)}</td>
|
|
302
302
|
<td>${w.count}</td>
|
|
@@ -306,7 +306,7 @@ Too many redirects:
|
|
|
306
306
|
<td>${w.p90!==void 0?Ca(w.p90):"\u2014"}</td>
|
|
307
307
|
<td>${w.p99!==void 0?Ca(w.p99):"\u2014"}</td>
|
|
308
308
|
<td class="${w.failed>0?"fail":"pass"}">${C}</td>
|
|
309
|
-
</tr>`}).join(""),l=Math.max(...r.map(w=>w.d),1),f=w=>{let C=Ic[w.m]??"GET",R=Math.max(2,Math.round(w.d/l*100)),
|
|
309
|
+
</tr>`}).join(""),l=Math.max(...r.map(w=>w.d),1),f=w=>{let C=Ic[w.m]??"GET",R=Math.max(2,Math.round(w.d/l*100)),T=w.p?"bar-pass":"bar-fail",A=w.p?"":' class="row-fail"',U=`req-${w.i}-${w.it}`;return`
|
|
310
310
|
<tr${A}>
|
|
311
311
|
<td class="dim">${w.i}</td>
|
|
312
312
|
<td>${w.it}</td>
|
|
@@ -314,14 +314,14 @@ Too many redirects:
|
|
|
314
314
|
<td><a href="#${U}" class="req-link">${yt(w.n)}</a></td>
|
|
315
315
|
<td class="${Fg(w.s)}">${w.s}</td>
|
|
316
316
|
<td>${Ca(w.d)}</td>
|
|
317
|
-
<td><div class="bar-wrap"><div class="${
|
|
317
|
+
<td><div class="bar-wrap"><div class="${T}" style="width:${R}%"></div></div></td>
|
|
318
318
|
<td class="${w.p?"pass":"fail"}">${w.p?"\u2713":"\u2717"}</td>
|
|
319
|
-
</tr>`},d=this.renderGroupedTimeline(r,e,f),m=w=>{let C=`${w.i}-${w.it}`,R=n.get(C),
|
|
319
|
+
</tr>`},d=this.renderGroupedTimeline(r,e,f),m=w=>{let C=`${w.i}-${w.it}`,R=n.get(C),T=Ic[w.m]??"GET",A=`req-${w.i}-${w.it}`,U=w.p,B=U?"#1f6feb40":"#f8514940",V=R?.assertions?.length?`<ul class="assert-list">${R.assertions.map(ht=>`
|
|
320
320
|
<li class="${ht.passed?"pass":"fail"}">
|
|
321
321
|
<span class="assert-icon">${ht.passed?"\u2713":"\u2717"}</span>
|
|
322
322
|
${yt(ht.name)}
|
|
323
323
|
${ht.message?`<span class="assert-msg"> \u2014 ${yt(ht.message)}</span>`:""}
|
|
324
|
-
</li>`).join("")}</ul>`:'<span class="dim">No assertions</span>',
|
|
324
|
+
</li>`).join("")}</ul>`:'<span class="dim">No assertions</span>',W=kq(R?.request?.headers),X=ex(R?{method:R.request?.method,url:R.request?.url,query:R.request?.query,params:R.request?.params,bodyType:R.request?.body?.type,bodyFormat:R.request?.body?.format}:void 0),P=R?.request?.body,_=P&&typeof P=="object"?P.type:void 0,k=P&&typeof P=="object"&&"content"in P?P.content:P,M=_!=="none"&&!(k==null||k===""),j=M?Tq(k):"",$=kq(R?.response?.headers),Y=ex(R?{status:R.status,statusText:R.statusText,durationMs:R.duration,responseTimeMs:R.response?.time,responseSizeBytes:R.response?.size}:void 0),K=R?.response?.body!==void 0&&R.response.body!==null?Tq(R.response.body):'<span class="dim">\u2014 no body \u2014</span>',ne=j9(R?.response?.cookies),ue=ex(R?{timestamp:R.timestamp?new Date(R.timestamp).toISOString():void 0,nextRequest:R.nextRequest,visualizerTemplate:R.visualizerData?.template,visualizerData:R.visualizerData?.data}:void 0),et=`
|
|
325
325
|
<div class="detail-section">
|
|
326
326
|
<div class="pane-section-title">Assertions
|
|
327
327
|
<span class="assert-counts">
|
|
@@ -329,7 +329,7 @@ Too many redirects:
|
|
|
329
329
|
${w.af>0?`<span class="fail"> \xB7 ${w.af} failed</span>`:""}
|
|
330
330
|
</span>
|
|
331
331
|
</div>
|
|
332
|
-
${
|
|
332
|
+
${V}
|
|
333
333
|
</div>`,_e=`
|
|
334
334
|
<div class="col-pane exec-meta-box">
|
|
335
335
|
<div class="pane-title">Execution Metadata</div>
|
|
@@ -344,7 +344,7 @@ Too many redirects:
|
|
|
344
344
|
|
|
345
345
|
<div class="pane-section">
|
|
346
346
|
<div class="pane-section-title">Headers</div>
|
|
347
|
-
${
|
|
347
|
+
${W}
|
|
348
348
|
</div>
|
|
349
349
|
|
|
350
350
|
${M?`
|
|
@@ -376,7 +376,7 @@ Too many redirects:
|
|
|
376
376
|
<summary class="req-summary">
|
|
377
377
|
<span class="toggle-icon">\u25B6</span>
|
|
378
378
|
<span class="req-index dim">#${w.i}</span>
|
|
379
|
-
<span class="method method-${
|
|
379
|
+
<span class="method method-${T.toLowerCase()}">${T}</span>
|
|
380
380
|
<span class="req-name">${yt(w.n)}</span>
|
|
381
381
|
${Rt}
|
|
382
382
|
${zr}
|
|
@@ -387,7 +387,7 @@ Too many redirects:
|
|
|
387
387
|
${ai}
|
|
388
388
|
<!-- URL row -->
|
|
389
389
|
<div class="detail-section url-row">
|
|
390
|
-
<span class="method method-${
|
|
390
|
+
<span class="method method-${T.toLowerCase()}">${T}</span>
|
|
391
391
|
<code class="url-text">${yt(R?.url??"\u2014")}</code>
|
|
392
392
|
</div>
|
|
393
393
|
|
|
@@ -675,7 +675,7 @@ Too many redirects:
|
|
|
675
675
|
<th>Avg</th><th>P90</th><th>P99</th><th>Pass%</th>
|
|
676
676
|
</tr>
|
|
677
677
|
</thead>
|
|
678
|
-
<tbody>${
|
|
678
|
+
<tbody>${a}</tbody>
|
|
679
679
|
</table>
|
|
680
680
|
</div>
|
|
681
681
|
|
|
@@ -800,17 +800,17 @@ Too many redirects:
|
|
|
800
800
|
});
|
|
801
801
|
</script>
|
|
802
802
|
</body>
|
|
803
|
-
</html>`}}});import*as jt from"fs/promises";import*as Wr from"path";function Lg(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 Tc,rx=ae(()=>{"use strict";yn();xf();tx();Dg();Tc=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=Wr.join(this.basePath,e,s),await jt.mkdir(Wr.join(this.currentRunPath,"results"),{recursive:!0}),await jt.mkdir(Wr.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=It(r.requestId),l=`result-${s}-iter-${i}-${o}.json`,f=Wr.join(this.currentRunPath,"results",l),d={index:this.resultIndex,iteration:e,requestId:r.requestId,name:r.name,method:r.executedRequest.method,url:r.executedRequest.url,folderPath:r.folderPath||"",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(w=>({name:w.name,passed:w.passed,message:w.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(D0(d),null,2),"utf-8");let m=r.assertions.filter(w=>w.passed).length,g=r.assertions.filter(w=>!w.passed).length,y={i:this.resultIndex,it:e,n:r.name,m:ZR[r.executedRequest.method.toUpperCase()]??0,s:r.response.status,d:r.duration,p:r.passed,ap:m,af:g,r:r.requestId,e:r.passed?null:r.error||null,fp:r.folderPath||"",cn:r.collectionName||""};return this.currentIndexPage.push(y),this.currentIndexPage.length>=this.indexPageSize&&await this.writeCurrentIndexPage(),this.updateStats(r),this.requestDurations[r.requestId]||(this.requestDurations[r.requestId]=[]),this.requestDurations[r.requestId].push(r.duration),r.passed||(this.recentErrors.unshift({timestamp:n,iteration:e,requestName:r.name,status:r.response.status,error:r.error||`Status ${r.response.status}`,resultFile:l}),this.recentErrors.length>this.recentErrorsLimit&&this.recentErrors.pop()),y}async finalizeRun(e="completed",r=!0){if(!this.currentManifest)return null;this.currentIndexPage.length>0&&await this.writeCurrentIndexPage(),this.currentManifest.endTime=new Date().toISOString(),this.currentManifest.status=e,this.currentManifest.totalIndexPages=this.currentPageNumber-1,this.currentManifest.stats.totalRequests>0&&(this.currentManifest.stats.avgDuration=Math.round(this.currentManifest.stats.totalDuration/this.currentManifest.stats.totalRequests)),this.currentManifest.stats.minDuration===Number.MAX_SAFE_INTEGER&&(this.currentManifest.stats.minDuration=0);for(let l in this.currentManifest.requestStats){let f=this.currentManifest.requestStats[l],d=this.requestDurations[l]||[];f.count>0&&(f.avgDuration=Math.round(f.totalDuration/f.count)),f.minDuration===Number.MAX_SAFE_INTEGER&&(f.minDuration=0),d.length>0&&(d.sort((m,g)=>m-g),f.p50=Lg(d,50),f.p90=Lg(d,90),f.p95=Lg(d,95),f.p99=Lg(d,99))}this.requestDurations={},await this.saveManifest();let n=null,i=this.currentRunPath,s=this.currentSuiteId,o=this.currentRunId;if(this.currentRunPath=null,this.currentRunId=null,this.currentSuiteId=null,this.currentManifest=null,this.currentIndexPage=[],this.recentErrors=[],this.resultIndex=0,r&&s&&o&&i)try{n=await new wd(this.basePath).generate(s,o)}catch(l){console.warn("[ResultStorage] HTML report generation failed:",l)}return n}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=Wr.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=Wr.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=Wr.join(this.basePath,e,r,"manifest.json"),i=await jt.readFile(n,"utf-8");return JSON.parse(i)}async listRuns(e){let r=Wr.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=Wr.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 d of f)if(new Date(d.startTime)<n){let m=Wr.join(this.basePath,l,d.runId),g=await this.getDirectorySize(m);await jt.rm(m,{recursive:!0,force:!0}),i++,s+=g}}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=Wr.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=Wr.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=Wr.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 Ei from"fs";import*as _d from"path";var nx,jg,Rd,Ug,Tq=ae(()=>{"use strict";nx=class{watchers=[];constructor(e,r){let n=this.globToPath(e,r);try{let i=Ei.watch(n,{recursive:!0},(s,o)=>{if(o){let l=_d.join(n,o);this.notifyChange(l)}});this.watchers.push(i)}catch{}}globToPath(e,r){return r.includes("**")?e:_d.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=[]}},jg=class{createFileWatcher(e,r){return new nx(e,r)}},Rd=class{data={};storeFile;constructor(e){this.storeFile=e,this.load()}load(){try{if(Ei.existsSync(this.storeFile)){let e=Ei.readFileSync(this.storeFile,"utf-8");this.data=JSON.parse(e)}}catch{}}save(){try{let e=_d.dirname(this.storeFile);Ei.mkdirSync(e,{recursive:!0}),Ei.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()}},Ug=class{async showInformation(e){console.log(`[INFO] ${e}`)}async showWarning(e){console.warn(`[WARN] ${e}`)}async showError(e){console.error(`[ERROR] ${e}`)}}});import*as Ac from"path";function Aq(t){let e=Ac.resolve(t.workspaceFolder),{appInfo:r}=t,n=xa.instance;n.clear();let i=Ac.join(e,".http-forge-cache","stores"),s=Ac.join(i,"workspace-state.json"),o=Ac.join(i,"global-state.json"),l={workspaceFolder:e,fileWatcherFactory:new jg,notificationService:new Ug,workspaceStore:new Rd(s),globalStore:new Rd(o),applicationInfo:r||{name:"http-forge-cli",version:"0.1.0"}};return Mg(n,l),n}function as(t){return Aq({workspaceFolder:t})}var Hg=ae(()=>{"use strict";GR();KR();Tq()});function L9(t){let e=[];return t.map(r=>{let n=vn(r,e);return e.push(n),n})}function qq(t,e,r,n){let i=t.find(d=>d.id===e);if(i)return{item:i,tier:"id"};let s=L9(t.map(d=>d.name)),o=t.filter((d,m)=>s[m]===e);if(o.length===1)return{item:o[0],tier:"slug"};if(o.length>1)throw new Ea(r,e,o.map(d=>({id:d.id,name:d.name,path:n(d)})));let l=e.toLowerCase(),f=t.filter(d=>d.name.toLowerCase()===l);if(f.length===1)return{item:f[0],tier:"name"};throw f.length>1?new Ea(r,e,f.map(d=>({id:d.id,name:d.name,path:n(d)}))):new Error(`${r.charAt(0).toUpperCase()}${r.slice(1)} "${e}" not found`)}function ix(t,e){let{item:r,tier:n}=qq(t,e,"collection",()=>"");return{collection:r,tier:n}}function sx(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(g=>g.type==="folder"),f=i.join("/"),{item:d,tier:m}=qq(l,o,"folder",g=>f?`${f}/${g.name}`:g.name);i.push(d.name),s.push(m),n=d.items??[]}return{folderPath:i.join("/"),tiers:s}}function $q(t,e,r){let n=[];for(let i of t)if(i.type==="request"){let s=vn(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}/${s.name}`:s.name;$q(s.items??[],o,r)}}function ox(t,e,r){let n=[];$q(t.items,"",n);let i=r?r.replace(/\/+$/,""):void 0,s=i?n.filter(y=>y.folderPath===i||y.folderPath.startsWith(`${i}/`)):n,o=y=>y.folderPath?`${y.folderPath}/${y.item.name}`:y.item.name,l=s.find(y=>y.item.id===e);if(l)return{request:l.item,tier:"id",folderPath:l.folderPath};let f=s.filter(y=>y.slug===e);if(f.length===1)return{request:f[0].item,tier:"slug",folderPath:f[0].folderPath};if(f.length>1)throw new Ea("request",e,f.map(y=>({id:y.item.id,name:y.item.name,path:o(y)})));let d=e.toLowerCase(),m=s.filter(y=>y.item.name.toLowerCase()===d);if(m.length===1)return{request:m[0].item,tier:"name",folderPath:m[0].folderPath};if(m.length>1)throw new Ea("request",e,m.map(y=>({id:y.item.id,name:y.item.name,path:o(y)})));let g=i?` under folder "${i}"`:"";throw new Error(`Request "${e}" not found in collection "${t.name}"${g}`)}var Ea,ax=ae(()=>{"use strict";Fo();Ea=class extends Error{constructor(r,n,i){super(`Ambiguous ${r} reference "${n}" matches ${i.length} items:
|
|
803
|
+
</html>`}}});import*as jt from"fs/promises";import*as Wr from"path";function Lg(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 Tc,rx=oe(()=>{"use strict";yn();xf();tx();Dg();Tc=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=Wr.join(this.basePath,e,s),await jt.mkdir(Wr.join(this.currentRunPath,"results"),{recursive:!0}),await jt.mkdir(Wr.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"),a=It(r.requestId),l=`result-${s}-iter-${i}-${a}.json`,f=Wr.join(this.currentRunPath,"results",l),d={index:this.resultIndex,iteration:e,requestId:r.requestId,name:r.name,method:r.executedRequest.method,url:r.executedRequest.url,folderPath:r.folderPath||"",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(w=>({name:w.name,passed:w.passed,message:w.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(D0(d),null,2),"utf-8");let m=r.assertions.filter(w=>w.passed).length,g=r.assertions.filter(w=>!w.passed).length,y={i:this.resultIndex,it:e,n:r.name,m:ZR[r.executedRequest.method.toUpperCase()]??0,s:r.response.status,d:r.duration,p:r.passed,ap:m,af:g,r:r.requestId,e:r.passed?null:r.error||null,fp:r.folderPath||"",cn:r.collectionName||""};return this.currentIndexPage.push(y),this.currentIndexPage.length>=this.indexPageSize&&await this.writeCurrentIndexPage(),this.updateStats(r),this.requestDurations[r.requestId]||(this.requestDurations[r.requestId]=[]),this.requestDurations[r.requestId].push(r.duration),r.passed||(this.recentErrors.unshift({timestamp:n,iteration:e,requestName:r.name,status:r.response.status,error:r.error||`Status ${r.response.status}`,resultFile:l}),this.recentErrors.length>this.recentErrorsLimit&&this.recentErrors.pop()),y}async finalizeRun(e="completed",r=!0){if(!this.currentManifest)return null;this.currentIndexPage.length>0&&await this.writeCurrentIndexPage(),this.currentManifest.endTime=new Date().toISOString(),this.currentManifest.status=e,this.currentManifest.totalIndexPages=this.currentPageNumber-1,this.currentManifest.stats.totalRequests>0&&(this.currentManifest.stats.avgDuration=Math.round(this.currentManifest.stats.totalDuration/this.currentManifest.stats.totalRequests)),this.currentManifest.stats.minDuration===Number.MAX_SAFE_INTEGER&&(this.currentManifest.stats.minDuration=0);for(let l in this.currentManifest.requestStats){let f=this.currentManifest.requestStats[l],d=this.requestDurations[l]||[];f.count>0&&(f.avgDuration=Math.round(f.totalDuration/f.count)),f.minDuration===Number.MAX_SAFE_INTEGER&&(f.minDuration=0),d.length>0&&(d.sort((m,g)=>m-g),f.p50=Lg(d,50),f.p90=Lg(d,90),f.p95=Lg(d,95),f.p99=Lg(d,99))}this.requestDurations={},await this.saveManifest();let n=null,i=this.currentRunPath,s=this.currentSuiteId,a=this.currentRunId;if(this.currentRunPath=null,this.currentRunId=null,this.currentSuiteId=null,this.currentManifest=null,this.currentIndexPage=[],this.recentErrors=[],this.resultIndex=0,r&&s&&a&&i)try{n=await new wd(this.basePath).generate(s,a)}catch(l){console.warn("[ResultStorage] HTML report generation failed:",l)}return n}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=Wr.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=Wr.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=Wr.join(this.basePath,e,r,"manifest.json"),i=await jt.readFile(n,"utf-8");return JSON.parse(i)}async listRuns(e){let r=Wr.join(this.basePath,e);try{let n=await jt.readdir(r),i=[];for(let s of n.sort().reverse())try{let a=await this.getManifest(e,s);i.push(a)}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=Wr.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,a=await this.listSuites();for(let l of a){let f=await this.listRuns(l);for(let d of f)if(new Date(d.startTime)<n){let m=Wr.join(this.basePath,l,d.runId),g=await this.getDirectorySize(m);await jt.rm(m,{recursive:!0,force:!0}),i++,s+=g}}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=Wr.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=Wr.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=Wr.join(e,i.name);if(i.isDirectory())r+=await this.getDirectorySize(s);else{let a=await jt.stat(s);r+=a.size}}}catch{}return r}}});import*as Ei from"fs";import*as _d from"path";var nx,jg,Rd,Ug,qq=oe(()=>{"use strict";nx=class{watchers=[];constructor(e,r){let n=this.globToPath(e,r);try{let i=Ei.watch(n,{recursive:!0},(s,a)=>{if(a){let l=_d.join(n,a);this.notifyChange(l)}});this.watchers.push(i)}catch{}}globToPath(e,r){return r.includes("**")?e:_d.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=[]}},jg=class{createFileWatcher(e,r){return new nx(e,r)}},Rd=class{data={};storeFile;constructor(e){this.storeFile=e,this.load()}load(){try{if(Ei.existsSync(this.storeFile)){let e=Ei.readFileSync(this.storeFile,"utf-8");this.data=JSON.parse(e)}}catch{}}save(){try{let e=_d.dirname(this.storeFile);Ei.mkdirSync(e,{recursive:!0}),Ei.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()}},Ug=class{async showInformation(e){console.log(`[INFO] ${e}`)}async showWarning(e){console.warn(`[WARN] ${e}`)}async showError(e){console.error(`[ERROR] ${e}`)}}});import*as Ac from"path";function $q(t){let e=Ac.resolve(t.workspaceFolder),{appInfo:r}=t,n=xa.instance;n.clear();let i=Ac.join(e,".http-forge-cache","stores"),s=Ac.join(i,"workspace-state.json"),a=Ac.join(i,"global-state.json"),l={workspaceFolder:e,fileWatcherFactory:new jg,notificationService:new Ug,workspaceStore:new Rd(s),globalStore:new Rd(a),applicationInfo:r||{name:"http-forge-cli",version:"0.1.0"}};return Mg(n,l),n}function as(t){return $q({workspaceFolder:t})}var Hg=oe(()=>{"use strict";GR();KR();qq()});function U9(t){let e=[];return t.map(r=>{let n=vn(r,e);return e.push(n),n})}function Mq(t,e,r,n){let i=t.find(d=>d.id===e);if(i)return{item:i,tier:"id"};let s=U9(t.map(d=>d.name)),a=t.filter((d,m)=>s[m]===e);if(a.length===1)return{item:a[0],tier:"slug"};if(a.length>1)throw new Ea(r,e,a.map(d=>({id:d.id,name:d.name,path:n(d)})));let l=e.toLowerCase(),f=t.filter(d=>d.name.toLowerCase()===l);if(f.length===1)return{item:f[0],tier:"name"};throw f.length>1?new Ea(r,e,f.map(d=>({id:d.id,name:d.name,path:n(d)}))):new Error(`${r.charAt(0).toUpperCase()}${r.slice(1)} "${e}" not found`)}function ix(t,e){let{item:r,tier:n}=Mq(t,e,"collection",()=>"");return{collection:r,tier:n}}function sx(t,e){let r=e.split("/").map(a=>a.trim()).filter(a=>a.length>0),n=t.items,i=[],s=[];for(let a of r){let l=n.filter(g=>g.type==="folder"),f=i.join("/"),{item:d,tier:m}=Mq(l,a,"folder",g=>f?`${f}/${g.name}`:g.name);i.push(d.name),s.push(m),n=d.items??[]}return{folderPath:i.join("/"),tiers:s}}function Nq(t,e,r){let n=[];for(let i of t)if(i.type==="request"){let s=vn(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,a=e?`${e}/${s.name}`:s.name;Nq(s.items??[],a,r)}}function ox(t,e,r){let n=[];Nq(t.items,"",n);let i=r?r.replace(/\/+$/,""):void 0,s=i?n.filter(y=>y.folderPath===i||y.folderPath.startsWith(`${i}/`)):n,a=y=>y.folderPath?`${y.folderPath}/${y.item.name}`:y.item.name,l=s.find(y=>y.item.id===e);if(l)return{request:l.item,tier:"id",folderPath:l.folderPath};let f=s.filter(y=>y.slug===e);if(f.length===1)return{request:f[0].item,tier:"slug",folderPath:f[0].folderPath};if(f.length>1)throw new Ea("request",e,f.map(y=>({id:y.item.id,name:y.item.name,path:a(y)})));let d=e.toLowerCase(),m=s.filter(y=>y.item.name.toLowerCase()===d);if(m.length===1)return{request:m[0].item,tier:"name",folderPath:m[0].folderPath};if(m.length>1)throw new Ea("request",e,m.map(y=>({id:y.item.id,name:y.item.name,path:a(y)})));let g=i?` under folder "${i}"`:"";throw new Error(`Request "${e}" not found in collection "${t.name}"${g}`)}var Ea,ax=oe(()=>{"use strict";Fo();Ea=class extends Error{constructor(r,n,i){super(`Ambiguous ${r} reference "${n}" matches ${i.length} items:
|
|
804
804
|
`+i.map(s=>` - ${s.name} (id: ${s.id}, path: ${s.path||"/"})`).join(`
|
|
805
805
|
`)+`
|
|
806
|
-
Disambiguate by passing the id or slug.`);this.kind=r;this.value=n;this.candidates=i;this.name="AmbiguousRefError"}kind;value;candidates}});var Cd={};ks(Cd,{runCollection:()=>xd,runFolder:()=>W9,runRequest:()=>ux,runSuite:()=>fx});function lx(t){let e=[t.testSuite,t.collection,t.environmentConfig,t.config,t.console];for(let r of e)try{r?.dispose?.()}catch{}}function Nq(t){return t==="1"||t==="true"||t==="yes"||t==="on"}function j9(){return Nq(process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS)}function U9(){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 Dq(t){return Nq(process.env.HTTP_FORGE_GENERATE_REPORTS)?!0:t.includes("report")}function Fq(t){if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}}function H9(t){return t?Object.fromEntries(Object.entries(t).filter(([e])=>e.toLowerCase()!=="set-cookie")):{}}function Lq(t){return Zi(H9(t))}function jq(t){return q0((t??[]).map(e=>({name:e.name,value:e.value})))}function Mq(t){return t.replace(/[^a-zA-Z0-9_-]/g,"_")}function Uq(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 Hq(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 Bq(t){return t?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,String(r)])):{}}function cx(t,e,r=t.items,n=[]){for(let i of r){if(i.type==="request"&&i.id===e)return{request:i,folderScriptsChain:[...n]};if(i.type==="folder"){let s=i,o=s.scripts?[...n,s.scripts]:[...n],l=cx(t,e,s.items??[],o);if(l)return l}}}function Vq(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.join("/")});else{let o=s,l=o.scripts?[...r,o.scripts]:[...r],f=[...n,o.name];i.push(...Vq(t,o.items??[],l,f))}return i}function B9(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 V9(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Wq(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}=ix(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 zq(t,e){if(e.folderPath)return e.folderPath;if(e.folderRef){let{folderPath:r}=sx(t,e.folderRef);return e.onResolve?.({kind:"folder",value:e.folderRef,tier:"name",id:r,path:r}),r}}async function Jq(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=r.requestFilter,d=r.include??[],m=Bq(r.variables),g=j9(),y=Dq(d),w=e.requests.filter(_=>!(_.enabled===!1||f&&!f.some(k=>_.name.toLowerCase().includes(k.toLowerCase()))));if(g){let _=U9(),k=w.length*s;if(k>_)throw new Error(`Suite "${e.name}" would execute ${k} request calls (${w.length} requests \xD7 ${s} iterations), which exceeds HTTP_FORGE_MAX_REQUESTS (${_}). Reduce iterations, use requestFilter, or increase HTTP_FORGE_MAX_REQUESTS.`)}let C=new Tc(t.config);await C.initializeRun(e.id,e.name,i,{iterations:s,delayBetweenRequests:l,stopOnError:o});let R=[],P=[],A=0,U=0,B=new AbortController,z=new Oc;for(let _=1;_<=s;_++){for(let k of w){let M=t.collection.getCollection(k.collectionId);if(!M)continue;let j=cx(M,k.requestId);if(!j)continue;let $=new Hs(t.httpRequest,t.scriptExecutor,t.environmentConfig,t.requestPreparer,i,z,M.scripts,j.folderScriptsChain,void 0,M.name,_,s),Y=Hq(Uq(j.request),{headers:r.headers,query:r.query,body:r.body,variables:r.variables}),K=await $.execute(Y,m,B.signal);if(K.folderPath=k.folderPath??"",K.collectionName=M.name,await C.saveResult(_,K),K.passed?A++:U++,d.includes("perRequest")&&R.push({name:k.name,iteration:_,status:K.response?.status,ok:(K.response?.status??0)>=200&&(K.response?.status??0)<300,duration:`${K.duration}ms`,allPassed:K.passed,...d.includes("consoleOutput")&&K.consoleOutput?.length?{consoleOutput:K.consoleOutput}:{}}),!K.passed&&(P.push({name:k.name,iteration:_,status:K.response?.status,duration:`${K.duration}ms`,body:Fq(K.response?.body),headers:Lq(K.response?.headers),cookies:jq(K.response?.cookies),failedTests:K.assertions?.filter(ne=>!ne.passed).map(ne=>({name:ne.name,...ne.message?{message:ne.message}:{}})),...K.error?{error:K.error}:{},...d.includes("consoleOutput")&&K.consoleOutput?.length?{consoleOutput:K.consoleOutput}:{}}),o)){B.abort();break}l>0&&!B.signal.aborted&&await new Promise(ne=>setTimeout(ne,l))}if(B.signal.aborted)break}let V=await C.finalizeRun("completed",y),T={[n==="collection"?"collection":"suite"]:e.name,environment:i,summary:{total:A+U,passed:A,failed:U,...s>1?{iterations:s}:{},allPassed:U===0}};return(U>0||d.includes("failedOnly"))&&(T.failedRequests=P),d.includes("perRequest")&&(T.results=R),V!==null&&(T.report={uri:`file://${V}`,hint:"Click the URI to open the HTML report in your browser"}),T}async function ux(t){let e=as(t.workspaceFolder),r=t.include??[],n=Dq(r);try{let i=e.collection,s=Wq(i,t),o=zq(s,t),l=t.requestId;if(!l){if(!t.requestRef)throw new Error("A request reference is required (requestId or requestRef)");let P=ox(s,t.requestRef,o);l=P.request.id,t.onResolve?.({kind:"request",value:t.requestRef,tier:P.tier,id:l,path:P.folderPath?`${P.folderPath}/${P.request.name}`:P.request.name})}let f=cx(s,l);if(!f)throw new Error(`Request "${l}" not found in collection "${s.name}"`);let d=t.environment||e.environmentConfig.getSelectedEnvironment(),m=Hq(Uq(f.request),{headers:t.headers,query:t.query,body:t.body,variables:t.variables}),y=await new Hs(e.httpRequest,e.scriptExecutor,e.environmentConfig,e.requestPreparer,d,new Oc,s.scripts,f.folderScriptsChain).execute(m,Bq(t.variables)),w=null;if(n){let P=new Tc(e.config),A=`request-${Mq(s.id)}-${Mq(l)}`,U=`Request: ${f.request.name}`;await P.initializeRun(A,U,d,{iterations:1,delayBetweenRequests:0,stopOnError:!0}),await P.saveResult(1,y),w=await P.finalizeRun("completed")}let C=Lq(y.response?.headers),R=jq(y.response?.cookies);return{request:f.request.name,status:y.response?.status||0,ok:(y.response?.status??0)>=200&&(y.response?.status??0)<300,duration:`${y.duration}ms`,body:Fq(y.response?.body),allPassed:y.passed,assertions:y.assertions?.map(P=>({name:P.name,passed:P.passed,message:P.message})),...r.includes("headers")?{headers:C}:{},...r.includes("cookies")?{cookies:R}:{},...r.includes("tests")?{tests:y.assertions?.map(P=>({name:P.name,passed:P.passed,...P.message?{message:P.message}:{}}))}:{},...Object.keys(y.modifiedVariables??{}).length?{modifiedVariables:y.modifiedVariables}:{},...r.includes("consoleOutput")&&y.consoleOutput?.length?{consoleOutput:y.consoleOutput}:{},...w!==null?{report:{uri:`file://${w}`,hint:"Click the URI to open the HTML report in your browser"}}:{},...y.error?{error:y.error}:{}}}catch(i){throw i}finally{lx(e)}}async function xd(t){let e=as(t.workspaceFolder);try{let r=e.collection,n=Wq(r,t),i=zq(n,t),s=Vq(n),o=B9(s,i,t.recursive);if(o.length===0&&i)throw new Error(`No requests found under folder "${i}" in collection "${n.name}"`);let l=o.map(({request:d,folderPath:m})=>({id:d.id,slug:d.id.toLowerCase().replace(/\s+/g,"-"),collectionId:n.id,requestId:d.id,name:d.name,method:d.method,collectionName:n.name,folderPath:m,enabled:!0})),f={id:i?`temp-${n.id}-${V9(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 Jq(e,f,{environment:t.environment,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,requestFilter:void 0,include:t.include,variables:t.variables},"collection")}catch(r){throw r}finally{lx(e)}}async function W9(t){return xd({recursive:!0,...t})}async function fx(t){let e=as(t.workspaceFolder);try{let n=await e.testSuite.getSuite(t.suiteId);if(!n)throw new Error(`Test suite "${t.suiteId}" not found`);return Jq(e,n,{environment:t.environment,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,requestFilter:t.requestFilter,include:t.include,variables:t.variables},"suite")}catch(r){throw r}finally{lx(e)}}var qc=ae(()=>{"use strict";QR();Jh();xf();rx();Hg();ax()});var e$={};ks(e$,{createMcpRuntime:()=>l8});import*as Kq from"fs";import{createServer as z9}from"http";import*as Ed from"path";function Q9(t){return Buffer.from(t,"utf8").toString("base64url")}function Z9(t){return Buffer.from(t,"base64url").toString("utf8")}async function Bg(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 Qq(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=r?`${r} / ${s.name}`:s.name;n.push(...Qq(t,s.items??[],o))}return n}function Zq(t,e=t.items,r=""){let n=[];for(let i of e)if(i.type==="folder"){let s=i,o=r?`${r}/${s.name}`:s.name;n.push({folderPath:o,requestCount:Xq(s.items??[])}),n.push(...Zq(t,s.items??[],o))}return n}function Xq(t){let e=0;for(let r of t)r.type==="request"?e++:e+=Xq(r.items??[]);return e}async function e8(t){let e=as(t),r=e.config.getMcpConfig(),n=r.toolPrefix??"",i=[],s=e.collection.getAllCollections();for(let l of s){let f=r.excludedCollections;if(f?.length&&(f.includes(l.id)||f.includes(l.name)))continue;let d=Qq(l);for(let{request:m,folderPath:g}of d){let y=g?`${g} / ${m.name}`:m.name;i.push({name:`${n}request__${l.id}__${m.id}`,description:`[${m.method}] ${y} (collection: ${l.name})`,inputSchema:Y9})}i.push({name:`${n}collection__${l.id}`,description:`Run all requests in collection: "${l.name}" (${d.length} requests)`,inputSchema:G9});for(let{folderPath:m,requestCount:g}of Zq(l))g!==0&&i.push({name:`${n}folder__${l.id}__${Q9(m)}`,description:`Run folder "${m}" in collection: "${l.name}" (${g} requests)`,inputSchema:K9})}let o=await e.testSuite.getAllSuites();for(let l of o){let f=r.excludedSuites;f?.length&&(f.includes(l.id)||f.includes(l.name))||i.push({name:`${n}suite__${l.id}`,description:`Run test suite: "${l.name}" (${l.requests.length} requests, ${l.config.iterations} iteration(s) by default)`,inputSchema:X9})}return i}function t8(t,e){let n=as(t).config.getMcpConfig().toolPrefix??"";return n&&e.startsWith(n)?e.slice(n.length):e}function r8(t,e,r){return t.replace(/"uri"\s*:\s*"file:\/\/([^"]+)"/g,(n,i)=>`"uri":"http://${e}:${r}/report?path=${encodeURIComponent(i)}"`)}function Yq(t,e,r,n){Oa(t,200,{jsonrpc:"2.0",id:e,error:{code:r,message:n}})}async function n8(t,e){switch(e.method){case"initialize":return{protocolVersion:"2024-11-05",capabilities:{tools:{}},serverInfo:{name:"http-forge",version:"1.0.0"}};case"tools/list":return{tools:await e8(t.workspaceFolder)};case"tools/call":{let r=e.params??{},n=r.name,i=r.arguments;if(!n)throw new Error("Missing tool name");let s=await dx(t.workspaceFolder,n,i??{}),o=JSON.stringify(s,null,2);return{content:[{type:"text",text:r8(o,t.host,t.port)}]}}default:throw new Error(`Method not found: ${e.method}`)}}function i8(t,e,r){let i=as(t.workspaceFolder).config.getMcpConfig().cors.allowedOrigins??["http://localhost","http://127.0.0.1"],s=e.headers.origin??"",o=i.includes(s)?s:i[0]??"http://localhost";r.setHeader("Access-Control-Allow-Origin",o),r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS"),r.setHeader("Access-Control-Allow-Headers","Content-Type")}function s8(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=Ed.resolve(i),o=Ed.resolve(t.workspaceFolder,".http-forge-cache");if(!s.startsWith(o+Ed.sep)||!s.endsWith(".html")){r.statusCode=403,r.end("Forbidden");return}Kq.readFile(s,"utf-8",(l,f)=>{if(l){r.statusCode=404,r.end("Report not found");return}r.statusCode=200,r.setHeader("content-type","text/html; charset=utf-8"),r.end(f)})}function $c(t){return new Error(`Bad request: ${t}`)}function o8(t){if(t.startsWith("request__")){let[,e,r]=t.split("__");if(!e||!r)throw $c(`request tool format must be request__<collectionId>__<requestId>, got: ${t}`);return{kind:"request",id1:e,id2:r}}if(t.startsWith("folder__")){let e=t.indexOf("__"),r=t.indexOf("__",e+2),n=r>=0?t.slice(e+2,r):"",i=r>=0?t.slice(r+2):"";if(!n||!i)throw $c(`folder tool format must be folder__<collectionId>__<encodedPath>, got: ${t}`);return{kind:"folder",id1:n,id2:Z9(i)}}if(t.startsWith("collection__")){let[,e]=t.split("__");if(!e)throw $c(`collection tool format must be collection__<collectionId>, got: ${t}`);return{kind:"collection",id1:e}}if(t.startsWith("suite__")){let[,e]=t.split("__");if(!e)throw $c(`suite tool format must be suite__<suiteId>, got: ${t}`);return{kind:"suite",id1:e}}throw $c(`unknown tool name: ${t}`)}async function dx(t,e,r={}){let n=o8(t8(t,e));return n.kind==="request"?Bg(()=>ux({workspaceFolder:t,collectionId:n.id1,requestId:n.id2,environment:r.environment,variables:r.variables,headers:r.headers,query:r.query,body:r.body,include:r.include})):n.kind==="collection"?Bg(()=>xd({workspaceFolder:t,collectionId:n.id1,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include})):n.kind==="folder"?Bg(()=>xd({workspaceFolder:t,collectionId:n.id1,folderPath:n.id2,recursive:r.recursive,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include})):Bg(()=>fx({workspaceFolder:t,suiteId:n.id1,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,requestFilter:r.requestFilter,include:r.include}))}function Oa(t,e,r){t.statusCode=e,t.setHeader("content-type","application/json; charset=utf-8"),t.end(JSON.stringify(r))}function Gq(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($c("invalid JSON body"))}}),t.on("error",r)})}function a8(t){return z9(async(e,r)=>{try{if(i8(t,e,r),e.method==="OPTIONS"){r.statusCode=204,r.end();return}if(e.method==="GET"&&e.url==="/health"){Oa(r,200,{status:"ok",port:t.port});return}if(e.method==="GET"&&e.url?.startsWith("/report?")){s8(t,e,r);return}if(e.method==="POST"&&e.url==="/"){let n;try{n=await Gq(e)}catch{Yq(r,null,-32700,"Parse error");return}try{let i=await n8(t,n);Oa(r,200,{jsonrpc:"2.0",id:n.id??null,result:i})}catch(i){Yq(r,n.id??null,-32603,i.message||"Internal error")}return}if(e.method==="POST"&&e.url==="/tools/execute"){let n=await Gq(e);if(!n||typeof n.name!="string"||n.name.trim()===""){Oa(r,400,{error:'Field "name" is required'});return}let i=await dx(t.workspaceFolder,n.name,n.args??{});Oa(r,200,{result:i});return}Oa(r,405,{error:"Method not allowed"})}catch(n){Oa(r,500,{error:n.message})}})}async function l8(t){let e=t.port||3100,r=t.host||"127.0.0.1",n=`${r}:${e}`,i={workspaceFolder:t.workspaceFolder,port:e,host:r,isRunning:!1};return J9.set(n,i),{async start(){if(i.isRunning)return;let s=a8(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.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 dx(i.workspaceFolder,s,o??{})}}}var J9,Y9,G9,K9,X9,t$=ae(()=>{"use strict";qc();Hg();J9=new Map,Y9={type:"object",properties:{environment:{type:"string",description:"Environment name to use (defaults to selected environment)"},variables:{type:"object",description:"Extra variables to inject",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 request body (JSON string)"},include:{type:"array",items:{type:"string",enum:["headers","cookies","tests","consoleOutput","report"]},description:"Extra fields to include in response"}}},G9={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},variables:{type:"object",description:"Extra variables for every request",additionalProperties:{type:"string"}},iterations:{type:"number",description:"Number of iterations (default: 1)"},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"}}},K9={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},variables:{type:"object",description:"Extra variables for every request",additionalProperties:{type:"string"}},iterations:{type:"number",description:"Number of iterations (default: 1)"},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"}}};X9={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},iterations:{type:"number",description:"Number of iterations"},stopOnError:{type:"boolean",description:"Stop on first failure"},delay:{type:"number",description:"Delay between requests in ms"},variables:{type:"object",description:"Extra variables for every request",additionalProperties:{type:"string"}},requestFilter:{type:"array",items:{type:"string"},description:"Run requests matching names"},include:{type:"array",items:{type:"string",enum:["perRequest","failedOnly","consoleOutput","report"]},description:"Result detail level"}}}});var bl=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()}};zp();Fo();function pb(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(zC),source:{format:"folder",filePath:e,version:t.version}}}function zC(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(zC)};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}}}function pL(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(hb)}}function hb(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(hb)}:{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}}}var bu=class{store;constructor(e){this.store=new Ts(e)}loadAll(){return this.store.loadAll().map(r=>pb(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 pb(r,this.store.getCollectionPath(r.id))}async create(e,r){let n=await this.store.create(e,r);return pb(n,this.store.getCollectionPath(n.id))}async save(e){return this.store.save(pL(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,hb(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 Su=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()}};Sl();var wu=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 dt.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 dt.parseCookieHeaders(e,r)}isExpired(e){return dt.isExpired(e)}domainMatches(e,r){return dt.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)}};Gp();var Bi=class t{config;selectedEnvironment;sessionGlobals={};sessionEnvironmentValues=new Map;constructor(e){this.config=e,this.selectedEnvironment=e.selectedEnvironment||Object.keys(e.environments)[0]||"default"}get(e){return this.getVariables()[e]}set(e,r){let n=this.sessionEnvironmentValues.get(this.selectedEnvironment);n||(n={},this.sessionEnvironmentValues.set(this.selectedEnvironment,n)),n[e]=r}getAll(){return this.getVariables()}getEnvironments(){return Object.keys(this.config.environments)}getActive(){return this.selectedEnvironment}setActive(e){if(!this.config.environments[e])throw new Error(`Environment not found: ${e}`);this.selectedEnvironment=e}getVariables(e){let r=e||this.selectedEnvironment,n=this.config.environments[r],i={...this.config.globalVariables||{},...this.sessionGlobals};if(n){if(n.inherits&&this.config.environments[n.inherits]){let o=this.getEnvironmentVariables(n.inherits);i={...i,...o}}i={...i,...n.variables};let s=this.sessionEnvironmentValues.get(r);s&&(i={...i,...s})}return i}getEnvironmentVariables(e){let r=this.config.environments[e];if(!r)return{};let n={};return r.inherits&&this.config.environments[r.inherits]&&(n={...this.getEnvironmentVariables(r.inherits)}),{...n,...r.variables}}getGlobals(){return{...this.config.globalVariables||{},...this.sessionGlobals}}setGlobal(e,r){this.sessionGlobals[e]=r}unsetGlobal(e){delete this.sessionGlobals[e]}clearGlobals(){this.sessionGlobals={}}resolve(e){let r=e||this.selectedEnvironment;return{name:r,merged:this.getVariables(r),globals:this.getGlobals()}}static fromVariables(e,r="default"){return new t({environments:{[r]:{name:r,variables:e}},selectedEnvironment:r})}};wl();Eu();var qs=class t{envStore;interpolator;urlBuilder;constructor(e,r){this.envStore=e,this.interpolator=r||new Vo,this.urlBuilder=new Hn}get(e){return this.envStore.get(e)}set(e,r){this.envStore.set(e,r)}has(e){return this.envStore.get(e)!==void 0}delete(e){this.envStore.set(e,"")}getAll(){return this.envStore.getAll()}getActiveEnvironment(){return this.envStore.getActive()}setActiveEnvironment(e){this.envStore.setActive(e)}getEnvironments(){let e=this.envStore;return typeof e.getEnvironments=="function"?e.getEnvironments():[]}getGlobals(){let e=this.envStore;return typeof e.getGlobals=="function"?e.getGlobals():{}}setGlobal(e,r){let n=this.envStore;typeof n.setGlobal=="function"&&n.setGlobal(e,r)}unsetGlobal(e){let r=this.envStore;typeof r.unsetGlobal=="function"&&r.unsetGlobal(e)}clearGlobals(){let e=this.envStore;typeof e.clearGlobals=="function"&&e.clearGlobals()}resolve(e){return this.interpolator.interpolate(e,this.getAll())}resolvePath(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r)}buildUrl(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r.params||{},r.query||{})}resolveObject(e){return this.interpolator.interpolateObject(e,this.getAll())}extractVariables(e){return this.interpolator.extractVariables(e)}extractPathParams(e){return this.urlBuilder.extractPathParams(e)}static create(e={}){let r=Bi.fromVariables(e);return new t(r)}static fromResolver(e){return new t(e)}};Eu();Pu();ku();wl();uf();var Hl=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?[it("path").join(s.forgeRoot,"modules")]:[],l=new Wi(new Hn,new zi,e);this.scriptExecutor=new Qi(l,o,void 0,s?.scriptScope??"shared")}}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},d=this.buildHttpRequest(e,n.overrides),m=this.findFolderPath(r,e.id),g=this.buildScriptChain(e,r,m),y={request:{url:d.url,method:d.method,headers:{...d.headers},body:d.body?typeof d.body=="string"?{type:"raw",content:d.body}:d.body: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:(P,A,U)=>{P==="set"&&A&&U!==void 0?this.forgeEnv.setGlobal(A,U):P==="unset"&&A?this.forgeEnv.unsetGlobal(A):P==="clear"&&this.forgeEnv.clearGlobals()}},w=this.scriptExecutor.createRequestSession(y),C,R;try{if(!n.skipPreRequest&&g.preRequest.length>0){let B=await w.executePreRequest(g.preRequest);if(C={success:B.success,error:B.error,modifiedVariables:B.modifiedVariables,modifiedEnvironment:B.modifiedEnvironmentVariables,modifiedGlobals:B.modifiedGlobals,modifiedCollectionVariables:B.modifiedCollectionVariables,consoleOutput:B.consoleOutput,modifiedRequest:B.modifiedRequest?{url:B.modifiedRequest.url,method:B.modifiedRequest.method,headers:B.modifiedRequest.headers,body:B.modifiedRequest.body?.content}:void 0},B.modifiedVariables&&(l={...l,...B.modifiedVariables}),B.modifiedEnvironmentVariables&&(f={...f,...B.modifiedEnvironmentVariables}),B.modifiedRequest){let z=B.modifiedRequest;z.url&&(d.url=z.url),z.method&&(d.method=z.method),z.headers&&(d.headers={...d.headers,...z.headers}),z.body!==void 0&&(d.body=z.body?.content||z.body)}if(!B.success)throw new Error(`Pre-request script failed: ${B.error}`)}let P={...f,...l};d=this.interpolateRequest(d,P);let A=n.overrides?.body||e.body;if(this.preprocessor&&A&&typeof A!="string"&&A.type==="graphql"&&d.body!==void 0){let B=this.preprocessor.encodeBody({type:"graphql",content:d.body});B!=null&&(d.body=typeof B=="string"?B:JSON.stringify(B))}let U=await this.httpClient.send(d);if(!n.skipPostResponse&&g.postResponse.length>0){let B=await w.executePostResponse(g.postResponse,{status:U.status,statusText:U.statusText,headers:U.headers,body:U.body,cookies:Object.fromEntries(U.cookies.map(z=>[z.name,z.value])),responseTime:U.time,responseSize:U.size,executedRequest:{url:d.url,method:d.method,headers:d.headers||{},body:d.body?typeof d.body=="string"?{type:"raw",content:d.body}:d.body:{type:"none",content:""},params:{},query:{}}});R={success:!0,assertions:B.testResults,consoleOutput:B.consoleOutput,modifiedEnvironment:B.modifiedEnvironmentVariables},B.modifiedEnvironmentVariables&&(f={...f,...B.modifiedEnvironmentVariables})}return{response:U,preRequestResult:C,postResponseResult:R,totalTime:Date.now()-i,finalRequest:d,variables:{environment:f,local:l}}}finally{w.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 m=new URLSearchParams;for(let g of e.query)g.enabled!==!1&&m.append(g.key,g.value);n+=(n.includes("?")?"&":"?")+m.toString()}let i=r?.url||n,s=r?.method||e.method,o={};if(e.headers&&Array.isArray(e.headers))for(let m of e.headers)m.enabled!==!1&&(o[m.key]=m.value);let l={...o,...r?.headers||{}},f,d=r?.body||e.body;if(d)if(typeof d=="string")f=d;else if(this.preprocessor&&d.type)if(d.type==="graphql")f=typeof d.content=="string"?d.content:JSON.stringify(d.content);else{let m=this.preprocessor.encodeBody(d);f=m!=null?String(m):void 0}else d.content&&(f=typeof d.content=="string"?d.content:JSON.stringify(d.content));return this.preprocessor&&d&&this.preprocessor.setContentTypeHeader(l,d),{url:i,method:s,headers:l,body:f,timeout:r?.timeout||e.settings?.timeout,settings:{...e.settings,...r?.settings}}}interpolateRequest(e,r){let n=qs.create(r);return{...e,url:n.resolvePath(e.url),headers:n.resolveObject(e.headers),body:e.body?n.resolve(typeof e.body=="string"?e.body:JSON.stringify(e.body)):void 0}}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 DV(){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 ff=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=DV(),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 d=this.requestIndex.get(e)||[];for(d.unshift(o);d.length>this.maxEntriesPerRequest;){let m=d.pop();m&&(this.entries.delete(m),this.fullResponses.delete(m))}if(this.requestIndex.set(e,d),this.storeFullResponses){let m={timestamp:l,status:n.status,statusText:n.statusText,headers:{...n.headers},cookies:n.cookies||[],body:n.body,time:n.time};this.fullResponses.set(o,m)}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 df=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(),d=l.headers.get("content-type")||"",m;try{d.includes("application/json")?m=await l.json():d.includes("text/")?m=await l.text():m=await l.text()}catch{m=null}let g={};return l.headers.forEach((y,w)=>{let C=g[w];C!==void 0?g[w]=Array.isArray(C)?[...C,y]:[C,y]:g[w]=y}),{status:l.status,statusText:l.statusText,headers:g,cookies:[],body:m,time:f-r}}catch(o){throw o.name==="AbortError"?new Error(`Request timeout after ${i}ms`):o}finally{clearTimeout(s)}}};Pu();ku();Iu();Hh();wl();var sa=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}}};Bh();import*as rn from"fs/promises";import*as Bl from"path";var pf=class{async readFile(e){return rn.readFile(e,"utf-8")}async writeFile(e,r){let n=Bl.dirname(e);await this.mkdir(n),await rn.writeFile(e,r,"utf-8")}async exists(e){try{return await rn.access(e),!0}catch{return!1}}async mkdir(e){await rn.mkdir(e,{recursive:!0})}async glob(e,r){let n=r||process.cwd(),i=[];try{await this.walkDirectory(n,s=>{let o=Bl.basename(s);for(let l of e)if(this.matchPattern(o,l)){i.push(s);break}})}catch{}return i}async readDir(e){return rn.readdir(e)}async isDirectory(e){try{return(await rn.stat(e)).isDirectory()}catch{return!1}}async walkDirectory(e,r){let n=await rn.readdir(e,{withFileTypes:!0});for(let i of n){let s=Bl.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)}};uf();var y0=class t{httpClient;fileSystem;scriptExecutor;interpolator;cookieJar;interceptorChain;preprocessor;dataFileParser;requestHistory;parserRegistry;collectionLoader;environmentStore;forgeEnv;requestExecutor;options;constructor(e={}){if(this.options=e,this.interpolator=e.interpolator||new Vo,this.fileSystem=e.fileSystem||new pf,this.preprocessor=e.preprocessor||new ia,this.dataFileParser=e.dataFileParser||new oa,this.cookieJar=e.cookieJar||new wu,e.enableHistory?this.requestHistory=e.requestHistory||new ff({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 Wo(s)}else this.httpClient=new df;let r=e.forgeRoot?[it("path").join(e.forgeRoot,"modules")]:[],n=new Wi(new Hn,this.interceptorChain,this.httpClient);if(this.scriptExecutor=e.scriptExecutor||new Qi(n,r,void 0,e.scriptScope??"shared"),this.parserRegistry=new Su,this.parserRegistry.register("http-forge",new sa),(e.storageFormat??"folder")==="folder"&&e.forgeRoot){let s=it("path").join(e.forgeRoot,"collections");this.collectionLoader=new bu(s)}else this.collectionLoader=new bl(this.fileSystem,this.parserRegistry);this.environmentStore=e.environmentConfig?new Bi(e.environmentConfig):Bi.fromVariables({}),this.forgeEnv=qs.fromResolver(this.environmentStore),this.requestExecutor=new Hl(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:e.forgeRoot,scriptExecutor:this.scriptExecutor})}createInterceptorChain(e){let r=new zi;if(e.requestInterceptors)for(let n of e.requestInterceptors)r.addRequestInterceptor(n);if(e.responseInterceptors)for(let n of e.responseInterceptors)r.addResponseInterceptor(n);if(e.errorInterceptors)for(let n of e.errorInterceptors)r.addErrorInterceptor(n);return r}async loadCollection(e){if(this.collectionLoader instanceof bl)return this.collectionLoader.load(e);throw new Error("loadCollection(filePath) is not supported with folder storage format. Use loadAllCollections() instead.")}async loadAllCollections(){return this.collectionLoader.loadAll()}async execute(e,r,n){return this.requestExecutor.execute(e,r,n)}async executeSimple(e,r){return this.requestExecutor.executeSimple(e,r)}registerParser(e,r){this.parserRegistry.register(e,r)}setEnvironmentConfig(e){this.environmentStore=new Bi(e),this.forgeEnv=qs.fromResolver(this.environmentStore),this.requestExecutor=new Hl(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=it("path"),i=n.join(e,"environments"),s,o=_u(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,d]of Object.entries(o.environments)){let m=o.localCredentials[f]?.variables||{};s.environments[f]={name:f,variables:{...d.variables,...m}}}}else{let f=it("fs"),d=n.join(i,"environments.json");if(f.existsSync(d))try{let m=f.readFileSync(d,"utf-8"),g=JSON.parse(m);if(s={globalVariables:g.globalVariables||{},environments:{},selectedEnvironment:g.selectedEnvironment},g.environments)for(let[y,w]of Object.entries(g.environments)){let C=w;s.environments[y]={name:C.name||y,variables:C.variables||{}}}}catch(m){console.warn(`[ForgeContainer] Failed to load environments from ${d}:`,m)}}return new t({...r,forgeRoot:e,storageFormat:r.storageFormat??"folder",environmentConfig:s})}};GR();KR();$g();async function c8(t){let{createMcpRuntime:e}=await Promise.resolve().then(()=>(t$(),e$));return e(t)}async function u8(t){let{runRequest:e}=await Promise.resolve().then(()=>(qc(),Cd));return e(t)}async function f8(t){let{runCollection:e}=await Promise.resolve().then(()=>(qc(),Cd));return e(t)}async function d8(t){let{runFolder:e}=await Promise.resolve().then(()=>(qc(),Cd));return e(t)}async function p8(t){let{runSuite:e}=await Promise.resolve().then(()=>(qc(),Cd));return e(t)}Hg();E0();Sl();QR();O0();Pu();ku();vb();Iu();Hh();wl();c0();h0();uf();Lh();Uh();xf();w0();R0();zp();Fo();Fo();S0();ax();P0();Gp();Eu();Jh();k0();F0();v0();function h8(t,e,r){let n=t.slice(0,e),i=n.match(/([a-zA-Z_]\w*)$/),s=i?i[1]:"",o=R8(n);if(o.trimEnd().endsWith("@")||s&&o.trimEnd().endsWith("@"+s))return{contextType:"directive",fieldPath:[],prefix:s};if(x8(o))return{contextType:"variable_def",fieldPath:[],prefix:s};let l=o.match(/\.\.\.\s+on\s+(\w*)$/);if(l)return{contextType:"fragment_type",fieldPath:[],prefix:l[1]||""};let f=o.match(/\(\s*(?:[\w]+\s*:\s*(?:"[^"]*"|[^,)]+)\s*,\s*)*(\w+)\s*:\s*(\w*)$/);if(f&&r$(o)){let g=px(o,r),y=g.length>0?g[g.length-1]:void 0,w=n$(o);return{contextType:"argument_value",fieldPath:g,parentType:y,prefix:f[2]||"",currentArg:f[1],currentField:w||void 0}}if(r$(o)){let g=px(o,r),y=g.length>0?g[g.length-1]:void 0,w=n$(o);return{contextType:"argument",fieldPath:g,parentType:y,prefix:s,currentField:w||void 0}}if(hx(o,"{","}")===0)return{contextType:"root",fieldPath:[],prefix:s};let m=px(o,r);return{contextType:"selection_set",fieldPath:m,parentType:m.length>0?m[m.length-1]:void 0,prefix:s}}function m8(t,e){switch(e.contextType){case"root":return g8(t,e.prefix);case"selection_set":return y8(t,e);case"argument":return v8(t,e);case"argument_value":return b8(t,e);case"directive":return S8(t,e.prefix);case"fragment_type":return w8(t,e.prefix);case"variable_def":return _8(t,e.prefix);default:return[]}}function g8(t,e){let r=[],n=[{label:"query",detail:"Query operation",insertText:`query \${1:OperationName} {
|
|
806
|
+
Disambiguate by passing the id or slug.`);this.kind=r;this.value=n;this.candidates=i;this.name="AmbiguousRefError"}kind;value;candidates}});var Cd={};ks(Cd,{runCollection:()=>xd,runFolder:()=>J9,runRequest:()=>ux,runSuite:()=>fx});function lx(t){let e=[t.testSuite,t.collection,t.environmentConfig,t.config,t.console];for(let r of e)try{r?.dispose?.()}catch{}}function Fq(t){return t==="1"||t==="true"||t==="yes"||t==="on"}function H9(){return Fq(process.env.HTTP_FORGE_ENFORCE_MAX_REQUESTS)}function B9(){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 Lq(t){return Fq(process.env.HTTP_FORGE_GENERATE_REPORTS)?!0:t.includes("report")}function jq(t){if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}}function V9(t){return t?Object.fromEntries(Object.entries(t).filter(([e])=>e.toLowerCase()!=="set-cookie")):{}}function Uq(t){return Zi(V9(t))}function Hq(t){return q0((t??[]).map(e=>({name:e.name,value:e.value})))}function Dq(t){return t.replace(/[^a-zA-Z0-9_-]/g,"_")}function Bq(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 Vq(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 Wq(t){return t?Object.fromEntries(Object.entries(t).map(([e,r])=>[e,String(r)])):{}}function cx(t,e,r=t.items,n=[]){for(let i of r){if(i.type==="request"&&i.id===e)return{request:i,folderScriptsChain:[...n]};if(i.type==="folder"){let s=i,a=s.scripts?[...n,s.scripts]:[...n],l=cx(t,e,s.items??[],a);if(l)return l}}}function zq(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.join("/")});else{let a=s,l=a.scripts?[...r,a.scripts]:[...r],f=[...n,a.name];i.push(...zq(t,a.items??[],l,f))}return i}function W9(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 z9(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Jq(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}=ix(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 Yq(t,e){if(e.folderPath)return e.folderPath;if(e.folderRef){let{folderPath:r}=sx(t,e.folderRef);return e.onResolve?.({kind:"folder",value:e.folderRef,tier:"name",id:r,path:r}),r}}async function Gq(t,e,r,n){let i=r.environment??t.environmentConfig.getSelectedEnvironment(),s=r.iterations??e.config?.iterations??1,a=r.stopOnError??e.config?.stopOnError??!1,l=r.delay??e.config?.delayBetweenRequests??0,f=r.requestFilter,d=r.include??[],m=Wq(r.variables),g=H9(),y=Lq(d),w=e.requests.filter(_=>!(_.enabled===!1||f&&!f.some(k=>_.name.toLowerCase().includes(k.toLowerCase()))));if(g){let _=B9(),k=w.length*s;if(k>_)throw new Error(`Suite "${e.name}" would execute ${k} request calls (${w.length} requests \xD7 ${s} iterations), which exceeds HTTP_FORGE_MAX_REQUESTS (${_}). Reduce iterations, use requestFilter, or increase HTTP_FORGE_MAX_REQUESTS.`)}let C=new Tc(t.config);await C.initializeRun(e.id,e.name,i,{iterations:s,delayBetweenRequests:l,stopOnError:a});let R=[],T=[],A=0,U=0,B=new AbortController,V=new Oc;for(let _=1;_<=s;_++){for(let k of w){let M=t.collection.getCollection(k.collectionId);if(!M)continue;let j=cx(M,k.requestId);if(!j)continue;let $=new Hs(t.httpRequest,t.scriptExecutor,t.environmentConfig,t.requestPreparer,i,V,M.scripts,j.folderScriptsChain,void 0,M.name,_,s),Y=Vq(Bq(j.request),{headers:r.headers,query:r.query,body:r.body,variables:r.variables}),K=await $.execute(Y,m,B.signal);if(K.folderPath=k.folderPath??"",K.collectionName=M.name,await C.saveResult(_,K),K.passed?A++:U++,d.includes("perRequest")&&R.push({name:k.name,iteration:_,status:K.response?.status,ok:(K.response?.status??0)>=200&&(K.response?.status??0)<300,duration:`${K.duration}ms`,allPassed:K.passed,...d.includes("consoleOutput")&&K.consoleOutput?.length?{consoleOutput:K.consoleOutput}:{}}),!K.passed&&(T.push({name:k.name,iteration:_,status:K.response?.status,duration:`${K.duration}ms`,body:jq(K.response?.body),headers:Uq(K.response?.headers),cookies:Hq(K.response?.cookies),failedTests:K.assertions?.filter(ne=>!ne.passed).map(ne=>({name:ne.name,...ne.message?{message:ne.message}:{}})),...K.error?{error:K.error}:{},...d.includes("consoleOutput")&&K.consoleOutput?.length?{consoleOutput:K.consoleOutput}:{}}),a)){B.abort();break}l>0&&!B.signal.aborted&&await new Promise(ne=>setTimeout(ne,l))}if(B.signal.aborted)break}let W=await C.finalizeRun("completed",y),P={[n==="collection"?"collection":"suite"]:e.name,environment:i,summary:{total:A+U,passed:A,failed:U,...s>1?{iterations:s}:{},allPassed:U===0}};return(U>0||d.includes("failedOnly"))&&(P.failedRequests=T),d.includes("perRequest")&&(P.results=R),W!==null&&(P.report={uri:`file://${W}`,hint:"Click the URI to open the HTML report in your browser"}),P}async function ux(t){let e=as(t.workspaceFolder),r=t.include??[],n=Lq(r);try{let i=e.collection,s=Jq(i,t),a=Yq(s,t),l=t.requestId;if(!l){if(!t.requestRef)throw new Error("A request reference is required (requestId or requestRef)");let T=ox(s,t.requestRef,a);l=T.request.id,t.onResolve?.({kind:"request",value:t.requestRef,tier:T.tier,id:l,path:T.folderPath?`${T.folderPath}/${T.request.name}`:T.request.name})}let f=cx(s,l);if(!f)throw new Error(`Request "${l}" not found in collection "${s.name}"`);let d=t.environment||e.environmentConfig.getSelectedEnvironment(),m=Vq(Bq(f.request),{headers:t.headers,query:t.query,body:t.body,variables:t.variables}),y=await new Hs(e.httpRequest,e.scriptExecutor,e.environmentConfig,e.requestPreparer,d,new Oc,s.scripts,f.folderScriptsChain).execute(m,Wq(t.variables)),w=null;if(n){let T=new Tc(e.config),A=`request-${Dq(s.id)}-${Dq(l)}`,U=`Request: ${f.request.name}`;await T.initializeRun(A,U,d,{iterations:1,delayBetweenRequests:0,stopOnError:!0}),await T.saveResult(1,y),w=await T.finalizeRun("completed")}let C=Uq(y.response?.headers),R=Hq(y.response?.cookies);return{request:f.request.name,status:y.response?.status||0,ok:(y.response?.status??0)>=200&&(y.response?.status??0)<300,duration:`${y.duration}ms`,body:jq(y.response?.body),allPassed:y.passed,assertions:y.assertions?.map(T=>({name:T.name,passed:T.passed,message:T.message})),...r.includes("headers")?{headers:C}:{},...r.includes("cookies")?{cookies:R}:{},...r.includes("tests")?{tests:y.assertions?.map(T=>({name:T.name,passed:T.passed,...T.message?{message:T.message}:{}}))}:{},...Object.keys(y.modifiedVariables??{}).length?{modifiedVariables:y.modifiedVariables}:{},...r.includes("consoleOutput")&&y.consoleOutput?.length?{consoleOutput:y.consoleOutput}:{},...w!==null?{report:{uri:`file://${w}`,hint:"Click the URI to open the HTML report in your browser"}}:{},...y.error?{error:y.error}:{}}}catch(i){throw i}finally{lx(e)}}async function xd(t){let e=as(t.workspaceFolder);try{let r=e.collection,n=Jq(r,t),i=Yq(n,t),s=zq(n),a=W9(s,i,t.recursive);if(a.length===0&&i)throw new Error(`No requests found under folder "${i}" in collection "${n.name}"`);let l=a.map(({request:d,folderPath:m})=>({id:d.id,slug:d.id.toLowerCase().replace(/\s+/g,"-"),collectionId:n.id,requestId:d.id,name:d.name,method:d.method,collectionName:n.name,folderPath:m,enabled:!0})),f={id:i?`temp-${n.id}-${z9(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 Gq(e,f,{environment:t.environment,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,requestFilter:void 0,include:t.include,variables:t.variables},"collection")}catch(r){throw r}finally{lx(e)}}async function J9(t){return xd({recursive:!0,...t})}async function fx(t){let e=as(t.workspaceFolder);try{let n=await e.testSuite.getSuite(t.suiteId);if(!n)throw new Error(`Test suite "${t.suiteId}" not found`);return Gq(e,n,{environment:t.environment,iterations:t.iterations,stopOnError:t.stopOnError,delay:t.delay,requestFilter:t.requestFilter,include:t.include,variables:t.variables},"suite")}catch(r){throw r}finally{lx(e)}}var qc=oe(()=>{"use strict";QR();Jh();xf();rx();Hg();ax()});var r$={};ks(r$,{createMcpRuntime:()=>u8});import*as Zq from"fs";import{createServer as Y9}from"http";import*as Ed from"path";function X9(t){return Buffer.from(t,"utf8").toString("base64url")}function e8(t){return Buffer.from(t,"base64url").toString("utf8")}async function Bg(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 Xq(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,a=r?`${r} / ${s.name}`:s.name;n.push(...Xq(t,s.items??[],a))}return n}function e$(t,e=t.items,r=""){let n=[];for(let i of e)if(i.type==="folder"){let s=i,a=r?`${r}/${s.name}`:s.name;n.push({folderPath:a,requestCount:t$(s.items??[])}),n.push(...e$(t,s.items??[],a))}return n}function t$(t){let e=0;for(let r of t)r.type==="request"?e++:e+=t$(r.items??[]);return e}async function r8(t){let e=as(t),r=e.config.getMcpConfig(),n=r.toolPrefix??"",i=[],s=e.collection.getAllCollections();for(let l of s){let f=r.excludedCollections;if(f?.length&&(f.includes(l.id)||f.includes(l.name)))continue;let d=Xq(l);for(let{request:m,folderPath:g}of d){let y=g?`${g} / ${m.name}`:m.name;i.push({name:`${n}request__${l.id}__${m.id}`,description:`[${m.method}] ${y} (collection: ${l.name})`,inputSchema:K9})}i.push({name:`${n}collection__${l.id}`,description:`Run all requests in collection: "${l.name}" (${d.length} requests)`,inputSchema:Q9});for(let{folderPath:m,requestCount:g}of e$(l))g!==0&&i.push({name:`${n}folder__${l.id}__${X9(m)}`,description:`Run folder "${m}" in collection: "${l.name}" (${g} requests)`,inputSchema:Z9})}let a=await e.testSuite.getAllSuites();for(let l of a){let f=r.excludedSuites;f?.length&&(f.includes(l.id)||f.includes(l.name))||i.push({name:`${n}suite__${l.id}`,description:`Run test suite: "${l.name}" (${l.requests.length} requests, ${l.config.iterations} iteration(s) by default)`,inputSchema:t8})}return i}function n8(t,e){let n=as(t).config.getMcpConfig().toolPrefix??"";return n&&e.startsWith(n)?e.slice(n.length):e}function i8(t,e,r){return t.replace(/"uri"\s*:\s*"file:\/\/([^"]+)"/g,(n,i)=>`"uri":"http://${e}:${r}/report?path=${encodeURIComponent(i)}"`)}function Kq(t,e,r,n){Oa(t,200,{jsonrpc:"2.0",id:e,error:{code:r,message:n}})}async function s8(t,e){switch(e.method){case"initialize":return{protocolVersion:"2024-11-05",capabilities:{tools:{}},serverInfo:{name:"http-forge",version:"1.0.0"}};case"tools/list":return{tools:await r8(t.workspaceFolder)};case"tools/call":{let r=e.params??{},n=r.name,i=r.arguments;if(!n)throw new Error("Missing tool name");let s=await dx(t.workspaceFolder,n,i??{}),a=JSON.stringify(s,null,2);return{content:[{type:"text",text:i8(a,t.host,t.port)}]}}default:throw new Error(`Method not found: ${e.method}`)}}function o8(t,e,r){let i=as(t.workspaceFolder).config.getMcpConfig().cors.allowedOrigins??["http://localhost","http://127.0.0.1"],s=e.headers.origin??"",a=i.includes(s)?s:i[0]??"http://localhost";r.setHeader("Access-Control-Allow-Origin",a),r.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS"),r.setHeader("Access-Control-Allow-Headers","Content-Type")}function a8(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=Ed.resolve(i),a=Ed.resolve(t.workspaceFolder,".http-forge-cache");if(!s.startsWith(a+Ed.sep)||!s.endsWith(".html")){r.statusCode=403,r.end("Forbidden");return}Zq.readFile(s,"utf-8",(l,f)=>{if(l){r.statusCode=404,r.end("Report not found");return}r.statusCode=200,r.setHeader("content-type","text/html; charset=utf-8"),r.end(f)})}function $c(t){return new Error(`Bad request: ${t}`)}function l8(t){if(t.startsWith("request__")){let[,e,r]=t.split("__");if(!e||!r)throw $c(`request tool format must be request__<collectionId>__<requestId>, got: ${t}`);return{kind:"request",id1:e,id2:r}}if(t.startsWith("folder__")){let e=t.indexOf("__"),r=t.indexOf("__",e+2),n=r>=0?t.slice(e+2,r):"",i=r>=0?t.slice(r+2):"";if(!n||!i)throw $c(`folder tool format must be folder__<collectionId>__<encodedPath>, got: ${t}`);return{kind:"folder",id1:n,id2:e8(i)}}if(t.startsWith("collection__")){let[,e]=t.split("__");if(!e)throw $c(`collection tool format must be collection__<collectionId>, got: ${t}`);return{kind:"collection",id1:e}}if(t.startsWith("suite__")){let[,e]=t.split("__");if(!e)throw $c(`suite tool format must be suite__<suiteId>, got: ${t}`);return{kind:"suite",id1:e}}throw $c(`unknown tool name: ${t}`)}async function dx(t,e,r={}){let n=l8(n8(t,e));return n.kind==="request"?Bg(()=>ux({workspaceFolder:t,collectionId:n.id1,requestId:n.id2,environment:r.environment,variables:r.variables,headers:r.headers,query:r.query,body:r.body,include:r.include})):n.kind==="collection"?Bg(()=>xd({workspaceFolder:t,collectionId:n.id1,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include})):n.kind==="folder"?Bg(()=>xd({workspaceFolder:t,collectionId:n.id1,folderPath:n.id2,recursive:r.recursive,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,include:r.include})):Bg(()=>fx({workspaceFolder:t,suiteId:n.id1,environment:r.environment,variables:r.variables,iterations:r.iterations,stopOnError:r.stopOnError,delay:r.delay,requestFilter:r.requestFilter,include:r.include}))}function Oa(t,e,r){t.statusCode=e,t.setHeader("content-type","application/json; charset=utf-8"),t.end(JSON.stringify(r))}function Qq(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($c("invalid JSON body"))}}),t.on("error",r)})}function c8(t){return Y9(async(e,r)=>{try{if(o8(t,e,r),e.method==="OPTIONS"){r.statusCode=204,r.end();return}if(e.method==="GET"&&e.url==="/health"){Oa(r,200,{status:"ok",port:t.port});return}if(e.method==="GET"&&e.url?.startsWith("/report?")){a8(t,e,r);return}if(e.method==="POST"&&e.url==="/"){let n;try{n=await Qq(e)}catch{Kq(r,null,-32700,"Parse error");return}try{let i=await s8(t,n);Oa(r,200,{jsonrpc:"2.0",id:n.id??null,result:i})}catch(i){Kq(r,n.id??null,-32603,i.message||"Internal error")}return}if(e.method==="POST"&&e.url==="/tools/execute"){let n=await Qq(e);if(!n||typeof n.name!="string"||n.name.trim()===""){Oa(r,400,{error:'Field "name" is required'});return}let i=await dx(t.workspaceFolder,n.name,n.args??{});Oa(r,200,{result:i});return}Oa(r,405,{error:"Method not allowed"})}catch(n){Oa(r,500,{error:n.message})}})}async function u8(t){let e=t.port||3100,r=t.host||"127.0.0.1",n=`${r}:${e}`,i={workspaceFolder:t.workspaceFolder,port:e,host:r,isRunning:!1};return G9.set(n,i),{async start(){if(i.isRunning)return;let s=c8(i);await new Promise((a,l)=>{s.once("error",l),s.listen(i.port,i.host,()=>{s.off("error",l),a()})}),i.server=s,i.isRunning=!0},async stop(){if(!i.server){i.isRunning=!1;return}await new Promise((s,a)=>{i.server.close(l=>{if(l){a(l);return}s()})}),i.server=void 0,i.isRunning=!1},isRunning(){return i.isRunning},getPort(){return i.port},async executeTool(s,a){return dx(i.workspaceFolder,s,a??{})}}}var G9,K9,Q9,Z9,t8,n$=oe(()=>{"use strict";qc();Hg();G9=new Map,K9={type:"object",properties:{environment:{type:"string",description:"Environment name to use (defaults to selected environment)"},variables:{type:"object",description:"Extra variables to inject",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 request body (JSON string)"},include:{type:"array",items:{type:"string",enum:["headers","cookies","tests","consoleOutput","report"]},description:"Extra fields to include in response"}}},Q9={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},variables:{type:"object",description:"Extra variables for every request",additionalProperties:{type:"string"}},iterations:{type:"number",description:"Number of iterations (default: 1)"},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"}}},Z9={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},variables:{type:"object",description:"Extra variables for every request",additionalProperties:{type:"string"}},iterations:{type:"number",description:"Number of iterations (default: 1)"},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"}}};t8={type:"object",properties:{environment:{type:"string",description:"Environment name to use"},iterations:{type:"number",description:"Number of iterations"},stopOnError:{type:"boolean",description:"Stop on first failure"},delay:{type:"number",description:"Delay between requests in ms"},variables:{type:"object",description:"Extra variables for every request",additionalProperties:{type:"string"}},requestFilter:{type:"array",items:{type:"string"},description:"Run requests matching names"},include:{type:"array",items:{type:"string",enum:["perRequest","failedOnly","consoleOutput","report"]},description:"Result detail level"}}}});var bl=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 a=await this.load(s);n.push(a)}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()}};zp();Fo();function pb(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(zC),source:{format:"folder",filePath:e,version:t.version}}}function zC(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(zC)};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}}}function mL(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(hb)}}function hb(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(hb)}:{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}}}var bu=class{store;constructor(e){this.store=new Ts(e)}loadAll(){return this.store.loadAll().map(r=>pb(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 pb(r,this.store.getCollectionPath(r.id))}async create(e,r){let n=await this.store.create(e,r);return pb(n,this.store.getCollectionPath(n.id))}async save(e){return this.store.save(mL(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,hb(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 Su=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()}};Sl();var wu=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}get(e,r){if(r){let s=this.getCookieKey(e,r),a=this.cookies.get(s);if(a&&!this.isExpired(a))return a}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 dt.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 dt.parseCookieHeaders(e,r)}isExpired(e){return dt.isExpired(e)}domainMatches(e,r){return dt.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)}};Gp();var Bi=class t{config;selectedEnvironment;sessionGlobals={};sessionEnvironmentValues=new Map;constructor(e){this.config=e,this.selectedEnvironment=e.selectedEnvironment||Object.keys(e.environments)[0]||"default"}get(e){return this.getVariables()[e]}set(e,r){let n=this.sessionEnvironmentValues.get(this.selectedEnvironment);n||(n={},this.sessionEnvironmentValues.set(this.selectedEnvironment,n)),n[e]=r}getAll(){return this.getVariables()}getEnvironments(){return Object.keys(this.config.environments)}getActive(){return this.selectedEnvironment}setActive(e){if(!this.config.environments[e])throw new Error(`Environment not found: ${e}`);this.selectedEnvironment=e}getVariables(e){let r=e||this.selectedEnvironment,n=this.config.environments[r],i={...this.config.globalVariables||{},...this.sessionGlobals};if(n){if(n.inherits&&this.config.environments[n.inherits]){let a=this.getEnvironmentVariables(n.inherits);i={...i,...a}}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})}};wl();Eu();var qs=class t{envStore;interpolator;urlBuilder;constructor(e,r){this.envStore=e,this.interpolator=r||new Vo,this.urlBuilder=new Hn}get(e){return this.envStore.get(e)}set(e,r){this.envStore.set(e,r)}has(e){return this.envStore.get(e)!==void 0}delete(e){this.envStore.set(e,"")}getAll(){return this.envStore.getAll()}getActiveEnvironment(){return this.envStore.getActive()}setActiveEnvironment(e){this.envStore.setActive(e)}getEnvironments(){let e=this.envStore;return typeof e.getEnvironments=="function"?e.getEnvironments():[]}getGlobals(){let e=this.envStore;return typeof e.getGlobals=="function"?e.getGlobals():{}}setGlobal(e,r){let n=this.envStore;typeof n.setGlobal=="function"&&n.setGlobal(e,r)}unsetGlobal(e){let r=this.envStore;typeof r.unsetGlobal=="function"&&r.unsetGlobal(e)}clearGlobals(){let e=this.envStore;typeof e.clearGlobals=="function"&&e.clearGlobals()}resolve(e){return this.interpolator.interpolate(e,this.getAll())}resolvePath(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r)}buildUrl(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r.params||{},r.query||{})}resolveObject(e){return this.interpolator.interpolateObject(e,this.getAll())}extractVariables(e){return this.interpolator.extractVariables(e)}extractPathParams(e){return this.urlBuilder.extractPathParams(e)}static create(e={}){let r=Bi.fromVariables(e);return new t(r)}static fromResolver(e){return new t(e)}};Eu();Pu();ku();wl();uf();var Hl=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 a=s?.forgeRoot?[it("path").join(s.forgeRoot,"modules")]:[],l=new Wi(new Hn,new zi,e);this.scriptExecutor=new Qi(l,a,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()},a={...this.forgeEnv.getGlobals()},l={...n.additionalVariables||{}},f={...s},d=this.buildHttpRequest(e,n.overrides),m=this.findFolderPath(r,e.id),g=this.buildScriptChain(e,r,m),y={request:{url:d.url,method:d.method,headers:{...d.headers},body:d.body?typeof d.body=="string"?{type:"raw",content:d.body}:d.body:void 0},variables:l,collectionVariables:r.variables||{},globals:{...a},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:(T,A,U)=>{T==="set"&&A&&U!==void 0?this.forgeEnv.setGlobal(A,U):T==="unset"&&A?this.forgeEnv.unsetGlobal(A):T==="clear"&&this.forgeEnv.clearGlobals()}},w=this.scriptExecutor.createRequestSession(y),C,R;try{if(!n.skipPreRequest&&g.preRequest.length>0){let B=await w.executePreRequest(g.preRequest);if(C={success:B.success,error:B.error,modifiedVariables:B.modifiedVariables,modifiedEnvironment:B.modifiedEnvironmentVariables,modifiedGlobals:B.modifiedGlobals,modifiedCollectionVariables:B.modifiedCollectionVariables,consoleOutput:B.consoleOutput,modifiedRequest:B.modifiedRequest?{url:B.modifiedRequest.url,method:B.modifiedRequest.method,headers:B.modifiedRequest.headers,body:B.modifiedRequest.body?.content}:void 0},B.modifiedVariables&&(l={...l,...B.modifiedVariables}),B.modifiedEnvironmentVariables&&(f={...f,...B.modifiedEnvironmentVariables}),B.modifiedRequest){let V=B.modifiedRequest;V.url&&(d.url=V.url),V.method&&(d.method=V.method),V.headers&&(d.headers={...d.headers,...V.headers}),V.body!==void 0&&(d.body=V.body?.content||V.body)}if(!B.success)throw new Error(`Pre-request script failed: ${B.error}`)}let T={...f,...l};d=this.interpolateRequest(d,T);let A=n.overrides?.body||e.body;if(this.preprocessor&&A&&typeof A!="string"&&A.type==="graphql"&&d.body!==void 0){let B=this.preprocessor.encodeBody({type:"graphql",content:d.body});B!=null&&(d.body=typeof B=="string"?B:JSON.stringify(B))}let U=await this.httpClient.send(d);if(!n.skipPostResponse&&g.postResponse.length>0){let B=await w.executePostResponse(g.postResponse,{status:U.status,statusText:U.statusText,headers:U.headers,body:U.body,cookies:Object.fromEntries(U.cookies.map(V=>[V.name,V.value])),responseTime:U.time,responseSize:U.size,executedRequest:{url:d.url,method:d.method,headers:d.headers||{},body:d.body?typeof d.body=="string"?{type:"raw",content:d.body}:d.body:{type:"none",content:""},params:{},query:{}}});R={success:!0,assertions:B.testResults,consoleOutput:B.consoleOutput,modifiedEnvironment:B.modifiedEnvironmentVariables},B.modifiedEnvironmentVariables&&(f={...f,...B.modifiedEnvironmentVariables})}return{response:U,preRequestResult:C,postResponseResult:R,totalTime:Date.now()-i,finalRequest:d,variables:{environment:f,local:l}}}finally{w.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 m=new URLSearchParams;for(let g of e.query)g.enabled!==!1&&m.append(g.key,g.value);n+=(n.includes("?")?"&":"?")+m.toString()}let i=r?.url||n,s=r?.method||e.method,a={};if(e.headers&&Array.isArray(e.headers))for(let m of e.headers)m.enabled!==!1&&(a[m.key]=m.value);let l={...a,...r?.headers||{}},f,d=r?.body||e.body;if(d)if(typeof d=="string")f=d;else if(this.preprocessor&&d.type)if(d.type==="graphql")f=typeof d.content=="string"?d.content:JSON.stringify(d.content);else{let m=this.preprocessor.encodeBody(d);f=m!=null?String(m):void 0}else d.content&&(f=typeof d.content=="string"?d.content:JSON.stringify(d.content));return this.preprocessor&&d&&this.preprocessor.setContentTypeHeader(l,d),{url:i,method:s,headers:l,body:f,timeout:r?.timeout||e.settings?.timeout,settings:{...e.settings,...r?.settings}}}interpolateRequest(e,r){let n=qs.create(r);return{...e,url:n.resolvePath(e.url),headers:n.resolveObject(e.headers),body:e.body?n.resolve(typeof e.body=="string"?e.body:JSON.stringify(e.body)):void 0}}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 a of n)a.scripts?.preRequest&&i.push(a.scripts.preRequest),a.scripts?.postResponse&&s.push(a.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,a)=>{for(let l of s){if(l.type==="request"&&l.id===r)return n.push(...a),!0;if(l.type==="folder"){let f=[...a,l];if(i(l.items,f))return!0}}return!1};return i(e.items,[]),n}};function LV(){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 ff=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 a=this.entries.get(s);a&&(!r||a.environment===r)&&i.push(a)}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 a=LV(),l=Date.now(),f={id:a,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(a,f);let d=this.requestIndex.get(e)||[];for(d.unshift(a);d.length>this.maxEntriesPerRequest;){let m=d.pop();m&&(this.entries.delete(m),this.fullResponses.delete(m))}if(this.requestIndex.set(e,d),this.storeFullResponses){let m={timestamp:l,status:n.status,statusText:n.statusText,headers:{...n.headers},cookies:n.cookies||[],body:n.body,time:n.time};this.fullResponses.set(a,m)}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 df=class{async send(e){let r=Date.now(),n=new AbortController,i=e.timeout??3e4,s=setTimeout(()=>n.abort(),i);try{let a={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?a.body=e.body:typeof e.body=="object"&&(a.body=JSON.stringify(e.body),!e.headers?.["Content-Type"]&&!e.headers?.["content-type"]&&(a.headers["Content-Type"]="application/json"))),e.settings?.followRedirects===!1&&(a.redirect="manual");let l=await fetch(e.url,a),f=Date.now(),d=l.headers.get("content-type")||"",m;try{d.includes("application/json")?m=await l.json():d.includes("text/")?m=await l.text():m=await l.text()}catch{m=null}let g={};return l.headers.forEach((y,w)=>{let C=g[w];C!==void 0?g[w]=Array.isArray(C)?[...C,y]:[C,y]:g[w]=y}),{status:l.status,statusText:l.statusText,headers:g,cookies:[],body:m,time:f-r}}catch(a){throw a.name==="AbortError"?new Error(`Request timeout after ${i}ms`):a}finally{clearTimeout(s)}}};Pu();ku();Iu();Hh();wl();var sa=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}}};Bh();import*as rn from"fs/promises";import*as Bl from"path";var pf=class{async readFile(e){return rn.readFile(e,"utf-8")}async writeFile(e,r){let n=Bl.dirname(e);await this.mkdir(n),await rn.writeFile(e,r,"utf-8")}async exists(e){try{return await rn.access(e),!0}catch{return!1}}async mkdir(e){await rn.mkdir(e,{recursive:!0})}async glob(e,r){let n=r||process.cwd(),i=[];try{await this.walkDirectory(n,s=>{let a=Bl.basename(s);for(let l of e)if(this.matchPattern(a,l)){i.push(s);break}})}catch{}return i}async readDir(e){return rn.readdir(e)}async isDirectory(e){try{return(await rn.stat(e)).isDirectory()}catch{return!1}}async walkDirectory(e,r){let n=await rn.readdir(e,{withFileTypes:!0});for(let i of n){let s=Bl.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)}};uf();var y0=class t{httpClient;fileSystem;scriptExecutor;interpolator;cookieJar;interceptorChain;preprocessor;dataFileParser;requestHistory;parserRegistry;collectionLoader;environmentStore;forgeEnv;requestExecutor;options;constructor(e={}){if(this.options=e,this.interpolator=e.interpolator||new Vo,this.fileSystem=e.fileSystem||new pf,this.preprocessor=e.preprocessor||new ia,this.dataFileParser=e.dataFileParser||new oa,this.cookieJar=e.cookieJar||new wu,e.enableHistory?this.requestHistory=e.requestHistory||new ff({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 Wo(s)}else this.httpClient=new df;let r=e.forgeRoot?[it("path").join(e.forgeRoot,"modules")]:[],n=new Wi(new Hn,this.interceptorChain,this.httpClient);if(this.scriptExecutor=e.scriptExecutor||new Qi(n,r,void 0,e.scriptScope??"shared",e.scriptTimeout??5e3),this.parserRegistry=new Su,this.parserRegistry.register("http-forge",new sa),(e.storageFormat??"folder")==="folder"&&e.forgeRoot){let s=it("path").join(e.forgeRoot,"collections");this.collectionLoader=new bu(s)}else this.collectionLoader=new bl(this.fileSystem,this.parserRegistry);this.environmentStore=e.environmentConfig?new Bi(e.environmentConfig):Bi.fromVariables({}),this.forgeEnv=qs.fromResolver(this.environmentStore),this.requestExecutor=new Hl(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:e.forgeRoot,scriptExecutor:this.scriptExecutor})}createInterceptorChain(e){let r=new zi;if(e.requestInterceptors)for(let n of e.requestInterceptors)r.addRequestInterceptor(n);if(e.responseInterceptors)for(let n of e.responseInterceptors)r.addResponseInterceptor(n);if(e.errorInterceptors)for(let n of e.errorInterceptors)r.addErrorInterceptor(n);return r}async loadCollection(e){if(this.collectionLoader instanceof bl)return this.collectionLoader.load(e);throw new Error("loadCollection(filePath) is not supported with folder storage format. Use loadAllCollections() instead.")}async loadAllCollections(){return this.collectionLoader.loadAll()}async execute(e,r,n){return this.requestExecutor.execute(e,r,n)}async executeSimple(e,r){return this.requestExecutor.executeSimple(e,r)}registerParser(e,r){this.parserRegistry.register(e,r)}setEnvironmentConfig(e){this.environmentStore=new Bi(e),this.forgeEnv=qs.fromResolver(this.environmentStore),this.requestExecutor=new Hl(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=it("path"),i=n.join(e,"environments"),s,a=_u(i);if(Object.keys(a.environments).length>0||Object.keys(a.globalVariables).length>0){s={globalVariables:{...a.globalVariables,...a.localVariables},environments:{},selectedEnvironment:void 0};for(let[f,d]of Object.entries(a.environments)){let m=a.localCredentials[f]?.variables||{};s.environments[f]={name:f,variables:{...d.variables,...m}}}}else{let f=it("fs"),d=n.join(i,"environments.json");if(f.existsSync(d))try{let m=f.readFileSync(d,"utf-8"),g=JSON.parse(m);if(s={globalVariables:g.globalVariables||{},environments:{},selectedEnvironment:g.selectedEnvironment},g.environments)for(let[y,w]of Object.entries(g.environments)){let C=w;s.environments[y]={name:C.name||y,variables:C.variables||{}}}}catch(m){console.warn(`[ForgeContainer] Failed to load environments from ${d}:`,m)}}return new t({...r,forgeRoot:e,storageFormat:r.storageFormat??"folder",environmentConfig:s})}};GR();KR();$g();async function f8(t){let{createMcpRuntime:e}=await Promise.resolve().then(()=>(n$(),r$));return e(t)}async function d8(t){let{runRequest:e}=await Promise.resolve().then(()=>(qc(),Cd));return e(t)}async function p8(t){let{runCollection:e}=await Promise.resolve().then(()=>(qc(),Cd));return e(t)}async function h8(t){let{runFolder:e}=await Promise.resolve().then(()=>(qc(),Cd));return e(t)}async function m8(t){let{runSuite:e}=await Promise.resolve().then(()=>(qc(),Cd));return e(t)}Hg();E0();Sl();QR();O0();Pu();ku();vb();Iu();Hh();wl();c0();h0();uf();Lh();Uh();xf();w0();R0();zp();Fo();Fo();S0();ax();P0();Gp();Eu();Jh();k0();F0();v0();function g8(t,e,r){let n=t.slice(0,e),i=n.match(/([a-zA-Z_]\w*)$/),s=i?i[1]:"",a=C8(n);if(a.trimEnd().endsWith("@")||s&&a.trimEnd().endsWith("@"+s))return{contextType:"directive",fieldPath:[],prefix:s};if(E8(a))return{contextType:"variable_def",fieldPath:[],prefix:s};let l=a.match(/\.\.\.\s+on\s+(\w*)$/);if(l)return{contextType:"fragment_type",fieldPath:[],prefix:l[1]||""};let f=a.match(/\(\s*(?:[\w]+\s*:\s*(?:"[^"]*"|[^,)]+)\s*,\s*)*(\w+)\s*:\s*(\w*)$/);if(f&&i$(a)){let g=px(a,r),y=g.length>0?g[g.length-1]:void 0,w=s$(a);return{contextType:"argument_value",fieldPath:g,parentType:y,prefix:f[2]||"",currentArg:f[1],currentField:w||void 0}}if(i$(a)){let g=px(a,r),y=g.length>0?g[g.length-1]:void 0,w=s$(a);return{contextType:"argument",fieldPath:g,parentType:y,prefix:s,currentField:w||void 0}}if(hx(a,"{","}")===0)return{contextType:"root",fieldPath:[],prefix:s};let m=px(a,r);return{contextType:"selection_set",fieldPath:m,parentType:m.length>0?m[m.length-1]:void 0,prefix:s}}function y8(t,e){switch(e.contextType){case"root":return v8(t,e.prefix);case"selection_set":return b8(t,e);case"argument":return S8(t,e);case"argument_value":return w8(t,e);case"directive":return _8(t,e.prefix);case"fragment_type":return R8(t,e.prefix);case"variable_def":return x8(t,e.prefix);default:return[]}}function v8(t,e){let r=[],n=[{label:"query",detail:"Query operation",insertText:`query \${1:OperationName} {
|
|
807
807
|
$0
|
|
808
808
|
}`},{label:"mutation",detail:"Mutation operation",insertText:`mutation \${1:OperationName} {
|
|
809
809
|
$0
|
|
810
810
|
}`},{label:"subscription",detail:"Subscription operation",insertText:`subscription \${1:OperationName} {
|
|
811
811
|
$0
|
|
812
|
-
}`},{label:"fragment",detail:"Fragment definition",insertText:"fragment ${1:FragmentName} on ${2:TypeName} {\n $0\n}"}];for(let s of n)s.label==="mutation"&&!t.mutationType||s.label==="subscription"&&!t.subscriptionType||(!e||s.label.startsWith(e.toLowerCase()))&&r.push({label:s.label,kind:"keyword",detail:s.detail,insertText:s.insertText,sortOrder:0});let i=t.types.get(t.queryType);if(i)for(let s of i.fields)(!e||s.name.toLowerCase().startsWith(e.toLowerCase()))&&r.push(
|
|
812
|
+
}`},{label:"fragment",detail:"Fragment definition",insertText:"fragment ${1:FragmentName} on ${2:TypeName} {\n $0\n}"}];for(let s of n)s.label==="mutation"&&!t.mutationType||s.label==="subscription"&&!t.subscriptionType||(!e||s.label.startsWith(e.toLowerCase()))&&r.push({label:s.label,kind:"keyword",detail:s.detail,insertText:s.insertText,sortOrder:0});let i=t.types.get(t.queryType);if(i)for(let s of i.fields)(!e||s.name.toLowerCase().startsWith(e.toLowerCase()))&&r.push(o$(s,1,t));return r}function b8(t,e){let r=[],n=e.parentType;if(!n)return r;let i=t.types.get(n);if(!i)return r;if(i.kind==="OBJECT"||i.kind==="INTERFACE"){for(let s of i.fields)(!e.prefix||s.name.toLowerCase().startsWith(e.prefix.toLowerCase()))&&r.push(o$(s,0,t));(!e.prefix||"__typename".startsWith(e.prefix.toLowerCase()))&&r.push({label:"__typename",kind:"field",detail:"String!",description:"The name of the current object type",sortOrder:10})}if(i.kind==="UNION"||i.kind==="INTERFACE")for(let s of i.possibleTypes){let a=s.replace(/[!\[\]]/g,"");(!e.prefix||a.toLowerCase().startsWith(e.prefix.toLowerCase()))&&r.push({label:`... on ${a}`,kind:"snippet",detail:`Inline fragment on ${a}`,insertText:`... on ${a} {
|
|
813
813
|
$0
|
|
814
|
-
}`,sortOrder:5})}return(!e.prefix||"...".startsWith(e.prefix))&&r.push({label:"...",kind:"snippet",detail:"Fragment spread",insertText:"...${1:FragmentName}",sortOrder:8}),r}function
|
|
814
|
+
}`,sortOrder:5})}return(!e.prefix||"...".startsWith(e.prefix))&&r.push({label:"...",kind:"snippet",detail:"Fragment spread",insertText:"...${1:FragmentName}",sortOrder:8}),r}function S8(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 w8(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 a=s.type.replace(/[!\[\]]/g,""),l=t.types.get(a);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(a==="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 _8(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 R8(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 x8(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 o$(t,e,r){let n=t.type.replace(/[!\[\]]/g,""),i=!1;if(r){let a=r.types.get(n);i=!!a&&(a.kind==="OBJECT"||a.kind==="INTERFACE"||a.kind==="UNION")}else i=!new Set(["String","Int","Float","Boolean","ID"]).has(n);let s=t.name;if(t.args.length>0){let a=t.args.filter(l=>l.type.endsWith("!"));if(a.length>0){let l=a.map((f,d)=>`${f.name}: \${${d+1}}`).join(", ");s=`${t.name}(${l})`}}return i&&(s+=` {
|
|
815
815
|
$0
|
|
816
|
-
}`),{label:t.name,kind:"field",detail:t.type,description:t.description,insertText:s,deprecated:t.isDeprecated,sortOrder:e}}function R8(t){return t.replace(/"""[\s\S]*?"""/g,'""').replace(/"(?:[^"\\]|\\.)*"/g,'""').replace(/#[^\n]*/g,"")}function hx(t,e,r){let n=0;for(let i of t)i===e?n++:i===r&&n--;return n}function r$(t){return hx(t,"(",")")>0}function x8(t){if(hx(t,"(",")")<=0)return!1;let r=t.indexOf("{"),n=r>=0?t.slice(0,r):t;return/\$\w+\s*:\s*\w*$/.test(n)}function n$(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 px(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=C8(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 d=l+1;if(s[d]==="("){let m=1;for(d++;d<s.length&&m>0;)s[d]==="("?m++:s[d]===")"&&m--,d++}if(d<s.length&&s[d]==="{"&&o){let m=o.fields.find(g=>g.name===f);if(m){let g=m.type.replace(/[!\[\]]/g,"");r.push(g),o=e.types.get(g)}}}}}return r}function C8(t){let e=[],r=/([a-zA-Z_]\w*|[{}(),:=@!$\[\].]|\.\.\.|"[^"]*"|\d+)/g,n;for(;(n=r.exec(t))!==null;)e.push(n[1]);return e}T0();__();L0();NR();Km();LR();FR();w_();DR();x0();C0();tx();JR();Dg();rx();function Vg(t,e){if(t.length===0)return 0;let r=Math.ceil(e/100*t.length)-1;return t[Math.max(0,r)]}function mx(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 s$(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=Vg(e,50),t.p90=Vg(e,90),t.p95=Vg(e,95),t.p99=Vg(e,99)}var gx=class{summary;byRequest;overall;errors;startTime=0;constructor(){this.summary=this.createEmptySummary(),this.byRequest=new Map,this.overall=mx("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=mx("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,mx(e));let l=this.byRequest.get(e);if(l.count++,n?l.passed++:l.failed++,l.durations.push(r),s$(l),this.overall.count++,n?this.overall.passed++:this.overall.failed++,this.overall.durations.push(r),s$(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}}};YR();Fo();import*as ls from"fs";import*as Ia from"path";var yx=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=Ia.join(this.suiteDir,e,"request.json");if(ls.existsSync(r))try{let n=JSON.parse(ls.readFileSync(r,"utf-8")),i=Ia.join(this.suiteDir,e,"scripts"),s=Vp(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=Ia.join(this.suiteDir,e);ls.mkdirSync(n,{recursive:!0});let i=r.scripts,s={...r};if(delete s.scripts,ls.writeFileSync(Ia.join(n,"request.json"),JSON.stringify(s,null,2),"utf-8"),i){let o=Ia.join(n,"scripts");Wp(o,{preRequest:i.preRequest||void 0,postResponse:i.postResponse||void 0})}}hasEmbeddedRequest(e){return!this.suiteDir||!e?!1:ls.existsSync(Ia.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=[];if(n){s=n.scripts;let l=this.findRequestInCollection(n,e.requestId);l&&(o=l.folderScriptsChain)}return{request:r,suiteRequest:e,collectionScripts:s,folderScriptsChain:o}}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,folderScriptsChain:i.folderScriptsChain}}findRequestInCollection(e,r,n=[]){let i=e.items||[];return this.searchItems(i,r,n)}searchItems(e,r,n){for(let i of e)if(i.type==="folder"){let s=i;if(!s.items)continue;let o=s.scripts?[...n,s.scripts]:n,l=this.searchItems(s.items||[],r,o);if(l)return l}else if(i.id===r)return{request:this.normalizeRequest(i),folderScriptsChain:n}}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=vn(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=vn(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}};I0();Wh();Bh();jR();UR();WR();VR();HR();BR();zR();Kp();Zp();eh();yn();export{Ea as AmbiguousRefError,Og as AwsSecretResolver,Ig as AzureKeyVaultResolver,LC as BODY_FILE_MAP,Jl as CONFIG_FILES,bl as CollectionLoader,gf as CollectionLoaderFactory,Hs as CollectionRequestExecutor,yf as CollectionService,Yl as ConfigService,wu as CookieJar,vf as CookieService,dt as CookieUtils,Vt as DEFAULT_CONFIG,Bn as DEFAULT_REQUEST_SETTINGS,bd as DEFAULT_SUITE_CONFIG,XC as DYNAMIC_VARIABLES,oa as DataFileParser,Ag as DopplerResolver,wf as EnvironmentConfigService,Bi as EnvironmentResolver,lc as ExampleGenerator,df as FetchHttpClient,bu as FolderCollectionLoader,Ts as FolderCollectionStore,y0 as ForgeContainer,qs as ForgeEnv,Tg as GcpSecretResolver,Rf as GraphQLSchemaService,ZR as HTTP_METHOD_MAP,Ic as HTTP_METHOD_REVERSE,Pg as HashiCorpVaultResolver,Gl as HistoryAnalyzer,wd as HtmlReportGenerator,sa as HttpForgeParser,Wi as HttpRequestService,Oc as InMemoryCookieJar,zi as InterceptorChain,zl as JsonCollectionLoader,bb as LoggingRequestInterceptor,Rr as METADATA_FILES,Nh as ModuleLoader,pf as NodeFileSystem,Wo as NodeHttpClient,hf as OAuth2TokenManager,kg as OnePasswordResolver,ac as OpenApiExporter,xc as OpenApiImporter,Su as ParserRegistry,bf as PersistentCookieJar,la as ROOT_DIRECTORIES,Rc as RefResolver,Hl as RequestExecutor,Cf as RequestHistoryService,ff as RequestHistoryStore,_f as RequestPreparer,ia as RequestPreprocessor,cf as RequestScriptSession,Tc as ResultStorageService,wb as RetryErrorInterceptor,vu as SCHEMA_FILES,tn as SCRIPTS_DIR,Bp as SCRIPT_FILES,Cc as SchemaInferenceService,Xs as SchemaInferrer,Ec as ScriptAnalyzer,Qi as ScriptExecutor,vd as SecretResolverRegistry,xa as ServiceContainer,re as ServiceIdentifiers,gx as StatisticsService,Sd as TestSuiteService,yx as TestSuiteStore,Sb as TimingResponseInterceptor,Hn as UrlBuilder,Vo as VariableInterpolator,Bo as VariableResolver,rW as applyExtractionPlan,Cu as applyFilterChain,jo as augmentWithDynamicVars,Aq as bootstrapNodeRuntime,tW as buildExtractionPlan,Ng as buildResultFileName,HC as cleanupOldBodyFiles,jh as concatenateScripts,af as createExpectChain,FI as createLodashShim,c8 as createMcpRuntime,l0 as createModuleLoader,Dh as createMomentShim,as as createNodeContainer,Fh as createResponseObject,AV as createScriptConsole,f0 as createTestFunction,BL as createVariableResolver,aL as deepClone,ub as deleteItemFromTree,eW as detectSensitiveData,Ho as evaluateExpression,M9 as expandSummary,jV as exportCollectionToRestClient,cb as findItemById,uL as formatBytes,Ul as formatConsoleOutput,fL as formatDuration,ft as generateId,vn as generateSlug,lb as generateUUID,m8 as getCompletions,LV as getRestClientExportFolder,Oq as getServiceContainer,lf as hasChanged,Uo as isExpression,lL as isPlainObject,Yp as isSystemEnvironmentFile,_u as loadEnvironmentsFromFolder,yu as mergeHeadersCaseInsensitive,yb as mergeRequestSettings,d0 as normalizeHeaders,xu as parseFilterChain,zh as parsePostmanEnvironment,KV as parsePostmanEnvironmentFile,h8 as parseQueryContext,UC as prepareBodyForSave,jC as readBodyFromDir,BC as readSchemaFile,Vp as readScriptsFromDir,$0 as redactBody,N0 as redactFullResponse,D0 as redactFullResultDetails,Zi as redactHeaders,M0 as redactHistoryEntry,Kh as redactUrl,Mg as registerCoreServices,ix as resolveCollectionRef,Vi as resolveDynamicVariable,$L as resolveDynamicVariablesInString,sx as resolveFolderRef,ox as resolveRequestRef,f8 as runCollection,d8 as runFolder,u8 as runRequest,p8 as runSuite,cL as safeJsonParse,It as sanitizeName,fb as searchForItemPath,db as searchForItemPathById,WC as sortItemsByOrder,Wl as writeEnvFile,Vh as writeFolderItems,VC as writeSchemaFiles,mf as writeScriptFile,Wp as writeScriptsToDir};
|
|
816
|
+
}`),{label:t.name,kind:"field",detail:t.type,description:t.description,insertText:s,deprecated:t.isDeprecated,sortOrder:e}}function C8(t){return t.replace(/"""[\s\S]*?"""/g,'""').replace(/"(?:[^"\\]|\\.)*"/g,'""').replace(/#[^\n]*/g,"")}function hx(t,e,r){let n=0;for(let i of t)i===e?n++:i===r&&n--;return n}function i$(t){return hx(t,"(",")")>0}function E8(t){if(hx(t,"(",")")<=0)return!1;let r=t.indexOf("{"),n=r>=0?t.slice(0,r):t;return/\$\w+\s*:\s*\w*$/.test(n)}function s$(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 px(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=O8(t),a=e.types.get(n);for(let l=0;l<s.length;l++){let f=s[l];if(f!=="{"){if(f==="}"){r.pop(),a=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 d=l+1;if(s[d]==="("){let m=1;for(d++;d<s.length&&m>0;)s[d]==="("?m++:s[d]===")"&&m--,d++}if(d<s.length&&s[d]==="{"&&a){let m=a.fields.find(g=>g.name===f);if(m){let g=m.type.replace(/[!\[\]]/g,"");r.push(g),a=e.types.get(g)}}}}}return r}function O8(t){let e=[],r=/([a-zA-Z_]\w*|[{}(),:=@!$\[\].]|\.\.\.|"[^"]*"|\d+)/g,n;for(;(n=r.exec(t))!==null;)e.push(n[1]);return e}T0();__();L0();NR();Km();LR();FR();w_();DR();x0();C0();tx();JR();Dg();rx();function Vg(t,e){if(t.length===0)return 0;let r=Math.ceil(e/100*t.length)-1;return t[Math.max(0,r)]}function mx(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 a$(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=Vg(e,50),t.p90=Vg(e,90),t.p95=Vg(e,95),t.p99=Vg(e,99)}var gx=class{summary;byRequest;overall;errors;startTime=0;constructor(){this.summary=this.createEmptySummary(),this.byRequest=new Map,this.overall=mx("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=mx("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 a=this.summary.passed+this.summary.failed;if(this.summary.passRate=a>0?Math.round(this.summary.passed/a*1e3)/10:0,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime),i)return;this.byRequest.has(e)||this.byRequest.set(e,mx(e));let l=this.byRequest.get(e);if(l.count++,n?l.passed++:l.failed++,l.durations.push(r),a$(l),this.overall.count++,n?this.overall.passed++:this.overall.failed++,this.overall.durations.push(r),a$(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}}};YR();Fo();import*as ls from"fs";import*as Ia from"path";var yx=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=Ia.join(this.suiteDir,e,"request.json");if(ls.existsSync(r))try{let n=JSON.parse(ls.readFileSync(r,"utf-8")),i=Ia.join(this.suiteDir,e,"scripts"),s=Vp(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=Ia.join(this.suiteDir,e);ls.mkdirSync(n,{recursive:!0});let i=r.scripts,s={...r};if(delete s.scripts,ls.writeFileSync(Ia.join(n,"request.json"),JSON.stringify(s,null,2),"utf-8"),i){let a=Ia.join(n,"scripts");Wp(a,{preRequest:i.preRequest||void 0,postResponse:i.postResponse||void 0})}}hasEmbeddedRequest(e){return!this.suiteDir||!e?!1:ls.existsSync(Ia.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,a=[];if(n){s=n.scripts;let l=this.findRequestInCollection(n,e.requestId);l&&(a=l.folderScriptsChain)}return{request:r,suiteRequest:e,collectionScripts:s,folderScriptsChain:a}}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,folderScriptsChain:i.folderScriptsChain}}findRequestInCollection(e,r,n=[]){let i=e.items||[];return this.searchItems(i,r,n)}searchItems(e,r,n){for(let i of e)if(i.type==="folder"){let s=i;if(!s.items)continue;let a=s.scripts?[...n,s.scripts]:n,l=this.searchItems(s.items||[],r,a);if(l)return l}else if(i.id===r)return{request:this.normalizeRequest(i),folderScriptsChain:n}}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=vn(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(":"),a=this.suite?.requests.find(l=>l.collectionId===i&&l.requestId===s);if(a){let l=this.resolveRequest(a);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=vn(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}};I0();Wh();Bh();jR();UR();WR();VR();HR();BR();zR();Kp();Zp();eh();yn();export{Ea as AmbiguousRefError,Og as AwsSecretResolver,Ig as AzureKeyVaultResolver,LC as BODY_FILE_MAP,Jl as CONFIG_FILES,bl as CollectionLoader,gf as CollectionLoaderFactory,Hs as CollectionRequestExecutor,yf as CollectionService,Yl as ConfigService,wu as CookieJar,vf as CookieService,dt as CookieUtils,Vt as DEFAULT_CONFIG,Bn as DEFAULT_REQUEST_SETTINGS,bd as DEFAULT_SUITE_CONFIG,XC as DYNAMIC_VARIABLES,oa as DataFileParser,Ag as DopplerResolver,wf as EnvironmentConfigService,Bi as EnvironmentResolver,lc as ExampleGenerator,df as FetchHttpClient,bu as FolderCollectionLoader,Ts as FolderCollectionStore,y0 as ForgeContainer,qs as ForgeEnv,Tg as GcpSecretResolver,Rf as GraphQLSchemaService,ZR as HTTP_METHOD_MAP,Ic as HTTP_METHOD_REVERSE,Pg as HashiCorpVaultResolver,Gl as HistoryAnalyzer,wd as HtmlReportGenerator,sa as HttpForgeParser,Wi as HttpRequestService,Oc as InMemoryCookieJar,zi as InterceptorChain,zl as JsonCollectionLoader,bb as LoggingRequestInterceptor,Rr as METADATA_FILES,Nh as ModuleLoader,pf as NodeFileSystem,Wo as NodeHttpClient,hf as OAuth2TokenManager,kg as OnePasswordResolver,ac as OpenApiExporter,xc as OpenApiImporter,Su as ParserRegistry,bf as PersistentCookieJar,la as ROOT_DIRECTORIES,Rc as RefResolver,Hl as RequestExecutor,Cf as RequestHistoryService,ff as RequestHistoryStore,_f as RequestPreparer,ia as RequestPreprocessor,cf as RequestScriptSession,Tc as ResultStorageService,wb as RetryErrorInterceptor,vu as SCHEMA_FILES,tn as SCRIPTS_DIR,Bp as SCRIPT_FILES,Cc as SchemaInferenceService,Xs as SchemaInferrer,Ec as ScriptAnalyzer,Qi as ScriptExecutor,vd as SecretResolverRegistry,xa as ServiceContainer,re as ServiceIdentifiers,gx as StatisticsService,Sd as TestSuiteService,yx as TestSuiteStore,Sb as TimingResponseInterceptor,Hn as UrlBuilder,Vo as VariableInterpolator,Bo as VariableResolver,iW as applyExtractionPlan,Cu as applyFilterChain,jo as augmentWithDynamicVars,$q as bootstrapNodeRuntime,nW as buildExtractionPlan,Ng as buildResultFileName,HC as cleanupOldBodyFiles,jh as concatenateScripts,af as createExpectChain,FI as createLodashShim,f8 as createMcpRuntime,l0 as createModuleLoader,Dh as createMomentShim,as as createNodeContainer,Fh as createResponseObject,$V as createScriptConsole,f0 as createTestFunction,WL as createVariableResolver,cL as deepClone,ub as deleteItemFromTree,rW as detectSensitiveData,Ho as evaluateExpression,D9 as expandSummary,HV as exportCollectionToRestClient,cb as findItemById,dL as formatBytes,Ul as formatConsoleOutput,pL as formatDuration,ft as generateId,vn as generateSlug,lb as generateUUID,y8 as getCompletions,UV as getRestClientExportFolder,Pq as getServiceContainer,lf as hasChanged,Uo as isExpression,uL as isPlainObject,Yp as isSystemEnvironmentFile,_u as loadEnvironmentsFromFolder,yu as mergeHeadersCaseInsensitive,yb as mergeRequestSettings,d0 as normalizeHeaders,xu as parseFilterChain,zh as parsePostmanEnvironment,ZV as parsePostmanEnvironmentFile,g8 as parseQueryContext,UC as prepareBodyForSave,jC as readBodyFromDir,BC as readSchemaFile,Vp as readScriptsFromDir,$0 as redactBody,N0 as redactFullResponse,D0 as redactFullResultDetails,Zi as redactHeaders,M0 as redactHistoryEntry,Kh as redactUrl,Mg as registerCoreServices,ix as resolveCollectionRef,Vi as resolveDynamicVariable,NL as resolveDynamicVariablesInString,sx as resolveFolderRef,ox as resolveRequestRef,p8 as runCollection,h8 as runFolder,d8 as runRequest,m8 as runSuite,fL as safeJsonParse,It as sanitizeName,fb as searchForItemPath,db as searchForItemPathById,WC as sortItemsByOrder,Wl as writeEnvFile,Vh as writeFolderItems,VC as writeSchemaFiles,mf as writeScriptFile,Wp as writeScriptsToDir};
|