view-contracts 0.3.5 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -3
- package/cli-contract.yaml +40 -0
- package/dist/preview-style-helpers.js +2 -0
- package/dist/preview-style-helpers.js.map +7 -0
- package/dist/preview.mjs +152 -0
- package/dist/preview.mjs.map +7 -0
- package/dist/view-contracts.bundle.mjs +457 -248
- package/dist/view-contracts.bundle.mjs.map +4 -4
- package/docs/cli-reference.md +36 -0
- package/package.json +28 -1
- package/renderers/compose/renderRuntime.ts +40 -0
- package/renderers/react/defaults/theme.yaml +52 -0
- package/renderers/react/defaults/tokens.yaml +76 -1
- package/renderers/react/elementMap.ts +30 -6
- package/renderers/react/elements.yaml +17 -5
- package/renderers/react/lowering/foldStyle.ts +13 -1
- package/renderers/react/lowering/lowerToJsx.ts +21 -40
- package/renderers/react/paths.ts +5 -10
- package/renderers/react/preview/components.ts +23 -0
- package/renderers/react/preview/index.ts +3 -0
- package/renderers/react/preview/start.tsx +42 -0
- package/renderers/react/preview/style-helpers.ts +5 -0
- package/renderers/react/preview/vocabulary.tsx +75 -0
- package/renderers/react/runtime/structural.css +38 -0
- package/renderers/react/style/foldLiterals.ts +25 -4
- package/renderers/swiftui/README.md +48 -10
- package/renderers/swiftui/elementMap.ts +45 -0
- package/renderers/swiftui/elements.yaml +82 -0
- package/renderers/swiftui/index.ts +5 -0
- package/renderers/swiftui/lowering/lowerToSwiftUI.ts +761 -0
- package/renderers/swiftui/lowering/modifiers.ts +221 -0
- package/renderers/swiftui/renderComponents.ts +79 -0
- package/renderers/swiftui/renderRuntime.ts +139 -0
- package/renderers/swiftui/renderTheme.ts +274 -0
- package/spec/ui-dsl.linter-rules.json +0 -7
- package/spec/ui-dsl.meta.json +5 -0
- package/spec/ui-dsl.schema.json +333 -259
- package/renderers/react/runtime/theme.css +0 -65
- package/src/generated/schema/allowed-components.ts +0 -36
- package/src/generated/schema/dsl-enums.ts +0 -19
- package/src/generated/schema/dsl-properties.ts +0 -64
- package/src/generated/schema/index.ts +0 -4
- package/src/generated/schema/lowering-style-properties.ts +0 -35
- package/src/generated/schema/react-renderer-element-config.ts +0 -27
- package/src/generated/schema/schema-document.ts +0 -33
package/dist/preview.mjs
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
var af=Object.create;var Si=Object.defineProperty;var cf=Object.getOwnPropertyDescriptor;var lf=Object.getOwnPropertyNames;var uf=Object.getPrototypeOf,df=Object.prototype.hasOwnProperty;var ne=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var T=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},ff=(t,e)=>{for(var r in e)Si(t,r,{get:e[r],enumerable:!0})},pf=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of lf(e))!df.call(t,i)&&i!==r&&Si(t,i,{get:()=>e[i],enumerable:!(n=cf(e,i))||n.enumerable});return t};var mf=(t,e,r)=>(r=t!=null?af(uf(t)):{},pf(e||!t||!t.__esModule?Si(r,"default",{value:t,enumerable:!0}):r,t));var hf,ha,gf,yf,wf,vf,se,$f,bf,vr,$r,_f,be,ga,ya,wa,va,$a,ba,_a,xa,Ea,Sa,Pa,ka,Ra,Ia,Ca,Ta,Aa,Pi,xf,Ef,Na,W$,Y$,G$,X$,Q$,Z$,eb,tb,rb,nb,ib,ob,sb,ab,Oe,Ht=ne(()=>{hf=Object.create,ha=Object.defineProperty,gf=Object.getOwnPropertyDescriptor,yf=Object.getOwnPropertyNames,wf=Object.getPrototypeOf,vf=Object.prototype.hasOwnProperty,se=(t,e)=>()=>(e||(t((e={exports:{}}).exports,e),t=null),e.exports),$f=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(var i=yf(e),s=0,a=i.length,c;s<a;s++)c=i[s],!vf.call(t,c)&&c!==r&&ha(t,c,{get:(l=>e[l]).bind(null,c),enumerable:!(n=gf(e,c))||n.enumerable});return t},bf=(t,e,r)=>(r=t!=null?hf(wf(t)):{},$f(e||!t||!t.__esModule?ha(r,"default",{value:t,enumerable:!0}):r,t)),vr=se(((t,e)=>{function r(l){return typeof l>"u"||l===null}function n(l){return typeof l=="object"&&l!==null}function i(l){return Array.isArray(l)?l:r(l)?[]:[l]}function s(l,f){if(f){let p=Object.keys(f);for(let u=0,m=p.length;u<m;u+=1){let h=p[u];l[h]=f[h]}}return l}function a(l,f){let p="";for(let u=0;u<f;u+=1)p+=l;return p}function c(l){return l===0&&Number.NEGATIVE_INFINITY===1/l}e.exports.isNothing=r,e.exports.isObject=n,e.exports.toArray=i,e.exports.repeat=a,e.exports.isNegativeZero=c,e.exports.extend=s})),$r=se(((t,e)=>{function r(i,s){let a="",c=i.reason||"(unknown reason)";return i.mark?(i.mark.name&&(a+='in "'+i.mark.name+'" '),a+="("+(i.mark.line+1)+":"+(i.mark.column+1)+")",!s&&i.mark.snippet&&(a+=`
|
|
2
|
+
|
|
3
|
+
`+i.mark.snippet),c+" "+a):c}function n(i,s){Error.call(this),this.name="YAMLException",this.reason=i,this.mark=s,this.message=r(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n.prototype.toString=function(s){return this.name+": "+r(this,s)},e.exports=n})),_f=se(((t,e)=>{var r=vr();function n(a,c,l,f,p){let u="",m="",h=Math.floor(p/2)-1;return f-c>h&&(u=" ... ",c=f-h+u.length),l-f>h&&(m=" ...",l=f+h-m.length),{str:u+a.slice(c,l).replace(/\t/g,"\u2192")+m,pos:f-c+u.length}}function i(a,c){return r.repeat(" ",c-a.length)+a}function s(a,c){if(c=Object.create(c||null),!a.buffer)return null;c.maxLength||(c.maxLength=79),typeof c.indent!="number"&&(c.indent=1),typeof c.linesBefore!="number"&&(c.linesBefore=3),typeof c.linesAfter!="number"&&(c.linesAfter=2);let l=/\r?\n|\r|\0/g,f=[0],p=[],u,m=-1;for(;u=l.exec(a.buffer);)p.push(u.index),f.push(u.index+u[0].length),a.position<=u.index&&m<0&&(m=f.length-2);m<0&&(m=f.length-1);let h="",y=Math.min(a.line+c.linesAfter,p.length).toString().length,v=c.maxLength-(c.indent+y+3);for(let P=1;P<=c.linesBefore&&!(m-P<0);P++){let D=n(a.buffer,f[m-P],p[m-P],a.position-(f[m]-f[m-P]),v);h=r.repeat(" ",c.indent)+i((a.line-P+1).toString(),y)+" | "+D.str+`
|
|
4
|
+
`+h}let I=n(a.buffer,f[m],p[m],a.position,v);h+=r.repeat(" ",c.indent)+i((a.line+1).toString(),y)+" | "+I.str+`
|
|
5
|
+
`,h+=r.repeat("-",c.indent+y+3+I.pos)+`^
|
|
6
|
+
`;for(let P=1;P<=c.linesAfter&&!(m+P>=p.length);P++){let D=n(a.buffer,f[m+P],p[m+P],a.position-(f[m]-f[m+P]),v);h+=r.repeat(" ",c.indent)+i((a.line+P+1).toString(),y)+" | "+D.str+`
|
|
7
|
+
`}return h.replace(/\n$/,"")}e.exports=s})),be=se(((t,e)=>{var r=$r(),n=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],i=["scalar","sequence","mapping"];function s(c){let l={};return c!==null&&Object.keys(c).forEach(function(f){c[f].forEach(function(p){l[String(p)]=f})}),l}function a(c,l){if(l=l||{},Object.keys(l).forEach(function(f){if(n.indexOf(f)===-1)throw new r('Unknown option "'+f+'" is met in definition of "'+c+'" YAML type.')}),this.options=l,this.tag=c,this.kind=l.kind||null,this.resolve=l.resolve||function(){return!0},this.construct=l.construct||function(f){return f},this.instanceOf=l.instanceOf||null,this.predicate=l.predicate||null,this.represent=l.represent||null,this.representName=l.representName||null,this.defaultStyle=l.defaultStyle||null,this.multi=l.multi||!1,this.styleAliases=s(l.styleAliases||null),i.indexOf(this.kind)===-1)throw new r('Unknown kind "'+this.kind+'" is specified for "'+c+'" YAML type.')}e.exports=a})),ga=se(((t,e)=>{var r=$r(),n=be();function i(c,l){let f=[];return c[l].forEach(function(p){let u=f.length;f.forEach(function(m,h){m.tag===p.tag&&m.kind===p.kind&&m.multi===p.multi&&(u=h)}),f[u]=p}),f}function s(){let c={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function l(f){f.multi?(c.multi[f.kind].push(f),c.multi.fallback.push(f)):c[f.kind][f.tag]=c.fallback[f.tag]=f}for(let f=0,p=arguments.length;f<p;f+=1)arguments[f].forEach(l);return c}function a(c){return this.extend(c)}a.prototype.extend=function(l){let f=[],p=[];if(l instanceof n)p.push(l);else if(Array.isArray(l))p=p.concat(l);else if(l&&(Array.isArray(l.implicit)||Array.isArray(l.explicit)))l.implicit&&(f=f.concat(l.implicit)),l.explicit&&(p=p.concat(l.explicit));else throw new r("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");f.forEach(function(m){if(!(m instanceof n))throw new r("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(m.loadKind&&m.loadKind!=="scalar")throw new r("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(m.multi)throw new r("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),p.forEach(function(m){if(!(m instanceof n))throw new r("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let u=Object.create(a.prototype);return u.implicit=(this.implicit||[]).concat(f),u.explicit=(this.explicit||[]).concat(p),u.compiledImplicit=i(u,"implicit"),u.compiledExplicit=i(u,"explicit"),u.compiledTypeMap=s(u.compiledImplicit,u.compiledExplicit),u},e.exports=a})),ya=se(((t,e)=>{e.exports=new(be())("tag:yaml.org,2002:str",{kind:"scalar",construct:function(r){return r!==null?r:""}})})),wa=se(((t,e)=>{e.exports=new(be())("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(r){return r!==null?r:[]}})})),va=se(((t,e)=>{e.exports=new(be())("tag:yaml.org,2002:map",{kind:"mapping",construct:function(r){return r!==null?r:{}}})})),$a=se(((t,e)=>{e.exports=new(ga())({explicit:[ya(),wa(),va()]})})),ba=se(((t,e)=>{var r=be();function n(a){if(a===null)return!0;let c=a.length;return c===1&&a==="~"||c===4&&(a==="null"||a==="Null"||a==="NULL")}function i(){return null}function s(a){return a===null}e.exports=new r("tag:yaml.org,2002:null",{kind:"scalar",resolve:n,construct:i,predicate:s,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"})})),_a=se(((t,e)=>{var r=be();function n(a){if(a===null)return!1;let c=a.length;return c===4&&(a==="true"||a==="True"||a==="TRUE")||c===5&&(a==="false"||a==="False"||a==="FALSE")}function i(a){return a==="true"||a==="True"||a==="TRUE"}function s(a){return Object.prototype.toString.call(a)==="[object Boolean]"}e.exports=new r("tag:yaml.org,2002:bool",{kind:"scalar",resolve:n,construct:i,predicate:s,represent:{lowercase:function(a){return a?"true":"false"},uppercase:function(a){return a?"TRUE":"FALSE"},camelcase:function(a){return a?"True":"False"}},defaultStyle:"lowercase"})})),xa=se(((t,e)=>{var r=vr(),n=be();function i(u){return u>=48&&u<=57||u>=65&&u<=70||u>=97&&u<=102}function s(u){return u>=48&&u<=55}function a(u){return u>=48&&u<=57}function c(u){if(u===null)return!1;let m=u.length,h=0,y=!1;if(!m)return!1;let v=u[h];if((v==="-"||v==="+")&&(v=u[++h]),v==="0"){if(h+1===m)return!0;if(v=u[++h],v==="b"){for(h++;h<m;h++){if(v=u[h],v!=="0"&&v!=="1")return!1;y=!0}return y&&Number.isFinite(l(u))}if(v==="x"){for(h++;h<m;h++){if(!i(u.charCodeAt(h)))return!1;y=!0}return y&&Number.isFinite(l(u))}if(v==="o"){for(h++;h<m;h++){if(!s(u.charCodeAt(h)))return!1;y=!0}return y&&Number.isFinite(l(u))}}for(;h<m;h++){if(!a(u.charCodeAt(h)))return!1;y=!0}return y?Number.isFinite(l(u)):!1}function l(u){let m=u,h=1,y=m[0];if((y==="-"||y==="+")&&(y==="-"&&(h=-1),m=m.slice(1),y=m[0]),m==="0")return 0;if(y==="0"){if(m[1]==="b")return h*parseInt(m.slice(2),2);if(m[1]==="x")return h*parseInt(m.slice(2),16);if(m[1]==="o")return h*parseInt(m.slice(2),8)}return h*parseInt(m,10)}function f(u){return l(u)}function p(u){return Object.prototype.toString.call(u)==="[object Number]"&&u%1===0&&!r.isNegativeZero(u)}e.exports=new n("tag:yaml.org,2002:int",{kind:"scalar",resolve:c,construct:f,predicate:p,represent:{binary:function(u){return u>=0?"0b"+u.toString(2):"-0b"+u.toString(2).slice(1)},octal:function(u){return u>=0?"0o"+u.toString(8):"-0o"+u.toString(8).slice(1)},decimal:function(u){return u.toString(10)},hexadecimal:function(u){return u>=0?"0x"+u.toString(16).toUpperCase():"-0x"+u.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})})),Ea=se(((t,e)=>{var r=vr(),n=be(),i=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),s=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function a(u){return u===null||!i.test(u)?!1:Number.isFinite(parseFloat(u,10))?!0:s.test(u)}function c(u){let m=u.toLowerCase(),h=m[0]==="-"?-1:1;return"+-".indexOf(m[0])>=0&&(m=m.slice(1)),m===".inf"?h===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:m===".nan"?NaN:h*parseFloat(m,10)}var l=/^[-+]?[0-9]+e/;function f(u,m){if(isNaN(u))switch(m){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===u)switch(m){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===u)switch(m){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(r.isNegativeZero(u))return"-0.0";let h=u.toString(10);return l.test(h)?h.replace("e",".e"):h}function p(u){return Object.prototype.toString.call(u)==="[object Number]"&&(u%1!==0||r.isNegativeZero(u))}e.exports=new n("tag:yaml.org,2002:float",{kind:"scalar",resolve:a,construct:c,predicate:p,represent:f,defaultStyle:"lowercase"})})),Sa=se(((t,e)=>{e.exports=$a().extend({implicit:[ba(),_a(),xa(),Ea()]})})),Pa=se(((t,e)=>{e.exports=Sa()})),ka=se(((t,e)=>{var r=be(),n=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),i=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function s(l){return l===null?!1:n.exec(l)!==null||i.exec(l)!==null}function a(l){let f=0,p=null,u=n.exec(l);if(u===null&&(u=i.exec(l)),u===null)throw new Error("Date resolve error");let m=+u[1],h=+u[2]-1,y=+u[3];if(!u[4])return new Date(Date.UTC(m,h,y));let v=+u[4],I=+u[5],P=+u[6];if(u[7]){for(f=u[7].slice(0,3);f.length<3;)f+="0";f=+f}if(u[9]){let z=+u[10],L=+(u[11]||0);p=(z*60+L)*6e4,u[9]==="-"&&(p=-p)}let D=new Date(Date.UTC(m,h,y,v,I,P,f));return p&&D.setTime(D.getTime()-p),D}function c(l){return l.toISOString()}e.exports=new r("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:s,construct:a,instanceOf:Date,represent:c})})),Ra=se(((t,e)=>{var r=be();function n(i){return i==="<<"||i===null}e.exports=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:n})})),Ia=se(((t,e)=>{var r=be(),n=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
8
|
+
\r`;function i(l){if(l===null)return!1;let f=0,p=l.length,u=n;for(let m=0;m<p;m++){let h=u.indexOf(l.charAt(m));if(!(h>64)){if(h<0)return!1;f+=6}}return f%8===0}function s(l){let f=l.replace(/[\r\n=]/g,""),p=f.length,u=n,m=0,h=[];for(let v=0;v<p;v++)v%4===0&&v&&(h.push(m>>16&255),h.push(m>>8&255),h.push(m&255)),m=m<<6|u.indexOf(f.charAt(v));let y=p%4*6;return y===0?(h.push(m>>16&255),h.push(m>>8&255),h.push(m&255)):y===18?(h.push(m>>10&255),h.push(m>>2&255)):y===12&&h.push(m>>4&255),new Uint8Array(h)}function a(l){let f="",p=0,u=l.length,m=n;for(let y=0;y<u;y++)y%3===0&&y&&(f+=m[p>>18&63],f+=m[p>>12&63],f+=m[p>>6&63],f+=m[p&63]),p=(p<<8)+l[y];let h=u%3;return h===0?(f+=m[p>>18&63],f+=m[p>>12&63],f+=m[p>>6&63],f+=m[p&63]):h===2?(f+=m[p>>10&63],f+=m[p>>4&63],f+=m[p<<2&63],f+=m[64]):h===1&&(f+=m[p>>2&63],f+=m[p<<4&63],f+=m[64],f+=m[64]),f}function c(l){return Object.prototype.toString.call(l)==="[object Uint8Array]"}e.exports=new r("tag:yaml.org,2002:binary",{kind:"scalar",resolve:i,construct:s,predicate:c,represent:a})})),Ca=se(((t,e)=>{var r=be(),n=Object.prototype.hasOwnProperty,i=Object.prototype.toString;function s(c){if(c===null)return!0;let l=[],f=c;for(let p=0,u=f.length;p<u;p+=1){let m=f[p],h=!1;if(i.call(m)!=="[object Object]")return!1;let y;for(y in m)if(n.call(m,y))if(!h)h=!0;else return!1;if(!h)return!1;if(l.indexOf(y)===-1)l.push(y);else return!1}return!0}function a(c){return c!==null?c:[]}e.exports=new r("tag:yaml.org,2002:omap",{kind:"sequence",resolve:s,construct:a})})),Ta=se(((t,e)=>{var r=be(),n=Object.prototype.toString;function i(a){if(a===null)return!0;let c=a,l=new Array(c.length);for(let f=0,p=c.length;f<p;f+=1){let u=c[f];if(n.call(u)!=="[object Object]")return!1;let m=Object.keys(u);if(m.length!==1)return!1;l[f]=[m[0],u[m[0]]]}return!0}function s(a){if(a===null)return[];let c=a,l=new Array(c.length);for(let f=0,p=c.length;f<p;f+=1){let u=c[f],m=Object.keys(u);l[f]=[m[0],u[m[0]]]}return l}e.exports=new r("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:i,construct:s})})),Aa=se(((t,e)=>{var r=be(),n=Object.prototype.hasOwnProperty;function i(a){if(a===null)return!0;let c=a;for(let l in c)if(n.call(c,l)&&c[l]!==null)return!1;return!0}function s(a){return a!==null?a:{}}e.exports=new r("tag:yaml.org,2002:set",{kind:"mapping",resolve:i,construct:s})})),Pi=se(((t,e)=>{e.exports=Pa().extend({implicit:[ka(),Ra()],explicit:[Ia(),Ca(),Ta(),Aa()]})})),xf=se(((t,e)=>{var r=vr(),n=$r(),i=_f(),s=Pi(),a=Object.prototype.hasOwnProperty,c=1,l=2,f=3,p=4,u=1,m=2,h=3,y=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,v=/[\x85\u2028\u2029]/,I=/[,\[\]{}]/,P=/^(?:!|!!|![0-9A-Za-z-]+!)$/,D=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function z(o){return Object.prototype.toString.call(o)}function L(o){return o===10||o===13}function N(o){return o===9||o===32}function X(o){return o===9||o===32||o===10||o===13}function fe(o){return o===44||o===91||o===93||o===123||o===125}function yt(o){if(o>=48&&o<=57)return o-48;let g=o|32;return g>=97&&g<=102?g-97+10:-1}function wt(o){return o===120?2:o===117?4:o===85?8:0}function ze(o){return o>=48&&o<=57?o-48:-1}function Je(o){switch(o){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
|
|
9
|
+
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function Vt(o){return o<=65535?String.fromCharCode(o):String.fromCharCode((o-65536>>10)+55296,(o-65536&1023)+56320)}function ot(o,g,b){g==="__proto__"?Object.defineProperty(o,g,{configurable:!0,enumerable:!0,writable:!0,value:b}):o[g]=b}var qt=new Array(256),mr=new Array(256);for(let o=0;o<256;o++)qt[o]=Je(o)?1:0,mr[o]=Je(o);function pe(o,g){this.input=o,this.filename=g.filename||null,this.schema=g.schema||s,this.onWarning=g.onWarning||null,this.legacy=g.legacy||!1,this.json=g.json||!1,this.listener=g.listener||null,this.maxDepth=typeof g.maxDepth=="number"?g.maxDepth:100,this.maxMergeSeqLength=typeof g.maxMergeSeqLength=="number"?g.maxMergeSeqLength:20,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=o.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function un(o,g){let b={name:o.filename,buffer:o.input.slice(0,-1),position:o.position,line:o.line,column:o.position-o.lineStart};return b.snippet=i(b),new n(g,b)}function M(o,g){throw un(o,g)}function Dt(o,g){o.onWarning&&o.onWarning.call(null,un(o,g))}function We(o,g,b){let E=o.anchorMapTransactions;if(E.length!==0){let $=E[E.length-1];a.call($,g)||($[g]={existed:a.call(o.anchorMap,g),value:o.anchorMap[g]})}o.anchorMap[g]=b}function vi(o){o.anchorMapTransactions.push(Object.create(null))}function vt(o){let g=o.anchorMapTransactions.pop(),b=o.anchorMapTransactions;if(b.length===0)return;let E=b[b.length-1],$=Object.keys(g);for(let C=0,d=$.length;C<d;C+=1){let w=$[C];a.call(E,w)||(E[w]=g[w])}}function $i(o){let g=o.anchorMapTransactions.pop(),b=Object.keys(g);for(let E=b.length-1;E>=0;E-=1){let $=g[b[E]];$.existed?o.anchorMap[b[E]]=$.value:delete o.anchorMap[b[E]]}}function hr(o){return{position:o.position,line:o.line,lineStart:o.lineStart,lineIndent:o.lineIndent,firstTabInLine:o.firstTabInLine,tag:o.tag,anchor:o.anchor,kind:o.kind,result:o.result}}function Lt(o,g){o.position=g.position,o.line=g.line,o.lineStart=g.lineStart,o.lineIndent=g.lineIndent,o.firstTabInLine=g.firstTabInLine,o.tag=g.tag,o.anchor=g.anchor,o.kind=g.kind,o.result=g.result}var dn={YAML:function(g,b,E){g.version!==null&&M(g,"duplication of %YAML directive"),E.length!==1&&M(g,"YAML directive accepts exactly one argument");let $=/^([0-9]+)\.([0-9]+)$/.exec(E[0]);$===null&&M(g,"ill-formed argument of the YAML directive");let C=parseInt($[1],10),d=parseInt($[2],10);C!==1&&M(g,"unacceptable YAML version of the document"),g.version=E[0],g.checkLineBreaks=d<2,d!==1&&d!==2&&Dt(g,"unsupported YAML version of the document")},TAG:function(g,b,E){let $;E.length!==2&&M(g,"TAG directive accepts exactly two arguments");let C=E[0];$=E[1],P.test(C)||M(g,"ill-formed tag handle (first argument) of the TAG directive"),a.call(g.tagMap,C)&&M(g,'there is a previously declared suffix for "'+C+'" tag handle'),D.test($)||M(g,"ill-formed tag prefix (second argument) of the TAG directive");try{$=decodeURIComponent($)}catch{M(g,"tag prefix is malformed: "+$)}g.tagMap[C]=$}};function Re(o,g,b,E){if(g<b){let $=o.input.slice(g,b);if(E)for(let C=0,d=$.length;C<d;C+=1){let w=$.charCodeAt(C);w===9||w>=32&&w<=1114111||M(o,"expected valid JSON character")}else y.test($)&&M(o,"the stream contains non-printable characters");o.result+=$}}function st(o,g,b,E){r.isObject(b)||M(o,"cannot merge mappings; the provided source object is unacceptable");let $=Object.keys(b);for(let C=0,d=$.length;C<d;C+=1){let w=$[C];a.call(g,w)||(ot(g,w,b[w]),E[w]=!0)}}function Ye(o,g,b,E,$,C,d,w,R){if(Array.isArray($)){$=Array.prototype.slice.call($);for(let _=0,x=$.length;_<x;_+=1)Array.isArray($[_])&&M(o,"nested arrays are not supported inside keys"),typeof $=="object"&&z($[_])==="[object Object]"&&($[_]="[object Object]")}if(typeof $=="object"&&z($)==="[object Object]"&&($="[object Object]"),$=String($),g===null&&(g={}),E==="tag:yaml.org,2002:merge")if(Array.isArray(C)){C.length>o.maxMergeSeqLength&&M(o,"merge sequence length exceeded maxMergeSeqLength ("+o.maxMergeSeqLength+")");let _=new Set;for(let x=0,k=C.length;x<k;x+=1){let S=C[x];_.has(S)||(_.add(S),st(o,g,S,b))}}else st(o,g,C,b);else!o.json&&!a.call(b,$)&&a.call(g,$)&&(o.line=d||o.line,o.lineStart=w||o.lineStart,o.position=R||o.position,M(o,"duplicated mapping key")),ot(g,$,C),delete b[$];return g}function Ft(o){let g=o.input.charCodeAt(o.position);g===10?o.position++:g===13?(o.position++,o.input.charCodeAt(o.position)===10&&o.position++):M(o,"a line break is expected"),o.line+=1,o.lineStart=o.position,o.firstTabInLine=-1}function ue(o,g,b){let E=0,$=o.input.charCodeAt(o.position);for(;$!==0;){for(;N($);)$===9&&o.firstTabInLine===-1&&(o.firstTabInLine=o.position),$=o.input.charCodeAt(++o.position);if(g&&$===35)do $=o.input.charCodeAt(++o.position);while($!==10&&$!==13&&$!==0);if(L($))for(Ft(o),$=o.input.charCodeAt(o.position),E++,o.lineIndent=0;$===32;)o.lineIndent++,$=o.input.charCodeAt(++o.position);else break}return b!==-1&&E!==0&&o.lineIndent<b&&Dt(o,"deficient indentation"),E}function zt(o){let g=o.position,b=o.input.charCodeAt(g);return!!((b===45||b===46)&&b===o.input.charCodeAt(g+1)&&b===o.input.charCodeAt(g+2)&&(g+=3,b=o.input.charCodeAt(g),b===0||X(b)))}function Ge(o,g){g===1?o.result+=" ":g>1&&(o.result+=r.repeat(`
|
|
10
|
+
`,g-1))}function fn(o,g,b){let E,$,C,d,w,R,_=o.kind,x=o.result,k=o.input.charCodeAt(o.position);if(X(k)||fe(k)||k===35||k===38||k===42||k===33||k===124||k===62||k===39||k===34||k===37||k===64||k===96)return!1;if(k===63||k===45){let S=o.input.charCodeAt(o.position+1);if(X(S)||b&&fe(S))return!1}for(o.kind="scalar",o.result="",E=$=o.position,C=!1;k!==0;){if(k===58){let S=o.input.charCodeAt(o.position+1);if(X(S)||b&&fe(S))break}else if(k===35){if(X(o.input.charCodeAt(o.position-1)))break}else{if(o.position===o.lineStart&&zt(o)||b&&fe(k))break;if(L(k))if(d=o.line,w=o.lineStart,R=o.lineIndent,ue(o,!1,-1),o.lineIndent>=g){C=!0,k=o.input.charCodeAt(o.position);continue}else{o.position=$,o.line=d,o.lineStart=w,o.lineIndent=R;break}}C&&(Re(o,E,$,!1),Ge(o,o.line-d),E=$=o.position,C=!1),N(k)||($=o.position+1),k=o.input.charCodeAt(++o.position)}return Re(o,E,$,!1),o.result?!0:(o.kind=_,o.result=x,!1)}function pn(o,g){let b,E,$=o.input.charCodeAt(o.position);if($!==39)return!1;for(o.kind="scalar",o.result="",o.position++,b=E=o.position;($=o.input.charCodeAt(o.position))!==0;)if($===39)if(Re(o,b,o.position,!0),$=o.input.charCodeAt(++o.position),$===39)b=o.position,o.position++,E=o.position;else return!0;else L($)?(Re(o,b,E,!0),Ge(o,ue(o,!1,g)),b=E=o.position):o.position===o.lineStart&&zt(o)?M(o,"unexpected end of the document within a single quoted scalar"):(o.position++,N($)||(E=o.position));M(o,"unexpected end of the stream within a single quoted scalar")}function gr(o,g){let b,E,$,C=o.input.charCodeAt(o.position);if(C!==34)return!1;for(o.kind="scalar",o.result="",o.position++,b=E=o.position;(C=o.input.charCodeAt(o.position))!==0;){if(C===34)return Re(o,b,o.position,!0),o.position++,!0;if(C===92){if(Re(o,b,o.position,!0),C=o.input.charCodeAt(++o.position),L(C))ue(o,!1,g);else if(C<256&&qt[C])o.result+=mr[C],o.position++;else if(($=wt(C))>0){let d=$,w=0;for(;d>0;d--)C=o.input.charCodeAt(++o.position),($=yt(C))>=0?w=(w<<4)+$:M(o,"expected hexadecimal character");o.result+=Vt(w),o.position++}else M(o,"unknown escape sequence");b=E=o.position}else L(C)?(Re(o,b,E,!0),Ge(o,ue(o,!1,g)),b=E=o.position):o.position===o.lineStart&&zt(o)?M(o,"unexpected end of the document within a double quoted scalar"):(o.position++,N(C)||(E=o.position))}M(o,"unexpected end of the stream within a double quoted scalar")}function mn(o,g){let b=!0,E,$,C,d=o.tag,w,R=o.anchor,_,x,k,S,O=Object.create(null),j,q,F,Q=o.input.charCodeAt(o.position);if(Q===91)_=93,S=!1,w=[];else if(Q===123)_=125,S=!0,w={};else return!1;for(o.anchor!==null&&We(o,o.anchor,w),Q=o.input.charCodeAt(++o.position);Q!==0;){if(ue(o,!0,g),Q=o.input.charCodeAt(o.position),Q===_)return o.position++,o.tag=d,o.anchor=R,o.kind=S?"mapping":"sequence",o.result=w,!0;b?Q===44&&M(o,"expected the node content, but found ','"):M(o,"missed comma between flow collection entries"),q=j=F=null,x=k=!1,Q===63&&X(o.input.charCodeAt(o.position+1))&&(x=k=!0,o.position++,ue(o,!0,g)),E=o.line,$=o.lineStart,C=o.position,Qe(o,g,c,!1,!0),q=o.tag,j=o.result,ue(o,!0,g),Q=o.input.charCodeAt(o.position),(k||o.line===E)&&Q===58&&(x=!0,Q=o.input.charCodeAt(++o.position),ue(o,!0,g),Qe(o,g,c,!1,!0),F=o.result),S?Ye(o,w,O,q,j,F,E,$,C):x?w.push(Ye(o,null,O,q,j,F,E,$,C)):w.push(j),ue(o,!0,g),Q=o.input.charCodeAt(o.position),Q===44?(b=!0,Q=o.input.charCodeAt(++o.position)):b=!1}M(o,"unexpected end of the stream within a flow collection")}function hn(o,g){let b,E=u,$=!1,C=!1,d=g,w=0,R=!1,_,x=o.input.charCodeAt(o.position);if(x===124)b=!1;else if(x===62)b=!0;else return!1;for(o.kind="scalar",o.result="";x!==0;)if(x=o.input.charCodeAt(++o.position),x===43||x===45)u===E?E=x===43?h:m:M(o,"repeat of a chomping mode identifier");else if((_=ze(x))>=0)_===0?M(o,"bad explicit indentation width of a block scalar; it cannot be less than one"):C?M(o,"repeat of an indentation width identifier"):(d=g+_-1,C=!0);else break;if(N(x)){do x=o.input.charCodeAt(++o.position);while(N(x));if(x===35)do x=o.input.charCodeAt(++o.position);while(!L(x)&&x!==0)}for(;x!==0;){for(Ft(o),o.lineIndent=0,x=o.input.charCodeAt(o.position);(!C||o.lineIndent<d)&&x===32;)o.lineIndent++,x=o.input.charCodeAt(++o.position);if(!C&&o.lineIndent>d&&(d=o.lineIndent),L(x)){w++;continue}if(!C&&d===0&&M(o,"missing indentation for block scalar"),o.lineIndent<d){E===h?o.result+=r.repeat(`
|
|
11
|
+
`,$?1+w:w):E===u&&$&&(o.result+=`
|
|
12
|
+
`);break}b?N(x)?(R=!0,o.result+=r.repeat(`
|
|
13
|
+
`,$?1+w:w)):R?(R=!1,o.result+=r.repeat(`
|
|
14
|
+
`,w+1)):w===0?$&&(o.result+=" "):o.result+=r.repeat(`
|
|
15
|
+
`,w):o.result+=r.repeat(`
|
|
16
|
+
`,$?1+w:w),$=!0,C=!0,w=0;let k=o.position;for(;!L(x)&&x!==0;)x=o.input.charCodeAt(++o.position);Re(o,k,o.position,!1)}return!0}function Xe(o,g){let b=o.tag,E=o.anchor,$=[],C=!1;if(o.firstTabInLine!==-1)return!1;o.anchor!==null&&We(o,o.anchor,$);let d=o.input.charCodeAt(o.position);for(;d!==0&&(o.firstTabInLine!==-1&&(o.position=o.firstTabInLine,M(o,"tab characters must not be used in indentation")),!(d!==45||!X(o.input.charCodeAt(o.position+1))));){if(C=!0,o.position++,ue(o,!0,-1)&&o.lineIndent<=g){$.push(null),d=o.input.charCodeAt(o.position);continue}let w=o.line;if(Qe(o,g,f,!1,!0),$.push(o.result),ue(o,!0,-1),d=o.input.charCodeAt(o.position),(o.line===w||o.lineIndent>g)&&d!==0)M(o,"bad indentation of a sequence entry");else if(o.lineIndent<g)break}return C?(o.tag=b,o.anchor=E,o.kind="sequence",o.result=$,!0):!1}function gn(o,g,b){let E,$,C,d,w=o.tag,R=o.anchor,_={},x=Object.create(null),k=null,S=null,O=null,j=!1,q=!1;if(o.firstTabInLine!==-1)return!1;o.anchor!==null&&We(o,o.anchor,_);let F=o.input.charCodeAt(o.position);for(;F!==0;){!j&&o.firstTabInLine!==-1&&(o.position=o.firstTabInLine,M(o,"tab characters must not be used in indentation"));let Q=o.input.charCodeAt(o.position+1),le=o.line;if((F===63||F===58)&&X(Q))F===63?(j&&(Ye(o,_,x,k,S,null,$,C,d),k=S=O=null),q=!0,j=!0,E=!0):j?(j=!1,E=!0):M(o,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),o.position+=1,F=Q;else{if($=o.line,C=o.lineStart,d=o.position,!Qe(o,b,l,!1,!0))break;if(o.line===le){for(F=o.input.charCodeAt(o.position);N(F);)F=o.input.charCodeAt(++o.position);if(F===58)F=o.input.charCodeAt(++o.position),X(F)||M(o,"a whitespace character is expected after the key-value separator within a block mapping"),j&&(Ye(o,_,x,k,S,null,$,C,d),k=S=O=null),q=!0,j=!1,E=!1,k=o.tag,S=o.result;else if(q)M(o,"can not read an implicit mapping pair; a colon is missed");else return o.tag=w,o.anchor=R,!0}else if(q)M(o,"can not read a block mapping entry; a multiline key may not be an implicit key");else return o.tag=w,o.anchor=R,!0}if((o.line===le||o.lineIndent>g)&&(j&&($=o.line,C=o.lineStart,d=o.position),Qe(o,g,p,!0,E)&&(j?S=o.result:O=o.result),j||(Ye(o,_,x,k,S,O,$,C,d),k=S=O=null),ue(o,!0,-1),F=o.input.charCodeAt(o.position)),(o.line===le||o.lineIndent>g)&&F!==0)M(o,"bad indentation of a mapping entry");else if(o.lineIndent<g)break}return j&&Ye(o,_,x,k,S,null,$,C,d),q&&(o.tag=w,o.anchor=R,o.kind="mapping",o.result=_),q}function bi(o){let g=!1,b=!1,E,$,C=o.input.charCodeAt(o.position);if(C!==33)return!1;o.tag!==null&&M(o,"duplication of a tag property"),C=o.input.charCodeAt(++o.position),C===60?(g=!0,C=o.input.charCodeAt(++o.position)):C===33?(b=!0,E="!!",C=o.input.charCodeAt(++o.position)):E="!";let d=o.position;if(g){do C=o.input.charCodeAt(++o.position);while(C!==0&&C!==62);o.position<o.length?($=o.input.slice(d,o.position),C=o.input.charCodeAt(++o.position)):M(o,"unexpected end of the stream within a verbatim tag")}else{for(;C!==0&&!X(C);)C===33&&(b?M(o,"tag suffix cannot contain exclamation marks"):(E=o.input.slice(d-1,o.position+1),P.test(E)||M(o,"named tag handle cannot contain such characters"),b=!0,d=o.position+1)),C=o.input.charCodeAt(++o.position);$=o.input.slice(d,o.position),I.test($)&&M(o,"tag suffix cannot contain flow indicator characters")}$&&!D.test($)&&M(o,"tag name cannot contain such characters: "+$);try{$=decodeURIComponent($)}catch{M(o,"tag name is malformed: "+$)}return g?o.tag=$:a.call(o.tagMap,E)?o.tag=o.tagMap[E]+$:E==="!"?o.tag="!"+$:E==="!!"?o.tag="tag:yaml.org,2002:"+$:M(o,'undeclared tag handle "'+E+'"'),!0}function yn(o){let g=o.input.charCodeAt(o.position);if(g!==38)return!1;o.anchor!==null&&M(o,"duplication of an anchor property"),g=o.input.charCodeAt(++o.position);let b=o.position;for(;g!==0&&!X(g)&&!fe(g);)g=o.input.charCodeAt(++o.position);return o.position===b&&M(o,"name of an anchor node must contain at least one character"),o.anchor=o.input.slice(b,o.position),!0}function wn(o){let g=o.input.charCodeAt(o.position);if(g!==42)return!1;g=o.input.charCodeAt(++o.position);let b=o.position;for(;g!==0&&!X(g)&&!fe(g);)g=o.input.charCodeAt(++o.position);o.position===b&&M(o,"name of an alias node must contain at least one character");let E=o.input.slice(b,o.position);return a.call(o.anchorMap,E)||M(o,'unidentified alias "'+E+'"'),o.result=o.anchorMap[E],ue(o,!0,-1),!0}function _i(o,g,b,E){let $=hr(o);return vi(o),Lt(o,g),o.tag=null,o.anchor=null,o.kind=null,o.result=null,gn(o,b,E)&&o.kind==="mapping"?(vt(o),!0):($i(o),Lt(o,$),!1)}function Qe(o,g,b,E,$){let C,d,w=1,R=!1,_=!1,x=null,k,S,O;o.depth>=o.maxDepth&&M(o,"nesting exceeded maxDepth ("+o.maxDepth+")"),o.depth+=1,o.listener!==null&&o.listener("open",o),o.tag=null,o.anchor=null,o.kind=null,o.result=null;let j=C=d=p===b||f===b;if(E&&ue(o,!0,-1)&&(R=!0,o.lineIndent>g?w=1:o.lineIndent===g?w=0:o.lineIndent<g&&(w=-1)),w===1)for(;;){let q=o.input.charCodeAt(o.position),F=hr(o);if(R&&(q===33&&o.tag!==null||q===38&&o.anchor!==null)||!bi(o)&&!yn(o))break;x===null&&(x=F),ue(o,!0,-1)?(R=!0,d=j,o.lineIndent>g?w=1:o.lineIndent===g?w=0:o.lineIndent<g&&(w=-1)):d=!1}if(d&&(d=R||$),w===1||p===b)if(c===b||l===b?S=g:S=g+1,O=o.position-o.lineStart,w===1)if(d&&(Xe(o,O)||gn(o,O,S))||mn(o,S))_=!0;else{let q=o.input.charCodeAt(o.position);x!==null&&j&&!d&&q!==124&&q!==62&&_i(o,x,x.position-x.lineStart,S)||C&&hn(o,S)||pn(o,S)||gr(o,S)?_=!0:wn(o)?(_=!0,(o.tag!==null||o.anchor!==null)&&M(o,"alias node should not have any properties")):fn(o,S,c===b)&&(_=!0,o.tag===null&&(o.tag="?")),o.anchor!==null&&We(o,o.anchor,o.result)}else w===0&&(_=d&&Xe(o,O));if(o.tag===null)o.anchor!==null&&We(o,o.anchor,o.result);else if(o.tag==="?"){o.result!==null&&o.kind!=="scalar"&&M(o,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+o.kind+'"');for(let q=0,F=o.implicitTypes.length;q<F;q+=1)if(k=o.implicitTypes[q],k.resolve(o.result)){o.result=k.construct(o.result),o.tag=k.tag,o.anchor!==null&&We(o,o.anchor,o.result);break}}else if(o.tag!=="!"){if(a.call(o.typeMap[o.kind||"fallback"],o.tag))k=o.typeMap[o.kind||"fallback"][o.tag];else{k=null;let q=o.typeMap.multi[o.kind||"fallback"];for(let F=0,Q=q.length;F<Q;F+=1)if(o.tag.slice(0,q[F].tag.length)===q[F].tag){k=q[F];break}}k||M(o,"unknown tag !<"+o.tag+">"),o.result!==null&&k.kind!==o.kind&&M(o,"unacceptable node kind for !<"+o.tag+'> tag; it should be "'+k.kind+'", not "'+o.kind+'"'),k.resolve(o.result,o.tag)?(o.result=k.construct(o.result,o.tag),o.anchor!==null&&We(o,o.anchor,o.result)):M(o,"cannot resolve a node with !<"+o.tag+"> explicit tag")}return o.listener!==null&&o.listener("close",o),o.depth-=1,o.tag!==null||o.anchor!==null||_}function xi(o){let g=o.position,b=!1,E;for(o.version=null,o.checkLineBreaks=o.legacy,o.tagMap=Object.create(null),o.anchorMap=Object.create(null);(E=o.input.charCodeAt(o.position))!==0&&(ue(o,!0,-1),E=o.input.charCodeAt(o.position),!(o.lineIndent>0||E!==37));){b=!0,E=o.input.charCodeAt(++o.position);let $=o.position;for(;E!==0&&!X(E);)E=o.input.charCodeAt(++o.position);let C=o.input.slice($,o.position),d=[];for(C.length<1&&M(o,"directive name must not be less than one character in length");E!==0;){for(;N(E);)E=o.input.charCodeAt(++o.position);if(E===35){do E=o.input.charCodeAt(++o.position);while(E!==0&&!L(E));break}if(L(E))break;for($=o.position;E!==0&&!X(E);)E=o.input.charCodeAt(++o.position);d.push(o.input.slice($,o.position))}E!==0&&Ft(o),a.call(dn,C)?dn[C](o,C,d):Dt(o,'unknown document directive "'+C+'"')}if(ue(o,!0,-1),o.lineIndent===0&&o.input.charCodeAt(o.position)===45&&o.input.charCodeAt(o.position+1)===45&&o.input.charCodeAt(o.position+2)===45?(o.position+=3,ue(o,!0,-1)):b&&M(o,"directives end mark is expected"),Qe(o,o.lineIndent-1,p,!1,!0),ue(o,!0,-1),o.checkLineBreaks&&v.test(o.input.slice(g,o.position))&&Dt(o,"non-ASCII line breaks are interpreted as content"),o.documents.push(o.result),o.position===o.lineStart&&zt(o)){o.input.charCodeAt(o.position)===46&&(o.position+=3,ue(o,!0,-1));return}o.position<o.length-1&&M(o,"end of the stream or a document separator is expected")}function vn(o,g){o=String(o),g=g||{},o.length!==0&&(o.charCodeAt(o.length-1)!==10&&o.charCodeAt(o.length-1)!==13&&(o+=`
|
|
17
|
+
`),o.charCodeAt(0)===65279&&(o=o.slice(1)));let b=new pe(o,g),E=o.indexOf("\0");for(E!==-1&&(b.position=E,M(b,"null byte is not allowed in input")),b.input+="\0";b.input.charCodeAt(b.position)===32;)b.lineIndent+=1,b.position+=1;for(;b.position<b.length-1;)xi(b);return b.documents}function $n(o,g,b){g!==null&&typeof g=="object"&&typeof b>"u"&&(b=g,g=null);let E=vn(o,b);if(typeof g!="function")return E;for(let $=0,C=E.length;$<C;$+=1)g(E[$])}function Ei(o,g){let b=vn(o,g);if(b.length!==0){if(b.length===1)return b[0];throw new n("expected a single document in the stream, but found more")}}e.exports.loadAll=$n,e.exports.load=Ei})),Ef=se(((t,e)=>{var r=vr(),n=$r(),i=Pi(),s=Object.prototype.toString,a=Object.prototype.hasOwnProperty,c=65279,l=9,f=10,p=13,u=32,m=33,h=34,y=35,v=37,I=38,P=39,D=42,z=44,L=45,N=58,X=61,fe=62,yt=63,wt=64,ze=91,Je=93,Vt=96,ot=123,qt=124,mr=125,pe={};pe[0]="\\0",pe[7]="\\a",pe[8]="\\b",pe[9]="\\t",pe[10]="\\n",pe[11]="\\v",pe[12]="\\f",pe[13]="\\r",pe[27]="\\e",pe[34]='\\"',pe[92]="\\\\",pe[133]="\\N",pe[160]="\\_",pe[8232]="\\L",pe[8233]="\\P";var un=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],M=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Dt(d,w){if(w===null)return{};let R={},_=Object.keys(w);for(let x=0,k=_.length;x<k;x+=1){let S=_[x],O=String(w[S]);S.slice(0,2)==="!!"&&(S="tag:yaml.org,2002:"+S.slice(2));let j=d.compiledTypeMap.fallback[S];j&&a.call(j.styleAliases,O)&&(O=j.styleAliases[O]),R[S]=O}return R}function We(d){let w,R,_=d.toString(16).toUpperCase();if(d<=255)w="x",R=2;else if(d<=65535)w="u",R=4;else if(d<=4294967295)w="U",R=8;else throw new n("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+w+r.repeat("0",R-_.length)+_}var vi=1,vt=2;function $i(d){this.schema=d.schema||i,this.indent=Math.max(1,d.indent||2),this.noArrayIndent=d.noArrayIndent||!1,this.skipInvalid=d.skipInvalid||!1,this.flowLevel=r.isNothing(d.flowLevel)?-1:d.flowLevel,this.styleMap=Dt(this.schema,d.styles||null),this.sortKeys=d.sortKeys||!1,this.lineWidth=d.lineWidth||80,this.noRefs=d.noRefs||!1,this.noCompatMode=d.noCompatMode||!1,this.condenseFlow=d.condenseFlow||!1,this.quotingType=d.quotingType==='"'?vt:vi,this.forceQuotes=d.forceQuotes||!1,this.replacer=typeof d.replacer=="function"?d.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function hr(d,w){let R=r.repeat(" ",w),_=0,x="",k=d.length;for(;_<k;){let S,O=d.indexOf(`
|
|
18
|
+
`,_);O===-1?(S=d.slice(_),_=k):(S=d.slice(_,O+1),_=O+1),S.length&&S!==`
|
|
19
|
+
`&&(x+=R),x+=S}return x}function Lt(d,w){return`
|
|
20
|
+
`+r.repeat(" ",d.indent*w)}function dn(d,w){for(let R=0,_=d.implicitTypes.length;R<_;R+=1)if(d.implicitTypes[R].resolve(w))return!0;return!1}function Re(d){return d===u||d===l}function st(d){return d>=32&&d<=126||d>=161&&d<=55295&&d!==8232&&d!==8233||d>=57344&&d<=65533&&d!==c||d>=65536&&d<=1114111}function Ye(d){return st(d)&&d!==c&&d!==p&&d!==f}function Ft(d,w,R){let _=Ye(d),x=_&&!Re(d);return(R?_:_&&d!==z&&d!==ze&&d!==Je&&d!==ot&&d!==mr)&&d!==y&&!(w===N&&!x)||Ye(w)&&!Re(w)&&d===y||w===N&&x}function ue(d){return st(d)&&d!==c&&!Re(d)&&d!==L&&d!==yt&&d!==N&&d!==z&&d!==ze&&d!==Je&&d!==ot&&d!==mr&&d!==y&&d!==I&&d!==D&&d!==m&&d!==qt&&d!==X&&d!==fe&&d!==P&&d!==h&&d!==v&&d!==wt&&d!==Vt}function zt(d){return!Re(d)&&d!==N}function Ge(d,w){let R=d.charCodeAt(w),_;return R>=55296&&R<=56319&&w+1<d.length&&(_=d.charCodeAt(w+1),_>=56320&&_<=57343)?(R-55296)*1024+_-56320+65536:R}function fn(d){return/^\n* /.test(d)}var pn=1,gr=2,mn=3,hn=4,Xe=5;function gn(d,w,R,_,x,k,S,O){let j,q=0,F=null,Q=!1,le=!1,ma=_!==-1,yr=-1,wr=ue(Ge(d,0))&&zt(Ge(d,d.length-1));if(w||S)for(j=0;j<d.length;q>=65536?j+=2:j++){if(q=Ge(d,j),!st(q))return Xe;wr=wr&&Ft(q,F,O),F=q}else{for(j=0;j<d.length;q>=65536?j+=2:j++){if(q=Ge(d,j),q===f)Q=!0,ma&&(le=le||j-yr-1>_&&d[yr+1]!==" ",yr=j);else if(!st(q))return Xe;wr=wr&&Ft(q,F,O),F=q}le=le||ma&&j-yr-1>_&&d[yr+1]!==" "}return!Q&&!le?wr&&!S&&!x(d)?pn:k===vt?Xe:gr:R>9&&fn(d)?Xe:S?k===vt?Xe:gr:le?hn:mn}function bi(d,w,R,_,x){d.dump=(function(){if(w.length===0)return d.quotingType===vt?'""':"''";if(!d.noCompatMode&&(un.indexOf(w)!==-1||M.test(w)))return d.quotingType===vt?'"'+w+'"':"'"+w+"'";let k=d.indent*Math.max(1,R),S=d.lineWidth===-1?-1:Math.max(Math.min(d.lineWidth,40),d.lineWidth-k),O=_||d.flowLevel>-1&&R>=d.flowLevel;function j(q){return dn(d,q)}switch(gn(w,O,d.indent,S,j,d.quotingType,d.forceQuotes&&!_,x)){case pn:return w;case gr:return"'"+w.replace(/'/g,"''")+"'";case mn:return"|"+yn(w,d.indent)+wn(hr(w,k));case hn:return">"+yn(w,d.indent)+wn(hr(_i(w,S),k));case Xe:return'"'+xi(w,S)+'"';default:throw new n("impossible error: invalid scalar style")}})()}function yn(d,w){let R=fn(d)?String(w):"",_=d[d.length-1]===`
|
|
21
|
+
`;return R+(_&&(d[d.length-2]===`
|
|
22
|
+
`||d===`
|
|
23
|
+
`)?"+":_?"":"-")+`
|
|
24
|
+
`}function wn(d){return d[d.length-1]===`
|
|
25
|
+
`?d.slice(0,-1):d}function _i(d,w){let R=/(\n+)([^\n]*)/g,_=(function(){let O=d.indexOf(`
|
|
26
|
+
`);return O=O!==-1?O:d.length,R.lastIndex=O,Qe(d.slice(0,O),w)})(),x=d[0]===`
|
|
27
|
+
`||d[0]===" ",k,S;for(;S=R.exec(d);){let O=S[1],j=S[2];k=j[0]===" ",_+=O+(!x&&!k&&j!==""?`
|
|
28
|
+
`:"")+Qe(j,w),x=k}return _}function Qe(d,w){if(d===""||d[0]===" ")return d;let R=/ [^ ]/g,_,x=0,k,S=0,O=0,j="";for(;_=R.exec(d);)O=_.index,O-x>w&&(k=S>x?S:O,j+=`
|
|
29
|
+
`+d.slice(x,k),x=k+1),S=O;return j+=`
|
|
30
|
+
`,d.length-x>w&&S>x?j+=d.slice(x,S)+`
|
|
31
|
+
`+d.slice(S+1):j+=d.slice(x),j.slice(1)}function xi(d){let w="",R=0;for(let _=0;_<d.length;R>=65536?_+=2:_++){R=Ge(d,_);let x=pe[R];!x&&st(R)?(w+=d[_],R>=65536&&(w+=d[_+1])):w+=x||We(R)}return w}function vn(d,w,R){let _="",x=d.tag;for(let k=0,S=R.length;k<S;k+=1){let O=R[k];d.replacer&&(O=d.replacer.call(R,String(k),O)),(b(d,w,O,!1,!1)||typeof O>"u"&&b(d,w,null,!1,!1))&&(_!==""&&(_+=","+(d.condenseFlow?"":" ")),_+=d.dump)}d.tag=x,d.dump="["+_+"]"}function $n(d,w,R,_){let x="",k=d.tag;for(let S=0,O=R.length;S<O;S+=1){let j=R[S];d.replacer&&(j=d.replacer.call(R,String(S),j)),(b(d,w+1,j,!0,!0,!1,!0)||typeof j>"u"&&b(d,w+1,null,!0,!0,!1,!0))&&((!_||x!=="")&&(x+=Lt(d,w)),d.dump&&f===d.dump.charCodeAt(0)?x+="-":x+="- ",x+=d.dump)}d.tag=k,d.dump=x||"[]"}function Ei(d,w,R){let _="",x=d.tag,k=Object.keys(R);for(let S=0,O=k.length;S<O;S+=1){let j="";_!==""&&(j+=", "),d.condenseFlow&&(j+='"');let q=k[S],F=R[q];d.replacer&&(F=d.replacer.call(R,q,F)),b(d,w,q,!1,!1)&&(d.dump.length>1024&&(j+="? "),j+=d.dump+(d.condenseFlow?'"':"")+":"+(d.condenseFlow?"":" "),b(d,w,F,!1,!1)&&(j+=d.dump,_+=j))}d.tag=x,d.dump="{"+_+"}"}function o(d,w,R,_){let x="",k=d.tag,S=Object.keys(R);if(d.sortKeys===!0)S.sort();else if(typeof d.sortKeys=="function")S.sort(d.sortKeys);else if(d.sortKeys)throw new n("sortKeys must be a boolean or a function");for(let O=0,j=S.length;O<j;O+=1){let q="";(!_||x!=="")&&(q+=Lt(d,w));let F=S[O],Q=R[F];if(d.replacer&&(Q=d.replacer.call(R,F,Q)),!b(d,w+1,F,!0,!0,!0))continue;let le=d.tag!==null&&d.tag!=="?"||d.dump&&d.dump.length>1024;le&&(d.dump&&f===d.dump.charCodeAt(0)?q+="?":q+="? "),q+=d.dump,le&&(q+=Lt(d,w)),b(d,w+1,Q,!0,le)&&(d.dump&&f===d.dump.charCodeAt(0)?q+=":":q+=": ",q+=d.dump,x+=q)}d.tag=k,d.dump=x||"{}"}function g(d,w,R){let _=R?d.explicitTypes:d.implicitTypes;for(let x=0,k=_.length;x<k;x+=1){let S=_[x];if((S.instanceOf||S.predicate)&&(!S.instanceOf||typeof w=="object"&&w instanceof S.instanceOf)&&(!S.predicate||S.predicate(w))){if(R?S.multi&&S.representName?d.tag=S.representName(w):d.tag=S.tag:d.tag="?",S.represent){let O=d.styleMap[S.tag]||S.defaultStyle,j;if(s.call(S.represent)==="[object Function]")j=S.represent(w,O);else if(a.call(S.represent,O))j=S.represent[O](w,O);else throw new n("!<"+S.tag+'> tag resolver accepts not "'+O+'" style');d.dump=j}return!0}}return!1}function b(d,w,R,_,x,k,S){d.tag=null,d.dump=R,g(d,R,!1)||g(d,R,!0);let O=s.call(d.dump),j=_;_&&(_=d.flowLevel<0||d.flowLevel>w);let q=O==="[object Object]"||O==="[object Array]",F,Q;if(q&&(F=d.duplicates.indexOf(R),Q=F!==-1),(d.tag!==null&&d.tag!=="?"||Q||d.indent!==2&&w>0)&&(x=!1),Q&&d.usedDuplicates[F])d.dump="*ref_"+F;else{if(q&&Q&&!d.usedDuplicates[F]&&(d.usedDuplicates[F]=!0),O==="[object Object]")_&&Object.keys(d.dump).length!==0?(o(d,w,d.dump,x),Q&&(d.dump="&ref_"+F+d.dump)):(Ei(d,w,d.dump),Q&&(d.dump="&ref_"+F+" "+d.dump));else if(O==="[object Array]")_&&d.dump.length!==0?(d.noArrayIndent&&!S&&w>0?$n(d,w-1,d.dump,x):$n(d,w,d.dump,x),Q&&(d.dump="&ref_"+F+d.dump)):(vn(d,w,d.dump),Q&&(d.dump="&ref_"+F+" "+d.dump));else if(O==="[object String]")d.tag!=="?"&&bi(d,d.dump,w,k,j);else{if(O==="[object Undefined]")return!1;if(d.skipInvalid)return!1;throw new n("unacceptable kind of an object to dump "+O)}if(d.tag!==null&&d.tag!=="?"){let le=encodeURI(d.tag[0]==="!"?d.tag.slice(1):d.tag).replace(/!/g,"%21");d.tag[0]==="!"?le="!"+le:le.slice(0,18)==="tag:yaml.org,2002:"?le="!!"+le.slice(18):le="!<"+le+">",d.dump=le+" "+d.dump}}return!0}function E(d,w){let R=[],_=[];$(d,R,_);let x=_.length;for(let k=0;k<x;k+=1)w.duplicates.push(R[_[k]]);w.usedDuplicates=new Array(x)}function $(d,w,R){if(d!==null&&typeof d=="object"){let _=w.indexOf(d);if(_!==-1)R.indexOf(_)===-1&&R.push(_);else if(w.push(d),Array.isArray(d))for(let x=0,k=d.length;x<k;x+=1)$(d[x],w,R);else{let x=Object.keys(d);for(let k=0,S=x.length;k<S;k+=1)$(d[x[k]],w,R)}}}function C(d,w){w=w||{};let R=new $i(w);R.noRefs||E(d,R);let _=d;return R.replacer&&(_=R.replacer.call({"":_},"",_)),b(R,0,_,!0,!0)?R.dump+`
|
|
32
|
+
`:""}e.exports.dump=C})),Na=bf(se(((t,e)=>{var r=xf(),n=Ef();function i(s,a){return function(){throw new Error("Function yaml."+s+" is removed in js-yaml 4. Use yaml."+a+" instead, which is now safe by default.")}}e.exports.Type=be(),e.exports.Schema=ga(),e.exports.FAILSAFE_SCHEMA=$a(),e.exports.JSON_SCHEMA=Sa(),e.exports.CORE_SCHEMA=Pa(),e.exports.DEFAULT_SCHEMA=Pi(),e.exports.load=r.load,e.exports.loadAll=r.loadAll,e.exports.dump=n.dump,e.exports.YAMLException=$r(),e.exports.types={binary:Ia(),float:Ea(),map:va(),null:ba(),pairs:Ta(),set:Aa(),timestamp:ka(),bool:_a(),int:xa(),merge:Ra(),omap:Ca(),seq:wa(),str:ya()},e.exports.safeLoad=i("safeLoad","load"),e.exports.safeLoadAll=i("safeLoadAll","loadAll"),e.exports.safeDump=i("safeDump","dump")}))(),1),{Type:W$,Schema:Y$,FAILSAFE_SCHEMA:G$,JSON_SCHEMA:X$,CORE_SCHEMA:Q$,DEFAULT_SCHEMA:Z$,load:eb,loadAll:tb,dump:rb,YAMLException:nb,types:ib,safeLoad:ob,safeLoadAll:sb,safeDump:ab}=Na.default,Oe=Na.default});import{access as ub,readFile as ja}from"node:fs/promises";import{dirname as Sf,relative as fb,resolve as me}from"node:path";async function at(t){let e=me(t),r=await ja(e,"utf-8"),n=Oe.load(r);return Pf(e,n)}function Pf(t,e){let r=Ie(t);return{...e,openapi:me(r,e.openapi),bindings:me(r,e.bindings),microContractsConfig:me(r,e.microContractsConfig),viewsDir:me(r,e.viewsDir),generated:{contractDir:me(r,e.generated.contractDir),actions:me(r,e.generated.actions),bridge:me(r,e.generated.bridge),reactDir:me(r,e.generated.reactDir)},runtimeModule:e.runtimeModule?me(r,e.runtimeModule):e.componentsModule?me(r,e.componentsModule):void 0,themeModule:e.themeModule?me(r,e.themeModule):void 0,design:e.design?{tokens:e.design.tokens?me(r,e.design.tokens):void 0,theme:e.design.theme?me(r,e.design.theme):void 0,extensionsCss:e.design.extensionsCss?me(r,e.design.extensionsCss):void 0}:void 0,extensions:e.extensions?me(r,e.extensions):void 0}}async function Oa(t){let e=await ja(me(t),"utf-8");return Oe.load(e)}function Ie(t){return Sf(me(t))}function bn(t){let e=t.design?.tokens,r=t.design?.theme;if(!e)throw new Error("view-contracts.config.yaml must define design.tokens (project tokens file path).");if(!r)throw new Error("view-contracts.config.yaml must define design.theme (project theme file path).");return{tokensPath:e,themePath:r}}var $t=ne(()=>{"use strict";Ht()});import{readFileSync as kf}from"node:fs";import{createRequire as Rf}from"node:module";import{dirname as ki,resolve as If}from"node:path";import{fileURLToPath as Cf}from"node:url";function Ze(){if(Ut)return Ut;let t=Rf(import.meta.url);try{return Ut=ki(t.resolve("view-contracts/package.json")),Ut}catch{let e=ki(Cf(import.meta.url));for(;;){try{let n=If(e,"package.json");if(JSON.parse(kf(n,"utf8")).name==="view-contracts")return Ut=e,Ut}catch{}let r=ki(e);if(r===e)break;e=r}throw new Error("view-contracts package root not found")}}var Ut,br=ne(()=>{"use strict"});import{resolve as Ma}from"node:path";function Tf(){return Ma(Ze(),"renderers/react/runtime")}function _n(){return Ma(Tf(),"structural.css")}var Ri=ne(()=>{"use strict";br()});import{readFile as Af}from"node:fs/promises";import{extname as Nf,resolve as jf}from"node:path";async function xn(t){let e=jf(t),r=await Af(e,"utf-8"),n=Nf(e).toLowerCase();if(n===".json")return JSON.parse(r);if(n===".yaml"||n===".yml")return Oe.load(r);throw new Error(`Unsupported design file extension "${n}" (expected .yaml, .yml, or .json): ${e}`)}var Ii=ne(()=>{"use strict";Ht()});var En,He,Kt,Sn,he,Bt,bt=ne(()=>{"use strict";En=["color","dimension","shadow","typography","layout"],He=class extends Error{constructor(e){super(e),this.name="DesignTokenError"}},Kt=["background","foreground","radius","padding","shadow","typography","display","gridTemplateColumns","minHeight","maxWidth","width","height","margin","border","borderColor","flexDirection","fontWeight","fontSize","alignItems","justifyContent"],Sn={background:["color"],foreground:["color"],radius:["dimension","layout"],padding:["dimension","layout"],shadow:["shadow"],typography:["typography"],display:["layout"],gridTemplateColumns:["layout"],minHeight:["dimension","layout"],maxWidth:["dimension","layout"],width:["dimension","layout"],height:["dimension","layout"],margin:["dimension","layout"],border:["layout"],borderColor:["color"],flexDirection:["layout"],fontWeight:["layout"],fontSize:["dimension","layout"],alignItems:["layout"],justifyContent:["layout"]},he=class extends Error{constructor(e){super(e),this.name="DesignThemeError"}},Bt=class extends Error{constructor(e){super(e),this.name="DesignConstraintError"}}});function Jt(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Mf(t){if(!Kt.includes(t))throw new he(`Unknown variant property "${t}" (expected ${Kt.join(", ")})`);return t}function Vf(t,e,r){if(typeof t!="string")throw new he(`${e}.${r} must be a token reference string like "{ui.primary}"`);let n=t.match(Of);if(!n)throw new he(`${e}.${r} must be a token reference like "{ui.primary}", got "${t}"`);return n[1]}function Va(t,e){let r={};for(let[n,i]of Object.entries(e)){let s=Mf(n),a=Vf(i,t,n);r[s]={ref:a,accepts:[...Sn[s]]}}return r}function qf(t){if(t===void 0)return{};if(!Jt(t))throw new he('Theme "defaults" must be an object');let e={};for(let[r,n]of Object.entries(t)){if(!Jt(n))throw new he(`Theme defaults for "${r}" must be an object`);e[r]=Va(`defaults.${r}`,n)}return e}function Ci(t){if(!Jt(t))throw new he("Theme document must be a YAML/JSON object");let e=t.variants;if(!Jt(e))throw new he('Theme document must contain a "variants" object');let r={};for(let[n,i]of Object.entries(e)){if(!Jt(i))throw new he(`Theme variants for "${n}" must be an object`);let s={};for(let[a,c]of Object.entries(i)){if(!Jt(c))throw new he(`Theme variant "${n}.${a}" must be an object`);s[a]=Va(`${n}.${a}`,c)}r[n]=s}return{defaults:qf(t.defaults),variants:r}}var Of,Ti=ne(()=>{"use strict";bt();Of=/^\{([^}]+)\}$/});function _r(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Lf(t){return`--${t.replace(/\./g,"-")}`}function Ff(t,e){if(typeof t!="string"||!En.includes(t))throw new He(`Token "${e}" has unsupported $type "${String(t)}" (expected ${En.join(", ")})`);return t}function qa(t,e,r){if(_r(t)){if("$type"in t&&"$value"in t){r.push({path:e,type:Ff(t.$type,e),rawValue:t.$value});return}for(let[n,i]of Object.entries(t)){if(n.startsWith("$"))continue;let s=e?`${e}.${n}`:n;qa(i,s,r)}}}function zf(t,e){if(typeof e=="string")return e;if(t==="typography"&&_r(e)){if(typeof e.fontFamily=="string")return e.fontFamily;let r=[e.fontWeight,e.fontStyle,e.fontSize,e.lineHeight,e.fontFamily].filter(n=>n!=null);if(r.length>0)return r.map(String).join(" ")}if(t==="shadow"&&Array.isArray(e))return e.map(r=>_r(r)?`${r.offsetX??0} ${r.offsetY??0} ${r.blur??0} ${r.color??"transparent"}`:String(r)).join(", ");if(t==="shadow"&&_r(e))return`${e.offsetX??0} ${e.offsetY??0} ${e.blur??0} ${e.color??"transparent"}`;throw new He(`Token value for "${t}" must be a string or supported object`)}function Hf(t){return typeof t!="string"?null:t.match(Df)?.[1]??null}function Da(t,e,r,n,i){let s=Hf(e);if(!s){let l=r.get(t);if(!l)throw new He(`Unknown token path "${t}"`);return{value:zf(l.type,e)}}if(n.has(t))throw new He(`Circular token reference detected at "${t}"`);let a=r.get(s);if(!a)throw new He(`Token "${t}" references unknown token "{${s}}"`);if(i.has(s))return{value:i.get(s),ref:s};n.add(t);let c=Da(s,a.rawValue,r,n,i);return n.delete(t),i.set(s,c.value),{value:c.value,ref:s}}function Ai(t){if(!_r(t))throw new He("Token document must be a YAML/JSON object");let e=[];qa(t,"",e);let r=new Map(e.map(s=>[s.path,s])),n=new Map,i=[];for(let s of e){let{value:a,ref:c}=Da(s.path,s.rawValue,r,new Set,n);n.set(s.path,a),i.push({path:s.path,type:s.type,value:a,cssVar:Lf(s.path),ref:c})}return{entries:i}}var Df,Ni=ne(()=>{"use strict";bt();Df=/^\{([^}]+)\}$/});function Fa(t){return kn[t]?.properties??[]}function za(t,e){let r=kn[e];return r?r.properties.includes(t):!1}var Pn,kn,et,La,Ab,ct=ne(()=>{"use strict";Pn={id:{type:"string",category:"identity",lowering:"attribute",description:"Stable identifier for tests and diff updates"},role:{type:"string",category:"identity",lowering:"attribute",enum:"role",description:"Accessibility semantics (not HTML tag names)"},label:{type:"string",category:"identity",lowering:"attribute",description:"Accessible name; required for IconButton"},visible:{type:"boolean",category:"state",lowering:"none",description:"Show or omit from render tree"},enabled:{type:"boolean",category:"state",lowering:"attribute"},selected:{type:"boolean",category:"state",lowering:"attribute"},checked:{type:"boolean",category:"state",lowering:"attribute"},readonly:{type:"boolean",category:"state",lowering:"attribute"},required:{type:"boolean",category:"state",lowering:"attribute"},width:{type:["string","number"],category:"size",lowering:"inline-css",enum:"widthSize",notes:"string: wrap|fill; number: fixed px/dp/pt; flex ratio uses weight property"},height:{type:["string","number"],category:"size",lowering:"inline-css",enum:"heightSize",notes:"string: wrap|fill; number: fixed px/dp/pt; flex ratio uses weight property"},minWidth:{type:"number",category:"size",lowering:"inline-css"},maxWidth:{type:["string","number"],category:"size",lowering:"inline-css",notes:"number or fill"},minHeight:{type:"number",category:"size",lowering:"inline-css"},maxHeight:{type:["string","number"],category:"size",lowering:"inline-css",notes:"number or fill"},aspectRatio:{type:"number",category:"size",lowering:"inline-css"},weight:{type:"number",category:"size",lowering:"inline-css",notes:"Flex ratio among Row/Column direct children; Spacer is the primary use case"},padding:{type:["string","number"],category:"spacing",lowering:"inline-css",notes:"space token or per-side"},gap:{type:["string","number"],category:"spacing",lowering:"inline-css"},align:{type:"string",category:"alignment",lowering:"inline-css",enum:"align"},justify:{type:"string",category:"alignment",lowering:"inline-css",enum:"justify"},selfAlign:{type:"string",category:"alignment",lowering:"inline-css",enum:"align"},contentAlign:{type:"string",category:"alignment",lowering:"inline-css",enum:"contentAlign"},axis:{type:"string",category:"direction",lowering:"inline-css",enum:"axis"},direction:{type:"string",category:"direction",lowering:"attribute",enum:"direction",description:"Text/layout direction; set at app or screen root, not per layout container"},scroll:{type:"string",category:"overflow",lowering:"inline-css",enum:"scroll"},background:{type:"string",category:"visual",lowering:"inline-css",notes:"color token"},foreground:{type:"string",category:"visual",lowering:"inline-css",notes:"color token"},border:{type:["string","object"],category:"visual",lowering:"inline-css",enum:"border",notes:"none|token|{width,color}"},separator:{type:"number",category:"visual",lowering:"inline-css",notes:"Row separator width in px/dp/pt (0=off)"},separatorColor:{type:"string",category:"visual",lowering:"inline-css",notes:"Row separator color token"},radius:{type:"string",category:"visual",lowering:"inline-css",notes:"radius token"},shadow:{type:"string",category:"visual",lowering:"inline-css",enum:"shadow"},opacity:{type:"number",category:"visual",lowering:"inline-css",notes:"0..1"},clip:{type:"string",category:"visual",lowering:"inline-css",enum:"clip"},textStyle:{type:"string",category:"text",lowering:"inline-css",notes:"typography token"},textAlign:{type:"string",category:"text",lowering:"inline-css",enum:"textAlign"},lineLimit:{type:["string","number"],category:"text",lowering:"inline-css",enum:"lineLimit"},textOverflow:{type:"string",category:"text",lowering:"inline-css",enum:"textOverflow"},fontWeight:{type:"string",category:"text",lowering:"inline-css",enum:"fontWeight"},size:{type:"number",category:"text",lowering:"inline-css",notes:"Font size shorthand (px/dp/pt)"},fit:{type:"string",category:"image",lowering:"inline-css",enum:"imageFit"},src:{type:"string",category:"image",lowering:"attribute",description:"Image source URL or asset reference"},alt:{type:"string",category:"image",lowering:"attribute",description:"Alternative text; not a source reference"},name:{type:"string",category:"image",lowering:"attribute",description:"Icon token or asset name in the renderer icon set"},onClick:{type:"action",category:"interaction",lowering:"none",description:"Action id, not arbitrary code"},onSubmit:{type:"action",category:"interaction",lowering:"none",description:"Form submit/validation action id"},onChange:{type:"action",category:"interaction",lowering:"none"},focusable:{type:"boolean",category:"interaction",lowering:"attribute"},autoFocus:{type:"boolean",category:"interaction",lowering:"attribute"},keyboardType:{type:"string",category:"interaction",lowering:"attribute",enum:"keyboardType"},value:{type:["string","number","boolean"],category:"data",lowering:"attribute"},binding:{type:"string",category:"data",lowering:"none",description:"ViewModel or form state field identifier"},placeholder:{type:"string",category:"data",lowering:"attribute"},options:{type:"array",category:"data",lowering:"none",notes:"array<{value,label}>"},error:{type:["string","null"],category:"validation",lowering:"none"},help:{type:["string","null"],category:"validation",lowering:"none"},variant:{type:"string",category:"visual",lowering:"class-name",notes:"design token variant"},theme:{type:"string",category:"visual",lowering:"class-name",notes:"active theme id for runtime theme switching"},display:{type:"string",category:"layout",lowering:"inline-css",notes:"CSS display value (grid, flex, etc.)"},gridTemplateColumns:{type:"string",category:"layout",lowering:"inline-css",notes:"CSS grid-template-columns"},flexDirection:{type:"string",category:"layout",lowering:"inline-css",notes:"CSS flex-direction"},alignItems:{type:"string",category:"alignment",lowering:"inline-css",notes:"CSS align-items"},margin:{type:["string","number"],category:"spacing",lowering:"inline-css",notes:"space token or per-side"},borderColor:{type:"string",category:"visual",lowering:"inline-css",notes:"border color token"},fontSize:{type:["string","number"],category:"text",lowering:"inline-css",notes:"CSS font-size"},flex:{type:"number",category:"size",lowering:"inline-css",description:"Flex grow ratio for proportional sizing in table columns/cells"},each:{type:"string",category:"data",lowering:"none",description:"Iterator variable name for data-bound row repetition"},source:{type:"string",category:"data",lowering:"none",description:"ViewModel array binding for data-driven elements"},headerVisible:{type:"boolean",category:"state",lowering:"attribute"}},kn={App:{description:"App root; holds theme/token/navigation context",tier:"core",category:"structure",notes:"Optional; not required for single-screen DSL",properties:["id","padding","direction","theme","variant"],children:{kind:"list",items:["Page"]}},Page:{description:"Screen root; viewport and safe-area boundary",tier:"core",category:"structure",properties:["id","visible","padding","direction","variant"],children:{kind:"list",items:["Column","Row","Stack","Box"]}},SafeArea:{description:"Insets for OS/browser safe areas",tier:"core",category:"structure",properties:["id","padding","variant"],children:{kind:"list",items:["Box","Column","Row"]}},Box:{description:"Single region; background, bounds, child placement",tier:"core",category:"layout",properties:["id","visible","width","height","minWidth","maxWidth","minHeight","maxHeight","padding","margin","gap","contentAlign","background","foreground","border","borderColor","radius","shadow","opacity","clip","selfAlign","display","gridTemplateColumns","flexDirection","variant"],children:{kind:"any"}},Row:{description:"Horizontal child layout",tier:"core",category:"layout",properties:["id","visible","gap","align","justify","padding","width","height","minWidth","maxWidth","minHeight","maxHeight","variant"],children:{kind:"any"}},Column:{description:"Vertical child layout",tier:"core",category:"layout",properties:["id","visible","gap","align","justify","padding","width","height","minWidth","maxWidth","minHeight","maxHeight","variant"],children:{kind:"any"}},Stack:{description:"Overlay children by z-order (not absolute positioning)",tier:"core",category:"layout",properties:["id","visible","gap","contentAlign","padding","width","height","background","variant"],children:{kind:"any"}},Spacer:{description:"Occupies remaining flex space",tier:"core",category:"layout",notes:"Direct child of Row/Column only",properties:["id","width","height","weight","variant"],children:{kind:"none"}},Divider:{description:"Horizontal or vertical separator",tier:"core",category:"layout",properties:["id","axis","variant"],children:{kind:"none"}},ScrollArea:{description:"Internal scroll boundary",tier:"core",category:"scroll",properties:["id","axis","scroll","width","height","minHeight","maxHeight","padding","variant"],children:{kind:"single"}},List:{description:"Homogeneous list of items",tier:"core",category:"scroll",properties:["id","gap","axis","role","visible","variant"],children:{kind:"list",items:["ListItem"]}},ListItem:{description:"One row/cell in a list",tier:"core",category:"scroll",properties:["id","selected","padding","gap","role","visible","variant"],children:{kind:"any"}},Text:{description:"Text display",tier:"core",category:"text",properties:["id","visible","textStyle","textAlign","lineLimit","textOverflow","fontWeight","fontSize","size","foreground","background","opacity","padding","radius","display","alignItems","role","variant"],children:{kind:"text"}},Link:{description:"Navigable text or region",tier:"optional",category:"text",properties:["id","visible","onClick","label","foreground","role","variant"],children:{kind:"text"}},Image:{description:"Image display",tier:"core",category:"media",properties:["id","visible","src","fit","alt","width","height","aspectRatio","radius","variant"],children:{kind:"none"}},Icon:{description:"Icon display; asset set referenced by name token at renderer",tier:"core",category:"media",properties:["id","visible","name","alt","foreground","opacity","variant"],children:{kind:"none"}},Button:{description:"Pressable action; label or children required (label is a11y name when both present)",tier:"core",category:"input",properties:["id","visible","enabled","onClick","label","foreground","background","radius","padding","shadow","border","borderColor","fontWeight","fontSize","variant","role"],children:{kind:"list",items:["Text","Icon","Row"]}},IconButton:{description:"Icon-primary button; label required for accessibility",tier:"optional",category:"input",properties:["id","visible","enabled","onClick","label","foreground","background","radius","padding","variant"],children:{kind:"list",items:["Icon"]}},TextInput:{description:"Single-line text input",tier:"core",category:"input",properties:["id","visible","enabled","readonly","required","value","binding","placeholder","onChange","error","help","keyboardType","focusable","autoFocus","width","label","foreground","background","radius","padding","border","borderColor","minHeight","fontSize","variant"],children:{kind:"none"}},TextArea:{description:"Multi-line text input",tier:"core",category:"input",properties:["id","visible","enabled","readonly","required","value","binding","placeholder","onChange","error","help","focusable","width","minHeight","label","foreground","background","radius","padding","border","borderColor","fontSize","variant"],children:{kind:"none"}},Select:{description:"Single selection",tier:"core",category:"input",properties:["id","visible","enabled","required","value","binding","options","onChange","error","help","width","label","foreground","background","radius","padding","border","borderColor","minHeight","fontSize","variant"],children:{kind:"none"}},Checkbox:{description:"Boolean or multi-select toggle",tier:"core",category:"input",properties:["id","visible","enabled","checked","required","binding","label","onChange","variant"],children:{kind:"none"}},Radio:{description:"Single choice in a group (use Row/Column to group; binding identifies group)",tier:"core",category:"input",notes:"RadioGroup is expressed via layout Group, not a separate element",properties:["id","visible","enabled","checked","binding","label","value","onChange","variant"],children:{kind:"none"}},Switch:{description:"On/off toggle",tier:"core",category:"input",properties:["id","visible","enabled","checked","binding","label","onChange","variant"],children:{kind:"none"}},Form:{description:"Input group submit/validation boundary",tier:"core",category:"form",properties:["id","visible","gap","onSubmit","variant"],children:{kind:"any"}},Field:{description:"label/help/error/input unit",tier:"core",category:"form",properties:["id","visible","label","help","error","required","gap","variant"],children:{kind:"any"}},Modal:{description:"Primary transient dialog",tier:"core",category:"overlay",notes:"Direct child of Page or App; role defaults to dialog at renderer",properties:["id","visible","role","autoFocus","variant"],children:{kind:"list",items:["Box","Column"]}},Drawer:{description:"Edge panel overlay",tier:"extension",category:"overlay",notes:"Placement limited to start/end/bottom at renderer",properties:["id","visible","variant"],children:{kind:"list",items:["Box","Column"]}},Popover:{description:"Small anchored panel",tier:"extension",category:"overlay",properties:["id","visible","variant"],children:{kind:"list",items:["Box","Column"]}},Tooltip:{description:"Supplementary description",tier:"extension",category:"overlay",properties:["id","visible","label","variant"],children:{kind:"text"}},Progress:{description:"Determinate progress",tier:"core",category:"feedback",properties:["id","visible","value","variant"],children:{kind:"none"}},Spinner:{description:"Indeterminate loading",tier:"core",category:"feedback",properties:["id","visible","variant"],children:{kind:"none"}},Table:{description:"Data table with header and repeated rows",tier:"core",category:"data",properties:["id","visible","source","gap","border","borderColor","separator","separatorColor","variant"],children:{kind:"list",items:["TableHeader","TableRow"]}},TableHeader:{description:"Table header row defining column labels",tier:"core",category:"data",properties:["height","border","borderColor","background","alignItems","variant"],children:{kind:"list",items:["TableColumn"]}},TableColumn:{description:"Header cell definition; children override label text",tier:"core",category:"data",properties:["label","width","flex","align","border","borderColor","padding","fontSize","fontWeight","foreground","variant"],children:{kind:"any"}},TableRow:{description:"Row template repeated for each source item",tier:"core",category:"data",properties:["each","height","border","borderColor","alignItems","variant"],children:{kind:"list",items:["TableCell"]}},TableCell:{description:"Data cell; children define cell content",tier:"core",category:"data",properties:["width","flex","align","border","borderColor","padding","fontSize","foreground","variant"],children:{kind:"any"}}},et=new Set(Object.keys(kn)),La=new Set(Object.entries(Pn).filter(([,t])=>t.lowering==="inline-css").map(([t])=>t)),Ab=new Set(Object.entries(Pn).filter(([,t])=>t.lowering==="class-name").map(([t])=>t))});function ji(t){let e=Fa(t),r=new Set;for(let n of e)Kt.includes(n)&&r.add(n);return r}var Ha=ne(()=>{"use strict";ct();bt()});function Uf(t){return new Map(t.entries.map(e=>[e.path,e]))}function Ua(t,e,r,n,i){for(let[s,a]of Object.entries(r)){let c=Sn[s];if(!c)throw new he(`Unknown variant property "${s}" on ${t}`);if(!n.has(s))throw new he(`Property "${s}" is not allowed for ${e} in ${t}`);let l=i.get(a.ref);if(!l)throw new he(`${t}.${s} references unknown token "{${a.ref}}"`);if(!c.includes(l.type))throw new he(`${t}.${s} requires a ${c.join(" or ")} token, but "{${a.ref}}" is ${l.type}`)}}function Ba(t,e){let r=Uf(t);for(let[n,i]of Object.entries(e.defaults)){let s=ji(n);Ua(`defaults.${n}`,n,i,s,r)}for(let[n,i]of Object.entries(e.variants)){let s=ji(n);for(let[a,c]of Object.entries(i))Ua(`variants.${n}.${a}`,n,c,s,r)}}function Oi(t,e){Ba(t,e)}var Mi=ne(()=>{"use strict";bt();Ha()});function Vi(t){let e=[":root {"];for(let r of t.entries)e.push(` ${r.cssVar}: ${r.value};`);return e.push("}"),e.join(`
|
|
33
|
+
`)}var Ka=ne(()=>{"use strict"});var Rn,qi=ne(()=>{"use strict";Rn={background:"background-color",foreground:"color",radius:"border-radius",padding:"padding",shadow:"box-shadow",typography:"font",display:"display",gridTemplateColumns:"grid-template-columns",minHeight:"min-height",maxWidth:"max-width",width:"width",height:"height",margin:"margin",border:"border",borderColor:"border-color",flexDirection:"flex-direction",fontWeight:"font-weight",fontSize:"font-size",alignItems:"align-items",justifyContent:"justify-content"}});function In(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Cn(t,e){let r=t.entries.find(n=>n.path===e);if(!r)throw new Error(`Token reference "${e}" not found while emitting theme CSS`);return r.cssVar}var Di=ne(()=>{"use strict"});function Li(t,e){let r=[];for(let[n,i]of Object.entries(e.defaults)){let s=In(n),a=[];for(let[c,l]of Object.entries(i)){let f=Rn[c];if(!f){console.warn(`[view-contracts] CSS theme: variant property "${c}" has no CSS mapping. Add it to cssPropertyMap.ts.`);continue}let p=Cn(t,l.ref);a.push(` ${f}: var(${p});`)}a.length!==0&&r.push(`.vc-${s} {
|
|
34
|
+
${a.join(`
|
|
35
|
+
`)}
|
|
36
|
+
}`)}return r.join(`
|
|
37
|
+
|
|
38
|
+
`)}var Ja=ne(()=>{"use strict";qi();Di()});function Fi(t,e){let r=[];for(let[n,i]of Object.entries(e.variants)){let s=In(n);for(let[a,c]of Object.entries(i)){let l=[];for(let[f,p]of Object.entries(c)){let u=Rn[f];if(!u){console.warn(`[view-contracts] CSS theme: variant property "${f}" has no CSS mapping. Add it to cssPropertyMap.ts.`);continue}let m=Cn(t,p.ref);l.push(` ${u}: var(${m});`)}l.length!==0&&r.push(`.vc-${s}--${a} {
|
|
39
|
+
${l.join(`
|
|
40
|
+
`)}
|
|
41
|
+
}`)}}return r.join(`
|
|
42
|
+
|
|
43
|
+
`)}var Wa=ne(()=>{"use strict";qi();Di()});function Ya(t){return typeof t=="object"&&t!==null&&"kind"in t&&t.kind==="binding"}function Bf(t){if(t.variant!==void 0)return t.variant;if(t.tone!==void 0)return t.tone}function Ga(t,e,r,n,i,s){let a=r.variants[t];if(!a){e!==void 0&&!Ya(e)&&typeof e=="string"&&i.push(`${n}: <${t}> references variant "${e}" but no variants are defined for ${t} in theme.yaml`);return}if(e===void 0||Ya(e)||typeof e!="string")return;(s?.mapMutedToDefault&&e==="muted"?"default":e)in a||i.push(`${n}: <${t}> references unknown variant "${e}" (not defined in theme.yaml)`)}function Tn(t,e,r,n){if(t.kind==="component"){let i=Bf(t.props);t.props.variant!==void 0?Ga(t.name,t.props.variant,e,r,n):i!==void 0&&t.name in e.variants&&Ga(t.name,i,e,r,n,{mapMutedToDefault:!0});for(let s of t.children)Tn(s,e,r,n);return}if(t.kind==="map"){Tn(t.body,e,r,n);return}if(t.kind==="fragment"){for(let i of t.children)Tn(i,e,r,n);return}t.kind}function zi(t,e){let r=[];for(let n of t)Tn(n.root,e,n.source,r);if(r.length>0)throw new Error(`View variant validation failed:
|
|
44
|
+
${r.map(n=>` - ${n}`).join(`
|
|
45
|
+
`)}`)}var Xa=ne(()=>{"use strict"});function Hi(t,e){return[...new Set([...t.matchAll(e)].map(r=>r[0]))]}function Qa(t,e,r){let n=e.slice(0,5).map(s=>` - ${t}: ${s}`).join(`
|
|
46
|
+
`),i=e.length>5?`
|
|
47
|
+
\u2026 and ${e.length-5} more`:"";return`${r}
|
|
48
|
+
${n}${i}`}function Ui(t,e){let r=Hi(t,Kf);if(r.length!==0)throw new Bt(Qa(e,r,".vc-* selectors are reserved for DSL output (theme.yaml variants + package structural CSS). Use project-owned class names (e.g. ext-*) in extension CSS."))}function Bi(t,e){let r=Hi(t,Jf),n=Hi(t,Wf),i=[...r,...n];if(i.length!==0)throw new Bt(Qa(e,i,".vc-* class names are reserved for DSL lowering output. Extension components must use project-owned class names (e.g. ext-*) in src/components/."))}var Kf,Jf,Wf,Ki=ne(()=>{"use strict";bt();Kf=/\.vc-[a-z][\w-]*/g,Jf=/(?:className\s*=\s*(?:"vc-[^"]*"|'vc-[^']*'|\{`[^`]*\bvc-[^`]*`\}|\{"vc-[^"]*"\}|\{'vc-[^']*'\})|["'`]vc-[a-z][\w-]*["'`])/g,Wf=/\bextensionClassName\s*\(/g});import{readFile as Za,stat as Yf}from"node:fs/promises";import{resolve as Gf}from"node:path";async function ec(t){try{return await Yf(t),!0}catch{return!1}}async function xr(t,e){let r=t.design?.extensionsCss;r&&await ec(r)&&Ui(await Za(r,"utf-8"),r);let n=Ie(e);for(let i of["extensions.tsx","extensions.ts"]){let s=Gf(n,"src/components",i);await ec(s)&&Bi(await Za(s,"utf-8"),s)}}var tc=ne(()=>{"use strict";$t();Ki()});async function Xf(t){let e=await xn(t);return Ai(e)}async function Qf(t){let e=await xn(t);return Ci(e)}async function An(t,e){let r=await Xf(t),n=await Qf(e);return Oi(r,n),{tokenIR:r,themeIR:n}}var Ji=ne(()=>{"use strict";Ii();Ti();Ni();Mi();Ka();Ja();Wa();Ii();Ti();Ni();Mi();Xa();Ki();tc();Yi();bt()});import{readFile as rc,stat as Zf}from"node:fs/promises";async function ep(t){try{return await Zf(t),!0}catch{return!1}}async function Wi(t,e){let r=Ie(e),{tokensPath:n,themePath:i}=bn(t),{tokenIR:s,themeIR:a}=await An(n,i);await xr(t,e);let c=await rc(_n(),"utf-8"),l=Li(s,a),f=Fi(s,a),p=`${Vi(s)}
|
|
49
|
+
|
|
50
|
+
${c.trim()}`;l&&(p+=`
|
|
51
|
+
|
|
52
|
+
${l}`),p+=`
|
|
53
|
+
|
|
54
|
+
${f}`;let u=t.design?.extensionsCss;return u&&await ep(u)&&(p+=`
|
|
55
|
+
|
|
56
|
+
${await rc(u,"utf-8")}`),p}var Yi=ne(()=>{"use strict";$t();Ri();Ji()});var Ir=T(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.regexpCode=te.getEsmExportName=te.getProperty=te.safeStringify=te.stringify=te.strConcat=te.addCodeArg=te.str=te._=te.nil=te._Code=te.Name=te.IDENTIFIER=te._CodeOrName=void 0;var kr=class{};te._CodeOrName=kr;te.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var _t=class extends kr{constructor(e){if(super(),!te.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};te.Name=_t;var Ce=class extends kr{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof _t&&(r[n.str]=(r[n.str]||0)+1),r),{})}};te._Code=Ce;te.nil=new Ce("");function wc(t,...e){let r=[t[0]],n=0;for(;n<e.length;)oo(r,e[n]),r.push(t[++n]);return new Ce(r)}te._=wc;var io=new Ce("+");function vc(t,...e){let r=[Rr(t[0])],n=0;for(;n<e.length;)r.push(io),oo(r,e[n]),r.push(io,Rr(t[++n]));return yp(r),new Ce(r)}te.str=vc;function oo(t,e){e instanceof Ce?t.push(...e._items):e instanceof _t?t.push(e):t.push($p(e))}te.addCodeArg=oo;function yp(t){let e=1;for(;e<t.length-1;){if(t[e]===io){let r=wp(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function wp(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof _t||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof _t))return`"${t}${e.slice(1)}`}function vp(t,e){return e.emptyStr()?t:t.emptyStr()?e:vc`${t}${e}`}te.strConcat=vp;function $p(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Rr(Array.isArray(t)?t.join(","):t)}function bp(t){return new Ce(Rr(t))}te.stringify=bp;function Rr(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}te.safeStringify=Rr;function _p(t){return typeof t=="string"&&te.IDENTIFIER.test(t)?new Ce(`.${t}`):wc`[${t}]`}te.getProperty=_p;function xp(t){if(typeof t=="string"&&te.IDENTIFIER.test(t))return new Ce(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}te.getEsmExportName=xp;function Ep(t){return new Ce(t.toString())}te.regexpCode=Ep});var co=T(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.ValueScope=Se.ValueScopeName=Se.Scope=Se.varKinds=Se.UsedValueState=void 0;var Ee=Ir(),so=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},jn;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(jn||(Se.UsedValueState=jn={}));Se.varKinds={const:new Ee.Name("const"),let:new Ee.Name("let"),var:new Ee.Name("var")};var On=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Ee.Name?e:this.name(e)}name(e){return new Ee.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Se.Scope=On;var Mn=class extends Ee.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Ee._)`.${new Ee.Name(r)}[${n}]`}};Se.ValueScopeName=Mn;var Sp=(0,Ee._)`\n`,ao=class extends On{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Sp:Ee.nil}}get(){return this._scope}name(e){return new Mn(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:s}=i,a=(n=r.key)!==null&&n!==void 0?n:r.ref,c=this._values[s];if(c){let p=c.get(a);if(p)return p}else c=this._values[s]=new Map;c.set(a,i);let l=this._scope[s]||(this._scope[s]=[]),f=l.length;return l[f]=r.ref,i.setValue(r,{property:s,itemIndex:f}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Ee._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let s=Ee.nil;for(let a in e){let c=e[a];if(!c)continue;let l=n[a]=n[a]||new Map;c.forEach(f=>{if(l.has(f))return;l.set(f,jn.Started);let p=r(f);if(p){let u=this.opts.es5?Se.varKinds.var:Se.varKinds.const;s=(0,Ee._)`${s}${u} ${f} = ${p};${this.opts._n}`}else if(p=i?.(f))s=(0,Ee._)`${s}${p}${this.opts._n}`;else throw new so(f);l.set(f,jn.Completed)})}return s}};Se.ValueScope=ao});var K=T(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.or=W.and=W.not=W.CodeGen=W.operators=W.varKinds=W.ValueScopeName=W.ValueScope=W.Scope=W.Name=W.regexpCode=W.stringify=W.getProperty=W.nil=W.strConcat=W.str=W._=void 0;var Z=Ir(),Me=co(),lt=Ir();Object.defineProperty(W,"_",{enumerable:!0,get:function(){return lt._}});Object.defineProperty(W,"str",{enumerable:!0,get:function(){return lt.str}});Object.defineProperty(W,"strConcat",{enumerable:!0,get:function(){return lt.strConcat}});Object.defineProperty(W,"nil",{enumerable:!0,get:function(){return lt.nil}});Object.defineProperty(W,"getProperty",{enumerable:!0,get:function(){return lt.getProperty}});Object.defineProperty(W,"stringify",{enumerable:!0,get:function(){return lt.stringify}});Object.defineProperty(W,"regexpCode",{enumerable:!0,get:function(){return lt.regexpCode}});Object.defineProperty(W,"Name",{enumerable:!0,get:function(){return lt.Name}});var Ln=co();Object.defineProperty(W,"Scope",{enumerable:!0,get:function(){return Ln.Scope}});Object.defineProperty(W,"ValueScope",{enumerable:!0,get:function(){return Ln.ValueScope}});Object.defineProperty(W,"ValueScopeName",{enumerable:!0,get:function(){return Ln.ValueScopeName}});Object.defineProperty(W,"varKinds",{enumerable:!0,get:function(){return Ln.varKinds}});W.operators={GT:new Z._Code(">"),GTE:new Z._Code(">="),LT:new Z._Code("<"),LTE:new Z._Code("<="),EQ:new Z._Code("==="),NEQ:new Z._Code("!=="),NOT:new Z._Code("!"),OR:new Z._Code("||"),AND:new Z._Code("&&"),ADD:new Z._Code("+")};var tt=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},lo=class extends tt{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Me.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Gt(this.rhs,e,r)),this}get names(){return this.rhs instanceof Z._CodeOrName?this.rhs.names:{}}},Vn=class extends tt{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof Z.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Gt(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Z.Name?{}:{...this.lhs.names};return Dn(e,this.rhs)}},uo=class extends Vn{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},fo=class extends tt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},po=class extends tt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},mo=class extends tt{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},ho=class extends tt{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Gt(this.code,e,r),this}get names(){return this.code instanceof Z._CodeOrName?this.code.names:{}}},Cr=class extends tt{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(e,r)||(Pp(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>St(e,r.names),{})}},rt=class extends Cr{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},go=class extends Cr{},Yt=class extends rt{};Yt.kind="else";var xt=class t extends rt{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Yt(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t($c(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Gt(this.condition,e,r),this}get names(){let e=super.names;return Dn(e,this.condition),this.else&&St(e,this.else.names),e}};xt.kind="if";var Et=class extends rt{};Et.kind="for";var yo=class extends Et{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Gt(this.iteration,e,r),this}get names(){return St(super.names,this.iteration.names)}},wo=class extends Et{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?Me.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${r} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=Dn(super.names,this.from);return Dn(e,this.to)}},qn=class extends Et{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Gt(this.iterable,e,r),this}get names(){return St(super.names,this.iterable.names)}},Tr=class extends rt{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Tr.kind="func";var Ar=class extends Cr{render(e){return"return "+super.render(e)}};Ar.kind="return";var vo=class extends rt{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&St(e,this.catch.names),this.finally&&St(e,this.finally.names),e}},Nr=class extends rt{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Nr.kind="catch";var jr=class extends rt{render(e){return"finally"+super.render(e)}};jr.kind="finally";var $o=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
57
|
+
`:""},this._extScope=e,this._scope=new Me.Scope({parent:e}),this._nodes=[new go]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,i){let s=this._scope.toName(r);return n!==void 0&&i&&(this._constants[s.str]=n),this._leafNode(new lo(e,s,n)),s}const(e,r,n){return this._def(Me.varKinds.const,e,r,n)}let(e,r,n){return this._def(Me.varKinds.let,e,r,n)}var(e,r,n){return this._def(Me.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Vn(e,r,n))}add(e,r){return this._leafNode(new uo(e,W.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Z.nil&&this._leafNode(new ho(e)),this}object(...e){let r=["{"];for(let[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,Z.addCodeArg)(r,i));return r.push("}"),new Z._Code(r)}if(e,r,n){if(this._blockNode(new xt(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new xt(e))}else(){return this._elseNode(new Yt)}endIf(){return this._endBlockNode(xt,Yt)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new yo(e),r)}forRange(e,r,n,i,s=this.opts.es5?Me.varKinds.var:Me.varKinds.let){let a=this._scope.toName(e);return this._for(new wo(s,a,r,n),()=>i(a))}forOf(e,r,n,i=Me.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let a=r instanceof Z.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Z._)`${a}.length`,c=>{this.var(s,(0,Z._)`${a}[${c}]`),n(s)})}return this._for(new qn("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?Me.varKinds.var:Me.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Z._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new qn("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(Et)}label(e){return this._leafNode(new fo(e))}break(e){return this._leafNode(new po(e))}return(e){let r=new Ar;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Ar)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new vo;if(this._blockNode(i),this.code(e),r){let s=this.name("e");this._currNode=i.catch=new Nr(s),r(s)}return n&&(this._currNode=i.finally=new jr,this.code(n)),this._endBlockNode(Nr,jr)}throw(e){return this._leafNode(new mo(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=Z.nil,n,i){return this._blockNode(new Tr(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Tr)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof xt))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};W.CodeGen=$o;function St(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Dn(t,e){return e instanceof Z._CodeOrName?St(t,e.names):t}function Gt(t,e,r){if(t instanceof Z.Name)return n(t);if(!i(t))return t;return new Z._Code(t._items.reduce((s,a)=>(a instanceof Z.Name&&(a=n(a)),a instanceof Z._Code?s.push(...a._items):s.push(a),s),[]));function n(s){let a=r[s.str];return a===void 0||e[s.str]!==1?s:(delete e[s.str],a)}function i(s){return s instanceof Z._Code&&s._items.some(a=>a instanceof Z.Name&&e[a.str]===1&&r[a.str]!==void 0)}}function Pp(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function $c(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Z._)`!${bo(t)}`}W.not=$c;var kp=bc(W.operators.AND);function Rp(...t){return t.reduce(kp)}W.and=Rp;var Ip=bc(W.operators.OR);function Cp(...t){return t.reduce(Ip)}W.or=Cp;function bc(t){return(e,r)=>e===Z.nil?r:r===Z.nil?e:(0,Z._)`${bo(e)} ${t} ${bo(r)}`}function bo(t){return t instanceof Z.Name?t:(0,Z._)`(${t})`}});var G=T(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.checkStrictMode=Y.getErrorPath=Y.Type=Y.useFunc=Y.setEvaluated=Y.evaluatedPropsToName=Y.mergeEvaluated=Y.eachItem=Y.unescapeJsonPointer=Y.escapeJsonPointer=Y.escapeFragment=Y.unescapeFragment=Y.schemaRefOrVal=Y.schemaHasRulesButRef=Y.schemaHasRules=Y.checkUnknownRules=Y.alwaysValidSchema=Y.toHash=void 0;var oe=K(),Tp=Ir();function Ap(t){let e={};for(let r of t)e[r]=!0;return e}Y.toHash=Ap;function Np(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(Ec(t,e),!Sc(e,t.self.RULES.all))}Y.alwaysValidSchema=Np;function Ec(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let i=n.RULES.keywords;for(let s in e)i[s]||Rc(t,`unknown keyword: "${s}"`)}Y.checkUnknownRules=Ec;function Sc(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}Y.schemaHasRules=Sc;function jp(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}Y.schemaHasRulesButRef=jp;function Op({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,oe._)`${r}`}return(0,oe._)`${t}${e}${(0,oe.getProperty)(n)}`}Y.schemaRefOrVal=Op;function Mp(t){return Pc(decodeURIComponent(t))}Y.unescapeFragment=Mp;function Vp(t){return encodeURIComponent(xo(t))}Y.escapeFragment=Vp;function xo(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}Y.escapeJsonPointer=xo;function Pc(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}Y.unescapeJsonPointer=Pc;function qp(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}Y.eachItem=qp;function _c({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,s,a,c)=>{let l=a===void 0?s:a instanceof oe.Name?(s instanceof oe.Name?t(i,s,a):e(i,s,a),a):s instanceof oe.Name?(e(i,a,s),s):r(s,a);return c===oe.Name&&!(l instanceof oe.Name)?n(i,l):l}}Y.mergeEvaluated={props:_c({mergeNames:(t,e,r)=>t.if((0,oe._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,oe._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,oe._)`${r} || {}`).code((0,oe._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,oe._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,oe._)`${r} || {}`),Eo(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:kc}),items:_c({mergeNames:(t,e,r)=>t.if((0,oe._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,oe._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,oe._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,oe._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function kc(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,oe._)`{}`);return e!==void 0&&Eo(t,r,e),r}Y.evaluatedPropsToName=kc;function Eo(t,e,r){Object.keys(r).forEach(n=>t.assign((0,oe._)`${e}${(0,oe.getProperty)(n)}`,!0))}Y.setEvaluated=Eo;var xc={};function Dp(t,e){return t.scopeValue("func",{ref:e,code:xc[e.code]||(xc[e.code]=new Tp._Code(e.code))})}Y.useFunc=Dp;var _o;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(_o||(Y.Type=_o={}));function Lp(t,e,r){if(t instanceof oe.Name){let n=e===_o.Num;return r?n?(0,oe._)`"[" + ${t} + "]"`:(0,oe._)`"['" + ${t} + "']"`:n?(0,oe._)`"/" + ${t}`:(0,oe._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,oe.getProperty)(t).toString():"/"+xo(t)}Y.getErrorPath=Lp;function Rc(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}Y.checkStrictMode=Rc});var Te=T(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});var we=K(),Fp={data:new we.Name("data"),valCxt:new we.Name("valCxt"),instancePath:new we.Name("instancePath"),parentData:new we.Name("parentData"),parentDataProperty:new we.Name("parentDataProperty"),rootData:new we.Name("rootData"),dynamicAnchors:new we.Name("dynamicAnchors"),vErrors:new we.Name("vErrors"),errors:new we.Name("errors"),this:new we.Name("this"),self:new we.Name("self"),scope:new we.Name("scope"),json:new we.Name("json"),jsonPos:new we.Name("jsonPos"),jsonLen:new we.Name("jsonLen"),jsonPart:new we.Name("jsonPart")};So.default=Fp});var Or=T(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.extendErrors=ve.resetErrorsCount=ve.reportExtraError=ve.reportError=ve.keyword$DataError=ve.keywordError=void 0;var ee=K(),Fn=G(),_e=Te();ve.keywordError={message:({keyword:t})=>(0,ee.str)`must pass "${t}" keyword validation`};ve.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,ee.str)`"${t}" keyword must be ${e} ($data)`:(0,ee.str)`"${t}" keyword is invalid ($data)`};function zp(t,e=ve.keywordError,r,n){let{it:i}=t,{gen:s,compositeRule:a,allErrors:c}=i,l=Tc(t,e,r);n??(a||c)?Ic(s,l):Cc(i,(0,ee._)`[${l}]`)}ve.reportError=zp;function Hp(t,e=ve.keywordError,r){let{it:n}=t,{gen:i,compositeRule:s,allErrors:a}=n,c=Tc(t,e,r);Ic(i,c),s||a||Cc(n,_e.default.vErrors)}ve.reportExtraError=Hp;function Up(t,e){t.assign(_e.default.errors,e),t.if((0,ee._)`${_e.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,ee._)`${_e.default.vErrors}.length`,e),()=>t.assign(_e.default.vErrors,null)))}ve.resetErrorsCount=Up;function Bp({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let a=t.name("err");t.forRange("i",i,_e.default.errors,c=>{t.const(a,(0,ee._)`${_e.default.vErrors}[${c}]`),t.if((0,ee._)`${a}.instancePath === undefined`,()=>t.assign((0,ee._)`${a}.instancePath`,(0,ee.strConcat)(_e.default.instancePath,s.errorPath))),t.assign((0,ee._)`${a}.schemaPath`,(0,ee.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,ee._)`${a}.schema`,r),t.assign((0,ee._)`${a}.data`,n))})}ve.extendErrors=Bp;function Ic(t,e){let r=t.const("err",e);t.if((0,ee._)`${_e.default.vErrors} === null`,()=>t.assign(_e.default.vErrors,(0,ee._)`[${r}]`),(0,ee._)`${_e.default.vErrors}.push(${r})`),t.code((0,ee._)`${_e.default.errors}++`)}function Cc(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,ee._)`new ${t.ValidationError}(${e})`):(r.assign((0,ee._)`${n}.errors`,e),r.return(!1))}var Pt={keyword:new ee.Name("keyword"),schemaPath:new ee.Name("schemaPath"),params:new ee.Name("params"),propertyName:new ee.Name("propertyName"),message:new ee.Name("message"),schema:new ee.Name("schema"),parentSchema:new ee.Name("parentSchema")};function Tc(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,ee._)`{}`:Kp(t,e,r)}function Kp(t,e,r={}){let{gen:n,it:i}=t,s=[Jp(i,r),Wp(t,r)];return Yp(t,e,s),n.object(...s)}function Jp({errorPath:t},{instancePath:e}){let r=e?(0,ee.str)`${t}${(0,Fn.getErrorPath)(e,Fn.Type.Str)}`:t;return[_e.default.instancePath,(0,ee.strConcat)(_e.default.instancePath,r)]}function Wp({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,ee.str)`${e}/${t}`;return r&&(i=(0,ee.str)`${i}${(0,Fn.getErrorPath)(r,Fn.Type.Str)}`),[Pt.schemaPath,i]}function Yp(t,{params:e,message:r},n){let{keyword:i,data:s,schemaValue:a,it:c}=t,{opts:l,propertyName:f,topSchemaRef:p,schemaPath:u}=c;n.push([Pt.keyword,i],[Pt.params,typeof e=="function"?e(t):e||(0,ee._)`{}`]),l.messages&&n.push([Pt.message,typeof r=="function"?r(t):r]),l.verbose&&n.push([Pt.schema,a],[Pt.parentSchema,(0,ee._)`${p}${u}`],[_e.default.data,s]),f&&n.push([Pt.propertyName,f])}});var Nc=T(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.boolOrEmptySchema=Xt.topBoolOrEmptySchema=void 0;var Gp=Or(),Xp=K(),Qp=Te(),Zp={message:"boolean schema is false"};function em(t){let{gen:e,schema:r,validateName:n}=t;r===!1?Ac(t,!1):typeof r=="object"&&r.$async===!0?e.return(Qp.default.data):(e.assign((0,Xp._)`${n}.errors`,null),e.return(!0))}Xt.topBoolOrEmptySchema=em;function tm(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),Ac(t)):r.var(e,!0)}Xt.boolOrEmptySchema=tm;function Ac(t,e){let{gen:r,data:n}=t,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,Gp.reportError)(i,Zp,void 0,e)}});var Po=T(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.getRules=Qt.isJSONType=void 0;var rm=["string","number","integer","boolean","null","object","array"],nm=new Set(rm);function im(t){return typeof t=="string"&&nm.has(t)}Qt.isJSONType=im;function om(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Qt.getRules=om});var ko=T(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.shouldUseRule=ut.shouldUseGroup=ut.schemaHasRulesForType=void 0;function sm({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&jc(t,n)}ut.schemaHasRulesForType=sm;function jc(t,e){return e.rules.some(r=>Oc(t,r))}ut.shouldUseGroup=jc;function Oc(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}ut.shouldUseRule=Oc});var Mr=T($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.reportTypeError=$e.checkDataTypes=$e.checkDataType=$e.coerceAndCheckDataType=$e.getJSONTypes=$e.getSchemaTypes=$e.DataType=void 0;var am=Po(),cm=ko(),lm=Or(),J=K(),Mc=G(),Zt;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Zt||($e.DataType=Zt={}));function um(t){let e=Vc(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}$e.getSchemaTypes=um;function Vc(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(am.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}$e.getJSONTypes=Vc;function dm(t,e){let{gen:r,data:n,opts:i}=t,s=fm(e,i.coerceTypes),a=e.length>0&&!(s.length===0&&e.length===1&&(0,cm.schemaHasRulesForType)(t,e[0]));if(a){let c=Io(e,n,i.strictNumbers,Zt.Wrong);r.if(c,()=>{s.length?pm(t,e,s):Co(t)})}return a}$e.coerceAndCheckDataType=dm;var qc=new Set(["string","number","integer","boolean","null"]);function fm(t,e){return e?t.filter(r=>qc.has(r)||e==="array"&&r==="array"):[]}function pm(t,e,r){let{gen:n,data:i,opts:s}=t,a=n.let("dataType",(0,J._)`typeof ${i}`),c=n.let("coerced",(0,J._)`undefined`);s.coerceTypes==="array"&&n.if((0,J._)`${a} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,J._)`${i}[0]`).assign(a,(0,J._)`typeof ${i}`).if(Io(e,i,s.strictNumbers),()=>n.assign(c,i))),n.if((0,J._)`${c} !== undefined`);for(let f of r)(qc.has(f)||f==="array"&&s.coerceTypes==="array")&&l(f);n.else(),Co(t),n.endIf(),n.if((0,J._)`${c} !== undefined`,()=>{n.assign(i,c),mm(t,c)});function l(f){switch(f){case"string":n.elseIf((0,J._)`${a} == "number" || ${a} == "boolean"`).assign(c,(0,J._)`"" + ${i}`).elseIf((0,J._)`${i} === null`).assign(c,(0,J._)`""`);return;case"number":n.elseIf((0,J._)`${a} == "boolean" || ${i} === null
|
|
58
|
+
|| (${a} == "string" && ${i} && ${i} == +${i})`).assign(c,(0,J._)`+${i}`);return;case"integer":n.elseIf((0,J._)`${a} === "boolean" || ${i} === null
|
|
59
|
+
|| (${a} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(c,(0,J._)`+${i}`);return;case"boolean":n.elseIf((0,J._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(c,!1).elseIf((0,J._)`${i} === "true" || ${i} === 1`).assign(c,!0);return;case"null":n.elseIf((0,J._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(c,null);return;case"array":n.elseIf((0,J._)`${a} === "string" || ${a} === "number"
|
|
60
|
+
|| ${a} === "boolean" || ${i} === null`).assign(c,(0,J._)`[${i}]`)}}}function mm({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,J._)`${e} !== undefined`,()=>t.assign((0,J._)`${e}[${r}]`,n))}function Ro(t,e,r,n=Zt.Correct){let i=n===Zt.Correct?J.operators.EQ:J.operators.NEQ,s;switch(t){case"null":return(0,J._)`${e} ${i} null`;case"array":s=(0,J._)`Array.isArray(${e})`;break;case"object":s=(0,J._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=a((0,J._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=a();break;default:return(0,J._)`typeof ${e} ${i} ${t}`}return n===Zt.Correct?s:(0,J.not)(s);function a(c=J.nil){return(0,J.and)((0,J._)`typeof ${e} == "number"`,c,r?(0,J._)`isFinite(${e})`:J.nil)}}$e.checkDataType=Ro;function Io(t,e,r,n){if(t.length===1)return Ro(t[0],e,r,n);let i,s=(0,Mc.toHash)(t);if(s.array&&s.object){let a=(0,J._)`typeof ${e} != "object"`;i=s.null?a:(0,J._)`!${e} || ${a}`,delete s.null,delete s.array,delete s.object}else i=J.nil;s.number&&delete s.integer;for(let a in s)i=(0,J.and)(i,Ro(a,e,r,n));return i}$e.checkDataTypes=Io;var hm={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,J._)`{type: ${t}}`:(0,J._)`{type: ${e}}`};function Co(t){let e=gm(t);(0,lm.reportError)(e,hm)}$e.reportTypeError=Co;function gm(t){let{gen:e,data:r,schema:n}=t,i=(0,Mc.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var Lc=T(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.assignDefaults=void 0;var er=K(),ym=G();function wm(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)Dc(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>Dc(t,s,i.default))}zn.assignDefaults=wm;function Dc(t,e,r){let{gen:n,compositeRule:i,data:s,opts:a}=t;if(r===void 0)return;let c=(0,er._)`${s}${(0,er.getProperty)(e)}`;if(i){(0,ym.checkStrictMode)(t,`default is ignored for: ${c}`);return}let l=(0,er._)`${c} === undefined`;a.useDefaults==="empty"&&(l=(0,er._)`${l} || ${c} === null || ${c} === ""`),n.if(l,(0,er._)`${c} = ${(0,er.stringify)(r)}`)}});var Ae=T(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.validateUnion=ie.validateArray=ie.usePattern=ie.callValidateCode=ie.schemaProperties=ie.allSchemaProperties=ie.noPropertyInData=ie.propertyInData=ie.isOwnProperty=ie.hasPropFunc=ie.reportMissingProp=ie.checkMissingProp=ie.checkReportMissingProp=void 0;var ae=K(),To=G(),dt=Te(),vm=G();function $m(t,e){let{gen:r,data:n,it:i}=t;r.if(No(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,ae._)`${e}`},!0),t.error()})}ie.checkReportMissingProp=$m;function bm({gen:t,data:e,it:{opts:r}},n,i){return(0,ae.or)(...n.map(s=>(0,ae.and)(No(t,e,s,r.ownProperties),(0,ae._)`${i} = ${s}`)))}ie.checkMissingProp=bm;function _m(t,e){t.setParams({missingProperty:e},!0),t.error()}ie.reportMissingProp=_m;function Fc(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ae._)`Object.prototype.hasOwnProperty`})}ie.hasPropFunc=Fc;function Ao(t,e,r){return(0,ae._)`${Fc(t)}.call(${e}, ${r})`}ie.isOwnProperty=Ao;function xm(t,e,r,n){let i=(0,ae._)`${e}${(0,ae.getProperty)(r)} !== undefined`;return n?(0,ae._)`${i} && ${Ao(t,e,r)}`:i}ie.propertyInData=xm;function No(t,e,r,n){let i=(0,ae._)`${e}${(0,ae.getProperty)(r)} === undefined`;return n?(0,ae.or)(i,(0,ae.not)(Ao(t,e,r))):i}ie.noPropertyInData=No;function zc(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}ie.allSchemaProperties=zc;function Em(t,e){return zc(e).filter(r=>!(0,To.alwaysValidSchema)(t,e[r]))}ie.schemaProperties=Em;function Sm({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:a},c,l,f){let p=f?(0,ae._)`${t}, ${e}, ${n}${i}`:e,u=[[dt.default.instancePath,(0,ae.strConcat)(dt.default.instancePath,s)],[dt.default.parentData,a.parentData],[dt.default.parentDataProperty,a.parentDataProperty],[dt.default.rootData,dt.default.rootData]];a.opts.dynamicRef&&u.push([dt.default.dynamicAnchors,dt.default.dynamicAnchors]);let m=(0,ae._)`${p}, ${r.object(...u)}`;return l!==ae.nil?(0,ae._)`${c}.call(${l}, ${m})`:(0,ae._)`${c}(${m})`}ie.callValidateCode=Sm;var Pm=(0,ae._)`new RegExp`;function km({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,s=i(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,ae._)`${i.code==="new RegExp"?Pm:(0,vm.useFunc)(t,i)}(${r}, ${n})`})}ie.usePattern=km;function Rm(t){let{gen:e,data:r,keyword:n,it:i}=t,s=e.name("valid");if(i.allErrors){let c=e.let("valid",!0);return a(()=>e.assign(c,!1)),c}return e.var(s,!0),a(()=>e.break()),s;function a(c){let l=e.const("len",(0,ae._)`${r}.length`);e.forRange("i",0,l,f=>{t.subschema({keyword:n,dataProp:f,dataPropType:To.Type.Num},s),e.if((0,ae.not)(s),c)})}}ie.validateArray=Rm;function Im(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(l=>(0,To.alwaysValidSchema)(i,l))&&!i.opts.unevaluated)return;let a=e.let("valid",!1),c=e.name("_valid");e.block(()=>r.forEach((l,f)=>{let p=t.subschema({keyword:n,schemaProp:f,compositeRule:!0},c);e.assign(a,(0,ae._)`${a} || ${c}`),t.mergeValidEvaluated(p,c)||e.if((0,ae.not)(a))})),t.result(a,()=>t.reset(),()=>t.error(!0))}ie.validateUnion=Im});var Bc=T(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.validateKeywordUsage=Ue.validSchemaType=Ue.funcKeywordCode=Ue.macroKeywordCode=void 0;var xe=K(),kt=Te(),Cm=Ae(),Tm=Or();function Am(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:a}=t,c=e.macro.call(a.self,i,s,a),l=Uc(r,n,c);a.opts.validateSchema!==!1&&a.self.validateSchema(c,!0);let f=r.name("valid");t.subschema({schema:c,schemaPath:xe.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:l,compositeRule:!0},f),t.pass(f,()=>t.error(!0))}Ue.macroKeywordCode=Am;function Nm(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:a,$data:c,it:l}=t;Om(l,e);let f=!c&&e.compile?e.compile.call(l.self,s,a,l):e.validate,p=Uc(n,i,f),u=n.let("valid");t.block$data(u,m),t.ok((r=e.valid)!==null&&r!==void 0?r:u);function m(){if(e.errors===!1)v(),e.modifying&&Hc(t),I(()=>t.error());else{let P=e.async?h():y();e.modifying&&Hc(t),I(()=>jm(t,P))}}function h(){let P=n.let("ruleErrs",null);return n.try(()=>v((0,xe._)`await `),D=>n.assign(u,!1).if((0,xe._)`${D} instanceof ${l.ValidationError}`,()=>n.assign(P,(0,xe._)`${D}.errors`),()=>n.throw(D))),P}function y(){let P=(0,xe._)`${p}.errors`;return n.assign(P,null),v(xe.nil),P}function v(P=e.async?(0,xe._)`await `:xe.nil){let D=l.opts.passContext?kt.default.this:kt.default.self,z=!("compile"in e&&!c||e.schema===!1);n.assign(u,(0,xe._)`${P}${(0,Cm.callValidateCode)(t,p,D,z)}`,e.modifying)}function I(P){var D;n.if((0,xe.not)((D=e.valid)!==null&&D!==void 0?D:u),P)}}Ue.funcKeywordCode=Nm;function Hc(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,xe._)`${n.parentData}[${n.parentDataProperty}]`))}function jm(t,e){let{gen:r}=t;r.if((0,xe._)`Array.isArray(${e})`,()=>{r.assign(kt.default.vErrors,(0,xe._)`${kt.default.vErrors} === null ? ${e} : ${kt.default.vErrors}.concat(${e})`).assign(kt.default.errors,(0,xe._)`${kt.default.vErrors}.length`),(0,Tm.extendErrors)(t)},()=>t.error())}function Om({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function Uc(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,xe.stringify)(r)})}function Mm(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}Ue.validSchemaType=Mm;function Vm({schema:t,opts:e,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let a=i.dependencies;if(a?.some(c=>!Object.prototype.hasOwnProperty.call(t,c)))throw new Error(`parent schema must have dependencies of ${s}: ${a.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[s])){let l=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(l);else throw new Error(l)}}Ue.validateKeywordUsage=Vm});var Jc=T(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.extendSubschemaMode=ft.extendSubschemaData=ft.getSubschema=void 0;var Be=K(),Kc=G();function qm(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:a}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let c=t.schema[e];return r===void 0?{schema:c,schemaPath:(0,Be._)`${t.schemaPath}${(0,Be.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:c[r],schemaPath:(0,Be._)`${t.schemaPath}${(0,Be.getProperty)(e)}${(0,Be.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,Kc.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}ft.getSubschema=qm;function Dm(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:a}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:c}=e;if(r!==void 0){let{errorPath:f,dataPathArr:p,opts:u}=e,m=c.let("data",(0,Be._)`${e.data}${(0,Be.getProperty)(r)}`,!0);l(m),t.errorPath=(0,Be.str)`${f}${(0,Kc.getErrorPath)(r,n,u.jsPropertySyntax)}`,t.parentDataProperty=(0,Be._)`${r}`,t.dataPathArr=[...p,t.parentDataProperty]}if(i!==void 0){let f=i instanceof Be.Name?i:c.let("data",i,!0);l(f),a!==void 0&&(t.propertyName=a)}s&&(t.dataTypes=s);function l(f){t.data=f,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,f]}}ft.extendSubschemaData=Dm;function Lm(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}ft.extendSubschemaMode=Lm});var jo=T((c0,Wc)=>{"use strict";Wc.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var a=s[i];if(!t(e[a],r[a]))return!1}return!0}return e!==e&&r!==r}});var Gc=T((l0,Yc)=>{"use strict";var pt=Yc.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};Hn(e,n,i,t,"",t)};pt.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};pt.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};pt.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};pt.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 Hn(t,e,r,n,i,s,a,c,l,f){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,a,c,l,f);for(var p in n){var u=n[p];if(Array.isArray(u)){if(p in pt.arrayKeywords)for(var m=0;m<u.length;m++)Hn(t,e,r,u[m],i+"/"+p+"/"+m,s,i,p,n,m)}else if(p in pt.propsKeywords){if(u&&typeof u=="object")for(var h in u)Hn(t,e,r,u[h],i+"/"+p+"/"+Fm(h),s,i,p,n,h)}else(p in pt.keywords||t.allKeys&&!(p in pt.skipKeywords))&&Hn(t,e,r,u,i+"/"+p,s,i,p,n)}r(n,i,s,a,c,l,f)}}function Fm(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Vr=T(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.getSchemaRefs=Pe.resolveUrl=Pe.normalizeId=Pe._getFullPath=Pe.getFullPath=Pe.inlineRef=void 0;var zm=G(),Hm=jo(),Um=Gc(),Bm=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Km(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Oo(t):e?Xc(t)<=e:!1}Pe.inlineRef=Km;var Jm=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Oo(t){for(let e in t){if(Jm.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Oo)||typeof r=="object"&&Oo(r))return!0}return!1}function Xc(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!Bm.has(r)&&(typeof t[r]=="object"&&(0,zm.eachItem)(t[r],n=>e+=Xc(n)),e===1/0))return 1/0}return e}function Qc(t,e="",r){r!==!1&&(e=tr(e));let n=t.parse(e);return Zc(t,n)}Pe.getFullPath=Qc;function Zc(t,e){return t.serialize(e).split("#")[0]+"#"}Pe._getFullPath=Zc;var Wm=/#\/?$/;function tr(t){return t?t.replace(Wm,""):""}Pe.normalizeId=tr;function Ym(t,e,r){return r=tr(r),t.resolve(e,r)}Pe.resolveUrl=Ym;var Gm=/^[a-z_][-a-z0-9._]*$/i;function Xm(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=tr(t[r]||e),s={"":i},a=Qc(n,i,!1),c={},l=new Set;return Um(t,{allKeys:!0},(u,m,h,y)=>{if(y===void 0)return;let v=a+m,I=s[y];typeof u[r]=="string"&&(I=P.call(this,u[r])),D.call(this,u.$anchor),D.call(this,u.$dynamicAnchor),s[m]=I;function P(z){let L=this.opts.uriResolver.resolve;if(z=tr(I?L(I,z):z),l.has(z))throw p(z);l.add(z);let N=this.refs[z];return typeof N=="string"&&(N=this.refs[N]),typeof N=="object"?f(u,N.schema,z):z!==tr(v)&&(z[0]==="#"?(f(u,c[z],z),c[z]=u):this.refs[z]=v),z}function D(z){if(typeof z=="string"){if(!Gm.test(z))throw new Error(`invalid anchor "${z}"`);P.call(this,`#${z}`)}}}),c;function f(u,m,h){if(m!==void 0&&!Hm(u,m))throw p(h)}function p(u){return new Error(`reference "${u}" resolves to more than one schema`)}}Pe.getSchemaRefs=Xm});var Lr=T(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.getData=mt.KeywordCxt=mt.validateFunctionCode=void 0;var il=Nc(),el=Mr(),Vo=ko(),Un=Mr(),Qm=Lc(),Dr=Bc(),Mo=Jc(),V=K(),B=Te(),Zm=Vr(),nt=G(),qr=Or();function eh(t){if(al(t)&&(cl(t),sl(t))){nh(t);return}ol(t,()=>(0,il.topBoolOrEmptySchema)(t))}mt.validateFunctionCode=eh;function ol({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,V._)`${B.default.data}, ${B.default.valCxt}`,n.$async,()=>{t.code((0,V._)`"use strict"; ${tl(r,i)}`),rh(t,i),t.code(s)}):t.func(e,(0,V._)`${B.default.data}, ${th(i)}`,n.$async,()=>t.code(tl(r,i)).code(s))}function th(t){return(0,V._)`{${B.default.instancePath}="", ${B.default.parentData}, ${B.default.parentDataProperty}, ${B.default.rootData}=${B.default.data}${t.dynamicRef?(0,V._)`, ${B.default.dynamicAnchors}={}`:V.nil}}={}`}function rh(t,e){t.if(B.default.valCxt,()=>{t.var(B.default.instancePath,(0,V._)`${B.default.valCxt}.${B.default.instancePath}`),t.var(B.default.parentData,(0,V._)`${B.default.valCxt}.${B.default.parentData}`),t.var(B.default.parentDataProperty,(0,V._)`${B.default.valCxt}.${B.default.parentDataProperty}`),t.var(B.default.rootData,(0,V._)`${B.default.valCxt}.${B.default.rootData}`),e.dynamicRef&&t.var(B.default.dynamicAnchors,(0,V._)`${B.default.valCxt}.${B.default.dynamicAnchors}`)},()=>{t.var(B.default.instancePath,(0,V._)`""`),t.var(B.default.parentData,(0,V._)`undefined`),t.var(B.default.parentDataProperty,(0,V._)`undefined`),t.var(B.default.rootData,B.default.data),e.dynamicRef&&t.var(B.default.dynamicAnchors,(0,V._)`{}`)})}function nh(t){let{schema:e,opts:r,gen:n}=t;ol(t,()=>{r.$comment&&e.$comment&&ul(t),ch(t),n.let(B.default.vErrors,null),n.let(B.default.errors,0),r.unevaluated&&ih(t),ll(t),dh(t)})}function ih(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,V._)`${r}.evaluated`),e.if((0,V._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,V._)`${t.evaluated}.props`,(0,V._)`undefined`)),e.if((0,V._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,V._)`${t.evaluated}.items`,(0,V._)`undefined`))}function tl(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,V._)`/*# sourceURL=${r} */`:V.nil}function oh(t,e){if(al(t)&&(cl(t),sl(t))){sh(t,e);return}(0,il.boolOrEmptySchema)(t,e)}function sl({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function al(t){return typeof t.schema!="boolean"}function sh(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&ul(t),lh(t),uh(t);let s=n.const("_errs",B.default.errors);ll(t,s),n.var(e,(0,V._)`${s} === ${B.default.errors}`)}function cl(t){(0,nt.checkUnknownRules)(t),ah(t)}function ll(t,e){if(t.opts.jtd)return rl(t,[],!1,e);let r=(0,el.getSchemaTypes)(t.schema),n=(0,el.coerceAndCheckDataType)(t,r);rl(t,r,!n,e)}function ah(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,nt.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function ch(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,nt.checkStrictMode)(t,"default is ignored in the schema root")}function lh(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,Zm.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function uh(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function ul({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,V._)`${B.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let a=(0,V.str)`${n}/$comment`,c=t.scopeValue("root",{ref:e.root});t.code((0,V._)`${B.default.self}.opts.$comment(${s}, ${a}, ${c}.schema)`)}}function dh(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,V._)`${B.default.errors} === 0`,()=>e.return(B.default.data),()=>e.throw((0,V._)`new ${i}(${B.default.vErrors})`)):(e.assign((0,V._)`${n}.errors`,B.default.vErrors),s.unevaluated&&fh(t),e.return((0,V._)`${B.default.errors} === 0`))}function fh({gen:t,evaluated:e,props:r,items:n}){r instanceof V.Name&&t.assign((0,V._)`${e}.props`,r),n instanceof V.Name&&t.assign((0,V._)`${e}.items`,n)}function rl(t,e,r,n){let{gen:i,schema:s,data:a,allErrors:c,opts:l,self:f}=t,{RULES:p}=f;if(s.$ref&&(l.ignoreKeywordsWithRef||!(0,nt.schemaHasRulesButRef)(s,p))){i.block(()=>fl(t,"$ref",p.all.$ref.definition));return}l.jtd||ph(t,e),i.block(()=>{for(let m of p.rules)u(m);u(p.post)});function u(m){(0,Vo.shouldUseGroup)(s,m)&&(m.type?(i.if((0,Un.checkDataType)(m.type,a,l.strictNumbers)),nl(t,m),e.length===1&&e[0]===m.type&&r&&(i.else(),(0,Un.reportTypeError)(t)),i.endIf()):nl(t,m),c||i.if((0,V._)`${B.default.errors} === ${n||0}`))}}function nl(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,Qm.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,Vo.shouldUseRule)(n,s)&&fl(t,s.keyword,s.definition,e.type)})}function ph(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(mh(t,e),t.opts.allowUnionTypes||hh(t,e),gh(t,t.dataTypes))}function mh(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{dl(t.dataTypes,r)||qo(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),wh(t,e)}}function hh(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&qo(t,"use allowUnionTypes to allow union type keyword")}function gh(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,Vo.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(a=>yh(e,a))&&qo(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function yh(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function dl(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function wh(t,e){let r=[];for(let n of t.dataTypes)dl(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function qo(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,nt.checkStrictMode)(t,e,t.opts.strictTypes)}var Bn=class{constructor(e,r,n){if((0,Dr.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,nt.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",pl(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Dr.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",B.default.errors))}result(e,r,n){this.failResult((0,V.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,V.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,V._)`${r} !== undefined && (${(0,V.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?qr.reportExtraError:qr.reportError)(this,this.def.error,r)}$dataError(){(0,qr.reportError)(this,this.def.$dataError||qr.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,qr.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=V.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=V.nil,r=V.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:a}=this;n.if((0,V.or)((0,V._)`${i} === undefined`,r)),e!==V.nil&&n.assign(e,!0),(s.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==V.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,V.or)(a(),c());function a(){if(n.length){if(!(r instanceof V.Name))throw new Error("ajv implementation error");let l=Array.isArray(n)?n:[n];return(0,V._)`${(0,Un.checkDataTypes)(l,r,s.opts.strictNumbers,Un.DataType.Wrong)}`}return V.nil}function c(){if(i.validateSchema){let l=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,V._)`!${l}(${r})`}return V.nil}}subschema(e,r){let n=(0,Mo.getSubschema)(this.it,e);(0,Mo.extendSubschemaData)(n,this.it,e),(0,Mo.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return oh(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=nt.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=nt.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,V.Name)),!0}};mt.KeywordCxt=Bn;function fl(t,e,r,n){let i=new Bn(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Dr.funcKeywordCode)(i,r):"macro"in r?(0,Dr.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Dr.funcKeywordCode)(i,r)}var vh=/^\/(?:[^~]|~0|~1)*$/,$h=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function pl(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return B.default.rootData;if(t[0]==="/"){if(!vh.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=B.default.rootData}else{let f=$h.exec(t);if(!f)throw new Error(`Invalid JSON-pointer: ${t}`);let p=+f[1];if(i=f[2],i==="#"){if(p>=e)throw new Error(l("property/index",p));return n[e-p]}if(p>e)throw new Error(l("data",p));if(s=r[e-p],!i)return s}let a=s,c=i.split("/");for(let f of c)f&&(s=(0,V._)`${s}${(0,V.getProperty)((0,nt.unescapeJsonPointer)(f))}`,a=(0,V._)`${a} && ${s}`);return a;function l(f,p){return`Cannot access ${f} ${p} levels up, current level is ${e}`}}mt.getData=pl});var Kn=T(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});var Do=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Lo.default=Do});var Fr=T(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});var Fo=Vr(),zo=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Fo.resolveUrl)(e,r,n),this.missingSchema=(0,Fo.normalizeId)((0,Fo.getFullPath)(e,this.missingRef))}};Ho.default=zo});var zr=T(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.resolveSchema=Ne.getCompilingSchema=Ne.resolveRef=Ne.compileSchema=Ne.SchemaEnv=void 0;var Ve=K(),bh=Kn(),Rt=Te(),qe=Vr(),ml=G(),_h=Lr(),rr=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,qe.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};Ne.SchemaEnv=rr;function Bo(t){let e=hl.call(this,t);if(e)return e;let r=(0,qe.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,a=new Ve.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),c;t.$async&&(c=a.scopeValue("Error",{ref:bh.default,code:(0,Ve._)`require("ajv/dist/runtime/validation_error").default`}));let l=a.scopeName("validate");t.validateName=l;let f={gen:a,allErrors:this.opts.allErrors,data:Rt.default.data,parentData:Rt.default.parentData,parentDataProperty:Rt.default.parentDataProperty,dataNames:[Rt.default.data],dataPathArr:[Ve.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Ve.stringify)(t.schema)}:{ref:t.schema}),validateName:l,ValidationError:c,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Ve.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Ve._)`""`,opts:this.opts,self:this},p;try{this._compilations.add(t),(0,_h.validateFunctionCode)(f),a.optimize(this.opts.code.optimize);let u=a.toString();p=`${a.scopeRefs(Rt.default.scope)}return ${u}`,this.opts.code.process&&(p=this.opts.code.process(p,t));let h=new Function(`${Rt.default.self}`,`${Rt.default.scope}`,p)(this,this.scope.get());if(this.scope.value(l,{ref:h}),h.errors=null,h.schema=t.schema,h.schemaEnv=t,t.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:l,validateCode:u,scopeValues:a._values}),this.opts.unevaluated){let{props:y,items:v}=f;h.evaluated={props:y instanceof Ve.Name?void 0:y,items:v instanceof Ve.Name?void 0:v,dynamicProps:y instanceof Ve.Name,dynamicItems:v instanceof Ve.Name},h.source&&(h.source.evaluated=(0,Ve.stringify)(h.evaluated))}return t.validate=h,t}catch(u){throw delete t.validate,delete t.validateName,p&&this.logger.error("Error compiling schema, function code:",p),u}finally{this._compilations.delete(t)}}Ne.compileSchema=Bo;function xh(t,e,r){var n;r=(0,qe.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=Ph.call(this,t,r);if(s===void 0){let a=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:c}=this.opts;a&&(s=new rr({schema:a,schemaId:c,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=Eh.call(this,s)}Ne.resolveRef=xh;function Eh(t){return(0,qe.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Bo.call(this,t)}function hl(t){for(let e of this._compilations)if(Sh(e,t))return e}Ne.getCompilingSchema=hl;function Sh(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function Ph(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Jn.call(this,t,e)}function Jn(t,e){let r=this.opts.uriResolver.parse(e),n=(0,qe._getFullPath)(this.opts.uriResolver,r),i=(0,qe.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return Uo.call(this,r,t);let s=(0,qe.normalizeId)(n),a=this.refs[s]||this.schemas[s];if(typeof a=="string"){let c=Jn.call(this,t,a);return typeof c?.schema!="object"?void 0:Uo.call(this,r,c)}if(typeof a?.schema=="object"){if(a.validate||Bo.call(this,a),s===(0,qe.normalizeId)(e)){let{schema:c}=a,{schemaId:l}=this.opts,f=c[l];return f&&(i=(0,qe.resolveUrl)(this.opts.uriResolver,i,f)),new rr({schema:c,schemaId:l,root:t,baseId:i})}return Uo.call(this,r,a)}}Ne.resolveSchema=Jn;var kh=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Uo(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let c of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let l=r[(0,ml.unescapeFragment)(c)];if(l===void 0)return;r=l;let f=typeof r=="object"&&r[this.opts.schemaId];!kh.has(c)&&f&&(e=(0,qe.resolveUrl)(this.opts.uriResolver,e,f))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,ml.schemaHasRulesButRef)(r,this.RULES)){let c=(0,qe.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=Jn.call(this,n,c)}let{schemaId:a}=this.opts;if(s=s||new rr({schema:r,schemaId:a,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var gl=T((h0,Rh)=>{Rh.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Wo=T((g0,_l)=>{"use strict";var Ih=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),wl=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),Ko=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),vl=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),Ch=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Jo(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var Th=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function yl(t){return t.length=0,!0}function Ah(t,e,r){if(t.length){let n=Jo(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function Nh(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,a=!1,c=Ah;for(let l=0;l<t.length;l++){let f=t[l];if(!(f==="["||f==="]"))if(f===":"){if(s===!0&&(a=!0),!c(i,n,r))break;if(++e>7){r.error=!0;break}l>0&&t[l-1]===":"&&(s=!0),n.push(":");continue}else if(f==="%"){if(!c(i,n,r))break;c=yl}else{i.push(f);continue}}return i.length&&(c===yl?r.zone=i.join(""):a?n.push(i.join("")):n.push(Jo(i))),r.address=n.join(""),r}function $l(t){if(jh(t,":")<2)return{host:t,isIPV6:!1};let e=Nh(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function jh(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function Oh(t){let e=t,r=[],n=-1,i=0;for(;i=e.length;){if(i===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(i===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(i===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}var Mh={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},Vh=/[@/?#:]/g,qh=/[@/?#]/g;function bl(t,e){let r=e?qh:Vh;return r.lastIndex=0,t.replace(r,n=>Mh[n])}function Dh(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let i=t.slice(n+1,n+3);if(Ko(i)){let s=i.toUpperCase(),a=String.fromCharCode(parseInt(s,16));e&&vl(a)?r+=a:r+="%"+s,n+=2;continue}}r+=t[n]}return r}function Lh(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(Ko(n)){let i=n.toUpperCase(),s=String.fromCharCode(parseInt(i,16));s!=="."&&vl(s)?e+=s:e+="%"+i,r+=2;continue}}Ch(t[r])?e+=t[r]:e+=escape(t[r])}return e}function Fh(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(Ko(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function zh(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!wl(r)){let n=$l(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=bl(r,!1)}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}_l.exports={nonSimpleDomain:Th,recomposeAuthority:zh,reescapeHostDelimiters:bl,normalizePercentEncoding:Dh,normalizePathEncoding:Lh,escapePreservingEscapes:Fh,removeDotSegments:Oh,isIPv4:wl,isUUID:Ih,normalizeIPv6:$l,stringArrayToHexStripped:Jo}});var kl=T((y0,Pl)=>{"use strict";var{isUUID:Hh}=Wo(),Uh=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Bh=["http","https","ws","wss","urn","urn:uuid"];function Kh(t){return Bh.indexOf(t)!==-1}function Yo(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function xl(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function El(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function Jh(t){return t.secure=Yo(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function Wh(t){if((t.port===(Yo(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function Yh(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(Uh);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let i=`${n}:${e.nid||t.nid}`,s=Go(i);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function Gh(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),i=`${r}:${e.nid||n}`,s=Go(i);s&&(t=s.serialize(t,e));let a=t,c=t.nss;return a.path=`${n||e.nid}:${c}`,e.skipEscape=!0,a}function Xh(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!Hh(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function Qh(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var Sl={scheme:"http",domainHost:!0,parse:xl,serialize:El},Zh={scheme:"https",domainHost:Sl.domainHost,parse:xl,serialize:El},Wn={scheme:"ws",domainHost:!0,parse:Jh,serialize:Wh},eg={scheme:"wss",domainHost:Wn.domainHost,parse:Wn.parse,serialize:Wn.serialize},tg={scheme:"urn",parse:Yh,serialize:Gh,skipNormalize:!0},rg={scheme:"urn:uuid",parse:Xh,serialize:Qh,skipNormalize:!0},Yn={http:Sl,https:Zh,ws:Wn,wss:eg,urn:tg,"urn:uuid":rg};Object.setPrototypeOf(Yn,null);function Go(t){return t&&(Yn[t]||Yn[t.toLowerCase()])||void 0}Pl.exports={wsIsSecure:Yo,SCHEMES:Yn,isValidSchemeName:Kh,getSchemeHandler:Go}});var Nl=T((w0,Gn)=>{"use strict";var{normalizeIPv6:ng,removeDotSegments:Hr,recomposeAuthority:ig,normalizePercentEncoding:og,normalizePathEncoding:sg,escapePreservingEscapes:ag,reescapeHostDelimiters:cg,isIPv4:lg,nonSimpleDomain:ug}=Wo(),{SCHEMES:dg,getSchemeHandler:Il}=kl();function fg(t,e){return typeof t=="string"?t=yg(t,e):typeof t=="object"&&(t=nr(It(t,e),e)),t}function pg(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=Cl(nr(t,n),nr(e,n),n,!0);return n.skipEscape=!0,It(i,n)}function Cl(t,e,r,n){let i={};return n||(t=nr(It(t,r),r),e=nr(It(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=Hr(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=Hr(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=Hr(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?i.path="/"+e.path:t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=Hr(i.path)),i.query=e.query):(i.path=t.path,e.query!==void 0?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function mg(t,e,r){let n=Rl(t,r),i=Rl(e,r);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()}function It(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),i=[],s=Il(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=og(r.path):(r.path=ag(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let a=ig(r);if(a!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(a),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let c=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(c=Hr(c)),a===void 0&&c[0]==="/"&&c[1]==="/"&&(c="/%2F"+c.slice(2)),i.push(c)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var hg=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function gg(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function Tl(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1,s=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let a=t.match(hg);if(a){n.scheme=a[1],n.userinfo=a[3],n.host=a[4],n.port=parseInt(a[5],10),n.path=a[6]||"",n.query=a[7],n.fragment=a[8],isNaN(n.port)&&(n.port=a[5]);let c=gg(n,a);if(c!==void 0&&(n.error=n.error||c,i=!0),n.host)if(lg(n.host)===!1){let p=ng(n.host);n.host=p.host.toLowerCase(),s=p.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let l=Il(r.scheme||n.scheme);if(!r.unicodeSupport&&(!l||!l.unicodeSupport)&&n.host&&(r.domainHost||l&&l.domainHost)&&s===!1&&ug(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(f){n.error=n.error||"Host's domain name can not be converted to ASCII: "+f}if((!l||l&&!l.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=cg(unescape(n.host),s))),n.path&&(n.path=sg(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}l&&l.parse&&l.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:i}}function nr(t,e){return Tl(t,e).parsed}function yg(t,e){return Al(t,e).normalized}function Al(t,e){let{parsed:r,malformedAuthorityOrPort:n}=Tl(t,e);return{normalized:n?t:It(r,e),malformedAuthorityOrPort:n}}function Rl(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=Al(t,e);return n?void 0:r}if(typeof t=="object")return It(t,e)}var Xo={SCHEMES:dg,normalize:fg,resolve:pg,resolveComponent:Cl,equal:mg,serialize:It,parse:nr};Gn.exports=Xo;Gn.exports.default=Xo;Gn.exports.fastUri=Xo});var Ol=T(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});var jl=Nl();jl.code='require("ajv/dist/runtime/uri").default';Qo.default=jl});var Hl=T(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.CodeGen=ge.Name=ge.nil=ge.stringify=ge.str=ge._=ge.KeywordCxt=void 0;var wg=Lr();Object.defineProperty(ge,"KeywordCxt",{enumerable:!0,get:function(){return wg.KeywordCxt}});var ir=K();Object.defineProperty(ge,"_",{enumerable:!0,get:function(){return ir._}});Object.defineProperty(ge,"str",{enumerable:!0,get:function(){return ir.str}});Object.defineProperty(ge,"stringify",{enumerable:!0,get:function(){return ir.stringify}});Object.defineProperty(ge,"nil",{enumerable:!0,get:function(){return ir.nil}});Object.defineProperty(ge,"Name",{enumerable:!0,get:function(){return ir.Name}});Object.defineProperty(ge,"CodeGen",{enumerable:!0,get:function(){return ir.CodeGen}});var vg=Kn(),Ll=Fr(),$g=Po(),Ur=zr(),bg=K(),Br=Vr(),Xn=Mr(),es=G(),Ml=gl(),_g=Ol(),Fl=(t,e)=>new RegExp(t,e);Fl.code="new RegExp";var xg=["removeAdditional","useDefaults","coerceTypes"],Eg=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Sg={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."},Pg={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Vl=200;function kg(t){var e,r,n,i,s,a,c,l,f,p,u,m,h,y,v,I,P,D,z,L,N,X,fe,yt,wt;let ze=t.strict,Je=(e=t.code)===null||e===void 0?void 0:e.optimize,Vt=Je===!0||Je===void 0?1:Je||0,ot=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Fl,qt=(i=t.uriResolver)!==null&&i!==void 0?i:_g.default;return{strictSchema:(a=(s=t.strictSchema)!==null&&s!==void 0?s:ze)!==null&&a!==void 0?a:!0,strictNumbers:(l=(c=t.strictNumbers)!==null&&c!==void 0?c:ze)!==null&&l!==void 0?l:!0,strictTypes:(p=(f=t.strictTypes)!==null&&f!==void 0?f:ze)!==null&&p!==void 0?p:"log",strictTuples:(m=(u=t.strictTuples)!==null&&u!==void 0?u:ze)!==null&&m!==void 0?m:"log",strictRequired:(y=(h=t.strictRequired)!==null&&h!==void 0?h:ze)!==null&&y!==void 0?y:!1,code:t.code?{...t.code,optimize:Vt,regExp:ot}:{optimize:Vt,regExp:ot},loopRequired:(v=t.loopRequired)!==null&&v!==void 0?v:Vl,loopEnum:(I=t.loopEnum)!==null&&I!==void 0?I:Vl,meta:(P=t.meta)!==null&&P!==void 0?P:!0,messages:(D=t.messages)!==null&&D!==void 0?D:!0,inlineRefs:(z=t.inlineRefs)!==null&&z!==void 0?z:!0,schemaId:(L=t.schemaId)!==null&&L!==void 0?L:"$id",addUsedSchema:(N=t.addUsedSchema)!==null&&N!==void 0?N:!0,validateSchema:(X=t.validateSchema)!==null&&X!==void 0?X:!0,validateFormats:(fe=t.validateFormats)!==null&&fe!==void 0?fe:!0,unicodeRegExp:(yt=t.unicodeRegExp)!==null&&yt!==void 0?yt:!0,int32range:(wt=t.int32range)!==null&&wt!==void 0?wt:!0,uriResolver:qt}}var Kr=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...kg(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new bg.ValueScope({scope:{},prefixes:Eg,es5:r,lines:n}),this.logger=Ng(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,$g.getRules)(),ql.call(this,Sg,e,"NOT SUPPORTED"),ql.call(this,Pg,e,"DEPRECATED","warn"),this._metaOpts=Tg.call(this),e.formats&&Ig.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&Cg.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),Rg.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=Ml;n==="id"&&(i={...Ml},i.id=i.$id,delete i.$id),r&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,e,r);async function i(p,u){await s.call(this,p.$schema);let m=this._addSchema(p,u);return m.validate||a.call(this,m)}async function s(p){p&&!this.getSchema(p)&&await i.call(this,{$ref:p},!0)}async function a(p){try{return this._compileSchemaEnv(p)}catch(u){if(!(u instanceof Ll.default))throw u;return c.call(this,u),await l.call(this,u.missingSchema),a.call(this,p)}}function c({missingSchema:p,missingRef:u}){if(this.refs[p])throw new Error(`AnySchema ${p} is loaded but ${u} cannot be resolved`)}async function l(p){let u=await f.call(this,p);this.refs[p]||await s.call(this,u.$schema),this.refs[p]||this.addSchema(u,p,r)}async function f(p){let u=this._loading[p];if(u)return u;try{return await(this._loading[p]=n(p))}finally{delete this._loading[p]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let a of e)this.addSchema(a,void 0,n,i);return this}let s;if(typeof e=="object"){let{schemaId:a}=this.opts;if(s=e[a],s!==void 0&&typeof s!="string")throw new Error(`schema ${a} must be string`)}return r=(0,Br.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,i,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,e);if(!i&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(e){let r;for(;typeof(r=Dl.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Ur.SchemaEnv({schema:{},schemaId:n});if(r=Ur.resolveSchema.call(this,i,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Dl.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,Br.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(Og.call(this,n,r),!r)return(0,es.eachItem)(n,s=>Zo.call(this,s)),this;Vg.call(this,r);let i={...r,type:(0,Xn.getJSONTypes)(r.type),schemaType:(0,Xn.getJSONTypes)(r.schemaType)};return(0,es.eachItem)(n,i.type.length===0?s=>Zo.call(this,s,i):s=>i.type.forEach(a=>Zo.call(this,s,i,a))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of r){let s=i.split("/").slice(1),a=e;for(let c of s)a=a[c];for(let c in n){let l=n[c];if(typeof l!="object")continue;let{$data:f}=l.definition,p=a[c];f&&p&&(a[c]=zl(p))}}return e}_removeAllSchemas(e,r){for(let n in e){let i=e[n];(!r||r.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let a,{schemaId:c}=this.opts;if(typeof e=="object")a=e[c];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let l=this._cache.get(e);if(l!==void 0)return l;n=(0,Br.normalizeId)(a||n);let f=Br.getSchemaRefs.call(this,e,n);return l=new Ur.SchemaEnv({schema:e,schemaId:c,meta:r,baseId:n,localRefs:f}),this._cache.set(l.schema,l),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=l),i&&this.validateSchema(e,!0),l}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):Ur.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{Ur.compileSchema.call(this,e)}finally{this.opts=r}}};Kr.ValidationError=vg.default;Kr.MissingRefError=Ll.default;ge.default=Kr;function ql(t,e,r,n="error"){for(let i in t){let s=i;s in e&&this.logger[n](`${r}: option ${i}. ${t[s]}`)}}function Dl(t){return t=(0,Br.normalizeId)(t),this.schemas[t]||this.refs[t]}function Rg(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function Ig(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function Cg(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function Tg(){let t={...this.opts};for(let e of xg)delete t[e];return t}var Ag={log(){},warn(){},error(){}};function Ng(t){if(t===!1)return Ag;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var jg=/^[a-z_$][a-z0-9_$:-]*$/i;function Og(t,e){let{RULES:r}=this;if((0,es.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!jg.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function Zo(t,e,r){var n;let i=e?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,a=i?s.post:s.rules.find(({type:l})=>l===r);if(a||(a={type:r,rules:[]},s.rules.push(a)),s.keywords[t]=!0,!e)return;let c={keyword:t,definition:{...e,type:(0,Xn.getJSONTypes)(e.type),schemaType:(0,Xn.getJSONTypes)(e.schemaType)}};e.before?Mg.call(this,a,c,e.before):a.rules.push(c),s.all[t]=c,(n=e.implements)===null||n===void 0||n.forEach(l=>this.addKeyword(l))}function Mg(t,e,r){let n=t.rules.findIndex(i=>i.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function Vg(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=zl(e)),t.validateSchema=this.compile(e,!0))}var qg={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function zl(t){return{anyOf:[t,qg]}}});var Ul=T(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});var Dg={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};ts.default=Dg});var ei=T(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.callRef=Ct.getValidate=void 0;var Lg=Fr(),Bl=Ae(),ke=K(),or=Te(),Kl=zr(),Qn=G(),Fg={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:s,validateName:a,opts:c,self:l}=n,{root:f}=s;if((r==="#"||r==="#/")&&i===f.baseId)return u();let p=Kl.resolveRef.call(l,f,i,r);if(p===void 0)throw new Lg.default(n.opts.uriResolver,i,r);if(p instanceof Kl.SchemaEnv)return m(p);return h(p);function u(){if(s===f)return Zn(t,a,s,s.$async);let y=e.scopeValue("root",{ref:f});return Zn(t,(0,ke._)`${y}.validate`,f,f.$async)}function m(y){let v=Jl(t,y);Zn(t,v,y,y.$async)}function h(y){let v=e.scopeValue("schema",c.code.source===!0?{ref:y,code:(0,ke.stringify)(y)}:{ref:y}),I=e.name("valid"),P=t.subschema({schema:y,dataTypes:[],schemaPath:ke.nil,topSchemaRef:v,errSchemaPath:r},I);t.mergeEvaluated(P),t.ok(I)}}};function Jl(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,ke._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Ct.getValidate=Jl;function Zn(t,e,r,n){let{gen:i,it:s}=t,{allErrors:a,schemaEnv:c,opts:l}=s,f=l.passContext?or.default.this:ke.nil;n?p():u();function p(){if(!c.$async)throw new Error("async schema referenced by sync schema");let y=i.let("valid");i.try(()=>{i.code((0,ke._)`await ${(0,Bl.callValidateCode)(t,e,f)}`),h(e),a||i.assign(y,!0)},v=>{i.if((0,ke._)`!(${v} instanceof ${s.ValidationError})`,()=>i.throw(v)),m(v),a||i.assign(y,!1)}),t.ok(y)}function u(){t.result((0,Bl.callValidateCode)(t,e,f),()=>h(e),()=>m(e))}function m(y){let v=(0,ke._)`${y}.errors`;i.assign(or.default.vErrors,(0,ke._)`${or.default.vErrors} === null ? ${v} : ${or.default.vErrors}.concat(${v})`),i.assign(or.default.errors,(0,ke._)`${or.default.vErrors}.length`)}function h(y){var v;if(!s.opts.unevaluated)return;let I=(v=r?.validate)===null||v===void 0?void 0:v.evaluated;if(s.props!==!0)if(I&&!I.dynamicProps)I.props!==void 0&&(s.props=Qn.mergeEvaluated.props(i,I.props,s.props));else{let P=i.var("props",(0,ke._)`${y}.evaluated.props`);s.props=Qn.mergeEvaluated.props(i,P,s.props,ke.Name)}if(s.items!==!0)if(I&&!I.dynamicItems)I.items!==void 0&&(s.items=Qn.mergeEvaluated.items(i,I.items,s.items));else{let P=i.var("items",(0,ke._)`${y}.evaluated.items`);s.items=Qn.mergeEvaluated.items(i,P,s.items,ke.Name)}}}Ct.callRef=Zn;Ct.default=Fg});var Wl=T(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});var zg=Ul(),Hg=ei(),Ug=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",zg.default,Hg.default];rs.default=Ug});var Yl=T(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});var ti=K(),ht=ti.operators,ri={maximum:{okStr:"<=",ok:ht.LTE,fail:ht.GT},minimum:{okStr:">=",ok:ht.GTE,fail:ht.LT},exclusiveMaximum:{okStr:"<",ok:ht.LT,fail:ht.GTE},exclusiveMinimum:{okStr:">",ok:ht.GT,fail:ht.LTE}},Bg={message:({keyword:t,schemaCode:e})=>(0,ti.str)`must be ${ri[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,ti._)`{comparison: ${ri[t].okStr}, limit: ${e}}`},Kg={keyword:Object.keys(ri),type:"number",schemaType:"number",$data:!0,error:Bg,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,ti._)`${r} ${ri[e].fail} ${n} || isNaN(${r})`)}};ns.default=Kg});var Gl=T(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});var Jr=K(),Jg={message:({schemaCode:t})=>(0,Jr.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Jr._)`{multipleOf: ${t}}`},Wg={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Jg,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,a=e.let("res"),c=s?(0,Jr._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:(0,Jr._)`${a} !== parseInt(${a})`;t.fail$data((0,Jr._)`(${n} === 0 || (${a} = ${r}/${n}, ${c}))`)}};is.default=Wg});var Ql=T(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});function Xl(t){let e=t.length,r=0,n=0,i;for(;n<e;)r++,i=t.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=t.charCodeAt(n),(i&64512)===56320&&n++);return r}os.default=Xl;Xl.code='require("ajv/dist/runtime/ucs2length").default'});var Zl=T(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});var Tt=K(),Yg=G(),Gg=Ql(),Xg={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Tt.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Tt._)`{limit: ${t}}`},Qg={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Xg,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?Tt.operators.GT:Tt.operators.LT,a=i.opts.unicode===!1?(0,Tt._)`${r}.length`:(0,Tt._)`${(0,Yg.useFunc)(t.gen,Gg.default)}(${r})`;t.fail$data((0,Tt._)`${a} ${s} ${n}`)}};ss.default=Qg});var eu=T(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});var Zg=Ae(),ey=G(),sr=K(),ty={message:({schemaCode:t})=>(0,sr.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,sr._)`{pattern: ${t}}`},ry={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:ty,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:a}=t,c=a.opts.unicodeRegExp?"u":"";if(n){let{regExp:l}=a.opts.code,f=l.code==="new RegExp"?(0,sr._)`new RegExp`:(0,ey.useFunc)(e,l),p=e.let("valid");e.try(()=>e.assign(p,(0,sr._)`${f}(${s}, ${c}).test(${r})`),()=>e.assign(p,!1)),t.fail$data((0,sr._)`!${p}`)}else{let l=(0,Zg.usePattern)(t,i);t.fail$data((0,sr._)`!${l}.test(${r})`)}}};as.default=ry});var tu=T(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});var Wr=K(),ny={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Wr.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Wr._)`{limit: ${t}}`},iy={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:ny,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?Wr.operators.GT:Wr.operators.LT;t.fail$data((0,Wr._)`Object.keys(${r}).length ${i} ${n}`)}};cs.default=iy});var ru=T(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});var Yr=Ae(),Gr=K(),oy=G(),sy={message:({params:{missingProperty:t}})=>(0,Gr.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Gr._)`{missingProperty: ${t}}`},ay={keyword:"required",type:"object",schemaType:"array",$data:!0,error:sy,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:s,it:a}=t,{opts:c}=a;if(!s&&r.length===0)return;let l=r.length>=c.loopRequired;if(a.allErrors?f():p(),c.strictRequired){let h=t.parentSchema.properties,{definedProperties:y}=t.it;for(let v of r)if(h?.[v]===void 0&&!y.has(v)){let I=a.schemaEnv.baseId+a.errSchemaPath,P=`required property "${v}" is not defined at "${I}" (strictRequired)`;(0,oy.checkStrictMode)(a,P,a.opts.strictRequired)}}function f(){if(l||s)t.block$data(Gr.nil,u);else for(let h of r)(0,Yr.checkReportMissingProp)(t,h)}function p(){let h=e.let("missing");if(l||s){let y=e.let("valid",!0);t.block$data(y,()=>m(h,y)),t.ok(y)}else e.if((0,Yr.checkMissingProp)(t,r,h)),(0,Yr.reportMissingProp)(t,h),e.else()}function u(){e.forOf("prop",n,h=>{t.setParams({missingProperty:h}),e.if((0,Yr.noPropertyInData)(e,i,h,c.ownProperties),()=>t.error())})}function m(h,y){t.setParams({missingProperty:h}),e.forOf(h,n,()=>{e.assign(y,(0,Yr.propertyInData)(e,i,h,c.ownProperties)),e.if((0,Gr.not)(y),()=>{t.error(),e.break()})},Gr.nil)}}};ls.default=ay});var nu=T(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});var Xr=K(),cy={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,Xr.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,Xr._)`{limit: ${t}}`},ly={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:cy,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?Xr.operators.GT:Xr.operators.LT;t.fail$data((0,Xr._)`${r}.length ${i} ${n}`)}};us.default=ly});var ni=T(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});var iu=jo();iu.code='require("ajv/dist/runtime/equal").default';ds.default=iu});var ou=T(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});var fs=Mr(),ye=K(),uy=G(),dy=ni(),fy={message:({params:{i:t,j:e}})=>(0,ye.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,ye._)`{i: ${t}, j: ${e}}`},py={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:fy,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:s,schemaCode:a,it:c}=t;if(!n&&!i)return;let l=e.let("valid"),f=s.items?(0,fs.getSchemaTypes)(s.items):[];t.block$data(l,p,(0,ye._)`${a} === false`),t.ok(l);function p(){let y=e.let("i",(0,ye._)`${r}.length`),v=e.let("j");t.setParams({i:y,j:v}),e.assign(l,!0),e.if((0,ye._)`${y} > 1`,()=>(u()?m:h)(y,v))}function u(){return f.length>0&&!f.some(y=>y==="object"||y==="array")}function m(y,v){let I=e.name("item"),P=(0,fs.checkDataTypes)(f,I,c.opts.strictNumbers,fs.DataType.Wrong),D=e.const("indices",(0,ye._)`{}`);e.for((0,ye._)`;${y}--;`,()=>{e.let(I,(0,ye._)`${r}[${y}]`),e.if(P,(0,ye._)`continue`),f.length>1&&e.if((0,ye._)`typeof ${I} == "string"`,(0,ye._)`${I} += "_"`),e.if((0,ye._)`typeof ${D}[${I}] == "number"`,()=>{e.assign(v,(0,ye._)`${D}[${I}]`),t.error(),e.assign(l,!1).break()}).code((0,ye._)`${D}[${I}] = ${y}`)})}function h(y,v){let I=(0,uy.useFunc)(e,dy.default),P=e.name("outer");e.label(P).for((0,ye._)`;${y}--;`,()=>e.for((0,ye._)`${v} = ${y}; ${v}--;`,()=>e.if((0,ye._)`${I}(${r}[${y}], ${r}[${v}])`,()=>{t.error(),e.assign(l,!1).break(P)})))}}};ps.default=py});var su=T(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});var ms=K(),my=G(),hy=ni(),gy={message:"must be equal to constant",params:({schemaCode:t})=>(0,ms._)`{allowedValue: ${t}}`},yy={keyword:"const",$data:!0,error:gy,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,ms._)`!${(0,my.useFunc)(e,hy.default)}(${r}, ${i})`):t.fail((0,ms._)`${s} !== ${r}`)}};hs.default=yy});var au=T(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});var Qr=K(),wy=G(),vy=ni(),$y={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Qr._)`{allowedValues: ${t}}`},by={keyword:"enum",schemaType:"array",$data:!0,error:$y,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:a}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let c=i.length>=a.opts.loopEnum,l,f=()=>l??(l=(0,wy.useFunc)(e,vy.default)),p;if(c||n)p=e.let("valid"),t.block$data(p,u);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let h=e.const("vSchema",s);p=(0,Qr.or)(...i.map((y,v)=>m(h,v)))}t.pass(p);function u(){e.assign(p,!1),e.forOf("v",s,h=>e.if((0,Qr._)`${f()}(${r}, ${h})`,()=>e.assign(p,!0).break()))}function m(h,y){let v=i[y];return typeof v=="object"&&v!==null?(0,Qr._)`${f()}(${r}, ${h}[${y}])`:(0,Qr._)`${r} === ${v}`}}};gs.default=by});var cu=T(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});var _y=Yl(),xy=Gl(),Ey=Zl(),Sy=eu(),Py=tu(),ky=ru(),Ry=nu(),Iy=ou(),Cy=su(),Ty=au(),Ay=[_y.default,xy.default,Ey.default,Sy.default,Py.default,ky.default,Ry.default,Iy.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Cy.default,Ty.default];ys.default=Ay});var vs=T(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.validateAdditionalItems=void 0;var At=K(),ws=G(),Ny={message:({params:{len:t}})=>(0,At.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,At._)`{limit: ${t}}`},jy={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Ny,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,ws.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}lu(t,n)}};function lu(t,e){let{gen:r,schema:n,data:i,keyword:s,it:a}=t;a.items=!0;let c=r.const("len",(0,At._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,At._)`${c} <= ${e.length}`);else if(typeof n=="object"&&!(0,ws.alwaysValidSchema)(a,n)){let f=r.var("valid",(0,At._)`${c} <= ${e.length}`);r.if((0,At.not)(f),()=>l(f)),t.ok(f)}function l(f){r.forRange("i",e.length,c,p=>{t.subschema({keyword:s,dataProp:p,dataPropType:ws.Type.Num},f),a.allErrors||r.if((0,At.not)(f),()=>r.break())})}}Zr.validateAdditionalItems=lu;Zr.default=jy});var $s=T(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.validateTuple=void 0;var uu=K(),ii=G(),Oy=Ae(),My={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return du(t,"additionalItems",e);r.items=!0,!(0,ii.alwaysValidSchema)(r,e)&&t.ok((0,Oy.validateArray)(t))}};function du(t,e,r=t.schema){let{gen:n,parentSchema:i,data:s,keyword:a,it:c}=t;p(i),c.opts.unevaluated&&r.length&&c.items!==!0&&(c.items=ii.mergeEvaluated.items(n,r.length,c.items));let l=n.name("valid"),f=n.const("len",(0,uu._)`${s}.length`);r.forEach((u,m)=>{(0,ii.alwaysValidSchema)(c,u)||(n.if((0,uu._)`${f} > ${m}`,()=>t.subschema({keyword:a,schemaProp:m,dataProp:m},l)),t.ok(l))});function p(u){let{opts:m,errSchemaPath:h}=c,y=r.length,v=y===u.minItems&&(y===u.maxItems||u[e]===!1);if(m.strictTuples&&!v){let I=`"${a}" is ${y}-tuple, but minItems or maxItems/${e} are not specified or different at path "${h}"`;(0,ii.checkStrictMode)(c,I,m.strictTuples)}}}en.validateTuple=du;en.default=My});var fu=T(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});var Vy=$s(),qy={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,Vy.validateTuple)(t,"items")};bs.default=qy});var mu=T(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});var pu=K(),Dy=G(),Ly=Ae(),Fy=vs(),zy={message:({params:{len:t}})=>(0,pu.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,pu._)`{limit: ${t}}`},Hy={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:zy,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,Dy.alwaysValidSchema)(n,e)&&(i?(0,Fy.validateAdditionalItems)(t,i):t.ok((0,Ly.validateArray)(t)))}};_s.default=Hy});var hu=T(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});var je=K(),oi=G(),Uy={message:({params:{min:t,max:e}})=>e===void 0?(0,je.str)`must contain at least ${t} valid item(s)`:(0,je.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,je._)`{minContains: ${t}}`:(0,je._)`{minContains: ${t}, maxContains: ${e}}`},By={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Uy,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t,a,c,{minContains:l,maxContains:f}=n;s.opts.next?(a=l===void 0?1:l,c=f):a=1;let p=e.const("len",(0,je._)`${i}.length`);if(t.setParams({min:a,max:c}),c===void 0&&a===0){(0,oi.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(c!==void 0&&a>c){(0,oi.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,oi.alwaysValidSchema)(s,r)){let v=(0,je._)`${p} >= ${a}`;c!==void 0&&(v=(0,je._)`${v} && ${p} <= ${c}`),t.pass(v);return}s.items=!0;let u=e.name("valid");c===void 0&&a===1?h(u,()=>e.if(u,()=>e.break())):a===0?(e.let(u,!0),c!==void 0&&e.if((0,je._)`${i}.length > 0`,m)):(e.let(u,!1),m()),t.result(u,()=>t.reset());function m(){let v=e.name("_valid"),I=e.let("count",0);h(v,()=>e.if(v,()=>y(I)))}function h(v,I){e.forRange("i",0,p,P=>{t.subschema({keyword:"contains",dataProp:P,dataPropType:oi.Type.Num,compositeRule:!0},v),I()})}function y(v){e.code((0,je._)`${v}++`),c===void 0?e.if((0,je._)`${v} >= ${a}`,()=>e.assign(u,!0).break()):(e.if((0,je._)`${v} > ${c}`,()=>e.assign(u,!1).break()),a===1?e.assign(u,!0):e.if((0,je._)`${v} >= ${a}`,()=>e.assign(u,!0)))}}};xs.default=By});var si=T(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.validateSchemaDeps=Ke.validatePropertyDeps=Ke.error=void 0;var Es=K(),Ky=G(),tn=Ae();Ke.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,Es.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,Es._)`{property: ${t},
|
|
61
|
+
missingProperty: ${n},
|
|
62
|
+
depsCount: ${e},
|
|
63
|
+
deps: ${r}}`};var Jy={keyword:"dependencies",type:"object",schemaType:"object",error:Ke.error,code(t){let[e,r]=Wy(t);gu(t,e),yu(t,r)}};function Wy({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let i=Array.isArray(t[n])?e:r;i[n]=t[n]}return[e,r]}function gu(t,e=t.schema){let{gen:r,data:n,it:i}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let a in e){let c=e[a];if(c.length===0)continue;let l=(0,tn.propertyInData)(r,n,a,i.opts.ownProperties);t.setParams({property:a,depsCount:c.length,deps:c.join(", ")}),i.allErrors?r.if(l,()=>{for(let f of c)(0,tn.checkReportMissingProp)(t,f)}):(r.if((0,Es._)`${l} && (${(0,tn.checkMissingProp)(t,c,s)})`),(0,tn.reportMissingProp)(t,s),r.else())}}Ke.validatePropertyDeps=gu;function yu(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,a=r.name("valid");for(let c in e)(0,Ky.alwaysValidSchema)(s,e[c])||(r.if((0,tn.propertyInData)(r,n,c,s.opts.ownProperties),()=>{let l=t.subschema({keyword:i,schemaProp:c},a);t.mergeValidEvaluated(l,a)},()=>r.var(a,!0)),t.ok(a))}Ke.validateSchemaDeps=yu;Ke.default=Jy});var vu=T(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});var wu=K(),Yy=G(),Gy={message:"property name must be valid",params:({params:t})=>(0,wu._)`{propertyName: ${t.propertyName}}`},Xy={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Gy,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,Yy.alwaysValidSchema)(i,r))return;let s=e.name("valid");e.forIn("key",n,a=>{t.setParams({propertyName:a}),t.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},s),e.if((0,wu.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};Ss.default=Xy});var ks=T(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});var ai=Ae(),De=K(),Qy=Te(),ci=G(),Zy={message:"must NOT have additional properties",params:({params:t})=>(0,De._)`{additionalProperty: ${t.additionalProperty}}`},ew={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Zy,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:s,it:a}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:c,opts:l}=a;if(a.props=!0,l.removeAdditional!=="all"&&(0,ci.alwaysValidSchema)(a,r))return;let f=(0,ai.allSchemaProperties)(n.properties),p=(0,ai.allSchemaProperties)(n.patternProperties);u(),t.ok((0,De._)`${s} === ${Qy.default.errors}`);function u(){e.forIn("key",i,I=>{!f.length&&!p.length?y(I):e.if(m(I),()=>y(I))})}function m(I){let P;if(f.length>8){let D=(0,ci.schemaRefOrVal)(a,n.properties,"properties");P=(0,ai.isOwnProperty)(e,D,I)}else f.length?P=(0,De.or)(...f.map(D=>(0,De._)`${I} === ${D}`)):P=De.nil;return p.length&&(P=(0,De.or)(P,...p.map(D=>(0,De._)`${(0,ai.usePattern)(t,D)}.test(${I})`))),(0,De.not)(P)}function h(I){e.code((0,De._)`delete ${i}[${I}]`)}function y(I){if(l.removeAdditional==="all"||l.removeAdditional&&r===!1){h(I);return}if(r===!1){t.setParams({additionalProperty:I}),t.error(),c||e.break();return}if(typeof r=="object"&&!(0,ci.alwaysValidSchema)(a,r)){let P=e.name("valid");l.removeAdditional==="failing"?(v(I,P,!1),e.if((0,De.not)(P),()=>{t.reset(),h(I)})):(v(I,P),c||e.if((0,De.not)(P),()=>e.break()))}}function v(I,P,D){let z={keyword:"additionalProperties",dataProp:I,dataPropType:ci.Type.Str};D===!1&&Object.assign(z,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(z,P)}}};Ps.default=ew});var _u=T(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});var tw=Lr(),$u=Ae(),Rs=G(),bu=ks(),rw={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&bu.default.code(new tw.KeywordCxt(s,bu.default,"additionalProperties"));let a=(0,$u.allSchemaProperties)(r);for(let u of a)s.definedProperties.add(u);s.opts.unevaluated&&a.length&&s.props!==!0&&(s.props=Rs.mergeEvaluated.props(e,(0,Rs.toHash)(a),s.props));let c=a.filter(u=>!(0,Rs.alwaysValidSchema)(s,r[u]));if(c.length===0)return;let l=e.name("valid");for(let u of c)f(u)?p(u):(e.if((0,$u.propertyInData)(e,i,u,s.opts.ownProperties)),p(u),s.allErrors||e.else().var(l,!0),e.endIf()),t.it.definedProperties.add(u),t.ok(l);function f(u){return s.opts.useDefaults&&!s.compositeRule&&r[u].default!==void 0}function p(u){t.subschema({keyword:"properties",schemaProp:u,dataProp:u},l)}}};Is.default=rw});var Pu=T(Cs=>{"use strict";Object.defineProperty(Cs,"__esModule",{value:!0});var xu=Ae(),li=K(),Eu=G(),Su=G(),nw={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:s}=t,{opts:a}=s,c=(0,xu.allSchemaProperties)(r),l=c.filter(v=>(0,Eu.alwaysValidSchema)(s,r[v]));if(c.length===0||l.length===c.length&&(!s.opts.unevaluated||s.props===!0))return;let f=a.strictSchema&&!a.allowMatchingProperties&&i.properties,p=e.name("valid");s.props!==!0&&!(s.props instanceof li.Name)&&(s.props=(0,Su.evaluatedPropsToName)(e,s.props));let{props:u}=s;m();function m(){for(let v of c)f&&h(v),s.allErrors?y(v):(e.var(p,!0),y(v),e.if(p))}function h(v){for(let I in f)new RegExp(v).test(I)&&(0,Eu.checkStrictMode)(s,`property ${I} matches pattern ${v} (use allowMatchingProperties)`)}function y(v){e.forIn("key",n,I=>{e.if((0,li._)`${(0,xu.usePattern)(t,v)}.test(${I})`,()=>{let P=l.includes(v);P||t.subschema({keyword:"patternProperties",schemaProp:v,dataProp:I,dataPropType:Su.Type.Str},p),s.opts.unevaluated&&u!==!0?e.assign((0,li._)`${u}[${I}]`,!0):!P&&!s.allErrors&&e.if((0,li.not)(p),()=>e.break())})})}}};Cs.default=nw});var ku=T(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});var iw=G(),ow={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,iw.alwaysValidSchema)(n,r)){t.fail();return}let i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};Ts.default=ow});var Ru=T(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});var sw=Ae(),aw={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:sw.validateUnion,error:{message:"must match a schema in anyOf"}};As.default=aw});var Iu=T(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});var ui=K(),cw=G(),lw={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,ui._)`{passingSchemas: ${t.passing}}`},uw={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:lw,code(t){let{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,a=e.let("valid",!1),c=e.let("passing",null),l=e.name("_valid");t.setParams({passing:c}),e.block(f),t.result(a,()=>t.reset(),()=>t.error(!0));function f(){s.forEach((p,u)=>{let m;(0,cw.alwaysValidSchema)(i,p)?e.var(l,!0):m=t.subschema({keyword:"oneOf",schemaProp:u,compositeRule:!0},l),u>0&&e.if((0,ui._)`${l} && ${a}`).assign(a,!1).assign(c,(0,ui._)`[${c}, ${u}]`).else(),e.if(l,()=>{e.assign(a,!0),e.assign(c,u),m&&t.mergeEvaluated(m,ui.Name)})})}}};Ns.default=uw});var Cu=T(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});var dw=G(),fw={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=e.name("valid");r.forEach((s,a)=>{if((0,dw.alwaysValidSchema)(n,s))return;let c=t.subschema({keyword:"allOf",schemaProp:a},i);t.ok(i),t.mergeEvaluated(c)})}};js.default=fw});var Nu=T(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});var di=K(),Au=G(),pw={message:({params:t})=>(0,di.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,di._)`{failingKeyword: ${t.ifClause}}`},mw={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:pw,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,Au.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=Tu(n,"then"),s=Tu(n,"else");if(!i&&!s)return;let a=e.let("valid",!0),c=e.name("_valid");if(l(),t.reset(),i&&s){let p=e.let("ifClause");t.setParams({ifClause:p}),e.if(c,f("then",p),f("else",p))}else i?e.if(c,f("then")):e.if((0,di.not)(c),f("else"));t.pass(a,()=>t.error(!0));function l(){let p=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},c);t.mergeEvaluated(p)}function f(p,u){return()=>{let m=t.subschema({keyword:p},c);e.assign(a,c),t.mergeValidEvaluated(m,a),u?e.assign(u,(0,di._)`${p}`):t.setParams({ifClause:p})}}}};function Tu(t,e){let r=t.schema[e];return r!==void 0&&!(0,Au.alwaysValidSchema)(t,r)}Os.default=mw});var ju=T(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});var hw=G(),gw={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,hw.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Ms.default=gw});var Ou=T(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});var yw=vs(),ww=fu(),vw=$s(),$w=mu(),bw=hu(),_w=si(),xw=vu(),Ew=ks(),Sw=_u(),Pw=Pu(),kw=ku(),Rw=Ru(),Iw=Iu(),Cw=Cu(),Tw=Nu(),Aw=ju();function Nw(t=!1){let e=[kw.default,Rw.default,Iw.default,Cw.default,Tw.default,Aw.default,xw.default,Ew.default,_w.default,Sw.default,Pw.default];return t?e.push(ww.default,$w.default):e.push(yw.default,vw.default),e.push(bw.default),e}Vs.default=Nw});var Ds=T(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.dynamicAnchor=void 0;var qs=K(),jw=Te(),Mu=zr(),Ow=ei(),Mw={keyword:"$dynamicAnchor",schemaType:"string",code:t=>Vu(t,t.schema)};function Vu(t,e){let{gen:r,it:n}=t;n.schemaEnv.root.dynamicAnchors[e]=!0;let i=(0,qs._)`${jw.default.dynamicAnchors}${(0,qs.getProperty)(e)}`,s=n.errSchemaPath==="#"?n.validateName:Vw(t);r.if((0,qs._)`!${i}`,()=>r.assign(i,s))}rn.dynamicAnchor=Vu;function Vw(t){let{schemaEnv:e,schema:r,self:n}=t.it,{root:i,baseId:s,localRefs:a,meta:c}=e.root,{schemaId:l}=n.opts,f=new Mu.SchemaEnv({schema:r,schemaId:l,root:i,baseId:s,localRefs:a,meta:c});return Mu.compileSchema.call(n,f),(0,Ow.getValidate)(t,f)}rn.default=Mw});var Ls=T(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.dynamicRef=void 0;var qu=K(),qw=Te(),Du=ei(),Dw={keyword:"$dynamicRef",schemaType:"string",code:t=>Lu(t,t.schema)};function Lu(t,e){let{gen:r,keyword:n,it:i}=t;if(e[0]!=="#")throw new Error(`"${n}" only supports hash fragment reference`);let s=e.slice(1);if(i.allErrors)a();else{let l=r.let("valid",!1);a(l),t.ok(l)}function a(l){if(i.schemaEnv.root.dynamicAnchors[s]){let f=r.let("_v",(0,qu._)`${qw.default.dynamicAnchors}${(0,qu.getProperty)(s)}`);r.if(f,c(f,l),c(i.validateName,l))}else c(i.validateName,l)()}function c(l,f){return f?()=>r.block(()=>{(0,Du.callRef)(t,l),r.let(f,!0)}):()=>(0,Du.callRef)(t,l)}}nn.dynamicRef=Lu;nn.default=Dw});var Fu=T(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});var Lw=Ds(),Fw=G(),zw={keyword:"$recursiveAnchor",schemaType:"boolean",code(t){t.schema?(0,Lw.dynamicAnchor)(t,""):(0,Fw.checkStrictMode)(t.it,"$recursiveAnchor: false is ignored")}};Fs.default=zw});var zu=T(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});var Hw=Ls(),Uw={keyword:"$recursiveRef",schemaType:"string",code:t=>(0,Hw.dynamicRef)(t,t.schema)};zs.default=Uw});var Hu=T(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});var Bw=Ds(),Kw=Ls(),Jw=Fu(),Ww=zu(),Yw=[Bw.default,Kw.default,Jw.default,Ww.default];Hs.default=Yw});var Bu=T(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});var Uu=si(),Gw={keyword:"dependentRequired",type:"object",schemaType:"object",error:Uu.error,code:t=>(0,Uu.validatePropertyDeps)(t)};Us.default=Gw});var Ku=T(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});var Xw=si(),Qw={keyword:"dependentSchemas",type:"object",schemaType:"object",code:t=>(0,Xw.validateSchemaDeps)(t)};Bs.default=Qw});var Ju=T(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});var Zw=G(),ev={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:t,parentSchema:e,it:r}){e.contains===void 0&&(0,Zw.checkStrictMode)(r,`"${t}" without "contains" is ignored`)}};Ks.default=ev});var Wu=T(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});var tv=Bu(),rv=Ku(),nv=Ju(),iv=[tv.default,rv.default,nv.default];Js.default=iv});var Gu=T(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});var gt=K(),Yu=G(),ov=Te(),sv={message:"must NOT have unevaluated properties",params:({params:t})=>(0,gt._)`{unevaluatedProperty: ${t.unevaluatedProperty}}`},av={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:sv,code(t){let{gen:e,schema:r,data:n,errsCount:i,it:s}=t;if(!i)throw new Error("ajv implementation error");let{allErrors:a,props:c}=s;c instanceof gt.Name?e.if((0,gt._)`${c} !== true`,()=>e.forIn("key",n,u=>e.if(f(c,u),()=>l(u)))):c!==!0&&e.forIn("key",n,u=>c===void 0?l(u):e.if(p(c,u),()=>l(u))),s.props=!0,t.ok((0,gt._)`${i} === ${ov.default.errors}`);function l(u){if(r===!1){t.setParams({unevaluatedProperty:u}),t.error(),a||e.break();return}if(!(0,Yu.alwaysValidSchema)(s,r)){let m=e.name("valid");t.subschema({keyword:"unevaluatedProperties",dataProp:u,dataPropType:Yu.Type.Str},m),a||e.if((0,gt.not)(m),()=>e.break())}}function f(u,m){return(0,gt._)`!${u} || !${u}[${m}]`}function p(u,m){let h=[];for(let y in u)u[y]===!0&&h.push((0,gt._)`${m} !== ${y}`);return(0,gt.and)(...h)}}};Ws.default=av});var Qu=T(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});var Nt=K(),Xu=G(),cv={message:({params:{len:t}})=>(0,Nt.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Nt._)`{limit: ${t}}`},lv={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:cv,code(t){let{gen:e,schema:r,data:n,it:i}=t,s=i.items||0;if(s===!0)return;let a=e.const("len",(0,Nt._)`${n}.length`);if(r===!1)t.setParams({len:s}),t.fail((0,Nt._)`${a} > ${s}`);else if(typeof r=="object"&&!(0,Xu.alwaysValidSchema)(i,r)){let l=e.var("valid",(0,Nt._)`${a} <= ${s}`);e.if((0,Nt.not)(l),()=>c(l,s)),t.ok(l)}i.items=!0;function c(l,f){e.forRange("i",f,a,p=>{t.subschema({keyword:"unevaluatedItems",dataProp:p,dataPropType:Xu.Type.Num},l),i.allErrors||e.if((0,Nt.not)(l),()=>e.break())})}}};Ys.default=lv});var Zu=T(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});var uv=Gu(),dv=Qu(),fv=[uv.default,dv.default];Gs.default=fv});var ed=T(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});var de=K(),pv={message:({schemaCode:t})=>(0,de.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,de._)`{format: ${t}}`},mv={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:pv,code(t,e){let{gen:r,data:n,$data:i,schema:s,schemaCode:a,it:c}=t,{opts:l,errSchemaPath:f,schemaEnv:p,self:u}=c;if(!l.validateFormats)return;i?m():h();function m(){let y=r.scopeValue("formats",{ref:u.formats,code:l.code.formats}),v=r.const("fDef",(0,de._)`${y}[${a}]`),I=r.let("fType"),P=r.let("format");r.if((0,de._)`typeof ${v} == "object" && !(${v} instanceof RegExp)`,()=>r.assign(I,(0,de._)`${v}.type || "string"`).assign(P,(0,de._)`${v}.validate`),()=>r.assign(I,(0,de._)`"string"`).assign(P,v)),t.fail$data((0,de.or)(D(),z()));function D(){return l.strictSchema===!1?de.nil:(0,de._)`${a} && !${P}`}function z(){let L=p.$async?(0,de._)`(${v}.async ? await ${P}(${n}) : ${P}(${n}))`:(0,de._)`${P}(${n})`,N=(0,de._)`(typeof ${P} == "function" ? ${L} : ${P}.test(${n}))`;return(0,de._)`${P} && ${P} !== true && ${I} === ${e} && !${N}`}}function h(){let y=u.formats[s];if(!y){D();return}if(y===!0)return;let[v,I,P]=z(y);v===e&&t.pass(L());function D(){if(l.strictSchema===!1){u.logger.warn(N());return}throw new Error(N());function N(){return`unknown format "${s}" ignored in schema at path "${f}"`}}function z(N){let X=N instanceof RegExp?(0,de.regexpCode)(N):l.code.formats?(0,de._)`${l.code.formats}${(0,de.getProperty)(s)}`:void 0,fe=r.scopeValue("formats",{key:s,ref:N,code:X});return typeof N=="object"&&!(N instanceof RegExp)?[N.type||"string",N.validate,(0,de._)`${fe}.validate`]:["string",N,fe]}function L(){if(typeof y=="object"&&!(y instanceof RegExp)&&y.async){if(!p.$async)throw new Error("async format in sync schema");return(0,de._)`await ${P}(${n})`}return typeof I=="function"?(0,de._)`${P}(${n})`:(0,de._)`${P}.test(${n})`}}}};Xs.default=mv});var td=T(Qs=>{"use strict";Object.defineProperty(Qs,"__esModule",{value:!0});var hv=ed(),gv=[hv.default];Qs.default=gv});var rd=T(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.contentVocabulary=ar.metadataVocabulary=void 0;ar.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];ar.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var id=T(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});var yv=Wl(),wv=cu(),vv=Ou(),$v=Hu(),bv=Wu(),_v=Zu(),xv=td(),nd=rd(),Ev=[$v.default,yv.default,wv.default,(0,vv.default)(!0),xv.default,nd.metadataVocabulary,nd.contentVocabulary,bv.default,_v.default];Zs.default=Ev});var sd=T(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.DiscrError=void 0;var od;(function(t){t.Tag="tag",t.Mapping="mapping"})(od||(fi.DiscrError=od={}))});var cd=T(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});var cr=K(),ea=sd(),ad=zr(),Sv=Fr(),Pv=G(),kv={message:({params:{discrError:t,tagName:e}})=>t===ea.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,cr._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},Rv={keyword:"discriminator",type:"object",schemaType:"object",error:kv,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:s}=t,{oneOf:a}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let c=n.propertyName;if(typeof c!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");let l=e.let("valid",!1),f=e.const("tag",(0,cr._)`${r}${(0,cr.getProperty)(c)}`);e.if((0,cr._)`typeof ${f} == "string"`,()=>p(),()=>t.error(!1,{discrError:ea.DiscrError.Tag,tag:f,tagName:c})),t.ok(l);function p(){let h=m();e.if(!1);for(let y in h)e.elseIf((0,cr._)`${f} === ${y}`),e.assign(l,u(h[y]));e.else(),t.error(!1,{discrError:ea.DiscrError.Mapping,tag:f,tagName:c}),e.endIf()}function u(h){let y=e.name("valid"),v=t.subschema({keyword:"oneOf",schemaProp:h},y);return t.mergeEvaluated(v,cr.Name),y}function m(){var h;let y={},v=P(i),I=!0;for(let L=0;L<a.length;L++){let N=a[L];if(N?.$ref&&!(0,Pv.schemaHasRulesButRef)(N,s.self.RULES)){let fe=N.$ref;if(N=ad.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,fe),N instanceof ad.SchemaEnv&&(N=N.schema),N===void 0)throw new Sv.default(s.opts.uriResolver,s.baseId,fe)}let X=(h=N?.properties)===null||h===void 0?void 0:h[c];if(typeof X!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${c}"`);I=I&&(v||P(N)),D(X,L)}if(!I)throw new Error(`discriminator: "${c}" must be required`);return y;function P({required:L}){return Array.isArray(L)&&L.includes(c)}function D(L,N){if(L.const)z(L.const,N);else if(L.enum)for(let X of L.enum)z(X,N);else throw new Error(`discriminator: "properties/${c}" must have "const" or "enum"`)}function z(L,N){if(typeof L!="string"||L in y)throw new Error(`discriminator: "${c}" values must be unique strings`);y[L]=N}}}};ta.default=Rv});var ld=T((wx,Iv)=>{Iv.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}});var ud=T((vx,Cv)=>{Cv.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}});var dd=T(($x,Tv)=>{Tv.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}});var fd=T((bx,Av)=>{Av.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}});var pd=T((_x,Nv)=>{Nv.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}});var md=T((xx,jv)=>{jv.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}});var hd=T((Ex,Ov)=>{Ov.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var gd=T((Sx,Mv)=>{Mv.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var yd=T(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});var Vv=ld(),qv=ud(),Dv=dd(),Lv=fd(),Fv=pd(),zv=md(),Hv=hd(),Uv=gd(),Bv=["/properties"];function Kv(t){return[Vv,qv,Dv,Lv,Fv,e(this,zv),Hv,e(this,Uv)].forEach(r=>this.addMetaSchema(r,void 0,!1)),this;function e(r,n){return t?r.$dataMetaSchema(n,Bv):n}}ra.default=Kv});var wd=T((ce,ia)=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.MissingRefError=ce.ValidationError=ce.CodeGen=ce.Name=ce.nil=ce.stringify=ce.str=ce._=ce.KeywordCxt=ce.Ajv2020=void 0;var Jv=Hl(),Wv=id(),Yv=cd(),Gv=yd(),na="https://json-schema.org/draft/2020-12/schema",lr=class extends Jv.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),Wv.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(Yv.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:r}=this.opts;r&&(Gv.default.call(this,e),this.refs["http://json-schema.org/schema"]=na)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(na)?na:void 0)}};ce.Ajv2020=lr;ia.exports=ce=lr;ia.exports.Ajv2020=lr;Object.defineProperty(ce,"__esModule",{value:!0});ce.default=lr;var Xv=Lr();Object.defineProperty(ce,"KeywordCxt",{enumerable:!0,get:function(){return Xv.KeywordCxt}});var ur=K();Object.defineProperty(ce,"_",{enumerable:!0,get:function(){return ur._}});Object.defineProperty(ce,"str",{enumerable:!0,get:function(){return ur.str}});Object.defineProperty(ce,"stringify",{enumerable:!0,get:function(){return ur.stringify}});Object.defineProperty(ce,"nil",{enumerable:!0,get:function(){return ur.nil}});Object.defineProperty(ce,"Name",{enumerable:!0,get:function(){return ur.Name}});Object.defineProperty(ce,"CodeGen",{enumerable:!0,get:function(){return ur.CodeGen}});var Qv=Kn();Object.defineProperty(ce,"ValidationError",{enumerable:!0,get:function(){return Qv.default}});var Zv=Fr();Object.defineProperty(ce,"MissingRefError",{enumerable:!0,get:function(){return Zv.default}})});import{readFile as n$}from"node:fs/promises";async function xd(t){return Oe.load(await n$(t,"utf-8"))}function Ed(t,e,r){for(let n of t)if(!e.has(n))throw new Error(`${r}: unknown element "${n}" \u2014 not in spec/ui-dsl.schema.json vocabulary`)}function Sd(t,e,r){for(let[n,i]of Object.entries(t))for(let s of e)if(i[s]===void 0||i[s]===null||i[s]==="")throw new Error(`${r}: element "${n}" is missing required "${String(s)}"`)}var Pd=ne(()=>{"use strict";Ht()});import{resolve as i$}from"node:path";function o$(t){Ed(Object.keys(t.elements),et,kd),Sd(t.elements,["tag"],kd)}async function sa(t){if(!t&&oa)return oa;let e=t??i$(Ze(),"renderers/react/elements.yaml"),r=await xd(e);return o$(r),t||(oa=r),r}var kd,oa,Rd=ne(()=>{"use strict";ct();ct();br();Pd();kd="renderers/react/elements.yaml",oa=null});function Id(t){if(t)return t==="start"?"flex-start":t==="end"?"flex-end":t}function Cd(t){if(t)return t==="start"?"flex-start":t==="end"?"flex-end":t==="between"||t==="spaceBetween"?"space-between":t==="around"||t==="spaceAround"?"space-around":t==="spaceEvenly"?"space-evenly":t}var Td=ne(()=>{"use strict"});function Le(t){return`${t}px`}function dr(t){let e=t.match(/^\{([^}]+)\}$/);if(e)return`var(--${e[1].replace(/\./g,"-")})`}function aa(t){let e={},r=t.width;typeof r=="number"?e.width=Le(r):r==="fill"?e.width="100%":typeof r=="string"&&r!=="wrap"&&(e.width=r),typeof t.minWidth=="number"&&(e.minWidth=Le(t.minWidth));let n=t.maxWidth;typeof n=="number"?e.maxWidth=Le(n):n==="fill"&&(e.maxWidth="100%");let i=t.height;typeof i=="number"?e.height=Le(i):i==="fill"?e.height="100%":typeof i=="string"&&i!=="wrap"&&(e.height=i),typeof t.minHeight=="number"&&(e.minHeight=Le(t.minHeight));let s=t.maxHeight;typeof s=="number"?e.maxHeight=Le(s):s==="fill"&&(e.maxHeight="100%"),t.aspectRatio!==void 0&&(e.aspectRatio=String(t.aspectRatio));let a=t.weight;typeof a=="number"&&(e.flexGrow=a),typeof t.padding=="number"&&(e.padding=Le(t.padding)),typeof t.margin=="number"&&(e.margin=Le(t.margin)),typeof t.gap=="number"&&(e.gap=Le(t.gap));let c=t.textAlign;typeof c=="string"&&(e.textAlign=c==="start"?"left":c==="end"?"right":c);let l=t.contentAlign;typeof l=="string"&&l in Ad&&(e.placeItems=Ad[l]),typeof t.overflow=="string"&&(e.overflow=t.overflow);let f=t.selfAlign;typeof f=="string"&&(e.alignSelf=f==="start"?"flex-start":f==="end"?"flex-end":f);let p=t.size;typeof p=="number"?e.fontSize=Le(p):typeof p=="string"&&(e.fontSize=p);let u=typeof a=="string"?a:t.fontWeight;typeof u=="string"&&(e.fontWeight=u);let m=t.background;typeof m=="string"&&(e.background=dr(m)??m);let h=t.foreground;typeof h=="string"&&(e.color=dr(h)??h);let y=t.radius;typeof y=="number"?e.borderRadius=Le(y):typeof y=="string"&&(e.borderRadius=dr(y)??y);let v=t.shadow;v===!0?e.boxShadow="var(--ui-shadow)":v===!1?e.boxShadow="none":typeof v=="string"&&(e.boxShadow=s$[v]??dr(v)??v);let I=t.border;typeof I=="string"&&(e.border=dr(I)??I),typeof t.opacity=="number"&&(e.opacity=t.opacity);let P=t.clip;typeof P=="string"&&(e.overflow=P==="hidden"?"hidden":P);let D=t.align;if(typeof D=="string"){let X=Id(D);X&&(e.alignItems=X)}let z=t.justify;if(typeof z=="string"){let X=Cd(z);X&&(e.justifyContent=X)}typeof t.display=="string"&&(e.display=t.display),typeof t.gridTemplateColumns=="string"&&(e.gridTemplateColumns=t.gridTemplateColumns),typeof t.flexDirection=="string"&&(e.flexDirection=t.flexDirection),typeof t.alignItems=="string"&&(e.alignItems=t.alignItems);let L=t.borderColor;typeof L=="string"&&(e.borderColor=dr(L)??L);let N=t.flex;return typeof N=="number"&&(e.flex=N),e}function on(t){let e=Object.entries(t);return e.length===0?"":`style={{ ${e.map(([n,i])=>typeof i=="number"?`${n}: ${i}`:`${n}: ${JSON.stringify(i)}`).join(", ")} }}`}var Ad,s$,ca=ne(()=>{"use strict";Td();Ad={topStart:"start start",top:"center start",topEnd:"end start",start:"start center",center:"center center",end:"end center",bottomStart:"start end",bottom:"center end",bottomEnd:"end end"},s$={none:"none",sm:"var(--ui-shadow-sm, 0 1px 2px rgba(0,0,0,0.05))",md:"var(--ui-shadow)",lg:"var(--ui-shadow-lg, 0 10px 15px rgba(0,0,0,0.1))"}});function mi(t,e){let r=t[e];if(r!=null){if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="object"&&"kind"in r&&r.kind==="literal")return r.value}}function a$(t,e){if(e!=null&&!(typeof e=="string"||typeof e=="number"||typeof e=="boolean")&&!(typeof e=="object"&&"kind"in e&&e.kind==="literal"))throw new Error(`Style property "${t}" must be a compile-time literal; ViewModel bindings are not allowed on layout/visual props`)}function c$(t){let e={};for(let[r,n]of Object.entries(t)){if(!La.has(r))continue;a$(r,n);let i=mi(t,r);i!==void 0&&(e[r]=i)}return e}function l$(t){return t.flex?{display:"flex",flexDirection:t.flex==="column"?"column":"row"}:{}}function u$(t){return t==="horizontal"?{overflowX:"auto",overflowY:"hidden"}:t==="both"?{overflowX:"auto",overflowY:"auto"}:t==="none"?{overflowX:"hidden",overflowY:"hidden"}:{overflowX:"hidden",overflowY:"auto"}}function Nd(t,e){let r=c$(e),n=aa(r);if(n={...n,...l$(t)},t.tableCell){if("alignItems"in n){let i=String(n.alignItems);n.textAlign=i==="flex-end"?"right":i==="center"?"center":"left",delete n.alignItems}"width"in n&&!("flex"in n)&&(n.flexShrink=0,n.flexGrow=0)}if(t.scrollContainer){let i=mi(e,"scroll"),s=mi(e,"axis"),a=typeof i=="string"?i:typeof s=="string"?s==="horizontal"?"horizontal":"vertical":void 0;if(a)return n={...n,...u$(a)},on(n);throw new Error("ScrollArea scroll/axis must be compile-time literals")}if(t.flexGrowProp&&e[t.flexGrowProp]){let i=mi(e,t.flexGrowProp);if(typeof i=="number")return n.flexGrow=i,on(n);throw new Error(`"${t.flexGrowProp}" on <Spacer> must be a compile-time literal`)}return on(n)}var jd=ne(()=>{"use strict";ct();ca();ca()});function U(t){return" ".repeat(t)}function Ot(t,e="vm"){let r=t.scope??e;return t.path?`${r}.${t.path}`:r}function Dd(t){return t.parts.map(e=>typeof e=="string"?e:`\${${Ot(e)}}`).join("")}function d$(t){return`\`${Dd(t)}\``}function hi(t,e=!1){let r=e?" as ActionDescriptor":"";if(!t.params||Object.keys(t.params).length===0)return`{ name: ${JSON.stringify(t.name)} }${r}`;let n=Object.entries(t.params).map(([i,s])=>`${i}: ${pr(s,0)}`).join(", ");return`{ name: ${JSON.stringify(t.name)}, params: { ${n} } }${r}`}function ua(t,e,r=!1){if(t===null)return"null";if(typeof t=="string")return JSON.stringify(t);if(typeof t=="number"||typeof t=="boolean")return String(t);if(Array.isArray(t))return`[
|
|
64
|
+
${t.map(n=>`${U(e+1)}${ua(n,e+1,r)}`).join(`,
|
|
65
|
+
`)}
|
|
66
|
+
${U(e)}]`;if(typeof t=="object"&&t!==null){let n=t;return"kind"in n&&n.kind==="action"?hi(n,r):`{
|
|
67
|
+
${Object.entries(n).map(([s,a])=>`${s}: ${ua(a,e+1,r)}`).map(s=>`${U(e+1)}${s}`).join(`,
|
|
68
|
+
`)}
|
|
69
|
+
${U(e)}}`}return"undefined"}function pr(t,e,r=!1){if(t===null)return"null";if(typeof t=="string")return JSON.stringify(t);if(typeof t=="number"||typeof t=="boolean")return String(t);if(Array.isArray(t))return`[
|
|
70
|
+
${t.map(n=>`${U(e+1)}${pr(n,e+1,r)}`).join(`,
|
|
71
|
+
`)}
|
|
72
|
+
${U(e)}]`;if(typeof t=="object"&&t!==null&&"kind"in t){if(t.kind==="binding")return Ot(t);if(t.kind==="action")return hi(t,r);if(t.kind==="literal")return ua(t.value,e,r);if(t.kind==="concat")return d$(t)}return"undefined"}function fr(t,e){let r=t[e];if(r!=null){if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="object"&&"kind"in r&&r.kind==="literal")return r.value}}function H(t,e){let r=t[e];if(r!=null)return pr(r,0)}function an(t,e,r){let n=Nd(e,r);n&&t.push(n)}function f$(t,e){let r=t.action??t[e==="onClick"?"onClick":"onSubmit"];if(!r||typeof r!="object"||!("kind"in r)||r.kind!=="action")return;let n=hi(r,!0);return e==="onSubmit"?`onSubmit={(e) => { e.preventDefault(); void dispatchAction(${n}); }}`:`onClick={() => { void dispatchAction(${n}); }}`}function la(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function p$(t,e){let r=fr(e,"variant");if(typeof r=="string")return` vc-${la(t)}--${r}`;let n=e.variant;if(n&&typeof n=="object"&&"kind"in n&&n.kind==="concat")return` vc-${la(t)}--${Dd(n)}`;let i=H(e,"variant");if(i)return` vc-${la(t)}--\${${i}}`}function cn(t,e,r){let n=e.className??"",i=p$(t,r);if(i)return typeof fr(r,"variant")=="string"?`className="${n}${i}"`:`className={\`${n}${i}\`}`;if(e.wrapProp&&fr(r,e.wrapProp)===!0)return`className="${n} vc-wrap"`;if(e.sizeClass&&r.size){let s=H(r,"size");return`className={\`${e.className} ${e.sizeClass}-\${${s} ?? 'md'}\`}`}return`className="${n}"`}function Od(t,e,r){let n=fr(e,"label"),i=fr(e,"help"),s=fr(e,"error"),a=H(e,"label"),c=H(e,"help"),l=H(e,"error"),f=[`${U(r)}<label className="vc-field">`];return typeof n=="string"?f.push(`${U(r+1)}<span className="vc-text vc-text--field-label">{${JSON.stringify(n)}}</span>`):a&&f.push(`${U(r+1)}{${a} ? <span className="vc-text vc-text--field-label">{${a}}</span> : null}`),f.push(`${U(r+1)}${t}`),typeof i=="string"?f.push(`${U(r+1)}<span className="vc-text vc-text--field-help">{${JSON.stringify(i)}}</span>`):c&&f.push(`${U(r+1)}{${c} ? <span className="vc-text vc-text--field-help">{${c}}</span> : null}`),typeof s=="string"?f.push(`${U(r+1)}<span className="vc-text vc-text--field-error">{${JSON.stringify(s)}}</span>`):l&&f.push(`${U(r+1)}{${l} ? <span className="vc-text vc-text--field-error">{${l}}</span> : null}`),f.push(`${U(r)}</label>`),f.join(`
|
|
73
|
+
`)}function m$(t,e){let r=H(t,"name")??'""',n=H(t,"label")??'""',i=t.checked?`defaultChecked={${H(t,"checked")}}`:"",s=t.enabled?`disabled={${H(t,"enabled")} === false}`:"";return`${U(e)}<label className="vc-checkbox">
|
|
74
|
+
${U(e+1)}<input type="checkbox" name={${r}} ${i} ${s} />
|
|
75
|
+
${U(e+1)}<span>{${n}}</span>
|
|
76
|
+
${U(e)}</label>`}function h$(t,e){let r=H(t,"binding")??H(t,"name")??'""',n=H(t,"value")??'""',i=H(t,"label")??'""',s=t.checked?`defaultChecked={${H(t,"checked")}}`:"",a=t.enabled?`disabled={${H(t,"enabled")} === false}`:"";return`${U(e)}<label className="vc-radio">
|
|
77
|
+
${U(e+1)}<input type="radio" name={${r}} value={${n}} ${s} ${a} />
|
|
78
|
+
${U(e+1)}<span>{${i}}</span>
|
|
79
|
+
${U(e)}</label>`}function g$(t,e){let r=H(t,"binding")??H(t,"name")??'""',n=H(t,"label")??'""',i=t.checked?`defaultChecked={${H(t,"checked")}}`:"",s=t.enabled?`disabled={${H(t,"enabled")} === false}`:"";return`${U(e)}<label className="vc-switch">
|
|
80
|
+
${U(e+1)}<input type="checkbox" role="switch" name={${r}} ${i} ${s} />
|
|
81
|
+
${U(e+1)}<span>{${n}}</span>
|
|
82
|
+
${U(e)}</label>`}function y$(t,e,r){let n=t.props;if(n.alt!==void 0){let a=[cn(t.name,e,n),`src={${H(n,"name")??'""'}}`,`alt={${H(n,"alt")??'""'}}`];return an(a,e,n),n.id&&a.push(`id={${H(n,"id")}}`),`${U(r)}<img ${a.join(" ")} />`}let s=[cn(t.name,e,n),"aria-hidden"];return an(s,e,n),n.id&&s.push(`id={${H(n,"id")}}`),n.name&&s.push(`data-icon={${H(n,"name")}}`),`${U(r)}<span ${s.join(" ")} />`}function Md(t,e){let r=t.options;if(!r||typeof r!="object"||!("kind"in r))return"";if(r.kind==="literal"&&Array.isArray(r.value))return r.value.map(s=>`${U(e+1)}<option key={${JSON.stringify(s.value)}} value={${JSON.stringify(s.value)}}>{${JSON.stringify(s.label)}}</option>`).join(`
|
|
83
|
+
`);let n=pr(r,0);return`${U(e+1)}{${n}.map((option) => <option key={option.value} value={option.value}>{option.label}</option>)}`}function Vd(t,e,r,n){let i=[cn(t,e,r)];return an(i,e,r),e.ariaHidden&&i.push("aria-hidden"),r.id&&i.push(`id={${H(r,"id")}}`),r.role?i.push(`role={${H(r,"role")}}`):e.defaultRole&&i.push(`role="${e.defaultRole}"`),e.ariaLabel&&(r.ariaLabel?i.push(`aria-label={${H(r,"ariaLabel")}}`):r.label?i.push(`aria-label={${H(r,"label")}}`):r.title&&i.push(`aria-label={${H(r,"title")}}`)),r.name&&i.push(`name={${H(r,"name")}}`),r.placeholder&&i.push(`placeholder={${H(r,"placeholder")}}`),e.inputType&&i.push(`type={${H(r,"type")??JSON.stringify(e.inputType)}}`),r.required&&i.push(`required={${H(r,"required")}}`),r.readonly&&i.push(`readOnly={${H(r,"readonly")}}`),r.enabled&&i.push(`disabled={${H(r,"enabled")} === false}`),e.tag==="img"&&r.src&&i.push(`src={${H(r,"src")}}`),e.tag==="img"&&r.alt&&i.push(`alt={${H(r,"alt")}}`),e.tag==="progress"&&r.value&&i.push(`value={${H(r,"value")}}`),r.rows&&i.push(`rows={${H(r,"rows")??"4"}}`),`${U(n)}<${e.tag} ${i.join(" ")} />`}function qd(t,e,r,n){let i=[];if(e.ariaHidden&&i.push("aria-hidden"),r.id&&i.push(`id={${H(r,"id")}}`),r.role?i.push(`role={${H(r,"role")}}`):e.defaultRole&&i.push(`role="${e.defaultRole}"`),e.ariaLabel&&(r.ariaLabel?i.push(`aria-label={${H(r,"ariaLabel")}}`):r.label?i.push(`aria-label={${H(r,"label")}}`):r.title&&i.push(`aria-label={${H(r,"title")}}`)),e.actionEvent){let s=f$(r,e.actionEvent);s&&i.push(s)}return e.tag==="button"&&r.enabled&&i.push(`disabled={${H(r,"enabled")} === false}`),e.tag==="a"&&r.href&&i.push(`href={${H(r,"href")}}`),e.tag==="button"&&i.push(`type={${H(r,"type")??'"button"'}}`),i.push(cn(t,e,r)),an(i,e,r),`<${n} ${i.join(" ")}`}function it(t,e,r){if(e.visible===void 0)return t;let n=H(e,"visible");return`${U(r)}{${n} !== false ? (
|
|
84
|
+
${t}
|
|
85
|
+
${U(r)}) : null}`}function da(t,e,r,n){if(t.length===0)return"";let i=n??"vm";return t.map(a=>{if(a.kind==="text"){let c=a.value;return c?`${U(e)}{${JSON.stringify(c)}}`:""}return a.kind==="binding"?`${U(e)}{${Ot(a,i)}}`:a.kind==="map"?w$(a,e,r):a.kind==="fragment"?da(a.children,e,r,n):r(a,e,n)}).filter(Boolean).join(`
|
|
86
|
+
`)}function w$(t,e,r){let n=t.item,i=r(t.body,e+1,n);if(t.key){let s=` key={${Ot(t.key,n)}}`;i=i.replace(/^( +)<(\w+)/,`$1<$2${s}`)}return`${U(e)}{${Ot(t.source)}.map((${n}) => (
|
|
87
|
+
${i}
|
|
88
|
+
${U(e)}))}`}function v$(t,e,r,n,i){let s=t.props,a=da(t.children,r+1,i,n);if(e.checkbox)return it(m$(s,r),s,r);if(t.name==="Radio")return it(h$(s,r),s,r);if(t.name==="Switch")return it(g$(s,r),s,r);if(t.name==="Icon")return it(y$(t,e,r),s,r);if(t.name==="Spinner"){let p=[cn(t.name,e,s),'aria-busy="true"'];return an(p,e,s),s.id&&p.push(`id={${H(s,"id")}}`),s.role?p.push(`role={${H(s,"role")}}`):e.defaultRole&&p.push(`role="${e.defaultRole}"`),it(`${U(r)}<div ${p.join(" ")} />`,s,r)}if(e.fieldContainer){let p=a||`${U(r+1)}<div />`;return it(Od(p,s,r),s,r)}if(e.fieldWrap){let p=e.tag,u;if(e.optionsProp&&s[e.optionsProp]){let m=qd(t.name,e,s,p);u=`${U(r+1)}${m}>
|
|
89
|
+
${Md(s,r+2)}
|
|
90
|
+
${U(r+1)}</${p}>`}else u=Vd(t.name,e,s,r+1);return it(Od(u,s,r),s,r)}let c=e.tag;if(e.void)return it(Vd(t.name,e,s,r),s,r);let l=qd(t.name,e,s,c),f;return!a&&e.optionsProp&&s[e.optionsProp]?f=`${U(r)}${l}>
|
|
91
|
+
${Md(s,r+1)}
|
|
92
|
+
${U(r)}</${c}>`:a?f=`${U(r)}${l}>
|
|
93
|
+
${a}
|
|
94
|
+
${U(r)}</${c}>`:f=`${U(r)}${l} />`,it(f,s,r)}function $$(t,e){let r=e??"vm";return Object.entries(t).map(([n,i])=>typeof i=="object"&&i!==null&&"kind"in i&&i.kind==="binding"?`${n}={${Ot(i,r)}}`:`${n}={${pr(i,0)}}`).join(" ")}function b$(t,e,r){let n=$$(t.props,r),i=n?` ${n}`:"";return`${U(e)}<${t.name}${i} />`}function _$(t,e){let r=e??"vm";return Object.entries(t).map(([n,i])=>n==="action"&&typeof i=="object"&&i!==null&&"kind"in i&&i.kind==="action"?`${n}={${hi(i,!0)}}`:typeof i=="object"&&i!==null&&"kind"in i&&i.kind==="binding"?`${n}={${Ot(i,r)}}`:n==="children"?"":`${n}={${pr(i,0,n==="columns")}}`).join(" ")}function x$(t,e,r,n){let i=_$(t.props,r),s=i?` ${i}`:"",a=da(t.children,e+1,n,r);return a?`${U(e)}<${t.name}${s}>
|
|
95
|
+
${a}
|
|
96
|
+
${U(e)}</${t.name}>`:`${U(e)}<${t.name}${s} />`}function Ld(t,e,r){return t in e.elements&&!r.includes(t)}function sn(t,e){if(t.kind==="viewRef"){e.add(t.name);return}if(t.kind==="component"){for(let r of t.children)sn(r,e);return}if(t.kind==="map"&&sn(t.body,e),t.kind==="fragment")for(let r of t.children)sn(r,e)}function jt(t,e,r,n){if(t.kind==="component"){Ld(t.name,e,r)||n.add(t.name);for(let i of t.children)jt(i,e,r,n);return}if(t.kind==="map"&&jt(t.body,e,r,n),t.kind==="fragment")for(let i of t.children)jt(i,e,r,n)}function Fd(t,e){let r=(n,i,s)=>n.kind==="viewRef"?b$(n,i,s):n.kind!=="component"?"":Ld(n.name,t,e)?v$(n,t.elements[n.name],i,s,r):x$(n,i,s,r);return(n,i,s)=>r(n,i,s)}var zd=ne(()=>{"use strict";jd()});var Kd={};ff(Kd,{partialReactOutputPath:()=>T$,renderReactComponent:()=>fa,renderReactFromIr:()=>I$,renderReactPreviewBundle:()=>C$});import{resolve as E$}from"node:path";function S$(t){if(t.isPartial)return t.exportName;let e=t.exportName.replace(/View$/,"")||t.exportName;return e.charAt(0).toUpperCase()+e.slice(1)}function P$(t,e){if(t.kind!=="component")throw new Error(`View IR root must be a component node (${e})`);return t}function Ud(t){if(!t)return[];let e=t.match(/\b[A-Z][A-Za-z0-9]*ViewModel\b/g);return e?[...new Set(e)]:[]}function k$(t){if(!t.propsType)return"";let e=t.propsType.match(/^\{\s*([^}]+)\s*\}$/);return e?`{ ${e[1].trim().split(",").map(i=>i.split(":")[0].trim()).join(", ")} }: ${t.propsType}`:`props: ${t.propsType}`}function Hd(t){return t.trimStart().startsWith("{")?`return (
|
|
97
|
+
<>${t}
|
|
98
|
+
</>
|
|
99
|
+
);`:`return (
|
|
100
|
+
${t}
|
|
101
|
+
);`}function R$(t){let e=t.replace(/^\/\*\*[\s\S]*?\*\/\s*/,"");return e=e.replace(/^import\s[^\n]+\n/gm,""),e.trimStart()}async function Bd(t,e){let r=await sa(e.elementMapPath),n=e.allowlistExtra??[],i=S$(t),s=P$(t.root,t.source),c=Fd(r,n)(s,2),l=new Set;jt(t.root,r,n,l);let f=[...l].sort(),p=new Set;sn(t.root,p);let u=[...p].sort(),m=e.previewImports,h=m?.dispatch??e.runtimeImportFrom,y=m?.contracts??e.contractsImportFrom,v=m?.extensions??e.extensionsImportFrom,I=new Set;if(t.isPartial)for(let N of Ud(t.propsType))I.add(N);else I.add(t.viewModel);let P=["import type { ReactElement } from 'react';"];P.push(`import { dispatchAction } from '${h}';`);let D=[...I].sort(),z=D.length>0?`${D.join(", ")}, ActionDescriptor`:"ActionDescriptor";P.push(`import type { ${z} } from '${y}';`),f.length>0&&P.push(`import { ${f.join(", ")} } from '${v}';`);for(let N of u){if(e.inlineViewRefs)continue;let X=e.viewRefImportFrom?.get(N)??`./${N}.generated.js`;P.push(`import { ${N} } from '${X}';`)}let L=m?`/**
|
|
102
|
+
* Preview module \u2014 compiled live from ${t.source}
|
|
103
|
+
* Same lowering as generated/; not written to disk.
|
|
104
|
+
*/`:`/**
|
|
105
|
+
* Auto-generated React component from ${t.source}
|
|
106
|
+
* DO NOT EDIT \u2014 regenerate with: view-contracts render react
|
|
107
|
+
*/`;if(t.isPartial){let N=k$(t);return`${L}
|
|
108
|
+
${P.join(`
|
|
109
|
+
`)}
|
|
110
|
+
|
|
111
|
+
export function ${i}(${N}): ReactElement {
|
|
112
|
+
${Hd(c)}
|
|
113
|
+
}
|
|
114
|
+
`}return`${L}
|
|
115
|
+
${P.join(`
|
|
116
|
+
`)}
|
|
117
|
+
|
|
118
|
+
export function ${i}({ vm }: { vm: ${t.viewModel} }): ReactElement {
|
|
119
|
+
${Hd(c)}
|
|
120
|
+
}
|
|
121
|
+
`}async function fa(t,e){return Bd(t,e)}async function I$(t,e,r){let{writeFile:n,mkdir:i}=await import("node:fs/promises"),{dirname:s}=await import("node:path"),a=await Bd(t,r);await i(s(e),{recursive:!0}),await n(e,a,"utf-8")}async function C$(t,e,r){let n={...r,inlineViewRefs:!0},i=await Promise.all(e.map(L=>fa(L,n))),s=await fa(t,n),a=R$,c=await sa(r.elementMapPath),l=r.allowlistExtra??[],f=new Set;jt(t.root,c,l,f);for(let L of e)jt(L.root,c,l,f);let p=r.previewImports,u=p?.dispatch??r.runtimeImportFrom,m=p?.contracts??r.contractsImportFrom,h=p?.extensions??r.extensionsImportFrom,y=new Set([t.viewModel]);for(let L of e)for(let N of Ud(L.propsType))y.add(N);let v=["import type { ReactElement } from 'react';",`import { dispatchAction } from '${u}';`,`import type { ${[...y].sort().join(", ")}, ActionDescriptor } from '${m}';`],I=[...f].sort();I.length>0&&v.push(`import { ${I.join(", ")} } from '${h}';`);let P=p?`/**
|
|
122
|
+
* Preview module \u2014 compiled live from ${t.source}
|
|
123
|
+
* Same lowering as generated/; not written to disk.
|
|
124
|
+
*/`:"",D=i.map(a),z=a(s);return`${P}
|
|
125
|
+
${v.join(`
|
|
126
|
+
`)}
|
|
127
|
+
|
|
128
|
+
${D.join(`
|
|
129
|
+
|
|
130
|
+
`)}
|
|
131
|
+
|
|
132
|
+
${z}`}function T$(t,e){return E$(t,"components",`${e.exportName}.generated.tsx`)}var Jd=ne(()=>{"use strict";Rd();zd()});import{readFile as j$,stat as fE}from"node:fs/promises";import{resolve as Gd}from"node:path";function Xd(){return"views/preview"}function O$(t){return`${t.charAt(0).toLowerCase()}${t.slice(1)}Mock`}function M$(t,e,r){let n=Ie(t),i=e.preview?.mocksDir??Xd();return Gd(n,i,`${r}.mock.yaml`)}function V$(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function q$(t,e){if(!V$(t))throw new yi(`${e} must be a YAML object (ViewModel fields at the root)`);return t}async function D$(t){let e;try{e=await j$(t,"utf-8")}catch{throw new yi(`Preview mock not found: ${t}`)}let r=Oe.load(e);return q$(r,t)}function L$(t,e){let r=O$(t);return`/** Auto-built from views/preview/${t}.mock.yaml \u2014 preview / example only */
|
|
133
|
+
export const ${r} = ${JSON.stringify(e,null,2)};
|
|
134
|
+
`}async function Qd(t,e,r){let n=M$(t,e,r),i=await D$(n);return L$(r,i)}function Zd(t){if(!t.startsWith(ln))return null;let e=t.slice(ln.length);return e.length>0?e:null}async function ef(t,e){let r=Ie(t),n=e.preview?.mocksDir??Xd();return Gd(r,n)}var ln,yi,tf=ne(()=>{"use strict";Ht();$t();ln="view-contracts:preview/mock/",yi=class extends Error{constructor(e){super(e),this.name="PreviewMockError"}}});$t();Yi();br();Ri();import{transform as F$}from"esbuild";import{resolve as Mt}from"node:path";import{resolve as A$}from"node:path";import{readFile as pc}from"node:fs/promises";import{basename as pp,relative as mc,resolve as hc}from"node:path";ct();import{dirname as oc,resolve as sc}from"node:path";import A from"typescript";import{readFileSync as tp}from"node:fs";import{resolve as rp}from"node:path";import re from"typescript";function Gi(t,e){let r=new Map;for(let n of t.statements){if(!re.isImportDeclaration(n)||!n.importClause?.namedBindings||!re.isStringLiteral(n.moduleSpecifier)||!re.isNamedImports(n.importClause.namedBindings))continue;let i=n.moduleSpecifier.text;i.endsWith(".tsx")||(i=`${i}.tsx`);let s=rp(e,i);for(let a of n.importClause.namedBindings.elements)r.set(a.name.text,s)}return r}function np(t){if(re.isObjectBindingPattern(t.name)){let e=[];for(let r of t.name.elements)re.isBindingElement(r)&&re.isIdentifier(r.name)&&e.push(r.name.text);return e}return re.isIdentifier(t.name)?[t.name.text]:[]}function ip(t){if(!re.isObjectBindingPattern(t.name)||t.name.elements.length===0)return null;let e=t.name.elements[0];return!re.isBindingElement(e)||!re.isIdentifier(e.name)?null:e.name.text}function op(t){if(re.isParenthesizedExpression(t))return t.expression;if(re.isJsxElement(t)||re.isJsxSelfClosingElement(t)||re.isJsxFragment(t))return t;if(re.isBlock(t))for(let e=t.statements.length-1;e>=0;e--){let r=t.statements[e];if(re.isReturnStatement(r)&&r.expression)return re.isParenthesizedExpression(r.expression)?r.expression.expression:r.expression}return null}function nc(t){if(!re.isIdentifier(t.expression)||t.expression.text!=="view"||t.arguments.length!==1)return null;let e=t.arguments[0];if(!re.isArrowFunction(e)&&!re.isFunctionExpression(e))return null;let r="__noop",n=[];if(e.parameters.length===1){let a=ip(e.parameters[0]);if(n=np(e.parameters[0]),a)r=a;else if(re.isIdentifier(e.parameters[0].name))r=e.parameters[0].name.text,n=[r];else return null}else if(e.parameters.length>1)return null;let i=op(e.body);if(!i)return null;let s;return t.typeArguments&&t.typeArguments.length===1&&(s=t.typeArguments[0].getText()),{paramName:r,jsxRoot:i,propNames:n,propsType:s}}function Xi(t,e){let r=null;function n(i){if(re.isVariableStatement(i))for(let s of i.declarationList.declarations){if(!re.isIdentifier(s.name)||s.name.text!==e||!s.initializer||!re.isCallExpression(s.initializer))continue;let a=nc(s.initializer);a&&(r=a)}if(re.isExportAssignment(i)&&i.isExportEquals===!1&&i.expression&&re.isCallExpression(i.expression)){let s=nc(i.expression);s&&e==="default"&&(r=s)}re.forEachChild(i,n)}return n(t),r}function ic(t,e){let r=tp(t,"utf-8"),n=re.createSourceFile(t,r,re.ScriptTarget.Latest,!0,re.ScriptKind.TSX);return Xi(n,e)}function sp(t,e,r){if("tone"in e){let n=e.tone;delete e.tone,"variant"in e||(e.variant=n),r.warnings.push(`"tone" on <${t}> is deprecated; use variant instead (mapped automatically)`)}if("textStyle"in e){let n=e.textStyle;delete e.textStyle,"variant"in e||(e.variant=n),r.warnings.push(`"textStyle" on <${t}> is deprecated; use variant instead (mapped automatically)`)}}function Qi(t){return t.join(".")}function Wt(t){let e=t.getText().replace(/\s+/g," ").trim();return e.length>100?`${e.slice(0,97)}...`:e}function eo(t){if(A.isIdentifier(t))return[t.text];if(A.isPropertyAccessExpression(t)){let e=eo(t.expression);return e?[...e,t.name.text]:null}return null}function ac(t,e){if(e.length===0)return t;let r=e.join(".");return{kind:"binding",path:t.path?`${t.path}.${r}`:r,scope:t.scope}}function Er(t,e){let r=eo(t);if(!r)return null;if(r[0]in e.propBindings)return ac(e.propBindings[r[0]],r.slice(1));if(r[0]===e.vmName)return{kind:"binding",path:Qi(r.slice(1))};let n=e.scopes[e.scopes.length-1];return n&&r[0]===n?{kind:"binding",path:Qi(r.slice(1)),scope:n}:null}function ap(t,e){let r,n={};for(let i of t.properties){if(!A.isPropertyAssignment(i)||!A.isIdentifier(i.name))continue;let s=i.name.text;if(s==="name"&&A.isStringLiteral(i.initializer)){r=i.initializer.text;continue}if(s==="params"&&A.isObjectLiteralExpression(i.initializer))for(let a of i.initializer.properties){if(!A.isPropertyAssignment(a)||!A.isIdentifier(a.name))continue;let c=Nn(a.initializer,e);c!==null?n[a.name.text]=c:e.errors.push(`Unsupported action param expression for "${a.name.text}": ${Wt(a.initializer)}`)}}return r?Object.keys(n).length>0?{kind:"action",name:r,params:n}:{kind:"action",name:r}:null}function Nn(t,e){if(A.isStringLiteral(t)||A.isNoSubstitutionTemplateLiteral(t))return t.text;if(t.kind===A.SyntaxKind.TrueKeyword)return!0;if(t.kind===A.SyntaxKind.FalseKeyword)return!1;if(A.isNumericLiteral(t))return Number(t.text);if(t.kind===A.SyntaxKind.NullKeyword)return null;if(A.isTemplateExpression(t)){let n=[];t.head.text&&n.push(t.head.text);for(let i of t.templateSpans){let s=Er(i.expression,e);if(!s)return null;n.push(s),i.literal.text&&n.push(i.literal.text)}return{kind:"concat",parts:n}}let r=Er(t,e);if(r)return r;if(A.isObjectLiteralExpression(t)){let n=ap(t,e);if(n)return n;let i={};for(let s of t.properties){if(!A.isPropertyAssignment(s)||!A.isIdentifier(s.name))continue;let a=Nn(s.initializer,e);a!==null?i[s.name.text]=a:e.errors.push(`Unsupported object literal property "${s.name.text}": ${Wt(s.initializer)}`)}return{kind:"literal",value:i}}if(A.isArrayLiteralExpression(t)){let n=[];for(let i of t.elements){if(!A.isExpression(i))continue;let s=Nn(i,e);s!==null?n.push(s):e.errors.push(`Unsupported array element expression: ${Wt(i)}`)}return n}return null}function cp(t){return A.isIdentifier(t)?t.text:A.isPropertyAccessExpression(t)&&A.isIdentifier(t.name)?t.name.text:null}function cc(t){return t.getText()}function Zi(t,e){let r=[];for(let n of t){if(A.isJsxText(n)){let i=n.getText().trim();i&&r.push({kind:"text",value:i});continue}if(A.isJsxExpression(n)&&n.expression){let i=Er(n.expression,e);if(i){r.push(i);continue}let s=lc(n.expression,e);s?Array.isArray(s)?r.push(...s):r.push(s):e.errors.push(`Unsupported JSX child expression: ${Wt(n.expression)}`);continue}if(A.isJsxElement(n)||A.isJsxSelfClosingElement(n)){let i=Sr(n,e);i&&r.push(i)}}return r}function lp(t,e){if(t.length===0)return null;let r=t[0];return r in e.propBindings?ac(e.propBindings[r],t.slice(1)):r===e.vmName?{kind:"binding",path:Qi(t.slice(1))}:null}function lc(t,e){if(A.isParenthesizedExpression(t))return lc(t.expression,e);if(A.isCallExpression(t)&&A.isPropertyAccessExpression(t.expression)){let n=eo(t.expression.expression),i=t.expression.name.text;if(n&&i==="map"&&t.arguments.length>=1){let s=lp(n,e);if(!s)return null;let a=t.arguments[0];if(!A.isArrowFunction(a)&&!A.isFunctionExpression(a))return e.errors.push("map callback must be an arrow function"),null;let c=a.parameters;if(c.length!==1||!A.isIdentifier(c[0].name))return e.errors.push("map callback must have a single item parameter"),null;let l=c[0].name.text,f={...e,scopes:[...e.scopes,l]},p=null,u=A.isParenthesizedExpression(a.body)?a.body.expression:a.body;if(A.isBlock(a.body))return e.errors.push("map callback body must be a JSX expression, not a block"),null;if(A.isJsxElement(u)||A.isJsxSelfClosingElement(u)?p=Sr(u,f):A.isJsxFragment(u)&&(p=to(u,f)),!p)return null;let m;if(A.isJsxElement(u)||A.isJsxSelfClosingElement(u)){let h=A.isJsxElement(u)?u.openingElement.attributes:u.attributes;for(let y of h.properties)if(!(!A.isJsxAttribute(y)||cc(y.name)!=="key"||!y.initializer)&&A.isJsxExpression(y.initializer)&&y.initializer.expression){let v=Er(y.initializer.expression,f);v&&(m=v)}}return{kind:"map",source:s,item:l,key:m,body:p}}}if(A.isJsxElement(t)||A.isJsxSelfClosingElement(t))return Sr(t,e);let r=Er(t,e);return r||null}function to(t,e){return{kind:"fragment",children:Zi(t.children,e)}}function up(t,e,r){let n=r.viewImports.get(t);return n?ic(n,t)?{kind:"viewRef",name:t,sourcePath:n,props:e}:(r.errors.push(`View component "${t}" is imported but has no view() export`),null):null}function Sr(t,e){let r=A.isJsxElement(t)?t.openingElement:t,n=cp(r.tagName);if(!n)return e.errors.push("Unsupported JSX tag expression"),null;let i={};for(let l of r.attributes.properties){if(!A.isJsxAttribute(l))continue;let f=cc(l.name);if(f!=="key"){if(!l.initializer){i[f]=!0;continue}if(A.isStringLiteral(l.initializer)){i[f]=l.initializer.text;continue}if(A.isJsxExpression(l.initializer)&&l.initializer.expression){let p=Nn(l.initializer.expression,e);p!==null?i[f]=p:e.errors.push(`Unsupported JSX prop expression for "${f}" on <${n}>: ${Wt(l.initializer.expression)}`)}}}if(!e.allowedComponents.has(n)){let l=up(n,i,e);return l||(e.errors.push(`Component "${n}" is not in the allowed registry`),null)}sp(n,i,e);let s=e;if(n==="Table"&&i.source){let l=typeof i.source=="object"&&"kind"in i.source&&i.source.kind==="binding"?i.source:void 0;l&&(s={...e,tableSource:l})}let a=typeof i.each=="string"?i.each:void 0;if(a){let l=e.tableSource;if(!l)return e.errors.push(`<${n} each="${a}"> requires an ancestor <Table source={...}>`),null;delete i.each;let f={...s,scopes:[...s.scopes,a]},p=A.isJsxElement(t)?Zi(t.children,f):[];return{kind:"map",source:l,item:a,body:{kind:"component",name:n,props:i,children:p}}}let c=A.isJsxElement(t)?Zi(t.children,s):[];return{kind:"component",name:n,props:i,children:c}}function dp(t){let e=null;function r(n){if(A.isCallExpression(n)&&A.isIdentifier(n.expression)&&n.expression.text==="screen"&&n.arguments.length===1&&(A.isArrowFunction(n.arguments[0])||A.isFunctionExpression(n.arguments[0]))){let i=n.arguments[0],s="unknown";if(n.typeArguments&&n.typeArguments.length===1){let c=n.typeArguments[0];A.isTypeReferenceNode(c)&&A.isIdentifier(c.typeName)&&(s=c.typeName.text)}let a=i.body;if(A.isParenthesizedExpression(a))(A.isJsxElement(a.expression)||A.isJsxSelfClosingElement(a.expression))&&(e={viewModel:s,jsxRoot:a.expression});else if(A.isJsxElement(a)||A.isJsxSelfClosingElement(a))e={viewModel:s,jsxRoot:a};else if(A.isBlock(a)&&a.statements.length===1){let c=a.statements[0];A.isReturnStatement(c)&&c.expression&&(A.isParenthesizedExpression(c.expression)?e={viewModel:s,jsxRoot:c.expression.expression}:e={viewModel:s,jsxRoot:c.expression})}}A.forEachChild(n,r)}return r(t),e}function uc(t,e,r,n={}){let i=new Set(et);for(let u of n.allowlistExtra??[])i.add(u);let s=sc(e),a=oc(s),c=A.createSourceFile(s,t,A.ScriptTarget.Latest,!0,A.ScriptKind.TSX),l={vmName:"vm",scopes:[],propBindings:{},errors:[],warnings:[],viewImports:Gi(c,a),allowedComponents:i},f=dp(c);if(!f)return{viewModel:"unknown",exportName:r,root:{kind:"fragment",children:[]},errors:["No screen<T>() default export found"],warnings:[]};let p=A.isJsxElement(f.jsxRoot)||A.isJsxSelfClosingElement(f.jsxRoot)?Sr(f.jsxRoot,l):A.isJsxFragment(f.jsxRoot)?to(f.jsxRoot,l):null;return p?{viewModel:f.viewModel,exportName:r,root:p,errors:l.errors,warnings:l.warnings}:(l.errors.push("screen() callback must return a single JSX root element"),{viewModel:f.viewModel,exportName:r,root:{kind:"fragment",children:[]},errors:l.errors,warnings:l.warnings})}function fp(t,e){let r={...e.propBindings};for(let i of t.propNames)r[i]={kind:"binding",path:"",scope:i};let n={...e,vmName:t.paramName,propBindings:r,scopes:[]};return A.isJsxElement(t.jsxRoot)||A.isJsxSelfClosingElement(t.jsxRoot)?Sr(t.jsxRoot,n):A.isJsxFragment(t.jsxRoot)?to(t.jsxRoot,n):A.isConditionalExpression(t.jsxRoot)?(e.errors.push("view() partial root must be a JSX element or fragment; conditional expressions are not supported"),null):A.isExpression(t.jsxRoot)?(e.errors.push(`view() partial root must be a JSX element or fragment; unsupported expression: ${Wt(t.jsxRoot)}`),null):(e.errors.push(`view() partial root must be a JSX element or fragment; unsupported syntax kind: ${A.SyntaxKind[t.jsxRoot.kind]}`),null)}function dc(t,e,r,n={}){let i=new Set(et);for(let u of n.allowlistExtra??[])i.add(u);let s=sc(e),a=oc(s),c=A.createSourceFile(s,t,A.ScriptTarget.Latest,!0,A.ScriptKind.TSX),l=Xi(c,r),f={vmName:l?.paramName??"__noop",scopes:[],propBindings:{},errors:[],warnings:[],viewImports:Gi(c,a),allowedComponents:i};if(!l)return{exportName:r,propNames:[],root:{kind:"fragment",children:[]},errors:[`No view() export "${r}" found in ${e}`],warnings:[]};let p=fp(l,f);return p?{exportName:r,propsType:l.propsType,propNames:l.propNames,root:p,errors:f.errors,warnings:f.warnings}:{exportName:r,propsType:l.propsType,propNames:l.propNames,root:{kind:"fragment",children:[]},errors:f.errors,warnings:f.warnings}}function ro(t){let e=[];function r(n){if(n.kind==="viewRef"){e.push(n);return}if(n.kind==="component"){for(let i of n.children)r(i);return}if(n.kind==="map"){r(n.body);return}if(n.kind==="fragment")for(let i of n.children)r(i)}return r(t),e}function fc(t){return`${t.sourcePath}:${t.name}`}ct();function no(t,e){let r=[],n=[],i=s=>{if(s.kind!=="viewRef"){if(s.kind==="component"){!et.has(s.name)&&!(s.name in e.extensions)&&r.push(`Extension component "${s.name}" is not registered in extensions.yaml`);for(let a of s.children)i(a);return}if(s.kind==="map"){i(s.body);return}if(s.kind==="fragment")for(let a of s.children)i(a)}};return i(t),{errors:r,warnings:n}}async function mp(t,e,r){let n=await pc(t,"utf-8"),i=dc(n,t,e,{allowlistExtra:r.allowlistExtra});if(i.errors.length>0)throw new Error(`Compile errors in ${t} (${e}):
|
|
135
|
+
${i.errors.map(s=>` - ${s}`).join(`
|
|
136
|
+
`)}`);if(r.extensionRegistry){let s=no(i.root,r.extensionRegistry);if(s.errors.length>0)throw new Error(`Extension validation errors in ${t} (${e}):
|
|
137
|
+
${s.errors.map(a=>` - ${a}`).join(`
|
|
138
|
+
`)}`);i.warnings.push(...s.warnings)}for(let s of i.warnings)console.warn(`Warning in ${t} (${e}): ${s}`);return{version:1,source:mc(process.cwd(),hc(t)),viewModel:i.propsType??"Record<string, unknown>",exportName:i.exportName,root:i.root,isPartial:!0,propsType:i.propsType}}async function hp(t,e){let r=new Map,n=ro(t);for(;n.length>0;){let i=n.shift(),s=fc(i);if(r.has(s))continue;let a=await mp(i.sourcePath,i.name,e);r.set(s,a),n.push(...ro(a.root))}return[...r.values()]}async function gc(t,e={}){let r=await pc(t.sourcePath,"utf-8"),n=t.exportName??pp(t.sourcePath,".view.tsx"),i=uc(r,t.sourcePath,n,{allowlistExtra:e.allowlistExtra});if(i.errors.length>0)throw new Error(`Compile errors in ${t.sourcePath}:
|
|
139
|
+
${i.errors.map(c=>` - ${c}`).join(`
|
|
140
|
+
`)}`);if(e.extensionRegistry){let c=no(i.root,e.extensionRegistry);if(c.errors.length>0)throw new Error(`Extension validation errors in ${t.sourcePath}:
|
|
141
|
+
${c.errors.map(l=>` - ${l}`).join(`
|
|
142
|
+
`)}`);i.warnings.push(...c.warnings)}for(let c of i.warnings)console.warn(`Warning in ${t.sourcePath}: ${c}`);let s={version:1,source:mc(process.cwd(),hc(t.sourcePath)),viewModel:i.viewModel,exportName:i.exportName,root:i.root},a=await hp(s.root,e);return{screen:s,partials:a}}$t();Ji();ct();function gp(t){let e=Pn[t];return e?e.lowering==="inline-css"||e.lowering==="class-name":!1}function Pr(t,e,r,n){if(t.kind==="component"){let{name:i,props:s}=t;if(r.has(i)||!et.has(i)){for(let a of t.children)Pr(a,e,r,n);return}for(let a of Object.keys(s))gp(a)&&(za(a,i)||n.push(`${e}: <${i}> does not accept property "${a}"`));for(let a of t.children)Pr(a,e,r,n);return}if(t.kind==="map"){Pr(t.body,e,r,n);return}if(t.kind==="fragment"){for(let i of t.children)Pr(i,e,r,n);return}}async function yc(t,e=[]){let r=new Set(e),n=[];for(let i of t)Pr(i.root,i.source,r,n);if(n.length>0)throw new Error(`View property validation failed:
|
|
143
|
+
${n.map(i=>` - ${i}`).join(`
|
|
144
|
+
`)}`)}var vd=mf(wd(),1);Ht();br();import{readFile as $d}from"node:fs/promises";import{resolve as bd}from"node:path";var e$=vd.default,t$=bd(Ze(),"spec/ui-dsl-extensions.meta.json"),pi;async function r$(){if(pi)return pi;let t=JSON.parse(await $d(t$,"utf-8"));return pi=new e$({allErrors:!0,strict:!1}).compile(t),pi}async function _d(t){if(!t)return{extensions:{}};let e=bd(t),r=await $d(e,"utf-8"),n=Oe.load(r),i=await r$();if(!i(n)){let s=i.errors?.map(a=>`${a.instancePath||"/"} ${a.message??""}`).join("; ")??"unknown";throw new Error(`Extension registry validation failed (${e}): ${s}`)}return n}async function Wd(t,e,r){return(await Promise.resolve().then(()=>(Jd(),Kd))).renderReactPreviewBundle(t,e,r)}var pa="view-contracts:screen/",gi="view-contracts:theme.css";var Fe={dispatch:"view-contracts:runtime/dispatch",style:"view-contracts:runtime/style",types:"view-contracts:runtime/types",styleHelpers:"view-contracts:runtime/style-helpers",contracts:"view-contracts:contracts",extensions:"view-contracts:extensions",mock:"view-contracts:preview/mock"};async function N$(t){if(!t.extensions)return{allowlistExtra:t.allowlistExtra??[]};let e=await _d(t.extensions),r=[...new Set([...t.allowlistExtra??[],...Object.keys(e.extensions)])];return{extensionRegistry:e,allowlistExtra:r}}async function Yd(t,e){let r=await at(t),i=(await Oa(r.bindings)).views.find(y=>y.screenName===e);if(!i)throw new Error(`No view binding for screen "${e}"`);if(!i.targets.includes("react"))throw new Error(`Screen "${e}" is not a react target`);let{extensionRegistry:s,allowlistExtra:a}=await N$(r),c=Ie(t),{screen:l,partials:f}=await gc({sourcePath:A$(c,i.source),exportName:i.exportName,screenName:i.screenName},{allowlistExtra:a,extensionRegistry:s}),{tokensPath:p,themePath:u}=bn(r),{themeIR:m}=await An(p,u);await xr(r,t);let h=[l,...f];return await yc(h,a),zi(h,m),Wd(l,f,{runtimeImportFrom:Fe.dispatch,extensionsImportFrom:Fe.extensions,contractsImportFrom:Fe.contracts,allowlistExtra:a,previewImports:Fe})}$t();tf();import{resolve as rf}from"node:path";var of="\0";function nf(t){return`${of}${t}`}function sf(t){let e="";async function r(){let s=await at(t.configPath);e=await ef(t.configPath,s)}function n(s){return s.startsWith(e)&&s.endsWith(".mock.yaml")}function i(s,a){let c=s.moduleGraph.getModuleById(nf(`${ln}${a}`));return c?(s.moduleGraph.invalidateModule(c),[c]):[]}return{name:"view-contracts-preview-mock",enforce:"pre",async buildStart(){await r()},resolveId(s){return s.startsWith(ln)?nf(s):null},async load(s){let a=Zd(s.slice(of.length));if(!a)return null;try{let c=await at(t.configPath);return await Qd(t.configPath,c,a)}catch(c){let l=c instanceof Error?c.message:String(c);this.error(`Preview mock failed for ${a}:
|
|
145
|
+
${l}`)}},configureServer(s){r(),s.watcher.on("change",a=>{if(!n(a))return;let c=rf(a).slice(e.length+1).replace(/\.mock\.yaml$/,"");i(s,c)})},handleHotUpdate({file:s,server:a}){if(!n(s))return;let c=rf(s).slice(e.length+1).replace(/\.mock\.yaml$/,"");return i(a,c)}}}var z$="\0";function wi(t){return`${z$}${t}`}function H$(t){let e=wi(pa);if(!t.startsWith(e))return null;let r=t.slice(e.length);return r.endsWith(".tsx")?r.slice(0,-4):r}function U$(t){let e="",r="",n=[],i,s,a="";async function c(){let u=await at(t.configPath);e=Ie(t.configPath),r=u.viewsDir,n=[],u.design?.tokens&&n.push(u.design.tokens),u.design?.theme&&n.push(u.design.theme),s=u.design?.extensionsCss,i=u.extensions,a=_n()}function l(u){let m=u.moduleGraph.getModuleById(wi(gi));return m?(u.moduleGraph.invalidateModule(m),[m]):[]}function f(u,m){let h=u.moduleGraph.getModulesByFile(m);if(h)for(let y of h)u.moduleGraph.invalidateModule(y);(m.endsWith(".view.tsx")||m.includes("/views/"))&&u.moduleGraph.invalidateAll()}function p(u){return n.some(m=>u===m)||u===a||s!==void 0&&u===s}return{name:"view-contracts-preview",enforce:"pre",async buildStart(){await c()},resolveId(u){return u===gi||u.startsWith(pa)?wi(u):null},async load(u){if(u===wi(gi)){let h=await at(t.configPath);return await Wi(h,t.configPath)}let m=H$(u);if(m)try{let h=await Yd(t.configPath,m),{code:y}=await F$(h,{loader:"tsx",format:"esm",jsx:"automatic",jsxImportSource:"react",target:"es2022"});return y}catch(h){let y=h instanceof Error?h.message:String(h);this.error(`Preview compile failed for ${m}:
|
|
146
|
+
${y}`)}return null},configureServer(u){c(),u.watcher.on("change",m=>{p(m)&&l(u),(m.startsWith(r)||p(m)||i&&m===i||m.includes("/renderers/react/elements.yaml"))&&f(u,m)})},handleHotUpdate({file:u,server:m}){if(p(u))return f(m,u),l(m);if(u.startsWith(r)||i&&u===i||u.includes("/renderers/react/elements.yaml"))return f(m,u),[...m.moduleGraph.getModulesByFile(u)??[]]}}}function B$(t){let e=Ze(),r=Mt(e,"renderers/react/runtime");return[{find:Fe.dispatch,replacement:Mt(r,"dispatch.ts")},{find:Fe.style,replacement:Mt(r,"style.ts")},{find:Fe.types,replacement:Mt(r,"types.ts")},{find:Fe.styleHelpers,replacement:Mt(e,"dist/preview-style-helpers.js")},{find:Fe.contracts,replacement:Mt(t,"contracts/view-models.ts")},{find:Fe.extensions,replacement:Mt(t,"src/components/extensions.tsx")}]}function K$(t,e){return[t,e,Ze()]}export{K$ as previewFsAllowPaths,B$ as previewRuntimeAliases,sf as viewContractsPreviewMockPlugin,U$ as viewContractsPreviewPlugin};
|
|
147
|
+
/*! Bundled license information:
|
|
148
|
+
|
|
149
|
+
js-yaml/dist/js-yaml.mjs:
|
|
150
|
+
(*! js-yaml 4.2.0 https://github.com/nodeca/js-yaml @license MIT *)
|
|
151
|
+
*/
|
|
152
|
+
//# sourceMappingURL=preview.mjs.map
|