create-prek-el-widgets
Version:
Create Elementor widgets with React using a single command
2 lines • 516 kB
JavaScript
#!/usr/bin/env node
(()=>{var t={8057:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.createFileSystemAdapter=r.FILE_SYSTEM_ADAPTER=void 0;const o=i(7147);r.FILE_SYSTEM_ADAPTER={lstat:o.lstat,stat:o.stat,lstatSync:o.lstatSync,statSync:o.statSync,readdir:o.readdir,readdirSync:o.readdirSync};function createFileSystemAdapter(t){if(t===undefined){return r.FILE_SYSTEM_ADAPTER}return Object.assign(Object.assign({},r.FILE_SYSTEM_ADAPTER),t)}r.createFileSystemAdapter=createFileSystemAdapter},1917:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;const i=process.versions.node.split(".");if(i[0]===undefined||i[1]===undefined){throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`)}const o=Number.parseInt(i[0],10);const a=Number.parseInt(i[1],10);const c=10;const l=10;const u=o>c;const h=o===c&&a>=l;r.IS_SUPPORT_READDIR_WITH_FILE_TYPES=u||h},6695:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.Settings=r.scandirSync=r.scandir=void 0;const o=i(1551);const a=i(2072);const c=i(1174);r.Settings=c.default;function scandir(t,r,i){if(typeof r==="function"){o.read(t,getSettings(),r);return}o.read(t,getSettings(r),i)}r.scandir=scandir;function scandirSync(t,r){const i=getSettings(r);return a.read(t,i)}r.scandirSync=scandirSync;function getSettings(t={}){if(t instanceof c.default){return t}return new c.default(t)}},1551:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.readdir=r.readdirWithFileTypes=r.read=void 0;const o=i(1092);const a=i(5205);const c=i(1917);const l=i(3175);const u=i(4233);function read(t,r,i){if(!r.stats&&c.IS_SUPPORT_READDIR_WITH_FILE_TYPES){readdirWithFileTypes(t,r,i);return}readdir(t,r,i)}r.read=read;function readdirWithFileTypes(t,r,i){r.fs.readdir(t,{withFileTypes:true},((o,c)=>{if(o!==null){callFailureCallback(i,o);return}const l=c.map((i=>({dirent:i,name:i.name,path:u.joinPathSegments(t,i.name,r.pathSegmentSeparator)})));if(!r.followSymbolicLinks){callSuccessCallback(i,l);return}const h=l.map((t=>makeRplTaskEntry(t,r)));a(h,((t,r)=>{if(t!==null){callFailureCallback(i,t);return}callSuccessCallback(i,r)}))}))}r.readdirWithFileTypes=readdirWithFileTypes;function makeRplTaskEntry(t,r){return i=>{if(!t.dirent.isSymbolicLink()){i(null,t);return}r.fs.stat(t.path,((o,a)=>{if(o!==null){if(r.throwErrorOnBrokenSymbolicLink){i(o);return}i(null,t);return}t.dirent=l.fs.createDirentFromStats(t.name,a);i(null,t)}))}}function readdir(t,r,i){r.fs.readdir(t,((c,h)=>{if(c!==null){callFailureCallback(i,c);return}const d=h.map((i=>{const a=u.joinPathSegments(t,i,r.pathSegmentSeparator);return t=>{o.stat(a,r.fsStatSettings,((o,c)=>{if(o!==null){t(o);return}const u={name:i,path:a,dirent:l.fs.createDirentFromStats(i,c)};if(r.stats){u.stats=c}t(null,u)}))}}));a(d,((t,r)=>{if(t!==null){callFailureCallback(i,t);return}callSuccessCallback(i,r)}))}))}r.readdir=readdir;function callFailureCallback(t,r){t(r)}function callSuccessCallback(t,r){t(null,r)}},4233:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.joinPathSegments=void 0;function joinPathSegments(t,r,i){if(t.endsWith(i)){return t+r}return t+i+r}r.joinPathSegments=joinPathSegments},2072:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.readdir=r.readdirWithFileTypes=r.read=void 0;const o=i(1092);const a=i(1917);const c=i(3175);const l=i(4233);function read(t,r){if(!r.stats&&a.IS_SUPPORT_READDIR_WITH_FILE_TYPES){return readdirWithFileTypes(t,r)}return readdir(t,r)}r.read=read;function readdirWithFileTypes(t,r){const i=r.fs.readdirSync(t,{withFileTypes:true});return i.map((i=>{const o={dirent:i,name:i.name,path:l.joinPathSegments(t,i.name,r.pathSegmentSeparator)};if(o.dirent.isSymbolicLink()&&r.followSymbolicLinks){try{const t=r.fs.statSync(o.path);o.dirent=c.fs.createDirentFromStats(o.name,t)}catch(t){if(r.throwErrorOnBrokenSymbolicLink){throw t}}}return o}))}r.readdirWithFileTypes=readdirWithFileTypes;function readdir(t,r){const i=r.fs.readdirSync(t);return i.map((i=>{const a=l.joinPathSegments(t,i,r.pathSegmentSeparator);const u=o.statSync(a,r.fsStatSettings);const h={name:i,path:a,dirent:c.fs.createDirentFromStats(i,u)};if(r.stats){h.stats=u}return h}))}r.readdir=readdir},1174:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1017);const a=i(1092);const c=i(8057);class Settings{constructor(t={}){this._options=t;this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,false);this.fs=c.createFileSystemAdapter(this._options.fs);this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,o.sep);this.stats=this._getValue(this._options.stats,false);this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,true);this.fsStatSettings=new a.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t!==null&&t!==void 0?t:r}}r["default"]=Settings},3984:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.createDirentFromStats=void 0;class DirentFromStats{constructor(t,r){this.name=t;this.isBlockDevice=r.isBlockDevice.bind(r);this.isCharacterDevice=r.isCharacterDevice.bind(r);this.isDirectory=r.isDirectory.bind(r);this.isFIFO=r.isFIFO.bind(r);this.isFile=r.isFile.bind(r);this.isSocket=r.isSocket.bind(r);this.isSymbolicLink=r.isSymbolicLink.bind(r)}}function createDirentFromStats(t,r){return new DirentFromStats(t,r)}r.createDirentFromStats=createDirentFromStats},3175:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.fs=void 0;const o=i(3984);r.fs=o},2799:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.createFileSystemAdapter=r.FILE_SYSTEM_ADAPTER=void 0;const o=i(7147);r.FILE_SYSTEM_ADAPTER={lstat:o.lstat,stat:o.stat,lstatSync:o.lstatSync,statSync:o.statSync};function createFileSystemAdapter(t){if(t===undefined){return r.FILE_SYSTEM_ADAPTER}return Object.assign(Object.assign({},r.FILE_SYSTEM_ADAPTER),t)}r.createFileSystemAdapter=createFileSystemAdapter},1092:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.statSync=r.stat=r.Settings=void 0;const o=i(8820);const a=i(1968);const c=i(2016);r.Settings=c.default;function stat(t,r,i){if(typeof r==="function"){o.read(t,getSettings(),r);return}o.read(t,getSettings(r),i)}r.stat=stat;function statSync(t,r){const i=getSettings(r);return a.read(t,i)}r.statSync=statSync;function getSettings(t={}){if(t instanceof c.default){return t}return new c.default(t)}},8820:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.read=void 0;function read(t,r,i){r.fs.lstat(t,((o,a)=>{if(o!==null){callFailureCallback(i,o);return}if(!a.isSymbolicLink()||!r.followSymbolicLink){callSuccessCallback(i,a);return}r.fs.stat(t,((t,o)=>{if(t!==null){if(r.throwErrorOnBrokenSymbolicLink){callFailureCallback(i,t);return}callSuccessCallback(i,a);return}if(r.markSymbolicLink){o.isSymbolicLink=()=>true}callSuccessCallback(i,o)}))}))}r.read=read;function callFailureCallback(t,r){t(r)}function callSuccessCallback(t,r){t(null,r)}},1968:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.read=void 0;function read(t,r){const i=r.fs.lstatSync(t);if(!i.isSymbolicLink()||!r.followSymbolicLink){return i}try{const i=r.fs.statSync(t);if(r.markSymbolicLink){i.isSymbolicLink=()=>true}return i}catch(t){if(!r.throwErrorOnBrokenSymbolicLink){return i}throw t}}r.read=read},2016:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2799);class Settings{constructor(t={}){this._options=t;this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,true);this.fs=o.createFileSystemAdapter(this._options.fs);this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,false);this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,true)}_getValue(t,r){return t!==null&&t!==void 0?t:r}}r["default"]=Settings},8734:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.Settings=r.walkStream=r.walkSync=r.walk=void 0;const o=i(7944);const a=i(1241);const c=i(3220);const l=i(567);r.Settings=l.default;function walk(t,r,i){if(typeof r==="function"){new o.default(t,getSettings()).read(r);return}new o.default(t,getSettings(r)).read(i)}r.walk=walk;function walkSync(t,r){const i=getSettings(r);const o=new c.default(t,i);return o.read()}r.walkSync=walkSync;function walkStream(t,r){const i=getSettings(r);const o=new a.default(t,i);return o.read()}r.walkStream=walkStream;function getSettings(t={}){if(t instanceof l.default){return t}return new l.default(t)}},7944:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1528);class AsyncProvider{constructor(t,r){this._root=t;this._settings=r;this._reader=new o.default(this._root,this._settings);this._storage=[]}read(t){this._reader.onError((r=>{callFailureCallback(t,r)}));this._reader.onEntry((t=>{this._storage.push(t)}));this._reader.onEnd((()=>{callSuccessCallback(t,this._storage)}));this._reader.read()}}r["default"]=AsyncProvider;function callFailureCallback(t,r){t(r)}function callSuccessCallback(t,r){t(null,r)}},1241:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2781);const a=i(1528);class StreamProvider{constructor(t,r){this._root=t;this._settings=r;this._reader=new a.default(this._root,this._settings);this._stream=new o.Readable({objectMode:true,read:()=>{},destroy:()=>{if(!this._reader.isDestroyed){this._reader.destroy()}}})}read(){this._reader.onError((t=>{this._stream.emit("error",t)}));this._reader.onEntry((t=>{this._stream.push(t)}));this._reader.onEnd((()=>{this._stream.push(null)}));this._reader.read();return this._stream}}r["default"]=StreamProvider},3220:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2424);class SyncProvider{constructor(t,r){this._root=t;this._settings=r;this._reader=new o.default(this._root,this._settings)}read(){return this._reader.read()}}r["default"]=SyncProvider},1528:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2361);const a=i(6695);const c=i(5826);const l=i(2774);const u=i(1614);class AsyncReader extends u.default{constructor(t,r){super(t,r);this._settings=r;this._scandir=a.scandir;this._emitter=new o.EventEmitter;this._queue=c(this._worker.bind(this),this._settings.concurrency);this._isFatalError=false;this._isDestroyed=false;this._queue.drain=()=>{if(!this._isFatalError){this._emitter.emit("end")}}}read(){this._isFatalError=false;this._isDestroyed=false;setImmediate((()=>{this._pushToQueue(this._root,this._settings.basePath)}));return this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed){throw new Error("The reader is already destroyed")}this._isDestroyed=true;this._queue.killAndDrain()}onEntry(t){this._emitter.on("entry",t)}onError(t){this._emitter.once("error",t)}onEnd(t){this._emitter.once("end",t)}_pushToQueue(t,r){const i={directory:t,base:r};this._queue.push(i,(t=>{if(t!==null){this._handleError(t)}}))}_worker(t,r){this._scandir(t.directory,this._settings.fsScandirSettings,((i,o)=>{if(i!==null){r(i,undefined);return}for(const r of o){this._handleEntry(r,t.base)}r(null,undefined)}))}_handleError(t){if(this._isDestroyed||!l.isFatalError(this._settings,t)){return}this._isFatalError=true;this._isDestroyed=true;this._emitter.emit("error",t)}_handleEntry(t,r){if(this._isDestroyed||this._isFatalError){return}const i=t.path;if(r!==undefined){t.path=l.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)}if(l.isAppliedFilter(this._settings.entryFilter,t)){this._emitEntry(t)}if(t.dirent.isDirectory()&&l.isAppliedFilter(this._settings.deepFilter,t)){this._pushToQueue(i,r===undefined?undefined:t.path)}}_emitEntry(t){this._emitter.emit("entry",t)}}r["default"]=AsyncReader},2774:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.joinPathSegments=r.replacePathSegmentSeparator=r.isAppliedFilter=r.isFatalError=void 0;function isFatalError(t,r){if(t.errorFilter===null){return true}return!t.errorFilter(r)}r.isFatalError=isFatalError;function isAppliedFilter(t,r){return t===null||t(r)}r.isAppliedFilter=isAppliedFilter;function replacePathSegmentSeparator(t,r){return t.split(/[/\\]/).join(r)}r.replacePathSegmentSeparator=replacePathSegmentSeparator;function joinPathSegments(t,r,i){if(t===""){return r}if(t.endsWith(i)){return t+r}return t+i+r}r.joinPathSegments=joinPathSegments},1614:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(2774);class Reader{constructor(t,r){this._root=t;this._settings=r;this._root=o.replacePathSegmentSeparator(t,r.pathSegmentSeparator)}}r["default"]=Reader},2424:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(6695);const a=i(2774);const c=i(1614);class SyncReader extends c.default{constructor(){super(...arguments);this._scandir=o.scandirSync;this._storage=[];this._queue=new Set}read(){this._pushToQueue(this._root,this._settings.basePath);this._handleQueue();return this._storage}_pushToQueue(t,r){this._queue.add({directory:t,base:r})}_handleQueue(){for(const t of this._queue.values()){this._handleDirectory(t.directory,t.base)}}_handleDirectory(t,r){try{const i=this._scandir(t,this._settings.fsScandirSettings);for(const t of i){this._handleEntry(t,r)}}catch(t){this._handleError(t)}}_handleError(t){if(!a.isFatalError(this._settings,t)){return}throw t}_handleEntry(t,r){const i=t.path;if(r!==undefined){t.path=a.joinPathSegments(r,t.name,this._settings.pathSegmentSeparator)}if(a.isAppliedFilter(this._settings.entryFilter,t)){this._pushToStorage(t)}if(t.dirent.isDirectory()&&a.isAppliedFilter(this._settings.deepFilter,t)){this._pushToQueue(i,r===undefined?undefined:t.path)}}_pushToStorage(t){this._storage.push(t)}}r["default"]=SyncReader},567:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(1017);const a=i(6695);class Settings{constructor(t={}){this._options=t;this.basePath=this._getValue(this._options.basePath,undefined);this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY);this.deepFilter=this._getValue(this._options.deepFilter,null);this.entryFilter=this._getValue(this._options.entryFilter,null);this.errorFilter=this._getValue(this._options.errorFilter,null);this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,o.sep);this.fsScandirSettings=new a.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(t,r){return t!==null&&t!==void 0?t:r}}r["default"]=Settings},9047:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.formatNames=r.fastFormats=r.fullFormats=void 0;function fmtDef(t,r){return{validate:t,compare:r}}r.fullFormats={date:fmtDef(date,compareDate),time:fmtDef(time,compareTime),"date-time":fmtDef(date_time,compareDateTime),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:uri,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[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a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:regex,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:byte,int32:{type:"number",validate:validateInt32},int64:{type:"number",validate:validateInt64},float:{type:"number",validate:validateNumber},double:{type:"number",validate:validateNumber},password:true,binary:true};r.fastFormats={...r.fullFormats,date:fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,compareDate),time:fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,compareTime),"date-time":fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,compareDateTime),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};r.formatNames=Object.keys(r.fullFormats);function isLeapYear(t){return t%4===0&&(t%100!==0||t%400===0)}const i=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;const o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function date(t){const r=i.exec(t);if(!r)return false;const a=+r[1];const c=+r[2];const l=+r[3];return c>=1&&c<=12&&l>=1&&l<=(c===2&&isLeapYear(a)?29:o[c])}function compareDate(t,r){if(!(t&&r))return undefined;if(t>r)return 1;if(t<r)return-1;return 0}const a=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function time(t,r){const i=a.exec(t);if(!i)return false;const o=+i[1];const c=+i[2];const l=+i[3];const u=i[5];return(o<=23&&c<=59&&l<=59||o===23&&c===59&&l===60)&&(!r||u!=="")}function compareTime(t,r){if(!(t&&r))return undefined;const i=a.exec(t);const o=a.exec(r);if(!(i&&o))return undefined;t=i[1]+i[2]+i[3]+(i[4]||"");r=o[1]+o[2]+o[3]+(o[4]||"");if(t>r)return 1;if(t<r)return-1;return 0}const c=/t|\s/i;function date_time(t){const r=t.split(c);return r.length===2&&date(r[0])&&time(r[1],true)}function compareDateTime(t,r){if(!(t&&r))return undefined;const[i,o]=t.split(c);const[a,l]=r.split(c);const u=compareDate(i,a);if(u===undefined)return undefined;return u||compareTime(o,l)}const l=/\/|:/;const u=/^(?:[a-z][a-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:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function uri(t){return l.test(t)&&u.test(t)}const h=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function byte(t){h.lastIndex=0;return h.test(t)}const d=-(2**31);const p=2**31-1;function validateInt32(t){return Number.isInteger(t)&&t<=p&&t>=d}function validateInt64(t){return Number.isInteger(t)}function validateNumber(){return true}const g=/[^\\]\\Z/;function regex(t){if(g.test(t))return false;try{new RegExp(t);return true}catch(t){return false}}},1870:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});const o=i(9047);const a=i(4597);const c=i(3651);const l=new c.Name("fullFormats");const u=new c.Name("fastFormats");const formatsPlugin=(t,r={keywords:true})=>{if(Array.isArray(r)){addFormats(t,r,o.fullFormats,l);return t}const[i,c]=r.mode==="fast"?[o.fastFormats,u]:[o.fullFormats,l];const h=r.formats||o.formatNames;addFormats(t,h,i,c);if(r.keywords)a.default(t);return t};formatsPlugin.get=(t,r="full")=>{const i=r==="fast"?o.fastFormats:o.fullFormats;const a=i[t];if(!a)throw new Error(`Unknown format "${t}"`);return a};function addFormats(t,r,i,o){var a;var l;(a=(l=t.opts.code).formats)!==null&&a!==void 0?a:l.formats=c._`require("ajv-formats/dist/formats").${o}`;for(const o of r)t.addFormat(o,i[o])}t.exports=r=formatsPlugin;Object.defineProperty(r,"__esModule",{value:true});r["default"]=formatsPlugin},4597:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.formatLimitDefinition=void 0;const o=i(8124);const a=i(3651);const c=a.operators;const l={formatMaximum:{okStr:"<=",ok:c.LTE,fail:c.GT},formatMinimum:{okStr:">=",ok:c.GTE,fail:c.LT},formatExclusiveMaximum:{okStr:"<",ok:c.LT,fail:c.GTE},formatExclusiveMinimum:{okStr:">",ok:c.GT,fail:c.LTE}};const u={message:({keyword:t,schemaCode:r})=>a.str`should be ${l[t].okStr} ${r}`,params:({keyword:t,schemaCode:r})=>a._`{comparison: ${l[t].okStr}, limit: ${r}}`};r.formatLimitDefinition={keyword:Object.keys(l),type:"string",schemaType:"string",$data:true,error:u,code(t){const{gen:r,data:i,schemaCode:c,keyword:u,it:h}=t;const{opts:d,self:p}=h;if(!d.validateFormats)return;const g=new o.KeywordCxt(h,p.RULES.all.format.definition,"format");if(g.$data)validate$DataFormat();else validateFormat();function validate$DataFormat(){const i=r.scopeValue("formats",{ref:p.formats,code:d.code.formats});const o=r.const("fmt",a._`${i}[${g.schemaCode}]`);t.fail$data(a.or(a._`typeof ${o} != "object"`,a._`${o} instanceof RegExp`,a._`typeof ${o}.compare != "function"`,compareCode(o)))}function validateFormat(){const i=g.schema;const o=p.formats[i];if(!o||o===true)return;if(typeof o!="object"||o instanceof RegExp||typeof o.compare!="function"){throw new Error(`"${u}": format "${i}" does not define "compare" function`)}const c=r.scopeValue("formats",{key:i,ref:o,code:d.code.formats?a._`${d.code.formats}${a.getProperty(i)}`:undefined});t.fail$data(compareCode(c))}function compareCode(t){return a._`${t}.compare(${i}, ${c}) ${l[u].fail} 0`}},dependencies:["format"]};const formatLimitPlugin=t=>{t.addKeyword(r.formatLimitDefinition);return t};r["default"]=formatLimitPlugin},8124:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.MissingRefError=r.ValidationError=r.CodeGen=r.Name=r.nil=r.stringify=r.str=r._=r.KeywordCxt=r.Ajv=void 0;const o=i(2659);const a=i(7629);const c=i(8396);const l=i(7290);const u=["/properties"];const h="http://json-schema.org/draft-07/schema";class Ajv extends o.default{_addVocabularies(){super._addVocabularies();a.default.forEach((t=>this.addVocabulary(t)));if(this.opts.discriminator)this.addKeyword(c.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();if(!this.opts.meta)return;const t=this.opts.$data?this.$dataMetaSchema(l,u):l;this.addMetaSchema(t,h,false);this.refs["http://json-schema.org/schema"]=h}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(h)?h:undefined)}}r.Ajv=Ajv;t.exports=r=Ajv;t.exports.Ajv=Ajv;Object.defineProperty(r,"__esModule",{value:true});r["default"]=Ajv;var d=i(93);Object.defineProperty(r,"KeywordCxt",{enumerable:true,get:function(){return d.KeywordCxt}});var p=i(3651);Object.defineProperty(r,"_",{enumerable:true,get:function(){return p._}});Object.defineProperty(r,"str",{enumerable:true,get:function(){return p.str}});Object.defineProperty(r,"stringify",{enumerable:true,get:function(){return p.stringify}});Object.defineProperty(r,"nil",{enumerable:true,get:function(){return p.nil}});Object.defineProperty(r,"Name",{enumerable:true,get:function(){return p.Name}});Object.defineProperty(r,"CodeGen",{enumerable:true,get:function(){return p.CodeGen}});var g=i(7917);Object.defineProperty(r,"ValidationError",{enumerable:true,get:function(){return g.default}});var y=i(2742);Object.defineProperty(r,"MissingRefError",{enumerable:true,get:function(){return y.default}})},2205:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.regexpCode=r.getEsmExportName=r.getProperty=r.safeStringify=r.stringify=r.strConcat=r.addCodeArg=r.str=r._=r.nil=r._Code=r.Name=r.IDENTIFIER=r._CodeOrName=void 0;class _CodeOrName{}r._CodeOrName=_CodeOrName;r.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Name extends _CodeOrName{constructor(t){super();if(!r.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return false}get names(){return{[this.str]:1}}}r.Name=Name;class _Code extends _CodeOrName{constructor(t){super();this._items=typeof t==="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return false;const t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce(((t,r)=>`${t}${r}`),"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce(((t,r)=>{if(r instanceof Name)t[r.str]=(t[r.str]||0)+1;return t}),{})}}r._Code=_Code;r.nil=new _Code("");function _(t,...r){const i=[t[0]];let o=0;while(o<r.length){addCodeArg(i,r[o]);i.push(t[++o])}return new _Code(i)}r._=_;const i=new _Code("+");function str(t,...r){const o=[safeStringify(t[0])];let a=0;while(a<r.length){o.push(i);addCodeArg(o,r[a]);o.push(i,safeStringify(t[++a]))}optimize(o);return new _Code(o)}r.str=str;function addCodeArg(t,r){if(r instanceof _Code)t.push(...r._items);else if(r instanceof Name)t.push(r);else t.push(interpolate(r))}r.addCodeArg=addCodeArg;function optimize(t){let r=1;while(r<t.length-1){if(t[r]===i){const i=mergeExprItems(t[r-1],t[r+1]);if(i!==undefined){t.splice(r-1,3,i);continue}t[r++]="+"}r++}}function mergeExprItems(t,r){if(r==='""')return t;if(t==='""')return r;if(typeof t=="string"){if(r instanceof Name||t[t.length-1]!=='"')return;if(typeof r!="string")return`${t.slice(0,-1)}${r}"`;if(r[0]==='"')return t.slice(0,-1)+r.slice(1);return}if(typeof r=="string"&&r[0]==='"'&&!(t instanceof Name))return`"${t}${r.slice(1)}`;return}function strConcat(t,r){return r.emptyStr()?t:t.emptyStr()?r:str`${t}${r}`}r.strConcat=strConcat;function interpolate(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:safeStringify(Array.isArray(t)?t.join(","):t)}function stringify(t){return new _Code(safeStringify(t))}r.stringify=stringify;function safeStringify(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}r.safeStringify=safeStringify;function getProperty(t){return typeof t=="string"&&r.IDENTIFIER.test(t)?new _Code(`.${t}`):_`[${t}]`}r.getProperty=getProperty;function getEsmExportName(t){if(typeof t=="string"&&r.IDENTIFIER.test(t)){return new _Code(`${t}`)}throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}r.getEsmExportName=getEsmExportName;function regexpCode(t){return new _Code(t.toString())}r.regexpCode=regexpCode},3651:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.or=r.and=r.not=r.CodeGen=r.operators=r.varKinds=r.ValueScopeName=r.ValueScope=r.Scope=r.Name=r.regexpCode=r.stringify=r.getProperty=r.nil=r.strConcat=r.str=r._=void 0;const o=i(2205);const a=i(4877);var c=i(2205);Object.defineProperty(r,"_",{enumerable:true,get:function(){return c._}});Object.defineProperty(r,"str",{enumerable:true,get:function(){return c.str}});Object.defineProperty(r,"strConcat",{enumerable:true,get:function(){return c.strConcat}});Object.defineProperty(r,"nil",{enumerable:true,get:function(){return c.nil}});Object.defineProperty(r,"getProperty",{enumerable:true,get:function(){return c.getProperty}});Object.defineProperty(r,"stringify",{enumerable:true,get:function(){return c.stringify}});Object.defineProperty(r,"regexpCode",{enumerable:true,get:function(){return c.regexpCode}});Object.defineProperty(r,"Name",{enumerable:true,get:function(){return c.Name}});var l=i(4877);Object.defineProperty(r,"Scope",{enumerable:true,get:function(){return l.Scope}});Object.defineProperty(r,"ValueScope",{enumerable:true,get:function(){return l.ValueScope}});Object.defineProperty(r,"ValueScopeName",{enumerable:true,get:function(){return l.ValueScopeName}});Object.defineProperty(r,"varKinds",{enumerable:true,get:function(){return l.varKinds}});r.operators={GT:new o._Code(">"),GTE:new o._Code(">="),LT:new o._Code("<"),LTE:new o._Code("<="),EQ:new o._Code("==="),NEQ:new o._Code("!=="),NOT:new o._Code("!"),OR:new o._Code("||"),AND:new o._Code("&&"),ADD:new o._Code("+")};class Node{optimizeNodes(){return this}optimizeNames(t,r){return this}}class Def extends Node{constructor(t,r,i){super();this.varKind=t;this.name=r;this.rhs=i}render({es5:t,_n:r}){const i=t?a.varKinds.var:this.varKind;const o=this.rhs===undefined?"":` = ${this.rhs}`;return`${i} ${this.name}${o};`+r}optimizeNames(t,r){if(!t[this.name.str])return;if(this.rhs)this.rhs=optimizeExpr(this.rhs,t,r);return this}get names(){return this.rhs instanceof o._CodeOrName?this.rhs.names:{}}}class Assign extends Node{constructor(t,r,i){super();this.lhs=t;this.rhs=r;this.sideEffects=i}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(this.lhs instanceof o.Name&&!t[this.lhs.str]&&!this.sideEffects)return;this.rhs=optimizeExpr(this.rhs,t,r);return this}get names(){const t=this.lhs instanceof o.Name?{}:{...this.lhs.names};return addExprNames(t,this.rhs)}}class AssignOp extends Assign{constructor(t,r,i,o){super(t,i,o);this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}}class Label extends Node{constructor(t){super();this.label=t;this.names={}}render({_n:t}){return`${this.label}:`+t}}class Break extends Node{constructor(t){super();this.label=t;this.names={}}render({_n:t}){const r=this.label?` ${this.label}`:"";return`break${r};`+t}}class Throw extends Node{constructor(t){super();this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}}class AnyCode extends Node{constructor(t){super();this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:undefined}optimizeNames(t,r){this.code=optimizeExpr(this.code,t,r);return this}get names(){return this.code instanceof o._CodeOrName?this.code.names:{}}}class ParentNode extends Node{constructor(t=[]){super();this.nodes=t}render(t){return this.nodes.reduce(((r,i)=>r+i.render(t)),"")}optimizeNodes(){const{nodes:t}=this;let r=t.length;while(r--){const i=t[r].optimizeNodes();if(Array.isArray(i))t.splice(r,1,...i);else if(i)t[r]=i;else t.splice(r,1)}return t.length>0?this:undefined}optimizeNames(t,r){const{nodes:i}=this;let o=i.length;while(o--){const a=i[o];if(a.optimizeNames(t,r))continue;subtractNames(t,a.names);i.splice(o,1)}return i.length>0?this:undefined}get names(){return this.nodes.reduce(((t,r)=>addNames(t,r.names)),{})}}class BlockNode extends ParentNode{render(t){return"{"+t._n+super.render(t)+"}"+t._n}}class Root extends ParentNode{}class Else extends BlockNode{}Else.kind="else";class If extends BlockNode{constructor(t,r){super(r);this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);if(this.else)r+="else "+this.else.render(t);return r}optimizeNodes(){super.optimizeNodes();const t=this.condition;if(t===true)return this.nodes;let r=this.else;if(r){const t=r.optimizeNodes();r=this.else=Array.isArray(t)?new Else(t):t}if(r){if(t===false)return r instanceof If?r:r.nodes;if(this.nodes.length)return this;return new If(not(t),r instanceof If?[r]:r.nodes)}if(t===false||!this.nodes.length)return undefined;return this}optimizeNames(t,r){var i;this.else=(i=this.else)===null||i===void 0?void 0:i.optimizeNames(t,r);if(!(super.optimizeNames(t,r)||this.else))return;this.condition=optimizeExpr(this.condition,t,r);return this}get names(){const t=super.names;addExprNames(t,this.condition);if(this.else)addNames(t,this.else.names);return t}}If.kind="if";class For extends BlockNode{}For.kind="for";class ForLoop extends For{constructor(t){super();this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(!super.optimizeNames(t,r))return;this.iteration=optimizeExpr(this.iteration,t,r);return this}get names(){return addNames(super.names,this.iteration.names)}}class ForRange extends For{constructor(t,r,i,o){super();this.varKind=t;this.name=r;this.from=i;this.to=o}render(t){const r=t.es5?a.varKinds.var:this.varKind;const{name:i,from:o,to:c}=this;return`for(${r} ${i}=${o}; ${i}<${c}; ${i}++)`+super.render(t)}get names(){const t=addExprNames(super.names,this.from);return addExprNames(t,this.to)}}class ForIter extends For{constructor(t,r,i,o){super();this.loop=t;this.varKind=r;this.name=i;this.iterable=o}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(!super.optimizeNames(t,r))return;this.iterable=optimizeExpr(this.iterable,t,r);return this}get names(){return addNames(super.names,this.iterable.names)}}class Func extends BlockNode{constructor(t,r,i){super();this.name=t;this.args=r;this.async=i}render(t){const r=this.async?"async ":"";return`${r}function ${this.name}(${this.args})`+super.render(t)}}Func.kind="func";class Return extends ParentNode{render(t){return"return "+super.render(t)}}Return.kind="return";class Try extends BlockNode{render(t){let r="try"+super.render(t);if(this.catch)r+=this.catch.render(t);if(this.finally)r+=this.finally.render(t);return r}optimizeNodes(){var t,r;super.optimizeNodes();(t=this.catch)===null||t===void 0?void 0:t.optimizeNodes();(r=this.finally)===null||r===void 0?void 0:r.optimizeNodes();return this}optimizeNames(t,r){var i,o;super.optimizeNames(t,r);(i=this.catch)===null||i===void 0?void 0:i.optimizeNames(t,r);(o=this.finally)===null||o===void 0?void 0:o.optimizeNames(t,r);return this}get names(){const t=super.names;if(this.catch)addNames(t,this.catch.names);if(this.finally)addNames(t,this.finally.names);return t}}class Catch extends BlockNode{constructor(t){super();this.error=t}render(t){return`catch(${this.error})`+super.render(t)}}Catch.kind="catch";class Finally extends BlockNode{render(t){return"finally"+super.render(t)}}Finally.kind="finally";class CodeGen{constructor(t,r={}){this._values={};this._blockStarts=[];this._constants={};this.opts={...r,_n:r.lines?"\n":""};this._extScope=t;this._scope=new a.Scope({parent:t});this._nodes=[new Root]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){const i=this._extScope.value(t,r);const o=this._values[i.prefix]||(this._values[i.prefix]=new Set);o.add(i);return i}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,i,o){const a=this._scope.toName(r);if(i!==undefined&&o)this._constants[a.str]=i;this._leafNode(new Def(t,a,i));return a}const(t,r,i){return this._def(a.varKinds.const,t,r,i)}let(t,r,i){return this._def(a.varKinds.let,t,r,i)}var(t,r,i){return this._def(a.varKinds.var,t,r,i)}assign(t,r,i){return this._leafNode(new Assign(t,r,i))}add(t,i){return this._leafNode(new AssignOp(t,r.operators.ADD,i))}code(t){if(typeof t=="function")t();else if(t!==o.nil)this._leafNode(new AnyCode(t));return this}object(...t){const r=["{"];for(const[i,a]of t){if(r.length>1)r.push(",");r.push(i);if(i!==a||this.opts.es5){r.push(":");(0,o.addCodeArg)(r,a)}}r.push("}");return new o._Code(r)}if(t,r,i){this._blockNode(new If(t));if(r&&i){this.code(r).else().code(i).endIf()}else if(r){this.code(r).endIf()}else if(i){throw new Error('CodeGen: "else" body without "then" body')}return this}elseIf(t){return this._elseNode(new If(t))}else(){return this._elseNode(new Else)}endIf(){return this._endBlockNode(If,Else)}_for(t,r){this._blockNode(t);if(r)this.code(r).endFor();return this}for(t,r){return this._for(new ForLoop(t),r)}forRange(t,r,i,o,c=(this.opts.es5?a.varKinds.var:a.varKinds.let)){const l=this._scope.toName(t);return this._for(new ForRange(c,l,r,i),(()=>o(l)))}forOf(t,r,i,c=a.varKinds.const){const l=this._scope.toName(t);if(this.opts.es5){const t=r instanceof o.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,o._)`${t}.length`,(r=>{this.var(l,(0,o._)`${t}[${r}]`);i(l)}))}return this._for(new ForIter("of",c,l,r),(()=>i(l)))}forIn(t,r,i,c=(this.opts.es5?a.varKinds.var:a.varKinds.const)){if(this.opts.ownProperties){return this.forOf(t,(0,o._)`Object.keys(${r})`,i)}const l=this._scope.toName(t);return this._for(new ForIter("in",c,l,r),(()=>i(l)))}endFor(){return this._endBlockNode(For)}label(t){return this._leafNode(new Label(t))}break(t){return this._leafNode(new Break(t))}return(t){const r=new Return;this._blockNode(r);this.code(t);if(r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Return)}try(t,r,i){if(!r&&!i)throw new Error('CodeGen: "try" without "catch" and "finally"');const o=new Try;this._blockNode(o);this.code(t);if(r){const t=this.name("e");this._currNode=o.catch=new Catch(t);r(t)}if(i){this._currNode=o.finally=new Finally;this.code(i)}return this._endBlockNode(Catch,Finally)}throw(t){return this._leafNode(new Throw(t))}block(t,r){this._blockStarts.push(this._nodes.length);if(t)this.code(t).endBlock(r);return this}endBlock(t){const r=this._blockStarts.pop();if(r===undefined)throw new Error("CodeGen: not in self-balancing block");const i=this._nodes.length-r;if(i<0||t!==undefined&&i!==t){throw new Error(`CodeGen: wrong number of nodes: ${i} vs ${t} expected`)}this._nodes.length=r;return this}func(t,r=o.nil,i,a){this._blockNode(new Func(t,r,i));if(a)this.code(a).endFunc();return this}endFunc(){return this._endBlockNode(Func)}optimize(t=1){while(t-- >0){this._root.optimizeNodes();this._root.optimizeNames(this._root.names,this._constants)}}_leafNode(t){this._currNode.nodes.push(t);return this}_blockNode(t){this._currNode.nodes.push(t);this._nodes.push(t)}_endBlockNode(t,r){const i=this._currNode;if(i instanceof t||r&&i instanceof r){this._nodes.pop();return this}throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){const r=this._currNode;if(!(r instanceof If)){throw new Error('CodeGen: "else" without "if"')}this._currNode=r.else=t;return this}get _root(){return this._nodes[0]}get _currNode(){const t=this._nodes;return t[t.length-1]}set _currNode(t){const r=this._nodes;r[r.length-1]=t}}r.CodeGen=CodeGen;function addNames(t,r){for(const i in r)t[i]=(t[i]||0)+(r[i]||0);return t}function addExprNames(t,r){return r instanceof o._CodeOrName?addNames(t,r.names):t}function optimizeExpr(t,r,i){if(t instanceof o.Name)return replaceName(t);if(!canOptimize(t))return t;return new o._Code(t._items.reduce(((t,r)=>{if(r instanceof o.Name)r=replaceName(r);if(r instanceof o._Code)t.push(...r._items);else t.push(r);return t}),[]));function replaceName(t){const o=i[t.str];if(o===undefined||r[t.str]!==1)return t;delete r[t.str];return o}function canOptimize(t){return t instanceof o._Code&&t._items.some((t=>t instanceof o.Name&&r[t.str]===1&&i[t.str]!==undefined))}}function subtractNames(t,r){for(const i in r)t[i]=(t[i]||0)-(r[i]||0)}function not(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,o._)`!${par(t)}`}r.not=not;const u=mappend(r.operators.AND);function and(...t){return t.reduce(u)}r.and=and;const h=mappend(r.operators.OR);function or(...t){return t.reduce(h)}r.or=or;function mappend(t){return(r,i)=>r===o.nil?i:i===o.nil?r:(0,o._)`${par(r)} ${t} ${par(i)}`}function par(t){return t instanceof o.Name?t:(0,o._)`(${t})`}},4877:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.ValueScope=r.ValueScopeName=r.Scope=r.varKinds=r.UsedValueState=void 0;const o=i(2205);class ValueError extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`);this.value=t.value}}var a;(function(t){t[t["Started"]=0]="Started";t[t["Completed"]=1]="Completed"})(a||(r.UsedValueState=a={}));r.varKinds={const:new o.Name("const"),let:new o.Name("let"),var:new o.Name("var")};class Scope{constructor({prefixes:t,parent:r}={}){this._names={};this._prefixes=t;this._parent=r}toName(t){return t instanceof o.Name?t:this.name(t)}name(t){return new o.Name(this._newName(t))}_newName(t){const r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,i;if(((i=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||i===void 0?void 0:i.has(t))||this._prefixes&&!this._prefixes.has(t)){throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`)}return this._names[t]={prefix:t,index:0}}}r.Scope=Scope;class ValueScopeName extends o.Name{constructor(t,r){super(r);this.prefix=t}setValue(t,{property:r,itemIndex:i}){this.value=t;this.scopePath=(0,o._)`.${new o.Name(r)}[${i}]`}}r.ValueScopeName=ValueScopeName;const c=(0,o._)`\n`;class ValueScope extends Scope{constructor(t){super(t);this._values={};this._scope=t.scope;this.opts={...t,_n:t.lines?c:o.nil}}get(){return this._scope}name(t){return new ValueScopeName(t,this._newName(t))}value(t,r){var i;if(r.ref===undefined)throw new Error("CodeGen: ref must be passed in value");const o=this.toName(t);const{prefix:a}=o;const c=(i=r.key)!==null&&i!==void 0?i:r.ref;let l=this._values[a];if(l){const t=l.get(c);if(t)return t}else{l=this._values[a]=new Map}l.set(c,o);const u=this._scope[a]||(this._scope[a]=[]);const h=u.length;u[h]=r.ref;o.setValue(r,{property:a,itemIndex:h});return o}getValue(t,r){const i=this._values[t];if(!i)return;return i.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,(r=>{if(r.scopePath===undefined)throw new Error(`CodeGen: name "${r}" has no value`);return(0,o._)`${t}${r.scopePath}`}))}scopeCode(t=this._values,r,i){return this._reduceValues(t,(t=>{if(t.value===undefined)throw new Error(`CodeGen: name "${t}" has no value`);return t.value.code}),r,i)}_reduceValues(t,i,c={},l){let u=o.nil;for(const h in t){const d=t[h];if(!d)continue;const p=c[h]=c[h]||new Map;d.forEach((t=>{if(p.has(t))return;p.set(t,a.Started);let c=i(t);if(c){const i=this.opts.es5?r.varKinds.var:r.varKinds.const;u=(0,o._)`${u}${i} ${t} = ${c};${this.opts._n}`}else if(c=l===null||l===void 0?void 0:l(t)){u=(0,o._)`${u}${c}${this.opts._n}`}else{throw new ValueError(t)}p.set(t,a.Completed)}))}return u}}r.ValueScope=ValueScope},5177:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.extendErrors=r.resetErrorsCount=r.reportExtraError=r.reportError=r.keyword$DataError=r.keywordError=void 0;const o=i(3651);const a=i(3593);const c=i(1711);r.keywordError={message:({keyword:t})=>(0,o.str)`must pass "${t}" keyword validation`};r.keyword$DataError={message:({keyword:t,schemaType:r})=>r?(0,o.str)`"${t}" keyword must be ${r} ($data)`:(0,o.str)`"${t}" keyword is invalid ($data)`};function reportError(t,i=r.keywordError,a,c){const{it:l}=t;const{gen:u,compositeRule:h,allErrors:d}=l;const p=errorObjectCode(t,i,a);if(c!==null&&c!==void 0?c:h||d){addError(u,p)}else{returnErrors(l,(0,o._)`[${p}]`)}}r.reportError=reportError;function reportExtraError(t,i=r.keywordError,o){const{it:a}=t;const{gen:l,compositeRule:u,allErrors:h}=a;const d=errorObjectCode(t,i,o);addError(l,d);if(!(u||h)){returnErrors(a,c.default.vErrors)}}r.reportExtraError=reportExtraError;function resetErrorsCount(t,r){t.assign(c.default.errors,r);t.if((0,o._)`${c.default.vErrors} !== null`,(()=>t.if(r,(()=>t.assign((0,o._)`${c.default.vErrors}.length`,r)),(()=>t.assign(c.default.vErrors,null)))))}r.resetErrorsCount=resetErrorsCount;function extendErrors({gen:t,keyword:r,schemaValue:i,data:a,errsCount:l,it:u}){if(l===undefined)throw new Error("ajv implementation error");const h=t.name("err");t.forRange("i",l,c.default.errors,(l=>{t.const(h,(0,o._)`${c.default.vErrors}[${l}]`);t.if((0,o._)`${h}.instancePath === undefined`,(()=>t.assign((0,o._)`${h}.instancePath`,(0,o.strConcat)(c.default.instancePath,u.errorPath))));t.assign((0,o._)`${h}.schemaPath`,(0,o.str)`${u.errSchemaPath}/${r}`);if(u.opts.verbose){t.assign((0,o._)`${h}.schema`,i);t.assign((0,o._)`${h}.data`,a)}}))}r.extendErrors=extendErrors;function addError(t,r){const i=t.const("err",r);t.if((0,o._)`${c.default.vErrors} === null`,(()=>t.assign(c.default.vErrors,(0,o._)`[${i}]`)),(0,o._)`${c.default.vErrors}.push(${i})`);t.code((0,o._)`${c.default.errors}++`)}function returnErrors(t,r){const{gen:i,validateName:a,schemaEnv:c}=t;if(c.$async){i.throw((0,o._)`new ${t.ValidationError}(${r})`)}else{i.assign((0,o._)`${a}.errors`,r);i.return(false)}}const l={keyword:new o.Name("keyword"),schemaPath:new o.Name("schemaPath"),params:new o.Name("params"),propertyName:new o.Name("propertyName"),message:new o.Name("message"),schema:new o.Name("schema"),parentSchema:new o.Name("parentSchema")};function errorObjectCode(t,r,i){const{createErrors:a}=t.it;if(a===false)return(0,o._)`{}`;return errorObject(t,r,i)}function errorObject(t,r,i={}){const{gen:o,it:a}=t;const c=[errorInstancePath(a,i),errorSchemaPath(t,i)];extraErrorProps(t,r,c);return o.object(...c)}function errorInstancePath({errorPath:t},{instancePath:r}){const i=r?(0,o.str)`${t}${(0,a.getErrorPath)(r,a.Type.Str)}`:t;return[c.default.instancePath,(0,o.strConcat)(c.default.instancePath,i)]}function errorSchemaPath({keyword:t,it:{errSchemaPath:r}},{schemaPath:i,parentSchema:c}){let u=c?r:(0,o.str)`${r}/${t}`;if(i){u=(0,o.str)`${u}${(0,a.getErrorPath)(i,a.Type.Str)}`}return[l.schemaPath,u]}function extraErrorProps(t,{params:r,message:i},a){const{keyword:u,data:h,schemaValue:d,it:p}=t;const{opts:g,propertyName:y,topSchemaRef:v,schemaPath:b}=p;a.push([l.keyword,u],[l.params,typeof r=="function"?r(t):r||(0,o._)`{}`]);if(g.messages){a.push([l.message,typeof i=="function"?i(t):i])}if(g.verbose){a.push([l.schema,d],[l.parentSchema,(0,o._)`${v}${b}`],[c.default.data,h])}if(y)a.push([l.propertyName,y])}},2051:(t,r,i)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.resolveSchema=r.getCompilingSchema=r.resolveRef=r.compileSchema=r.SchemaEnv=void 0;const o=i(3651);const a=i(7917);const c=i(1711);const l=i(6327);const u=i(3593);const h=i(93);class SchemaEnv{constructor(t){var r;this.refs={};this.dynamicAnchors={};let i;if(typeof t.schema=="object")i=t.schema;this.schema=t.schema;this.schemaId=t.schemaId;this.root=t.root||this;this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,l.normalizeId)(i===null||i===void 0?void 0:i[t.schemaId||"$id"]);this.schemaPath=t.schemaPath;this.localRefs=t.localRefs;this.meta=t.meta;this.$async=i===null||i===void 0?void 0:i.$async;this.refs={}}}r.SchemaEnv=SchemaEnv;function compileSchema(t){const r=getCompilingSchema.call(this,t);if(r)return r;const i=(0,l.getFullPath)(this.opts.uriResolver,t.root.baseId);const{es5:u,lines:d}=this.opts.code;const{ownProperties:p}=this.opts;const g=new o.CodeGen(this.scope,{es5:u,lines:d,ownProperties:p});let y;if(t.$async){y=g.scopeValue("Error",{ref:a.default,code:(0,o._)`require("ajv/dist/runtime/validation_error").default`})}const v=g.scopeName("validate");t.validateName=v;const b={gen:g,allErrors:this.opts.allErrors,data:c.default.data,parentData:c.default.parentData,parentDataProperty:c.default.parentDataProperty,dataN