view-contracts 0.3.5 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +10 -3
  2. package/cli-contract.yaml +40 -0
  3. package/dist/preview-style-helpers.js +2 -0
  4. package/dist/preview-style-helpers.js.map +7 -0
  5. package/dist/preview.mjs +153 -0
  6. package/dist/preview.mjs.map +7 -0
  7. package/dist/view-contracts.bundle.mjs +399 -248
  8. package/dist/view-contracts.bundle.mjs.map +4 -4
  9. package/docs/cli-reference.md +36 -0
  10. package/package.json +28 -1
  11. package/renderers/compose/renderRuntime.ts +40 -0
  12. package/renderers/react/defaults/theme.yaml +23 -0
  13. package/renderers/react/defaults/tokens.yaml +15 -0
  14. package/renderers/react/elementMap.ts +30 -6
  15. package/renderers/react/elements.yaml +17 -5
  16. package/renderers/react/lowering/foldStyle.ts +13 -1
  17. package/renderers/react/lowering/lowerToJsx.ts +15 -34
  18. package/renderers/react/paths.ts +1 -10
  19. package/renderers/react/preview/components.ts +23 -0
  20. package/renderers/react/preview/index.ts +3 -0
  21. package/renderers/react/preview/start.tsx +42 -0
  22. package/renderers/react/preview/style-helpers.ts +5 -0
  23. package/renderers/react/preview/vocabulary.tsx +75 -0
  24. package/renderers/react/runtime/theme.css +9 -17
  25. package/renderers/react/style/foldLiterals.ts +11 -0
  26. package/renderers/swiftui/README.md +48 -10
  27. package/renderers/swiftui/elementMap.ts +45 -0
  28. package/renderers/swiftui/elements.yaml +82 -0
  29. package/renderers/swiftui/index.ts +5 -0
  30. package/renderers/swiftui/lowering/lowerToSwiftUI.ts +542 -0
  31. package/renderers/swiftui/lowering/modifiers.ts +142 -0
  32. package/renderers/swiftui/renderComponents.ts +79 -0
  33. package/renderers/swiftui/renderRuntime.ts +91 -0
  34. package/renderers/swiftui/renderTheme.ts +208 -0
  35. package/spec/ui-dsl.linter-rules.json +0 -7
  36. package/spec/ui-dsl.meta.json +5 -0
  37. package/spec/ui-dsl.schema.json +333 -259
  38. package/src/generated/schema/allowed-components.ts +0 -36
  39. package/src/generated/schema/dsl-enums.ts +0 -19
  40. package/src/generated/schema/dsl-properties.ts +0 -64
  41. package/src/generated/schema/index.ts +0 -4
  42. package/src/generated/schema/lowering-style-properties.ts +0 -35
  43. package/src/generated/schema/react-renderer-element-config.ts +0 -27
  44. package/src/generated/schema/schema-document.ts +0 -33
