@bonsae/nrg-runtime 0.33.0 → 0.35.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonsae/nrg-runtime",
3
- "version": "0.33.0",
3
+ "version": "0.35.0",
4
4
  "description": "The runtime for Node-RED nodes built with @bonsae/nrg — node base classes, schemas, AJV validator, and the editor client. Carries no build tooling.",
5
5
  "author": "Allan Oricil <allanoricil@duck.com>",
6
6
  "license": "MIT",
@@ -0,0 +1,20 @@
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.nrg-tray-content[data-v-715e36f4]{height:100%;padding:12px;box-sizing:border-box}.nrg-label[data-v-ec9d13ab]{display:inline-block;width:100%;margin-bottom:4px;cursor:default}.nrg-label i[data-v-ec9d13ab]{margin-right:5px}.nrg-required[data-v-ec9d13ab]{color:var(--red-ui-text-color-error);margin-left:2px}.editor-wrapper[data-v-6971120f]{position:relative}.expand-button[data-v-6971120f]{position:absolute;top:-23px;right:0;z-index:10;transition:color .3s ease;cursor:pointer}.expanded-editor-host[data-v-6971120f]{height:100%}.nrg-schema-editor[data-v-d46acc22]{display:block;height:100%}.nrg-schema-editor[data-v-d46acc22] .container,.nrg-schema-editor[data-v-d46acc22] .editor-wrapper{height:100%}.nrg-form-app[data-v-94314aba]{padding-bottom:16px}.nrg-lifecycle-port[data-v-94314aba]{white-space:nowrap}.nrg-lifecycle td.nrg-lifecycle-desc[data-v-94314aba]{text-align:left;white-space:nowrap;color:var(--red-ui-text-color-disabled, #999)}.nrg-help-list[data-v-94314aba]{margin:4px 0 6px;padding-left:16px;font-size:11px;line-height:1.5;color:var(--red-ui-text-color-disabled, #999)}.nrg-help-list li[data-v-94314aba]{margin:1px 0}.nrg-section[data-v-94314aba]{border-top:1px solid var(--red-ui-secondary-border-color, #ddd);margin-top:12px;padding-top:8px}.nrg-section-title[data-v-94314aba]{font-weight:700;font-size:14px;margin-bottom:8px}.nrg-help[data-v-94314aba]{white-space:nowrap;font-size:11px;line-height:1.4;color:var(--red-ui-text-color-disabled, #999);margin:2px 0 6px}.nrg-help-link[data-v-94314aba]{color:var(--red-ui-text-color-link, #2196f3);white-space:nowrap}.nrg-help-link[data-v-94314aba]:hover{text-decoration:underline}.nrg-subsection[data-v-94314aba]{margin-bottom:10px}.nrg-subsection-title[data-v-94314aba]{font-weight:700;font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--red-ui-text-color-disabled, #777);margin:6px 0 4px}.nrg-outputs[data-v-94314aba],.nrg-lifecycle[data-v-94314aba],.nrg-input[data-v-94314aba]{width:100%;max-width:100%;table-layout:fixed;margin-top:6px;border-collapse:separate;border-spacing:0;border:1px solid var(--red-ui-secondary-border-color, #d9d9d9);border-radius:3px;overflow:hidden;font-size:12px}.nrg-lifecycle[data-v-94314aba],.nrg-input[data-v-94314aba]{table-layout:auto}.nrg-input[data-v-94314aba],.nrg-lifecycle .nrg-outputs-flag[data-v-94314aba],.nrg-input .nrg-outputs-flag[data-v-94314aba]{width:auto}.nrg-outputs th[data-v-94314aba],.nrg-outputs td[data-v-94314aba],.nrg-lifecycle th[data-v-94314aba],.nrg-lifecycle td[data-v-94314aba],.nrg-input th[data-v-94314aba],.nrg-input td[data-v-94314aba]{padding:5px 8px;text-align:center;vertical-align:middle;border-right:1px solid var(--red-ui-secondary-border-color, #e6e6e6);border-bottom:1px solid var(--red-ui-secondary-border-color, #e6e6e6)}.nrg-outputs th[data-v-94314aba]:last-child,.nrg-outputs td[data-v-94314aba]:last-child,.nrg-lifecycle th[data-v-94314aba]:last-child,.nrg-lifecycle td[data-v-94314aba]:last-child,.nrg-input th[data-v-94314aba]:last-child,.nrg-input td[data-v-94314aba]:last-child{border-right:none}.nrg-outputs tbody tr:last-child td[data-v-94314aba],.nrg-lifecycle tbody tr:last-child td[data-v-94314aba],.nrg-input tbody tr:last-child td[data-v-94314aba]{border-bottom:none}.nrg-outputs thead th[data-v-94314aba],.nrg-lifecycle thead th[data-v-94314aba],.nrg-input thead th[data-v-94314aba]{background:var(--red-ui-tertiary-background, #f3f3f3);color:var(--red-ui-text-color-disabled, #777);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.02em}.nrg-outputs-index[data-v-94314aba]{width:3em}.nrg-outputs-label[data-v-94314aba]{width:200px;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nrg-outputs-return-col[data-v-94314aba]{width:150px;white-space:nowrap}.nrg-outputs-context-col[data-v-94314aba]{width:130px;white-space:nowrap}.nrg-outputs-flag[data-v-94314aba]{width:116px}.nrg-outputs-flag .nrg-toggle-wrapper[data-v-94314aba]{display:flex;align-items:center;justify-content:center}.nrg-outputs-schema-btn .nrg-schema-glyph[data-v-94314aba]{font-family:var(--red-ui-monospace-font, "Courier New", monospace);font-weight:700;font-size:.95em;line-height:1;letter-spacing:-.06em}.nrg-outputs-return[data-v-94314aba]{width:100%;height:28px;box-sizing:border-box;padding:0 6px;text-align:left;border:1px solid var( --red-ui-form-input-border-color, var(--red-ui-secondary-border-color, #ccc) );border-radius:2px;background:var(--red-ui-form-input-background, #fff);color:var(--red-ui-form-text-color, inherit)}.nrg-outputs-context[data-v-94314aba]{width:100%;height:28px;box-sizing:border-box;padding:0 6px;text-align:center;border:1px solid var( --red-ui-form-input-border-color, var(--red-ui-secondary-border-color, #ccc) );border-radius:2px;background:var(--red-ui-form-input-background, #fff);color:var(--red-ui-form-text-color, inherit)}.nrg-outputs-context[data-v-94314aba]:disabled{opacity:.6;cursor:not-allowed}.nrg-outputs td .nrg-outputs-return[data-v-94314aba],.nrg-outputs td .nrg-outputs-context[data-v-94314aba]{height:28px;margin:0;padding:0 6px;line-height:normal}[data-v-94314aba] .node-red-vue-input-error-message{color:var(--red-ui-text-color-error)}[data-v-94314aba] .form-row input[type=text],[data-v-94314aba] .form-row input[type=number],[data-v-94314aba] .form-row input[type=password]{height:34px;padding:0 8px;box-sizing:border-box}.nrg-toggle-wrapper[data-v-9d4b2ecb]{display:inline-flex;align-items:center}.nrg-toggle[data-v-9d4b2ecb]{position:relative;display:inline-flex!important;flex-direction:column;align-items:flex-start;cursor:pointer;gap:4px;-webkit-user-select:none;user-select:none;margin:0!important}.nrg-toggle__input[data-v-9d4b2ecb]{position:absolute;opacity:0;width:0;height:0}.nrg-toggle__slider[data-v-9d4b2ecb]{position:relative;display:inline-block;width:36px;min-width:36px;height:20px;background-color:var(--red-ui-secondary-border-color, #ccc);border-radius:10px;transition:background-color .2s ease}.nrg-toggle__slider[data-v-9d4b2ecb]:after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;background-color:#fff;border-radius:50%;transition:transform .2s ease}.nrg-toggle__input:focus-visible~.nrg-toggle__slider[data-v-9d4b2ecb]{outline:2px solid var(--red-ui-form-input-focus-color, #2b6ec9);outline-offset:2px}.nrg-toggle--checked .nrg-toggle__slider[data-v-9d4b2ecb]{background-color:var(--red-ui-text-color-link, #0070d2)}.nrg-toggle--checked .nrg-toggle__slider[data-v-9d4b2ecb]:after{transform:translate(16px)}.nrg-toggle__label[data-v-9d4b2ecb]{cursor:default;white-space:nowrap}.nrg-toggle__label i[data-v-9d4b2ecb]{margin-right:2px}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();var Yo=Object.defineProperty,Xo=(e,t,r)=>t in e?Yo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,et=(e,t,r)=>Xo(e,typeof t!="symbol"?t+"":t,r);import{ref as ea,defineComponent as we,openBlock as K,createElementBlock as G,Fragment as Le,createCommentVNode as Q,createBlock as ve,Teleport as ta,createElementVNode as U,renderSlot as Oe,resolveDynamicComponent as ra,withCtx as Jt,normalizeClass as Gt,createTextVNode as Se,toDisplayString as Z,shallowRef as Ce,resolveComponent as ie,withDirectives as na,vShow as oa,createVNode as pe,renderList as tt,createApp as aa,inject as Zt}from"/nrg/assets/vue.esm-browser.prod.js";const sa=["error","complete","status"];function $r(e){return sa.filter(t=>e[`${t}Port`]===!0)}function ia(e){return Math.max(0,Number(e.outputs??0)-$r(e).length)}function la(e,t){const r=ia(e);if(t<r)return{kind:"base",index:t};const n=$r(e)[t-r];return n?{kind:n}:null}function ua(e,t,r){var n;return t.validateInputTypes===!0?!0:r.kind==="base"&&((n=e.validateOutputTypes)==null?void 0:n[r.index])===!0}function wr(e){return`${e.source.id}:${e.sourcePort}:${e.target.id}`}function _r(e,t){var r,n;return t(e.type)?(n=(r=e._def)==null?void 0:r.set)==null?void 0:n.module:void 0}function Pr(e,t){var r,n;const o=la(e.source,e.sourcePort);if(!o||!ua(e.source,e.target,o))return null;const l=o.kind==="base"?{kind:"base",index:o.index,returnKey:(r=e.source.outputReturnProperties)==null?void 0:r[o.index],mode:(n=e.source.outputContextModes)==null?void 0:n[o.index]}:{kind:o.kind};return{id:wr(e),source:{type:e.source.type,module:_r(e.source,t),port:l},target:{type:e.target.type,module:_r(e.target,t)}}}function ca(e){return`Wire type mismatch \u2014 ${e.message??"the source output is not assignable to the target input"}`}function da(e){return`Type Validation for wire ${e.id} couldn't be done because ${e.reason??"the wire could not be resolved"}`}function pa(e){const t=e.filter(o=>o.checked&&!o.ok),r=e.filter(o=>!o.checked&&o.reason);if(!t.length&&!r.length)return null;const n=[];return t.length&&n.push(`${t.length} wire${t.length>1?"s":""} failed type validation:`,...t.map(o=>`\u2022 ${o.id}: ${o.message??"type mismatch"}`)),r.length&&(n.length&&n.push(""),n.push(...r.map(o=>`\u2022 ${da(o)}`))),{level:t.length?"error":"warning",text:n.join(`
2
+ `)}}const Er=new Set;function fa(e){Er.add(e)}function Sr(e){return Er.has(e)}const Qt="nrg/type-check";function kr(e,t){return new Promise(r=>{try{$.ajax({url:e,method:"POST",contentType:"application/json",data:JSON.stringify(t),dataType:"json",success:n=>r(n),error:()=>r(null)})}catch{r(null)}})}function ha(e){return new Promise(t=>{try{$.ajax({url:e,method:"GET",dataType:"json",success:r=>t(r),error:()=>t(null)})}catch{t(null)}})}async function ma(){const e=await ha(`${Qt}/status`);return{available:e?.available===!0}}function xr(e){return typeof e=="object"&&e!==null&&typeof e.ok=="boolean"}async function ya(e){const t=await kr(Qt,e);return xr(t)?t:null}async function va(e){const t=await kr(`${Qt}/batch`,{wires:e}),r=t?.results;return Array.isArray(r)&&r.every(xr)?r:null}const rt=ea(!1);async function ga(){const e=await ma();rt.value=e.available}let Nr=!1;const jr=[];let Yt=!1;const Xt=new Set,Ir=new Set;let er=!1;function ba(){Yt||(Yt=!0,Promise.resolve().then($a))}function $a(){const e=jr.splice(0);Yt=!1,e.length===1&&wa(e[0])}function wa(e){const t=Pr(e,Sr);if(!t)return;const r=t.id;Xt.add(r),ya(t).then(n=>{if(Xt.delete(r),!Ir.delete(r)&&!(!n||!n.checked||n.ok)){er=!0;try{RED.nodes.removeLink(e),RED.view.redraw(!0)}catch{}finally{er=!1}RED.notify(ca(n),{type:"error",timeout:8e3})}})}function _a(e){!Nr||!rt.value||(jr.push(e),ba())}function Pa(e){if(er)return;const t=wr(e);Xt.has(t)&&Ir.add(t)}function Ea(){if(!rt.value)return;const e=[];RED.nodes.eachLink(t=>{const r=Pr(t,Sr);r&&e.push(r)}),e.length&&va(e).then(t=>{if(!t)return;const r=pa(t);r&&RED.notify(r.text,{type:r.level,timeout:r.level==="error"?0:1e4})})}function Sa(){typeof RED>"u"||!RED.events||(ga(),RED.events.on("flows:load",()=>{Nr=!0}),RED.events.on("links:add",e=>_a(e)),RED.events.on("links:remove",e=>Pa(e)),RED.events.on("deploy",Ea))}Sa();function ka(e){return e}function nt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ke={},Tr;function xa(){if(Tr)return Ke;Tr=1;var e=/~/,t=/~[01]/g;function r(d){switch(d){case"~1":return"/";case"~0":return"~"}throw new Error("Invalid tilde escape: "+d)}function n(d){return e.test(d)?d.replace(t,r):d}function o(d,m,k){for(var b,u,v=1,S=m.length;v<S;){if(m[v]==="constructor"||m[v]==="prototype"||m[v]==="__proto__")return d;if(b=n(m[v++]),u=S>v,typeof d[b]>"u"&&(Array.isArray(d)&&b==="-"&&(b=d.length),u&&(m[v]!==""&&m[v]<1/0||m[v]==="-"?d[b]=[]:d[b]={})),!u)break;d=d[b]}var h=d[b];return k===void 0?delete d[b]:d[b]=k,h}function l(d){if(typeof d=="string"){if(d=d.split("/"),d[0]==="")return d;throw new Error("Invalid JSON pointer.")}else if(Array.isArray(d)){for(const m of d)if(typeof m!="string"&&typeof m!="number")throw new Error("Invalid JSON pointer. Must be of type string or number.");return d}throw new Error("Invalid JSON pointer.")}function s(d,m){if(typeof d!="object")throw new Error("Invalid input object.");m=l(m);var k=m.length;if(k===1)return d;for(var b=1;b<k;){if(d=d[n(m[b++])],k===b)return d;if(typeof d!="object"||d===null)return}}function c(d,m,k){if(typeof d!="object")throw new Error("Invalid input object.");if(m=l(m),m.length===0)throw new Error("Invalid JSON pointer for set.");return o(d,m,k)}function y(d){var m=l(d);return{get:function(k){return s(k,m)},set:function(k,b){return c(k,m,b)}}}return Ke.get=s,Ke.set=c,Ke.compile=y,Ke}var Na=xa();const Or=nt(Na);function ja(e,t,{signal:r,edges:n}={}){let o,l=null;const s=n!=null&&n.includes("leading"),c=n==null||n.includes("trailing"),y=()=>{l!==null&&(e.apply(o,l),o=void 0,l=null)},d=()=>{c&&y(),u()};let m=null;const k=()=>{m!=null&&clearTimeout(m),m=setTimeout(()=>{m=null,d()},t)},b=()=>{m!==null&&(clearTimeout(m),m=null)},u=()=>{b(),o=void 0,l=null},v=()=>{y()},S=function(...h){if(r!=null&&r.aborted)return;o=this,l=h;const p=m==null;k(),s&&p&&y()};return S.schedule=k,S.cancel=u,S.flush=v,r?.addEventListener("abort",u,{once:!0}),S}function Ia(){}function Ta(e){return e==null||typeof e!="object"&&typeof e!="function"}function Oa(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function tr(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function rr(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Cr="[object RegExp]",Rr="[object String]",Vr="[object Number]",Dr="[object Boolean]",nr="[object Arguments]",Ar="[object Symbol]",Lr="[object Date]",qr="[object Map]",zr="[object Set]",Mr="[object Array]",Ca="[object Function]",Ur="[object ArrayBuffer]",ot="[object Object]",Ra="[object Error]",Fr="[object DataView]",Kr="[object Uint8Array]",Br="[object Uint8ClampedArray]",Hr="[object Uint16Array]",Wr="[object Uint32Array]",Va="[object BigUint64Array]",Jr="[object Int8Array]",Gr="[object Int16Array]",Zr="[object Int32Array]",Da="[object BigInt64Array]",Qr="[object Float32Array]",Yr="[object Float64Array]";function qe(e,t,r,n=new Map,o=void 0){const l=o?.(e,t,r,n);if(l!==void 0)return l;if(Ta(e))return e;if(n.has(e))return n.get(e);if(Array.isArray(e)){const s=new Array(e.length);n.set(e,s);for(let c=0;c<e.length;c++)s[c]=qe(e[c],c,r,n,o);return Object.hasOwn(e,"index")&&(s.index=e.index),Object.hasOwn(e,"input")&&(s.input=e.input),s}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const s=new RegExp(e.source,e.flags);return s.lastIndex=e.lastIndex,s}if(e instanceof Map){const s=new Map;n.set(e,s);for(const[c,y]of e)s.set(c,qe(y,c,r,n,o));return s}if(e instanceof Set){const s=new Set;n.set(e,s);for(const c of e)s.add(qe(c,void 0,r,n,o));return s}if(typeof Buffer<"u"&&Buffer.isBuffer(e))return e.subarray();if(Oa(e)){const s=new(Object.getPrototypeOf(e)).constructor(e.length);n.set(e,s);for(let c=0;c<e.length;c++)s[c]=qe(e[c],c,r,n,o);return s}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const s=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return n.set(e,s),Ie(s,e,r,n,o),s}if(typeof File<"u"&&e instanceof File){const s=new File([e],e.name,{type:e.type});return n.set(e,s),Ie(s,e,r,n,o),s}if(typeof Blob<"u"&&e instanceof Blob){const s=new Blob([e],{type:e.type});return n.set(e,s),Ie(s,e,r,n,o),s}if(e instanceof Error){const s=structuredClone(e);return n.set(e,s),s.message=e.message,s.name=e.name,s.stack=e.stack,s.cause=e.cause,s.constructor=e.constructor,Ie(s,e,r,n,o),s}if(e instanceof Boolean){const s=new Boolean(e.valueOf());return n.set(e,s),Ie(s,e,r,n,o),s}if(e instanceof Number){const s=new Number(e.valueOf());return n.set(e,s),Ie(s,e,r,n,o),s}if(e instanceof String){const s=new String(e.valueOf());return n.set(e,s),Ie(s,e,r,n,o),s}if(typeof e=="object"&&Aa(e)){const s=Object.create(Object.getPrototypeOf(e));return n.set(e,s),Ie(s,e,r,n,o),s}return e}function Ie(e,t,r=e,n,o){const l=[...Object.keys(t),...tr(t)];for(let s=0;s<l.length;s++){const c=l[s],y=Object.getOwnPropertyDescriptor(e,c);(y==null||y.writable)&&(e[c]=qe(t[c],c,r,n,o))}}function Aa(e){switch(rr(e)){case nr:case Mr:case Ur:case Fr:case Dr:case Lr:case Qr:case Yr:case Jr:case Gr:case Zr:case qr:case Vr:case ot:case Cr:case zr:case Rr:case Ar:case Kr:case Br:case Hr:case Wr:return!0;default:return!1}}function Xr(e){return qe(e,void 0,e,new Map,void 0)}function en(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)==="[object Object]":!1}function La(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function qa(e,t,r){return Be(e,t,void 0,void 0,void 0,void 0,r)}function Be(e,t,r,n,o,l,s){const c=s(e,t,r,n,o,l);if(c!==void 0)return c;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return e===t;case"number":return e===t||Object.is(e,t);case"function":return e===t;case"object":return He(e,t,l,s)}return He(e,t,l,s)}function He(e,t,r,n){if(Object.is(e,t))return!0;let o=rr(e),l=rr(t);if(o===nr&&(o=ot),l===nr&&(l=ot),o!==l)return!1;switch(o){case Rr:return e.toString()===t.toString();case Vr:{const y=e.valueOf(),d=t.valueOf();return La(y,d)}case Dr:case Lr:case Ar:return Object.is(e.valueOf(),t.valueOf());case Cr:return e.source===t.source&&e.flags===t.flags;case Ca:return e===t}r=r??new Map;const s=r.get(e),c=r.get(t);if(s!=null&&c!=null)return s===t;r.set(e,t),r.set(t,e);try{switch(o){case qr:{if(e.size!==t.size)return!1;for(const[y,d]of e.entries())if(!t.has(y)||!Be(d,t.get(y),y,e,t,r,n))return!1;return!0}case zr:{if(e.size!==t.size)return!1;const y=Array.from(e.values()),d=Array.from(t.values());for(let m=0;m<y.length;m++){const k=y[m],b=d.findIndex(u=>Be(k,u,void 0,e,t,r,n));if(b===-1)return!1;d.splice(b,1)}return!0}case Mr:case Kr:case Br:case Hr:case Wr:case Va:case Jr:case Gr:case Zr:case Da:case Qr:case Yr:{if(typeof Buffer<"u"&&Buffer.isBuffer(e)!==Buffer.isBuffer(t)||e.length!==t.length)return!1;for(let y=0;y<e.length;y++)if(!Be(e[y],t[y],y,e,t,r,n))return!1;return!0}case Ur:return e.byteLength!==t.byteLength?!1:He(new Uint8Array(e),new Uint8Array(t),r,n);case Fr:return e.byteLength!==t.byteLength||e.byteOffset!==t.byteOffset?!1:He(new Uint8Array(e),new Uint8Array(t),r,n);case Ra:return e.name===t.name&&e.message===t.message;case ot:{if(!(He(e.constructor,t.constructor,r,n)||en(e)&&en(t)))return!1;const y=[...Object.keys(e),...tr(e)],d=[...Object.keys(t),...tr(t)];if(y.length!==d.length)return!1;for(let m=0;m<y.length;m++){const k=y[m],b=e[k];if(!Object.hasOwn(t,k))return!1;const u=t[k];if(!Be(b,u,k,e,t,r,n))return!1}return!0}default:return!1}}finally{r.delete(e),r.delete(t)}}function za(e,t){return qa(e,t,Ia)}var or={exports:{}},tn={},ke={},Re={},rn={},nn={},on={},an;function We(){return an||(an=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(a){if(super(),!e.IDENTIFIER.test(a))throw new Error("CodeGen: name must be a valid identifier");this.str=a}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(a){super(),this._items=typeof a=="string"?[a]:a}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const a=this._items[0];return a===""||a==='""'}get str(){var a;return(a=this._str)!==null&&a!==void 0?a:this._str=this._items.reduce((i,w)=>`${i}${w}`,"")}get names(){var a;return(a=this._names)!==null&&a!==void 0?a:this._names=this._items.reduce((i,w)=>(w instanceof r&&(i[w.str]=(i[w.str]||0)+1),i),{})}}e._Code=n,e.nil=new n("");function o(p,...a){const i=[p[0]];let w=0;for(;w<a.length;)c(i,a[w]),i.push(p[++w]);return new n(i)}e._=o;const l=new n("+");function s(p,...a){const i=[u(p[0])];let w=0;for(;w<a.length;)i.push(l),c(i,a[w]),i.push(l,u(p[++w]));return y(i),new n(i)}e.str=s;function c(p,a){a instanceof n?p.push(...a._items):a instanceof r?p.push(a):p.push(k(a))}e.addCodeArg=c;function y(p){let a=1;for(;a<p.length-1;){if(p[a]===l){const i=d(p[a-1],p[a+1]);if(i!==void 0){p.splice(a-1,3,i);continue}p[a++]="+"}a++}}function d(p,a){if(a==='""')return p;if(p==='""')return a;if(typeof p=="string")return a instanceof r||p[p.length-1]!=='"'?void 0:typeof a!="string"?`${p.slice(0,-1)}${a}"`:a[0]==='"'?p.slice(0,-1)+a.slice(1):void 0;if(typeof a=="string"&&a[0]==='"'&&!(p instanceof r))return`"${p}${a.slice(1)}`}function m(p,a){return a.emptyStr()?p:p.emptyStr()?a:s`${p}${a}`}e.strConcat=m;function k(p){return typeof p=="number"||typeof p=="boolean"||p===null?p:u(Array.isArray(p)?p.join(","):p)}function b(p){return new n(u(p))}e.stringify=b;function u(p){return JSON.stringify(p).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=u;function v(p){return typeof p=="string"&&e.IDENTIFIER.test(p)?new n(`.${p}`):o`[${p}]`}e.getProperty=v;function S(p){if(typeof p=="string"&&e.IDENTIFIER.test(p))return new n(`${p}`);throw new Error(`CodeGen: invalid export name: ${p}, use explicit $id name mapping`)}e.getEsmExportName=S;function h(p){return new n(p.toString())}e.regexpCode=h})(on)),on}var sn={},ln;function un(){return ln||(ln=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=We();class r extends Error{constructor(d){super(`CodeGen: "code" for ${d} not defined`),this.value=d.value}}var n;(function(y){y[y.Started=0]="Started",y[y.Completed=1]="Completed"})(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class o{constructor({prefixes:d,parent:m}={}){this._names={},this._prefixes=d,this._parent=m}toName(d){return d instanceof t.Name?d:this.name(d)}name(d){return new t.Name(this._newName(d))}_newName(d){const m=this._names[d]||this._nameGroup(d);return`${d}${m.index++}`}_nameGroup(d){var m,k;if(!((k=(m=this._parent)===null||m===void 0?void 0:m._prefixes)===null||k===void 0)&&k.has(d)||this._prefixes&&!this._prefixes.has(d))throw new Error(`CodeGen: prefix "${d}" is not allowed in this scope`);return this._names[d]={prefix:d,index:0}}}e.Scope=o;class l extends t.Name{constructor(d,m){super(m),this.prefix=d}setValue(d,{property:m,itemIndex:k}){this.value=d,this.scopePath=(0,t._)`.${new t.Name(m)}[${k}]`}}e.ValueScopeName=l;const s=(0,t._)`\n`;class c extends o{constructor(d){super(d),this._values={},this._scope=d.scope,this.opts={...d,_n:d.lines?s:t.nil}}get(){return this._scope}name(d){return new l(d,this._newName(d))}value(d,m){var k;if(m.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const b=this.toName(d),{prefix:u}=b,v=(k=m.key)!==null&&k!==void 0?k:m.ref;let S=this._values[u];if(S){const a=S.get(v);if(a)return a}else S=this._values[u]=new Map;S.set(v,b);const h=this._scope[u]||(this._scope[u]=[]),p=h.length;return h[p]=m.ref,b.setValue(m,{property:u,itemIndex:p}),b}getValue(d,m){const k=this._values[d];if(k)return k.get(m)}scopeRefs(d,m=this._values){return this._reduceValues(m,k=>{if(k.scopePath===void 0)throw new Error(`CodeGen: name "${k}" has no value`);return(0,t._)`${d}${k.scopePath}`})}scopeCode(d=this._values,m,k){return this._reduceValues(d,b=>{if(b.value===void 0)throw new Error(`CodeGen: name "${b}" has no value`);return b.value.code},m,k)}_reduceValues(d,m,k={},b){let u=t.nil;for(const v in d){const S=d[v];if(!S)continue;const h=k[v]=k[v]||new Map;S.forEach(p=>{if(h.has(p))return;h.set(p,n.Started);let a=m(p);if(a){const i=this.opts.es5?e.varKinds.var:e.varKinds.const;u=(0,t._)`${u}${i} ${p} = ${a};${this.opts._n}`}else if(a=b?.(p))u=(0,t._)`${u}${a}${this.opts._n}`;else throw new r(p);h.set(p,n.Completed)})}return u}}e.ValueScope=c})(sn)),sn}var cn;function X(){return cn||(cn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=We(),r=un();var n=We();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var o=un();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class l{optimizeNodes(){return this}optimizeNames(f,P){return this}}class s extends l{constructor(f,P,O){super(),this.varKind=f,this.name=P,this.rhs=O}render({es5:f,_n:P}){const O=f?r.varKinds.var:this.varKind,M=this.rhs===void 0?"":` = ${this.rhs}`;return`${O} ${this.name}${M};`+P}optimizeNames(f,P){if(f[this.name.str])return this.rhs&&(this.rhs=W(this.rhs,f,P)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class c extends l{constructor(f,P,O){super(),this.lhs=f,this.rhs=P,this.sideEffects=O}render({_n:f}){return`${this.lhs} = ${this.rhs};`+f}optimizeNames(f,P){if(!(this.lhs instanceof t.Name&&!f[this.lhs.str]&&!this.sideEffects))return this.rhs=W(this.rhs,f,P),this}get names(){const f=this.lhs instanceof t.Name?{}:{...this.lhs.names};return B(f,this.rhs)}}class y extends c{constructor(f,P,O,M){super(f,O,M),this.op=P}render({_n:f}){return`${this.lhs} ${this.op}= ${this.rhs};`+f}}class d extends l{constructor(f){super(),this.label=f,this.names={}}render({_n:f}){return`${this.label}:`+f}}class m extends l{constructor(f){super(),this.label=f,this.names={}}render({_n:f}){return`break${this.label?` ${this.label}`:""};`+f}}class k extends l{constructor(f){super(),this.error=f}render({_n:f}){return`throw ${this.error};`+f}get names(){return this.error.names}}class b extends l{constructor(f){super(),this.code=f}render({_n:f}){return`${this.code};`+f}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(f,P){return this.code=W(this.code,f,P),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class u extends l{constructor(f=[]){super(),this.nodes=f}render(f){return this.nodes.reduce((P,O)=>P+O.render(f),"")}optimizeNodes(){const{nodes:f}=this;let P=f.length;for(;P--;){const O=f[P].optimizeNodes();Array.isArray(O)?f.splice(P,1,...O):O?f[P]=O:f.splice(P,1)}return f.length>0?this:void 0}optimizeNames(f,P){const{nodes:O}=this;let M=O.length;for(;M--;){const A=O[M];A.optimizeNames(f,P)||(ae(f,A.names),O.splice(M,1))}return O.length>0?this:void 0}get names(){return this.nodes.reduce((f,P)=>F(f,P.names),{})}}class v extends u{render(f){return"{"+f._n+super.render(f)+"}"+f._n}}class S extends u{}class h extends v{}h.kind="else";class p extends v{constructor(f,P){super(P),this.condition=f}render(f){let P=`if(${this.condition})`+super.render(f);return this.else&&(P+="else "+this.else.render(f)),P}optimizeNodes(){super.optimizeNodes();const f=this.condition;if(f===!0)return this.nodes;let P=this.else;if(P){const O=P.optimizeNodes();P=this.else=Array.isArray(O)?new h(O):O}if(P)return f===!1?P instanceof p?P:P.nodes:this.nodes.length?this:new p(se(f),P instanceof p?[P]:P.nodes);if(!(f===!1||!this.nodes.length))return this}optimizeNames(f,P){var O;if(this.else=(O=this.else)===null||O===void 0?void 0:O.optimizeNames(f,P),!!(super.optimizeNames(f,P)||this.else))return this.condition=W(this.condition,f,P),this}get names(){const f=super.names;return B(f,this.condition),this.else&&F(f,this.else.names),f}}p.kind="if";class a extends v{}a.kind="for";class i extends a{constructor(f){super(),this.iteration=f}render(f){return`for(${this.iteration})`+super.render(f)}optimizeNames(f,P){if(super.optimizeNames(f,P))return this.iteration=W(this.iteration,f,P),this}get names(){return F(super.names,this.iteration.names)}}class w extends a{constructor(f,P,O,M){super(),this.varKind=f,this.name=P,this.from=O,this.to=M}render(f){const P=f.es5?r.varKinds.var:this.varKind,{name:O,from:M,to:A}=this;return`for(${P} ${O}=${M}; ${O}<${A}; ${O}++)`+super.render(f)}get names(){const f=B(super.names,this.from);return B(f,this.to)}}class g extends a{constructor(f,P,O,M){super(),this.loop=f,this.varKind=P,this.name=O,this.iterable=M}render(f){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(f)}optimizeNames(f,P){if(super.optimizeNames(f,P))return this.iterable=W(this.iterable,f,P),this}get names(){return F(super.names,this.iterable.names)}}class _ extends v{constructor(f,P,O){super(),this.name=f,this.args=P,this.async=O}render(f){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(f)}}_.kind="func";class E extends u{render(f){return"return "+super.render(f)}}E.kind="return";class C extends v{render(f){let P="try"+super.render(f);return this.catch&&(P+=this.catch.render(f)),this.finally&&(P+=this.finally.render(f)),P}optimizeNodes(){var f,P;return super.optimizeNodes(),(f=this.catch)===null||f===void 0||f.optimizeNodes(),(P=this.finally)===null||P===void 0||P.optimizeNodes(),this}optimizeNames(f,P){var O,M;return super.optimizeNames(f,P),(O=this.catch)===null||O===void 0||O.optimizeNames(f,P),(M=this.finally)===null||M===void 0||M.optimizeNames(f,P),this}get names(){const f=super.names;return this.catch&&F(f,this.catch.names),this.finally&&F(f,this.finally.names),f}}class L extends v{constructor(f){super(),this.error=f}render(f){return`catch(${this.error})`+super.render(f)}}L.kind="catch";class z extends v{render(f){return"finally"+super.render(f)}}z.kind="finally";class V{constructor(f,P={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...P,_n:P.lines?`
3
+ `:""},this._extScope=f,this._scope=new r.Scope({parent:f}),this._nodes=[new S]}toString(){return this._root.render(this.opts)}name(f){return this._scope.name(f)}scopeName(f){return this._extScope.name(f)}scopeValue(f,P){const O=this._extScope.value(f,P);return(this._values[O.prefix]||(this._values[O.prefix]=new Set)).add(O),O}getScopeValue(f,P){return this._extScope.getValue(f,P)}scopeRefs(f){return this._extScope.scopeRefs(f,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(f,P,O,M){const A=this._scope.toName(P);return O!==void 0&&M&&(this._constants[A.str]=O),this._leafNode(new s(f,A,O)),A}const(f,P,O){return this._def(r.varKinds.const,f,P,O)}let(f,P,O){return this._def(r.varKinds.let,f,P,O)}var(f,P,O){return this._def(r.varKinds.var,f,P,O)}assign(f,P,O){return this._leafNode(new c(f,P,O))}add(f,P){return this._leafNode(new y(f,e.operators.ADD,P))}code(f){return typeof f=="function"?f():f!==t.nil&&this._leafNode(new b(f)),this}object(...f){const P=["{"];for(const[O,M]of f)P.length>1&&P.push(","),P.push(O),(O!==M||this.opts.es5)&&(P.push(":"),(0,t.addCodeArg)(P,M));return P.push("}"),new t._Code(P)}if(f,P,O){if(this._blockNode(new p(f)),P&&O)this.code(P).else().code(O).endIf();else if(P)this.code(P).endIf();else if(O)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(f){return this._elseNode(new p(f))}else(){return this._elseNode(new h)}endIf(){return this._endBlockNode(p,h)}_for(f,P){return this._blockNode(f),P&&this.code(P).endFor(),this}for(f,P){return this._for(new i(f),P)}forRange(f,P,O,M,A=this.opts.es5?r.varKinds.var:r.varKinds.let){const H=this._scope.toName(f);return this._for(new w(A,H,P,O),()=>M(H))}forOf(f,P,O,M=r.varKinds.const){const A=this._scope.toName(f);if(this.opts.es5){const H=P instanceof t.Name?P:this.var("_arr",P);return this.forRange("_i",0,(0,t._)`${H}.length`,Y=>{this.var(A,(0,t._)`${H}[${Y}]`),O(A)})}return this._for(new g("of",M,A,P),()=>O(A))}forIn(f,P,O,M=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(f,(0,t._)`Object.keys(${P})`,O);const A=this._scope.toName(f);return this._for(new g("in",M,A,P),()=>O(A))}endFor(){return this._endBlockNode(a)}label(f){return this._leafNode(new d(f))}break(f){return this._leafNode(new m(f))}return(f){const P=new E;if(this._blockNode(P),this.code(f),P.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(f,P,O){if(!P&&!O)throw new Error('CodeGen: "try" without "catch" and "finally"');const M=new C;if(this._blockNode(M),this.code(f),P){const A=this.name("e");this._currNode=M.catch=new L(A),P(A)}return O&&(this._currNode=M.finally=new z,this.code(O)),this._endBlockNode(L,z)}throw(f){return this._leafNode(new k(f))}block(f,P){return this._blockStarts.push(this._nodes.length),f&&this.code(f).endBlock(P),this}endBlock(f){const P=this._blockStarts.pop();if(P===void 0)throw new Error("CodeGen: not in self-balancing block");const O=this._nodes.length-P;if(O<0||f!==void 0&&O!==f)throw new Error(`CodeGen: wrong number of nodes: ${O} vs ${f} expected`);return this._nodes.length=P,this}func(f,P=t.nil,O,M){return this._blockNode(new _(f,P,O)),M&&this.code(M).endFunc(),this}endFunc(){return this._endBlockNode(_)}optimize(f=1){for(;f-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(f){return this._currNode.nodes.push(f),this}_blockNode(f){this._currNode.nodes.push(f),this._nodes.push(f)}_endBlockNode(f,P){const O=this._currNode;if(O instanceof f||P&&O instanceof P)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${P?`${f.kind}/${P.kind}`:f.kind}"`)}_elseNode(f){const P=this._currNode;if(!(P instanceof p))throw new Error('CodeGen: "else" without "if"');return this._currNode=P.else=f,this}get _root(){return this._nodes[0]}get _currNode(){const f=this._nodes;return f[f.length-1]}set _currNode(f){const P=this._nodes;P[P.length-1]=f}}e.CodeGen=V;function F(x,f){for(const P in f)x[P]=(x[P]||0)+(f[P]||0);return x}function B(x,f){return f instanceof t._CodeOrName?F(x,f.names):x}function W(x,f,P){if(x instanceof t.Name)return O(x);if(!M(x))return x;return new t._Code(x._items.reduce((A,H)=>(H instanceof t.Name&&(H=O(H)),H instanceof t._Code?A.push(...H._items):A.push(H),A),[]));function O(A){const H=P[A.str];return H===void 0||f[A.str]!==1?A:(delete f[A.str],H)}function M(A){return A instanceof t._Code&&A._items.some(H=>H instanceof t.Name&&f[H.str]===1&&P[H.str]!==void 0)}}function ae(x,f){for(const P in f)x[P]=(x[P]||0)-(f[P]||0)}function se(x){return typeof x=="boolean"||typeof x=="number"||x===null?!x:(0,t._)`!${T(x)}`}e.not=se;const de=I(e.operators.AND);function ne(...x){return x.reduce(de)}e.and=ne;const fe=I(e.operators.OR);function D(...x){return x.reduce(fe)}e.or=D;function I(x){return(f,P)=>f===t.nil?P:P===t.nil?f:(0,t._)`${T(f)} ${x} ${T(P)}`}function T(x){return x instanceof t.Name?x:(0,t._)`(${x})`}})(nn)),nn}var ee={},dn;function re(){if(dn)return ee;dn=1,Object.defineProperty(ee,"__esModule",{value:!0}),ee.checkStrictMode=ee.getErrorPath=ee.Type=ee.useFunc=ee.setEvaluated=ee.evaluatedPropsToName=ee.mergeEvaluated=ee.eachItem=ee.unescapeJsonPointer=ee.escapeJsonPointer=ee.escapeFragment=ee.unescapeFragment=ee.schemaRefOrVal=ee.schemaHasRulesButRef=ee.schemaHasRules=ee.checkUnknownRules=ee.alwaysValidSchema=ee.toHash=void 0;const e=X(),t=We();function r(g){const _={};for(const E of g)_[E]=!0;return _}ee.toHash=r;function n(g,_){return typeof _=="boolean"?_:Object.keys(_).length===0?!0:(o(g,_),!l(_,g.self.RULES.all))}ee.alwaysValidSchema=n;function o(g,_=g.schema){const{opts:E,self:C}=g;if(!E.strictSchema||typeof _=="boolean")return;const L=C.RULES.keywords;for(const z in _)L[z]||w(g,`unknown keyword: "${z}"`)}ee.checkUnknownRules=o;function l(g,_){if(typeof g=="boolean")return!g;for(const E in g)if(_[E])return!0;return!1}ee.schemaHasRules=l;function s(g,_){if(typeof g=="boolean")return!g;for(const E in g)if(E!=="$ref"&&_.all[E])return!0;return!1}ee.schemaHasRulesButRef=s;function c({topSchemaRef:g,schemaPath:_},E,C,L){if(!L){if(typeof E=="number"||typeof E=="boolean")return E;if(typeof E=="string")return(0,e._)`${E}`}return(0,e._)`${g}${_}${(0,e.getProperty)(C)}`}ee.schemaRefOrVal=c;function y(g){return k(decodeURIComponent(g))}ee.unescapeFragment=y;function d(g){return encodeURIComponent(m(g))}ee.escapeFragment=d;function m(g){return typeof g=="number"?`${g}`:g.replace(/~/g,"~0").replace(/\//g,"~1")}ee.escapeJsonPointer=m;function k(g){return g.replace(/~1/g,"/").replace(/~0/g,"~")}ee.unescapeJsonPointer=k;function b(g,_){if(Array.isArray(g))for(const E of g)_(E);else _(g)}ee.eachItem=b;function u({mergeNames:g,mergeToName:_,mergeValues:E,resultToName:C}){return(L,z,V,F)=>{const B=V===void 0?z:V instanceof e.Name?(z instanceof e.Name?g(L,z,V):_(L,z,V),V):z instanceof e.Name?(_(L,V,z),z):E(z,V);return F===e.Name&&!(B instanceof e.Name)?C(L,B):B}}ee.mergeEvaluated={props:u({mergeNames:(g,_,E)=>g.if((0,e._)`${E} !== true && ${_} !== undefined`,()=>{g.if((0,e._)`${_} === true`,()=>g.assign(E,!0),()=>g.assign(E,(0,e._)`${E} || {}`).code((0,e._)`Object.assign(${E}, ${_})`))}),mergeToName:(g,_,E)=>g.if((0,e._)`${E} !== true`,()=>{_===!0?g.assign(E,!0):(g.assign(E,(0,e._)`${E} || {}`),S(g,E,_))}),mergeValues:(g,_)=>g===!0?!0:{...g,..._},resultToName:v}),items:u({mergeNames:(g,_,E)=>g.if((0,e._)`${E} !== true && ${_} !== undefined`,()=>g.assign(E,(0,e._)`${_} === true ? true : ${E} > ${_} ? ${E} : ${_}`)),mergeToName:(g,_,E)=>g.if((0,e._)`${E} !== true`,()=>g.assign(E,_===!0?!0:(0,e._)`${E} > ${_} ? ${E} : ${_}`)),mergeValues:(g,_)=>g===!0?!0:Math.max(g,_),resultToName:(g,_)=>g.var("items",_)})};function v(g,_){if(_===!0)return g.var("props",!0);const E=g.var("props",(0,e._)`{}`);return _!==void 0&&S(g,E,_),E}ee.evaluatedPropsToName=v;function S(g,_,E){Object.keys(E).forEach(C=>g.assign((0,e._)`${_}${(0,e.getProperty)(C)}`,!0))}ee.setEvaluated=S;const h={};function p(g,_){return g.scopeValue("func",{ref:_,code:h[_.code]||(h[_.code]=new t._Code(_.code))})}ee.useFunc=p;var a;(function(g){g[g.Num=0]="Num",g[g.Str=1]="Str"})(a||(ee.Type=a={}));function i(g,_,E){if(g instanceof e.Name){const C=_===a.Num;return E?C?(0,e._)`"[" + ${g} + "]"`:(0,e._)`"['" + ${g} + "']"`:C?(0,e._)`"/" + ${g}`:(0,e._)`"/" + ${g}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return E?(0,e.getProperty)(g).toString():"/"+m(g)}ee.getErrorPath=i;function w(g,_,E=g.opts.strictSchema){if(E){if(_=`strict mode: ${_}`,E===!0)throw new Error(_);g.self.logger.warn(_)}}return ee.checkStrictMode=w,ee}var at={},pn;function xe(){if(pn)return at;pn=1,Object.defineProperty(at,"__esModule",{value:!0});const e=X(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return at.default=t,at}var fn;function Je(){return fn||(fn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=X(),r=re(),n=xe();e.keywordError={message:({keyword:h})=>(0,t.str)`must pass "${h}" keyword validation`},e.keyword$DataError={message:({keyword:h,schemaType:p})=>p?(0,t.str)`"${h}" keyword must be ${p} ($data)`:(0,t.str)`"${h}" keyword is invalid ($data)`};function o(h,p=e.keywordError,a,i){const{it:w}=h,{gen:g,compositeRule:_,allErrors:E}=w,C=k(h,p,a);i??(_||E)?y(g,C):d(w,(0,t._)`[${C}]`)}e.reportError=o;function l(h,p=e.keywordError,a){const{it:i}=h,{gen:w,compositeRule:g,allErrors:_}=i,E=k(h,p,a);y(w,E),g||_||d(i,n.default.vErrors)}e.reportExtraError=l;function s(h,p){h.assign(n.default.errors,p),h.if((0,t._)`${n.default.vErrors} !== null`,()=>h.if(p,()=>h.assign((0,t._)`${n.default.vErrors}.length`,p),()=>h.assign(n.default.vErrors,null)))}e.resetErrorsCount=s;function c({gen:h,keyword:p,schemaValue:a,data:i,errsCount:w,it:g}){if(w===void 0)throw new Error("ajv implementation error");const _=h.name("err");h.forRange("i",w,n.default.errors,E=>{h.const(_,(0,t._)`${n.default.vErrors}[${E}]`),h.if((0,t._)`${_}.instancePath === undefined`,()=>h.assign((0,t._)`${_}.instancePath`,(0,t.strConcat)(n.default.instancePath,g.errorPath))),h.assign((0,t._)`${_}.schemaPath`,(0,t.str)`${g.errSchemaPath}/${p}`),g.opts.verbose&&(h.assign((0,t._)`${_}.schema`,a),h.assign((0,t._)`${_}.data`,i))})}e.extendErrors=c;function y(h,p){const a=h.const("err",p);h.if((0,t._)`${n.default.vErrors} === null`,()=>h.assign(n.default.vErrors,(0,t._)`[${a}]`),(0,t._)`${n.default.vErrors}.push(${a})`),h.code((0,t._)`${n.default.errors}++`)}function d(h,p){const{gen:a,validateName:i,schemaEnv:w}=h;w.$async?a.throw((0,t._)`new ${h.ValidationError}(${p})`):(a.assign((0,t._)`${i}.errors`,p),a.return(!1))}const m={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function k(h,p,a){const{createErrors:i}=h.it;return i===!1?(0,t._)`{}`:b(h,p,a)}function b(h,p,a={}){const{gen:i,it:w}=h,g=[u(w,a),v(h,a)];return S(h,p,g),i.object(...g)}function u({errorPath:h},{instancePath:p}){const a=p?(0,t.str)`${h}${(0,r.getErrorPath)(p,r.Type.Str)}`:h;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,a)]}function v({keyword:h,it:{errSchemaPath:p}},{schemaPath:a,parentSchema:i}){let w=i?p:(0,t.str)`${p}/${h}`;return a&&(w=(0,t.str)`${w}${(0,r.getErrorPath)(a,r.Type.Str)}`),[m.schemaPath,w]}function S(h,{params:p,message:a},i){const{keyword:w,data:g,schemaValue:_,it:E}=h,{opts:C,propertyName:L,topSchemaRef:z,schemaPath:V}=E;i.push([m.keyword,w],[m.params,typeof p=="function"?p(h):p||(0,t._)`{}`]),C.messages&&i.push([m.message,typeof a=="function"?a(h):a]),C.verbose&&i.push([m.schema,_],[m.parentSchema,(0,t._)`${z}${V}`],[n.default.data,g]),L&&i.push([m.propertyName,L])}})(rn)),rn}var hn;function Ma(){if(hn)return Re;hn=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.boolOrEmptySchema=Re.topBoolOrEmptySchema=void 0;const e=Je(),t=X(),r=xe(),n={message:"boolean schema is false"};function o(c){const{gen:y,schema:d,validateName:m}=c;d===!1?s(c,!1):typeof d=="object"&&d.$async===!0?y.return(r.default.data):(y.assign((0,t._)`${m}.errors`,null),y.return(!0))}Re.topBoolOrEmptySchema=o;function l(c,y){const{gen:d,schema:m}=c;m===!1?(d.var(y,!1),s(c)):d.var(y,!0)}Re.boolOrEmptySchema=l;function s(c,y){const{gen:d,data:m}=c,k={gen:d,keyword:"false schema",data:m,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:c};(0,e.reportError)(k,n,void 0,y)}return Re}var ce={},Ve={},mn;function yn(){if(mn)return Ve;mn=1,Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.getRules=Ve.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function r(o){return typeof o=="string"&&t.has(o)}Ve.isJSONType=r;function n(){const o={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...o,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},o.number,o.string,o.array,o.object],post:{rules:[]},all:{},keywords:{}}}return Ve.getRules=n,Ve}var Ne={},vn;function gn(){if(vn)return Ne;vn=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.shouldUseRule=Ne.shouldUseGroup=Ne.schemaHasRulesForType=void 0;function e({schema:n,self:o},l){const s=o.RULES.types[l];return s&&s!==!0&&t(n,s)}Ne.schemaHasRulesForType=e;function t(n,o){return o.rules.some(l=>r(n,l))}Ne.shouldUseGroup=t;function r(n,o){var l;return n[o.keyword]!==void 0||((l=o.definition.implements)===null||l===void 0?void 0:l.some(s=>n[s]!==void 0))}return Ne.shouldUseRule=r,Ne}var bn;function st(){if(bn)return ce;bn=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.reportTypeError=ce.checkDataTypes=ce.checkDataType=ce.coerceAndCheckDataType=ce.getJSONTypes=ce.getSchemaTypes=ce.DataType=void 0;const e=yn(),t=gn(),r=Je(),n=X(),o=re();var l;(function(a){a[a.Correct=0]="Correct",a[a.Wrong=1]="Wrong"})(l||(ce.DataType=l={}));function s(a){const i=c(a.type);if(i.includes("null")){if(a.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!i.length&&a.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');a.nullable===!0&&i.push("null")}return i}ce.getSchemaTypes=s;function c(a){const i=Array.isArray(a)?a:a?[a]:[];if(i.every(e.isJSONType))return i;throw new Error("type must be JSONType or JSONType[]: "+i.join(","))}ce.getJSONTypes=c;function y(a,i){const{gen:w,data:g,opts:_}=a,E=m(i,_.coerceTypes),C=i.length>0&&!(E.length===0&&i.length===1&&(0,t.schemaHasRulesForType)(a,i[0]));if(C){const L=v(i,g,_.strictNumbers,l.Wrong);w.if(L,()=>{E.length?k(a,i,E):h(a)})}return C}ce.coerceAndCheckDataType=y;const d=new Set(["string","number","integer","boolean","null"]);function m(a,i){return i?a.filter(w=>d.has(w)||i==="array"&&w==="array"):[]}function k(a,i,w){const{gen:g,data:_,opts:E}=a,C=g.let("dataType",(0,n._)`typeof ${_}`),L=g.let("coerced",(0,n._)`undefined`);E.coerceTypes==="array"&&g.if((0,n._)`${C} == 'object' && Array.isArray(${_}) && ${_}.length == 1`,()=>g.assign(_,(0,n._)`${_}[0]`).assign(C,(0,n._)`typeof ${_}`).if(v(i,_,E.strictNumbers),()=>g.assign(L,_))),g.if((0,n._)`${L} !== undefined`);for(const V of w)(d.has(V)||V==="array"&&E.coerceTypes==="array")&&z(V);g.else(),h(a),g.endIf(),g.if((0,n._)`${L} !== undefined`,()=>{g.assign(_,L),b(a,L)});function z(V){switch(V){case"string":g.elseIf((0,n._)`${C} == "number" || ${C} == "boolean"`).assign(L,(0,n._)`"" + ${_}`).elseIf((0,n._)`${_} === null`).assign(L,(0,n._)`""`);return;case"number":g.elseIf((0,n._)`${C} == "boolean" || ${_} === null
4
+ || (${C} == "string" && ${_} && ${_} == +${_})`).assign(L,(0,n._)`+${_}`);return;case"integer":g.elseIf((0,n._)`${C} === "boolean" || ${_} === null
5
+ || (${C} === "string" && ${_} && ${_} == +${_} && !(${_} % 1))`).assign(L,(0,n._)`+${_}`);return;case"boolean":g.elseIf((0,n._)`${_} === "false" || ${_} === 0 || ${_} === null`).assign(L,!1).elseIf((0,n._)`${_} === "true" || ${_} === 1`).assign(L,!0);return;case"null":g.elseIf((0,n._)`${_} === "" || ${_} === 0 || ${_} === false`),g.assign(L,null);return;case"array":g.elseIf((0,n._)`${C} === "string" || ${C} === "number"
6
+ || ${C} === "boolean" || ${_} === null`).assign(L,(0,n._)`[${_}]`)}}}function b({gen:a,parentData:i,parentDataProperty:w},g){a.if((0,n._)`${i} !== undefined`,()=>a.assign((0,n._)`${i}[${w}]`,g))}function u(a,i,w,g=l.Correct){const _=g===l.Correct?n.operators.EQ:n.operators.NEQ;let E;switch(a){case"null":return(0,n._)`${i} ${_} null`;case"array":E=(0,n._)`Array.isArray(${i})`;break;case"object":E=(0,n._)`${i} && typeof ${i} == "object" && !Array.isArray(${i})`;break;case"integer":E=C((0,n._)`!(${i} % 1) && !isNaN(${i})`);break;case"number":E=C();break;default:return(0,n._)`typeof ${i} ${_} ${a}`}return g===l.Correct?E:(0,n.not)(E);function C(L=n.nil){return(0,n.and)((0,n._)`typeof ${i} == "number"`,L,w?(0,n._)`isFinite(${i})`:n.nil)}}ce.checkDataType=u;function v(a,i,w,g){if(a.length===1)return u(a[0],i,w,g);let _;const E=(0,o.toHash)(a);if(E.array&&E.object){const C=(0,n._)`typeof ${i} != "object"`;_=E.null?C:(0,n._)`!${i} || ${C}`,delete E.null,delete E.array,delete E.object}else _=n.nil;E.number&&delete E.integer;for(const C in E)_=(0,n.and)(_,u(C,i,w,g));return _}ce.checkDataTypes=v;const S={message:({schema:a})=>`must be ${a}`,params:({schema:a,schemaValue:i})=>typeof a=="string"?(0,n._)`{type: ${a}}`:(0,n._)`{type: ${i}}`};function h(a){const i=p(a);(0,r.reportError)(i,S)}ce.reportTypeError=h;function p(a){const{gen:i,data:w,schema:g}=a,_=(0,o.schemaRefOrVal)(a,g,"type");return{gen:i,keyword:"type",data:w,schema:g.type,schemaCode:_,schemaValue:_,parentSchema:g,params:{},it:a}}return ce}var Ge={},$n;function Ua(){if($n)return Ge;$n=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.assignDefaults=void 0;const e=X(),t=re();function r(o,l){const{properties:s,items:c}=o.schema;if(l==="object"&&s)for(const y in s)n(o,y,s[y].default);else l==="array"&&Array.isArray(c)&&c.forEach((y,d)=>n(o,d,y.default))}Ge.assignDefaults=r;function n(o,l,s){const{gen:c,compositeRule:y,data:d,opts:m}=o;if(s===void 0)return;const k=(0,e._)`${d}${(0,e.getProperty)(l)}`;if(y){(0,t.checkStrictMode)(o,`default is ignored for: ${k}`);return}let b=(0,e._)`${k} === undefined`;m.useDefaults==="empty"&&(b=(0,e._)`${b} || ${k} === null || ${k} === ""`),c.if(b,(0,e._)`${k} = ${(0,e.stringify)(s)}`)}return Ge}var _e={},oe={},wn;function Pe(){if(wn)return oe;wn=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.validateUnion=oe.validateArray=oe.usePattern=oe.callValidateCode=oe.schemaProperties=oe.allSchemaProperties=oe.noPropertyInData=oe.propertyInData=oe.isOwnProperty=oe.hasPropFunc=oe.reportMissingProp=oe.checkMissingProp=oe.checkReportMissingProp=void 0;const e=X(),t=re(),r=xe(),n=re();function o(a,i){const{gen:w,data:g,it:_}=a;w.if(m(w,g,i,_.opts.ownProperties),()=>{a.setParams({missingProperty:(0,e._)`${i}`},!0),a.error()})}oe.checkReportMissingProp=o;function l({gen:a,data:i,it:{opts:w}},g,_){return(0,e.or)(...g.map(E=>(0,e.and)(m(a,i,E,w.ownProperties),(0,e._)`${_} = ${E}`)))}oe.checkMissingProp=l;function s(a,i){a.setParams({missingProperty:i},!0),a.error()}oe.reportMissingProp=s;function c(a){return a.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}oe.hasPropFunc=c;function y(a,i,w){return(0,e._)`${c(a)}.call(${i}, ${w})`}oe.isOwnProperty=y;function d(a,i,w,g){const _=(0,e._)`${i}${(0,e.getProperty)(w)} !== undefined`;return g?(0,e._)`${_} && ${y(a,i,w)}`:_}oe.propertyInData=d;function m(a,i,w,g){const _=(0,e._)`${i}${(0,e.getProperty)(w)} === undefined`;return g?(0,e.or)(_,(0,e.not)(y(a,i,w))):_}oe.noPropertyInData=m;function k(a){return a?Object.keys(a).filter(i=>i!=="__proto__"):[]}oe.allSchemaProperties=k;function b(a,i){return k(i).filter(w=>!(0,t.alwaysValidSchema)(a,i[w]))}oe.schemaProperties=b;function u({schemaCode:a,data:i,it:{gen:w,topSchemaRef:g,schemaPath:_,errorPath:E},it:C},L,z,V){const F=V?(0,e._)`${a}, ${i}, ${g}${_}`:i,B=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,E)],[r.default.parentData,C.parentData],[r.default.parentDataProperty,C.parentDataProperty],[r.default.rootData,r.default.rootData]];C.opts.dynamicRef&&B.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const W=(0,e._)`${F}, ${w.object(...B)}`;return z!==e.nil?(0,e._)`${L}.call(${z}, ${W})`:(0,e._)`${L}(${W})`}oe.callValidateCode=u;const v=(0,e._)`new RegExp`;function S({gen:a,it:{opts:i}},w){const g=i.unicodeRegExp?"u":"",{regExp:_}=i.code,E=_(w,g);return a.scopeValue("pattern",{key:E.toString(),ref:E,code:(0,e._)`${_.code==="new RegExp"?v:(0,n.useFunc)(a,_)}(${w}, ${g})`})}oe.usePattern=S;function h(a){const{gen:i,data:w,keyword:g,it:_}=a,E=i.name("valid");if(_.allErrors){const L=i.let("valid",!0);return C(()=>i.assign(L,!1)),L}return i.var(E,!0),C(()=>i.break()),E;function C(L){const z=i.const("len",(0,e._)`${w}.length`);i.forRange("i",0,z,V=>{a.subschema({keyword:g,dataProp:V,dataPropType:t.Type.Num},E),i.if((0,e.not)(E),L)})}}oe.validateArray=h;function p(a){const{gen:i,schema:w,keyword:g,it:_}=a;if(!Array.isArray(w))throw new Error("ajv implementation error");if(w.some(L=>(0,t.alwaysValidSchema)(_,L))&&!_.opts.unevaluated)return;const E=i.let("valid",!1),C=i.name("_valid");i.block(()=>w.forEach((L,z)=>{const V=a.subschema({keyword:g,schemaProp:z,compositeRule:!0},C);i.assign(E,(0,e._)`${E} || ${C}`),a.mergeValidEvaluated(V,C)||i.if((0,e.not)(E))})),a.result(E,()=>a.reset(),()=>a.error(!0))}return oe.validateUnion=p,oe}var _n;function Fa(){if(_n)return _e;_n=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.validateKeywordUsage=_e.validSchemaType=_e.funcKeywordCode=_e.macroKeywordCode=void 0;const e=X(),t=xe(),r=Pe(),n=Je();function o(b,u){const{gen:v,keyword:S,schema:h,parentSchema:p,it:a}=b,i=u.macro.call(a.self,h,p,a),w=d(v,S,i);a.opts.validateSchema!==!1&&a.self.validateSchema(i,!0);const g=v.name("valid");b.subschema({schema:i,schemaPath:e.nil,errSchemaPath:`${a.errSchemaPath}/${S}`,topSchemaRef:w,compositeRule:!0},g),b.pass(g,()=>b.error(!0))}_e.macroKeywordCode=o;function l(b,u){var v;const{gen:S,keyword:h,schema:p,parentSchema:a,$data:i,it:w}=b;y(w,u);const g=!i&&u.compile?u.compile.call(w.self,p,a,w):u.validate,_=d(S,h,g),E=S.let("valid");b.block$data(E,C),b.ok((v=u.valid)!==null&&v!==void 0?v:E);function C(){if(u.errors===!1)V(),u.modifying&&s(b),F(()=>b.error());else{const B=u.async?L():z();u.modifying&&s(b),F(()=>c(b,B))}}function L(){const B=S.let("ruleErrs",null);return S.try(()=>V((0,e._)`await `),W=>S.assign(E,!1).if((0,e._)`${W} instanceof ${w.ValidationError}`,()=>S.assign(B,(0,e._)`${W}.errors`),()=>S.throw(W))),B}function z(){const B=(0,e._)`${_}.errors`;return S.assign(B,null),V(e.nil),B}function V(B=u.async?(0,e._)`await `:e.nil){const W=w.opts.passContext?t.default.this:t.default.self,ae=!("compile"in u&&!i||u.schema===!1);S.assign(E,(0,e._)`${B}${(0,r.callValidateCode)(b,_,W,ae)}`,u.modifying)}function F(B){var W;S.if((0,e.not)((W=u.valid)!==null&&W!==void 0?W:E),B)}}_e.funcKeywordCode=l;function s(b){const{gen:u,data:v,it:S}=b;u.if(S.parentData,()=>u.assign(v,(0,e._)`${S.parentData}[${S.parentDataProperty}]`))}function c(b,u){const{gen:v}=b;v.if((0,e._)`Array.isArray(${u})`,()=>{v.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${u} : ${t.default.vErrors}.concat(${u})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,n.extendErrors)(b)},()=>b.error())}function y({schemaEnv:b},u){if(u.async&&!b.$async)throw new Error("async keyword in sync schema")}function d(b,u,v){if(v===void 0)throw new Error(`keyword "${u}" failed to compile`);return b.scopeValue("keyword",typeof v=="function"?{ref:v}:{ref:v,code:(0,e.stringify)(v)})}function m(b,u,v=!1){return!u.length||u.some(S=>S==="array"?Array.isArray(b):S==="object"?b&&typeof b=="object"&&!Array.isArray(b):typeof b==S||v&&typeof b>"u")}_e.validSchemaType=m;function k({schema:b,opts:u,self:v,errSchemaPath:S},h,p){if(Array.isArray(h.keyword)?!h.keyword.includes(p):h.keyword!==p)throw new Error("ajv implementation error");const a=h.dependencies;if(a!=null&&a.some(i=>!Object.prototype.hasOwnProperty.call(b,i)))throw new Error(`parent schema must have dependencies of ${p}: ${a.join(",")}`);if(h.validateSchema&&!h.validateSchema(b[p])){const i=`keyword "${p}" value is invalid at path "${S}": `+v.errorsText(h.validateSchema.errors);if(u.validateSchema==="log")v.logger.error(i);else throw new Error(i)}}return _e.validateKeywordUsage=k,_e}var je={},Pn;function Ka(){if(Pn)return je;Pn=1,Object.defineProperty(je,"__esModule",{value:!0}),je.extendSubschemaMode=je.extendSubschemaData=je.getSubschema=void 0;const e=X(),t=re();function r(l,{keyword:s,schemaProp:c,schema:y,schemaPath:d,errSchemaPath:m,topSchemaRef:k}){if(s!==void 0&&y!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(s!==void 0){const b=l.schema[s];return c===void 0?{schema:b,schemaPath:(0,e._)`${l.schemaPath}${(0,e.getProperty)(s)}`,errSchemaPath:`${l.errSchemaPath}/${s}`}:{schema:b[c],schemaPath:(0,e._)`${l.schemaPath}${(0,e.getProperty)(s)}${(0,e.getProperty)(c)}`,errSchemaPath:`${l.errSchemaPath}/${s}/${(0,t.escapeFragment)(c)}`}}if(y!==void 0){if(d===void 0||m===void 0||k===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:y,schemaPath:d,topSchemaRef:k,errSchemaPath:m}}throw new Error('either "keyword" or "schema" must be passed')}je.getSubschema=r;function n(l,s,{dataProp:c,dataPropType:y,data:d,dataTypes:m,propertyName:k}){if(d!==void 0&&c!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:b}=s;if(c!==void 0){const{errorPath:v,dataPathArr:S,opts:h}=s,p=b.let("data",(0,e._)`${s.data}${(0,e.getProperty)(c)}`,!0);u(p),l.errorPath=(0,e.str)`${v}${(0,t.getErrorPath)(c,y,h.jsPropertySyntax)}`,l.parentDataProperty=(0,e._)`${c}`,l.dataPathArr=[...S,l.parentDataProperty]}if(d!==void 0){const v=d instanceof e.Name?d:b.let("data",d,!0);u(v),k!==void 0&&(l.propertyName=k)}m&&(l.dataTypes=m);function u(v){l.data=v,l.dataLevel=s.dataLevel+1,l.dataTypes=[],s.definedProperties=new Set,l.parentData=s.data,l.dataNames=[...s.dataNames,v]}}je.extendSubschemaData=n;function o(l,{jtdDiscriminator:s,jtdMetadata:c,compositeRule:y,createErrors:d,allErrors:m}){y!==void 0&&(l.compositeRule=y),d!==void 0&&(l.createErrors=d),m!==void 0&&(l.allErrors=m),l.jtdDiscriminator=s,l.jtdMetadata=c}return je.extendSubschemaMode=o,je}var he={},En,Sn;function kn(){return Sn||(Sn=1,En=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,l;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(l=Object.keys(t),n=l.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,l[o]))return!1;for(o=n;o--!==0;){var s=l[o];if(!e(t[s],r[s]))return!1}return!0}return t!==t&&r!==r}),En}var ar={exports:{}},xn;function Ba(){if(xn)return ar.exports;xn=1;var e=ar.exports=function(n,o,l){typeof o=="function"&&(l=o,o={}),l=o.cb||l;var s=typeof l=="function"?l:l.pre||function(){},c=l.post||function(){};t(o,s,c,n,"",n)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.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 t(n,o,l,s,c,y,d,m,k,b){if(s&&typeof s=="object"&&!Array.isArray(s)){o(s,c,y,d,m,k,b);for(var u in s){var v=s[u];if(Array.isArray(v)){if(u in e.arrayKeywords)for(var S=0;S<v.length;S++)t(n,o,l,v[S],c+"/"+u+"/"+S,y,c,u,s,S)}else if(u in e.propsKeywords){if(v&&typeof v=="object")for(var h in v)t(n,o,l,v[h],c+"/"+u+"/"+r(h),y,c,u,s,h)}else(u in e.keywords||n.allKeys&&!(u in e.skipKeywords))&&t(n,o,l,v,c+"/"+u,y,c,u,s)}l(s,c,y,d,m,k,b)}}function r(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return ar.exports}var Nn;function it(){if(Nn)return he;Nn=1,Object.defineProperty(he,"__esModule",{value:!0}),he.getSchemaRefs=he.resolveUrl=he.normalizeId=he._getFullPath=he.getFullPath=he.inlineRef=void 0;const e=re(),t=kn(),r=Ba(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function o(S,h=!0){return typeof S=="boolean"?!0:h===!0?!s(S):h?c(S)<=h:!1}he.inlineRef=o;const l=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function s(S){for(const h in S){if(l.has(h))return!0;const p=S[h];if(Array.isArray(p)&&p.some(s)||typeof p=="object"&&s(p))return!0}return!1}function c(S){let h=0;for(const p in S)if(p==="$ref"||(h++,!n.has(p)&&(typeof S[p]=="object"&&(0,e.eachItem)(S[p],a=>h+=c(a)),h===1/0)))return 1/0;return h}function y(S,h="",p){p!==!1&&(h=k(h));const a=S.parse(h);return d(S,a)}he.getFullPath=y;function d(S,h){return S.serialize(h).split("#")[0]+"#"}he._getFullPath=d;const m=/#\/?$/;function k(S){return S?S.replace(m,""):""}he.normalizeId=k;function b(S,h,p){return p=k(p),S.resolve(h,p)}he.resolveUrl=b;const u=/^[a-z_][-a-z0-9._]*$/i;function v(S,h){if(typeof S=="boolean")return{};const{schemaId:p,uriResolver:a}=this.opts,i=k(S[p]||h),w={"":i},g=y(a,i,!1),_={},E=new Set;return r(S,{allKeys:!0},(z,V,F,B)=>{if(B===void 0)return;const W=g+V;let ae=w[B];typeof z[p]=="string"&&(ae=se.call(this,z[p])),de.call(this,z.$anchor),de.call(this,z.$dynamicAnchor),w[V]=ae;function se(ne){const fe=this.opts.uriResolver.resolve;if(ne=k(ae?fe(ae,ne):ne),E.has(ne))throw L(ne);E.add(ne);let D=this.refs[ne];return typeof D=="string"&&(D=this.refs[D]),typeof D=="object"?C(z,D.schema,ne):ne!==k(W)&&(ne[0]==="#"?(C(z,_[ne],ne),_[ne]=z):this.refs[ne]=W),ne}function de(ne){if(typeof ne=="string"){if(!u.test(ne))throw new Error(`invalid anchor "${ne}"`);se.call(this,`#${ne}`)}}}),_;function C(z,V,F){if(V!==void 0&&!t(z,V))throw L(F)}function L(z){return new Error(`reference "${z}" resolves to more than one schema`)}}return he.getSchemaRefs=v,he}var jn;function Ze(){if(jn)return ke;jn=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.getData=ke.KeywordCxt=ke.validateFunctionCode=void 0;const e=Ma(),t=st(),r=gn(),n=st(),o=Ua(),l=Fa(),s=Ka(),c=X(),y=xe(),d=it(),m=re(),k=Je();function b(N){if(g(N)&&(E(N),w(N))){h(N);return}u(N,()=>(0,e.topBoolOrEmptySchema)(N))}ke.validateFunctionCode=b;function u({gen:N,validateName:j,schema:R,schemaEnv:q,opts:J},te){J.code.es5?N.func(j,(0,c._)`${y.default.data}, ${y.default.valCxt}`,q.$async,()=>{N.code((0,c._)`"use strict"; ${a(R,J)}`),S(N,J),N.code(te)}):N.func(j,(0,c._)`${y.default.data}, ${v(J)}`,q.$async,()=>N.code(a(R,J)).code(te))}function v(N){return(0,c._)`{${y.default.instancePath}="", ${y.default.parentData}, ${y.default.parentDataProperty}, ${y.default.rootData}=${y.default.data}${N.dynamicRef?(0,c._)`, ${y.default.dynamicAnchors}={}`:c.nil}}={}`}function S(N,j){N.if(y.default.valCxt,()=>{N.var(y.default.instancePath,(0,c._)`${y.default.valCxt}.${y.default.instancePath}`),N.var(y.default.parentData,(0,c._)`${y.default.valCxt}.${y.default.parentData}`),N.var(y.default.parentDataProperty,(0,c._)`${y.default.valCxt}.${y.default.parentDataProperty}`),N.var(y.default.rootData,(0,c._)`${y.default.valCxt}.${y.default.rootData}`),j.dynamicRef&&N.var(y.default.dynamicAnchors,(0,c._)`${y.default.valCxt}.${y.default.dynamicAnchors}`)},()=>{N.var(y.default.instancePath,(0,c._)`""`),N.var(y.default.parentData,(0,c._)`undefined`),N.var(y.default.parentDataProperty,(0,c._)`undefined`),N.var(y.default.rootData,y.default.data),j.dynamicRef&&N.var(y.default.dynamicAnchors,(0,c._)`{}`)})}function h(N){const{schema:j,opts:R,gen:q}=N;u(N,()=>{R.$comment&&j.$comment&&B(N),z(N),q.let(y.default.vErrors,null),q.let(y.default.errors,0),R.unevaluated&&p(N),C(N),W(N)})}function p(N){const{gen:j,validateName:R}=N;N.evaluated=j.const("evaluated",(0,c._)`${R}.evaluated`),j.if((0,c._)`${N.evaluated}.dynamicProps`,()=>j.assign((0,c._)`${N.evaluated}.props`,(0,c._)`undefined`)),j.if((0,c._)`${N.evaluated}.dynamicItems`,()=>j.assign((0,c._)`${N.evaluated}.items`,(0,c._)`undefined`))}function a(N,j){const R=typeof N=="object"&&N[j.schemaId];return R&&(j.code.source||j.code.process)?(0,c._)`/*# sourceURL=${R} */`:c.nil}function i(N,j){if(g(N)&&(E(N),w(N))){_(N,j);return}(0,e.boolOrEmptySchema)(N,j)}function w({schema:N,self:j}){if(typeof N=="boolean")return!N;for(const R in N)if(j.RULES.all[R])return!0;return!1}function g(N){return typeof N.schema!="boolean"}function _(N,j){const{schema:R,gen:q,opts:J}=N;J.$comment&&R.$comment&&B(N),V(N),F(N);const te=q.const("_errs",y.default.errors);C(N,te),q.var(j,(0,c._)`${te} === ${y.default.errors}`)}function E(N){(0,m.checkUnknownRules)(N),L(N)}function C(N,j){if(N.opts.jtd)return se(N,[],!1,j);const R=(0,t.getSchemaTypes)(N.schema),q=(0,t.coerceAndCheckDataType)(N,R);se(N,R,!q,j)}function L(N){const{schema:j,errSchemaPath:R,opts:q,self:J}=N;j.$ref&&q.ignoreKeywordsWithRef&&(0,m.schemaHasRulesButRef)(j,J.RULES)&&J.logger.warn(`$ref: keywords ignored in schema at path "${R}"`)}function z(N){const{schema:j,opts:R}=N;j.default!==void 0&&R.useDefaults&&R.strictSchema&&(0,m.checkStrictMode)(N,"default is ignored in the schema root")}function V(N){const j=N.schema[N.opts.schemaId];j&&(N.baseId=(0,d.resolveUrl)(N.opts.uriResolver,N.baseId,j))}function F(N){if(N.schema.$async&&!N.schemaEnv.$async)throw new Error("async schema in sync schema")}function B({gen:N,schemaEnv:j,schema:R,errSchemaPath:q,opts:J}){const te=R.$comment;if(J.$comment===!0)N.code((0,c._)`${y.default.self}.logger.log(${te})`);else if(typeof J.$comment=="function"){const le=(0,c.str)`${q}/$comment`,$e=N.scopeValue("root",{ref:j.root});N.code((0,c._)`${y.default.self}.opts.$comment(${te}, ${le}, ${$e}.schema)`)}}function W(N){const{gen:j,schemaEnv:R,validateName:q,ValidationError:J,opts:te}=N;R.$async?j.if((0,c._)`${y.default.errors} === 0`,()=>j.return(y.default.data),()=>j.throw((0,c._)`new ${J}(${y.default.vErrors})`)):(j.assign((0,c._)`${q}.errors`,y.default.vErrors),te.unevaluated&&ae(N),j.return((0,c._)`${y.default.errors} === 0`))}function ae({gen:N,evaluated:j,props:R,items:q}){R instanceof c.Name&&N.assign((0,c._)`${j}.props`,R),q instanceof c.Name&&N.assign((0,c._)`${j}.items`,q)}function se(N,j,R,q){const{gen:J,schema:te,data:le,allErrors:$e,opts:me,self:ye}=N,{RULES:ue}=ye;if(te.$ref&&(me.ignoreKeywordsWithRef||!(0,m.schemaHasRulesButRef)(te,ue))){J.block(()=>M(N,"$ref",ue.all.$ref.definition));return}me.jtd||ne(N,j),J.block(()=>{for(const be of ue.rules)Ae(be);Ae(ue.post)});function Ae(be){(0,r.shouldUseGroup)(te,be)&&(be.type?(J.if((0,n.checkDataType)(be.type,le,me.strictNumbers)),de(N,be),j.length===1&&j[0]===be.type&&R&&(J.else(),(0,n.reportTypeError)(N)),J.endIf()):de(N,be),$e||J.if((0,c._)`${y.default.errors} === ${q||0}`))}}function de(N,j){const{gen:R,schema:q,opts:{useDefaults:J}}=N;J&&(0,o.assignDefaults)(N,j.type),R.block(()=>{for(const te of j.rules)(0,r.shouldUseRule)(q,te)&&M(N,te.keyword,te.definition,j.type)})}function ne(N,j){N.schemaEnv.meta||!N.opts.strictTypes||(fe(N,j),N.opts.allowUnionTypes||D(N,j),I(N,N.dataTypes))}function fe(N,j){if(j.length){if(!N.dataTypes.length){N.dataTypes=j;return}j.forEach(R=>{x(N.dataTypes,R)||P(N,`type "${R}" not allowed by context "${N.dataTypes.join(",")}"`)}),f(N,j)}}function D(N,j){j.length>1&&!(j.length===2&&j.includes("null"))&&P(N,"use allowUnionTypes to allow union type keyword")}function I(N,j){const R=N.self.RULES.all;for(const q in R){const J=R[q];if(typeof J=="object"&&(0,r.shouldUseRule)(N.schema,J)){const{type:te}=J.definition;te.length&&!te.some(le=>T(j,le))&&P(N,`missing type "${te.join(",")}" for keyword "${q}"`)}}}function T(N,j){return N.includes(j)||j==="number"&&N.includes("integer")}function x(N,j){return N.includes(j)||j==="integer"&&N.includes("number")}function f(N,j){const R=[];for(const q of N.dataTypes)x(j,q)?R.push(q):j.includes("integer")&&q==="number"&&R.push("integer");N.dataTypes=R}function P(N,j){const R=N.schemaEnv.baseId+N.errSchemaPath;j+=` at "${R}" (strictTypes)`,(0,m.checkStrictMode)(N,j,N.opts.strictTypes)}class O{constructor(j,R,q){if((0,l.validateKeywordUsage)(j,R,q),this.gen=j.gen,this.allErrors=j.allErrors,this.keyword=q,this.data=j.data,this.schema=j.schema[q],this.$data=R.$data&&j.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,m.schemaRefOrVal)(j,this.schema,q,this.$data),this.schemaType=R.schemaType,this.parentSchema=j.schema,this.params={},this.it=j,this.def=R,this.$data)this.schemaCode=j.gen.const("vSchema",Y(this.$data,j));else if(this.schemaCode=this.schemaValue,!(0,l.validSchemaType)(this.schema,R.schemaType,R.allowUndefined))throw new Error(`${q} value must be ${JSON.stringify(R.schemaType)}`);("code"in R?R.trackErrors:R.errors!==!1)&&(this.errsCount=j.gen.const("_errs",y.default.errors))}result(j,R,q){this.failResult((0,c.not)(j),R,q)}failResult(j,R,q){this.gen.if(j),q?q():this.error(),R?(this.gen.else(),R(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(j,R){this.failResult((0,c.not)(j),void 0,R)}fail(j){if(j===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(j),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(j){if(!this.$data)return this.fail(j);const{schemaCode:R}=this;this.fail((0,c._)`${R} !== undefined && (${(0,c.or)(this.invalid$data(),j)})`)}error(j,R,q){if(R){this.setParams(R),this._error(j,q),this.setParams({});return}this._error(j,q)}_error(j,R){(j?k.reportExtraError:k.reportError)(this,this.def.error,R)}$dataError(){(0,k.reportError)(this,this.def.$dataError||k.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,k.resetErrorsCount)(this.gen,this.errsCount)}ok(j){this.allErrors||this.gen.if(j)}setParams(j,R){R?Object.assign(this.params,j):this.params=j}block$data(j,R,q=c.nil){this.gen.block(()=>{this.check$data(j,q),R()})}check$data(j=c.nil,R=c.nil){if(!this.$data)return;const{gen:q,schemaCode:J,schemaType:te,def:le}=this;q.if((0,c.or)((0,c._)`${J} === undefined`,R)),j!==c.nil&&q.assign(j,!0),(te.length||le.validateSchema)&&(q.elseIf(this.invalid$data()),this.$dataError(),j!==c.nil&&q.assign(j,!1)),q.else()}invalid$data(){const{gen:j,schemaCode:R,schemaType:q,def:J,it:te}=this;return(0,c.or)(le(),$e());function le(){if(q.length){if(!(R instanceof c.Name))throw new Error("ajv implementation error");const me=Array.isArray(q)?q:[q];return(0,c._)`${(0,n.checkDataTypes)(me,R,te.opts.strictNumbers,n.DataType.Wrong)}`}return c.nil}function $e(){if(J.validateSchema){const me=j.scopeValue("validate$data",{ref:J.validateSchema});return(0,c._)`!${me}(${R})`}return c.nil}}subschema(j,R){const q=(0,s.getSubschema)(this.it,j);(0,s.extendSubschemaData)(q,this.it,j),(0,s.extendSubschemaMode)(q,j);const J={...this.it,...q,items:void 0,props:void 0};return i(J,R),J}mergeEvaluated(j,R){const{it:q,gen:J}=this;q.opts.unevaluated&&(q.props!==!0&&j.props!==void 0&&(q.props=m.mergeEvaluated.props(J,j.props,q.props,R)),q.items!==!0&&j.items!==void 0&&(q.items=m.mergeEvaluated.items(J,j.items,q.items,R)))}mergeValidEvaluated(j,R){const{it:q,gen:J}=this;if(q.opts.unevaluated&&(q.props!==!0||q.items!==!0))return J.if(R,()=>this.mergeEvaluated(j,c.Name)),!0}}ke.KeywordCxt=O;function M(N,j,R,q){const J=new O(N,R,j);"code"in R?R.code(J,q):J.$data&&R.validate?(0,l.funcKeywordCode)(J,R):"macro"in R?(0,l.macroKeywordCode)(J,R):(R.compile||R.validate)&&(0,l.funcKeywordCode)(J,R)}const A=/^\/(?:[^~]|~0|~1)*$/,H=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Y(N,{dataLevel:j,dataNames:R,dataPathArr:q}){let J,te;if(N==="")return y.default.rootData;if(N[0]==="/"){if(!A.test(N))throw new Error(`Invalid JSON-pointer: ${N}`);J=N,te=y.default.rootData}else{const ye=H.exec(N);if(!ye)throw new Error(`Invalid JSON-pointer: ${N}`);const ue=+ye[1];if(J=ye[2],J==="#"){if(ue>=j)throw new Error(me("property/index",ue));return q[j-ue]}if(ue>j)throw new Error(me("data",ue));if(te=R[j-ue],!J)return te}let le=te;const $e=J.split("/");for(const ye of $e)ye&&(te=(0,c._)`${te}${(0,c.getProperty)((0,m.unescapeJsonPointer)(ye))}`,le=(0,c._)`${le} && ${te}`);return le;function me(ye,ue){return`Cannot access ${ye} ${ue} levels up, current level is ${j}`}}return ke.getData=Y,ke}var lt={},In;function sr(){if(In)return lt;In=1,Object.defineProperty(lt,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return lt.default=e,lt}var ut={},Tn;function ct(){if(Tn)return ut;Tn=1,Object.defineProperty(ut,"__esModule",{value:!0});const e=it();class t extends Error{constructor(n,o,l,s){super(s||`can't resolve reference ${l} from id ${o}`),this.missingRef=(0,e.resolveUrl)(n,o,l),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(n,this.missingRef))}}return ut.default=t,ut}var ge={},On;function ir(){if(On)return ge;On=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.resolveSchema=ge.getCompilingSchema=ge.resolveRef=ge.compileSchema=ge.SchemaEnv=void 0;const e=X(),t=sr(),r=xe(),n=it(),o=re(),l=Ze();class s{constructor(p){var a;this.refs={},this.dynamicAnchors={};let i;typeof p.schema=="object"&&(i=p.schema),this.schema=p.schema,this.schemaId=p.schemaId,this.root=p.root||this,this.baseId=(a=p.baseId)!==null&&a!==void 0?a:(0,n.normalizeId)(i?.[p.schemaId||"$id"]),this.schemaPath=p.schemaPath,this.localRefs=p.localRefs,this.meta=p.meta,this.$async=i?.$async,this.refs={}}}ge.SchemaEnv=s;function c(h){const p=m.call(this,h);if(p)return p;const a=(0,n.getFullPath)(this.opts.uriResolver,h.root.baseId),{es5:i,lines:w}=this.opts.code,{ownProperties:g}=this.opts,_=new e.CodeGen(this.scope,{es5:i,lines:w,ownProperties:g});let E;h.$async&&(E=_.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const C=_.scopeName("validate");h.validateName=C;const L={gen:_,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:_.scopeValue("schema",this.opts.code.source===!0?{ref:h.schema,code:(0,e.stringify)(h.schema)}:{ref:h.schema}),validateName:C,ValidationError:E,schema:h.schema,schemaEnv:h,rootId:a,baseId:h.baseId||a,schemaPath:e.nil,errSchemaPath:h.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let z;try{this._compilations.add(h),(0,l.validateFunctionCode)(L),_.optimize(this.opts.code.optimize);const V=_.toString();z=`${_.scopeRefs(r.default.scope)}return ${V}`,this.opts.code.process&&(z=this.opts.code.process(z,h));const F=new Function(`${r.default.self}`,`${r.default.scope}`,z)(this,this.scope.get());if(this.scope.value(C,{ref:F}),F.errors=null,F.schema=h.schema,F.schemaEnv=h,h.$async&&(F.$async=!0),this.opts.code.source===!0&&(F.source={validateName:C,validateCode:V,scopeValues:_._values}),this.opts.unevaluated){const{props:B,items:W}=L;F.evaluated={props:B instanceof e.Name?void 0:B,items:W instanceof e.Name?void 0:W,dynamicProps:B instanceof e.Name,dynamicItems:W instanceof e.Name},F.source&&(F.source.evaluated=(0,e.stringify)(F.evaluated))}return h.validate=F,h}catch(V){throw delete h.validate,delete h.validateName,z&&this.logger.error("Error compiling schema, function code:",z),V}finally{this._compilations.delete(h)}}ge.compileSchema=c;function y(h,p,a){var i;a=(0,n.resolveUrl)(this.opts.uriResolver,p,a);const w=h.refs[a];if(w)return w;let g=b.call(this,h,a);if(g===void 0){const _=(i=h.localRefs)===null||i===void 0?void 0:i[a],{schemaId:E}=this.opts;_&&(g=new s({schema:_,schemaId:E,root:h,baseId:p}))}if(g!==void 0)return h.refs[a]=d.call(this,g)}ge.resolveRef=y;function d(h){return(0,n.inlineRef)(h.schema,this.opts.inlineRefs)?h.schema:h.validate?h:c.call(this,h)}function m(h){for(const p of this._compilations)if(k(p,h))return p}ge.getCompilingSchema=m;function k(h,p){return h.schema===p.schema&&h.root===p.root&&h.baseId===p.baseId}function b(h,p){let a;for(;typeof(a=this.refs[p])=="string";)p=a;return a||this.schemas[p]||u.call(this,h,p)}function u(h,p){const a=this.opts.uriResolver.parse(p),i=(0,n._getFullPath)(this.opts.uriResolver,a);let w=(0,n.getFullPath)(this.opts.uriResolver,h.baseId,void 0);if(Object.keys(h.schema).length>0&&i===w)return S.call(this,a,h);const g=(0,n.normalizeId)(i),_=this.refs[g]||this.schemas[g];if(typeof _=="string"){const E=u.call(this,h,_);return typeof E?.schema!="object"?void 0:S.call(this,a,E)}if(typeof _?.schema=="object"){if(_.validate||c.call(this,_),g===(0,n.normalizeId)(p)){const{schema:E}=_,{schemaId:C}=this.opts,L=E[C];return L&&(w=(0,n.resolveUrl)(this.opts.uriResolver,w,L)),new s({schema:E,schemaId:C,root:h,baseId:w})}return S.call(this,a,_)}}ge.resolveSchema=u;const v=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function S(h,{baseId:p,schema:a,root:i}){var w;if(((w=h.fragment)===null||w===void 0?void 0:w[0])!=="/")return;for(const E of h.fragment.slice(1).split("/")){if(typeof a=="boolean")return;const C=a[(0,o.unescapeFragment)(E)];if(C===void 0)return;a=C;const L=typeof a=="object"&&a[this.opts.schemaId];!v.has(E)&&L&&(p=(0,n.resolveUrl)(this.opts.uriResolver,p,L))}let g;if(typeof a!="boolean"&&a.$ref&&!(0,o.schemaHasRulesButRef)(a,this.RULES)){const E=(0,n.resolveUrl)(this.opts.uriResolver,p,a.$ref);g=u.call(this,i,E)}const{schemaId:_}=this.opts;if(g=g||new s({schema:a,schemaId:_,root:i,baseId:p}),g.schema!==g.root.schema)return g}return ge}const Ha="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Wa="Meta-schema for $data reference (JSON AnySchema extension proposal)",Ja="object",Ga=["$data"],Za={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Qa=!1,Ya={$id:Ha,description:Wa,type:Ja,required:Ga,properties:Za,additionalProperties:Qa};var dt={},Qe={exports:{}},lr,Cn;function Rn(){if(Cn)return lr;Cn=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function r(b){let u="",v=0,S=0;for(S=0;S<b.length;S++)if(v=b[S].charCodeAt(0),v!==48){if(!(v>=48&&v<=57||v>=65&&v<=70||v>=97&&v<=102))return"";u+=b[S];break}for(S+=1;S<b.length;S++){if(v=b[S].charCodeAt(0),!(v>=48&&v<=57||v>=65&&v<=70||v>=97&&v<=102))return"";u+=b[S]}return u}const n=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function o(b){return b.length=0,!0}function l(b,u,v){if(b.length){const S=r(b);if(S!=="")u.push(S);else return v.error=!0,!1;b.length=0}return!0}function s(b){let u=0;const v={error:!1,address:"",zone:""},S=[],h=[];let p=!1,a=!1,i=l;for(let w=0;w<b.length;w++){const g=b[w];if(!(g==="["||g==="]"))if(g===":"){if(p===!0&&(a=!0),!i(h,S,v))break;if(++u>7){v.error=!0;break}w>0&&b[w-1]===":"&&(p=!0),S.push(":");continue}else if(g==="%"){if(!i(h,S,v))break;i=o}else{h.push(g);continue}}return h.length&&(i===o?v.zone=h.join(""):a?S.push(h.join("")):S.push(r(h))),v.address=S.join(""),v}function c(b){if(y(b,":")<2)return{host:b,isIPV6:!1};const u=s(b);if(u.error)return{host:b,isIPV6:!1};{let v=u.address,S=u.address;return u.zone&&(v+="%"+u.zone,S+="%25"+u.zone),{host:v,isIPV6:!0,escapedHost:S}}}function y(b,u){let v=0;for(let S=0;S<b.length;S++)b[S]===u&&v++;return v}function d(b){let u=b;const v=[];let S=-1,h=0;for(;h=u.length;){if(h===1){if(u===".")break;if(u==="/"){v.push("/");break}else{v.push(u);break}}else if(h===2){if(u[0]==="."){if(u[1]===".")break;if(u[1]==="/"){u=u.slice(2);continue}}else if(u[0]==="/"&&(u[1]==="."||u[1]==="/")){v.push("/");break}}else if(h===3&&u==="/.."){v.length!==0&&v.pop(),v.push("/");break}if(u[0]==="."){if(u[1]==="."){if(u[2]==="/"){u=u.slice(3);continue}}else if(u[1]==="/"){u=u.slice(2);continue}}else if(u[0]==="/"&&u[1]==="."){if(u[2]==="/"){u=u.slice(2);continue}else if(u[2]==="."&&u[3]==="/"){u=u.slice(3),v.length!==0&&v.pop();continue}}if((S=u.indexOf("/",1))===-1){v.push(u);break}else v.push(u.slice(0,S)),u=u.slice(S)}return v.join("")}function m(b,u){const v=u!==!0?escape:unescape;return b.scheme!==void 0&&(b.scheme=v(b.scheme)),b.userinfo!==void 0&&(b.userinfo=v(b.userinfo)),b.host!==void 0&&(b.host=v(b.host)),b.path!==void 0&&(b.path=v(b.path)),b.query!==void 0&&(b.query=v(b.query)),b.fragment!==void 0&&(b.fragment=v(b.fragment)),b}function k(b){const u=[];if(b.userinfo!==void 0&&(u.push(b.userinfo),u.push("@")),b.host!==void 0){let v=unescape(b.host);if(!t(v)){const S=c(v);S.isIPV6===!0?v=`[${S.escapedHost}]`:v=b.host}u.push(v)}return(typeof b.port=="number"||typeof b.port=="string")&&(u.push(":"),u.push(String(b.port))),u.length?u.join(""):void 0}return lr={nonSimpleDomain:n,recomposeAuthority:k,normalizeComponentEncoding:m,removeDotSegments:d,isIPv4:t,isUUID:e,normalizeIPv6:c,stringArrayToHexStripped:r},lr}var ur,Vn;function Xa(){if(Vn)return ur;Vn=1;const{isUUID:e}=Rn(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,r=["http","https","ws","wss","urn","urn:uuid"];function n(i){return r.indexOf(i)!==-1}function o(i){return i.secure===!0?!0:i.secure===!1?!1:i.scheme?i.scheme.length===3&&(i.scheme[0]==="w"||i.scheme[0]==="W")&&(i.scheme[1]==="s"||i.scheme[1]==="S")&&(i.scheme[2]==="s"||i.scheme[2]==="S"):!1}function l(i){return i.host||(i.error=i.error||"HTTP URIs must have a host."),i}function s(i){const w=String(i.scheme).toLowerCase()==="https";return(i.port===(w?443:80)||i.port==="")&&(i.port=void 0),i.path||(i.path="/"),i}function c(i){return i.secure=o(i),i.resourceName=(i.path||"/")+(i.query?"?"+i.query:""),i.path=void 0,i.query=void 0,i}function y(i){if((i.port===(o(i)?443:80)||i.port==="")&&(i.port=void 0),typeof i.secure=="boolean"&&(i.scheme=i.secure?"wss":"ws",i.secure=void 0),i.resourceName){const[w,g]=i.resourceName.split("?");i.path=w&&w!=="/"?w:void 0,i.query=g,i.resourceName=void 0}return i.fragment=void 0,i}function d(i,w){if(!i.path)return i.error="URN can not be parsed",i;const g=i.path.match(t);if(g){const _=w.scheme||i.scheme||"urn";i.nid=g[1].toLowerCase(),i.nss=g[2];const E=`${_}:${w.nid||i.nid}`,C=a(E);i.path=void 0,C&&(i=C.parse(i,w))}else i.error=i.error||"URN can not be parsed.";return i}function m(i,w){if(i.nid===void 0)throw new Error("URN without nid cannot be serialized");const g=w.scheme||i.scheme||"urn",_=i.nid.toLowerCase(),E=`${g}:${w.nid||_}`,C=a(E);C&&(i=C.serialize(i,w));const L=i,z=i.nss;return L.path=`${_||w.nid}:${z}`,w.skipEscape=!0,L}function k(i,w){const g=i;return g.uuid=g.nss,g.nss=void 0,!w.tolerant&&(!g.uuid||!e(g.uuid))&&(g.error=g.error||"UUID is not valid."),g}function b(i){const w=i;return w.nss=(i.uuid||"").toLowerCase(),w}const u={scheme:"http",domainHost:!0,parse:l,serialize:s},v={scheme:"https",domainHost:u.domainHost,parse:l,serialize:s},S={scheme:"ws",domainHost:!0,parse:c,serialize:y},h={scheme:"wss",domainHost:S.domainHost,parse:S.parse,serialize:S.serialize},p={http:u,https:v,ws:S,wss:h,urn:{scheme:"urn",parse:d,serialize:m,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:k,serialize:b,skipNormalize:!0}};Object.setPrototypeOf(p,null);function a(i){return i&&(p[i]||p[i.toLowerCase()])||void 0}return ur={wsIsSecure:o,SCHEMES:p,isValidSchemeName:n,getSchemeHandler:a},ur}var Dn;function es(){if(Dn)return Qe.exports;Dn=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:r,normalizeComponentEncoding:n,isIPv4:o,nonSimpleDomain:l}=Rn(),{SCHEMES:s,getSchemeHandler:c}=Xa();function y(h,p){return typeof h=="string"?h=b(v(h,p),p):typeof h=="object"&&(h=v(b(h,p),p)),h}function d(h,p,a){const i=a?Object.assign({scheme:"null"},a):{scheme:"null"},w=m(v(h,i),v(p,i),i,!0);return i.skipEscape=!0,b(w,i)}function m(h,p,a,i){const w={};return i||(h=v(b(h,a),a),p=v(b(p,a),a)),a=a||{},!a.tolerant&&p.scheme?(w.scheme=p.scheme,w.userinfo=p.userinfo,w.host=p.host,w.port=p.port,w.path=t(p.path||""),w.query=p.query):(p.userinfo!==void 0||p.host!==void 0||p.port!==void 0?(w.userinfo=p.userinfo,w.host=p.host,w.port=p.port,w.path=t(p.path||""),w.query=p.query):(p.path?(p.path[0]==="/"?w.path=t(p.path):((h.userinfo!==void 0||h.host!==void 0||h.port!==void 0)&&!h.path?w.path="/"+p.path:h.path?w.path=h.path.slice(0,h.path.lastIndexOf("/")+1)+p.path:w.path=p.path,w.path=t(w.path)),w.query=p.query):(w.path=h.path,p.query!==void 0?w.query=p.query:w.query=h.query),w.userinfo=h.userinfo,w.host=h.host,w.port=h.port),w.scheme=h.scheme),w.fragment=p.fragment,w}function k(h,p,a){return typeof h=="string"?(h=unescape(h),h=b(n(v(h,a),!0),{...a,skipEscape:!0})):typeof h=="object"&&(h=b(n(h,!0),{...a,skipEscape:!0})),typeof p=="string"?(p=unescape(p),p=b(n(v(p,a),!0),{...a,skipEscape:!0})):typeof p=="object"&&(p=b(n(p,!0),{...a,skipEscape:!0})),h.toLowerCase()===p.toLowerCase()}function b(h,p){const a={host:h.host,scheme:h.scheme,userinfo:h.userinfo,port:h.port,path:h.path,query:h.query,nid:h.nid,nss:h.nss,uuid:h.uuid,fragment:h.fragment,reference:h.reference,resourceName:h.resourceName,secure:h.secure,error:""},i=Object.assign({},p),w=[],g=c(i.scheme||a.scheme);g&&g.serialize&&g.serialize(a,i),a.path!==void 0&&(i.skipEscape?a.path=unescape(a.path):(a.path=escape(a.path),a.scheme!==void 0&&(a.path=a.path.split("%3A").join(":")))),i.reference!=="suffix"&&a.scheme&&w.push(a.scheme,":");const _=r(a);if(_!==void 0&&(i.reference!=="suffix"&&w.push("//"),w.push(_),a.path&&a.path[0]!=="/"&&w.push("/")),a.path!==void 0){let E=a.path;!i.absolutePath&&(!g||!g.absolutePath)&&(E=t(E)),_===void 0&&E[0]==="/"&&E[1]==="/"&&(E="/%2F"+E.slice(2)),w.push(E)}return a.query!==void 0&&w.push("?",a.query),a.fragment!==void 0&&w.push("#",a.fragment),w.join("")}const u=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function v(h,p){const a=Object.assign({},p),i={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let w=!1;a.reference==="suffix"&&(a.scheme?h=a.scheme+":"+h:h="//"+h);const g=h.match(u);if(g){if(i.scheme=g[1],i.userinfo=g[3],i.host=g[4],i.port=parseInt(g[5],10),i.path=g[6]||"",i.query=g[7],i.fragment=g[8],isNaN(i.port)&&(i.port=g[5]),i.host)if(o(i.host)===!1){const E=e(i.host);i.host=E.host.toLowerCase(),w=E.isIPV6}else w=!0;i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path?i.reference="same-document":i.scheme===void 0?i.reference="relative":i.fragment===void 0?i.reference="absolute":i.reference="uri",a.reference&&a.reference!=="suffix"&&a.reference!==i.reference&&(i.error=i.error||"URI is not a "+a.reference+" reference.");const _=c(a.scheme||i.scheme);if(!a.unicodeSupport&&(!_||!_.unicodeSupport)&&i.host&&(a.domainHost||_&&_.domainHost)&&w===!1&&l(i.host))try{i.host=URL.domainToASCII(i.host.toLowerCase())}catch(E){i.error=i.error||"Host's domain name can not be converted to ASCII: "+E}(!_||_&&!_.skipNormalize)&&(h.indexOf("%")!==-1&&(i.scheme!==void 0&&(i.scheme=unescape(i.scheme)),i.host!==void 0&&(i.host=unescape(i.host))),i.path&&(i.path=escape(unescape(i.path))),i.fragment&&(i.fragment=encodeURI(decodeURIComponent(i.fragment)))),_&&_.parse&&_.parse(i,a)}else i.error=i.error||"URI can not be parsed.";return i}const S={SCHEMES:s,normalize:y,resolve:d,resolveComponent:m,equal:k,serialize:b,parse:v};return Qe.exports=S,Qe.exports.default=S,Qe.exports.fastUri=S,Qe.exports}var An;function ts(){if(An)return dt;An=1,Object.defineProperty(dt,"__esModule",{value:!0});const e=es();return e.code='require("ajv/dist/runtime/uri").default',dt.default=e,dt}var Ln;function rs(){return Ln||(Ln=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Ze();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=X();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=sr(),o=ct(),l=yn(),s=ir(),c=X(),y=it(),d=st(),m=re(),k=Ya,b=ts(),u=(D,I)=>new RegExp(D,I);u.code="new RegExp";const v=["removeAdditional","useDefaults","coerceTypes"],S=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),h={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."},p={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},a=200;function i(D){var I,T,x,f,P,O,M,A,H,Y,N,j,R,q,J,te,le,$e,me,ye,ue,Ae,be,Bt,Ht;const Fe=D.strict,Wt=(I=D.code)===null||I===void 0?void 0:I.optimize,gr=Wt===!0||Wt===void 0?1:Wt||0,br=(x=(T=D.code)===null||T===void 0?void 0:T.regExp)!==null&&x!==void 0?x:u,Qo=(f=D.uriResolver)!==null&&f!==void 0?f:b.default;return{strictSchema:(O=(P=D.strictSchema)!==null&&P!==void 0?P:Fe)!==null&&O!==void 0?O:!0,strictNumbers:(A=(M=D.strictNumbers)!==null&&M!==void 0?M:Fe)!==null&&A!==void 0?A:!0,strictTypes:(Y=(H=D.strictTypes)!==null&&H!==void 0?H:Fe)!==null&&Y!==void 0?Y:"log",strictTuples:(j=(N=D.strictTuples)!==null&&N!==void 0?N:Fe)!==null&&j!==void 0?j:"log",strictRequired:(q=(R=D.strictRequired)!==null&&R!==void 0?R:Fe)!==null&&q!==void 0?q:!1,code:D.code?{...D.code,optimize:gr,regExp:br}:{optimize:gr,regExp:br},loopRequired:(J=D.loopRequired)!==null&&J!==void 0?J:a,loopEnum:(te=D.loopEnum)!==null&&te!==void 0?te:a,meta:(le=D.meta)!==null&&le!==void 0?le:!0,messages:($e=D.messages)!==null&&$e!==void 0?$e:!0,inlineRefs:(me=D.inlineRefs)!==null&&me!==void 0?me:!0,schemaId:(ye=D.schemaId)!==null&&ye!==void 0?ye:"$id",addUsedSchema:(ue=D.addUsedSchema)!==null&&ue!==void 0?ue:!0,validateSchema:(Ae=D.validateSchema)!==null&&Ae!==void 0?Ae:!0,validateFormats:(be=D.validateFormats)!==null&&be!==void 0?be:!0,unicodeRegExp:(Bt=D.unicodeRegExp)!==null&&Bt!==void 0?Bt:!0,int32range:(Ht=D.int32range)!==null&&Ht!==void 0?Ht:!0,uriResolver:Qo}}class w{constructor(I={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,I=this.opts={...I,...i(I)};const{es5:T,lines:x}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:S,es5:T,lines:x}),this.logger=F(I.logger);const f=I.validateFormats;I.validateFormats=!1,this.RULES=(0,l.getRules)(),g.call(this,h,I,"NOT SUPPORTED"),g.call(this,p,I,"DEPRECATED","warn"),this._metaOpts=z.call(this),I.formats&&C.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),I.keywords&&L.call(this,I.keywords),typeof I.meta=="object"&&this.addMetaSchema(I.meta),E.call(this),I.validateFormats=f}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:I,meta:T,schemaId:x}=this.opts;let f=k;x==="id"&&(f={...k},f.id=f.$id,delete f.$id),T&&I&&this.addMetaSchema(f,f[x],!1)}defaultMeta(){const{meta:I,schemaId:T}=this.opts;return this.opts.defaultMeta=typeof I=="object"?I[T]||I:void 0}validate(I,T){let x;if(typeof I=="string"){if(x=this.getSchema(I),!x)throw new Error(`no schema with key or ref "${I}"`)}else x=this.compile(I);const f=x(T);return"$async"in x||(this.errors=x.errors),f}compile(I,T){const x=this._addSchema(I,T);return x.validate||this._compileSchemaEnv(x)}compileAsync(I,T){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:x}=this.opts;return f.call(this,I,T);async function f(Y,N){await P.call(this,Y.$schema);const j=this._addSchema(Y,N);return j.validate||O.call(this,j)}async function P(Y){Y&&!this.getSchema(Y)&&await f.call(this,{$ref:Y},!0)}async function O(Y){try{return this._compileSchemaEnv(Y)}catch(N){if(!(N instanceof o.default))throw N;return M.call(this,N),await A.call(this,N.missingSchema),O.call(this,Y)}}function M({missingSchema:Y,missingRef:N}){if(this.refs[Y])throw new Error(`AnySchema ${Y} is loaded but ${N} cannot be resolved`)}async function A(Y){const N=await H.call(this,Y);this.refs[Y]||await P.call(this,N.$schema),this.refs[Y]||this.addSchema(N,Y,T)}async function H(Y){const N=this._loading[Y];if(N)return N;try{return await(this._loading[Y]=x(Y))}finally{delete this._loading[Y]}}}addSchema(I,T,x,f=this.opts.validateSchema){if(Array.isArray(I)){for(const O of I)this.addSchema(O,void 0,x,f);return this}let P;if(typeof I=="object"){const{schemaId:O}=this.opts;if(P=I[O],P!==void 0&&typeof P!="string")throw new Error(`schema ${O} must be string`)}return T=(0,y.normalizeId)(T||P),this._checkUnique(T),this.schemas[T]=this._addSchema(I,x,T,f,!0),this}addMetaSchema(I,T,x=this.opts.validateSchema){return this.addSchema(I,T,!0,x),this}validateSchema(I,T){if(typeof I=="boolean")return!0;let x;if(x=I.$schema,x!==void 0&&typeof x!="string")throw new Error("$schema must be a string");if(x=x||this.opts.defaultMeta||this.defaultMeta(),!x)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const f=this.validate(x,I);if(!f&&T){const P="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(P);else throw new Error(P)}return f}getSchema(I){let T;for(;typeof(T=_.call(this,I))=="string";)I=T;if(T===void 0){const{schemaId:x}=this.opts,f=new s.SchemaEnv({schema:{},schemaId:x});if(T=s.resolveSchema.call(this,f,I),!T)return;this.refs[I]=T}return T.validate||this._compileSchemaEnv(T)}removeSchema(I){if(I instanceof RegExp)return this._removeAllSchemas(this.schemas,I),this._removeAllSchemas(this.refs,I),this;switch(typeof I){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const T=_.call(this,I);return typeof T=="object"&&this._cache.delete(T.schema),delete this.schemas[I],delete this.refs[I],this}case"object":{const T=I;this._cache.delete(T);let x=I[this.opts.schemaId];return x&&(x=(0,y.normalizeId)(x),delete this.schemas[x],delete this.refs[x]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(I){for(const T of I)this.addKeyword(T);return this}addKeyword(I,T){let x;if(typeof I=="string")x=I,typeof T=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),T.keyword=x);else if(typeof I=="object"&&T===void 0){if(T=I,x=T.keyword,Array.isArray(x)&&!x.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(W.call(this,x,T),!T)return(0,m.eachItem)(x,P=>ae.call(this,P)),this;de.call(this,T);const f={...T,type:(0,d.getJSONTypes)(T.type),schemaType:(0,d.getJSONTypes)(T.schemaType)};return(0,m.eachItem)(x,f.type.length===0?P=>ae.call(this,P,f):P=>f.type.forEach(O=>ae.call(this,P,f,O))),this}getKeyword(I){const T=this.RULES.all[I];return typeof T=="object"?T.definition:!!T}removeKeyword(I){const{RULES:T}=this;delete T.keywords[I],delete T.all[I];for(const x of T.rules){const f=x.rules.findIndex(P=>P.keyword===I);f>=0&&x.rules.splice(f,1)}return this}addFormat(I,T){return typeof T=="string"&&(T=new RegExp(T)),this.formats[I]=T,this}errorsText(I=this.errors,{separator:T=", ",dataVar:x="data"}={}){return!I||I.length===0?"No errors":I.map(f=>`${x}${f.instancePath} ${f.message}`).reduce((f,P)=>f+T+P)}$dataMetaSchema(I,T){const x=this.RULES.all;I=JSON.parse(JSON.stringify(I));for(const f of T){const P=f.split("/").slice(1);let O=I;for(const M of P)O=O[M];for(const M in x){const A=x[M];if(typeof A!="object")continue;const{$data:H}=A.definition,Y=O[M];H&&Y&&(O[M]=fe(Y))}}return I}_removeAllSchemas(I,T){for(const x in I){const f=I[x];(!T||T.test(x))&&(typeof f=="string"?delete I[x]:f&&!f.meta&&(this._cache.delete(f.schema),delete I[x]))}}_addSchema(I,T,x,f=this.opts.validateSchema,P=this.opts.addUsedSchema){let O;const{schemaId:M}=this.opts;if(typeof I=="object")O=I[M];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof I!="boolean")throw new Error("schema must be object or boolean")}let A=this._cache.get(I);if(A!==void 0)return A;x=(0,y.normalizeId)(O||x);const H=y.getSchemaRefs.call(this,I,x);return A=new s.SchemaEnv({schema:I,schemaId:M,meta:T,baseId:x,localRefs:H}),this._cache.set(A.schema,A),P&&!x.startsWith("#")&&(x&&this._checkUnique(x),this.refs[x]=A),f&&this.validateSchema(I,!0),A}_checkUnique(I){if(this.schemas[I]||this.refs[I])throw new Error(`schema with key or id "${I}" already exists`)}_compileSchemaEnv(I){if(I.meta?this._compileMetaSchema(I):s.compileSchema.call(this,I),!I.validate)throw new Error("ajv implementation error");return I.validate}_compileMetaSchema(I){const T=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,I)}finally{this.opts=T}}}w.ValidationError=n.default,w.MissingRefError=o.default,e.default=w;function g(D,I,T,x="error"){for(const f in D){const P=f;P in I&&this.logger[x](`${T}: option ${f}. ${D[P]}`)}}function _(D){return D=(0,y.normalizeId)(D),this.schemas[D]||this.refs[D]}function E(){const D=this.opts.schemas;if(D)if(Array.isArray(D))this.addSchema(D);else for(const I in D)this.addSchema(D[I],I)}function C(){for(const D in this.opts.formats){const I=this.opts.formats[D];I&&this.addFormat(D,I)}}function L(D){if(Array.isArray(D)){this.addVocabulary(D);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const I in D){const T=D[I];T.keyword||(T.keyword=I),this.addKeyword(T)}}function z(){const D={...this.opts};for(const I of v)delete D[I];return D}const V={log(){},warn(){},error(){}};function F(D){if(D===!1)return V;if(D===void 0)return console;if(D.log&&D.warn&&D.error)return D;throw new Error("logger must implement log, warn and error methods")}const B=/^[a-z_$][a-z0-9_$:-]*$/i;function W(D,I){const{RULES:T}=this;if((0,m.eachItem)(D,x=>{if(T.keywords[x])throw new Error(`Keyword ${x} is already defined`);if(!B.test(x))throw new Error(`Keyword ${x} has invalid name`)}),!!I&&I.$data&&!("code"in I||"validate"in I))throw new Error('$data keyword must have "code" or "validate" function')}function ae(D,I,T){var x;const f=I?.post;if(T&&f)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:P}=this;let O=f?P.post:P.rules.find(({type:A})=>A===T);if(O||(O={type:T,rules:[]},P.rules.push(O)),P.keywords[D]=!0,!I)return;const M={keyword:D,definition:{...I,type:(0,d.getJSONTypes)(I.type),schemaType:(0,d.getJSONTypes)(I.schemaType)}};I.before?se.call(this,O,M,I.before):O.rules.push(M),P.all[D]=M,(x=I.implements)===null||x===void 0||x.forEach(A=>this.addKeyword(A))}function se(D,I,T){const x=D.rules.findIndex(f=>f.keyword===T);x>=0?D.rules.splice(x,0,I):(D.rules.push(I),this.logger.warn(`rule ${T} is not defined`))}function de(D){let{metaSchema:I}=D;I!==void 0&&(D.$data&&this.opts.$data&&(I=fe(I)),D.validateSchema=this.compile(I,!0))}const ne={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function fe(D){return{anyOf:[D,ne]}}})(tn)),tn}var pt={},ft={},ht={},qn;function ns(){if(qn)return ht;qn=1,Object.defineProperty(ht,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return ht.default=e,ht}var Te={},zn;function os(){if(zn)return Te;zn=1,Object.defineProperty(Te,"__esModule",{value:!0}),Te.callRef=Te.getValidate=void 0;const e=ct(),t=Pe(),r=X(),n=xe(),o=ir(),l=re(),s={keyword:"$ref",schemaType:"string",code(d){const{gen:m,schema:k,it:b}=d,{baseId:u,schemaEnv:v,validateName:S,opts:h,self:p}=b,{root:a}=v;if((k==="#"||k==="#/")&&u===a.baseId)return w();const i=o.resolveRef.call(p,a,u,k);if(i===void 0)throw new e.default(b.opts.uriResolver,u,k);if(i instanceof o.SchemaEnv)return g(i);return _(i);function w(){if(v===a)return y(d,S,v,v.$async);const E=m.scopeValue("root",{ref:a});return y(d,(0,r._)`${E}.validate`,a,a.$async)}function g(E){const C=c(d,E);y(d,C,E,E.$async)}function _(E){const C=m.scopeValue("schema",h.code.source===!0?{ref:E,code:(0,r.stringify)(E)}:{ref:E}),L=m.name("valid"),z=d.subschema({schema:E,dataTypes:[],schemaPath:r.nil,topSchemaRef:C,errSchemaPath:k},L);d.mergeEvaluated(z),d.ok(L)}}};function c(d,m){const{gen:k}=d;return m.validate?k.scopeValue("validate",{ref:m.validate}):(0,r._)`${k.scopeValue("wrapper",{ref:m})}.validate`}Te.getValidate=c;function y(d,m,k,b){const{gen:u,it:v}=d,{allErrors:S,schemaEnv:h,opts:p}=v,a=p.passContext?n.default.this:r.nil;b?i():w();function i(){if(!h.$async)throw new Error("async schema referenced by sync schema");const E=u.let("valid");u.try(()=>{u.code((0,r._)`await ${(0,t.callValidateCode)(d,m,a)}`),_(m),S||u.assign(E,!0)},C=>{u.if((0,r._)`!(${C} instanceof ${v.ValidationError})`,()=>u.throw(C)),g(C),S||u.assign(E,!1)}),d.ok(E)}function w(){d.result((0,t.callValidateCode)(d,m,a),()=>_(m),()=>g(m))}function g(E){const C=(0,r._)`${E}.errors`;u.assign(n.default.vErrors,(0,r._)`${n.default.vErrors} === null ? ${C} : ${n.default.vErrors}.concat(${C})`),u.assign(n.default.errors,(0,r._)`${n.default.vErrors}.length`)}function _(E){var C;if(!v.opts.unevaluated)return;const L=(C=k?.validate)===null||C===void 0?void 0:C.evaluated;if(v.props!==!0)if(L&&!L.dynamicProps)L.props!==void 0&&(v.props=l.mergeEvaluated.props(u,L.props,v.props));else{const z=u.var("props",(0,r._)`${E}.evaluated.props`);v.props=l.mergeEvaluated.props(u,z,v.props,r.Name)}if(v.items!==!0)if(L&&!L.dynamicItems)L.items!==void 0&&(v.items=l.mergeEvaluated.items(u,L.items,v.items));else{const z=u.var("items",(0,r._)`${E}.evaluated.items`);v.items=l.mergeEvaluated.items(u,z,v.items,r.Name)}}}return Te.callRef=y,Te.default=s,Te}var Mn;function as(){if(Mn)return ft;Mn=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=ns(),t=os(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return ft.default=r,ft}var mt={},yt={},Un;function ss(){if(Un)return yt;Un=1,Object.defineProperty(yt,"__esModule",{value:!0});const e=X(),t=e.operators,r={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},n={message:({keyword:l,schemaCode:s})=>(0,e.str)`must be ${r[l].okStr} ${s}`,params:({keyword:l,schemaCode:s})=>(0,e._)`{comparison: ${r[l].okStr}, limit: ${s}}`},o={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:n,code(l){const{keyword:s,data:c,schemaCode:y}=l;l.fail$data((0,e._)`${c} ${r[s].fail} ${y} || isNaN(${c})`)}};return yt.default=o,yt}var vt={},Fn;function is(){if(Fn)return vt;Fn=1,Object.defineProperty(vt,"__esModule",{value:!0});const e=X(),t={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must be multiple of ${r}`,params:({schemaCode:r})=>(0,e._)`{multipleOf: ${r}}`},code(r){const{gen:n,data:o,schemaCode:l,it:s}=r,c=s.opts.multipleOfPrecision,y=n.let("res"),d=c?(0,e._)`Math.abs(Math.round(${y}) - ${y}) > 1e-${c}`:(0,e._)`${y} !== parseInt(${y})`;r.fail$data((0,e._)`(${l} === 0 || (${y} = ${o}/${l}, ${d}))`)}};return vt.default=t,vt}var gt={},bt={},Kn;function ls(){if(Kn)return bt;Kn=1,Object.defineProperty(bt,"__esModule",{value:!0});function e(t){const r=t.length;let n=0,o=0,l;for(;o<r;)n++,l=t.charCodeAt(o++),l>=55296&&l<=56319&&o<r&&(l=t.charCodeAt(o),(l&64512)===56320&&o++);return n}return bt.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',bt}var Bn;function us(){if(Bn)return gt;Bn=1,Object.defineProperty(gt,"__esModule",{value:!0});const e=X(),t=re(),r=ls(),n={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:l}){const s=o==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${l} characters`},params:({schemaCode:o})=>(0,e._)`{limit: ${o}}`},code(o){const{keyword:l,data:s,schemaCode:c,it:y}=o,d=l==="maxLength"?e.operators.GT:e.operators.LT,m=y.opts.unicode===!1?(0,e._)`${s}.length`:(0,e._)`${(0,t.useFunc)(o.gen,r.default)}(${s})`;o.fail$data((0,e._)`${m} ${d} ${c}`)}};return gt.default=n,gt}var $t={},Hn;function cs(){if(Hn)return $t;Hn=1,Object.defineProperty($t,"__esModule",{value:!0});const e=Pe(),t=re(),r=X(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:o})=>(0,r.str)`must match pattern "${o}"`,params:({schemaCode:o})=>(0,r._)`{pattern: ${o}}`},code(o){const{gen:l,data:s,$data:c,schema:y,schemaCode:d,it:m}=o,k=m.opts.unicodeRegExp?"u":"";if(c){const{regExp:b}=m.opts.code,u=b.code==="new RegExp"?(0,r._)`new RegExp`:(0,t.useFunc)(l,b),v=l.let("valid");l.try(()=>l.assign(v,(0,r._)`${u}(${d}, ${k}).test(${s})`),()=>l.assign(v,!1)),o.fail$data((0,r._)`!${v}`)}else{const b=(0,e.usePattern)(o,y);o.fail$data((0,r._)`!${b}.test(${s})`)}}};return $t.default=n,$t}var wt={},Wn;function ds(){if(Wn)return wt;Wn=1,Object.defineProperty(wt,"__esModule",{value:!0});const e=X(),t={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:n}){const o=r==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${n} properties`},params:({schemaCode:r})=>(0,e._)`{limit: ${r}}`},code(r){const{keyword:n,data:o,schemaCode:l}=r,s=n==="maxProperties"?e.operators.GT:e.operators.LT;r.fail$data((0,e._)`Object.keys(${o}).length ${s} ${l}`)}};return wt.default=t,wt}var _t={},Jn;function ps(){if(Jn)return _t;Jn=1,Object.defineProperty(_t,"__esModule",{value:!0});const e=Pe(),t=X(),r=re(),n={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:o}})=>(0,t.str)`must have required property '${o}'`,params:({params:{missingProperty:o}})=>(0,t._)`{missingProperty: ${o}}`},code(o){const{gen:l,schema:s,schemaCode:c,data:y,$data:d,it:m}=o,{opts:k}=m;if(!d&&s.length===0)return;const b=s.length>=k.loopRequired;if(m.allErrors?u():v(),k.strictRequired){const p=o.parentSchema.properties,{definedProperties:a}=o.it;for(const i of s)if(p?.[i]===void 0&&!a.has(i)){const w=m.schemaEnv.baseId+m.errSchemaPath,g=`required property "${i}" is not defined at "${w}" (strictRequired)`;(0,r.checkStrictMode)(m,g,m.opts.strictRequired)}}function u(){if(b||d)o.block$data(t.nil,S);else for(const p of s)(0,e.checkReportMissingProp)(o,p)}function v(){const p=l.let("missing");if(b||d){const a=l.let("valid",!0);o.block$data(a,()=>h(p,a)),o.ok(a)}else l.if((0,e.checkMissingProp)(o,s,p)),(0,e.reportMissingProp)(o,p),l.else()}function S(){l.forOf("prop",c,p=>{o.setParams({missingProperty:p}),l.if((0,e.noPropertyInData)(l,y,p,k.ownProperties),()=>o.error())})}function h(p,a){o.setParams({missingProperty:p}),l.forOf(p,c,()=>{l.assign(a,(0,e.propertyInData)(l,y,p,k.ownProperties)),l.if((0,t.not)(a),()=>{o.error(),l.break()})},t.nil)}}};return _t.default=n,_t}var Pt={},Gn;function fs(){if(Gn)return Pt;Gn=1,Object.defineProperty(Pt,"__esModule",{value:!0});const e=X(),t={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:n}){const o=r==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${n} items`},params:({schemaCode:r})=>(0,e._)`{limit: ${r}}`},code(r){const{keyword:n,data:o,schemaCode:l}=r,s=n==="maxItems"?e.operators.GT:e.operators.LT;r.fail$data((0,e._)`${o}.length ${s} ${l}`)}};return Pt.default=t,Pt}var Et={},St={},Zn;function cr(){if(Zn)return St;Zn=1,Object.defineProperty(St,"__esModule",{value:!0});const e=kn();return e.code='require("ajv/dist/runtime/equal").default',St.default=e,St}var Qn;function hs(){if(Qn)return Et;Qn=1,Object.defineProperty(Et,"__esModule",{value:!0});const e=st(),t=X(),r=re(),n=cr(),o={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:l,j:s}})=>(0,t.str)`must NOT have duplicate items (items ## ${s} and ${l} are identical)`,params:({params:{i:l,j:s}})=>(0,t._)`{i: ${l}, j: ${s}}`},code(l){const{gen:s,data:c,$data:y,schema:d,parentSchema:m,schemaCode:k,it:b}=l;if(!y&&!d)return;const u=s.let("valid"),v=m.items?(0,e.getSchemaTypes)(m.items):[];l.block$data(u,S,(0,t._)`${k} === false`),l.ok(u);function S(){const i=s.let("i",(0,t._)`${c}.length`),w=s.let("j");l.setParams({i,j:w}),s.assign(u,!0),s.if((0,t._)`${i} > 1`,()=>(h()?p:a)(i,w))}function h(){return v.length>0&&!v.some(i=>i==="object"||i==="array")}function p(i,w){const g=s.name("item"),_=(0,e.checkDataTypes)(v,g,b.opts.strictNumbers,e.DataType.Wrong),E=s.const("indices",(0,t._)`{}`);s.for((0,t._)`;${i}--;`,()=>{s.let(g,(0,t._)`${c}[${i}]`),s.if(_,(0,t._)`continue`),v.length>1&&s.if((0,t._)`typeof ${g} == "string"`,(0,t._)`${g} += "_"`),s.if((0,t._)`typeof ${E}[${g}] == "number"`,()=>{s.assign(w,(0,t._)`${E}[${g}]`),l.error(),s.assign(u,!1).break()}).code((0,t._)`${E}[${g}] = ${i}`)})}function a(i,w){const g=(0,r.useFunc)(s,n.default),_=s.name("outer");s.label(_).for((0,t._)`;${i}--;`,()=>s.for((0,t._)`${w} = ${i}; ${w}--;`,()=>s.if((0,t._)`${g}(${c}[${i}], ${c}[${w}])`,()=>{l.error(),s.assign(u,!1).break(_)})))}}};return Et.default=o,Et}var kt={},Yn;function ms(){if(Yn)return kt;Yn=1,Object.defineProperty(kt,"__esModule",{value:!0});const e=X(),t=re(),r=cr(),n={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:o})=>(0,e._)`{allowedValue: ${o}}`},code(o){const{gen:l,data:s,$data:c,schemaCode:y,schema:d}=o;c||d&&typeof d=="object"?o.fail$data((0,e._)`!${(0,t.useFunc)(l,r.default)}(${s}, ${y})`):o.fail((0,e._)`${d} !== ${s}`)}};return kt.default=n,kt}var xt={},Xn;function ys(){if(Xn)return xt;Xn=1,Object.defineProperty(xt,"__esModule",{value:!0});const e=X(),t=re(),r=cr(),n={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:o})=>(0,e._)`{allowedValues: ${o}}`},code(o){const{gen:l,data:s,$data:c,schema:y,schemaCode:d,it:m}=o;if(!c&&y.length===0)throw new Error("enum must have non-empty array");const k=y.length>=m.opts.loopEnum;let b;const u=()=>b??(b=(0,t.useFunc)(l,r.default));let v;if(k||c)v=l.let("valid"),o.block$data(v,S);else{if(!Array.isArray(y))throw new Error("ajv implementation error");const p=l.const("vSchema",d);v=(0,e.or)(...y.map((a,i)=>h(p,i)))}o.pass(v);function S(){l.assign(v,!1),l.forOf("v",d,p=>l.if((0,e._)`${u()}(${s}, ${p})`,()=>l.assign(v,!0).break()))}function h(p,a){const i=y[a];return typeof i=="object"&&i!==null?(0,e._)`${u()}(${s}, ${p}[${a}])`:(0,e._)`${s} === ${i}`}}};return xt.default=n,xt}var eo;function vs(){if(eo)return mt;eo=1,Object.defineProperty(mt,"__esModule",{value:!0});const e=ss(),t=is(),r=us(),n=cs(),o=ds(),l=ps(),s=fs(),c=hs(),y=ms(),d=ys(),m=[e.default,t.default,r.default,n.default,o.default,l.default,s.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},y.default,d.default];return mt.default=m,mt}var Nt={},ze={},to;function ro(){if(to)return ze;to=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.validateAdditionalItems=void 0;const e=X(),t=re(),r={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,e.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,e._)`{limit: ${o}}`},code(o){const{parentSchema:l,it:s}=o,{items:c}=l;if(!Array.isArray(c)){(0,t.checkStrictMode)(s,'"additionalItems" is ignored when "items" is not an array of schemas');return}n(o,c)}};function n(o,l){const{gen:s,schema:c,data:y,keyword:d,it:m}=o;m.items=!0;const k=s.const("len",(0,e._)`${y}.length`);if(c===!1)o.setParams({len:l.length}),o.pass((0,e._)`${k} <= ${l.length}`);else if(typeof c=="object"&&!(0,t.alwaysValidSchema)(m,c)){const u=s.var("valid",(0,e._)`${k} <= ${l.length}`);s.if((0,e.not)(u),()=>b(u)),o.ok(u)}function b(u){s.forRange("i",l.length,k,v=>{o.subschema({keyword:d,dataProp:v,dataPropType:t.Type.Num},u),m.allErrors||s.if((0,e.not)(u),()=>s.break())})}}return ze.validateAdditionalItems=n,ze.default=r,ze}var jt={},Me={},no;function oo(){if(no)return Me;no=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.validateTuple=void 0;const e=X(),t=re(),r=Pe(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(l){const{schema:s,it:c}=l;if(Array.isArray(s))return o(l,"additionalItems",s);c.items=!0,!(0,t.alwaysValidSchema)(c,s)&&l.ok((0,r.validateArray)(l))}};function o(l,s,c=l.schema){const{gen:y,parentSchema:d,data:m,keyword:k,it:b}=l;S(d),b.opts.unevaluated&&c.length&&b.items!==!0&&(b.items=t.mergeEvaluated.items(y,c.length,b.items));const u=y.name("valid"),v=y.const("len",(0,e._)`${m}.length`);c.forEach((h,p)=>{(0,t.alwaysValidSchema)(b,h)||(y.if((0,e._)`${v} > ${p}`,()=>l.subschema({keyword:k,schemaProp:p,dataProp:p},u)),l.ok(u))});function S(h){const{opts:p,errSchemaPath:a}=b,i=c.length,w=i===h.minItems&&(i===h.maxItems||h[s]===!1);if(p.strictTuples&&!w){const g=`"${k}" is ${i}-tuple, but minItems or maxItems/${s} are not specified or different at path "${a}"`;(0,t.checkStrictMode)(b,g,p.strictTuples)}}}return Me.validateTuple=o,Me.default=n,Me}var ao;function gs(){if(ao)return jt;ao=1,Object.defineProperty(jt,"__esModule",{value:!0});const e=oo(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return jt.default=t,jt}var It={},so;function bs(){if(so)return It;so=1,Object.defineProperty(It,"__esModule",{value:!0});const e=X(),t=re(),r=Pe(),n=ro(),o={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:l}})=>(0,e.str)`must NOT have more than ${l} items`,params:({params:{len:l}})=>(0,e._)`{limit: ${l}}`},code(l){const{schema:s,parentSchema:c,it:y}=l,{prefixItems:d}=c;y.items=!0,!(0,t.alwaysValidSchema)(y,s)&&(d?(0,n.validateAdditionalItems)(l,d):l.ok((0,r.validateArray)(l)))}};return It.default=o,It}var Tt={},io;function $s(){if(io)return Tt;io=1,Object.defineProperty(Tt,"__esModule",{value:!0});const e=X(),t=re(),r={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:n,max:o}})=>o===void 0?(0,e.str)`must contain at least ${n} valid item(s)`:(0,e.str)`must contain at least ${n} and no more than ${o} valid item(s)`,params:({params:{min:n,max:o}})=>o===void 0?(0,e._)`{minContains: ${n}}`:(0,e._)`{minContains: ${n}, maxContains: ${o}}`},code(n){const{gen:o,schema:l,parentSchema:s,data:c,it:y}=n;let d,m;const{minContains:k,maxContains:b}=s;y.opts.next?(d=k===void 0?1:k,m=b):d=1;const u=o.const("len",(0,e._)`${c}.length`);if(n.setParams({min:d,max:m}),m===void 0&&d===0){(0,t.checkStrictMode)(y,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(m!==void 0&&d>m){(0,t.checkStrictMode)(y,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,t.alwaysValidSchema)(y,l)){let a=(0,e._)`${u} >= ${d}`;m!==void 0&&(a=(0,e._)`${a} && ${u} <= ${m}`),n.pass(a);return}y.items=!0;const v=o.name("valid");m===void 0&&d===1?h(v,()=>o.if(v,()=>o.break())):d===0?(o.let(v,!0),m!==void 0&&o.if((0,e._)`${c}.length > 0`,S)):(o.let(v,!1),S()),n.result(v,()=>n.reset());function S(){const a=o.name("_valid"),i=o.let("count",0);h(a,()=>o.if(a,()=>p(i)))}function h(a,i){o.forRange("i",0,u,w=>{n.subschema({keyword:"contains",dataProp:w,dataPropType:t.Type.Num,compositeRule:!0},a),i()})}function p(a){o.code((0,e._)`${a}++`),m===void 0?o.if((0,e._)`${a} >= ${d}`,()=>o.assign(v,!0).break()):(o.if((0,e._)`${a} > ${m}`,()=>o.assign(v,!1).break()),d===1?o.assign(v,!0):o.if((0,e._)`${a} >= ${d}`,()=>o.assign(v,!0)))}}};return Tt.default=r,Tt}var lo={},uo;function ws(){return uo||(uo=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=X(),r=re(),n=Pe();e.error={message:({params:{property:y,depsCount:d,deps:m}})=>{const k=d===1?"property":"properties";return(0,t.str)`must have ${k} ${m} when property ${y} is present`},params:({params:{property:y,depsCount:d,deps:m,missingProperty:k}})=>(0,t._)`{property: ${y},
7
+ missingProperty: ${k},
8
+ depsCount: ${d},
9
+ deps: ${m}}`};const o={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(y){const[d,m]=l(y);s(y,d),c(y,m)}};function l({schema:y}){const d={},m={};for(const k in y){if(k==="__proto__")continue;const b=Array.isArray(y[k])?d:m;b[k]=y[k]}return[d,m]}function s(y,d=y.schema){const{gen:m,data:k,it:b}=y;if(Object.keys(d).length===0)return;const u=m.let("missing");for(const v in d){const S=d[v];if(S.length===0)continue;const h=(0,n.propertyInData)(m,k,v,b.opts.ownProperties);y.setParams({property:v,depsCount:S.length,deps:S.join(", ")}),b.allErrors?m.if(h,()=>{for(const p of S)(0,n.checkReportMissingProp)(y,p)}):(m.if((0,t._)`${h} && (${(0,n.checkMissingProp)(y,S,u)})`),(0,n.reportMissingProp)(y,u),m.else())}}e.validatePropertyDeps=s;function c(y,d=y.schema){const{gen:m,data:k,keyword:b,it:u}=y,v=m.name("valid");for(const S in d)(0,r.alwaysValidSchema)(u,d[S])||(m.if((0,n.propertyInData)(m,k,S,u.opts.ownProperties),()=>{const h=y.subschema({keyword:b,schemaProp:S},v);y.mergeValidEvaluated(h,v)},()=>m.var(v,!0)),y.ok(v))}e.validateSchemaDeps=c,e.default=o})(lo)),lo}var Ot={},co;function _s(){if(co)return Ot;co=1,Object.defineProperty(Ot,"__esModule",{value:!0});const e=X(),t=re(),r={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:n})=>(0,e._)`{propertyName: ${n.propertyName}}`},code(n){const{gen:o,schema:l,data:s,it:c}=n;if((0,t.alwaysValidSchema)(c,l))return;const y=o.name("valid");o.forIn("key",s,d=>{n.setParams({propertyName:d}),n.subschema({keyword:"propertyNames",data:d,dataTypes:["string"],propertyName:d,compositeRule:!0},y),o.if((0,e.not)(y),()=>{n.error(!0),c.allErrors||o.break()})}),n.ok(y)}};return Ot.default=r,Ot}var Ct={},po;function fo(){if(po)return Ct;po=1,Object.defineProperty(Ct,"__esModule",{value:!0});const e=Pe(),t=X(),r=xe(),n=re(),o={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:l})=>(0,t._)`{additionalProperty: ${l.additionalProperty}}`},code(l){const{gen:s,schema:c,parentSchema:y,data:d,errsCount:m,it:k}=l;if(!m)throw new Error("ajv implementation error");const{allErrors:b,opts:u}=k;if(k.props=!0,u.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(k,c))return;const v=(0,e.allSchemaProperties)(y.properties),S=(0,e.allSchemaProperties)(y.patternProperties);h(),l.ok((0,t._)`${m} === ${r.default.errors}`);function h(){s.forIn("key",d,g=>{!v.length&&!S.length?i(g):s.if(p(g),()=>i(g))})}function p(g){let _;if(v.length>8){const E=(0,n.schemaRefOrVal)(k,y.properties,"properties");_=(0,e.isOwnProperty)(s,E,g)}else v.length?_=(0,t.or)(...v.map(E=>(0,t._)`${g} === ${E}`)):_=t.nil;return S.length&&(_=(0,t.or)(_,...S.map(E=>(0,t._)`${(0,e.usePattern)(l,E)}.test(${g})`))),(0,t.not)(_)}function a(g){s.code((0,t._)`delete ${d}[${g}]`)}function i(g){if(u.removeAdditional==="all"||u.removeAdditional&&c===!1){a(g);return}if(c===!1){l.setParams({additionalProperty:g}),l.error(),b||s.break();return}if(typeof c=="object"&&!(0,n.alwaysValidSchema)(k,c)){const _=s.name("valid");u.removeAdditional==="failing"?(w(g,_,!1),s.if((0,t.not)(_),()=>{l.reset(),a(g)})):(w(g,_),b||s.if((0,t.not)(_),()=>s.break()))}}function w(g,_,E){const C={keyword:"additionalProperties",dataProp:g,dataPropType:n.Type.Str};E===!1&&Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1}),l.subschema(C,_)}}};return Ct.default=o,Ct}var Rt={},ho;function Ps(){if(ho)return Rt;ho=1,Object.defineProperty(Rt,"__esModule",{value:!0});const e=Ze(),t=Pe(),r=re(),n=fo(),o={keyword:"properties",type:"object",schemaType:"object",code(l){const{gen:s,schema:c,parentSchema:y,data:d,it:m}=l;m.opts.removeAdditional==="all"&&y.additionalProperties===void 0&&n.default.code(new e.KeywordCxt(m,n.default,"additionalProperties"));const k=(0,t.allSchemaProperties)(c);for(const h of k)m.definedProperties.add(h);m.opts.unevaluated&&k.length&&m.props!==!0&&(m.props=r.mergeEvaluated.props(s,(0,r.toHash)(k),m.props));const b=k.filter(h=>!(0,r.alwaysValidSchema)(m,c[h]));if(b.length===0)return;const u=s.name("valid");for(const h of b)v(h)?S(h):(s.if((0,t.propertyInData)(s,d,h,m.opts.ownProperties)),S(h),m.allErrors||s.else().var(u,!0),s.endIf()),l.it.definedProperties.add(h),l.ok(u);function v(h){return m.opts.useDefaults&&!m.compositeRule&&c[h].default!==void 0}function S(h){l.subschema({keyword:"properties",schemaProp:h,dataProp:h},u)}}};return Rt.default=o,Rt}var Vt={},mo;function Es(){if(mo)return Vt;mo=1,Object.defineProperty(Vt,"__esModule",{value:!0});const e=Pe(),t=X(),r=re(),n=re(),o={keyword:"patternProperties",type:"object",schemaType:"object",code(l){const{gen:s,schema:c,data:y,parentSchema:d,it:m}=l,{opts:k}=m,b=(0,e.allSchemaProperties)(c),u=b.filter(w=>(0,r.alwaysValidSchema)(m,c[w]));if(b.length===0||u.length===b.length&&(!m.opts.unevaluated||m.props===!0))return;const v=k.strictSchema&&!k.allowMatchingProperties&&d.properties,S=s.name("valid");m.props!==!0&&!(m.props instanceof t.Name)&&(m.props=(0,n.evaluatedPropsToName)(s,m.props));const{props:h}=m;p();function p(){for(const w of b)v&&a(w),m.allErrors?i(w):(s.var(S,!0),i(w),s.if(S))}function a(w){for(const g in v)new RegExp(w).test(g)&&(0,r.checkStrictMode)(m,`property ${g} matches pattern ${w} (use allowMatchingProperties)`)}function i(w){s.forIn("key",y,g=>{s.if((0,t._)`${(0,e.usePattern)(l,w)}.test(${g})`,()=>{const _=u.includes(w);_||l.subschema({keyword:"patternProperties",schemaProp:w,dataProp:g,dataPropType:n.Type.Str},S),m.opts.unevaluated&&h!==!0?s.assign((0,t._)`${h}[${g}]`,!0):!_&&!m.allErrors&&s.if((0,t.not)(S),()=>s.break())})})}}};return Vt.default=o,Vt}var Dt={},yo;function Ss(){if(yo)return Dt;yo=1,Object.defineProperty(Dt,"__esModule",{value:!0});const e=re(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:n,schema:o,it:l}=r;if((0,e.alwaysValidSchema)(l,o)){r.fail();return}const s=n.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),r.failResult(s,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return Dt.default=t,Dt}var At={},vo;function ks(){if(vo)return At;vo=1,Object.defineProperty(At,"__esModule",{value:!0});const e={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Pe().validateUnion,error:{message:"must match a schema in anyOf"}};return At.default=e,At}var Lt={},go;function xs(){if(go)return Lt;go=1,Object.defineProperty(Lt,"__esModule",{value:!0});const e=X(),t=re(),r={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:n})=>(0,e._)`{passingSchemas: ${n.passing}}`},code(n){const{gen:o,schema:l,parentSchema:s,it:c}=n;if(!Array.isArray(l))throw new Error("ajv implementation error");if(c.opts.discriminator&&s.discriminator)return;const y=l,d=o.let("valid",!1),m=o.let("passing",null),k=o.name("_valid");n.setParams({passing:m}),o.block(b),n.result(d,()=>n.reset(),()=>n.error(!0));function b(){y.forEach((u,v)=>{let S;(0,t.alwaysValidSchema)(c,u)?o.var(k,!0):S=n.subschema({keyword:"oneOf",schemaProp:v,compositeRule:!0},k),v>0&&o.if((0,e._)`${k} && ${d}`).assign(d,!1).assign(m,(0,e._)`[${m}, ${v}]`).else(),o.if(k,()=>{o.assign(d,!0),o.assign(m,v),S&&n.mergeEvaluated(S,e.Name)})})}}};return Lt.default=r,Lt}var qt={},bo;function Ns(){if(bo)return qt;bo=1,Object.defineProperty(qt,"__esModule",{value:!0});const e=re(),t={keyword:"allOf",schemaType:"array",code(r){const{gen:n,schema:o,it:l}=r;if(!Array.isArray(o))throw new Error("ajv implementation error");const s=n.name("valid");o.forEach((c,y)=>{if((0,e.alwaysValidSchema)(l,c))return;const d=r.subschema({keyword:"allOf",schemaProp:y},s);r.ok(s),r.mergeEvaluated(d)})}};return qt.default=t,qt}var zt={},$o;function js(){if($o)return zt;$o=1,Object.defineProperty(zt,"__esModule",{value:!0});const e=X(),t=re(),r={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:o})=>(0,e.str)`must match "${o.ifClause}" schema`,params:({params:o})=>(0,e._)`{failingKeyword: ${o.ifClause}}`},code(o){const{gen:l,parentSchema:s,it:c}=o;s.then===void 0&&s.else===void 0&&(0,t.checkStrictMode)(c,'"if" without "then" and "else" is ignored');const y=n(c,"then"),d=n(c,"else");if(!y&&!d)return;const m=l.let("valid",!0),k=l.name("_valid");if(b(),o.reset(),y&&d){const v=l.let("ifClause");o.setParams({ifClause:v}),l.if(k,u("then",v),u("else",v))}else y?l.if(k,u("then")):l.if((0,e.not)(k),u("else"));o.pass(m,()=>o.error(!0));function b(){const v=o.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},k);o.mergeEvaluated(v)}function u(v,S){return()=>{const h=o.subschema({keyword:v},k);l.assign(m,k),o.mergeValidEvaluated(h,m),S?l.assign(S,(0,e._)`${v}`):o.setParams({ifClause:v})}}}};function n(o,l){const s=o.schema[l];return s!==void 0&&!(0,t.alwaysValidSchema)(o,s)}return zt.default=r,zt}var Mt={},wo;function Is(){if(wo)return Mt;wo=1,Object.defineProperty(Mt,"__esModule",{value:!0});const e=re(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:o}){n.if===void 0&&(0,e.checkStrictMode)(o,`"${r}" without "if" is ignored`)}};return Mt.default=t,Mt}var _o;function Ts(){if(_o)return Nt;_o=1,Object.defineProperty(Nt,"__esModule",{value:!0});const e=ro(),t=gs(),r=oo(),n=bs(),o=$s(),l=ws(),s=_s(),c=fo(),y=Ps(),d=Es(),m=Ss(),k=ks(),b=xs(),u=Ns(),v=js(),S=Is();function h(p=!1){const a=[m.default,k.default,b.default,u.default,v.default,S.default,s.default,c.default,l.default,y.default,d.default];return p?a.push(t.default,n.default):a.push(e.default,r.default),a.push(o.default),a}return Nt.default=h,Nt}var Ut={},Ft={},Po;function Os(){if(Po)return Ft;Po=1,Object.defineProperty(Ft,"__esModule",{value:!0});const e=X(),t={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,e._)`{format: ${r}}`},code(r,n){const{gen:o,data:l,$data:s,schema:c,schemaCode:y,it:d}=r,{opts:m,errSchemaPath:k,schemaEnv:b,self:u}=d;if(!m.validateFormats)return;s?v():S();function v(){const h=o.scopeValue("formats",{ref:u.formats,code:m.code.formats}),p=o.const("fDef",(0,e._)`${h}[${y}]`),a=o.let("fType"),i=o.let("format");o.if((0,e._)`typeof ${p} == "object" && !(${p} instanceof RegExp)`,()=>o.assign(a,(0,e._)`${p}.type || "string"`).assign(i,(0,e._)`${p}.validate`),()=>o.assign(a,(0,e._)`"string"`).assign(i,p)),r.fail$data((0,e.or)(w(),g()));function w(){return m.strictSchema===!1?e.nil:(0,e._)`${y} && !${i}`}function g(){const _=b.$async?(0,e._)`(${p}.async ? await ${i}(${l}) : ${i}(${l}))`:(0,e._)`${i}(${l})`,E=(0,e._)`(typeof ${i} == "function" ? ${_} : ${i}.test(${l}))`;return(0,e._)`${i} && ${i} !== true && ${a} === ${n} && !${E}`}}function S(){const h=u.formats[c];if(!h){w();return}if(h===!0)return;const[p,a,i]=g(h);p===n&&r.pass(_());function w(){if(m.strictSchema===!1){u.logger.warn(E());return}throw new Error(E());function E(){return`unknown format "${c}" ignored in schema at path "${k}"`}}function g(E){const C=E instanceof RegExp?(0,e.regexpCode)(E):m.code.formats?(0,e._)`${m.code.formats}${(0,e.getProperty)(c)}`:void 0,L=o.scopeValue("formats",{key:c,ref:E,code:C});return typeof E=="object"&&!(E instanceof RegExp)?[E.type||"string",E.validate,(0,e._)`${L}.validate`]:["string",E,L]}function _(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!b.$async)throw new Error("async format in sync schema");return(0,e._)`await ${i}(${l})`}return typeof a=="function"?(0,e._)`${i}(${l})`:(0,e._)`${i}.test(${l})`}}}};return Ft.default=t,Ft}var Eo;function Cs(){if(Eo)return Ut;Eo=1,Object.defineProperty(Ut,"__esModule",{value:!0});const e=[Os().default];return Ut.default=e,Ut}var Ue={},So;function Rs(){return So||(So=1,Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.contentVocabulary=Ue.metadataVocabulary=void 0,Ue.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Ue.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Ue}var ko;function Vs(){if(ko)return pt;ko=1,Object.defineProperty(pt,"__esModule",{value:!0});const e=as(),t=vs(),r=Ts(),n=Cs(),o=Rs(),l=[e.default,t.default,(0,r.default)(),n.default,o.metadataVocabulary,o.contentVocabulary];return pt.default=l,pt}var Kt={},Ye={},xo;function Ds(){if(xo)return Ye;xo=1,Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(Ye.DiscrError=e={})),Ye}var No;function As(){if(No)return Kt;No=1,Object.defineProperty(Kt,"__esModule",{value:!0});const e=X(),t=Ds(),r=ir(),n=ct(),o=re(),l={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:s,tagName:c}})=>s===t.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:s,tag:c,tagName:y}})=>(0,e._)`{error: ${s}, tag: ${y}, tagValue: ${c}}`},code(s){const{gen:c,data:y,schema:d,parentSchema:m,it:k}=s,{oneOf:b}=m;if(!k.opts.discriminator)throw new Error("discriminator: requires discriminator option");const u=d.propertyName;if(typeof u!="string")throw new Error("discriminator: requires propertyName");if(d.mapping)throw new Error("discriminator: mapping is not supported");if(!b)throw new Error("discriminator: requires oneOf keyword");const v=c.let("valid",!1),S=c.const("tag",(0,e._)`${y}${(0,e.getProperty)(u)}`);c.if((0,e._)`typeof ${S} == "string"`,()=>h(),()=>s.error(!1,{discrError:t.DiscrError.Tag,tag:S,tagName:u})),s.ok(v);function h(){const i=a();c.if(!1);for(const w in i)c.elseIf((0,e._)`${S} === ${w}`),c.assign(v,p(i[w]));c.else(),s.error(!1,{discrError:t.DiscrError.Mapping,tag:S,tagName:u}),c.endIf()}function p(i){const w=c.name("valid"),g=s.subschema({keyword:"oneOf",schemaProp:i},w);return s.mergeEvaluated(g,e.Name),w}function a(){var i;const w={},g=E(m);let _=!0;for(let z=0;z<b.length;z++){let V=b[z];if(V!=null&&V.$ref&&!(0,o.schemaHasRulesButRef)(V,k.self.RULES)){const B=V.$ref;if(V=r.resolveRef.call(k.self,k.schemaEnv.root,k.baseId,B),V instanceof r.SchemaEnv&&(V=V.schema),V===void 0)throw new n.default(k.opts.uriResolver,k.baseId,B)}const F=(i=V?.properties)===null||i===void 0?void 0:i[u];if(typeof F!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${u}"`);_=_&&(g||E(V)),C(F,z)}if(!_)throw new Error(`discriminator: "${u}" must be required`);return w;function E({required:z}){return Array.isArray(z)&&z.includes(u)}function C(z,V){if(z.const)L(z.const,V);else if(z.enum)for(const F of z.enum)L(F,V);else throw new Error(`discriminator: "properties/${u}" must have "const" or "enum"`)}function L(z,V){if(typeof z!="string"||z in w)throw new Error(`discriminator: "${u}" values must be unique strings`);w[z]=V}}}};return Kt.default=l,Kt}const Ls="http://json-schema.org/draft-07/schema#",qs="http://json-schema.org/draft-07/schema#",zs="Core schema meta-schema",Ms={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:[]}},Us=["object","boolean"],Fs={$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:"#"}},Ks={$schema:Ls,$id:qs,title:zs,definitions:Ms,type:Us,properties:Fs,default:!0};var jo;function dr(){return jo||(jo=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const r=rs(),n=Vs(),o=As(),l=Ks,s=["/properties"],c="http://json-schema.org/draft-07/schema";class y extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(v=>this.addVocabulary(v)),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const v=this.opts.$data?this.$dataMetaSchema(l,s):l;this.addMetaSchema(v,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}}t.Ajv=y,e.exports=t=y,e.exports.Ajv=y,Object.defineProperty(t,"__esModule",{value:!0}),t.default=y;var d=Ze();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return d.KeywordCxt}});var m=X();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return m._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return m.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return m.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return m.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return m.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return m.CodeGen}});var k=sr();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return k.default}});var b=ct();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return b.default}})})(or,or.exports)),or.exports}var Bs=dr();const Hs=nt(Bs);var pr={exports:{}},Io={},To;function Ws(){return To||(To=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(V,F){return{validate:V,compare:F}}e.fullFormats={date:t(l,s),time:t(y(!0),d),"date-time":t(b(!0),u),"iso-time":t(y(),m),"iso-date-time":t(b(),v),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:p,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:z,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:i,int32:{type:"number",validate:_},int64:{type:"number",validate:E},float:{type:"number",validate:C},double:{type:"number",validate:C},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,s),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,d),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,m),"iso-date-time":t(/^\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,v),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},e.formatNames=Object.keys(e.fullFormats);function r(V){return V%4===0&&(V%100!==0||V%400===0)}const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function l(V){const F=n.exec(V);if(!F)return!1;const B=+F[1],W=+F[2],ae=+F[3];return W>=1&&W<=12&&ae>=1&&ae<=(W===2&&r(B)?29:o[W])}function s(V,F){if(V&&F)return V>F?1:V<F?-1:0}const c=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function y(V){return function(F){const B=c.exec(F);if(!B)return!1;const W=+B[1],ae=+B[2],se=+B[3],de=B[4],ne=B[5]==="-"?-1:1,fe=+(B[6]||0),D=+(B[7]||0);if(fe>23||D>59||V&&!de)return!1;if(W<=23&&ae<=59&&se<60)return!0;const I=ae-D*ne,T=W-fe*ne-(I<0?1:0);return(T===23||T===-1)&&(I===59||I===-1)&&se<61}}function d(V,F){if(!(V&&F))return;const B=new Date("2020-01-01T"+V).valueOf(),W=new Date("2020-01-01T"+F).valueOf();if(B&&W)return B-W}function m(V,F){if(!(V&&F))return;const B=c.exec(V),W=c.exec(F);if(B&&W)return V=B[1]+B[2]+B[3],F=W[1]+W[2]+W[3],V>F?1:V<F?-1:0}const k=/t|\s/i;function b(V){const F=y(V);return function(B){const W=B.split(k);return W.length===2&&l(W[0])&&F(W[1])}}function u(V,F){if(!(V&&F))return;const B=new Date(V).valueOf(),W=new Date(F).valueOf();if(B&&W)return B-W}function v(V,F){if(!(V&&F))return;const[B,W]=V.split(k),[ae,se]=F.split(k),de=s(B,ae);if(de!==void 0)return de||d(W,se)}const S=/\/|:/,h=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function p(V){return S.test(V)&&h.test(V)}const a=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function i(V){return a.lastIndex=0,a.test(V)}const w=-2147483648,g=2**31-1;function _(V){return Number.isInteger(V)&&V<=g&&V>=w}function E(V){return Number.isInteger(V)}function C(){return!0}const L=/[^\\]\\Z/;function z(V){if(L.test(V))return!1;try{return new RegExp(V),!0}catch{return!1}}})(Io)),Io}var Oo={},Co;function Js(){return Co||(Co=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=dr(),r=X(),n=r.operators,o={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},l={message:({keyword:c,schemaCode:y})=>(0,r.str)`should be ${o[c].okStr} ${y}`,params:({keyword:c,schemaCode:y})=>(0,r._)`{comparison: ${o[c].okStr}, limit: ${y}}`};e.formatLimitDefinition={keyword:Object.keys(o),type:"string",schemaType:"string",$data:!0,error:l,code(c){const{gen:y,data:d,schemaCode:m,keyword:k,it:b}=c,{opts:u,self:v}=b;if(!u.validateFormats)return;const S=new t.KeywordCxt(b,v.RULES.all.format.definition,"format");S.$data?h():p();function h(){const i=y.scopeValue("formats",{ref:v.formats,code:u.code.formats}),w=y.const("fmt",(0,r._)`${i}[${S.schemaCode}]`);c.fail$data((0,r.or)((0,r._)`typeof ${w} != "object"`,(0,r._)`${w} instanceof RegExp`,(0,r._)`typeof ${w}.compare != "function"`,a(w)))}function p(){const i=S.schema,w=v.formats[i];if(!w||w===!0)return;if(typeof w!="object"||w instanceof RegExp||typeof w.compare!="function")throw new Error(`"${k}": format "${i}" does not define "compare" function`);const g=y.scopeValue("formats",{key:i,ref:w,code:u.code.formats?(0,r._)`${u.code.formats}${(0,r.getProperty)(i)}`:void 0});c.fail$data(a(g))}function a(i){return(0,r._)`${i}.compare(${d}, ${m}) ${o[k].fail} 0`}},dependencies:["format"]};const s=c=>(c.addKeyword(e.formatLimitDefinition),c);e.default=s})(Oo)),Oo}var Ro;function Gs(){return Ro||(Ro=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=Ws(),n=Js(),o=X(),l=new o.Name("fullFormats"),s=new o.Name("fastFormats"),c=(d,m={keywords:!0})=>{if(Array.isArray(m))return y(d,m,r.fullFormats,l),d;const[k,b]=m.mode==="fast"?[r.fastFormats,s]:[r.fullFormats,l],u=m.formats||r.formatNames;return y(d,u,k,b),m.keywords&&(0,n.default)(d),d};c.get=(d,m="full")=>{const k=(m==="fast"?r.fastFormats:r.fullFormats)[d];if(!k)throw new Error(`Unknown format "${d}"`);return k};function y(d,m,k,b){var u,v;(u=(v=d.opts.code).formats)!==null&&u!==void 0||(v.formats=(0,o._)`require("ajv-formats/dist/formats").${b}`);for(const S of m)d.addFormat(S,k[S])}e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c})(pr,pr.exports)),pr.exports}var Zs=Gs();const Qs=nt(Zs);var fr={exports:{}},Vo;function Ys(){return Vo||(Vo=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=dr(),n=X(),o=We(),l=Ze(),s=Je(),c=xe(),y="errorMessage",d=new r.Name("emUsed"),m={required:"missingProperty",dependencies:"property",dependentRequired:"property"},k=/\$\{[^}]+\}/,b=/\$\{([^}]+)\}/g,u=/^""\s*\+\s*|\s*\+\s*""$/g;function v(h){return{keyword:y,schemaType:["string","object"],post:!0,code(p){const{gen:a,data:i,schema:w,schemaValue:g,it:_}=p;if(_.createErrors===!1)return;const E=w,C=n.strConcat(c.default.instancePath,_.errorPath);a.if(r._`${c.default.errors} > 0`,()=>{if(typeof E=="object"){const[x,f]=z(E);f&&V(f),x&&F(x),B(L(E))}const T=typeof E=="string"?E:E._;T&&W(T),h.keepErrors||ae()});function L({properties:T,items:x}){const f={};if(T){f.props={};for(const P in T)f.props[P]=[]}if(x){f.items={};for(let P=0;P<x.length;P++)f.items[P]=[]}return f}function z(T){let x,f;for(const P in T){if(P==="properties"||P==="items")continue;const O=T[P];if(typeof O=="object"){x||(x={});const M=x[P]={};for(const A in O)M[A]=[]}else f||(f={}),f[P]=[]}return[x,f]}function V(T){const x=a.const("emErrors",r.stringify(T)),f=a.const("templates",fe(T,w));a.forOf("err",c.default.vErrors,A=>a.if(se(A,x),()=>a.code(r._`${x}[${A}.keyword].push(${A})`).assign(r._`${A}.${d}`,!0)));const{singleError:P}=h;if(P){const A=a.let("message",r._`""`),H=a.let("paramsErrors",r._`[]`);O(Y=>{a.if(A,()=>a.code(r._`${A} += ${typeof P=="string"?P:";"}`)),a.code(r._`${A} += ${M(Y)}`),a.assign(H,r._`${H}.concat(${x}[${Y}])`)}),s.reportError(p,{message:A,params:r._`{errors: ${H}}`})}else O(A=>s.reportError(p,{message:M(A),params:r._`{errors: ${x}[${A}]}`}));function O(A){a.forIn("key",x,H=>a.if(r._`${x}[${H}].length`,()=>A(H)))}function M(A){return r._`${A} in ${f} ? ${f}[${A}]() : ${g}[${A}]`}}function F(T){const x=a.const("emErrors",r.stringify(T)),f=[];for(const H in T)f.push([H,fe(T[H],w[H])]);const P=a.const("templates",a.object(...f)),O=a.scopeValue("obj",{ref:m,code:r.stringify(m)}),M=a.let("emPropParams"),A=a.let("emParamsErrors");a.forOf("err",c.default.vErrors,H=>a.if(se(H,x),()=>{a.assign(M,r._`${O}[${H}.keyword]`),a.assign(A,r._`${x}[${H}.keyword][${H}.params[${M}]]`),a.if(A,()=>a.code(r._`${A}.push(${H})`).assign(r._`${H}.${d}`,!0))})),a.forIn("key",x,H=>a.forIn("keyProp",r._`${x}[${H}]`,Y=>{a.assign(A,r._`${x}[${H}][${Y}]`),a.if(r._`${A}.length`,()=>{const N=a.const("tmpl",r._`${P}[${H}] && ${P}[${H}][${Y}]`);s.reportError(p,{message:r._`${N} ? ${N}() : ${g}[${H}][${Y}]`,params:r._`{errors: ${A}}`})})}))}function B(T){const{props:x,items:f}=T;if(!x&&!f)return;const P=r._`typeof ${i} == "object"`,O=r._`Array.isArray(${i})`,M=a.let("emErrors");let A,H;const Y=a.let("templates");x&&f?(A=a.let("emChildKwd"),a.if(P),a.if(O,()=>{N(f,w.items),a.assign(A,r.str`items`)},()=>{N(x,w.properties),a.assign(A,r.str`properties`)}),H=r._`[${A}]`):f?(a.if(O),N(f,w.items),H=r._`.items`):x&&(a.if(n.and(P,n.not(O))),N(x,w.properties),H=r._`.properties`),a.forOf("err",c.default.vErrors,j=>de(j,M,R=>a.code(r._`${M}[${R}].push(${j})`).assign(r._`${j}.${d}`,!0))),a.forIn("key",M,j=>a.if(r._`${M}[${j}].length`,()=>{s.reportError(p,{message:r._`${j} in ${Y} ? ${Y}[${j}]() : ${g}${H}[${j}]`,params:r._`{errors: ${M}[${j}]}`}),a.assign(r._`${c.default.vErrors}[${c.default.errors}-1].instancePath`,r._`${C} + "/" + ${j}.replace(/~/g, "~0").replace(/\\//g, "~1")`)})),a.endIf();function N(j,R){a.assign(M,r.stringify(j)),a.assign(Y,fe(j,R))}}function W(T){const x=a.const("emErrs",r._`[]`);a.forOf("err",c.default.vErrors,f=>a.if(ne(f),()=>a.code(r._`${x}.push(${f})`).assign(r._`${f}.${d}`,!0))),a.if(r._`${x}.length`,()=>s.reportError(p,{message:D(T),params:r._`{errors: ${x}}`}))}function ae(){const T=a.const("emErrs",r._`[]`);a.forOf("err",c.default.vErrors,x=>a.if(r._`!${x}.${d}`,()=>a.code(r._`${T}.push(${x})`))),a.assign(c.default.vErrors,T).assign(c.default.errors,r._`${T}.length`)}function se(T,x){return n.and(r._`${T}.keyword !== ${y}`,r._`!${T}.${d}`,r._`${T}.instancePath === ${C}`,r._`${T}.keyword in ${x}`,r._`${T}.schemaPath.indexOf(${_.errSchemaPath}) === 0`,r._`/^\\/[^\\/]*$/.test(${T}.schemaPath.slice(${_.errSchemaPath.length}))`)}function de(T,x,f){a.if(n.and(r._`${T}.keyword !== ${y}`,r._`!${T}.${d}`,r._`${T}.instancePath.indexOf(${C}) === 0`),()=>{const P=a.scopeValue("pattern",{ref:/^\/([^/]*)(?:\/|$)/,code:r._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")`}),O=a.const("emMatches",r._`${P}.exec(${T}.instancePath.slice(${C}.length))`),M=a.const("emChild",r._`${O} && ${O}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);a.if(r._`${M} !== undefined && ${M} in ${x}`,()=>f(M))})}function ne(T){return n.and(r._`${T}.keyword !== ${y}`,r._`!${T}.${d}`,n.or(r._`${T}.instancePath === ${C}`,n.and(r._`${T}.instancePath.indexOf(${C}) === 0`,r._`${T}.instancePath[${C}.length] === "/"`)),r._`${T}.schemaPath.indexOf(${_.errSchemaPath}) === 0`,r._`${T}.schemaPath[${_.errSchemaPath}.length] === "/"`)}function fe(T,x){const f=[];for(const P in T){const O=x[P];k.test(O)&&f.push([P,I(O)])}return a.object(...f)}function D(T){return k.test(T)?new o._Code(o.safeStringify(T).replace(b,(x,f)=>`" + JSON.stringify(${l.getData(f,_)}) + "`).replace(u,"")):r.stringify(T)}function I(T){return r._`function(){return ${D(T)}}`}},metaSchema:{anyOf:[{type:"string"},{type:"object",properties:{properties:{$ref:"#/$defs/stringMap"},items:{$ref:"#/$defs/stringList"},required:{$ref:"#/$defs/stringOrMap"},dependencies:{$ref:"#/$defs/stringOrMap"}},additionalProperties:{type:"string"}}],$defs:{stringMap:{type:"object",additionalProperties:{type:"string"}},stringOrMap:{anyOf:[{type:"string"},{$ref:"#/$defs/stringMap"}]},stringList:{type:"array",items:{type:"string"}}}}}}const S=(h,p={})=>{if(!h.opts.allErrors)throw new Error("ajv-errors: Ajv option allErrors must be true");if(h.opts.jsPropertySyntax)throw new Error("ajv-errors: ajv option jsPropertySyntax is not supported");return h.addKeyword(v(p))};t.default=S,e.exports=S,e.exports.default=S})(fr,fr.exports)),fr.exports}var Xs=Ys();const ei=nt(Xs);class ti{constructor(t){et(this,"ajv"),et(this,"pureAjv"),et(this,"pureInlineCache",new WeakMap),et(this,"mutateInlineCache",new WeakMap);const{customKeywords:r,customFormats:n,...o}=t||{};this.ajv=this.buildAjv(o,!0,r,n),this.pureAjv=this.buildAjv(o,!1,r,n)}buildAjv(t,r,n,o){const l=new Hs({allErrors:!0,code:{source:!1},coerceTypes:r,removeAdditional:!1,strict:!1,strictSchema:!1,useDefaults:r,validateFormats:!0,validateSchema:!1,verbose:!0,...t});return Qs(l),ei(l),this.addCustomKeywords(l,n||[]),this.addCustomFormats(l,o||{}),l}addCustomKeywords(t,r){r.forEach(n=>{t.addKeyword(n)})}addCustomFormats(t,r){Object.entries(r).forEach(([n,o])=>{o instanceof RegExp?t.addFormat(n,o):t.addFormat(n,{validate:o})})}createValidator(t,r=!0){const n=r?this.ajv:this.pureAjv;if(t.$id)return n.getSchema(t.$id)||n.compile(t);const o=r?this.mutateInlineCache:this.pureInlineCache,l=o.get(t);if(l)return l;const s=n.compile(t);return o.set(t,s),s}validate(t,r,n){const o=this.createValidator(r,n?.mutate??!0);if(!o(t)){const l=this.formatErrors(o.errors);if(n!=null&&n.throwOnError)throw new vr(l,o.errors||[]);return{valid:!1,errors:o.errors||void 0,errorMessage:l}}return{valid:!0,data:t}}formatErrors(t,r){return!t||t.length===0?"No errors":this.ajv.errorsText(t,{separator:"; ",dataVar:"data",...r})}getDetailedErrors(t){return!t||t.length===0?[]:t.map(r=>({field:r.instancePath||"/",message:r.message||"Validation failed",keyword:r.keyword,params:r.params,schemaPath:r.schemaPath}))}addSchema(t,r){return this.ajv.addSchema(t,r),this.pureAjv.addSchema(t,r),this}removeSchema(t){return this.ajv.removeSchema(t),this.pureAjv.removeSchema(t),this}}class vr extends Error{constructor(t,r){super(t),this.errors=r,this.name="ValidationError",Object.setPrototypeOf(this,vr.prototype)}}const ri=new ti({customKeywords:[{keyword:"x-nrg-skip-validation",schemaType:"boolean",valid:!0},{keyword:"x-nrg-node-type",type:"string",validate:(e,t)=>{if(!t)return!0;const r=RED.nodes.node(t);return!!r&&r.type===e}}],customFormats:{"node-id":/^[a-zA-Z0-9-_]+$/}});function Do(e){var t;if(!e)return e;let r=!1;const n={};for(const[o,l]of Object.entries(e)){if(!((t=l?.["x-nrg-form"])!=null&&t.required)||l!=null&&l["x-nrg-skip-validation"]){n[o]=l;continue}const s=Array.isArray(l.type)?l.type:[l.type];s.includes("string")&&l.minLength===void 0?(n[o]={...l,minLength:1},r=!0):s.includes("array")&&l.minItems===void 0?(n[o]={...l,minItems:1},r=!0):n[o]=l}return r?n:e}function ni(e,t){const r=Do(e?.properties),n=Do(t?.properties),o=e&&r!==e.properties?{...e,properties:r}:e;if(!n)return o;const l={type:"object",properties:n,...t!=null&&t.required?{required:t.required}:{}};return o?{...o,properties:{...o.properties,credentials:l}}:{type:"object",properties:{credentials:l},additionalProperties:!0}}function Ao(e,t){const r=ri.validate(Xr(e),t);return r.valid?[]:r.errors??[]}function oi(e,t){const r=Ao(e,t).filter(n=>{var o;if(((o=n.parentSchema)==null?void 0:o.format)!=="password")return!0;if(!e.credentials)return!1;const l=n.instancePath.split("/").pop(),s=Or.get(e,n.instancePath);return!(e.credentials[`has_${l}`]&&(!s||s==="__PWD__"))});return r.length===0?!0:r.map(n=>{var o;let l=n.instancePath;return n.keyword==="required"&&(o=n.params)!=null&&o.missingProperty&&(l=`${l}/${n.params.missingProperty}`),`${l.slice(1)||"root"}: ${n.message??"invalid"}`})}function ai(e,t){return Ao(e,t).filter(r=>{var n;return((n=r.parentSchema)==null?void 0:n.format)!=="password"?!0:Or.get(e,r.instancePath)!=="__PWD__"}).reduce((r,n)=>{var o;let l=n.instancePath;n.keyword==="required"&&(o=n.params)!=null&&o.missingProperty&&(l=`${l}/${n.params.missingProperty}`);const s=`node${l.replaceAll("/",".")}`;return r[s]=n.message??"Invalid",r},{})}const si=we({name:"NodeRedTray",props:{title:{type:String,default:""},width:{type:String,default:"Infinity"}},emits:["open","close","done","cancel"],data(){return{trayBody:null}},methods:{open(){RED.tray.show({title:this.title,width:this.width,buttons:[{id:"node-dialog-cancel",text:RED._("common.label.cancel"),click:()=>{this.$emit("cancel"),RED.tray.close()}},{id:"node-dialog-ok",text:RED._("common.label.done"),class:"primary",click:()=>{this.$emit("done"),RED.tray.close()}}],open:e=>{this.trayBody=e.find(".red-ui-tray-body")[0]??null,this.$emit("open")},close:()=>{this.trayBody=null,this.$emit("close")}})},close(){RED.tray.close()}}}),Ee=(e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r},ii={class:"nrg-tray-content"};function li(e,t,r,n,o,l){return K(),G(Le,null,[Q(` Renders nothing inline. While open, the default slot is TELEPORTED into the
10
+ Node-RED tray body, so the tray's content is a real Vue subtree the node
11
+ author controls \u2014 no imperative DOM/jQuery. RED owns the tray shell (title
12
+ + footer buttons) via RED.tray.show. `),e.trayBody?(K(),ve(ta,{key:0,to:e.trayBody},[U("div",ii,[Oe(e.$slots,"default",{close:e.close},void 0,!0)])],8,["to"])):Q("v-if",!0)],2112)}const hr=Ee(si,[["render",li],["__scopeId","data-v-715e36f4"]]),ui=we({name:"NodeRedInputLabel",props:{label:{type:String,default:""},icon:{type:String,default:""},required:{type:Boolean,default:!1},htmlFor:{type:String,default:""},labelId:{type:String,default:""}},computed:{iconClass(){return this.icon?`fa ${this.icon.startsWith("fa-")?this.icon:`fa-${this.icon}`}`:""}}}),ci={key:1,class:"nrg-required"};function di(e,t,r,n,o,l){return K(),ve(ra(e.htmlFor?"label":"span"),{id:e.labelId||void 0,class:"nrg-label",for:e.htmlFor||void 0},{default:Jt(()=>[e.icon?(K(),G("i",{key:0,class:Gt(e.iconClass)},null,2)):Q("v-if",!0),Oe(e.$slots,"default",{},()=>[Se(Z(e.label),1)],!0),e.required?(K(),G("span",ci,"*")):Q("v-if",!0)]),_:3},8,["id","for"])}const De=Ee(ui,[["render",di],["__scopeId","data-v-ec9d13ab"]]),pi=we({components:{NodeRedInputLabel:De,NodeRedTray:hr},props:{modelValue:{type:String,default:void 0},value:{type:String,default:""},language:{type:String,default:"json",validator:function(e){const t=["abap","apex","azcli","bat","bicep","cameligo","clojure","coffee","cpp","csharp","csp","css","cypher","dart","dockerfile","ecl","elixir","flow9","freemarker2","fsharp","go","graphql","handlebars","hcl","html","ini","java","javascript","json","julia","kotlin","less","lexon","liquid","lua","m3","markdown","mdx","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","pla","postiats","powerquery","powershell","protobuf","pub","python","qsharp","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scala","scheme","scss","shell","solidity","sophia","sparql","sql","st","swift","systemverilog","tcl","twig","typescript","typespec","vb","wgsl","xml","yaml"],r=t.includes(e);return r||console.warn(`[WARN]: Invalid value for 'type' property: "${e}". Expected one of: ${t.join(", ")}`),r}},label:{type:String,default:""},icon:{type:String,default:""},required:{type:Boolean,default:!1},error:{type:String,default:""},labelId:{type:String,default:""}},emits:["update:modelValue","update:value","editor-ready"],setup(){return{editorInstance:Ce(null),expandedEditor:Ce(null)}},data(){const e=Math.random().toString(36).substring(2,9);return{editorId:"node-red-editor-"+e,expandedEditorId:"expanded-editor-"+e,stateId:e}},computed:{effectiveValue(){return this.modelValue!==void 0?this.modelValue:this.value}},mounted(){const e=$(this.$refs["expand-button"]);RED.popover.tooltip(e,RED._("node-red:common.label.expand")),this.mountEditor()},beforeUnmount(){if(this.editorInstance){try{this.editorInstance.destroy()}catch(e){console.error(`Error destroying editor for ID ${this.editorId}:`,e)}this.editorInstance=null}this.destroyExpandedEditor()},methods:{mountEditor(){this.$nextTick(()=>{const e=this.$refs.container,t=this.$refs.editor;if(e&&t)try{const r=e.style.height,n=e.style.width;r?t.style.height=r:t.style.height="200px",n?t.style.width=n:t.style.width="100%",this.createEditorInstance()}catch(r){console.error("[NodeRedEditorInput] Error setting initial editor style:",r),this.createEditorInstance()}else console.error("[NodeRedEditorInput] Container or Editor div refs not found on mount.")})},createEditorInstance(){this.editorInstance=RED.editor.createEditor({id:this.editorId,mode:this.language,value:this.effectiveValue}),this.editorInstance.getSession().on("change",()=>{const e=this.editorInstance.getValue();e!==this.effectiveValue&&(this.$emit("update:modelValue",e),this.$emit("update:value",e))}),this.$emit("editor-ready",this.editorInstance)},destroyExpandedEditor(){if(this.expandedEditor){try{this.expandedEditor.destroy()}catch{}this.expandedEditor=null}},onClickExpand(){this.$refs.expandTray.open()},onExpandOpen(){this.$nextTick(()=>{var e,t;this.expandedEditor=RED.editor.createEditor({id:this.expandedEditorId,stateId:this.stateId,mode:this.language,value:this.effectiveValue}),(t=(e=this.expandedEditor).focus)==null||t.call(e)})},onExpandDone(){var e;this.expandedEditor.saveView(),(e=this.editorInstance)==null||e.setValue(this.expandedEditor.getValue(),-1),setTimeout(()=>{var t,r;(t=this.editorInstance)==null||t.restoreView(),(r=this.editorInstance)==null||r.focus()},250)},onExpandCancel(){setTimeout(()=>{var e;(e=this.editorInstance)==null||e.focus()},250)},onExpandClose(){this.destroyExpandedEditor()}}}),fi={ref:"container",class:"container"},hi={class:"editor-wrapper"},mi=["id","aria-labelledby"],yi=["id"];function vi(e,t,r,n,o,l){const s=ie("NodeRedInputLabel"),c=ie("NodeRedTray");return K(),G("div",fi,[Oe(e.$slots,"label",{},()=>[e.label?(K(),ve(s,{key:0,label:e.label,icon:e.icon,required:e.required,"label-id":e.labelId||void 0},null,8,["label","icon","required","label-id"])):Q("v-if",!0)],!0),U("div",hi,[U("button",{ref:"expand-button",class:"red-ui-button red-ui-button-small expand-button",onClick:t[0]||(t[0]=(...y)=>e.onClickExpand&&e.onClickExpand(...y))},[...t[1]||(t[1]=[U("i",{class:"fa fa-expand"},null,-1)])],512),U("div",{id:e.editorId,ref:"editor",role:"textbox","aria-labelledby":e.labelId||void 0},null,8,mi)]),na(U("div",{class:"node-red-vue-input-error-message"},Z(e.error),513),[[oa,e.error]]),Q(` "Expand" pops the field's editor into a full-width tray. Reuses the
13
+ shared NodeRedTray shell; a second Monaco is mounted into the teleported
14
+ host (sharing this field's stateId for scroll/cursor view state). `),pe(c,{ref:"expandTray",title:"Editor",onOpen:e.onExpandOpen,onDone:e.onExpandDone,onCancel:e.onExpandCancel,onClose:e.onExpandClose},{default:Jt(()=>[U("div",{id:e.expandedEditorId,class:"expanded-editor-host"},null,8,yi)]),_:1},8,["onOpen","onDone","onCancel","onClose"])],512)}const mr=Ee(pi,[["render",vi],["__scopeId","data-v-6971120f"]]),gi=we({name:"NodeRedSchemaTray",components:{NodeRedTray:hr,NodeRedEditorInput:mr},data(){return{title:"",draft:"",onSave:null}},methods:{open(e,t,r){this.title=e,this.draft=t,this.onSave=r,this.$refs.tray.open()},onDone(){var e;(e=this.onSave)==null||e.call(this,this.draft)}}});function bi(e,t,r,n,o,l){const s=ie("NodeRedEditorInput"),c=ie("NodeRedTray");return K(),G(Le,null,[Q(` The per-port schema editor, built ON TOP of the reusable NodeRedTray: a
15
+ Monaco (JSON) editor as the tray's Vue content. This is how a node author
16
+ composes NodeRedTray with their own content. `),pe(c,{ref:"tray",title:e.title,onDone:e.onDone},{default:Jt(()=>[pe(s,{class:"nrg-schema-editor","model-value":e.draft,language:"json","onUpdate:modelValue":t[0]||(t[0]=y=>e.draft=y)},null,8,["model-value"])]),_:1},8,["title","onDone"])],2112)}const $i=Ee(gi,[["render",bi],["__scopeId","data-v-d46acc22"]]),wi=we({name:"NodeRedVueApp",components:{NodeRedSchemaTray:$i},provide(){return{__nrg_form_node:this.localNode,__nrg_form_schema:this.schema,__nrg_form_errors:this.errors}},props:{node:{type:Object,required:!0},schema:{type:Object,required:!0},features:{type:Object,required:!0}},setup(){return{debouncedValidate:Ce(null),typeCheckEnabled:rt}},data(){return{localNode:this.node,errors:{}}},computed:{hasOutputReturnProperties(){var e,t;return((t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.outputReturnProperties)!==void 0},hasOutputContextModes(){var e,t;return((t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.outputContextModes)!==void 0},supportsInputTypeValidation(){var e,t;return((t=(e=this.node._def)==null?void 0:e.defaults)==null?void 0:t.validateInputTypes)!==void 0},supportsOutputTypeValidation(){var e,t;return((t=(e=this.node._def)==null?void 0:e.defaults)==null?void 0:t.validateOutputTypes)!==void 0},authorContextModeDefaults(){var e,t,r;return((r=(t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.outputContextModes)==null?void 0:r.default)??{}},hasOutputSchemas(){var e,t;return((t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.outputSchemas)!==void 0},authorOutputSchemaDefaults(){var e,t,r;return((r=(t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.outputSchemas)==null?void 0:r.default)??{}},acceptsInputSchema(){var e,t;return((t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.inputSchema)!==void 0},hasErrorPort(){var e,t;return((t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.errorPort)!==void 0},hasCompletePort(){var e,t;return((t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.completePort)!==void 0},hasStatusPort(){var e,t;return((t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.statusPort)!==void 0},hasBuiltinPorts(){return this.hasErrorPort||this.hasCompletePort||this.hasStatusPort},hasOutputValidation(){return this.hasOutputSchemas},showOutputs(){return this.outputRows.length>0},showPortsSettings(){return this.features.hasInput||this.showOutputs||this.hasBuiltinPorts},outputRows(){const e=(this.localNode.errorPort?1:0)+(this.localNode.completePort?1:0)+(this.localNode.statusPort?1:0),t=typeof this.localNode.outputs=="number"?this.localNode.outputs:null,r=t!==null&&t>=e?t-e:this.features.outputPorts.length;return Array.from({length:r},(n,o)=>{var l;return{index:o,label:((l=this.features.outputPorts[o])==null?void 0:l.label)??`Output ${o}`}})},inputLabel(){return this.resolveLabel("inputLabels.0","")||this.resolveLabel("inputLabels","Input")},contextModeOptions(){return[{value:"carry",label:this.resolveLabel("contextModes.modes.carry","carry")},{value:"trace",label:this.resolveLabel("contextModes.modes.trace","trace")},{value:"reset",label:this.resolveLabel("contextModes.modes.reset","reset")}]}},created(){this.debouncedValidate=ja(()=>this.validate(),150)},beforeMount(){var e;for(const t of["validateOutputs","validateOutputTypes","outputContextModes","outputReturnProperties","outputSchemas"]){const r=this.localNode[t];r&&typeof r=="object"&&(this.localNode[t]={...r})}if((e=this.schema)!=null&&e.properties){for(const[t,r]of Object.entries(this.schema.properties))if(r.type==="array"&&!Array.isArray(this.localNode[t])){const n=this.localNode[t];this.localNode[t]=n?String(n).split(",").filter(Boolean):[]}}this.localNode._def.credentials&&Object.keys(this.localNode._def.credentials).forEach(t=>{this.localNode._def.credentials[t].type==="password"&&this.localNode.credentials[`has_${t}`]&&!this.localNode.credentials[t]&&(this.localNode.credentials[t]="__PWD__")}),this.validate(),this.localNode._def.defaults&&Object.keys(this.localNode._def.defaults).forEach(t=>{this.$watch(()=>this.localNode[t],()=>{var r;(r=this.debouncedValidate)==null||r.call(this)},{deep:!0})}),this.localNode._def.credentials&&Object.keys(this.localNode._def.credentials).forEach(t=>{this.$watch(()=>this.localNode.credentials[t],(r,n)=>{var o;(o=this.debouncedValidate)==null||o.call(this),this.localNode._def.credentials[t].type==="password"&&r!==n&&(this.localNode.credentials[`has_${t}`]=!!r)},{deep:!0})})},beforeUnmount(){var e,t;(t=(e=this.debouncedValidate)==null?void 0:e.cancel)==null||t.call(e),this.localNode._def.credentials&&Object.keys(this.localNode._def.credentials).forEach(r=>{var n,o;this.localNode._def.credentials[r].type==="password"&&(n=this.localNode.credentials)!=null&&n[`has_${r}`]&&((o=this.localNode.credentials)==null?void 0:o[r])==="__PWD__"&&(this.localNode.credentials[r]=void 0)})},methods:{validate(){const e=ai(this.localNode,this.schema),t=Object.keys(this.errors);for(let r=0;r<t.length;r++)delete this.errors[t[r]];Object.assign(this.errors,e)},resolveLabel(e,t){const r=this.$i18n(e),n=`${this.localNode.type}.${e}`;return r&&r!==n&&r!==e?r:t},docsUrl(e){return`https://bonsaedev.github.io/nrg${e}`},recalculateOutputs(){var e;let t=((e=this.localNode._def)==null?void 0:e.outputs)??0;this.localNode.errorPort&&t++,this.localNode.completePort&&t++,this.localNode.statusPort&&t++,this.localNode.outputs=t},validateOutputFor(e){var t;return((t=this.localNode.validateOutputs)==null?void 0:t[e])??!1},setValidateOutput(e,t){this.localNode.validateOutputs={...this.localNode.validateOutputs??{},[e]:t}},validateOutputTypesFor(e){var t;return((t=this.localNode.validateOutputTypes)==null?void 0:t[e])??!1},setValidateOutputTypes(e,t){this.localNode.validateOutputTypes={...this.localNode.validateOutputTypes??{},[e]:t}},returnPropertyFor(e){var t;return((t=this.localNode.outputReturnProperties)==null?void 0:t[e])??""},setReturnProperty(e,t){const r={...this.localNode.outputReturnProperties??{}};t.trim()?r[e]=t:delete r[e],this.localNode.outputReturnProperties=r},contextModeFor(e){var t;return((t=this.localNode.outputContextModes)==null?void 0:t[e])??this.authorContextModeDefaults[e]??"carry"},setContextMode(e,t){this.localNode.outputContextModes={...this.localNode.outputContextModes??{},[e]:t}},outputSchemaFor(e){var t;return((t=this.localNode.outputSchemas)==null?void 0:t[e])??this.authorOutputSchemaDefaults[e]??""},setOutputSchema(e,t){const r={...this.localNode.outputSchemas??{}};t.trim()?r[e]=t:delete r[e],this.localNode.outputSchemas=r},schemaTrayRef(){return this.$refs.schemaTray},openOutputSchemaEditor(e){var t;const r=`${this.resolveLabel("outputs.schema","Schema")} \u2014 ${((t=this.outputRows[e])==null?void 0:t.label)??`Output ${e}`}`;this.schemaTrayRef().open(r,this.outputSchemaFor(e),n=>this.setOutputSchema(e,n))},inputSchemaValue(){var e,t,r;return this.localNode.inputSchema??((r=(t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.inputSchema)==null?void 0:r.default)??""},setInputSchema(e){this.localNode.inputSchema=e.trim()},openInputSchemaEditor(){const e=`${this.resolveLabel("outputs.schema","Schema")} \u2014 ${this.inputLabel}`;this.schemaTrayRef().open(e,this.inputSchemaValue(),t=>this.setInputSchema(t))}}}),_i={class:"nrg-form-app"},Pi={style:{width:"100%","padding-bottom":"12px"}},Ei={key:0,class:"nrg-section"},Si={class:"nrg-section-title"},ki={key:0,class:"nrg-subsection"},xi={class:"nrg-subsection-title"},Ni={class:"nrg-input"},ji={class:"nrg-outputs-label"},Ii={class:"nrg-outputs-flag"},Ti={key:0,class:"nrg-outputs-flag"},Oi={key:1,class:"nrg-outputs-flag"},Ci={class:"nrg-outputs-label"},Ri={class:"nrg-outputs-flag"},Vi={key:0,class:"nrg-outputs-flag"},Di=["disabled","aria-label"],Ai={key:1,class:"nrg-outputs-flag"},Li={class:"nrg-help-list"},qi=["href"],zi={key:0},Mi={key:1,class:"nrg-subsection"},Ui={class:"nrg-subsection-title"},Fi={class:"nrg-outputs"},Ki={class:"nrg-outputs-index"},Bi={class:"nrg-outputs-label"},Hi={key:0,class:"nrg-outputs-flag"},Wi={key:1,class:"nrg-outputs-flag"},Ji={key:2,class:"nrg-outputs-flag"},Gi={key:3,class:"nrg-outputs-return-col"},Zi={key:4,class:"nrg-outputs-context-col"},Qi={class:"nrg-outputs-index"},Yi={class:"nrg-outputs-label"},Xi={key:0,class:"nrg-outputs-flag"},el={key:1,class:"nrg-outputs-flag"},tl=["disabled","aria-label","onClick"],rl={key:2,class:"nrg-outputs-flag"},nl={key:3,class:"nrg-outputs-return-col"},ol=["value","onInput"],al={key:4,class:"nrg-outputs-context-col"},sl=["value","onChange"],il=["value"],ll={class:"nrg-help-list"},ul=["href"],cl={key:0},dl=["href"],pl={key:1},fl=["href"],hl={key:2},ml=["href"],yl={key:2,class:"nrg-subsection"},vl={class:"nrg-subsection-title"},gl={class:"nrg-help"},bl=["href"],$l={class:"nrg-lifecycle"},wl={class:"nrg-lifecycle-port"},_l={class:"nrg-outputs-flag"},Pl={class:"nrg-lifecycle-desc"},El={key:0},Sl={class:"nrg-lifecycle-port"},kl={class:"nrg-outputs-flag"},xl={class:"nrg-lifecycle-desc"},Nl={key:1},jl={class:"nrg-lifecycle-port"},Il={class:"nrg-outputs-flag"},Tl={class:"nrg-lifecycle-desc"},Ol={key:2},Cl={class:"nrg-lifecycle-port"},Rl={class:"nrg-outputs-flag"},Vl={class:"nrg-lifecycle-desc"};function Dl(e,t,r,n,o,l){const s=ie("NodeRedSchemaTray"),c=ie("NodeRedNodeForm"),y=ie("NodeRedToggle");return K(),G("div",_i,[Q(" Vue-driven schema editor tray (renders into a RED tray on open()). "),pe(s,{ref:"schemaTray"},null,512),Q(" 1. Node fields (schema-driven, name first) "),U("div",Pi,[pe(c,{node:e.localNode,schema:e.schema,errors:e.errors,style:{width:"100%"}},null,8,["node","schema","errors"])]),Q(" 2. Ports Settings "),e.showPortsSettings?(K(),G("div",Ei,[U("div",Si,Z(e.resolveLabel("sections.portsSettings","Ports Settings")),1),Q(` Input \u2014 a single Validate Data row, rendered as a table so it matches
17
+ the Outputs / Lifecycle Output Ports sections (muted headers) instead
18
+ of a bright toggle label that outweighs the section title. `),e.features.hasInput?(K(),G("div",ki,[U("div",xi,Z(e.resolveLabel("sections.input","Input")),1),U("table",Ni,[U("thead",null,[U("tr",null,[U("th",ji,Z(e.resolveLabel("outputs.label","Label")),1),U("th",Ii,Z(e.resolveLabel("toggles.validateInput","Validate Data")),1),e.acceptsInputSchema?(K(),G("th",Ti,Z(e.resolveLabel("outputs.schema","Schema")),1)):Q("v-if",!0),e.typeCheckEnabled&&e.supportsInputTypeValidation?(K(),G("th",Oi,Z(e.resolveLabel("toggles.validateInputTypes","Validate Types")),1)):Q("v-if",!0)])]),U("tbody",null,[U("tr",null,[U("td",Ci,Z(e.inputLabel),1),U("td",Ri,[pe(y,{"model-value":e.localNode.validateInput,"aria-label":e.resolveLabel("toggles.validateInput","Validate Data"),"onUpdate:modelValue":t[0]||(t[0]=d=>{e.localNode.validateInput=d})},null,8,["model-value","aria-label"])]),e.acceptsInputSchema?(K(),G("td",Vi,[U("button",{type:"button",class:"red-ui-button red-ui-button-small nrg-outputs-schema-btn",disabled:!e.localNode.validateInput,"aria-label":`${e.resolveLabel("outputs.schema","Schema")} \u2014 ${e.inputLabel}`,onClick:t[1]||(t[1]=d=>e.openInputSchemaEditor())},[...t[6]||(t[6]=[U("span",{class:"nrg-schema-glyph","aria-hidden":"true"},"{ }",-1)])],8,Di)])):Q("v-if",!0),e.typeCheckEnabled&&e.supportsInputTypeValidation?(K(),G("td",Ai,[pe(y,{"model-value":e.localNode.validateInputTypes,"aria-label":e.resolveLabel("toggles.validateInputTypes","Validate Types"),"onUpdate:modelValue":t[2]||(t[2]=d=>{e.localNode.validateInputTypes=d})},null,8,["model-value","aria-label"])])):Q("v-if",!0)])])]),U("ul",Li,[U("li",null,[U("strong",null,Z(e.resolveLabel("toggles.validateInput","Validate Data")),1),Se(" \u2014 "+Z(e.resolveLabel("help.validateInput","Validate incoming messages against the input schema before input() runs."))+" ",1),U("a",{class:"nrg-help-link",href:e.docsUrl("/guide/schemas#input-schema"),target:"_blank",rel:"noopener noreferrer"},Z(e.resolveLabel("help.learnMore","Learn more")),9,qi)]),e.typeCheckEnabled&&e.supportsInputTypeValidation?(K(),G("li",zi,[U("strong",null,Z(e.resolveLabel("toggles.validateInputTypes","Validate Types")),1),Se(" \u2014 "+Z(e.resolveLabel("help.validateInputTypes","Type-check wires connected to this input on deploy (TypeScript).")),1)])):Q("v-if",!0)])])):Q("v-if",!0),Q(" Outputs "),e.showOutputs?(K(),G("div",Mi,[U("div",Ui,Z(e.resolveLabel("sections.outputs","Outputs")),1),U("table",Fi,[U("thead",null,[U("tr",null,[U("th",Ki,Z(e.resolveLabel("outputs.port","Port")),1),U("th",Bi,Z(e.resolveLabel("outputs.label","Label")),1),e.hasOutputValidation?(K(),G("th",Hi,Z(e.resolveLabel("outputs.validate","Validate Data")),1)):Q("v-if",!0),e.hasOutputSchemas?(K(),G("th",Wi,Z(e.resolveLabel("outputs.schema","Schema")),1)):Q("v-if",!0),e.typeCheckEnabled&&e.supportsOutputTypeValidation?(K(),G("th",Ji,Z(e.resolveLabel("outputs.validateTypes","Validate Types")),1)):Q("v-if",!0),e.hasOutputReturnProperties?(K(),G("th",Gi,Z(e.resolveLabel("outputs.returnProperty","Return Property")),1)):Q("v-if",!0),e.hasOutputContextModes?(K(),G("th",Zi,Z(e.resolveLabel("outputs.contextMode","Context Mode")),1)):Q("v-if",!0)])]),U("tbody",null,[(K(!0),G(Le,null,tt(e.outputRows,d=>(K(),G("tr",{key:d.index},[U("td",Qi,Z(d.index),1),U("td",Yi,Z(d.label),1),e.hasOutputValidation?(K(),G("td",Xi,[pe(y,{"model-value":e.validateOutputFor(d.index),"aria-label":`${e.resolveLabel("outputs.validate","Validate Data")} \u2014 ${d.label}`,"onUpdate:modelValue":m=>e.setValidateOutput(d.index,m)},null,8,["model-value","aria-label","onUpdate:modelValue"])])):Q("v-if",!0),e.hasOutputSchemas?(K(),G("td",el,[U("button",{type:"button",class:"red-ui-button red-ui-button-small nrg-outputs-schema-btn",disabled:!e.validateOutputFor(d.index),"aria-label":`${e.resolveLabel("outputs.schema","Schema")} \u2014 ${d.label}`,onClick:m=>e.openOutputSchemaEditor(d.index)},[...t[7]||(t[7]=[U("span",{class:"nrg-schema-glyph","aria-hidden":"true"},"{ }",-1)])],8,tl)])):Q("v-if",!0),e.typeCheckEnabled&&e.supportsOutputTypeValidation?(K(),G("td",rl,[pe(y,{"model-value":e.validateOutputTypesFor(d.index),"aria-label":`${e.resolveLabel("outputs.validateTypes","Validate Types")} \u2014 ${d.label}`,"onUpdate:modelValue":m=>e.setValidateOutputTypes(d.index,m)},null,8,["model-value","aria-label","onUpdate:modelValue"])])):Q("v-if",!0),e.hasOutputReturnProperties?(K(),G("td",nl,[U("input",{type:"text",class:"nrg-outputs-return",placeholder:"output",value:e.returnPropertyFor(d.index),onInput:m=>e.setReturnProperty(d.index,m.target.value)},null,40,ol)])):Q("v-if",!0),e.hasOutputContextModes?(K(),G("td",al,[U("select",{class:"nrg-outputs-context",value:e.contextModeFor(d.index),onChange:m=>e.setContextMode(d.index,m.target.value)},[(K(!0),G(Le,null,tt(e.contextModeOptions,m=>(K(),G("option",{key:m.value,value:m.value},Z(m.label),9,il))),128))],40,sl)])):Q("v-if",!0)]))),128))])]),U("ul",ll,[U("li",null,[U("strong",null,Z(e.resolveLabel("outputs.validate","Validate Data")),1),Se(" \u2014 "+Z(e.resolveLabel("help.validateData","Check the sent value against this port's schema before it is emitted."))+" ",1),U("a",{class:"nrg-help-link",href:e.docsUrl("/guide/schemas#output-schema"),target:"_blank",rel:"noopener noreferrer"},Z(e.resolveLabel("help.learnMore","Learn more")),9,ul)]),e.typeCheckEnabled&&e.supportsOutputTypeValidation?(K(),G("li",cl,[U("strong",null,Z(e.resolveLabel("outputs.validateTypes","Validate Types")),1),Se(" \u2014 "+Z(e.resolveLabel("help.validateTypes","Type-check wires from this port on deploy (TypeScript)."))+" ",1),U("a",{class:"nrg-help-link",href:e.docsUrl("/guide/schemas#output-schema"),target:"_blank",rel:"noopener noreferrer"},Z(e.resolveLabel("help.learnMore","Learn more")),9,dl)])):Q("v-if",!0),e.hasOutputReturnProperties?(K(),G("li",pl,[U("strong",null,Z(e.resolveLabel("outputs.returnProperty","Return Property")),1),Se(" \u2014 "+Z(e.resolveLabel("help.returnProperty","The message property the sent value is placed on (default: output)."))+" ",1),U("a",{class:"nrg-help-link",href:e.docsUrl("/guide/schemas#overriding-the-return-key"),target:"_blank",rel:"noopener noreferrer"},Z(e.resolveLabel("help.learnMore","Learn more")),9,fl)])):Q("v-if",!0),e.hasOutputContextModes?(K(),G("li",hl,[U("strong",null,Z(e.resolveLabel("outputs.contextMode","Context Mode")),1),Se(" \u2014 "+Z(e.resolveLabel("help.contextMode","How the incoming message is carried to this port: carry, trace, or reset."))+" ",1),U("a",{class:"nrg-help-link",href:e.docsUrl("/guide/schemas#context-modes"),target:"_blank",rel:"noopener noreferrer"},Z(e.resolveLabel("help.learnMore","Learn more")),9,ml)])):Q("v-if",!0)])])):Q("v-if",!0),Q(" Lifecycle ports: extra output ports, a subsection of Ports Settings "),e.hasBuiltinPorts?(K(),G("div",yl,[U("div",vl,Z(e.resolveLabel("sections.lifecyclePorts","Lifecycle Output Ports")),1),U("div",gl,[Se(Z(e.resolveLabel("help.lifecyclePorts","Optional extra output ports that fire on error, on completion, and on every status change."))+" ",1),U("a",{class:"nrg-help-link",href:e.docsUrl("/guide/creating-a-node#lifecycle-output-ports"),target:"_blank",rel:"noopener noreferrer"},Z(e.resolveLabel("help.learnMore","Learn more")),9,bl)]),U("table",$l,[U("thead",null,[U("tr",null,[U("th",wl,Z(e.resolveLabel("lifecyclePorts.port","Port")),1),U("th",_l,Z(e.resolveLabel("lifecyclePorts.enable","Enable")),1),U("th",Pl,Z(e.resolveLabel("lifecyclePorts.description","Description")),1)])]),U("tbody",null,[e.hasErrorPort?(K(),G("tr",El,[U("td",Sl,Z(e.resolveLabel("lifecyclePorts.error.name","Error")),1),U("td",kl,[pe(y,{"model-value":e.localNode.errorPort,"aria-label":e.resolveLabel("toggles.errorPort","Error Port"),"onUpdate:modelValue":t[3]||(t[3]=d=>{e.localNode.errorPort=d,e.recalculateOutputs()})},null,8,["model-value","aria-label"])]),U("td",xl,Z(e.resolveLabel("lifecyclePorts.error.description","Routes the message to a separate output when this node fails, so you can handle errors on their own wire.")),1)])):Q("v-if",!0),e.hasCompletePort?(K(),G("tr",Nl,[U("td",jl,Z(e.resolveLabel("lifecyclePorts.complete.name","Complete")),1),U("td",Il,[pe(y,{"model-value":e.localNode.completePort,"aria-label":e.resolveLabel("toggles.completePort","Complete Port"),"onUpdate:modelValue":t[4]||(t[4]=d=>{e.localNode.completePort=d,e.recalculateOutputs()})},null,8,["model-value","aria-label"])]),U("td",Tl,Z(e.resolveLabel("lifecyclePorts.complete.description","Emits a message from a separate output once this node finishes, so you can trigger what comes next.")),1)])):Q("v-if",!0),e.hasStatusPort?(K(),G("tr",Ol,[U("td",Cl,Z(e.resolveLabel("lifecyclePorts.status.name","Status")),1),U("td",Rl,[pe(y,{"model-value":e.localNode.statusPort,"aria-label":e.resolveLabel("toggles.statusPort","Status Port"),"onUpdate:modelValue":t[5]||(t[5]=d=>{e.localNode.statusPort=d,e.recalculateOutputs()})},null,8,["model-value","aria-label"])]),U("td",Vl,Z(e.resolveLabel("lifecyclePorts.status.description","Emits a message from a separate output whenever this node's status changes, so your flow can react.")),1)])):Q("v-if",!0)])])])):Q("v-if",!0)])):Q("v-if",!0)])}const Al=Ee(wi,[["render",Dl],["__scopeId","data-v-94314aba"]]),Lo="*************",Ll=we({components:{NodeRedInputLabel:De},props:{modelValue:{type:[String,Number],default:void 0},value:{type:[String,Number],default:""},type:{type:String,default:"text"},placeholder:{type:String,default:""},label:{type:String,default:""},icon:{type:String,default:""},required:{type:Boolean,default:!1},error:{type:String,default:""},inputId:{type:String,default:""}},emits:["update:modelValue","update:value","input"],data(){return{internalValue:"",isFocused:!1}},computed:{effectiveValue(){return this.modelValue!==void 0?this.modelValue:this.value}},watch:{effectiveValue(e){this.isFocused||this.type==="password"||this.internalValue!==e&&(this.internalValue=e)}},beforeMount(){this.internalValue=this.effectiveValue,this.onBlur()},methods:{onInput(e){this.internalValue=e.target.value,this.$emit("update:modelValue",this.internalValue),this.$emit("update:value",this.internalValue),this.$emit("input",this.internalValue)},onFocus(){this.isFocused=!0,this.type==="password"&&this.internalValue===Lo&&(this.internalValue="")},onBlur(){this.isFocused=!1,this.type==="password"&&this.effectiveValue==="__PWD__"&&(this.internalValue=Lo)}}}),ql={style:{display:"flex","flex-direction":"column",width:"100%"}},zl=["id","type","value","placeholder"],Ml={key:0,class:"node-red-vue-input-error-message"};function Ul(e,t,r,n,o,l){const s=ie("NodeRedInputLabel");return K(),G("div",ql,[Oe(e.$slots,"label",{},()=>[e.label?(K(),ve(s,{key:0,label:e.label,icon:e.icon,required:e.required,"html-for":e.inputId||void 0},null,8,["label","icon","required","html-for"])):Q("v-if",!0)]),U("input",{id:e.inputId||void 0,ref:"inputField",type:e.type,value:e.internalValue,placeholder:e.placeholder,style:{width:"100%"},onInput:t[0]||(t[0]=(...c)=>e.onInput&&e.onInput(...c)),onFocus:t[1]||(t[1]=(...c)=>e.onFocus&&e.onFocus(...c)),onBlur:t[2]||(t[2]=(...c)=>e.onBlur&&e.onBlur(...c))},null,40,zl),e.error?(K(),G("div",Ml,Z(e.error),1)):Q("v-if",!0)])}const qo=Ee(Ll,[["render",Ul]]),Fl=["msg","flow","global","str","num","bool","json","bin","re","jsonata","date","env","node","cred"],Kl=["errorPort","completePort","statusPort"],Bl=we({components:{NodeRedInputLabel:De},props:{modelValue:{type:Object,default:void 0,validator:function(e){if(e===void 0)return!0;if(typeof e!="object"||e===null)return console.warn("[WARN] Invalid modelValue for TypedInput. It must be an object."),!1;const t=typeof e.value=="string"&&typeof e.type=="string";return t||console.warn("[WARN] Invalid modelValue for TypedInput. It must be an object with 'value' and 'type' properties being strings.",e),t}},value:{type:Object,default:void 0,validator:function(e){if(e===void 0)return!0;if(typeof e!="object"||e===null)return console.warn("[WARN] Invalid value for TypedInput. It must be an object."),!1;const t=typeof e.value=="string"&&typeof e.type=="string";return t||console.warn("[WARN] Invalid value for TypedInput. It must be an object with 'value' and 'type' properties being strings.",e),t}},types:{type:Array,default:()=>Fl},label:{type:String,default:""},icon:{type:String,default:""},required:{type:Boolean,default:!1},error:{type:String,default:""},labelId:{type:String,default:""}},emits:["update:modelValue","update:value"],setup(){return{inputWidget:Ce(null),mutationObserver:Ce(null)}},computed:{effectiveValue(){return this.modelValue!==void 0?this.modelValue:this.value},isProvidedValueTypeValid(){const e=this.effectiveValue.type;return this.types.includes(e)}},watch:{isProvidedValueTypeValid:{handler(e){e||console.warn(`Validation failed: type (${this.effectiveValue.type}) must be one of the provided types (${this.types}).`)},immediate:!0},error(e){this.$nextTick(()=>{const t=this.$el.querySelector(".red-ui-typedInput-container");t&&(e?t.classList.add("input-error"):t.classList.remove("input-error"))})},effectiveValue:{handler(e){this.inputWidget&&(this.$el.contains(document.activeElement)||(e.value!==this.inputWidget.typedInput("value")&&this.inputWidget.typedInput("value",e.value??""),e.type!==this.inputWidget.typedInput("type")&&this.inputWidget.typedInput("type",e.type??this.types[0])))},deep:!0}},mounted(){const e=this.$refs.typedInput;this.inputWidget=$(e),this.inputWidget.typedInput({default:this.effectiveValue.type||this.types[0],types:this.types}),this.inputWidget.typedInput("value",this.effectiveValue.value||""),this.inputWidget.typedInput("type",this.effectiveValue.type||this.types[0]),this.$nextTick(()=>{const t=new MutationObserver(r=>{for(const n of r)n.attributeName==="value"&&this.onChange()});t.observe(e,{attributes:!0,attributeFilter:["value"]}),this.mutationObserver=t}),this.inputWidget.on("change",()=>{this.onChange()})},beforeUnmount(){this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=null)},methods:{onChange(){const e=this.inputWidget.typedInput("value"),t=this.inputWidget.typedInput("type");if(this.effectiveValue.value!==e||this.effectiveValue.type!==t){const r={value:e,type:t};this.$emit("update:modelValue",r),this.$emit("update:value",r)}}}}),Hl={style:{display:"flex","flex-direction":"column",width:"100%"}},Wl=["aria-labelledby"],Jl={key:0,class:"node-red-vue-input-error-message"};function Gl(e,t,r,n,o,l){const s=ie("NodeRedInputLabel");return K(),G("div",Hl,[Oe(e.$slots,"label",{},()=>[e.label?(K(),ve(s,{key:0,label:e.label,icon:e.icon,required:e.required,"label-id":e.labelId||void 0},null,8,["label","icon","required","label-id"])):Q("v-if",!0)]),U("input",{ref:"typedInput","aria-labelledby":e.labelId||void 0,type:"text",class:"node-red-typed-input",style:{flex:"1",width:"100%"}},null,8,Wl),e.error?(K(),G("div",Jl,Z(e.error),1)):Q("v-if",!0)])}const zo=Ee(Bl,[["render",Gl]]),Zl=we({components:{NodeRedInputLabel:De},props:{modelValue:{type:String,default:void 0},value:{type:String,default:""},type:{type:String,required:!0},node:{type:Object,required:!0},propName:{type:String,required:!0},label:{type:String,default:""},icon:{type:String,default:""},required:{type:Boolean,default:!1},error:{type:String,default:""},labelId:{type:String,default:""}},emits:["update:modelValue","update:value"],setup(){return{jqInput:Ce(null)}},computed:{inputId(){return"node-input-"+this.propName},effectiveValue(){return this.modelValue!==void 0?this.modelValue:this.value}},mounted(){RED.editor.prepareConfigNodeSelect(this.node,this.propName,this.type,"node-input");const e=$("#"+this.inputId);this.jqInput=e,e.on("change",()=>{const t=e.val(),r=t==="_ADD_"?"":t;this.$emit("update:modelValue",r),this.$emit("update:value",r)}),e.val(this.effectiveValue||"_ADD_")},beforeUnmount(){this.jqInput&&(this.jqInput.off("change"),this.jqInput=null)}}),Ql={style:{display:"flex","flex-direction":"column",width:"100%"}},Yl=["id","aria-labelledby"],Xl={key:0,class:"node-red-vue-input-error-message"};function eu(e,t,r,n,o,l){const s=ie("NodeRedInputLabel");return K(),G("div",Ql,[Oe(e.$slots,"label",{},()=>[e.label?(K(),ve(s,{key:0,label:e.label,icon:e.icon,required:e.required,"label-id":e.labelId||void 0},null,8,["label","icon","required","label-id"])):Q("v-if",!0)]),U("input",{id:e.inputId,"aria-labelledby":e.labelId||void 0,type:"text",style:{width:"100%"}},null,8,Yl),e.error?(K(),G("div",Xl,Z(e.error),1)):Q("v-if",!0)])}const Mo=Ee(Zl,[["render",eu]]),tu=we({components:{NodeRedInputLabel:De},props:{modelValue:{type:[String,Array],default:void 0},value:{type:[String,Array],default:()=>""},options:{type:Array,required:!0,validator:function(e){if(!Array.isArray(e))return console.warn("[WARN] Invalid value for 'options' property. It must be an array."),!1;const t=e.every(r=>typeof r=="object"&&r!==null&&typeof r.value=="string"&&typeof r.label=="string"&&Object.prototype.hasOwnProperty.call(r,"value")&&Object.prototype.hasOwnProperty.call(r,"label"));return t||console.warn("[WARN] Invalid value for 'options' property. Each item must be an object with 'value' and 'label' properties being strings.",e),t}},multiple:{type:Boolean,default:!1},label:{type:String,default:""},icon:{type:String,default:""},required:{type:Boolean,default:!1},error:{type:String,default:""},labelId:{type:String,default:""}},emits:["update:modelValue","update:value"],setup(){return{selectWidget:Ce(null)}},computed:{effectiveValue(){return this.modelValue!==void 0?this.modelValue:this.value}},mounted(){const e=this.$refs.selectInput,t=$(e);this.selectWidget=t,t.typedInput({types:[{multiple:this.multiple,options:this.options}]}),t.typedInput("value",Array.isArray(this.effectiveValue)?this.effectiveValue.join(","):this.effectiveValue),t.on("change",()=>{var r;const n=this.multiple?((r=t.typedInput("value"))==null?void 0:r.split(",").filter(Boolean))??[]:t.typedInput("value");this.$emit("update:modelValue",n),this.$emit("update:value",n)})},beforeUnmount(){this.selectWidget&&(this.selectWidget.off("change"),this.selectWidget=null)}}),ru={style:{display:"flex","flex-direction":"column",width:"100%"}},nu=["aria-labelledby"],ou={key:0,class:"node-red-vue-input-error-message"};function au(e,t,r,n,o,l){const s=ie("NodeRedInputLabel");return K(),G("div",ru,[Oe(e.$slots,"label",{},()=>[e.label?(K(),ve(s,{key:0,label:e.label,icon:e.icon,required:e.required,"label-id":e.labelId||void 0},null,8,["label","icon","required","label-id"])):Q("v-if",!0)]),U("input",{ref:"selectInput","aria-labelledby":e.labelId||void 0,type:"text",class:"node-input-select",style:{width:"100%"}},null,8,nu),e.error?(K(),G("div",ou,Z(e.error),1)):Q("v-if",!0)])}const Uo=Ee(tu,[["render",au]]),su=we({name:"NodeRedToggle",props:{modelValue:{type:Boolean,default:!1},label:{type:String,default:""},icon:{type:String,default:""},ariaLabel:{type:String,default:""}},emits:["update:modelValue"],computed:{iconClass(){return this.icon?`fa ${this.icon.startsWith("fa-")?this.icon:`fa-${this.icon}`}`:""}}}),iu={class:"nrg-toggle-wrapper"},lu=["checked","aria-label"],uu={key:0,class:"nrg-toggle__label"};function cu(e,t,r,n,o,l){return K(),G("div",iu,[U("label",{class:Gt(["nrg-toggle",{"nrg-toggle--checked":e.modelValue}])},[U("input",{type:"checkbox",checked:e.modelValue,class:"nrg-toggle__input","aria-label":e.ariaLabel||void 0,onChange:t[0]||(t[0]=s=>e.$emit("update:modelValue",s.target.checked))},null,40,lu),e.icon||e.label?(K(),G("span",uu,[e.icon?(K(),G("i",{key:0,class:Gt(e.iconClass)},null,2)):Q("v-if",!0),Se(" "+Z(e.label),1)])):Q("v-if",!0),t[1]||(t[1]=U("span",{class:"nrg-toggle__slider"},null,-1))],2)])}const Fo=Ee(su,[["render",cu],["__scopeId","data-v-9d4b2ecb"]]),du=new Set(["id","type","x","y","z","g","wires","credentials","_users","validateInput","validateOutputs","outputs","outputContextModes","outputReturnProperties","outputSchemas","inputSchema",...Kl]);function pu(e){return e.replace(/([A-Z])/g," $1").replace(/^./,t=>t.toUpperCase()).trim()}function fu(e){var t,r;return e.type==="object"&&!!((t=e.properties)!=null&&t.value)&&!!((r=e.properties)!=null&&r.type)}function Ko(e){var t;return!!((t=e["x-nrg-form"])!=null&&t.required||typeof e.minLength=="number"&&e.minLength>=1||typeof e.minItems=="number"&&e.minItems>=1)}function Bo(e,t,r,n,o){var l;const s=n||t.title||pu(e),c=t["x-nrg-form"]??{},y=c.icon||"",d=m=>o?.(String(m))??String(m);if(t["x-nrg-node-type"])return{key:e,label:s,icon:y,inputType:"config",required:r,configType:t["x-nrg-node-type"]};if(fu(t))return{key:e,label:s,icon:y,inputType:"typed",required:r,types:c.typedInputTypes};if(t.type==="array"&&(l=t.items)!=null&&l.enum)return{key:e,label:s,icon:y,inputType:"select",required:r,multiple:!0,options:t.items.enum.map(m=>({value:String(m),label:d(m)}))};if(t.enum)return{key:e,label:s,icon:y,inputType:"select",required:r,multiple:!1,options:t.enum.map(m=>({value:String(m),label:d(m)}))};if(t.anyOf&&t.anyOf.every(m=>m.const!==void 0))return{key:e,label:s,icon:y,inputType:"select",required:r,multiple:!1,options:t.anyOf.map(m=>({value:String(m.const),label:d(m.const)}))};switch(Array.isArray(t.type)?t.type[0]:t.type){case"boolean":return{key:e,label:s,icon:y,inputType:"boolean",required:r,toggle:c.toggle};case"number":case"integer":return{key:e,label:s,icon:y,inputType:"number",required:r,htmlType:"number"};case"array":return c.editorLanguage?{key:e,label:s,icon:y,inputType:"editor",required:r,language:c.editorLanguage}:{key:e,label:s,icon:y,inputType:"array-text",required:r};case"object":return c.editorLanguage?{key:e,label:s,icon:y,inputType:"editor",required:r,language:c.editorLanguage}:{key:e,label:s,icon:y,inputType:"object-json",required:r};default:return c.editorLanguage?{key:e,label:s,icon:y,inputType:"editor",required:r,language:c.editorLanguage}:{key:e,label:s,icon:y,inputType:"text",required:r,htmlType:t.format==="password"?"password":"text"}}}const hu=we({name:"NodeRedJsonSchemaForm",components:{NodeRedInputLabel:De,NodeRedToggle:Fo,NodeRedInput:qo,NodeRedSelectInput:Uo,NodeRedTypedInput:zo,NodeRedConfigInput:Mo,NodeRedEditorInput:mr},props:{node:{type:Object,required:!0},schema:{type:Object,required:!0},errors:{type:Object,default:()=>({})}},computed:{configFields(){var e;return(e=this.schema)!=null&&e.properties?Object.entries(this.schema.properties).filter(([t])=>!du.has(t)).map(([t,r])=>Bo(t,r,Ko(r),this.resolveI18n("configs",t),n=>this.resolveOptionLabel(t,n))):[]},credentialFields(){var e,t;const r=(t=(e=this.schema)==null?void 0:e.properties)==null?void 0:t.credentials;return r!=null&&r.properties?Object.entries(r.properties).map(([n,o])=>{const l=Bo(n,o,Ko(o),this.resolveI18n("credentials",n));return l.inputType!=="text"?{...l,inputType:"text",htmlType:o.format==="password"?"password":"text"}:l}):[]}},methods:{fieldId(e){var t;return`nrg-${((t=this.node)==null?void 0:t.id)??"node"}-${e}`},setObjectField(e,t){const r=this.node;try{r[e]=JSON.parse(t)}catch{r[e]=t}},resolveI18n(e,t){const r=this.$i18n(`${e}.${t}`),n=`${this.node.type}.${e}.${t}`;if(r&&r!==n&&r!==`${e}.${t}`)return r},resolveOptionLabel(e,t){const r=`options.${e}.${t}`,n=this.$i18n(r),o=`${this.node.type}.${r}`;if(n&&n!==o&&n!==r)return n}}}),mu={key:1},yu={key:2},vu=["id","checked","onChange"],gu={key:6},bu=["id","value","onInput"],$u={key:0,class:"node-red-vue-input-error-message"};function wu(e,t,r,n,o,l){const s=ie("NodeRedInput"),c=ie("NodeRedToggle"),y=ie("NodeRedInputLabel"),d=ie("NodeRedSelectInput"),m=ie("NodeRedTypedInput"),k=ie("NodeRedConfigInput"),b=ie("NodeRedEditorInput");return K(),G("div",null,[(K(!0),G(Le,null,tt(e.configFields,u=>(K(),G("div",{key:u.key,class:"form-row"},[u.inputType==="text"||u.inputType==="number"?(K(),ve(s,{key:0,value:e.node[u.key],"onUpdate:value":v=>e.node[u.key]=v,type:u.htmlType,label:u.label,icon:u.icon,required:u.required,error:e.errors[`node.${u.key}`],"input-id":e.fieldId(u.key)},null,8,["value","onUpdate:value","type","label","icon","required","error","input-id"])):u.inputType==="boolean"&&u.toggle?(K(),G("div",mu,[pe(c,{"model-value":e.node[u.key],label:u.label,icon:u.icon,"onUpdate:modelValue":v=>e.node[u.key]=v},null,8,["model-value","label","icon","onUpdate:modelValue"])])):u.inputType==="boolean"?(K(),G("div",yu,[pe(y,{label:u.label,icon:u.icon,required:u.required,"html-for":e.fieldId(u.key)},null,8,["label","icon","required","html-for"]),U("input",{id:e.fieldId(u.key),type:"checkbox",checked:e.node[u.key],style:{width:"auto",margin:"0"},onChange:v=>{e.node[u.key]=v.target.checked}},null,40,vu)])):u.inputType==="select"?(K(),ve(d,{key:3,value:e.node[u.key],"onUpdate:value":v=>e.node[u.key]=v,options:u.options,multiple:u.multiple,label:u.label,icon:u.icon,required:u.required,error:e.errors[`node.${u.key}`],"label-id":e.fieldId(u.key)},null,8,["value","onUpdate:value","options","multiple","label","icon","required","error","label-id"])):u.inputType==="typed"?(K(),ve(m,{key:4,value:e.node[u.key],"onUpdate:value":v=>e.node[u.key]=v,types:u.types,label:u.label,icon:u.icon,required:u.required,error:e.errors[`node.${u.key}`],"label-id":e.fieldId(u.key)},null,8,["value","onUpdate:value","types","label","icon","required","error","label-id"])):u.inputType==="config"?(K(),ve(k,{key:5,value:e.node[u.key],"onUpdate:value":v=>e.node[u.key]=v,type:u.configType,node:e.node,"prop-name":u.key,label:u.label,icon:u.icon,required:u.required,error:e.errors[`node.${u.key}`],"label-id":e.fieldId(u.key)},null,8,["value","onUpdate:value","type","node","prop-name","label","icon","required","error","label-id"])):u.inputType==="array-text"?(K(),G("div",gu,[pe(y,{label:u.label,icon:u.icon,required:u.required,"html-for":e.fieldId(u.key)},null,8,["label","icon","required","html-for"]),t[0]||(t[0]=U("span",{style:{display:"block","font-size":"11px",color:"var(--red-ui-text-color-disabled, #999)","margin-bottom":"4px"}}," One entry per line ",-1)),U("textarea",{id:e.fieldId(u.key),value:Array.isArray(e.node[u.key])?e.node[u.key].join(`
19
+ `):e.node[u.key]??"",rows:"4",style:{width:"100%",resize:"vertical","font-family":"monospace","font-size":"13px"},onInput:v=>e.node[u.key]=v.target.value.split(`
20
+ `).filter(Boolean)},null,40,bu),e.errors[`node.${u.key}`]?(K(),G("span",$u,Z(e.errors[`node.${u.key}`]),1)):Q("v-if",!0)])):u.inputType==="object-json"?(K(),ve(b,{key:7,value:typeof e.node[u.key]=="string"?e.node[u.key]:JSON.stringify(e.node[u.key]??{},null,2),language:"json",label:u.label,icon:u.icon,required:u.required,error:e.errors[`node.${u.key}`],"label-id":e.fieldId(u.key),"onUpdate:value":v=>e.setObjectField(u.key,v)},null,8,["value","label","icon","required","error","label-id","onUpdate:value"])):u.inputType==="editor"?(K(),ve(b,{key:8,value:e.node[u.key],"onUpdate:value":v=>e.node[u.key]=v,language:u.language,label:u.label,icon:u.icon,required:u.required,error:e.errors[`node.${u.key}`],"label-id":e.fieldId(u.key)},null,8,["value","onUpdate:value","language","label","icon","required","error","label-id"])):Q("v-if",!0)]))),128)),(K(!0),G(Le,null,tt(e.credentialFields,u=>(K(),G("div",{key:`cred-${u.key}`,class:"form-row"},[pe(s,{value:e.node.credentials[u.key],"onUpdate:value":v=>e.node.credentials[u.key]=v,type:u.htmlType,label:u.label,icon:u.icon,required:u.required,error:e.errors[`node.credentials.${u.key}`],"input-id":e.fieldId(`credentials.${u.key}`)},null,8,["value","onUpdate:value","type","label","icon","required","error","input-id"])]))),128))])}const Ho=Ee(hu,[["render",wu]]);function _u(e,t,r,n){const o=aa(Al,{node:e,schema:r,features:n});return o.component("NodeRedInputLabel",De),o.component("NodeRedToggle",Fo),o.component("NodeRedInput",qo),o.component("NodeRedTypedInput",zo),o.component("NodeRedConfigInput",Mo),o.component("NodeRedSelectInput",Uo),o.component("NodeRedEditorInput",mr),o.component("NodeRedTray",hr),o.component("NodeRedJsonSchemaForm",Ho),o.component("NodeRedNodeForm",t?.component??Ho),o.config.globalProperties.$i18n=l=>e._(`${e.type}.${l}`),o}function Pu(e,t,r,n,o){$(`#${o}`).empty();const{_newState:l,_app:s,...c}=e,y=Xr(c);e._newState=y,e._app=_u(y,t,r,n),e._app.mount(`#${o}`)}function yr(e){e._app&&(e._app.unmount(),e._app=null)}function Wo(e){const t={credentials:{}};return Object.keys(e._def.defaults??{}).forEach(r=>{t[r]=e[r]}),e._def.credentials&&Object.keys(e._def.credentials).forEach(r=>{var n,o;t.credentials[r]=(n=e.credentials)==null?void 0:n[r],e._def.credentials[r].type==="password"&&(t.credentials[`has_${r}`]=((o=e.credentials)==null?void 0:o[`has_${r}`])||!1)}),t}function Jo(e,t){const r={};return new Set([...Object.keys(e),...Object.keys(t??{})]).forEach(n=>{const o=e[n],l=(t??{})[n];if(!Array.isArray(o)&&typeof o=="object"&&o!==null){const s=Jo(o,l);Object.keys(s).length&&(r[n]=s)}else za(o,l)||(r[n]=o)}),r}function Go(e,t){for(const r of Object.keys(t)){const n=t[r];Array.isArray(n)?e[r]=[...n]:n!==null&&typeof n=="object"?((!e[r]||typeof e[r]!="object"||Array.isArray(e[r]))&&(e[r]={}),Go(e[r],n)):e[r]=n}}function Xe(e,...t){for(const r of t){const n=e._(r);if(n&&n!==r)return n}}function Eu(e){return function(){return this.name?this.name:Xe(this,`${e}.label`)??e}}function Su(e){return function(){return Xe(this,`${e}.paletteLabel`,`${e}.label`)??e}}function ku(e){return function(t){return Xe(this,`${e}.inputLabels.${t}`,`${e}.inputLabels`)}}function xu(e,t,r,n){return function(o){if(t&&o<t.length)return t[o];if(r){let l=n;if(this.errorPort){if(o===l)return"Error";l++}if(this.completePort){if(o===l)return"Complete";l++}if(this.statusPort){if(o===l)return"Status";l++}}return Xe(this,`${e}.outputLabels.${o}`,`${e}.outputLabels`)}}function Nu(e){Object.keys(e._def.defaults??{}).forEach(t=>{var r,n;if(!((n=(r=e._def.defaults)==null?void 0:r[t])!=null&&n.type))return;const o=e[t],l=e._newState[t];if(o===l)return;const s=RED.nodes.node(o);if(s&&s._def.category==="config"){const c=s.users.findIndex(y=>y.id===e.id);c!==-1&&s.users.splice(c,1)}}),Object.keys(e._def.defaults??{}).forEach(t=>{var r,n;if(!((n=(r=e._def.defaults)==null?void 0:r[t])!=null&&n.type))return;const o=e._newState[t];if(!o)return;const l=RED.nodes.node(o);l&&l._def.category==="config"&&l.users.findIndex(s=>s.id===e.id)===-1&&l.users.push(e)})}function ju(e,t,r){Object.keys(e._def.defaults??{}).forEach(n=>{if(e._def.defaults[n].type)return;const o=`node-config-input-${n}`;let l=$(`#${o}`);l.length||(l=$("<input>",{type:"hidden",id:o}),$(`#${r}`).append(l)),l.val(t[n]??"")})}function Iu(e,t){var r,n,o;const l="errorPort"in e||"completePort"in e||"statusPort"in e;if(l&&!("outputs"in e)){let s=t;(r=e.errorPort)!=null&&r.value&&s++,(n=e.completePort)!=null&&n.value&&s++,(o=e.statusPort)!=null&&o.value&&s++,e.outputs={value:s}}return{hasBuiltinPorts:l,baseOutputs:t}}function Tu(e,t,r,n){const o=r??[],l=[];for(let s=0;s<n;s++){const c=o[s]??Xe(e,`${t}.outputLabels.${s}`,`${t}.outputLabels`)??`Output ${s}`;l.push({index:s,label:c})}return l}async function Zo(e){const{type:t}=e;try{let r=function(){const u=s.form,v=Tu(this,t,s.outputPortNames,b),S={hasInput:(s.inputs??0)>0,outputPorts:v};Pu(this,u,m,S,d)},n=function(){const u=this;yr(u);const v=Wo(u._newState),S=Wo(u),h=Jo(S,v),p=Object.keys(h).length>0;if(!p)return!1;if(Nu(u),Go(u,v),e.category==="config"){ju(u,v,d);return}return{changed:p,history:[{t:"edit",node:u,changes:h,links:[],dirty:RED.nodes.dirty(),changed:p}]}},o=function(){yr(this)},l=function(){yr(this)};const s=e,c=s.defaults?{...s.defaults}:void 0,y=s.credentials??void 0,d=`nrg-app-${t}`;$("<script>",{type:"text/html","data-template-name":t,html:`<div id="${d}"></div>`}).appendTo("body");const m=ni(s.configSchema,s.credentialsSchema);let k=!1,b=s.outputs||0;if(c&&({hasBuiltinPorts:k,baseOutputs:b}=Iu(c,b)),m&&c){const u=Object.keys(c)[0];if(u){const{required:v,...S}=c[u];c[u]={...S,validate:function(h,p){return oi(this,m)}}}}RED.nodes.registerType(t,{type:t,defaults:c,credentials:y,category:s.category,color:s.color||"#FFFFFF",icon:s.icon,inputs:s.inputs||0,outputs:s.outputs||0,label:s.label||Eu(t),paletteLabel:s.paletteLabel||Su(t),labelStyle:s.labelStyle,inputLabels:s.inputLabels||ku(t),outputLabels:s.outputLabels||xu(t,s.outputPortNames,k,b),align:s.align||"left",button:s.button?{...s.button,onclick:s.button.onClick}:void 0,oneditprepare:r,oneditsave:n,oneditcancel:o,oneditdelete:l,oneditresize:s.onEditResize,onpaletteadd:s.onPaletteAdd,onpaletteremove:s.onPaletteRemove}),fa(t)}catch(r){throw console.error(`Error while registering node type ${t}:`,r),r}}async function Ou(e){try{await Promise.all(e.map(t=>Zo(t)))}catch(t){throw console.error("Error registering node types:",t),t}}function Cu(){const e=Zt("__nrg_form_node"),t=Zt("__nrg_form_schema"),r=Zt("__nrg_form_errors");if(!e)throw new Error("useFormNode() must be called inside a form component mounted by NRG.");return{node:e,schema:t,errors:r}}export{ka as defineNode,Zo as registerType,Ou as registerTypes,Cu as useFormNode};