@@ -0,0 +1,153 @@
1
+ var df=Object.create;var Si=Object.defineProperty;var ff=Object.getOwnPropertyDescriptor;var pf=Object.getOwnPropertyNames;var mf=Object.getPrototypeOf,hf=Object.prototype.hasOwnProperty;var te=(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}},gf=(t,e)=>{for(var r in e)Si(t,r,{get:e[r],enumerable:!0})},yf=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of pf(e))!hf.call(t,i)&&i!==r&&Si(t,i,{get:()=>e[i],enumerable:!(n=ff(e,i))||n.enumerable});return t};var wf=(t,e,r)=>(r=t!=null?df(mf(t)):{},yf(e||!t||!t.__esModule?Si(r,"default",{value:t,enumerable:!0}):r,t));var vf,ga,$f,bf,_f,xf,se,Ef,Sf,vr,$r,Pf,be,ya,wa,va,$a,ba,_a,xa,Ea,Sa,Pa,ka,Ra,Ia,Ca,Ta,Aa,Na,Pi,kf,Rf,ja,ib,ob,sb,ab,cb,lb,ub,db,fb,pb,mb,hb,gb,yb,Oe,Ut=te(()=>{vf=Object.create,ga=Object.defineProperty,$f=Object.getOwnPropertyDescriptor,bf=Object.getOwnPropertyNames,_f=Object.getPrototypeOf,xf=Object.prototype.hasOwnProperty,se=(t,e)=>()=>(e||(t((e={exports:{}}).exports,e),t=null),e.exports),Ef=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(var i=bf(e),s=0,a=i.length,c;s<a;s++)c=i[s],!xf.call(t,c)&&c!==r&&ga(t,c,{get:(l=>e[l]).bind(null,c),enumerable:!(n=$f(e,c))||n.enumerable});return t},Sf=(t,e,r)=>(r=t!=null?vf(_f(t)):{},Ef(e||!t||!t.__esModule?ga(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})),Pf=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})),ya=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})),wa=se(((t,e)=>{e.exports=new(be())("tag:yaml.org,2002:str",{kind:"scalar",construct:function(r){return r!==null?r:""}})})),va=se(((t,e)=>{e.exports=new(be())("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(r){return r!==null?r:[]}})})),$a=se(((t,e)=>{e.exports=new(be())("tag:yaml.org,2002:map",{kind:"mapping",construct:function(r){return r!==null?r:{}}})})),ba=se(((t,e)=>{e.exports=new(ya())({explicit:[wa(),va(),$a()]})})),_a=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"})})),xa=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"})})),Ea=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"]}})})),Sa=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"})})),Pa=se(((t,e)=>{e.exports=ba().extend({implicit:[_a(),xa(),Ea(),Sa()]})})),ka=se(((t,e)=>{e.exports=Pa()})),Ra=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 L=+u[10],H=+(u[11]||0);p=(L*60+H)*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})})),Ia=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})})),Ca=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})})),Ta=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})})),Aa=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})})),Na=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=ka().extend({implicit:[Ra(),Ia()],explicit:[Ca(),Ta(),Aa(),Na()]})})),kf=se(((t,e)=>{var r=vr(),n=$r(),i=Pf(),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 L(o){return Object.prototype.toString.call(o)}function H(o){return o===10||o===13}function j(o){return o===9||o===32}function ne(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 wt(o){if(o>=48&&o<=57)return o-48;let g=o|32;return g>=97&&g<=102?g-97+10:-1}function vt(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 $t(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"&&L($[_])==="[object Object]"&&($[_]="[object Object]")}if(typeof $=="object"&&L($)==="[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(;j($);)$===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(H($))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||ne(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(ne(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(ne(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(ne(S)||b&&fe(S))break}else if(k===35){if(ne(o.input.charCodeAt(o.position-1)))break}else{if(o.position===o.lineStart&&zt(o)||b&&fe(k))break;if(H(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),j(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 H($)?(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++,j($)||(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),H(C))ue(o,!1,g);else if(C<256&&qt[C])o.result+=mr[C],o.position++;else if(($=vt(C))>0){let d=$,w=0;for(;d>0;d--)C=o.input.charCodeAt(++o.position),($=wt(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 H(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++,j(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),N,q,F,X=o.input.charCodeAt(o.position);if(X===91)_=93,S=!1,w=[];else if(X===123)_=125,S=!0,w={};else return!1;for(o.anchor!==null&&We(o,o.anchor,w),X=o.input.charCodeAt(++o.position);X!==0;){if(ue(o,!0,g),X=o.input.charCodeAt(o.position),X===_)return o.position++,o.tag=d,o.anchor=R,o.kind=S?"mapping":"sequence",o.result=w,!0;b?X===44&&M(o,"expected the node content, but found ','"):M(o,"missed comma between flow collection entries"),q=N=F=null,x=k=!1,X===63&&ne(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,N=o.result,ue(o,!0,g),X=o.input.charCodeAt(o.position),(k||o.line===E)&&X===58&&(x=!0,X=o.input.charCodeAt(++o.position),ue(o,!0,g),Qe(o,g,c,!1,!0),F=o.result),S?Ye(o,w,O,q,N,F,E,$,C):x?w.push(Ye(o,null,O,q,N,F,E,$,C)):w.push(N),ue(o,!0,g),X=o.input.charCodeAt(o.position),X===44?(b=!0,X=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(j(x)){do x=o.input.charCodeAt(++o.position);while(j(x));if(x===35)do x=o.input.charCodeAt(++o.position);while(!H(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),H(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?j(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(;!H(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||!ne(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,N=!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;){!N&&o.firstTabInLine!==-1&&(o.position=o.firstTabInLine,M(o,"tab characters must not be used in indentation"));let X=o.input.charCodeAt(o.position+1),le=o.line;if((F===63||F===58)&&ne(X))F===63?(N&&(Ye(o,_,x,k,S,null,$,C,d),k=S=O=null),q=!0,N=!0,E=!0):N?(N=!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=X;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);j(F);)F=o.input.charCodeAt(++o.position);if(F===58)F=o.input.charCodeAt(++o.position),ne(F)||M(o,"a whitespace character is expected after the key-value separator within a block mapping"),N&&(Ye(o,_,x,k,S,null,$,C,d),k=S=O=null),q=!0,N=!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)&&(N&&($=o.line,C=o.lineStart,d=o.position),Qe(o,g,p,!0,E)&&(N?S=o.result:O=o.result),N||(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 N&&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&&!ne(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&&!ne(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&&!ne(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"?($t(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 N=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=N,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&&N&&!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,X=q.length;F<X;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&&!ne(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(;j(E);)E=o.input.charCodeAt(++o.position);if(E===35){do E=o.input.charCodeAt(++o.position);while(E!==0&&!H(E));break}if(H(E))break;for($=o.position;E!==0&&!ne(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})),Rf=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,L=44,H=45,j=58,ne=61,fe=62,wt=63,vt=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 N=d.compiledTypeMap.fallback[S];N&&a.call(N.styleAliases,O)&&(O=N.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,$t=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==='"'?$t: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!==L&&d!==ze&&d!==Je&&d!==ot&&d!==mr)&&d!==y&&!(w===j&&!x)||Ye(w)&&!Re(w)&&d===y||w===j&&x}function ue(d){return st(d)&&d!==c&&!Re(d)&&d!==H&&d!==wt&&d!==j&&d!==L&&d!==ze&&d!==Je&&d!==ot&&d!==mr&&d!==y&&d!==I&&d!==D&&d!==m&&d!==qt&&d!==ne&&d!==fe&&d!==P&&d!==h&&d!==v&&d!==vt&&d!==Vt}function zt(d){return!Re(d)&&d!==j}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 N,q=0,F=null,X=!1,le=!1,ha=_!==-1,yr=-1,wr=ue(Ge(d,0))&&zt(Ge(d,d.length-1));if(w||S)for(N=0;N<d.length;q>=65536?N+=2:N++){if(q=Ge(d,N),!st(q))return Xe;wr=wr&&Ft(q,F,O),F=q}else{for(N=0;N<d.length;q>=65536?N+=2:N++){if(q=Ge(d,N),q===f)X=!0,ha&&(le=le||N-yr-1>_&&d[yr+1]!==" ",yr=N);else if(!st(q))return Xe;wr=wr&&Ft(q,F,O),F=q}le=le||ha&&N-yr-1>_&&d[yr+1]!==" "}return!X&&!le?wr&&!S&&!x(d)?pn:k===$t?Xe:gr:R>9&&fn(d)?Xe:S?k===$t?Xe:gr:le?hn:mn}function bi(d,w,R,_,x){d.dump=(function(){if(w.length===0)return d.quotingType===$t?'""':"''";if(!d.noCompatMode&&(un.indexOf(w)!==-1||M.test(w)))return d.quotingType===$t?'"'+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 N(q){return dn(d,q)}switch(gn(w,O,d.indent,S,N,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],N=S[2];k=N[0]===" ",_+=O+(!x&&!k&&N!==""?`
28
+ `:"")+Qe(N,w),x=k}return _}function Qe(d,w){if(d===""||d[0]===" ")return d;let R=/ [^ ]/g,_,x=0,k,S=0,O=0,N="";for(;_=R.exec(d);)O=_.index,O-x>w&&(k=S>x?S:O,N+=`
29
+ `+d.slice(x,k),x=k+1),S=O;return N+=`
30
+ `,d.length-x>w&&S>x?N+=d.slice(x,S)+`
31
+ `+d.slice(S+1):N+=d.slice(x),N.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 N=R[S];d.replacer&&(N=d.replacer.call(R,String(S),N)),(b(d,w+1,N,!0,!0,!1,!0)||typeof N>"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 N="";_!==""&&(N+=", "),d.condenseFlow&&(N+='"');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&&(N+="? "),N+=d.dump+(d.condenseFlow?'"':"")+":"+(d.condenseFlow?"":" "),b(d,w,F,!1,!1)&&(N+=d.dump,_+=N))}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,N=S.length;O<N;O+=1){let q="";(!_||x!=="")&&(q+=Lt(d,w));let F=S[O],X=R[F];if(d.replacer&&(X=d.replacer.call(R,F,X)),!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,X,!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,N;if(s.call(S.represent)==="[object Function]")N=S.represent(w,O);else if(a.call(S.represent,O))N=S.represent[O](w,O);else throw new n("!<"+S.tag+'> tag resolver accepts not "'+O+'" style');d.dump=N}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),N=_;_&&(_=d.flowLevel<0||d.flowLevel>w);let q=O==="[object Object]"||O==="[object Array]",F,X;if(q&&(F=d.duplicates.indexOf(R),X=F!==-1),(d.tag!==null&&d.tag!=="?"||X||d.indent!==2&&w>0)&&(x=!1),X&&d.usedDuplicates[F])d.dump="*ref_"+F;else{if(q&&X&&!d.usedDuplicates[F]&&(d.usedDuplicates[F]=!0),O==="[object Object]")_&&Object.keys(d.dump).length!==0?(o(d,w,d.dump,x),X&&(d.dump="&ref_"+F+d.dump)):(Ei(d,w,d.dump),X&&(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),X&&(d.dump="&ref_"+F+d.dump)):(vn(d,w,d.dump),X&&(d.dump="&ref_"+F+" "+d.dump));else if(O==="[object String]")d.tag!=="?"&&bi(d,d.dump,w,k,N);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})),ja=Sf(se(((t,e)=>{var r=kf(),n=Rf();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=ya(),e.exports.FAILSAFE_SCHEMA=ba(),e.exports.JSON_SCHEMA=Pa(),e.exports.CORE_SCHEMA=ka(),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:Ca(),float:Sa(),map:$a(),null:_a(),pairs:Aa(),set:Na(),timestamp:Ra(),bool:xa(),int:Ea(),merge:Ia(),omap:Ta(),seq:va(),str:wa()},e.exports.safeLoad=i("safeLoad","load"),e.exports.safeLoadAll=i("safeLoadAll","loadAll"),e.exports.safeDump=i("safeDump","dump")}))(),1),{Type:ib,Schema:ob,FAILSAFE_SCHEMA:sb,JSON_SCHEMA:ab,CORE_SCHEMA:cb,DEFAULT_SCHEMA:lb,load:ub,loadAll:db,dump:fb,YAMLException:pb,types:mb,safeLoad:hb,safeLoadAll:gb,safeDump:yb}=ja.default,Oe=ja.default});import{access as $b,readFile as Oa}from"node:fs/promises";import{dirname as If,relative as _b,resolve as me}from"node:path";async function at(t){let e=me(t),r=await Oa(e,"utf-8"),n=Oe.load(r);return Cf(e,n)}function Cf(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 Ma(t){let e=await Oa(me(t),"utf-8");return Oe.load(e)}function Ie(t){return If(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 bt=te(()=>{"use strict";Ut()});import{readFile as Va}from"node:fs/promises";import{createRequire as Tf}from"node:module";import{dirname as Af,resolve as Da}from"node:path";async function jf(t,e){return t.startsWith("@")||!t.startsWith(".")&&!t.startsWith("/")?Nf.resolve(t):Da(e,t)}async function La(t){let e=Da(t),r=await Va(e,"utf-8"),n=Af(e);for(let i of r.matchAll(qa)){let s=i[0],a=i[1];if(!a)continue;let c=await jf(a,n),l=await Va(c,"utf-8");r=r.replace(s,`${l}
33
+ `)}return r.replace(qa,"").trim()}var qa,Nf,Fa=te(()=>{"use strict";qa=/^@import\s+['"](.+?)['"]\s*;/gm,Nf=Tf(import.meta.url)});import{readFileSync as Of}from"node:fs";import{createRequire as Mf}from"node:module";import{dirname as ki,resolve as Vf}from"node:path";import{fileURLToPath as qf}from"node:url";function Ze(){if(Ht)return Ht;let t=Mf(import.meta.url);try{return Ht=ki(t.resolve("view-contracts/package.json")),Ht}catch{let e=ki(qf(import.meta.url));for(;;){try{let n=Vf(e,"package.json");if(JSON.parse(Of(n,"utf8")).name==="view-contracts")return Ht=e,Ht}catch{}let r=ki(e);if(r===e)break;e=r}throw new Error("view-contracts package root not found")}}var Ht,br=te(()=>{"use strict"});import{resolve as Df}from"node:path";function _n(){return Df(Ze(),"renderers/react/runtime")}var Ri=te(()=>{"use strict";br()});import{readFile as Lf}from"node:fs/promises";import{extname as Ff,resolve as zf}from"node:path";async function xn(t){let e=zf(t),r=await Lf(e,"utf-8"),n=Ff(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=te(()=>{"use strict";Ut()});var En,Ue,Kt,Sn,he,Bt,_t=te(()=>{"use strict";En=["color","dimension","shadow","typography","layout"],Ue=class extends Error{constructor(e){super(e),this.name="DesignTokenError"}},Kt=["background","foreground","radius","padding","shadow","typography","display","gridTemplateColumns","minHeight","maxWidth","width","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"],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 Hf(t){if(!Kt.includes(t))throw new he(`Unknown variant property "${t}" (expected ${Kt.join(", ")})`);return t}function Bf(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(Uf);if(!n)throw new he(`${e}.${r} must be a token reference like "{ui.primary}", got "${t}"`);return n[1]}function za(t,e){let r={};for(let[n,i]of Object.entries(e)){let s=Hf(n),a=Bf(i,t,n);r[s]={ref:a,accepts:[...Sn[s]]}}return r}function Kf(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]=za(`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]=za(`${n}.${a}`,c)}r[n]=s}return{defaults:Kf(t.defaults),variants:r}}var Uf,Ti=te(()=>{"use strict";_t();Uf=/^\{([^}]+)\}$/});function _r(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Wf(t){return`--${t.replace(/\./g,"-")}`}function Yf(t,e){if(typeof t!="string"||!En.includes(t))throw new Ue(`Token "${e}" has unsupported $type "${String(t)}" (expected ${En.join(", ")})`);return t}function Ua(t,e,r){if(_r(t)){if("$type"in t&&"$value"in t){r.push({path:e,type:Yf(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;Ua(i,s,r)}}}function Gf(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 Ue(`Token value for "${t}" must be a string or supported object`)}function Xf(t){return typeof t!="string"?null:t.match(Jf)?.[1]??null}function Ha(t,e,r,n,i){let s=Xf(e);if(!s){let l=r.get(t);if(!l)throw new Ue(`Unknown token path "${t}"`);return{value:Gf(l.type,e)}}if(n.has(t))throw new Ue(`Circular token reference detected at "${t}"`);let a=r.get(s);if(!a)throw new Ue(`Token "${t}" references unknown token "{${s}}"`);if(i.has(s))return{value:i.get(s),ref:s};n.add(t);let c=Ha(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 Ue("Token document must be a YAML/JSON object");let e=[];Ua(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}=Ha(s.path,s.rawValue,r,new Set,n);n.set(s.path,a),i.push({path:s.path,type:s.type,value:a,cssVar:Wf(s.path),ref:c})}return{entries:i}}var Jf,Ni=te(()=>{"use strict";_t();Jf=/^\{([^}]+)\}$/});function Ka(t){return kn[t]?.properties??[]}function Ja(t,e){let r=kn[e];return r?r.properties.includes(t):!1}var Pn,kn,et,Ba,Kb,ct=te(()=>{"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","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","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","minHeight","label","foreground","background","radius","padding","border","borderColor","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","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","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","variant"],children:{kind:"any"}},TableRow:{description:"Row template repeated for each source item",tier:"core",category:"data",properties:["each","height","border","borderColor","variant"],children:{kind:"list",items:["TableCell"]}},TableCell:{description:"Data cell; children define cell content",tier:"core",category:"data",properties:["width","flex","align","border","borderColor","variant"],children:{kind:"any"}}},et=new Set(Object.keys(kn)),Ba=new Set(Object.entries(Pn).filter(([,t])=>t.lowering==="inline-css").map(([t])=>t)),Kb=new Set(Object.entries(Pn).filter(([,t])=>t.lowering==="class-name").map(([t])=>t))});function ji(t){let e=Ka(t),r=new Set;for(let n of e)Kt.includes(n)&&r.add(n);return r}var Wa=te(()=>{"use strict";ct();_t()});function Qf(t){return new Map(t.entries.map(e=>[e.path,e]))}function Ya(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 Ga(t,e){let r=Qf(t);for(let[n,i]of Object.entries(e.defaults)){let s=ji(n);Ya(`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))Ya(`variants.${n}.${a}`,n,c,s,r)}}function Oi(t,e){Ga(t,e)}var Mi=te(()=>{"use strict";_t();Wa()});function Vi(t){let e=[":root {"];for(let r of t.entries)e.push(` ${r.cssVar}: ${r.value};`);return e.push("}"),e.join(`
34
+ `)}function qi(t){return t.replace(/:root\s*\{[\s\S]*?\}\s*/m,"").trim()}var Xa=te(()=>{"use strict"});var Rn,Di=te(()=>{"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",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 Li=te(()=>{"use strict"});function Fi(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],p=Cn(t,l.ref);a.push(` ${f}: var(${p});`)}a.length!==0&&r.push(`.vc-${s} {
35
+ ${a.join(`
36
+ `)}
37
+ }`)}return r.join(`
38
+
39
+ `)}var Qa=te(()=>{"use strict";Di();Li()});function zi(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],m=Cn(t,p.ref);l.push(` ${u}: var(${m});`)}l.length!==0&&r.push(`.vc-${s}--${a} {
40
+ ${l.join(`
41
+ `)}
42
+ }`)}}return r.join(`
43
+
44
+ `)}var Za=te(()=>{"use strict";Di();Li()});function ec(t){return typeof t=="object"&&t!==null&&"kind"in t&&t.kind==="binding"}function Zf(t){if(t.variant!==void 0)return t.variant;if(t.tone!==void 0)return t.tone}function tc(t,e,r,n,i,s){let a=r.variants[t];if(!a){e!==void 0&&!ec(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||ec(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=Zf(t.props);t.props.variant!==void 0?tc(t.name,t.props.variant,e,r,n):i!==void 0&&t.name in e.variants&&tc(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 Ui(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:
45
+ ${r.map(n=>` - ${n}`).join(`
46
+ `)}`)}var rc=te(()=>{"use strict"});function Hi(t,e){return[...new Set([...t.matchAll(e)].map(r=>r[0]))]}function nc(t,e,r){let n=e.slice(0,5).map(s=>` - ${t}: ${s}`).join(`
47
+ `),i=e.length>5?`
48
+ \u2026 and ${e.length-5} more`:"";return`${r}
49
+ ${n}${i}`}function Bi(t,e){let r=Hi(t,ep);if(r.length!==0)throw new Bt(nc(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 Ki(t,e){let r=Hi(t,tp),n=Hi(t,rp),i=[...r,...n];if(i.length!==0)throw new Bt(nc(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 ep,tp,rp,Ji=te(()=>{"use strict";_t();ep=/\.vc-[a-z][\w-]*/g,tp=/(?:className\s*=\s*(?:"vc-[^"]*"|'vc-[^']*'|\{`[^`]*\bvc-[^`]*`\}|\{"vc-[^"]*"\}|\{'vc-[^']*'\})|["'`]vc-[a-z][\w-]*["'`])/g,rp=/\bextensionClassName\s*\(/g});import{readFile as ic,stat as np}from"node:fs/promises";import{resolve as ip}from"node:path";async function oc(t){try{return await np(t),!0}catch{return!1}}async function xr(t,e){let r=t.design?.extensionsCss;r&&await oc(r)&&Bi(await ic(r,"utf-8"),r);let n=Ie(e);for(let i of["extensions.tsx","extensions.ts"]){let s=ip(n,"src/components",i);await oc(s)&&Ki(await ic(s,"utf-8"),s)}}var sc=te(()=>{"use strict";bt();Ji()});async function op(t){let e=await xn(t);return Ai(e)}async function sp(t){let e=await xn(t);return Ci(e)}async function An(t,e){let r=await op(t),n=await sp(e);return Oi(r,n),{tokenIR:r,themeIR:n}}var Wi=te(()=>{"use strict";Ii();Ti();Ni();Mi();Xa();Qa();Za();Ii();Ti();Ni();Mi();rc();Ji();sc();Gi();_t()});import{readFile as ap,stat as cp}from"node:fs/promises";import{resolve as lp}from"node:path";async function up(t){try{return await cp(t),!0}catch{return!1}}async function Yi(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 La(lp(_n(),"theme.css")),l=qi(c),f=Fi(s,a),p=zi(s,a),u=`${Vi(s)}
50
+
51
+ ${l}`;f&&(u+=`
52
+
53
+ ${f}`),u+=`
54
+
55
+ ${p}`;let m=t.design?.extensionsCss;return m&&await up(m)&&(u+=`
56
+
57
+ ${await ap(m,"utf-8")}`),u}var Gi=te(()=>{"use strict";bt();Fa();Ri();Wi()});var Ir=T(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.regexpCode=ee.getEsmExportName=ee.getProperty=ee.safeStringify=ee.stringify=ee.strConcat=ee.addCodeArg=ee.str=ee._=ee.nil=ee._Code=ee.Name=ee.IDENTIFIER=ee._CodeOrName=void 0;var kr=class{};ee._CodeOrName=kr;ee.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var xt=class extends kr{constructor(e){if(super(),!ee.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}}};ee.Name=xt;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 xt&&(r[n.str]=(r[n.str]||0)+1),r),{})}};ee._Code=Ce;ee.nil=new Ce("");function _c(t,...e){let r=[t[0]],n=0;for(;n<e.length;)so(r,e[n]),r.push(t[++n]);return new Ce(r)}ee._=_c;var oo=new Ce("+");function xc(t,...e){let r=[Rr(t[0])],n=0;for(;n<e.length;)r.push(oo),so(r,e[n]),r.push(oo,Rr(t[++n]));return kp(r),new Ce(r)}ee.str=xc;function so(t,e){e instanceof Ce?t.push(...e._items):e instanceof xt?t.push(e):t.push(Cp(e))}ee.addCodeArg=so;function kp(t){let e=1;for(;e<t.length-1;){if(t[e]===oo){let r=Rp(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function Rp(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof xt||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 xt))return`"${t}${e.slice(1)}`}function Ip(t,e){return e.emptyStr()?t:t.emptyStr()?e:xc`${t}${e}`}ee.strConcat=Ip;function Cp(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Rr(Array.isArray(t)?t.join(","):t)}function Tp(t){return new Ce(Rr(t))}ee.stringify=Tp;function Rr(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ee.safeStringify=Rr;function Ap(t){return typeof t=="string"&&ee.IDENTIFIER.test(t)?new Ce(`.${t}`):_c`[${t}]`}ee.getProperty=Ap;function Np(t){if(typeof t=="string"&&ee.IDENTIFIER.test(t))return new Ce(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}ee.getEsmExportName=Np;function jp(t){return new Ce(t.toString())}ee.regexpCode=jp});var lo=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(),ao=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 Op=(0,Ee._)`\n`,co=class extends On{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Op: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 ao(f);l.set(f,jn.Completed)})}return s}};Se.ValueScope=co});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 Q=Ir(),Me=lo(),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=lo();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 Q._Code(">"),GTE:new Q._Code(">="),LT:new Q._Code("<"),LTE:new Q._Code("<="),EQ:new Q._Code("==="),NEQ:new Q._Code("!=="),NOT:new Q._Code("!"),OR:new Q._Code("||"),AND:new Q._Code("&&"),ADD:new Q._Code("+")};var tt=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},uo=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 Q._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 Q.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Gt(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Q.Name?{}:{...this.lhs.names};return Dn(e,this.rhs)}},fo=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}},po=class extends tt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},mo=class extends tt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},ho=class extends tt{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},go=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 Q._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)||(Mp(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Pt(e,r.names),{})}},rt=class extends Cr{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},yo=class extends Cr{},Yt=class extends rt{};Yt.kind="else";var Et=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(Ec(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&&Pt(e,this.else.names),e}};Et.kind="if";var St=class extends rt{};St.kind="for";var wo=class extends St{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 Pt(super.names,this.iteration.names)}},vo=class extends St{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 St{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 Pt(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 $o=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&&Pt(e,this.catch.names),this.finally&&Pt(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 bo=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
58
+ `:""},this._extScope=e,this._scope=new Me.Scope({parent:e}),this._nodes=[new yo]}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 uo(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 fo(e,W.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Q.nil&&this._leafNode(new go(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,Q.addCodeArg)(r,i));return r.push("}"),new Q._Code(r)}if(e,r,n){if(this._blockNode(new Et(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 Et(e))}else(){return this._elseNode(new Yt)}endIf(){return this._endBlockNode(Et,Yt)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new wo(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 vo(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 Q.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Q._)`${a}.length`,c=>{this.var(s,(0,Q._)`${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,Q._)`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(St)}label(e){return this._leafNode(new po(e))}break(e){return this._leafNode(new mo(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 $o;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 ho(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=Q.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 Et))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=bo;function Pt(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Dn(t,e){return e instanceof Q._CodeOrName?Pt(t,e.names):t}function Gt(t,e,r){if(t instanceof Q.Name)return n(t);if(!i(t))return t;return new Q._Code(t._items.reduce((s,a)=>(a instanceof Q.Name&&(a=n(a)),a instanceof Q._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 Q._Code&&s._items.some(a=>a instanceof Q.Name&&e[a.str]===1&&r[a.str]!==void 0)}}function Mp(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function Ec(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Q._)`!${_o(t)}`}W.not=Ec;var Vp=Sc(W.operators.AND);function qp(...t){return t.reduce(Vp)}W.and=qp;var Dp=Sc(W.operators.OR);function Lp(...t){return t.reduce(Dp)}W.or=Lp;function Sc(t){return(e,r)=>e===Q.nil?r:r===Q.nil?e:(0,Q._)`${_o(e)} ${t} ${_o(r)}`}function _o(t){return t instanceof Q.Name?t:(0,Q._)`(${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(),Fp=Ir();function zp(t){let e={};for(let r of t)e[r]=!0;return e}Y.toHash=zp;function Up(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(Rc(t,e),!Ic(e,t.self.RULES.all))}Y.alwaysValidSchema=Up;function Rc(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]||Ac(t,`unknown keyword: "${s}"`)}Y.checkUnknownRules=Rc;function Ic(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}Y.schemaHasRules=Ic;function Hp(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=Hp;function Bp({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=Bp;function Kp(t){return Cc(decodeURIComponent(t))}Y.unescapeFragment=Kp;function Jp(t){return encodeURIComponent(Eo(t))}Y.escapeFragment=Jp;function Eo(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}Y.escapeJsonPointer=Eo;function Cc(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}Y.unescapeJsonPointer=Cc;function Wp(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}Y.eachItem=Wp;function Pc({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:Pc({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} || {}`),So(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:Tc}),items:Pc({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 Tc(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,oe._)`{}`);return e!==void 0&&So(t,r,e),r}Y.evaluatedPropsToName=Tc;function So(t,e,r){Object.keys(r).forEach(n=>t.assign((0,oe._)`${e}${(0,oe.getProperty)(n)}`,!0))}Y.setEvaluated=So;var kc={};function Yp(t,e){return t.scopeValue("func",{ref:e,code:kc[e.code]||(kc[e.code]=new Fp._Code(e.code))})}Y.useFunc=Yp;var xo;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(xo||(Y.Type=xo={}));function Gp(t,e,r){if(t instanceof oe.Name){let n=e===xo.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():"/"+Eo(t)}Y.getErrorPath=Gp;function Ac(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=Ac});var Te=T(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});var we=K(),Xp={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")};Po.default=Xp});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 Z=K(),Fn=G(),_e=Te();ve.keywordError={message:({keyword:t})=>(0,Z.str)`must pass "${t}" keyword validation`};ve.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,Z.str)`"${t}" keyword must be ${e} ($data)`:(0,Z.str)`"${t}" keyword is invalid ($data)`};function Qp(t,e=ve.keywordError,r,n){let{it:i}=t,{gen:s,compositeRule:a,allErrors:c}=i,l=Oc(t,e,r);n??(a||c)?Nc(s,l):jc(i,(0,Z._)`[${l}]`)}ve.reportError=Qp;function Zp(t,e=ve.keywordError,r){let{it:n}=t,{gen:i,compositeRule:s,allErrors:a}=n,c=Oc(t,e,r);Nc(i,c),s||a||jc(n,_e.default.vErrors)}ve.reportExtraError=Zp;function em(t,e){t.assign(_e.default.errors,e),t.if((0,Z._)`${_e.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Z._)`${_e.default.vErrors}.length`,e),()=>t.assign(_e.default.vErrors,null)))}ve.resetErrorsCount=em;function tm({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,Z._)`${_e.default.vErrors}[${c}]`),t.if((0,Z._)`${a}.instancePath === undefined`,()=>t.assign((0,Z._)`${a}.instancePath`,(0,Z.strConcat)(_e.default.instancePath,s.errorPath))),t.assign((0,Z._)`${a}.schemaPath`,(0,Z.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,Z._)`${a}.schema`,r),t.assign((0,Z._)`${a}.data`,n))})}ve.extendErrors=tm;function Nc(t,e){let r=t.const("err",e);t.if((0,Z._)`${_e.default.vErrors} === null`,()=>t.assign(_e.default.vErrors,(0,Z._)`[${r}]`),(0,Z._)`${_e.default.vErrors}.push(${r})`),t.code((0,Z._)`${_e.default.errors}++`)}function jc(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,Z._)`new ${t.ValidationError}(${e})`):(r.assign((0,Z._)`${n}.errors`,e),r.return(!1))}var kt={keyword:new Z.Name("keyword"),schemaPath:new Z.Name("schemaPath"),params:new Z.Name("params"),propertyName:new Z.Name("propertyName"),message:new Z.Name("message"),schema:new Z.Name("schema"),parentSchema:new Z.Name("parentSchema")};function Oc(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,Z._)`{}`:rm(t,e,r)}function rm(t,e,r={}){let{gen:n,it:i}=t,s=[nm(i,r),im(t,r)];return om(t,e,s),n.object(...s)}function nm({errorPath:t},{instancePath:e}){let r=e?(0,Z.str)`${t}${(0,Fn.getErrorPath)(e,Fn.Type.Str)}`:t;return[_e.default.instancePath,(0,Z.strConcat)(_e.default.instancePath,r)]}function im({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,Z.str)`${e}/${t}`;return r&&(i=(0,Z.str)`${i}${(0,Fn.getErrorPath)(r,Fn.Type.Str)}`),[kt.schemaPath,i]}function om(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([kt.keyword,i],[kt.params,typeof e=="function"?e(t):e||(0,Z._)`{}`]),l.messages&&n.push([kt.message,typeof r=="function"?r(t):r]),l.verbose&&n.push([kt.schema,a],[kt.parentSchema,(0,Z._)`${p}${u}`],[_e.default.data,s]),f&&n.push([kt.propertyName,f])}});var Vc=T(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.boolOrEmptySchema=Xt.topBoolOrEmptySchema=void 0;var sm=Or(),am=K(),cm=Te(),lm={message:"boolean schema is false"};function um(t){let{gen:e,schema:r,validateName:n}=t;r===!1?Mc(t,!1):typeof r=="object"&&r.$async===!0?e.return(cm.default.data):(e.assign((0,am._)`${n}.errors`,null),e.return(!0))}Xt.topBoolOrEmptySchema=um;function dm(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),Mc(t)):r.var(e,!0)}Xt.boolOrEmptySchema=dm;function Mc(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,sm.reportError)(i,lm,void 0,e)}});var ko=T(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.getRules=Qt.isJSONType=void 0;var fm=["string","number","integer","boolean","null","object","array"],pm=new Set(fm);function mm(t){return typeof t=="string"&&pm.has(t)}Qt.isJSONType=mm;function hm(){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=hm});var Ro=T(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.shouldUseRule=ut.shouldUseGroup=ut.schemaHasRulesForType=void 0;function gm({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&qc(t,n)}ut.schemaHasRulesForType=gm;function qc(t,e){return e.rules.some(r=>Dc(t,r))}ut.shouldUseGroup=qc;function Dc(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=Dc});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 ym=ko(),wm=Ro(),vm=Or(),J=K(),Lc=G(),Zt;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Zt||($e.DataType=Zt={}));function $m(t){let e=Fc(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=$m;function Fc(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(ym.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}$e.getJSONTypes=Fc;function bm(t,e){let{gen:r,data:n,opts:i}=t,s=_m(e,i.coerceTypes),a=e.length>0&&!(s.length===0&&e.length===1&&(0,wm.schemaHasRulesForType)(t,e[0]));if(a){let c=Co(e,n,i.strictNumbers,Zt.Wrong);r.if(c,()=>{s.length?xm(t,e,s):To(t)})}return a}$e.coerceAndCheckDataType=bm;var zc=new Set(["string","number","integer","boolean","null"]);function _m(t,e){return e?t.filter(r=>zc.has(r)||e==="array"&&r==="array"):[]}function xm(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(Co(e,i,s.strictNumbers),()=>n.assign(c,i))),n.if((0,J._)`${c} !== undefined`);for(let f of r)(zc.has(f)||f==="array"&&s.coerceTypes==="array")&&l(f);n.else(),To(t),n.endIf(),n.if((0,J._)`${c} !== undefined`,()=>{n.assign(i,c),Em(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
59
+ || (${a} == "string" && ${i} && ${i} == +${i})`).assign(c,(0,J._)`+${i}`);return;case"integer":n.elseIf((0,J._)`${a} === "boolean" || ${i} === null
60
+ || (${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"
61
+ || ${a} === "boolean" || ${i} === null`).assign(c,(0,J._)`[${i}]`)}}}function Em({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,J._)`${e} !== undefined`,()=>t.assign((0,J._)`${e}[${r}]`,n))}function Io(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=Io;function Co(t,e,r,n){if(t.length===1)return Io(t[0],e,r,n);let i,s=(0,Lc.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,Io(a,e,r,n));return i}$e.checkDataTypes=Co;var Sm={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,J._)`{type: ${t}}`:(0,J._)`{type: ${e}}`};function To(t){let e=Pm(t);(0,vm.reportError)(e,Sm)}$e.reportTypeError=To;function Pm(t){let{gen:e,data:r,schema:n}=t,i=(0,Lc.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var Hc=T(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.assignDefaults=void 0;var er=K(),km=G();function Rm(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)Uc(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>Uc(t,s,i.default))}zn.assignDefaults=Rm;function Uc(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,km.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(),Ao=G(),dt=Te(),Im=G();function Cm(t,e){let{gen:r,data:n,it:i}=t;r.if(jo(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,ae._)`${e}`},!0),t.error()})}ie.checkReportMissingProp=Cm;function Tm({gen:t,data:e,it:{opts:r}},n,i){return(0,ae.or)(...n.map(s=>(0,ae.and)(jo(t,e,s,r.ownProperties),(0,ae._)`${i} = ${s}`)))}ie.checkMissingProp=Tm;function Am(t,e){t.setParams({missingProperty:e},!0),t.error()}ie.reportMissingProp=Am;function Bc(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ae._)`Object.prototype.hasOwnProperty`})}ie.hasPropFunc=Bc;function No(t,e,r){return(0,ae._)`${Bc(t)}.call(${e}, ${r})`}ie.isOwnProperty=No;function Nm(t,e,r,n){let i=(0,ae._)`${e}${(0,ae.getProperty)(r)} !== undefined`;return n?(0,ae._)`${i} && ${No(t,e,r)}`:i}ie.propertyInData=Nm;function jo(t,e,r,n){let i=(0,ae._)`${e}${(0,ae.getProperty)(r)} === undefined`;return n?(0,ae.or)(i,(0,ae.not)(No(t,e,r))):i}ie.noPropertyInData=jo;function Kc(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}ie.allSchemaProperties=Kc;function jm(t,e){return Kc(e).filter(r=>!(0,Ao.alwaysValidSchema)(t,e[r]))}ie.schemaProperties=jm;function Om({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=Om;var Mm=(0,ae._)`new RegExp`;function Vm({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"?Mm:(0,Im.useFunc)(t,i)}(${r}, ${n})`})}ie.usePattern=Vm;function qm(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:Ao.Type.Num},s),e.if((0,ae.not)(s),c)})}}ie.validateArray=qm;function Dm(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,Ao.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=Dm});var Yc=T(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.validateKeywordUsage=He.validSchemaType=He.funcKeywordCode=He.macroKeywordCode=void 0;var xe=K(),Rt=Te(),Lm=Ae(),Fm=Or();function zm(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:a}=t,c=e.macro.call(a.self,i,s,a),l=Wc(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))}He.macroKeywordCode=zm;function Um(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:a,$data:c,it:l}=t;Bm(l,e);let f=!c&&e.compile?e.compile.call(l.self,s,a,l):e.validate,p=Wc(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&&Jc(t),I(()=>t.error());else{let P=e.async?h():y();e.modifying&&Jc(t),I(()=>Hm(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?Rt.default.this:Rt.default.self,L=!("compile"in e&&!c||e.schema===!1);n.assign(u,(0,xe._)`${P}${(0,Lm.callValidateCode)(t,p,D,L)}`,e.modifying)}function I(P){var D;n.if((0,xe.not)((D=e.valid)!==null&&D!==void 0?D:u),P)}}He.funcKeywordCode=Um;function Jc(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,xe._)`${n.parentData}[${n.parentDataProperty}]`))}function Hm(t,e){let{gen:r}=t;r.if((0,xe._)`Array.isArray(${e})`,()=>{r.assign(Rt.default.vErrors,(0,xe._)`${Rt.default.vErrors} === null ? ${e} : ${Rt.default.vErrors}.concat(${e})`).assign(Rt.default.errors,(0,xe._)`${Rt.default.vErrors}.length`),(0,Fm.extendErrors)(t)},()=>t.error())}function Bm({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function Wc(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 Km(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")}He.validSchemaType=Km;function Jm({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)}}He.validateKeywordUsage=Jm});var Xc=T(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.extendSubschemaMode=ft.extendSubschemaData=ft.getSubschema=void 0;var Be=K(),Gc=G();function Wm(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,Gc.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=Wm;function Ym(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,Gc.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=Ym;function Gm(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=Gm});var Oo=T((x0,Qc)=>{"use strict";Qc.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 el=T((E0,Zc)=>{"use strict";var pt=Zc.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(){};Un(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 Un(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++)Un(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)Un(t,e,r,u[h],i+"/"+p+"/"+Xm(h),s,i,p,n,h)}else(p in pt.keywords||t.allKeys&&!(p in pt.skipKeywords))&&Un(t,e,r,u,i+"/"+p,s,i,p,n)}r(n,i,s,a,c,l,f)}}function Xm(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 Qm=G(),Zm=Oo(),eh=el(),th=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function rh(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Mo(t):e?tl(t)<=e:!1}Pe.inlineRef=rh;var nh=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Mo(t){for(let e in t){if(nh.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Mo)||typeof r=="object"&&Mo(r))return!0}return!1}function tl(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!th.has(r)&&(typeof t[r]=="object"&&(0,Qm.eachItem)(t[r],n=>e+=tl(n)),e===1/0))return 1/0}return e}function rl(t,e="",r){r!==!1&&(e=tr(e));let n=t.parse(e);return nl(t,n)}Pe.getFullPath=rl;function nl(t,e){return t.serialize(e).split("#")[0]+"#"}Pe._getFullPath=nl;var ih=/#\/?$/;function tr(t){return t?t.replace(ih,""):""}Pe.normalizeId=tr;function oh(t,e,r){return r=tr(r),t.resolve(e,r)}Pe.resolveUrl=oh;var sh=/^[a-z_][-a-z0-9._]*$/i;function ah(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=tr(t[r]||e),s={"":i},a=rl(n,i,!1),c={},l=new Set;return eh(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(L){let H=this.opts.uriResolver.resolve;if(L=tr(I?H(I,L):L),l.has(L))throw p(L);l.add(L);let j=this.refs[L];return typeof j=="string"&&(j=this.refs[j]),typeof j=="object"?f(u,j.schema,L):L!==tr(v)&&(L[0]==="#"?(f(u,c[L],L),c[L]=u):this.refs[L]=v),L}function D(L){if(typeof L=="string"){if(!sh.test(L))throw new Error(`invalid anchor "${L}"`);P.call(this,`#${L}`)}}}),c;function f(u,m,h){if(m!==void 0&&!Zm(u,m))throw p(h)}function p(u){return new Error(`reference "${u}" resolves to more than one schema`)}}Pe.getSchemaRefs=ah});var Lr=T(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.getData=mt.KeywordCxt=mt.validateFunctionCode=void 0;var cl=Vc(),il=Mr(),qo=Ro(),Hn=Mr(),ch=Hc(),Dr=Yc(),Vo=Xc(),V=K(),B=Te(),lh=Vr(),nt=G(),qr=Or();function uh(t){if(dl(t)&&(fl(t),ul(t))){ph(t);return}ll(t,()=>(0,cl.topBoolOrEmptySchema)(t))}mt.validateFunctionCode=uh;function ll({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"; ${ol(r,i)}`),fh(t,i),t.code(s)}):t.func(e,(0,V._)`${B.default.data}, ${dh(i)}`,n.$async,()=>t.code(ol(r,i)).code(s))}function dh(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 fh(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 ph(t){let{schema:e,opts:r,gen:n}=t;ll(t,()=>{r.$comment&&e.$comment&&ml(t),wh(t),n.let(B.default.vErrors,null),n.let(B.default.errors,0),r.unevaluated&&mh(t),pl(t),bh(t)})}function mh(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 ol(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 hh(t,e){if(dl(t)&&(fl(t),ul(t))){gh(t,e);return}(0,cl.boolOrEmptySchema)(t,e)}function ul({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 dl(t){return typeof t.schema!="boolean"}function gh(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&ml(t),vh(t),$h(t);let s=n.const("_errs",B.default.errors);pl(t,s),n.var(e,(0,V._)`${s} === ${B.default.errors}`)}function fl(t){(0,nt.checkUnknownRules)(t),yh(t)}function pl(t,e){if(t.opts.jtd)return sl(t,[],!1,e);let r=(0,il.getSchemaTypes)(t.schema),n=(0,il.coerceAndCheckDataType)(t,r);sl(t,r,!n,e)}function yh(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 wh(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 vh(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,lh.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function $h(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function ml({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 bh(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&&_h(t),e.return((0,V._)`${B.default.errors} === 0`))}function _h({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 sl(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(()=>gl(t,"$ref",p.all.$ref.definition));return}l.jtd||xh(t,e),i.block(()=>{for(let m of p.rules)u(m);u(p.post)});function u(m){(0,qo.shouldUseGroup)(s,m)&&(m.type?(i.if((0,Hn.checkDataType)(m.type,a,l.strictNumbers)),al(t,m),e.length===1&&e[0]===m.type&&r&&(i.else(),(0,Hn.reportTypeError)(t)),i.endIf()):al(t,m),c||i.if((0,V._)`${B.default.errors} === ${n||0}`))}}function al(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,ch.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,qo.shouldUseRule)(n,s)&&gl(t,s.keyword,s.definition,e.type)})}function xh(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(Eh(t,e),t.opts.allowUnionTypes||Sh(t,e),Ph(t,t.dataTypes))}function Eh(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{hl(t.dataTypes,r)||Do(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),Rh(t,e)}}function Sh(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Do(t,"use allowUnionTypes to allow union type keyword")}function Ph(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,qo.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(a=>kh(e,a))&&Do(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function kh(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function hl(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function Rh(t,e){let r=[];for(let n of t.dataTypes)hl(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function Do(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",yl(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,Hn.checkDataTypes)(l,r,s.opts.strictNumbers,Hn.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,Vo.getSubschema)(this.it,e);(0,Vo.extendSubschemaData)(n,this.it,e),(0,Vo.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return hh(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 gl(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 Ih=/^\/(?:[^~]|~0|~1)*$/,Ch=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function yl(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return B.default.rootData;if(t[0]==="/"){if(!Ih.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=B.default.rootData}else{let f=Ch.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=yl});var Kn=T(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});var Lo=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Fo.default=Lo});var Fr=T(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});var zo=Vr(),Uo=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,zo.resolveUrl)(e,r,n),this.missingSchema=(0,zo.normalizeId)((0,zo.getFullPath)(e,this.missingRef))}};Ho.default=Uo});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(),Th=Kn(),It=Te(),qe=Vr(),wl=G(),Ah=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 Ko(t){let e=vl.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:Th.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:It.default.data,parentData:It.default.parentData,parentDataProperty:It.default.parentDataProperty,dataNames:[It.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,Ah.validateFunctionCode)(f),a.optimize(this.opts.code.optimize);let u=a.toString();p=`${a.scopeRefs(It.default.scope)}return ${u}`,this.opts.code.process&&(p=this.opts.code.process(p,t));let h=new Function(`${It.default.self}`,`${It.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=Ko;function Nh(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=Mh.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]=jh.call(this,s)}Ne.resolveRef=Nh;function jh(t){return(0,qe.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Ko.call(this,t)}function vl(t){for(let e of this._compilations)if(Oh(e,t))return e}Ne.getCompilingSchema=vl;function Oh(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function Mh(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 Bo.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:Bo.call(this,r,c)}if(typeof a?.schema=="object"){if(a.validate||Ko.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 Bo.call(this,r,a)}}Ne.resolveSchema=Jn;var Vh=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Bo(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,wl.unescapeFragment)(c)];if(l===void 0)return;r=l;let f=typeof r=="object"&&r[this.opts.schemaId];!Vh.has(c)&&f&&(e=(0,qe.resolveUrl)(this.opts.uriResolver,e,f))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,wl.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 $l=T((C0,qh)=>{qh.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 Yo=T((T0,Pl)=>{"use strict";var Dh=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),_l=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),Jo=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),xl=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),Lh=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Wo(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 Fh=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function bl(t){return t.length=0,!0}function zh(t,e,r){if(t.length){let n=Wo(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function Uh(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,a=!1,c=zh;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=bl}else{i.push(f);continue}}return i.length&&(c===bl?r.zone=i.join(""):a?n.push(i.join("")):n.push(Wo(i))),r.address=n.join(""),r}function El(t){if(Hh(t,":")<2)return{host:t,isIPV6:!1};let e=Uh(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 Hh(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function Bh(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 Kh={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},Jh=/[@/?#:]/g,Wh=/[@/?#]/g;function Sl(t,e){let r=e?Wh:Jh;return r.lastIndex=0,t.replace(r,n=>Kh[n])}function Yh(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(Jo(i)){let s=i.toUpperCase(),a=String.fromCharCode(parseInt(s,16));e&&xl(a)?r+=a:r+="%"+s,n+=2;continue}}r+=t[n]}return r}function Gh(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(Jo(n)){let i=n.toUpperCase(),s=String.fromCharCode(parseInt(i,16));s!=="."&&xl(s)?e+=s:e+="%"+i,r+=2;continue}}Lh(t[r])?e+=t[r]:e+=escape(t[r])}return e}function Xh(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(Jo(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function Qh(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!_l(r)){let n=El(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=Sl(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}Pl.exports={nonSimpleDomain:Fh,recomposeAuthority:Qh,reescapeHostDelimiters:Sl,normalizePercentEncoding:Yh,normalizePathEncoding:Gh,escapePreservingEscapes:Xh,removeDotSegments:Bh,isIPv4:_l,isUUID:Dh,normalizeIPv6:El,stringArrayToHexStripped:Wo}});var Tl=T((A0,Cl)=>{"use strict";var{isUUID:Zh}=Yo(),eg=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,tg=["http","https","ws","wss","urn","urn:uuid"];function rg(t){return tg.indexOf(t)!==-1}function Go(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 kl(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function Rl(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 ng(t){return t.secure=Go(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function ig(t){if((t.port===(Go(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 og(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(eg);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=Xo(i);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function sg(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=Xo(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 ag(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!Zh(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function cg(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var Il={scheme:"http",domainHost:!0,parse:kl,serialize:Rl},lg={scheme:"https",domainHost:Il.domainHost,parse:kl,serialize:Rl},Wn={scheme:"ws",domainHost:!0,parse:ng,serialize:ig},ug={scheme:"wss",domainHost:Wn.domainHost,parse:Wn.parse,serialize:Wn.serialize},dg={scheme:"urn",parse:og,serialize:sg,skipNormalize:!0},fg={scheme:"urn:uuid",parse:ag,serialize:cg,skipNormalize:!0},Yn={http:Il,https:lg,ws:Wn,wss:ug,urn:dg,"urn:uuid":fg};Object.setPrototypeOf(Yn,null);function Xo(t){return t&&(Yn[t]||Yn[t.toLowerCase()])||void 0}Cl.exports={wsIsSecure:Go,SCHEMES:Yn,isValidSchemeName:rg,getSchemeHandler:Xo}});var Vl=T((N0,Gn)=>{"use strict";var{normalizeIPv6:pg,removeDotSegments:Ur,recomposeAuthority:mg,normalizePercentEncoding:hg,normalizePathEncoding:gg,escapePreservingEscapes:yg,reescapeHostDelimiters:wg,isIPv4:vg,nonSimpleDomain:$g}=Yo(),{SCHEMES:bg,getSchemeHandler:Nl}=Tl();function _g(t,e){return typeof t=="string"?t=kg(t,e):typeof t=="object"&&(t=nr(Ct(t,e),e)),t}function xg(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=jl(nr(t,n),nr(e,n),n,!0);return n.skipEscape=!0,Ct(i,n)}function jl(t,e,r,n){let i={};return n||(t=nr(Ct(t,r),r),e=nr(Ct(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=Ur(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=Ur(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=Ur(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=Ur(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 Eg(t,e,r){let n=Al(t,r),i=Al(e,r);return n!==void 0&&i!==void 0&&n.toLowerCase()===i.toLowerCase()}function Ct(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=Nl(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=hg(r.path):(r.path=yg(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let a=mg(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=Ur(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 Sg=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Pg(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 Ol(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(Sg);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=Pg(n,a);if(c!==void 0&&(n.error=n.error||c,i=!0),n.host)if(vg(n.host)===!1){let p=pg(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=Nl(r.scheme||n.scheme);if(!r.unicodeSupport&&(!l||!l.unicodeSupport)&&n.host&&(r.domainHost||l&&l.domainHost)&&s===!1&&$g(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=wg(unescape(n.host),s))),n.path&&(n.path=gg(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 Ol(t,e).parsed}function kg(t,e){return Ml(t,e).normalized}function Ml(t,e){let{parsed:r,malformedAuthorityOrPort:n}=Ol(t,e);return{normalized:n?t:Ct(r,e),malformedAuthorityOrPort:n}}function Al(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=Ml(t,e);return n?void 0:r}if(typeof t=="object")return Ct(t,e)}var Qo={SCHEMES:bg,normalize:_g,resolve:xg,resolveComponent:jl,equal:Eg,serialize:Ct,parse:nr};Gn.exports=Qo;Gn.exports.default=Qo;Gn.exports.fastUri=Qo});var Dl=T(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});var ql=Vl();ql.code='require("ajv/dist/runtime/uri").default';Zo.default=ql});var Jl=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 Rg=Lr();Object.defineProperty(ge,"KeywordCxt",{enumerable:!0,get:function(){return Rg.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 Ig=Kn(),Hl=Fr(),Cg=ko(),Hr=zr(),Tg=K(),Br=Vr(),Xn=Mr(),ts=G(),Ll=$l(),Ag=Dl(),Bl=(t,e)=>new RegExp(t,e);Bl.code="new RegExp";var Ng=["removeAdditional","useDefaults","coerceTypes"],jg=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Og={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."},Mg={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Fl=200;function Vg(t){var e,r,n,i,s,a,c,l,f,p,u,m,h,y,v,I,P,D,L,H,j,ne,fe,wt,vt;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:Bl,qt=(i=t.uriResolver)!==null&&i!==void 0?i:Ag.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:Fl,loopEnum:(I=t.loopEnum)!==null&&I!==void 0?I:Fl,meta:(P=t.meta)!==null&&P!==void 0?P:!0,messages:(D=t.messages)!==null&&D!==void 0?D:!0,inlineRefs:(L=t.inlineRefs)!==null&&L!==void 0?L:!0,schemaId:(H=t.schemaId)!==null&&H!==void 0?H:"$id",addUsedSchema:(j=t.addUsedSchema)!==null&&j!==void 0?j:!0,validateSchema:(ne=t.validateSchema)!==null&&ne!==void 0?ne:!0,validateFormats:(fe=t.validateFormats)!==null&&fe!==void 0?fe:!0,unicodeRegExp:(wt=t.unicodeRegExp)!==null&&wt!==void 0?wt:!0,int32range:(vt=t.int32range)!==null&&vt!==void 0?vt:!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,...Vg(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new Tg.ValueScope({scope:{},prefixes:jg,es5:r,lines:n}),this.logger=Ug(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,Cg.getRules)(),zl.call(this,Og,e,"NOT SUPPORTED"),zl.call(this,Mg,e,"DEPRECATED","warn"),this._metaOpts=Fg.call(this),e.formats&&Dg.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&Lg.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),qg.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=Ll;n==="id"&&(i={...Ll},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 Hl.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=Ul.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new Hr.SchemaEnv({schema:{},schemaId:n});if(r=Hr.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=Ul.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(Bg.call(this,n,r),!r)return(0,ts.eachItem)(n,s=>es.call(this,s)),this;Jg.call(this,r);let i={...r,type:(0,Xn.getJSONTypes)(r.type),schemaType:(0,Xn.getJSONTypes)(r.schemaType)};return(0,ts.eachItem)(n,i.type.length===0?s=>es.call(this,s,i):s=>i.type.forEach(a=>es.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]=Kl(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 Hr.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):Hr.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{Hr.compileSchema.call(this,e)}finally{this.opts=r}}};Kr.ValidationError=Ig.default;Kr.MissingRefError=Hl.default;ge.default=Kr;function zl(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 Ul(t){return t=(0,Br.normalizeId)(t),this.schemas[t]||this.refs[t]}function qg(){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 Dg(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function Lg(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 Fg(){let t={...this.opts};for(let e of Ng)delete t[e];return t}var zg={log(){},warn(){},error(){}};function Ug(t){if(t===!1)return zg;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 Hg=/^[a-z_$][a-z0-9_$:-]*$/i;function Bg(t,e){let{RULES:r}=this;if((0,ts.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!Hg.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 es(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?Kg.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 Kg(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 Jg(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=Kl(e)),t.validateSchema=this.compile(e,!0))}var Wg={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Kl(t){return{anyOf:[t,Wg]}}});var Wl=T(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});var Yg={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};rs.default=Yg});var ei=T(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.callRef=Tt.getValidate=void 0;var Gg=Fr(),Yl=Ae(),ke=K(),or=Te(),Gl=zr(),Qn=G(),Xg={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=Gl.resolveRef.call(l,f,i,r);if(p===void 0)throw new Gg.default(n.opts.uriResolver,i,r);if(p instanceof Gl.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=Xl(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 Xl(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,ke._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Tt.getValidate=Xl;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,Yl.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,Yl.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)}}}Tt.callRef=Zn;Tt.default=Xg});var Ql=T(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});var Qg=Wl(),Zg=ei(),ey=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Qg.default,Zg.default];ns.default=ey});var Zl=T(is=>{"use strict";Object.defineProperty(is,"__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}},ty={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}}`},ry={keyword:Object.keys(ri),type:"number",schemaType:"number",$data:!0,error:ty,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,ti._)`${r} ${ri[e].fail} ${n} || isNaN(${r})`)}};is.default=ry});var eu=T(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});var Jr=K(),ny={message:({schemaCode:t})=>(0,Jr.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Jr._)`{multipleOf: ${t}}`},iy={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:ny,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}))`)}};os.default=iy});var ru=T(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});function tu(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}ss.default=tu;tu.code='require("ajv/dist/runtime/ucs2length").default'});var nu=T(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});var At=K(),oy=G(),sy=ru(),ay={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,At.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,At._)`{limit: ${t}}`},cy={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:ay,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?At.operators.GT:At.operators.LT,a=i.opts.unicode===!1?(0,At._)`${r}.length`:(0,At._)`${(0,oy.useFunc)(t.gen,sy.default)}(${r})`;t.fail$data((0,At._)`${a} ${s} ${n}`)}};as.default=cy});var iu=T(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});var ly=Ae(),uy=G(),sr=K(),dy={message:({schemaCode:t})=>(0,sr.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,sr._)`{pattern: ${t}}`},fy={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:dy,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,uy.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,ly.usePattern)(t,i);t.fail$data((0,sr._)`!${l}.test(${r})`)}}};cs.default=fy});var ou=T(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});var Wr=K(),py={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}}`},my={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:py,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}`)}};ls.default=my});var su=T(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});var Yr=Ae(),Gr=K(),hy=G(),gy={message:({params:{missingProperty:t}})=>(0,Gr.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Gr._)`{missingProperty: ${t}}`},yy={keyword:"required",type:"object",schemaType:"array",$data:!0,error:gy,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,hy.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)}}};us.default=yy});var au=T(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});var Xr=K(),wy={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}}`},vy={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:wy,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}`)}};ds.default=vy});var ni=T(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});var cu=Oo();cu.code='require("ajv/dist/runtime/equal").default';fs.default=cu});var lu=T(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});var ps=Mr(),ye=K(),$y=G(),by=ni(),_y={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}}`},xy={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:_y,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,ps.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,ps.checkDataTypes)(f,I,c.opts.strictNumbers,ps.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,$y.useFunc)(e,by.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)})))}}};ms.default=xy});var uu=T(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});var hs=K(),Ey=G(),Sy=ni(),Py={message:"must be equal to constant",params:({schemaCode:t})=>(0,hs._)`{allowedValue: ${t}}`},ky={keyword:"const",$data:!0,error:Py,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,hs._)`!${(0,Ey.useFunc)(e,Sy.default)}(${r}, ${i})`):t.fail((0,hs._)`${s} !== ${r}`)}};gs.default=ky});var du=T(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});var Qr=K(),Ry=G(),Iy=ni(),Cy={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Qr._)`{allowedValues: ${t}}`},Ty={keyword:"enum",schemaType:"array",$data:!0,error:Cy,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,Ry.useFunc)(e,Iy.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}`}}};ys.default=Ty});var fu=T(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});var Ay=Zl(),Ny=eu(),jy=nu(),Oy=iu(),My=ou(),Vy=su(),qy=au(),Dy=lu(),Ly=uu(),Fy=du(),zy=[Ay.default,Ny.default,jy.default,Oy.default,My.default,Vy.default,qy.default,Dy.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Ly.default,Fy.default];ws.default=zy});var $s=T(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.validateAdditionalItems=void 0;var Nt=K(),vs=G(),Uy={message:({params:{len:t}})=>(0,Nt.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Nt._)`{limit: ${t}}`},Hy={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Uy,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,vs.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}pu(t,n)}};function pu(t,e){let{gen:r,schema:n,data:i,keyword:s,it:a}=t;a.items=!0;let c=r.const("len",(0,Nt._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Nt._)`${c} <= ${e.length}`);else if(typeof n=="object"&&!(0,vs.alwaysValidSchema)(a,n)){let f=r.var("valid",(0,Nt._)`${c} <= ${e.length}`);r.if((0,Nt.not)(f),()=>l(f)),t.ok(f)}function l(f){r.forRange("i",e.length,c,p=>{t.subschema({keyword:s,dataProp:p,dataPropType:vs.Type.Num},f),a.allErrors||r.if((0,Nt.not)(f),()=>r.break())})}}Zr.validateAdditionalItems=pu;Zr.default=Hy});var bs=T(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.validateTuple=void 0;var mu=K(),ii=G(),By=Ae(),Ky={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return hu(t,"additionalItems",e);r.items=!0,!(0,ii.alwaysValidSchema)(r,e)&&t.ok((0,By.validateArray)(t))}};function hu(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,mu._)`${s}.length`);r.forEach((u,m)=>{(0,ii.alwaysValidSchema)(c,u)||(n.if((0,mu._)`${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=hu;en.default=Ky});var gu=T(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});var Jy=bs(),Wy={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,Jy.validateTuple)(t,"items")};_s.default=Wy});var wu=T(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});var yu=K(),Yy=G(),Gy=Ae(),Xy=$s(),Qy={message:({params:{len:t}})=>(0,yu.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,yu._)`{limit: ${t}}`},Zy={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:Qy,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,Yy.alwaysValidSchema)(n,e)&&(i?(0,Xy.validateAdditionalItems)(t,i):t.ok((0,Gy.validateArray)(t)))}};xs.default=Zy});var vu=T(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});var je=K(),oi=G(),ew={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}}`},tw={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:ew,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)))}}};Es.default=tw});var si=T(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.validateSchemaDeps=Ke.validatePropertyDeps=Ke.error=void 0;var Ss=K(),rw=G(),tn=Ae();Ke.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,Ss.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,Ss._)`{property: ${t},
62
+ missingProperty: ${n},
63
+ depsCount: ${e},
64
+ deps: ${r}}`};var nw={keyword:"dependencies",type:"object",schemaType:"object",error:Ke.error,code(t){let[e,r]=iw(t);$u(t,e),bu(t,r)}};function iw({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 $u(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,Ss._)`${l} && (${(0,tn.checkMissingProp)(t,c,s)})`),(0,tn.reportMissingProp)(t,s),r.else())}}Ke.validatePropertyDeps=$u;function bu(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,a=r.name("valid");for(let c in e)(0,rw.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=bu;Ke.default=nw});var xu=T(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});var _u=K(),ow=G(),sw={message:"property name must be valid",params:({params:t})=>(0,_u._)`{propertyName: ${t.propertyName}}`},aw={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:sw,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,ow.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,_u.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};Ps.default=aw});var Rs=T(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});var ai=Ae(),De=K(),cw=Te(),ci=G(),lw={message:"must NOT have additional properties",params:({params:t})=>(0,De._)`{additionalProperty: ${t.additionalProperty}}`},uw={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:lw,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} === ${cw.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 L={keyword:"additionalProperties",dataProp:I,dataPropType:ci.Type.Str};D===!1&&Object.assign(L,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(L,P)}}};ks.default=uw});var Pu=T(Cs=>{"use strict";Object.defineProperty(Cs,"__esModule",{value:!0});var dw=Lr(),Eu=Ae(),Is=G(),Su=Rs(),fw={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&&Su.default.code(new dw.KeywordCxt(s,Su.default,"additionalProperties"));let a=(0,Eu.allSchemaProperties)(r);for(let u of a)s.definedProperties.add(u);s.opts.unevaluated&&a.length&&s.props!==!0&&(s.props=Is.mergeEvaluated.props(e,(0,Is.toHash)(a),s.props));let c=a.filter(u=>!(0,Is.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,Eu.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)}}};Cs.default=fw});var Cu=T(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});var ku=Ae(),li=K(),Ru=G(),Iu=G(),pw={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,ku.allSchemaProperties)(r),l=c.filter(v=>(0,Ru.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,Iu.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,Ru.checkStrictMode)(s,`property ${I} matches pattern ${v} (use allowMatchingProperties)`)}function y(v){e.forIn("key",n,I=>{e.if((0,li._)`${(0,ku.usePattern)(t,v)}.test(${I})`,()=>{let P=l.includes(v);P||t.subschema({keyword:"patternProperties",schemaProp:v,dataProp:I,dataPropType:Iu.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())})})}}};Ts.default=pw});var Tu=T(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});var mw=G(),hw={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,mw.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"}};As.default=hw});var Au=T(Ns=>{"use strict";Object.defineProperty(Ns,"__esModule",{value:!0});var gw=Ae(),yw={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:gw.validateUnion,error:{message:"must match a schema in anyOf"}};Ns.default=yw});var Nu=T(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});var ui=K(),ww=G(),vw={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,ui._)`{passingSchemas: ${t.passing}}`},$w={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:vw,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,ww.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)})})}}};js.default=$w});var ju=T(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});var bw=G(),_w={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,bw.alwaysValidSchema)(n,s))return;let c=t.subschema({keyword:"allOf",schemaProp:a},i);t.ok(i),t.mergeEvaluated(c)})}};Os.default=_w});var Vu=T(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});var di=K(),Mu=G(),xw={message:({params:t})=>(0,di.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,di._)`{failingKeyword: ${t.ifClause}}`},Ew={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:xw,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,Mu.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=Ou(n,"then"),s=Ou(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 Ou(t,e){let r=t.schema[e];return r!==void 0&&!(0,Mu.alwaysValidSchema)(t,r)}Ms.default=Ew});var qu=T(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});var Sw=G(),Pw={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,Sw.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Vs.default=Pw});var Du=T(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});var kw=$s(),Rw=gu(),Iw=bs(),Cw=wu(),Tw=vu(),Aw=si(),Nw=xu(),jw=Rs(),Ow=Pu(),Mw=Cu(),Vw=Tu(),qw=Au(),Dw=Nu(),Lw=ju(),Fw=Vu(),zw=qu();function Uw(t=!1){let e=[Vw.default,qw.default,Dw.default,Lw.default,Fw.default,zw.default,Nw.default,jw.default,Aw.default,Ow.default,Mw.default];return t?e.push(Rw.default,Cw.default):e.push(kw.default,Iw.default),e.push(Tw.default),e}qs.default=Uw});var Ls=T(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.dynamicAnchor=void 0;var Ds=K(),Hw=Te(),Lu=zr(),Bw=ei(),Kw={keyword:"$dynamicAnchor",schemaType:"string",code:t=>Fu(t,t.schema)};function Fu(t,e){let{gen:r,it:n}=t;n.schemaEnv.root.dynamicAnchors[e]=!0;let i=(0,Ds._)`${Hw.default.dynamicAnchors}${(0,Ds.getProperty)(e)}`,s=n.errSchemaPath==="#"?n.validateName:Jw(t);r.if((0,Ds._)`!${i}`,()=>r.assign(i,s))}rn.dynamicAnchor=Fu;function Jw(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 Lu.SchemaEnv({schema:r,schemaId:l,root:i,baseId:s,localRefs:a,meta:c});return Lu.compileSchema.call(n,f),(0,Bw.getValidate)(t,f)}rn.default=Kw});var Fs=T(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.dynamicRef=void 0;var zu=K(),Ww=Te(),Uu=ei(),Yw={keyword:"$dynamicRef",schemaType:"string",code:t=>Hu(t,t.schema)};function Hu(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,zu._)`${Ww.default.dynamicAnchors}${(0,zu.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,Uu.callRef)(t,l),r.let(f,!0)}):()=>(0,Uu.callRef)(t,l)}}nn.dynamicRef=Hu;nn.default=Yw});var Bu=T(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});var Gw=Ls(),Xw=G(),Qw={keyword:"$recursiveAnchor",schemaType:"boolean",code(t){t.schema?(0,Gw.dynamicAnchor)(t,""):(0,Xw.checkStrictMode)(t.it,"$recursiveAnchor: false is ignored")}};zs.default=Qw});var Ku=T(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});var Zw=Fs(),ev={keyword:"$recursiveRef",schemaType:"string",code:t=>(0,Zw.dynamicRef)(t,t.schema)};Us.default=ev});var Ju=T(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});var tv=Ls(),rv=Fs(),nv=Bu(),iv=Ku(),ov=[tv.default,rv.default,nv.default,iv.default];Hs.default=ov});var Yu=T(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});var Wu=si(),sv={keyword:"dependentRequired",type:"object",schemaType:"object",error:Wu.error,code:t=>(0,Wu.validatePropertyDeps)(t)};Bs.default=sv});var Gu=T(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});var av=si(),cv={keyword:"dependentSchemas",type:"object",schemaType:"object",code:t=>(0,av.validateSchemaDeps)(t)};Ks.default=cv});var Xu=T(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});var lv=G(),uv={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:t,parentSchema:e,it:r}){e.contains===void 0&&(0,lv.checkStrictMode)(r,`"${t}" without "contains" is ignored`)}};Js.default=uv});var Qu=T(Ws=>{"use strict";Object.defineProperty(Ws,"__esModule",{value:!0});var dv=Yu(),fv=Gu(),pv=Xu(),mv=[dv.default,fv.default,pv.default];Ws.default=mv});var ed=T(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});var gt=K(),Zu=G(),hv=Te(),gv={message:"must NOT have unevaluated properties",params:({params:t})=>(0,gt._)`{unevaluatedProperty: ${t.unevaluatedProperty}}`},yv={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:gv,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} === ${hv.default.errors}`);function l(u){if(r===!1){t.setParams({unevaluatedProperty:u}),t.error(),a||e.break();return}if(!(0,Zu.alwaysValidSchema)(s,r)){let m=e.name("valid");t.subschema({keyword:"unevaluatedProperties",dataProp:u,dataPropType:Zu.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)}}};Ys.default=yv});var rd=T(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});var jt=K(),td=G(),wv={message:({params:{len:t}})=>(0,jt.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,jt._)`{limit: ${t}}`},vv={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:wv,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,jt._)`${n}.length`);if(r===!1)t.setParams({len:s}),t.fail((0,jt._)`${a} > ${s}`);else if(typeof r=="object"&&!(0,td.alwaysValidSchema)(i,r)){let l=e.var("valid",(0,jt._)`${a} <= ${s}`);e.if((0,jt.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:td.Type.Num},l),i.allErrors||e.if((0,jt.not)(l),()=>e.break())})}}};Gs.default=vv});var nd=T(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});var $v=ed(),bv=rd(),_v=[$v.default,bv.default];Xs.default=_v});var id=T(Qs=>{"use strict";Object.defineProperty(Qs,"__esModule",{value:!0});var de=K(),xv={message:({schemaCode:t})=>(0,de.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,de._)`{format: ${t}}`},Ev={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:xv,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(),L()));function D(){return l.strictSchema===!1?de.nil:(0,de._)`${a} && !${P}`}function L(){let H=p.$async?(0,de._)`(${v}.async ? await ${P}(${n}) : ${P}(${n}))`:(0,de._)`${P}(${n})`,j=(0,de._)`(typeof ${P} == "function" ? ${H} : ${P}.test(${n}))`;return(0,de._)`${P} && ${P} !== true && ${I} === ${e} && !${j}`}}function h(){let y=u.formats[s];if(!y){D();return}if(y===!0)return;let[v,I,P]=L(y);v===e&&t.pass(H());function D(){if(l.strictSchema===!1){u.logger.warn(j());return}throw new Error(j());function j(){return`unknown format "${s}" ignored in schema at path "${f}"`}}function L(j){let ne=j instanceof RegExp?(0,de.regexpCode)(j):l.code.formats?(0,de._)`${l.code.formats}${(0,de.getProperty)(s)}`:void 0,fe=r.scopeValue("formats",{key:s,ref:j,code:ne});return typeof j=="object"&&!(j instanceof RegExp)?[j.type||"string",j.validate,(0,de._)`${fe}.validate`]:["string",j,fe]}function H(){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})`}}}};Qs.default=Ev});var od=T(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});var Sv=id(),Pv=[Sv.default];Zs.default=Pv});var sd=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 cd=T(ea=>{"use strict";Object.defineProperty(ea,"__esModule",{value:!0});var kv=Ql(),Rv=fu(),Iv=Du(),Cv=Ju(),Tv=Qu(),Av=nd(),Nv=od(),ad=sd(),jv=[Cv.default,kv.default,Rv.default,(0,Iv.default)(!0),Nv.default,ad.metadataVocabulary,ad.contentVocabulary,Tv.default,Av.default];ea.default=jv});var ud=T(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.DiscrError=void 0;var ld;(function(t){t.Tag="tag",t.Mapping="mapping"})(ld||(fi.DiscrError=ld={}))});var fd=T(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});var cr=K(),ta=ud(),dd=zr(),Ov=Fr(),Mv=G(),Vv={message:({params:{discrError:t,tagName:e}})=>t===ta.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}}`},qv={keyword:"discriminator",type:"object",schemaType:"object",error:Vv,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:ta.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:ta.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 H=0;H<a.length;H++){let j=a[H];if(j?.$ref&&!(0,Mv.schemaHasRulesButRef)(j,s.self.RULES)){let fe=j.$ref;if(j=dd.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,fe),j instanceof dd.SchemaEnv&&(j=j.schema),j===void 0)throw new Ov.default(s.opts.uriResolver,s.baseId,fe)}let ne=(h=j?.properties)===null||h===void 0?void 0:h[c];if(typeof ne!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${c}"`);I=I&&(v||P(j)),D(ne,H)}if(!I)throw new Error(`discriminator: "${c}" must be required`);return y;function P({required:H}){return Array.isArray(H)&&H.includes(c)}function D(H,j){if(H.const)L(H.const,j);else if(H.enum)for(let ne of H.enum)L(ne,j);else throw new Error(`discriminator: "properties/${c}" must have "const" or "enum"`)}function L(H,j){if(typeof H!="string"||H in y)throw new Error(`discriminator: "${c}" values must be unique strings`);y[H]=j}}}};ra.default=qv});var pd=T((Nx,Dv)=>{Dv.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 md=T((jx,Lv)=>{Lv.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 hd=T((Ox,Fv)=>{Fv.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 gd=T((Mx,zv)=>{zv.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 yd=T((Vx,Uv)=>{Uv.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 wd=T((qx,Hv)=>{Hv.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 vd=T((Dx,Bv)=>{Bv.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 $d=T((Lx,Kv)=>{Kv.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 bd=T(na=>{"use strict";Object.defineProperty(na,"__esModule",{value:!0});var Jv=pd(),Wv=md(),Yv=hd(),Gv=gd(),Xv=yd(),Qv=wd(),Zv=vd(),e$=$d(),t$=["/properties"];function r$(t){return[Jv,Wv,Yv,Gv,Xv,e(this,Qv),Zv,e(this,e$)].forEach(r=>this.addMetaSchema(r,void 0,!1)),this;function e(r,n){return t?r.$dataMetaSchema(n,t$):n}}na.default=r$});var _d=T((ce,oa)=>{"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 n$=Jl(),i$=cd(),o$=fd(),s$=bd(),ia="https://json-schema.org/draft/2020-12/schema",lr=class extends n$.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),i$.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(o$.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:r}=this.opts;r&&(s$.default.call(this,e),this.refs["http://json-schema.org/schema"]=ia)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(ia)?ia:void 0)}};ce.Ajv2020=lr;oa.exports=ce=lr;oa.exports.Ajv2020=lr;Object.defineProperty(ce,"__esModule",{value:!0});ce.default=lr;var a$=Lr();Object.defineProperty(ce,"KeywordCxt",{enumerable:!0,get:function(){return a$.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 c$=Kn();Object.defineProperty(ce,"ValidationError",{enumerable:!0,get:function(){return c$.default}});var l$=Fr();Object.defineProperty(ce,"MissingRefError",{enumerable:!0,get:function(){return l$.default}})});import{readFile as p$}from"node:fs/promises";async function kd(t){return Oe.load(await p$(t,"utf-8"))}function Rd(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 Id(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 Cd=te(()=>{"use strict";Ut()});import{resolve as m$}from"node:path";function h$(t){Rd(Object.keys(t.elements),et,Td),Id(t.elements,["tag"],Td)}async function aa(t){if(!t&&sa)return sa;let e=t??m$(Ze(),"renderers/react/elements.yaml"),r=await kd(e);return h$(r),t||(sa=r),r}var Td,sa,Ad=te(()=>{"use strict";ct();ct();br();Cd();Td="renderers/react/elements.yaml",sa=null});function Nd(t){if(t)return t==="start"?"flex-start":t==="end"?"flex-end":t}function jd(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 Od=te(()=>{"use strict"});function Le(t){return`${t}px`}function dr(t){let e=t.match(/^\{([^}]+)\}$/);if(e)return`var(--${e[1].replace(/\./g,"-")})`}function ca(t){let e={},r=t.width;typeof r=="number"?e.width=Le(r):typeof r=="string"&&r!=="wrap"&&r!=="fill"&&(e.width=r),typeof t.minWidth=="number"&&(e.minWidth=Le(t.minWidth)),typeof t.maxWidth=="number"&&(e.maxWidth=Le(t.maxWidth)),typeof t.height=="number"&&(e.height=Le(t.height)),typeof t.minHeight=="number"&&(e.minHeight=Le(t.minHeight)),typeof t.maxHeight=="number"&&(e.maxHeight=Le(t.maxHeight)),t.aspectRatio!==void 0&&(e.aspectRatio=String(t.aspectRatio));let n=t.weight;typeof n=="number"&&(e.flexGrow=n),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 i=t.textAlign;typeof i=="string"&&(e.textAlign=i==="start"?"left":i==="end"?"right":i);let s=t.contentAlign;typeof s=="string"&&s in Md&&(e.placeItems=Md[s]),typeof t.overflow=="string"&&(e.overflow=t.overflow);let a=t.selfAlign;typeof a=="string"&&(e.alignSelf=a==="start"?"flex-start":a==="end"?"flex-end":a);let c=t.size;typeof c=="number"?e.fontSize=Le(c):typeof c=="string"&&(e.fontSize=c);let l=typeof n=="string"?n:t.fontWeight;typeof l=="string"&&(e.fontWeight=l);let f=t.background;typeof f=="string"&&(e.background=dr(f)??f);let p=t.foreground;typeof p=="string"&&(e.color=dr(p)??p);let u=t.radius;typeof u=="number"?e.borderRadius=Le(u):typeof u=="string"&&(e.borderRadius=dr(u)??u);let m=t.shadow;m===!0?e.boxShadow="var(--ui-shadow)":m===!1?e.boxShadow="none":typeof m=="string"&&(e.boxShadow=g$[m]??dr(m)??m);let h=t.border;typeof h=="string"&&(e.border=dr(h)??h),typeof t.opacity=="number"&&(e.opacity=t.opacity);let y=t.clip;typeof y=="string"&&(e.overflow=y==="hidden"?"hidden":y);let v=t.align;if(typeof v=="string"){let L=Nd(v);L&&(e.alignItems=L)}let I=t.justify;if(typeof I=="string"){let L=jd(I);L&&(e.justifyContent=L)}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 P=t.borderColor;typeof P=="string"&&(e.borderColor=dr(P)??P);let D=t.flex;return typeof D=="number"&&(e.flex=D),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 Md,g$,la=te(()=>{"use strict";Od();Md={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"},g$={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 y$(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 w$(t){let e={};for(let[r,n]of Object.entries(t)){if(!Ba.has(r))continue;y$(r,n);let i=mi(t,r);i!==void 0&&(e[r]=i)}return e}function v$(t){return t.flex?{display:"flex",flexDirection:t.flex==="column"?"column":"row"}:{}}function $$(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 Vd(t,e){let r=w$(e),n=ca(r);if(n={...n,...v$(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,...$$(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 qd=te(()=>{"use strict";ct();la();la()});function U(t){return" ".repeat(t)}function Mt(t,e="vm"){let r=t.scope??e;return t.path?`${r}.${t.path}`:r}function Ud(t){return t.parts.map(e=>typeof e=="string"?e:`\${${Mt(e)}}`).join("")}function b$(t){return`\`${Ud(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 da(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`[
65
+ ${t.map(n=>`${U(e+1)}${da(n,e+1,r)}`).join(`,
66
+ `)}
67
+ ${U(e)}]`;if(typeof t=="object"&&t!==null){let n=t;return"kind"in n&&n.kind==="action"?hi(n,r):`{
68
+ ${Object.entries(n).map(([s,a])=>`${s}: ${da(a,e+1,r)}`).map(s=>`${U(e+1)}${s}`).join(`,
69
+ `)}
70
+ ${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`[
71
+ ${t.map(n=>`${U(e+1)}${pr(n,e+1,r)}`).join(`,
72
+ `)}
73
+ ${U(e)}]`;if(typeof t=="object"&&t!==null&&"kind"in t){if(t.kind==="binding")return Mt(t);if(t.kind==="action")return hi(t,r);if(t.kind==="literal")return da(t.value,e,r);if(t.kind==="concat")return b$(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 z(t,e){let r=t[e];if(r!=null)return pr(r,0)}function an(t,e,r){let n=Vd(e,r);n&&t.push(n)}function _$(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 ua(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function x$(t,e){let r=fr(e,"variant");if(typeof r=="string")return` vc-${ua(t)}--${r}`;let n=e.variant;if(n&&typeof n=="object"&&"kind"in n&&n.kind==="concat")return` vc-${ua(t)}--${Ud(n)}`;let i=z(e,"variant");if(i)return` vc-${ua(t)}--\${${i}}`}function cn(t,e,r){let n=e.className??"",i=x$(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=z(r,"size");return`className={\`${e.className} ${e.sizeClass}-\${${s} ?? 'md'}\`}`}return`className="${n}"`}function Dd(t,e,r){let n=fr(e,"label"),i=fr(e,"help"),s=fr(e,"error"),a=z(e,"label"),c=z(e,"help"),l=z(e,"error"),f=[`${U(r)}<label className="vc-field">`];return typeof n=="string"?f.push(`${U(r+1)}<span className="vc-field-label">{${JSON.stringify(n)}}</span>`):a&&f.push(`${U(r+1)}{${a} ? <span className="vc-field-label">{${a}}</span> : null}`),f.push(`${U(r+1)}${t}`),typeof i=="string"?f.push(`${U(r+1)}<span className="vc-field-help">{${JSON.stringify(i)}}</span>`):c&&f.push(`${U(r+1)}{${c} ? <span className="vc-field-help">{${c}}</span> : null}`),typeof s=="string"?f.push(`${U(r+1)}<span className="vc-field-error">{${JSON.stringify(s)}}</span>`):l&&f.push(`${U(r+1)}{${l} ? <span className="vc-field-error">{${l}}</span> : null}`),f.push(`${U(r)}</label>`),f.join(`
74
+ `)}function E$(t,e){let r=z(t,"name")??'""',n=z(t,"label")??'""',i=t.checked?`defaultChecked={${z(t,"checked")}}`:"",s=t.enabled?`disabled={${z(t,"enabled")} === false}`:"";return`${U(e)}<label className="vc-checkbox">
75
+ ${U(e+1)}<input type="checkbox" name={${r}} ${i} ${s} />
76
+ ${U(e+1)}<span>{${n}}</span>
77
+ ${U(e)}</label>`}function S$(t,e){let r=z(t,"binding")??z(t,"name")??'""',n=z(t,"value")??'""',i=z(t,"label")??'""',s=t.checked?`defaultChecked={${z(t,"checked")}}`:"",a=t.enabled?`disabled={${z(t,"enabled")} === false}`:"";return`${U(e)}<label className="vc-radio">
78
+ ${U(e+1)}<input type="radio" name={${r}} value={${n}} ${s} ${a} />
79
+ ${U(e+1)}<span>{${i}}</span>
80
+ ${U(e)}</label>`}function P$(t,e){let r=z(t,"binding")??z(t,"name")??'""',n=z(t,"label")??'""',i=t.checked?`defaultChecked={${z(t,"checked")}}`:"",s=t.enabled?`disabled={${z(t,"enabled")} === false}`:"";return`${U(e)}<label className="vc-switch">
81
+ ${U(e+1)}<input type="checkbox" role="switch" name={${r}} ${i} ${s} />
82
+ ${U(e+1)}<span>{${n}}</span>
83
+ ${U(e)}</label>`}function k$(t,e,r){let n=t.props;if(n.alt!==void 0){let a=[cn(t.name,e,n),`src={${z(n,"name")??'""'}}`,`alt={${z(n,"alt")??'""'}}`];return an(a,e,n),n.id&&a.push(`id={${z(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={${z(n,"id")}}`),n.name&&s.push(`data-icon={${z(n,"name")}}`),`${U(r)}<span ${s.join(" ")} />`}function Ld(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(`
84
+ `);let n=pr(r,0);return`${U(e+1)}{${n}.map((option) => <option key={option.value} value={option.value}>{option.label}</option>)}`}function Fd(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={${z(r,"id")}}`),r.role?i.push(`role={${z(r,"role")}}`):e.defaultRole&&i.push(`role="${e.defaultRole}"`),e.ariaLabel&&(r.ariaLabel?i.push(`aria-label={${z(r,"ariaLabel")}}`):r.label?i.push(`aria-label={${z(r,"label")}}`):r.title&&i.push(`aria-label={${z(r,"title")}}`)),r.name&&i.push(`name={${z(r,"name")}}`),r.placeholder&&i.push(`placeholder={${z(r,"placeholder")}}`),e.inputType&&i.push(`type={${z(r,"type")??JSON.stringify(e.inputType)}}`),r.required&&i.push(`required={${z(r,"required")}}`),r.readonly&&i.push(`readOnly={${z(r,"readonly")}}`),r.enabled&&i.push(`disabled={${z(r,"enabled")} === false}`),e.tag==="img"&&r.src&&i.push(`src={${z(r,"src")}}`),e.tag==="img"&&r.alt&&i.push(`alt={${z(r,"alt")}}`),e.tag==="progress"&&r.value&&i.push(`value={${z(r,"value")}}`),r.rows&&i.push(`rows={${z(r,"rows")??"4"}}`),`${U(n)}<${e.tag} ${i.join(" ")} />`}function zd(t,e,r,n){let i=[];if(e.ariaHidden&&i.push("aria-hidden"),r.id&&i.push(`id={${z(r,"id")}}`),r.role?i.push(`role={${z(r,"role")}}`):e.defaultRole&&i.push(`role="${e.defaultRole}"`),e.ariaLabel&&(r.ariaLabel?i.push(`aria-label={${z(r,"ariaLabel")}}`):r.label?i.push(`aria-label={${z(r,"label")}}`):r.title&&i.push(`aria-label={${z(r,"title")}}`)),e.actionEvent){let s=_$(r,e.actionEvent);s&&i.push(s)}return e.tag==="button"&&r.enabled&&i.push(`disabled={${z(r,"enabled")} === false}`),e.tag==="a"&&r.href&&i.push(`href={${z(r,"href")}}`),e.tag==="button"&&i.push(`type={${z(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=z(e,"visible");return`${U(r)}{${n} !== false ? (
85
+ ${t}
86
+ ${U(r)}) : null}`}function fa(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)}{${Mt(a,i)}}`:a.kind==="map"?R$(a,e,r):a.kind==="fragment"?fa(a.children,e,r,n):r(a,e,n)}).filter(Boolean).join(`
87
+ `)}function R$(t,e,r){let n=t.item,i=r(t.body,e+1,n);if(t.key){let s=` key={${Mt(t.key,n)}}`;i=i.replace(/^( +)<(\w+)/,`$1<$2${s}`)}return`${U(e)}{${Mt(t.source)}.map((${n}) => (
88
+ ${i}
89
+ ${U(e)}))}`}function I$(t,e,r,n,i){let s=t.props,a=fa(t.children,r+1,i,n);if(e.checkbox)return it(E$(s,r),s,r);if(t.name==="Radio")return it(S$(s,r),s,r);if(t.name==="Switch")return it(P$(s,r),s,r);if(t.name==="Icon")return it(k$(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={${z(s,"id")}}`),s.role?p.push(`role={${z(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(Dd(p,s,r),s,r)}if(e.fieldWrap){let p=e.tag,u;if(e.optionsProp&&s[e.optionsProp]){let m=zd(t.name,e,s,p);u=`${U(r+1)}${m}>
90
+ ${Ld(s,r+2)}
91
+ ${U(r+1)}</${p}>`}else u=Fd(t.name,e,s,r+1);return it(Dd(u,s,r),s,r)}let c=e.tag;if(e.void)return it(Fd(t.name,e,s,r),s,r);let l=zd(t.name,e,s,c),f;return!a&&e.optionsProp&&s[e.optionsProp]?f=`${U(r)}${l}>
92
+ ${Ld(s,r+1)}
93
+ ${U(r)}</${c}>`:a?f=`${U(r)}${l}>
94
+ ${a}
95
+ ${U(r)}</${c}>`:f=`${U(r)}${l} />`,it(f,s,r)}function C$(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}={${Mt(i,r)}}`:`${n}={${pr(i,0)}}`).join(" ")}function T$(t,e,r){let n=C$(t.props,r),i=n?` ${n}`:"";return`${U(e)}<${t.name}${i} />`}function A$(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}={${Mt(i,r)}}`:n==="children"?"":`${n}={${pr(i,0,n==="columns")}}`).join(" ")}function N$(t,e,r,n){let i=A$(t.props,r),s=i?` ${i}`:"",a=fa(t.children,e+1,n,r);return a?`${U(e)}<${t.name}${s}>
96
+ ${a}
97
+ ${U(e)}</${t.name}>`:`${U(e)}<${t.name}${s} />`}function Hd(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 Ot(t,e,r,n){if(t.kind==="component"){Hd(t.name,e,r)||n.add(t.name);for(let i of t.children)Ot(i,e,r,n);return}if(t.kind==="map"&&Ot(t.body,e,r,n),t.kind==="fragment")for(let i of t.children)Ot(i,e,r,n)}function Bd(t,e){let r=(n,i,s)=>n.kind==="viewRef"?T$(n,i,s):n.kind!=="component"?"":Hd(n.name,t,e)?I$(n,t.elements[n.name],i,s,r):N$(n,i,s,r);return(n,i,s)=>r(n,i,s)}var Kd=te(()=>{"use strict";qd()});var Gd={};gf(Gd,{partialReactOutputPath:()=>F$,renderReactComponent:()=>pa,renderReactFromIr:()=>D$,renderReactPreviewBundle:()=>L$});import{resolve as j$}from"node:path";function O$(t){if(t.isPartial)return t.exportName;let e=t.exportName.replace(/View$/,"")||t.exportName;return e.charAt(0).toUpperCase()+e.slice(1)}function M$(t,e){if(t.kind!=="component")throw new Error(`View IR root must be a component node (${e})`);return t}function Wd(t){if(!t)return[];let e=t.match(/\b[A-Z][A-Za-z0-9]*ViewModel\b/g);return e?[...new Set(e)]:[]}function V$(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 Jd(t){return t.trimStart().startsWith("{")?`return (
98
+ <>${t}
99
+ </>
100
+ );`:`return (
101
+ ${t}
102
+ );`}function q$(t){let e=t.replace(/^\/\*\*[\s\S]*?\*\/\s*/,"");return e=e.replace(/^import\s[^\n]+\n/gm,""),e.trimStart()}async function Yd(t,e){let r=await aa(e.elementMapPath),n=e.allowlistExtra??[],i=O$(t),s=M$(t.root,t.source),c=Bd(r,n)(s,2),l=new Set;Ot(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 j of Wd(t.propsType))I.add(j);else I.add(t.viewModel);let P=["import type { ReactElement } from 'react';"];P.push(`import { dispatchAction } from '${h}';`);let D=[...I].sort(),L=D.length>0?`${D.join(", ")}, ActionDescriptor`:"ActionDescriptor";P.push(`import type { ${L} } from '${y}';`),f.length>0&&P.push(`import { ${f.join(", ")} } from '${v}';`);for(let j of u){if(e.inlineViewRefs)continue;let ne=e.viewRefImportFrom?.get(j)??`./${j}.generated.js`;P.push(`import { ${j} } from '${ne}';`)}let H=m?`/**
103
+ * Preview module \u2014 compiled live from ${t.source}
104
+ * Same lowering as generated/; not written to disk.
105
+ */`:`/**
106
+ * Auto-generated React component from ${t.source}
107
+ * DO NOT EDIT \u2014 regenerate with: view-contracts render react
108
+ */`;if(t.isPartial){let j=V$(t);return`${H}
109
+ ${P.join(`
110
+ `)}
111
+
112
+ export function ${i}(${j}): ReactElement {
113
+ ${Jd(c)}
114
+ }
115
+ `}return`${H}
116
+ ${P.join(`
117
+ `)}
118
+
119
+ export function ${i}({ vm }: { vm: ${t.viewModel} }): ReactElement {
120
+ ${Jd(c)}
121
+ }
122
+ `}async function pa(t,e){return Yd(t,e)}async function D$(t,e,r){let{writeFile:n,mkdir:i}=await import("node:fs/promises"),{dirname:s}=await import("node:path"),a=await Yd(t,r);await i(s(e),{recursive:!0}),await n(e,a,"utf-8")}async function L$(t,e,r){let n={...r,inlineViewRefs:!0},i=await Promise.all(e.map(H=>pa(H,n))),s=await pa(t,n),a=q$,c=await aa(r.elementMapPath),l=r.allowlistExtra??[],f=new Set;Ot(t.root,c,l,f);for(let H of e)Ot(H.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 H of e)for(let j of Wd(H.propsType))y.add(j);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?`/**
123
+ * Preview module \u2014 compiled live from ${t.source}
124
+ * Same lowering as generated/; not written to disk.
125
+ */`:"",D=i.map(a),L=a(s);return`${P}
126
+ ${v.join(`
127
+ `)}
128
+
129
+ ${D.join(`
130
+
131
+ `)}
132
+
133
+ ${L}`}function F$(t,e){return j$(t,"components",`${e.exportName}.generated.tsx`)}var Xd=te(()=>{"use strict";Ad();Kd()});import{readFile as H$,stat as kE}from"node:fs/promises";import{resolve as ef}from"node:path";function tf(){return"views/preview"}function B$(t){return`${t.charAt(0).toLowerCase()}${t.slice(1)}Mock`}function K$(t,e,r){let n=Ie(t),i=e.preview?.mocksDir??tf();return ef(n,i,`${r}.mock.yaml`)}function J$(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function W$(t,e){if(!J$(t))throw new yi(`${e} must be a YAML object (ViewModel fields at the root)`);return t}async function Y$(t){let e;try{e=await H$(t,"utf-8")}catch{throw new yi(`Preview mock not found: ${t}`)}let r=Oe.load(e);return W$(r,t)}function G$(t,e){let r=B$(t);return`/** Auto-built from views/preview/${t}.mock.yaml \u2014 preview / example only */
134
+ export const ${r} = ${JSON.stringify(e,null,2)};
135
+ `}async function rf(t,e,r){let n=K$(t,e,r),i=await Y$(n);return G$(r,i)}function nf(t){if(!t.startsWith(ln))return null;let e=t.slice(ln.length);return e.length>0?e:null}async function of(t,e){let r=Ie(t),n=e.preview?.mocksDir??tf();return ef(r,n)}var ln,yi,sf=te(()=>{"use strict";Ut();bt();ln="view-contracts:preview/mock/",yi=class extends Error{constructor(e){super(e),this.name="PreviewMockError"}}});bt();Gi();br();Ri();import{transform as X$}from"esbuild";import{resolve as yt}from"node:path";import{resolve as z$}from"node:path";import{readFile as yc}from"node:fs/promises";import{basename as xp,relative as wc,resolve as vc}from"node:path";ct();import{dirname as lc,resolve as uc}from"node:path";import A from"typescript";import{readFileSync as dp}from"node:fs";import{resolve as fp}from"node:path";import re from"typescript";function Xi(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=fp(e,i);for(let a of n.importClause.namedBindings.elements)r.set(a.name.text,s)}return r}function pp(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 mp(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 hp(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 ac(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=mp(e.parameters[0]);if(n=pp(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=hp(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 Qi(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=ac(s.initializer);a&&(r=a)}if(re.isExportAssignment(i)&&i.isExportEquals===!1&&i.expression&&re.isCallExpression(i.expression)){let s=ac(i.expression);s&&e==="default"&&(r=s)}re.forEachChild(i,n)}return n(t),r}function cc(t,e){let r=dp(t,"utf-8"),n=re.createSourceFile(t,r,re.ScriptTarget.Latest,!0,re.ScriptKind.TSX);return Qi(n,e)}function gp(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 Zi(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 to(t){if(A.isIdentifier(t))return[t.text];if(A.isPropertyAccessExpression(t)){let e=to(t.expression);return e?[...e,t.name.text]:null}return null}function dc(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=to(t);if(!r)return null;if(r[0]in e.propBindings)return dc(e.propBindings[r[0]],r.slice(1));if(r[0]===e.vmName)return{kind:"binding",path:Zi(r.slice(1))};let n=e.scopes[e.scopes.length-1];return n&&r[0]===n?{kind:"binding",path:Zi(r.slice(1)),scope:n}:null}function yp(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=yp(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 wp(t){return A.isIdentifier(t)?t.text:A.isPropertyAccessExpression(t)&&A.isIdentifier(t.name)?t.name.text:null}function fc(t){return t.getText()}function eo(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=pc(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 vp(t,e){if(t.length===0)return null;let r=t[0];return r in e.propBindings?dc(e.propBindings[r],t.slice(1)):r===e.vmName?{kind:"binding",path:Zi(t.slice(1))}:null}function pc(t,e){if(A.isParenthesizedExpression(t))return pc(t.expression,e);if(A.isCallExpression(t)&&A.isPropertyAccessExpression(t.expression)){let n=to(t.expression.expression),i=t.expression.name.text;if(n&&i==="map"&&t.arguments.length>=1){let s=vp(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=ro(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)||fc(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 ro(t,e){return{kind:"fragment",children:eo(t.children,e)}}function $p(t,e,r){let n=r.viewImports.get(t);return n?cc(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=wp(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=fc(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=$p(n,i,e);return l||(e.errors.push(`Component "${n}" is not in the allowed registry`),null)}gp(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)?eo(t.children,f):[];return{kind:"map",source:l,item:a,body:{kind:"component",name:n,props:i,children:p}}}let c=A.isJsxElement(t)?eo(t.children,s):[];return{kind:"component",name:n,props:i,children:c}}function bp(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 mc(t,e,r,n={}){let i=new Set(et);for(let u of n.allowlistExtra??[])i.add(u);let s=uc(e),a=lc(s),c=A.createSourceFile(s,t,A.ScriptTarget.Latest,!0,A.ScriptKind.TSX),l={vmName:"vm",scopes:[],propBindings:{},errors:[],warnings:[],viewImports:Xi(c,a),allowedComponents:i},f=bp(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)?ro(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 _p(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)?ro(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 hc(t,e,r,n={}){let i=new Set(et);for(let u of n.allowlistExtra??[])i.add(u);let s=uc(e),a=lc(s),c=A.createSourceFile(s,t,A.ScriptTarget.Latest,!0,A.ScriptKind.TSX),l=Qi(c,r),f={vmName:l?.paramName??"__noop",scopes:[],propBindings:{},errors:[],warnings:[],viewImports:Xi(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=_p(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 no(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 gc(t){return`${t.sourcePath}:${t.name}`}ct();function io(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 Ep(t,e,r){let n=await yc(t,"utf-8"),i=hc(n,t,e,{allowlistExtra:r.allowlistExtra});if(i.errors.length>0)throw new Error(`Compile errors in ${t} (${e}):
136
+ ${i.errors.map(s=>` - ${s}`).join(`
137
+ `)}`);if(r.extensionRegistry){let s=io(i.root,r.extensionRegistry);if(s.errors.length>0)throw new Error(`Extension validation errors in ${t} (${e}):
138
+ ${s.errors.map(a=>` - ${a}`).join(`
139
+ `)}`);i.warnings.push(...s.warnings)}for(let s of i.warnings)console.warn(`Warning in ${t} (${e}): ${s}`);return{version:1,source:wc(process.cwd(),vc(t)),viewModel:i.propsType??"Record<string, unknown>",exportName:i.exportName,root:i.root,isPartial:!0,propsType:i.propsType}}async function Sp(t,e){let r=new Map,n=no(t);for(;n.length>0;){let i=n.shift(),s=gc(i);if(r.has(s))continue;let a=await Ep(i.sourcePath,i.name,e);r.set(s,a),n.push(...no(a.root))}return[...r.values()]}async function $c(t,e={}){let r=await yc(t.sourcePath,"utf-8"),n=t.exportName??xp(t.sourcePath,".view.tsx"),i=mc(r,t.sourcePath,n,{allowlistExtra:e.allowlistExtra});if(i.errors.length>0)throw new Error(`Compile errors in ${t.sourcePath}:
140
+ ${i.errors.map(c=>` - ${c}`).join(`
141
+ `)}`);if(e.extensionRegistry){let c=io(i.root,e.extensionRegistry);if(c.errors.length>0)throw new Error(`Extension validation errors in ${t.sourcePath}:
142
+ ${c.errors.map(l=>` - ${l}`).join(`
143
+ `)}`);i.warnings.push(...c.warnings)}for(let c of i.warnings)console.warn(`Warning in ${t.sourcePath}: ${c}`);let s={version:1,source:wc(process.cwd(),vc(t.sourcePath)),viewModel:i.viewModel,exportName:i.exportName,root:i.root},a=await Sp(s.root,e);return{screen:s,partials:a}}bt();Wi();ct();function Pp(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))Pp(a)&&(Ja(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 bc(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:
144
+ ${n.map(i=>` - ${i}`).join(`
145
+ `)}`)}var xd=wf(_d(),1);Ut();br();import{readFile as Ed}from"node:fs/promises";import{resolve as Sd}from"node:path";var u$=xd.default,d$=Sd(Ze(),"spec/ui-dsl-extensions.meta.json"),pi;async function f$(){if(pi)return pi;let t=JSON.parse(await Ed(d$,"utf-8"));return pi=new u$({allErrors:!0,strict:!1}).compile(t),pi}async function Pd(t){if(!t)return{extensions:{}};let e=Sd(t),r=await Ed(e,"utf-8"),n=Oe.load(r),i=await f$();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 Qd(t,e,r){return(await Promise.resolve().then(()=>(Xd(),Gd))).renderReactPreviewBundle(t,e,r)}var ma="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 U$(t){if(!t.extensions)return{allowlistExtra:t.allowlistExtra??[]};let e=await Pd(t.extensions),r=[...new Set([...t.allowlistExtra??[],...Object.keys(e.extensions)])];return{extensionRegistry:e,allowlistExtra:r}}async function Zd(t,e){let r=await at(t),i=(await Ma(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 U$(r),c=Ie(t),{screen:l,partials:f}=await $c({sourcePath:z$(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 bc(h,a),Ui(h,m),Qd(l,f,{runtimeImportFrom:Fe.dispatch,extensionsImportFrom:Fe.extensions,contractsImportFrom:Fe.contracts,allowlistExtra:a,previewImports:Fe})}bt();sf();import{resolve as af}from"node:path";var lf="\0";function cf(t){return`${lf}${t}`}function uf(t){let e="";async function r(){let s=await at(t.configPath);e=await of(t.configPath,s)}function n(s){return s.startsWith(e)&&s.endsWith(".mock.yaml")}function i(s,a){let c=s.moduleGraph.getModuleById(cf(`${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)?cf(s):null},async load(s){let a=nf(s.slice(lf.length));if(!a)return null;try{let c=await at(t.configPath);return await rf(t.configPath,c,a)}catch(c){let l=c instanceof Error?c.message:String(c);this.error(`Preview mock failed for ${a}:
146
+ ${l}`)}},configureServer(s){r(),s.watcher.on("change",a=>{if(!n(a))return;let c=af(a).slice(e.length+1).replace(/\.mock\.yaml$/,"");i(s,c)})},handleHotUpdate({file:s,server:a}){if(!n(s))return;let c=af(s).slice(e.length+1).replace(/\.mock\.yaml$/,"");return i(a,c)}}}var Q$="\0";function wi(t){return`${Q$}${t}`}function Z$(t){let e=wi(ma);if(!t.startsWith(e))return null;let r=t.slice(e.length);return r.endsWith(".tsx")?r.slice(0,-4):r}function eb(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=yt(_n(),"theme.css")}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(ma)?wi(u):null},async load(u){if(u===wi(gi)){let h=await at(t.configPath);return await Yi(h,t.configPath)}let m=Z$(u);if(m)try{let h=await Zd(t.configPath,m),{code:y}=await X$(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}:
147
+ ${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 tb(t){let e=Ze(),r=yt(e,"renderers/react/runtime");return[{find:Fe.dispatch,replacement:yt(r,"dispatch.ts")},{find:Fe.style,replacement:yt(r,"style.ts")},{find:Fe.types,replacement:yt(r,"types.ts")},{find:Fe.styleHelpers,replacement:yt(e,"dist/preview-style-helpers.js")},{find:Fe.contracts,replacement:yt(t,"contracts/view-models.ts")},{find:Fe.extensions,replacement:yt(t,"src/components/extensions.tsx")}]}function rb(t,e){return[t,e,Ze()]}export{rb as previewFsAllowPaths,tb as previewRuntimeAliases,uf as viewContractsPreviewMockPlugin,eb as viewContractsPreviewPlugin};
148
+ /*! Bundled license information:
149
+
150
+ js-yaml/dist/js-yaml.mjs:
151
+ (*! js-yaml 4.2.0 https://github.com/nodeca/js-yaml @license MIT *)
152
+ */
153
+ //# sourceMappingURL=preview.mjs.map