@qaecy/cue-ui 0.0.66 → 0.0.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/3630.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[3630],{43630(A,b,i){i.r(b),i.d(b,{LasStreamingSource:()=>S});var p=i(10467),c=i(80070),y=i(18209);class S{bytes;header=null;cursor=0;rgbScale=1;downsample;label;originOffset;constructor(r,t={}){this.bytes=new y.j(r),this.downsample=t.downsample??{stride:1},this.label=t.label,this.originOffset=t.originOffset}open(r){var t=this;return(0,p.A)(function*(){if(t.header)return t.toInfo(t.header);s(r);const e=yield t.bytes.read(0,1024);s(r);const o=(0,c.jb)(e);let f=1;if(o.hasRgb){const n=Math.min(4096*o.pointRecordLength,Math.max(0,t.bytes.size-o.pointDataOffset));if(n>0){const d=yield t.bytes.read(o.pointDataOffset,o.pointDataOffset+n);s(r);const h=(0,c.V_)(d,o);f=h>0&&h<=255?257:1}}return t.header=o,t.rgbScale=f,t.cursor=0,t.toInfo(o)})()}next(r,t){var e=this;return(0,p.A)(function*(){if(s(t),!Number.isFinite(r)||r<=0)throw new Error(`LasStreamingSource: maxPoints must be > 0 (got ${r})`);if(!e.header)throw new Error("LasStreamingSource: open() must be awaited before next()");const o=Math.max(1,0|e.downsample.stride);if(e.cursor>=e.header.pointCount)return null;if(1===o){const a=Math.min(r,e.header.pointCount-e.cursor),R=e.header.pointDataOffset+e.cursor*e.header.pointRecordLength,M=R+a*e.header.pointRecordLength,D=yield e.bytes.read(R,M);s(t);const B=(0,c.wu)(D,e.header,a,e.header.pointRecordLength,e.rgbScale,e.originOffset);return e.cursor+=a,B}const n=Math.min(r*o,e.header.pointCount-e.cursor),d=Math.ceil(n/o),h=e.header.pointDataOffset+e.cursor*e.header.pointRecordLength,w=h+n*e.header.pointRecordLength,l=yield e.bytes.read(h,w);s(t);const g=n*e.header.pointRecordLength;if(l.length<g)throw new Error(`LAS: decode expects ${g} bytes for ${n} strided source records, got ${l.length} \u2014 file truncated?`);const m=new Uint8Array(d*e.header.pointRecordLength);let O=0;for(let u=0;u<d;u++){const a=u*o*e.header.pointRecordLength;m.set(l.subarray(a,a+e.header.pointRecordLength),O),O+=e.header.pointRecordLength}const C=(0,c.wu)(m,e.header,d,e.header.pointRecordLength,e.rgbScale,e.originOffset);return e.cursor+=n,C})()}close(){this.header=null,this.cursor=0}toInfo(r){const t=Math.max(1,0|this.downsample.stride);return{totalPointCount:1===t?r.pointCount:Math.ceil(r.pointCount/t),bbox:(0,c.iX)(r.bbox,this.originOffset),hasColor:r.hasRgb,hasClassification:!0,hasIntensity:!0,label:this.label}}}function s(_){if(_?.aborted)throw new DOMException("Aborted","AbortError")}}}]);
package/3632.js ADDED
@@ -0,0 +1,7 @@
1
+ "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[3632],{91927(Y,r){function l(H,G){return{validate:H,compare:G}}Object.defineProperty(r,"__esModule",{value:!0}),r.formatNames=r.fastFormats=r.fullFormats=void 0,r.fullFormats={date:l(b,I),time:l(v(!0),c),"date-time":l(y(!0),$),"iso-time":l(v(),m),"iso-date-time":l(y(),w),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function p(H){return O.test(H)&&j.test(H)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function L(H){if(N.test(H))return!1;try{return new RegExp(H),!0}catch{return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function S(H){return o.lastIndex=0,o.test(H)},int32:{type:"number",validate:function k(H){return Number.isInteger(H)&&H<=2147483647&&H>=-2147483648}},int64:{type:"number",validate:function i(H){return Number.isInteger(H)}},float:{type:"number",validate:g},double:{type:"number",validate:g},password:!0,binary:!0},r.fastFormats={...r.fullFormats,date:l(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,I),time:l(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,c),"date-time":l(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,$),"iso-time":l(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,m),"iso-date-time":l(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,w),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},r.formatNames=Object.keys(r.fullFormats);const _=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,E=[0,31,28,31,30,31,30,31,31,30,31,30,31];function b(H){const G=_.exec(H);if(!G)return!1;const X=+G[2],x=+G[3];return X>=1&&X<=12&&x>=1&&x<=(2===X&&function t(H){return H%4==0&&(H%100!=0||H%400==0)}(+G[1])?29:E[X])}function I(H,G){if(H&&G)return H>G?1:H<G?-1:0}const h=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function v(H){return function(Q){const X=h.exec(Q);if(!X)return!1;const x=+X[1],ue=+X[2],fe=+X[3],Te="-"===X[5]?-1:1,le=+(X[6]||0),Oe=+(X[7]||0);if(le>23||Oe>59||H&&!X[4])return!1;if(x<=23&&ue<=59&&fe<60)return!0;const J=ue-Oe*Te,M=x-le*Te-(J<0?1:0);return(23===M||-1===M)&&(59===J||-1===J)&&fe<61}}function c(H,G){if(!H||!G)return;const Q=new Date("2020-01-01T"+H).valueOf(),X=new Date("2020-01-01T"+G).valueOf();return Q&&X?Q-X:void 0}function m(H,G){if(!H||!G)return;const Q=h.exec(H),X=h.exec(G);return Q&&X?(H=Q[1]+Q[2]+Q[3])>(G=X[1]+X[2]+X[3])?1:H<G?-1:0:void 0}const T=/t|\s/i;function y(H){const G=v(H);return function(X){const x=X.split(T);return 2===x.length&&b(x[0])&&G(x[1])}}function $(H,G){if(!H||!G)return;const Q=new Date(H).valueOf(),X=new Date(G).valueOf();return Q&&X?Q-X:void 0}function w(H,G){if(!H||!G)return;const[Q,X]=H.split(T),[x,ue]=G.split(T),fe=I(Q,x);return void 0!==fe?fe||c(X,ue):void 0}const O=/\/|:/,j=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,o=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function g(){return!0}const N=/[^\\]\\Z/},71011(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(91927),_=l(62040),E=l(22984),b=new E.Name("fullFormats"),I=new E.Name("fastFormats"),h=(c,m={keywords:!0})=>{if(Array.isArray(m))return v(c,m,t.fullFormats,b),c;const[T,y]="fast"===m.mode?[t.fastFormats,I]:[t.fullFormats,b];return v(c,m.formats||t.formatNames,T,y),m.keywords&&(0,_.default)(c),c};function v(c,m,T,y){var $,w;null!==($=(w=c.opts.code).formats)&&void 0!==$||(w.formats=E._`require("ajv-formats/dist/formats").${y}`);for(const O of m)c.addFormat(O,T[O])}h.get=(c,m="full")=>{const y=("fast"===m?t.fastFormats:t.fullFormats)[c];if(!y)throw new Error(`Unknown format "${c}"`);return y},Y.exports=r=h,Object.defineProperty(r,"__esModule",{value:!0}),r.default=h},62040(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0}),r.formatLimitDefinition=void 0;const t=l(51435),_=l(22984),E=_.operators,b={formatMaximum:{okStr:"<=",ok:E.LTE,fail:E.GT},formatMinimum:{okStr:">=",ok:E.GTE,fail:E.LT},formatExclusiveMaximum:{okStr:"<",ok:E.LT,fail:E.GTE},formatExclusiveMinimum:{okStr:">",ok:E.GT,fail:E.LTE}},I={message:({keyword:v,schemaCode:c})=>_.str`should be ${b[v].okStr} ${c}`,params:({keyword:v,schemaCode:c})=>_._`{comparison: ${b[v].okStr}, limit: ${c}}`};r.formatLimitDefinition={keyword:Object.keys(b),type:"string",schemaType:"string",$data:!0,error:I,code(v){const{gen:c,data:m,schemaCode:T,keyword:y,it:$}=v,{opts:w,self:O}=$;if(!w.validateFormats)return;const j=new t.KeywordCxt($,O.RULES.all.format.definition,"format");function S(n){return _._`${n}.compare(${m}, ${T}) ${b[y].fail} 0`}j.$data?function p(){const n=c.scopeValue("formats",{ref:O.formats,code:w.code.formats}),d=c.const("fmt",_._`${n}[${j.schemaCode}]`);v.fail$data((0,_.or)(_._`typeof ${d} != "object"`,_._`${d} instanceof RegExp`,_._`typeof ${d}.compare != "function"`,S(d)))}():function o(){const n=j.schema,d=O.formats[n];if(!d||!0===d)return;if("object"!=typeof d||d instanceof RegExp||"function"!=typeof d.compare)throw new Error(`"${y}": format "${n}" does not define "compare" function`);const k=c.scopeValue("formats",{key:n,ref:d,code:w.code.formats?_._`${w.code.formats}${(0,_.getProperty)(n)}`:void 0});v.fail$data(S(k))}()},dependencies:["format"]},r.default=v=>(v.addKeyword(r.formatLimitDefinition),v)},51435(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0}),r.MissingRefError=r.ValidationError=r.CodeGen=r.Name=r.nil=r.stringify=r.str=r._=r.KeywordCxt=r.Ajv=void 0;const t=l(4017),_=l(94505),E=l(95962),b=l(7595),I=["/properties"],h="http://json-schema.org/draft-07/schema";class v extends t.default{_addVocabularies(){super._addVocabularies(),_.default.forEach(w=>this.addVocabulary(w)),this.opts.discriminator&&this.addKeyword(E.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const w=this.opts.$data?this.$dataMetaSchema(b,I):b;this.addMetaSchema(w,h,!1),this.refs["http://json-schema.org/schema"]=h}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(h)?h:void 0)}}r.Ajv=v,Y.exports=r=v,Y.exports.Ajv=v,Object.defineProperty(r,"__esModule",{value:!0}),r.default=v;var c=l(99141);Object.defineProperty(r,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var m=l(22984);Object.defineProperty(r,"_",{enumerable:!0,get:function(){return m._}}),Object.defineProperty(r,"str",{enumerable:!0,get:function(){return m.str}}),Object.defineProperty(r,"stringify",{enumerable:!0,get:function(){return m.stringify}}),Object.defineProperty(r,"nil",{enumerable:!0,get:function(){return m.nil}}),Object.defineProperty(r,"Name",{enumerable:!0,get:function(){return m.Name}}),Object.defineProperty(r,"CodeGen",{enumerable:!0,get:function(){return m.CodeGen}});var T=l(46545);Object.defineProperty(r,"ValidationError",{enumerable:!0,get:function(){return T.default}});var y=l(56798);Object.defineProperty(r,"MissingRefError",{enumerable:!0,get:function(){return y.default}})},80123(Y,r){Object.defineProperty(r,"__esModule",{value:!0}),r.regexpCode=r.getEsmExportName=r.getProperty=r.safeStringify=r.stringify=r.strConcat=r.addCodeArg=r.str=r._=r.nil=r._Code=r.Name=r.IDENTIFIER=r._CodeOrName=void 0;class l{}r._CodeOrName=l,r.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class t extends l{constructor(o){if(super(),!r.IDENTIFIER.test(o))throw new Error("CodeGen: name must be a valid identifier");this.str=o}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}r.Name=t;class _ extends l{constructor(o){super(),this._items="string"==typeof o?[o]:o}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const o=this._items[0];return""===o||'""'===o}get str(){var o;return null!==(o=this._str)&&void 0!==o?o:this._str=this._items.reduce((S,n)=>`${S}${n}`,"")}get names(){var o;return null!==(o=this._names)&&void 0!==o?o:this._names=this._items.reduce((S,n)=>(n instanceof t&&(S[n.str]=(S[n.str]||0)+1),S),{})}}function E(p,...o){const S=[p[0]];let n=0;for(;n<o.length;)h(S,o[n]),S.push(p[++n]);return new _(S)}r._Code=_,r.nil=new _(""),r._=E;const b=new _("+");function I(p,...o){const S=[$(p[0])];let n=0;for(;n<o.length;)S.push(b),h(S,o[n]),S.push(b,$(p[++n]));return function v(p){let o=1;for(;o<p.length-1;){if(p[o]===b){const S=c(p[o-1],p[o+1]);if(void 0!==S){p.splice(o-1,3,S);continue}p[o++]="+"}o++}}(S),new _(S)}function h(p,o){o instanceof _?p.push(...o._items):p.push(o instanceof t?o:function T(p){return"number"==typeof p||"boolean"==typeof p||null===p?p:$(Array.isArray(p)?p.join(","):p)}(o))}function c(p,o){return'""'===o?p:'""'===p?o:"string"==typeof p?o instanceof t||'"'!==p[p.length-1]?void 0:"string"!=typeof o?`${p.slice(0,-1)}${o}"`:'"'===o[0]?p.slice(0,-1)+o.slice(1):void 0:"string"!=typeof o||'"'!==o[0]||p instanceof t?void 0:`"${p}${o.slice(1)}`}function $(p){return JSON.stringify(p).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}r.str=I,r.addCodeArg=h,r.strConcat=function m(p,o){return o.emptyStr()?p:p.emptyStr()?o:I`${p}${o}`},r.stringify=function y(p){return new _($(p))},r.safeStringify=$,r.getProperty=function w(p){return"string"==typeof p&&r.IDENTIFIER.test(p)?new _(`.${p}`):E`[${p}]`},r.getEsmExportName=function O(p){if("string"==typeof p&&r.IDENTIFIER.test(p))return new _(`${p}`);throw new Error(`CodeGen: invalid export name: ${p}, use explicit $id name mapping`)},r.regexpCode=function j(p){return new _(p.toString())}},22984(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0}),r.or=r.and=r.not=r.CodeGen=r.operators=r.varKinds=r.ValueScopeName=r.ValueScope=r.Scope=r.Name=r.regexpCode=r.stringify=r.getProperty=r.nil=r.strConcat=r.str=r._=void 0;const t=l(80123),_=l(36032);var E=l(80123);Object.defineProperty(r,"_",{enumerable:!0,get:function(){return E._}}),Object.defineProperty(r,"str",{enumerable:!0,get:function(){return E.str}}),Object.defineProperty(r,"strConcat",{enumerable:!0,get:function(){return E.strConcat}}),Object.defineProperty(r,"nil",{enumerable:!0,get:function(){return E.nil}}),Object.defineProperty(r,"getProperty",{enumerable:!0,get:function(){return E.getProperty}}),Object.defineProperty(r,"stringify",{enumerable:!0,get:function(){return E.stringify}}),Object.defineProperty(r,"regexpCode",{enumerable:!0,get:function(){return E.regexpCode}}),Object.defineProperty(r,"Name",{enumerable:!0,get:function(){return E.Name}});var b=l(36032);Object.defineProperty(r,"Scope",{enumerable:!0,get:function(){return b.Scope}}),Object.defineProperty(r,"ValueScope",{enumerable:!0,get:function(){return b.ValueScope}}),Object.defineProperty(r,"ValueScopeName",{enumerable:!0,get:function(){return b.ValueScopeName}}),Object.defineProperty(r,"varKinds",{enumerable:!0,get:function(){return b.varKinds}}),r.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class I{optimizeNodes(){return this}optimizeNames(f,P){return this}}class h extends I{constructor(f,P,F){super(),this.varKind=f,this.name=P,this.rhs=F}render({es5:f,_n:P}){return`${f?_.varKinds.var:this.varKind} ${this.name}${void 0===this.rhs?"":` = ${this.rhs}`};`+P}optimizeNames(f,P){if(f[this.name.str])return this.rhs&&(this.rhs=x(this.rhs,f,P)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class v extends I{constructor(f,P,F){super(),this.lhs=f,this.rhs=P,this.sideEffects=F}render({_n:f}){return`${this.lhs} = ${this.rhs};`+f}optimizeNames(f,P){if(!(this.lhs instanceof t.Name)||f[this.lhs.str]||this.sideEffects)return this.rhs=x(this.rhs,f,P),this}get names(){return X(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}}class c extends v{constructor(f,P,F,B){super(f,F,B),this.op=P}render({_n:f}){return`${this.lhs} ${this.op}= ${this.rhs};`+f}}class m extends I{constructor(f){super(),this.label=f,this.names={}}render({_n:f}){return`${this.label}:`+f}}class T extends I{constructor(f){super(),this.label=f,this.names={}}render({_n:f}){return`break${this.label?` ${this.label}`:""};`+f}}class y extends I{constructor(f){super(),this.error=f}render({_n:f}){return`throw ${this.error};`+f}get names(){return this.error.names}}class $ extends I{constructor(f){super(),this.code=f}render({_n:f}){return`${this.code};`+f}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(f,P){return this.code=x(this.code,f,P),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class w extends I{constructor(f=[]){super(),this.nodes=f}render(f){return this.nodes.reduce((P,F)=>P+F.render(f),"")}optimizeNodes(){const{nodes:f}=this;let P=f.length;for(;P--;){const F=f[P].optimizeNodes();Array.isArray(F)?f.splice(P,1,...F):F?f[P]=F:f.splice(P,1)}return f.length>0?this:void 0}optimizeNames(f,P){const{nodes:F}=this;let B=F.length;for(;B--;){const te=F[B];te.optimizeNames(f,P)||(ue(f,te.names),F.splice(B,1))}return F.length>0?this:void 0}get names(){return this.nodes.reduce((f,P)=>Q(f,P.names),{})}}class O extends w{render(f){return"{"+f._n+super.render(f)+"}"+f._n}}class j extends w{}let p=(()=>{class A extends O{}return A.kind="else",A})(),o=(()=>{class A extends O{constructor(P,F){super(F),this.condition=P}render(P){let F=`if(${this.condition})`+super.render(P);return this.else&&(F+="else "+this.else.render(P)),F}optimizeNodes(){super.optimizeNodes();const P=this.condition;if(!0===P)return this.nodes;let F=this.else;if(F){const B=F.optimizeNodes();F=this.else=Array.isArray(B)?new p(B):B}return F?!1===P?F instanceof A?F:F.nodes:this.nodes.length?this:new A(fe(P),F instanceof A?[F]:F.nodes):!1!==P&&this.nodes.length?this:void 0}optimizeNames(P,F){var B;if(this.else=null===(B=this.else)||void 0===B?void 0:B.optimizeNames(P,F),super.optimizeNames(P,F)||this.else)return this.condition=x(this.condition,P,F),this}get names(){const P=super.names;return X(P,this.condition),this.else&&Q(P,this.else.names),P}}return A.kind="if",A})(),S=(()=>{class A extends O{}return A.kind="for",A})();class n extends S{constructor(f){super(),this.iteration=f}render(f){return`for(${this.iteration})`+super.render(f)}optimizeNames(f,P){if(super.optimizeNames(f,P))return this.iteration=x(this.iteration,f,P),this}get names(){return Q(super.names,this.iteration.names)}}class d extends S{constructor(f,P,F,B){super(),this.varKind=f,this.name=P,this.from=F,this.to=B}render(f){const P=f.es5?_.varKinds.var:this.varKind,{name:F,from:B,to:te}=this;return`for(${P} ${F}=${B}; ${F}<${te}; ${F}++)`+super.render(f)}get names(){const f=X(super.names,this.from);return X(f,this.to)}}class k extends S{constructor(f,P,F,B){super(),this.loop=f,this.varKind=P,this.name=F,this.iterable=B}render(f){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(f)}optimizeNames(f,P){if(super.optimizeNames(f,P))return this.iterable=x(this.iterable,f,P),this}get names(){return Q(super.names,this.iterable.names)}}let i=(()=>{class A extends O{constructor(P,F,B){super(),this.name=P,this.args=F,this.async=B}render(P){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(P)}}return A.kind="func",A})(),g=(()=>{class A extends w{render(P){return"return "+super.render(P)}}return A.kind="return",A})();class N extends O{render(f){let P="try"+super.render(f);return this.catch&&(P+=this.catch.render(f)),this.finally&&(P+=this.finally.render(f)),P}optimizeNodes(){var f,P;return super.optimizeNodes(),null===(f=this.catch)||void 0===f||f.optimizeNodes(),null===(P=this.finally)||void 0===P||P.optimizeNodes(),this}optimizeNames(f,P){var F,B;return super.optimizeNames(f,P),null===(F=this.catch)||void 0===F||F.optimizeNames(f,P),null===(B=this.finally)||void 0===B||B.optimizeNames(f,P),this}get names(){const f=super.names;return this.catch&&Q(f,this.catch.names),this.finally&&Q(f,this.finally.names),f}}let L=(()=>{class A extends O{constructor(P){super(),this.error=P}render(P){return`catch(${this.error})`+super.render(P)}}return A.kind="catch",A})(),H=(()=>{class A extends O{render(P){return"finally"+super.render(P)}}return A.kind="finally",A})();function Q(A,f){for(const P in f)A[P]=(A[P]||0)+(f[P]||0);return A}function X(A,f){return f instanceof t._CodeOrName?Q(A,f.names):A}function x(A,f,P){return A instanceof t.Name?F(A):function B(te){return te instanceof t._Code&&te._items.some(ne=>ne instanceof t.Name&&1===f[ne.str]&&void 0!==P[ne.str])}(A)?new t._Code(A._items.reduce((te,ne)=>(ne instanceof t.Name&&(ne=F(ne)),ne instanceof t._Code?te.push(...ne._items):te.push(ne),te),[])):A;function F(te){const ne=P[te.str];return void 0===ne||1!==f[te.str]?te:(delete f[te.str],ne)}}function ue(A,f){for(const P in f)A[P]=(A[P]||0)-(f[P]||0)}function fe(A){return"boolean"==typeof A||"number"==typeof A||null===A?!A:t._`!${M(A)}`}r.CodeGen=class G{constructor(f,P={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...P,_n:P.lines?"\n":""},this._extScope=f,this._scope=new _.Scope({parent:f}),this._nodes=[new j]}toString(){return this._root.render(this.opts)}name(f){return this._scope.name(f)}scopeName(f){return this._extScope.name(f)}scopeValue(f,P){const F=this._extScope.value(f,P);return(this._values[F.prefix]||(this._values[F.prefix]=new Set)).add(F),F}getScopeValue(f,P){return this._extScope.getValue(f,P)}scopeRefs(f){return this._extScope.scopeRefs(f,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(f,P,F,B){const te=this._scope.toName(P);return void 0!==F&&B&&(this._constants[te.str]=F),this._leafNode(new h(f,te,F)),te}const(f,P,F){return this._def(_.varKinds.const,f,P,F)}let(f,P,F){return this._def(_.varKinds.let,f,P,F)}var(f,P,F){return this._def(_.varKinds.var,f,P,F)}assign(f,P,F){return this._leafNode(new v(f,P,F))}add(f,P){return this._leafNode(new c(f,r.operators.ADD,P))}code(f){return"function"==typeof f?f():f!==t.nil&&this._leafNode(new $(f)),this}object(...f){const P=["{"];for(const[F,B]of f)P.length>1&&P.push(","),P.push(F),(F!==B||this.opts.es5)&&(P.push(":"),(0,t.addCodeArg)(P,B));return P.push("}"),new t._Code(P)}if(f,P,F){if(this._blockNode(new o(f)),P&&F)this.code(P).else().code(F).endIf();else if(P)this.code(P).endIf();else if(F)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(f){return this._elseNode(new o(f))}else(){return this._elseNode(new p)}endIf(){return this._endBlockNode(o,p)}_for(f,P){return this._blockNode(f),P&&this.code(P).endFor(),this}for(f,P){return this._for(new n(f),P)}forRange(f,P,F,B,te=(this.opts.es5?_.varKinds.var:_.varKinds.let)){const ne=this._scope.toName(f);return this._for(new d(te,ne,P,F),()=>B(ne))}forOf(f,P,F,B=_.varKinds.const){const te=this._scope.toName(f);if(this.opts.es5){const ne=P instanceof t.Name?P:this.var("_arr",P);return this.forRange("_i",0,t._`${ne}.length`,ve=>{this.var(te,t._`${ne}[${ve}]`),F(te)})}return this._for(new k("of",B,te,P),()=>F(te))}forIn(f,P,F,B=(this.opts.es5?_.varKinds.var:_.varKinds.const)){if(this.opts.ownProperties)return this.forOf(f,t._`Object.keys(${P})`,F);const te=this._scope.toName(f);return this._for(new k("in",B,te,P),()=>F(te))}endFor(){return this._endBlockNode(S)}label(f){return this._leafNode(new m(f))}break(f){return this._leafNode(new T(f))}return(f){const P=new g;if(this._blockNode(P),this.code(f),1!==P.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(g)}try(f,P,F){if(!P&&!F)throw new Error('CodeGen: "try" without "catch" and "finally"');const B=new N;if(this._blockNode(B),this.code(f),P){const te=this.name("e");this._currNode=B.catch=new L(te),P(te)}return F&&(this._currNode=B.finally=new H,this.code(F)),this._endBlockNode(L,H)}throw(f){return this._leafNode(new y(f))}block(f,P){return this._blockStarts.push(this._nodes.length),f&&this.code(f).endBlock(P),this}endBlock(f){const P=this._blockStarts.pop();if(void 0===P)throw new Error("CodeGen: not in self-balancing block");const F=this._nodes.length-P;if(F<0||void 0!==f&&F!==f)throw new Error(`CodeGen: wrong number of nodes: ${F} vs ${f} expected`);return this._nodes.length=P,this}func(f,P=t.nil,F,B){return this._blockNode(new i(f,P,F)),B&&this.code(B).endFunc(),this}endFunc(){return this._endBlockNode(i)}optimize(f=1){for(;f-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(f){return this._currNode.nodes.push(f),this}_blockNode(f){this._currNode.nodes.push(f),this._nodes.push(f)}_endBlockNode(f,P){const F=this._currNode;if(F instanceof f||P&&F instanceof P)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${P?`${f.kind}/${P.kind}`:f.kind}"`)}_elseNode(f){const P=this._currNode;if(!(P instanceof o))throw new Error('CodeGen: "else" without "if"');return this._currNode=P.else=f,this}get _root(){return this._nodes[0]}get _currNode(){const f=this._nodes;return f[f.length-1]}set _currNode(f){const P=this._nodes;P[P.length-1]=f}},r.not=fe;const ke=J(r.operators.AND);r.and=function Te(...A){return A.reduce(ke)};const le=J(r.operators.OR);function J(A){return(f,P)=>f===t.nil?P:P===t.nil?f:t._`${M(f)} ${A} ${M(P)}`}function M(A){return A instanceof t.Name?A:t._`(${A})`}r.or=function Oe(...A){return A.reduce(le)}},36032(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0}),r.ValueScope=r.ValueScopeName=r.Scope=r.varKinds=r.UsedValueState=void 0;const t=l(80123);class _ extends Error{constructor(m){super(`CodeGen: "code" for ${m} not defined`),this.value=m.value}}var E=function(c){return c[c.Started=0]="Started",c[c.Completed=1]="Completed",c}(E||(r.UsedValueState=E={}));r.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class b{constructor({prefixes:m,parent:T}={}){this._names={},this._prefixes=m,this._parent=T}toName(m){return m instanceof t.Name?m:this.name(m)}name(m){return new t.Name(this._newName(m))}_newName(m){return`${m}${(this._names[m]||this._nameGroup(m)).index++}`}_nameGroup(m){var T,y;if(null!==(y=null===(T=this._parent)||void 0===T?void 0:T._prefixes)&&void 0!==y&&y.has(m)||this._prefixes&&!this._prefixes.has(m))throw new Error(`CodeGen: prefix "${m}" is not allowed in this scope`);return this._names[m]={prefix:m,index:0}}}r.Scope=b;class I extends t.Name{constructor(m,T){super(T),this.prefix=m}setValue(m,{property:T,itemIndex:y}){this.value=m,this.scopePath=t._`.${new t.Name(T)}[${y}]`}}r.ValueScopeName=I;const h=t._`\n`;r.ValueScope=class v extends b{constructor(m){super(m),this._values={},this._scope=m.scope,this.opts={...m,_n:m.lines?h:t.nil}}get(){return this._scope}name(m){return new I(m,this._newName(m))}value(m,T){var y;if(void 0===T.ref)throw new Error("CodeGen: ref must be passed in value");const $=this.toName(m),{prefix:w}=$,O=null!==(y=T.key)&&void 0!==y?y:T.ref;let j=this._values[w];if(j){const S=j.get(O);if(S)return S}else j=this._values[w]=new Map;j.set(O,$);const p=this._scope[w]||(this._scope[w]=[]),o=p.length;return p[o]=T.ref,$.setValue(T,{property:w,itemIndex:o}),$}getValue(m,T){const y=this._values[m];if(y)return y.get(T)}scopeRefs(m,T=this._values){return this._reduceValues(T,y=>{if(void 0===y.scopePath)throw new Error(`CodeGen: name "${y}" has no value`);return t._`${m}${y.scopePath}`})}scopeCode(m=this._values,T,y){return this._reduceValues(m,$=>{if(void 0===$.value)throw new Error(`CodeGen: name "${$}" has no value`);return $.value.code},T,y)}_reduceValues(m,T,y={},$){let w=t.nil;for(const O in m){const j=m[O];if(!j)continue;const p=y[O]=y[O]||new Map;j.forEach(o=>{if(p.has(o))return;p.set(o,E.Started);let S=T(o);if(S)w=t._`${w}${this.opts.es5?r.varKinds.var:r.varKinds.const} ${o} = ${S};${this.opts._n}`;else{if(!(S=$?.(o)))throw new _(o);w=t._`${w}${S}${this.opts._n}`}p.set(o,E.Completed)})}return w}}},41751(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0}),r.extendErrors=r.resetErrorsCount=r.reportExtraError=r.reportError=r.keyword$DataError=r.keywordError=void 0;const t=l(22984),_=l(73612),E=l(80794);function c(p,o){const S=p.const("err",o);p.if(t._`${E.default.vErrors} === null`,()=>p.assign(E.default.vErrors,t._`[${S}]`),t._`${E.default.vErrors}.push(${S})`),p.code(t._`${E.default.errors}++`)}function m(p,o){const{gen:S,validateName:n,schemaEnv:d}=p;d.$async?S.throw(t._`new ${p.ValidationError}(${o})`):(S.assign(t._`${n}.errors`,o),S.return(!1))}r.keywordError={message:({keyword:p})=>t.str`must pass "${p}" keyword validation`},r.keyword$DataError={message:({keyword:p,schemaType:o})=>o?t.str`"${p}" keyword must be ${o} ($data)`:t.str`"${p}" keyword is invalid ($data)`},r.reportError=function b(p,o=r.keywordError,S,n){const{it:d}=p,{gen:k,compositeRule:i,allErrors:g}=d,N=y(p,o,S);n??(i||g)?c(k,N):m(d,t._`[${N}]`)},r.reportExtraError=function I(p,o=r.keywordError,S){const{it:n}=p,{gen:d,compositeRule:k,allErrors:i}=n;c(d,y(p,o,S)),k||i||m(n,E.default.vErrors)},r.resetErrorsCount=function h(p,o){p.assign(E.default.errors,o),p.if(t._`${E.default.vErrors} !== null`,()=>p.if(o,()=>p.assign(t._`${E.default.vErrors}.length`,o),()=>p.assign(E.default.vErrors,null)))},r.extendErrors=function v({gen:p,keyword:o,schemaValue:S,data:n,errsCount:d,it:k}){if(void 0===d)throw new Error("ajv implementation error");const i=p.name("err");p.forRange("i",d,E.default.errors,g=>{p.const(i,t._`${E.default.vErrors}[${g}]`),p.if(t._`${i}.instancePath === undefined`,()=>p.assign(t._`${i}.instancePath`,(0,t.strConcat)(E.default.instancePath,k.errorPath))),p.assign(t._`${i}.schemaPath`,t.str`${k.errSchemaPath}/${o}`),k.opts.verbose&&(p.assign(t._`${i}.schema`,S),p.assign(t._`${i}.data`,n))})};const T={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function y(p,o,S){const{createErrors:n}=p.it;return!1===n?t._`{}`:function $(p,o,S={}){const{gen:n,it:d}=p,k=[w(d,S),O(p,S)];return function j(p,{params:o,message:S},n){const{keyword:d,data:k,schemaValue:i,it:g}=p,{opts:N,propertyName:L,topSchemaRef:H,schemaPath:G}=g;n.push([T.keyword,d],[T.params,"function"==typeof o?o(p):o||t._`{}`]),N.messages&&n.push([T.message,"function"==typeof S?S(p):S]),N.verbose&&n.push([T.schema,i],[T.parentSchema,t._`${H}${G}`],[E.default.data,k]),L&&n.push([T.propertyName,L])}(p,o,k),n.object(...k)}(p,o,S)}function w({errorPath:p},{instancePath:o}){const S=o?t.str`${p}${(0,_.getErrorPath)(o,_.Type.Str)}`:p;return[E.default.instancePath,(0,t.strConcat)(E.default.instancePath,S)]}function O({keyword:p,it:{errSchemaPath:o}},{schemaPath:S,parentSchema:n}){let d=n?o:t.str`${o}/${p}`;return S&&(d=t.str`${d}${(0,_.getErrorPath)(S,_.Type.Str)}`),[T.schemaPath,d]}},95938(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0}),r.resolveSchema=r.getCompilingSchema=r.resolveRef=r.compileSchema=r.SchemaEnv=void 0;const t=l(22984),_=l(46545),E=l(80794),b=l(72014),I=l(73612),h=l(99141);class v{constructor(S){var n;let d;this.refs={},this.dynamicAnchors={},"object"==typeof S.schema&&(d=S.schema),this.schema=S.schema,this.schemaId=S.schemaId,this.root=S.root||this,this.baseId=null!==(n=S.baseId)&&void 0!==n?n:(0,b.normalizeId)(d?.[S.schemaId||"$id"]),this.schemaPath=S.schemaPath,this.localRefs=S.localRefs,this.meta=S.meta,this.$async=d?.$async,this.refs={}}}function c(o){const S=y.call(this,o);if(S)return S;const n=(0,b.getFullPath)(this.opts.uriResolver,o.root.baseId),{es5:d,lines:k}=this.opts.code,{ownProperties:i}=this.opts,g=new t.CodeGen(this.scope,{es5:d,lines:k,ownProperties:i});let N;o.$async&&(N=g.scopeValue("Error",{ref:_.default,code:t._`require("ajv/dist/runtime/validation_error").default`}));const L=g.scopeName("validate");o.validateName=L;const H={gen:g,allErrors:this.opts.allErrors,data:E.default.data,parentData:E.default.parentData,parentDataProperty:E.default.parentDataProperty,dataNames:[E.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:g.scopeValue("schema",!0===this.opts.code.source?{ref:o.schema,code:(0,t.stringify)(o.schema)}:{ref:o.schema}),validateName:L,ValidationError:N,schema:o.schema,schemaEnv:o,rootId:n,baseId:o.baseId||n,schemaPath:t.nil,errSchemaPath:o.schemaPath||(this.opts.jtd?"":"#"),errorPath:t._`""`,opts:this.opts,self:this};let G;try{this._compilations.add(o),(0,h.validateFunctionCode)(H),g.optimize(this.opts.code.optimize);const Q=g.toString();G=`${g.scopeRefs(E.default.scope)}return ${Q}`,this.opts.code.process&&(G=this.opts.code.process(G,o));const x=new Function(`${E.default.self}`,`${E.default.scope}`,G)(this,this.scope.get());if(this.scope.value(L,{ref:x}),x.errors=null,x.schema=o.schema,x.schemaEnv=o,o.$async&&(x.$async=!0),!0===this.opts.code.source&&(x.source={validateName:L,validateCode:Q,scopeValues:g._values}),this.opts.unevaluated){const{props:ue,items:fe}=H;x.evaluated={props:ue instanceof t.Name?void 0:ue,items:fe instanceof t.Name?void 0:fe,dynamicProps:ue instanceof t.Name,dynamicItems:fe instanceof t.Name},x.source&&(x.source.evaluated=(0,t.stringify)(x.evaluated))}return o.validate=x,o}catch(Q){throw delete o.validate,delete o.validateName,G&&this.logger.error("Error compiling schema, function code:",G),Q}finally{this._compilations.delete(o)}}function T(o){return(0,b.inlineRef)(o.schema,this.opts.inlineRefs)?o.schema:o.validate?o:c.call(this,o)}function y(o){for(const S of this._compilations)if($(S,o))return S}function $(o,S){return o.schema===S.schema&&o.root===S.root&&o.baseId===S.baseId}function w(o,S){let n;for(;"string"==typeof(n=this.refs[S]);)S=n;return n||this.schemas[S]||O.call(this,o,S)}function O(o,S){const n=this.opts.uriResolver.parse(S),d=(0,b._getFullPath)(this.opts.uriResolver,n);let k=(0,b.getFullPath)(this.opts.uriResolver,o.baseId,void 0);if(Object.keys(o.schema).length>0&&d===k)return p.call(this,n,o);const i=(0,b.normalizeId)(d),g=this.refs[i]||this.schemas[i];if("string"==typeof g){const N=O.call(this,o,g);return"object"!=typeof N?.schema?void 0:p.call(this,n,N)}if("object"==typeof g?.schema){if(g.validate||c.call(this,g),i===(0,b.normalizeId)(S)){const{schema:N}=g,{schemaId:L}=this.opts,H=N[L];return H&&(k=(0,b.resolveUrl)(this.opts.uriResolver,k,H)),new v({schema:N,schemaId:L,root:o,baseId:k})}return p.call(this,n,g)}}r.SchemaEnv=v,r.compileSchema=c,r.resolveRef=function m(o,S,n){var d;n=(0,b.resolveUrl)(this.opts.uriResolver,S,n);const k=o.refs[n];if(k)return k;let i=w.call(this,o,n);if(void 0===i){const g=null===(d=o.localRefs)||void 0===d?void 0:d[n],{schemaId:N}=this.opts;g&&(i=new v({schema:g,schemaId:N,root:o,baseId:S}))}return void 0!==i?o.refs[n]=T.call(this,i):void 0},r.getCompilingSchema=y,r.resolveSchema=O;const j=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function p(o,{baseId:S,schema:n,root:d}){var k;if("/"!==(null===(k=o.fragment)||void 0===k?void 0:k[0]))return;for(const N of o.fragment.slice(1).split("/")){if("boolean"==typeof n)return;const L=n[(0,I.unescapeFragment)(N)];if(void 0===L)return;const H="object"==typeof(n=L)&&n[this.opts.schemaId];!j.has(N)&&H&&(S=(0,b.resolveUrl)(this.opts.uriResolver,S,H))}let i;if("boolean"!=typeof n&&n.$ref&&!(0,I.schemaHasRulesButRef)(n,this.RULES)){const N=(0,b.resolveUrl)(this.opts.uriResolver,S,n.$ref);i=O.call(this,d,N)}const{schemaId:g}=this.opts;return i=i||new v({schema:n,schemaId:g,root:d,baseId:S}),i.schema!==i.root.schema?i:void 0}},80794(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(22984),_={data:new t.Name("data"),valCxt:new t.Name("valCxt"),instancePath:new t.Name("instancePath"),parentData:new t.Name("parentData"),parentDataProperty:new t.Name("parentDataProperty"),rootData:new t.Name("rootData"),dynamicAnchors:new t.Name("dynamicAnchors"),vErrors:new t.Name("vErrors"),errors:new t.Name("errors"),this:new t.Name("this"),self:new t.Name("self"),scope:new t.Name("scope"),json:new t.Name("json"),jsonPos:new t.Name("jsonPos"),jsonLen:new t.Name("jsonLen"),jsonPart:new t.Name("jsonPart")};r.default=_},56798(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(72014);class _ extends Error{constructor(b,I,h,v){super(v||`can't resolve reference ${h} from id ${I}`),this.missingRef=(0,t.resolveUrl)(b,I,h),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(b,this.missingRef))}}r.default=_},72014(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0}),r.getSchemaRefs=r.resolveUrl=r.normalizeId=r._getFullPath=r.getFullPath=r.inlineRef=void 0;const t=l(73612),_=l(68986),E=l(97915),b=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);r.inlineRef=function I(p,o=!0){return"boolean"==typeof p||(!0===o?!v(p):!!o&&c(p)<=o)};const h=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function v(p){for(const o in p){if(h.has(o))return!0;const S=p[o];if(Array.isArray(S)&&S.some(v)||"object"==typeof S&&v(S))return!0}return!1}function c(p){let o=0;for(const S in p){if("$ref"===S)return 1/0;if(o++,!b.has(S)&&("object"==typeof p[S]&&(0,t.eachItem)(p[S],n=>o+=c(n)),o===1/0))return 1/0}return o}function m(p,o="",S){!1!==S&&(o=$(o));const n=p.parse(o);return T(p,n)}function T(p,o){return p.serialize(o).split("#")[0]+"#"}r.getFullPath=m,r._getFullPath=T;const y=/#\/?$/;function $(p){return p?p.replace(y,""):""}r.normalizeId=$,r.resolveUrl=function w(p,o,S){return S=$(S),p.resolve(o,S)};const O=/^[a-z_][-a-z0-9._]*$/i;r.getSchemaRefs=function j(p,o){if("boolean"==typeof p)return{};const{schemaId:S,uriResolver:n}=this.opts,d=$(p[S]||o),k={"":d},i=m(n,d,!1),g={},N=new Set;return E(p,{allKeys:!0},(G,Q,X,x)=>{if(void 0===x)return;const ue=i+Q;let fe=k[x];function ke(le){if(le=$(fe?(0,this.opts.uriResolver.resolve)(fe,le):le),N.has(le))throw H(le);N.add(le);let J=this.refs[le];return"string"==typeof J&&(J=this.refs[J]),"object"==typeof J?L(G,J.schema,le):le!==$(ue)&&("#"===le[0]?(L(G,g[le],le),g[le]=G):this.refs[le]=ue),le}function Te(le){if("string"==typeof le){if(!O.test(le))throw new Error(`invalid anchor "${le}"`);ke.call(this,`#${le}`)}}"string"==typeof G[S]&&(fe=ke.call(this,G[S])),Te.call(this,G.$anchor),Te.call(this,G.$dynamicAnchor),k[Q]=fe}),g;function L(G,Q,X){if(void 0!==Q&&!_(G,Q))throw H(X)}function H(G){return new Error(`reference "${G}" resolves to more than one schema`)}}},98621(Y,r){Object.defineProperty(r,"__esModule",{value:!0}),r.getRules=r.isJSONType=void 0;const t=new Set(["string","number","integer","boolean","null","object","array"]);r.isJSONType=function _(b){return"string"==typeof b&&t.has(b)},r.getRules=function E(){const b={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...b,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},b.number,b.string,b.array,b.object],post:{rules:[]},all:{},keywords:{}}}},73612(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0}),r.checkStrictMode=r.getErrorPath=r.Type=r.useFunc=r.setEvaluated=r.evaluatedPropsToName=r.mergeEvaluated=r.eachItem=r.unescapeJsonPointer=r.escapeJsonPointer=r.escapeFragment=r.unescapeFragment=r.schemaRefOrVal=r.schemaHasRulesButRef=r.schemaHasRules=r.checkUnknownRules=r.alwaysValidSchema=r.toHash=void 0;const t=l(22984),_=l(80123);function I(i,g=i.schema){const{opts:N,self:L}=i;if(!N.strictSchema||"boolean"==typeof g)return;const H=L.RULES.keywords;for(const G in g)H[G]||k(i,`unknown keyword: "${G}"`)}function h(i,g){if("boolean"==typeof i)return!i;for(const N in i)if(g[N])return!0;return!1}function y(i){return"number"==typeof i?`${i}`:i.replace(/~/g,"~0").replace(/\//g,"~1")}function $(i){return i.replace(/~1/g,"/").replace(/~0/g,"~")}function O({mergeNames:i,mergeToName:g,mergeValues:N,resultToName:L}){return(H,G,Q,X)=>{const x=void 0===Q?G:Q instanceof t.Name?(G instanceof t.Name?i(H,G,Q):g(H,G,Q),Q):G instanceof t.Name?(g(H,Q,G),G):N(G,Q);return X!==t.Name||x instanceof t.Name?x:L(H,x)}}function j(i,g){if(!0===g)return i.var("props",!0);const N=i.var("props",t._`{}`);return void 0!==g&&p(i,N,g),N}function p(i,g,N){Object.keys(N).forEach(L=>i.assign(t._`${g}${(0,t.getProperty)(L)}`,!0))}r.toHash=function E(i){const g={};for(const N of i)g[N]=!0;return g},r.alwaysValidSchema=function b(i,g){return"boolean"==typeof g?g:0===Object.keys(g).length||(I(i,g),!h(g,i.self.RULES.all))},r.checkUnknownRules=I,r.schemaHasRules=h,r.schemaHasRulesButRef=function v(i,g){if("boolean"==typeof i)return!i;for(const N in i)if("$ref"!==N&&g.all[N])return!0;return!1},r.schemaRefOrVal=function c({topSchemaRef:i,schemaPath:g},N,L,H){if(!H){if("number"==typeof N||"boolean"==typeof N)return N;if("string"==typeof N)return t._`${N}`}return t._`${i}${g}${(0,t.getProperty)(L)}`},r.unescapeFragment=function m(i){return $(decodeURIComponent(i))},r.escapeFragment=function T(i){return encodeURIComponent(y(i))},r.escapeJsonPointer=y,r.unescapeJsonPointer=$,r.eachItem=function w(i,g){if(Array.isArray(i))for(const N of i)g(N);else g(i)},r.mergeEvaluated={props:O({mergeNames:(i,g,N)=>i.if(t._`${N} !== true && ${g} !== undefined`,()=>{i.if(t._`${g} === true`,()=>i.assign(N,!0),()=>i.assign(N,t._`${N} || {}`).code(t._`Object.assign(${N}, ${g})`))}),mergeToName:(i,g,N)=>i.if(t._`${N} !== true`,()=>{!0===g?i.assign(N,!0):(i.assign(N,t._`${N} || {}`),p(i,N,g))}),mergeValues:(i,g)=>!0===i||{...i,...g},resultToName:j}),items:O({mergeNames:(i,g,N)=>i.if(t._`${N} !== true && ${g} !== undefined`,()=>i.assign(N,t._`${g} === true ? true : ${N} > ${g} ? ${N} : ${g}`)),mergeToName:(i,g,N)=>i.if(t._`${N} !== true`,()=>i.assign(N,!0===g||t._`${N} > ${g} ? ${N} : ${g}`)),mergeValues:(i,g)=>!0===i||Math.max(i,g),resultToName:(i,g)=>i.var("items",g)})},r.evaluatedPropsToName=j,r.setEvaluated=p;const o={};r.useFunc=function S(i,g){return i.scopeValue("func",{ref:g,code:o[g.code]||(o[g.code]=new _._Code(g.code))})};var n=function(i){return i[i.Num=0]="Num",i[i.Str=1]="Str",i}(n||(r.Type=n={}));function k(i,g,N=i.opts.strictSchema){if(N){if(g=`strict mode: ${g}`,!0===N)throw new Error(g);i.self.logger.warn(g)}}r.getErrorPath=function d(i,g,N){if(i instanceof t.Name){const L=g===n.Num;return N?L?t._`"[" + ${i} + "]"`:t._`"['" + ${i} + "']"`:L?t._`"/" + ${i}`:t._`"/" + ${i}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return N?(0,t.getProperty)(i).toString():"/"+y(i)},r.checkStrictMode=k},61528(Y,r){function t(E,b){return b.rules.some(I=>_(E,I))}function _(E,b){var I;return void 0!==E[b.keyword]||(null===(I=b.definition.implements)||void 0===I?void 0:I.some(h=>void 0!==E[h]))}Object.defineProperty(r,"__esModule",{value:!0}),r.shouldUseRule=r.shouldUseGroup=r.schemaHasRulesForType=void 0,r.schemaHasRulesForType=function l({schema:E,self:b},I){const h=b.RULES.types[I];return h&&!0!==h&&t(E,h)},r.shouldUseGroup=t,r.shouldUseRule=_},21654(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0}),r.boolOrEmptySchema=r.topBoolOrEmptySchema=void 0;const t=l(41751),_=l(22984),E=l(80794),b={message:"boolean schema is false"};function v(c,m){const{gen:T,data:y}=c;(0,t.reportError)({gen:T,keyword:"false schema",data:y,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:c},b,void 0,m)}r.topBoolOrEmptySchema=function I(c){const{gen:m,schema:T,validateName:y}=c;!1===T?v(c,!1):"object"==typeof T&&!0===T.$async?m.return(E.default.data):(m.assign(_._`${y}.errors`,null),m.return(!0))},r.boolOrEmptySchema=function h(c,m){const{gen:T,schema:y}=c;!1===y?(T.var(m,!1),v(c)):T.var(m,!0)}},97465(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0}),r.reportTypeError=r.checkDataTypes=r.checkDataType=r.coerceAndCheckDataType=r.getJSONTypes=r.getSchemaTypes=r.DataType=void 0;const t=l(98621),_=l(61528),E=l(41751),b=l(22984),I=l(73612);var h=function(n){return n[n.Correct=0]="Correct",n[n.Wrong=1]="Wrong",n}(h||(r.DataType=h={}));function c(n){const d=Array.isArray(n)?n:n?[n]:[];if(d.every(t.isJSONType))return d;throw new Error("type must be JSONType or JSONType[]: "+d.join(","))}r.getSchemaTypes=function v(n){const d=c(n.type);if(d.includes("null")){if(!1===n.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!d.length&&void 0!==n.nullable)throw new Error('"nullable" cannot be used without "type"');!0===n.nullable&&d.push("null")}return d},r.getJSONTypes=c,r.coerceAndCheckDataType=function m(n,d){const{gen:k,data:i,opts:g}=n,N=function y(n,d){return d?n.filter(k=>T.has(k)||"array"===d&&"array"===k):[]}(d,g.coerceTypes),L=d.length>0&&!(0===N.length&&1===d.length&&(0,_.schemaHasRulesForType)(n,d[0]));if(L){const H=j(d,i,g.strictNumbers,h.Wrong);k.if(H,()=>{N.length?function $(n,d,k){const{gen:i,data:g,opts:N}=n,L=i.let("dataType",b._`typeof ${g}`),H=i.let("coerced",b._`undefined`);"array"===N.coerceTypes&&i.if(b._`${L} == 'object' && Array.isArray(${g}) && ${g}.length == 1`,()=>i.assign(g,b._`${g}[0]`).assign(L,b._`typeof ${g}`).if(j(d,g,N.strictNumbers),()=>i.assign(H,g))),i.if(b._`${H} !== undefined`);for(const Q of k)(T.has(Q)||"array"===Q&&"array"===N.coerceTypes)&&G(Q);function G(Q){switch(Q){case"string":return void i.elseIf(b._`${L} == "number" || ${L} == "boolean"`).assign(H,b._`"" + ${g}`).elseIf(b._`${g} === null`).assign(H,b._`""`);case"number":return void i.elseIf(b._`${L} == "boolean" || ${g} === null
2
+ || (${L} == "string" && ${g} && ${g} == +${g})`).assign(H,b._`+${g}`);case"integer":return void i.elseIf(b._`${L} === "boolean" || ${g} === null
3
+ || (${L} === "string" && ${g} && ${g} == +${g} && !(${g} % 1))`).assign(H,b._`+${g}`);case"boolean":return void i.elseIf(b._`${g} === "false" || ${g} === 0 || ${g} === null`).assign(H,!1).elseIf(b._`${g} === "true" || ${g} === 1`).assign(H,!0);case"null":return i.elseIf(b._`${g} === "" || ${g} === 0 || ${g} === false`),void i.assign(H,null);case"array":i.elseIf(b._`${L} === "string" || ${L} === "number"
4
+ || ${L} === "boolean" || ${g} === null`).assign(H,b._`[${g}]`)}}i.else(),o(n),i.endIf(),i.if(b._`${H} !== undefined`,()=>{i.assign(g,H),function w({gen:n,parentData:d,parentDataProperty:k},i){n.if(b._`${d} !== undefined`,()=>n.assign(b._`${d}[${k}]`,i))}(n,H)})}(n,d,N):o(n)})}return L};const T=new Set(["string","number","integer","boolean","null"]);function O(n,d,k,i=h.Correct){const g=i===h.Correct?b.operators.EQ:b.operators.NEQ;let N;switch(n){case"null":return b._`${d} ${g} null`;case"array":N=b._`Array.isArray(${d})`;break;case"object":N=b._`${d} && typeof ${d} == "object" && !Array.isArray(${d})`;break;case"integer":N=L(b._`!(${d} % 1) && !isNaN(${d})`);break;case"number":N=L();break;default:return b._`typeof ${d} ${g} ${n}`}return i===h.Correct?N:(0,b.not)(N);function L(H=b.nil){return(0,b.and)(b._`typeof ${d} == "number"`,H,k?b._`isFinite(${d})`:b.nil)}}function j(n,d,k,i){if(1===n.length)return O(n[0],d,k,i);let g;const N=(0,I.toHash)(n);if(N.array&&N.object){const L=b._`typeof ${d} != "object"`;g=N.null?L:b._`!${d} || ${L}`,delete N.null,delete N.array,delete N.object}else g=b.nil;N.number&&delete N.integer;for(const L in N)g=(0,b.and)(g,O(L,d,k,i));return g}r.checkDataType=O,r.checkDataTypes=j;const p={message:({schema:n})=>`must be ${n}`,params:({schema:n,schemaValue:d})=>"string"==typeof n?b._`{type: ${n}}`:b._`{type: ${d}}`};function o(n){const d=function S(n){const{gen:d,data:k,schema:i}=n,g=(0,I.schemaRefOrVal)(n,i,"type");return{gen:d,keyword:"type",data:k,schema:i.type,schemaCode:g,schemaValue:g,parentSchema:i,params:{},it:n}}(n);(0,E.reportError)(d,p)}r.reportTypeError=o},28655(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0}),r.assignDefaults=void 0;const t=l(22984),_=l(73612);function b(I,h,v){const{gen:c,compositeRule:m,data:T,opts:y}=I;if(void 0===v)return;const $=t._`${T}${(0,t.getProperty)(h)}`;if(m)return void(0,_.checkStrictMode)(I,`default is ignored for: ${$}`);let w=t._`${$} === undefined`;"empty"===y.useDefaults&&(w=t._`${w} || ${$} === null || ${$} === ""`),c.if(w,t._`${$} = ${(0,t.stringify)(v)}`)}r.assignDefaults=function E(I,h){const{properties:v,items:c}=I.schema;if("object"===h&&v)for(const m in v)b(I,m,v[m].default);else"array"===h&&Array.isArray(c)&&c.forEach((m,T)=>b(I,T,m.default))}},99141(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0}),r.getData=r.KeywordCxt=r.validateFunctionCode=void 0;const t=l(21654),_=l(97465),E=l(61528),b=l(97465),I=l(28655),h=l(58870),v=l(78404),c=l(22984),m=l(80794),T=l(72014),y=l(73612),$=l(41751);function O({gen:C,validateName:D,schema:U,schemaEnv:q,opts:W},re){W.code.es5?C.func(D,c._`${m.default.data}, ${m.default.valCxt}`,q.$async,()=>{C.code(c._`"use strict"; ${n(U,W)}`),function p(C,D){C.if(m.default.valCxt,()=>{C.var(m.default.instancePath,c._`${m.default.valCxt}.${m.default.instancePath}`),C.var(m.default.parentData,c._`${m.default.valCxt}.${m.default.parentData}`),C.var(m.default.parentDataProperty,c._`${m.default.valCxt}.${m.default.parentDataProperty}`),C.var(m.default.rootData,c._`${m.default.valCxt}.${m.default.rootData}`),D.dynamicRef&&C.var(m.default.dynamicAnchors,c._`${m.default.valCxt}.${m.default.dynamicAnchors}`)},()=>{C.var(m.default.instancePath,c._`""`),C.var(m.default.parentData,c._`undefined`),C.var(m.default.parentDataProperty,c._`undefined`),C.var(m.default.rootData,m.default.data),D.dynamicRef&&C.var(m.default.dynamicAnchors,c._`{}`)})}(C,W),C.code(re)}):C.func(D,c._`${m.default.data}, ${function j(C){return c._`{${m.default.instancePath}="", ${m.default.parentData}, ${m.default.parentDataProperty}, ${m.default.rootData}=${m.default.data}${C.dynamicRef?c._`, ${m.default.dynamicAnchors}={}`:c.nil}}={}`}(W)}`,q.$async,()=>C.code(n(U,W)).code(re))}function n(C,D){const U="object"==typeof C&&C[D.schemaId];return U&&(D.code.source||D.code.process)?c._`/*# sourceURL=${U} */`:c.nil}function k({schema:C,self:D}){if("boolean"==typeof C)return!C;for(const U in C)if(D.RULES.all[U])return!0;return!1}function i(C){return"boolean"!=typeof C.schema}function N(C){(0,y.checkUnknownRules)(C),function H(C){const{schema:D,errSchemaPath:U,opts:q,self:W}=C;D.$ref&&q.ignoreKeywordsWithRef&&(0,y.schemaHasRulesButRef)(D,W.RULES)&&W.logger.warn(`$ref: keywords ignored in schema at path "${U}"`)}(C)}function L(C,D){if(C.opts.jtd)return ke(C,[],!1,D);const U=(0,_.getSchemaTypes)(C.schema);ke(C,U,!(0,_.coerceAndCheckDataType)(C,U),D)}function x({gen:C,schemaEnv:D,schema:U,errSchemaPath:q,opts:W}){const re=U.$comment;if(!0===W.$comment)C.code(c._`${m.default.self}.logger.log(${re})`);else if("function"==typeof W.$comment){const he=c.str`${q}/$comment`,Ne=C.scopeValue("root",{ref:D.root});C.code(c._`${m.default.self}.opts.$comment(${re}, ${he}, ${Ne}.schema)`)}}function ke(C,D,U,q){const{gen:W,schema:re,data:he,allErrors:Ne,opts:_e,self:$e}=C,{RULES:ge}=$e;function Ie(Se){(0,E.shouldUseGroup)(re,Se)&&(Se.type?(W.if((0,b.checkDataType)(Se.type,he,_e.strictNumbers)),Te(C,Se),1===D.length&&D[0]===Se.type&&U&&(W.else(),(0,b.reportTypeError)(C)),W.endIf()):Te(C,Se),Ne||W.if(c._`${m.default.errors} === ${q||0}`))}!re.$ref||!_e.ignoreKeywordsWithRef&&(0,y.schemaHasRulesButRef)(re,ge)?(_e.jtd||function le(C,D){C.schemaEnv.meta||!C.opts.strictTypes||(function Oe(C,D){if(D.length){if(!C.dataTypes.length)return void(C.dataTypes=D);D.forEach(U=>{f(C.dataTypes,U)||F(C,`type "${U}" not allowed by context "${C.dataTypes.join(",")}"`)}),function P(C,D){const U=[];for(const q of C.dataTypes)f(D,q)?U.push(q):D.includes("integer")&&"number"===q&&U.push("integer");C.dataTypes=U}(C,D)}}(C,D),C.opts.allowUnionTypes||function J(C,D){D.length>1&&(2!==D.length||!D.includes("null"))&&F(C,"use allowUnionTypes to allow union type keyword")}(C,D),function M(C,D){const U=C.self.RULES.all;for(const q in U){const W=U[q];if("object"==typeof W&&(0,E.shouldUseRule)(C.schema,W)){const{type:re}=W.definition;re.length&&!re.some(he=>A(D,he))&&F(C,`missing type "${re.join(",")}" for keyword "${q}"`)}}}(C,C.dataTypes))}(C,D),W.block(()=>{for(const Se of ge.rules)Ie(Se);Ie(ge.post)})):W.block(()=>te(C,"$ref",ge.all.$ref.definition))}function Te(C,D){const{gen:U,schema:q,opts:{useDefaults:W}}=C;W&&(0,I.assignDefaults)(C,D.type),U.block(()=>{for(const re of D.rules)(0,E.shouldUseRule)(q,re)&&te(C,re.keyword,re.definition,D.type)})}function A(C,D){return C.includes(D)||"number"===D&&C.includes("integer")}function f(C,D){return C.includes(D)||"integer"===D&&C.includes("number")}function F(C,D){(0,y.checkStrictMode)(C,D+=` at "${C.schemaEnv.baseId+C.errSchemaPath}" (strictTypes)`,C.opts.strictTypes)}r.validateFunctionCode=function w(C){i(C)&&(N(C),k(C))?function o(C){const{schema:D,opts:U,gen:q}=C;O(C,()=>{U.$comment&&D.$comment&&x(C),function G(C){const{schema:D,opts:U}=C;void 0!==D.default&&U.useDefaults&&U.strictSchema&&(0,y.checkStrictMode)(C,"default is ignored in the schema root")}(C),q.let(m.default.vErrors,null),q.let(m.default.errors,0),U.unevaluated&&function S(C){const{gen:D,validateName:U}=C;C.evaluated=D.const("evaluated",c._`${U}.evaluated`),D.if(c._`${C.evaluated}.dynamicProps`,()=>D.assign(c._`${C.evaluated}.props`,c._`undefined`)),D.if(c._`${C.evaluated}.dynamicItems`,()=>D.assign(c._`${C.evaluated}.items`,c._`undefined`))}(C),L(C),function ue(C){const{gen:D,schemaEnv:U,validateName:q,ValidationError:W,opts:re}=C;U.$async?D.if(c._`${m.default.errors} === 0`,()=>D.return(m.default.data),()=>D.throw(c._`new ${W}(${m.default.vErrors})`)):(D.assign(c._`${q}.errors`,m.default.vErrors),re.unevaluated&&function fe({gen:C,evaluated:D,props:U,items:q}){U instanceof c.Name&&C.assign(c._`${D}.props`,U),q instanceof c.Name&&C.assign(c._`${D}.items`,q)}(C),D.return(c._`${m.default.errors} === 0`))}(C)})}(C):O(C,()=>(0,t.topBoolOrEmptySchema)(C))};class B{constructor(D,U,q){if((0,h.validateKeywordUsage)(D,U,q),this.gen=D.gen,this.allErrors=D.allErrors,this.keyword=q,this.data=D.data,this.schema=D.schema[q],this.$data=U.$data&&D.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,y.schemaRefOrVal)(D,this.schema,q,this.$data),this.schemaType=U.schemaType,this.parentSchema=D.schema,this.params={},this.it=D,this.def=U,this.$data)this.schemaCode=D.gen.const("vSchema",be(this.$data,D));else if(this.schemaCode=this.schemaValue,!(0,h.validSchemaType)(this.schema,U.schemaType,U.allowUndefined))throw new Error(`${q} value must be ${JSON.stringify(U.schemaType)}`);("code"in U?U.trackErrors:!1!==U.errors)&&(this.errsCount=D.gen.const("_errs",m.default.errors))}result(D,U,q){this.failResult((0,c.not)(D),U,q)}failResult(D,U,q){this.gen.if(D),q?q():this.error(),U?(this.gen.else(),U(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(D,U){this.failResult((0,c.not)(D),void 0,U)}fail(D){if(void 0===D)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(D),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(D){if(!this.$data)return this.fail(D);const{schemaCode:U}=this;this.fail(c._`${U} !== undefined && (${(0,c.or)(this.invalid$data(),D)})`)}error(D,U,q){if(U)return this.setParams(U),this._error(D,q),void this.setParams({});this._error(D,q)}_error(D,U){(D?$.reportExtraError:$.reportError)(this,this.def.error,U)}$dataError(){(0,$.reportError)(this,this.def.$dataError||$.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,$.resetErrorsCount)(this.gen,this.errsCount)}ok(D){this.allErrors||this.gen.if(D)}setParams(D,U){U?Object.assign(this.params,D):this.params=D}block$data(D,U,q=c.nil){this.gen.block(()=>{this.check$data(D,q),U()})}check$data(D=c.nil,U=c.nil){if(!this.$data)return;const{gen:q,schemaCode:W,schemaType:re,def:he}=this;q.if((0,c.or)(c._`${W} === undefined`,U)),D!==c.nil&&q.assign(D,!0),(re.length||he.validateSchema)&&(q.elseIf(this.invalid$data()),this.$dataError(),D!==c.nil&&q.assign(D,!1)),q.else()}invalid$data(){const{gen:D,schemaCode:U,schemaType:q,def:W,it:re}=this;return(0,c.or)(function he(){if(q.length){if(!(U instanceof c.Name))throw new Error("ajv implementation error");const _e=Array.isArray(q)?q:[q];return c._`${(0,b.checkDataTypes)(_e,U,re.opts.strictNumbers,b.DataType.Wrong)}`}return c.nil}(),function Ne(){if(W.validateSchema){const _e=D.scopeValue("validate$data",{ref:W.validateSchema});return c._`!${_e}(${U})`}return c.nil}())}subschema(D,U){const q=(0,v.getSubschema)(this.it,D);(0,v.extendSubschemaData)(q,this.it,D),(0,v.extendSubschemaMode)(q,D);const W={...this.it,...q,items:void 0,props:void 0};return function d(C,D){i(C)&&(N(C),k(C))?function g(C,D){const{schema:U,gen:q,opts:W}=C;W.$comment&&U.$comment&&x(C),function Q(C){const D=C.schema[C.opts.schemaId];D&&(C.baseId=(0,T.resolveUrl)(C.opts.uriResolver,C.baseId,D))}(C),function X(C){if(C.schema.$async&&!C.schemaEnv.$async)throw new Error("async schema in sync schema")}(C);const re=q.const("_errs",m.default.errors);L(C,re),q.var(D,c._`${re} === ${m.default.errors}`)}(C,D):(0,t.boolOrEmptySchema)(C,D)}(W,U),W}mergeEvaluated(D,U){const{it:q,gen:W}=this;q.opts.unevaluated&&(!0!==q.props&&void 0!==D.props&&(q.props=y.mergeEvaluated.props(W,D.props,q.props,U)),!0!==q.items&&void 0!==D.items&&(q.items=y.mergeEvaluated.items(W,D.items,q.items,U)))}mergeValidEvaluated(D,U){const{it:q,gen:W}=this;if(q.opts.unevaluated&&(!0!==q.props||!0!==q.items))return W.if(U,()=>this.mergeEvaluated(D,c.Name)),!0}}function te(C,D,U,q){const W=new B(C,U,D);"code"in U?U.code(W,q):W.$data&&U.validate?(0,h.funcKeywordCode)(W,U):"macro"in U?(0,h.macroKeywordCode)(W,U):(U.compile||U.validate)&&(0,h.funcKeywordCode)(W,U)}r.KeywordCxt=B;const ne=/^\/(?:[^~]|~0|~1)*$/,ve=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function be(C,{dataLevel:D,dataNames:U,dataPathArr:q}){let W,re;if(""===C)return m.default.rootData;if("/"===C[0]){if(!ne.test(C))throw new Error(`Invalid JSON-pointer: ${C}`);W=C,re=m.default.rootData}else{const $e=ve.exec(C);if(!$e)throw new Error(`Invalid JSON-pointer: ${C}`);const ge=+$e[1];if(W=$e[2],"#"===W){if(ge>=D)throw new Error(_e("property/index",ge));return q[D-ge]}if(ge>D)throw new Error(_e("data",ge));if(re=U[D-ge],!W)return re}let he=re;const Ne=W.split("/");for(const $e of Ne)$e&&(re=c._`${re}${(0,c.getProperty)((0,y.unescapeJsonPointer)($e))}`,he=c._`${he} && ${re}`);return he;function _e($e,ge){return`Cannot access ${$e} ${ge} levels up, current level is ${D}`}}r.getData=be},58870(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0}),r.validateKeywordUsage=r.validSchemaType=r.funcKeywordCode=r.macroKeywordCode=void 0;const t=l(22984),_=l(80794),E=l(47904),b=l(41751);function v(w){const{gen:O,data:j,it:p}=w;O.if(p.parentData,()=>O.assign(j,t._`${p.parentData}[${p.parentDataProperty}]`))}function T(w,O,j){if(void 0===j)throw new Error(`keyword "${O}" failed to compile`);return w.scopeValue("keyword","function"==typeof j?{ref:j}:{ref:j,code:(0,t.stringify)(j)})}r.macroKeywordCode=function I(w,O){const{gen:j,keyword:p,schema:o,parentSchema:S,it:n}=w,d=O.macro.call(n.self,o,S,n),k=T(j,p,d);!1!==n.opts.validateSchema&&n.self.validateSchema(d,!0);const i=j.name("valid");w.subschema({schema:d,schemaPath:t.nil,errSchemaPath:`${n.errSchemaPath}/${p}`,topSchemaRef:k,compositeRule:!0},i),w.pass(i,()=>w.error(!0))},r.funcKeywordCode=function h(w,O){var j;const{gen:p,keyword:o,schema:S,parentSchema:n,$data:d,it:k}=w;!function m({schemaEnv:w},O){if(O.async&&!w.$async)throw new Error("async keyword in sync schema")}(k,O);const i=!d&&O.compile?O.compile.call(k.self,S,n,k):O.validate,g=T(p,o,i),N=p.let("valid");function Q(x=(O.async?t._`await `:t.nil)){p.assign(N,t._`${x}${(0,E.callValidateCode)(w,g,k.opts.passContext?_.default.this:_.default.self,!("compile"in O&&!d||!1===O.schema))}`,O.modifying)}function X(x){var ue;p.if((0,t.not)(null!==(ue=O.valid)&&void 0!==ue?ue:N),x)}w.block$data(N,function L(){if(!1===O.errors)Q(),O.modifying&&v(w),X(()=>w.error());else{const x=O.async?function H(){const x=p.let("ruleErrs",null);return p.try(()=>Q(t._`await `),ue=>p.assign(N,!1).if(t._`${ue} instanceof ${k.ValidationError}`,()=>p.assign(x,t._`${ue}.errors`),()=>p.throw(ue))),x}():function G(){const x=t._`${g}.errors`;return p.assign(x,null),Q(t.nil),x}();O.modifying&&v(w),X(()=>function c(w,O){const{gen:j}=w;j.if(t._`Array.isArray(${O})`,()=>{j.assign(_.default.vErrors,t._`${_.default.vErrors} === null ? ${O} : ${_.default.vErrors}.concat(${O})`).assign(_.default.errors,t._`${_.default.vErrors}.length`),(0,b.extendErrors)(w)},()=>w.error())}(w,x))}}),w.ok(null!==(j=O.valid)&&void 0!==j?j:N)},r.validSchemaType=function y(w,O,j=!1){return!O.length||O.some(p=>"array"===p?Array.isArray(w):"object"===p?w&&"object"==typeof w&&!Array.isArray(w):typeof w==p||j&&typeof w>"u")},r.validateKeywordUsage=function $({schema:w,opts:O,self:j,errSchemaPath:p},o,S){if(Array.isArray(o.keyword)?!o.keyword.includes(S):o.keyword!==S)throw new Error("ajv implementation error");const n=o.dependencies;if(n?.some(d=>!Object.prototype.hasOwnProperty.call(w,d)))throw new Error(`parent schema must have dependencies of ${S}: ${n.join(",")}`);if(o.validateSchema&&!o.validateSchema(w[S])){const k=`keyword "${S}" value is invalid at path "${p}": `+j.errorsText(o.validateSchema.errors);if("log"!==O.validateSchema)throw new Error(k);j.logger.error(k)}}},78404(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0}),r.extendSubschemaMode=r.extendSubschemaData=r.getSubschema=void 0;const t=l(22984),_=l(73612);r.getSubschema=function E(h,{keyword:v,schemaProp:c,schema:m,schemaPath:T,errSchemaPath:y,topSchemaRef:$}){if(void 0!==v&&void 0!==m)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==v){const w=h.schema[v];return void 0===c?{schema:w,schemaPath:t._`${h.schemaPath}${(0,t.getProperty)(v)}`,errSchemaPath:`${h.errSchemaPath}/${v}`}:{schema:w[c],schemaPath:t._`${h.schemaPath}${(0,t.getProperty)(v)}${(0,t.getProperty)(c)}`,errSchemaPath:`${h.errSchemaPath}/${v}/${(0,_.escapeFragment)(c)}`}}if(void 0!==m){if(void 0===T||void 0===y||void 0===$)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:m,schemaPath:T,topSchemaRef:$,errSchemaPath:y}}throw new Error('either "keyword" or "schema" must be passed')},r.extendSubschemaData=function b(h,v,{dataProp:c,dataPropType:m,data:T,dataTypes:y,propertyName:$}){if(void 0!==T&&void 0!==c)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:w}=v;if(void 0!==c){const{errorPath:j,dataPathArr:p,opts:o}=v;O(w.let("data",t._`${v.data}${(0,t.getProperty)(c)}`,!0)),h.errorPath=t.str`${j}${(0,_.getErrorPath)(c,m,o.jsPropertySyntax)}`,h.parentDataProperty=t._`${c}`,h.dataPathArr=[...p,h.parentDataProperty]}function O(j){h.data=j,h.dataLevel=v.dataLevel+1,h.dataTypes=[],v.definedProperties=new Set,h.parentData=v.data,h.dataNames=[...v.dataNames,j]}void 0!==T&&(O(T instanceof t.Name?T:w.let("data",T,!0)),void 0!==$&&(h.propertyName=$)),y&&(h.dataTypes=y)},r.extendSubschemaMode=function I(h,{jtdDiscriminator:v,jtdMetadata:c,compositeRule:m,createErrors:T,allErrors:y}){void 0!==m&&(h.compositeRule=m),void 0!==T&&(h.createErrors=T),void 0!==y&&(h.allErrors=y),h.jtdDiscriminator=v,h.jtdMetadata=c}},4017(Y,r,l){var t=l(29293).default;Object.defineProperty(r,"__esModule",{value:!0}),r.CodeGen=r.Name=r.nil=r.stringify=r.str=r._=r.KeywordCxt=void 0;var _=l(99141);Object.defineProperty(r,"KeywordCxt",{enumerable:!0,get:function(){return _.KeywordCxt}});var E=l(22984);Object.defineProperty(r,"_",{enumerable:!0,get:function(){return E._}}),Object.defineProperty(r,"str",{enumerable:!0,get:function(){return E.str}}),Object.defineProperty(r,"stringify",{enumerable:!0,get:function(){return E.stringify}}),Object.defineProperty(r,"nil",{enumerable:!0,get:function(){return E.nil}}),Object.defineProperty(r,"Name",{enumerable:!0,get:function(){return E.Name}}),Object.defineProperty(r,"CodeGen",{enumerable:!0,get:function(){return E.CodeGen}});const b=l(46545),I=l(56798),h=l(98621),v=l(95938),c=l(22984),m=l(72014),T=l(97465),y=l(73612),$=l(70545),w=l(67977),O=(J,M)=>new RegExp(J,M);O.code="new RegExp";const j=["removeAdditional","useDefaults","coerceTypes"],p=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),o={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."},S={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function d(J){var M,A,f,P,F,B,te,ne,ve,be,C,D,U,q,W,re,he,Ne,_e,$e,ge,Ie,Se,je,Me;const Re=J.strict,Ae=null===(M=J.code)||void 0===M?void 0:M.optimize,Fe=!0===Ae||void 0===Ae?1:Ae||0,Ce=null!==(f=null===(A=J.code)||void 0===A?void 0:A.regExp)&&void 0!==f?f:O,De=null!==(P=J.uriResolver)&&void 0!==P?P:w.default;return{strictSchema:null===(B=null!==(F=J.strictSchema)&&void 0!==F?F:Re)||void 0===B||B,strictNumbers:null===(ne=null!==(te=J.strictNumbers)&&void 0!==te?te:Re)||void 0===ne||ne,strictTypes:null!==(be=null!==(ve=J.strictTypes)&&void 0!==ve?ve:Re)&&void 0!==be?be:"log",strictTuples:null!==(D=null!==(C=J.strictTuples)&&void 0!==C?C:Re)&&void 0!==D?D:"log",strictRequired:null!==(q=null!==(U=J.strictRequired)&&void 0!==U?U:Re)&&void 0!==q&&q,code:J.code?{...J.code,optimize:Fe,regExp:Ce}:{optimize:Fe,regExp:Ce},loopRequired:null!==(W=J.loopRequired)&&void 0!==W?W:200,loopEnum:null!==(re=J.loopEnum)&&void 0!==re?re:200,meta:null===(he=J.meta)||void 0===he||he,messages:null===(Ne=J.messages)||void 0===Ne||Ne,inlineRefs:null===(_e=J.inlineRefs)||void 0===_e||_e,schemaId:null!==($e=J.schemaId)&&void 0!==$e?$e:"$id",addUsedSchema:null===(ge=J.addUsedSchema)||void 0===ge||ge,validateSchema:null===(Ie=J.validateSchema)||void 0===Ie||Ie,validateFormats:null===(Se=J.validateFormats)||void 0===Se||Se,unicodeRegExp:null===(je=J.unicodeRegExp)||void 0===je||je,int32range:null===(Me=J.int32range)||void 0===Me||Me,uriResolver:De}}class k{constructor(M={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,M=this.opts={...M,...d(M)};const{es5:A,lines:f}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:p,es5:A,lines:f}),this.logger=function X(J){if(!1===J)return Q;if(void 0===J)return console;if(J.log&&J.warn&&J.error)return J;throw new Error("logger must implement log, warn and error methods")}(M.logger);const P=M.validateFormats;M.validateFormats=!1,this.RULES=(0,h.getRules)(),i.call(this,o,M,"NOT SUPPORTED"),i.call(this,S,M,"DEPRECATED","warn"),this._metaOpts=G.call(this),M.formats&&L.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),M.keywords&&H.call(this,M.keywords),"object"==typeof M.meta&&this.addMetaSchema(M.meta),N.call(this),M.validateFormats=P}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:M,meta:A,schemaId:f}=this.opts;let P=$;"id"===f&&(P={...$},P.id=P.$id,delete P.$id),A&&M&&this.addMetaSchema(P,P[f],!1)}defaultMeta(){const{meta:M,schemaId:A}=this.opts;return this.opts.defaultMeta="object"==typeof M?M[A]||M:void 0}validate(M,A){let f;if("string"==typeof M){if(f=this.getSchema(M),!f)throw new Error(`no schema with key or ref "${M}"`)}else f=this.compile(M);const P=f(A);return"$async"in f||(this.errors=f.errors),P}compile(M,A){const f=this._addSchema(M,A);return f.validate||this._compileSchemaEnv(f)}compileAsync(M,A){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:f}=this.opts;return P.call(this,M,A);function P(W,re){return F.apply(this,arguments)}function F(){return(F=t(function*(W,re){yield B.call(this,W.$schema);const he=this._addSchema(W,re);return he.validate||ne.call(this,he)})).apply(this,arguments)}function B(W){return te.apply(this,arguments)}function te(){return(te=t(function*(W){W&&!this.getSchema(W)&&(yield P.call(this,{$ref:W},!0))})).apply(this,arguments)}function ne(W){return ve.apply(this,arguments)}function ve(){return(ve=t(function*(W){try{return this._compileSchemaEnv(W)}catch(re){if(!(re instanceof I.default))throw re;return be.call(this,re),yield C.call(this,re.missingSchema),ne.call(this,W)}})).apply(this,arguments)}function be({missingSchema:W,missingRef:re}){if(this.refs[W])throw new Error(`AnySchema ${W} is loaded but ${re} cannot be resolved`)}function C(W){return D.apply(this,arguments)}function D(){return(D=t(function*(W){const re=yield U.call(this,W);this.refs[W]||(yield B.call(this,re.$schema)),this.refs[W]||this.addSchema(re,W,A)})).apply(this,arguments)}function U(W){return q.apply(this,arguments)}function q(){return(q=t(function*(W){const re=this._loading[W];if(re)return re;try{return yield this._loading[W]=f(W)}finally{delete this._loading[W]}})).apply(this,arguments)}}addSchema(M,A,f,P=this.opts.validateSchema){if(Array.isArray(M)){for(const B of M)this.addSchema(B,void 0,f,P);return this}let F;if("object"==typeof M){const{schemaId:B}=this.opts;if(F=M[B],void 0!==F&&"string"!=typeof F)throw new Error(`schema ${B} must be string`)}return A=(0,m.normalizeId)(A||F),this._checkUnique(A),this.schemas[A]=this._addSchema(M,f,A,P,!0),this}addMetaSchema(M,A,f=this.opts.validateSchema){return this.addSchema(M,A,!0,f),this}validateSchema(M,A){if("boolean"==typeof M)return!0;let f;if(f=M.$schema,void 0!==f&&"string"!=typeof f)throw new Error("$schema must be a string");if(f=f||this.opts.defaultMeta||this.defaultMeta(),!f)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const P=this.validate(f,M);if(!P&&A){const F="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(F);this.logger.error(F)}return P}getSchema(M){let A;for(;"string"==typeof(A=g.call(this,M));)M=A;if(void 0===A){const{schemaId:f}=this.opts,P=new v.SchemaEnv({schema:{},schemaId:f});if(A=v.resolveSchema.call(this,P,M),!A)return;this.refs[M]=A}return A.validate||this._compileSchemaEnv(A)}removeSchema(M){if(M instanceof RegExp)return this._removeAllSchemas(this.schemas,M),this._removeAllSchemas(this.refs,M),this;switch(typeof M){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const A=g.call(this,M);return"object"==typeof A&&this._cache.delete(A.schema),delete this.schemas[M],delete this.refs[M],this}case"object":{this._cache.delete(M);let f=M[this.opts.schemaId];return f&&(f=(0,m.normalizeId)(f),delete this.schemas[f],delete this.refs[f]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(M){for(const A of M)this.addKeyword(A);return this}addKeyword(M,A){let f;if("string"==typeof M)f=M,"object"==typeof A&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),A.keyword=f);else{if("object"!=typeof M||void 0!==A)throw new Error("invalid addKeywords parameters");if(f=(A=M).keyword,Array.isArray(f)&&!f.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(ue.call(this,f,A),!A)return(0,y.eachItem)(f,F=>fe.call(this,F)),this;Te.call(this,A);const P={...A,type:(0,T.getJSONTypes)(A.type),schemaType:(0,T.getJSONTypes)(A.schemaType)};return(0,y.eachItem)(f,0===P.type.length?F=>fe.call(this,F,P):F=>P.type.forEach(B=>fe.call(this,F,P,B))),this}getKeyword(M){const A=this.RULES.all[M];return"object"==typeof A?A.definition:!!A}removeKeyword(M){const{RULES:A}=this;delete A.keywords[M],delete A.all[M];for(const f of A.rules){const P=f.rules.findIndex(F=>F.keyword===M);P>=0&&f.rules.splice(P,1)}return this}addFormat(M,A){return"string"==typeof A&&(A=new RegExp(A)),this.formats[M]=A,this}errorsText(M=this.errors,{separator:A=", ",dataVar:f="data"}={}){return M&&0!==M.length?M.map(P=>`${f}${P.instancePath} ${P.message}`).reduce((P,F)=>P+A+F):"No errors"}$dataMetaSchema(M,A){const f=this.RULES.all;M=JSON.parse(JSON.stringify(M));for(const P of A){const F=P.split("/").slice(1);let B=M;for(const te of F)B=B[te];for(const te in f){const ne=f[te];if("object"!=typeof ne)continue;const{$data:ve}=ne.definition,be=B[te];ve&&be&&(B[te]=Oe(be))}}return M}_removeAllSchemas(M,A){for(const f in M){const P=M[f];(!A||A.test(f))&&("string"==typeof P?delete M[f]:P&&!P.meta&&(this._cache.delete(P.schema),delete M[f]))}}_addSchema(M,A,f,P=this.opts.validateSchema,F=this.opts.addUsedSchema){let B;const{schemaId:te}=this.opts;if("object"==typeof M)B=M[te];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof M)throw new Error("schema must be object or boolean")}let ne=this._cache.get(M);if(void 0!==ne)return ne;f=(0,m.normalizeId)(B||f);const ve=m.getSchemaRefs.call(this,M,f);return ne=new v.SchemaEnv({schema:M,schemaId:te,meta:A,baseId:f,localRefs:ve}),this._cache.set(ne.schema,ne),F&&!f.startsWith("#")&&(f&&this._checkUnique(f),this.refs[f]=ne),P&&this.validateSchema(M,!0),ne}_checkUnique(M){if(this.schemas[M]||this.refs[M])throw new Error(`schema with key or id "${M}" already exists`)}_compileSchemaEnv(M){if(M.meta?this._compileMetaSchema(M):v.compileSchema.call(this,M),!M.validate)throw new Error("ajv implementation error");return M.validate}_compileMetaSchema(M){const A=this.opts;this.opts=this._metaOpts;try{v.compileSchema.call(this,M)}finally{this.opts=A}}}function i(J,M,A,f="error"){for(const P in J)P in M&&this.logger[f](`${A}: option ${P}. ${J[P]}`)}function g(J){return J=(0,m.normalizeId)(J),this.schemas[J]||this.refs[J]}function N(){const J=this.opts.schemas;if(J)if(Array.isArray(J))this.addSchema(J);else for(const M in J)this.addSchema(J[M],M)}function L(){for(const J in this.opts.formats){const M=this.opts.formats[J];M&&this.addFormat(J,M)}}function H(J){if(Array.isArray(J))this.addVocabulary(J);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const M in J){const A=J[M];A.keyword||(A.keyword=M),this.addKeyword(A)}}}function G(){const J={...this.opts};for(const M of j)delete J[M];return J}k.ValidationError=b.default,k.MissingRefError=I.default,r.default=k;const Q={log(){},warn(){},error(){}},x=/^[a-z_$][a-z0-9_$:-]*$/i;function ue(J,M){const{RULES:A}=this;if((0,y.eachItem)(J,f=>{if(A.keywords[f])throw new Error(`Keyword ${f} is already defined`);if(!x.test(f))throw new Error(`Keyword ${f} has invalid name`)}),M&&M.$data&&!("code"in M)&&!("validate"in M))throw new Error('$data keyword must have "code" or "validate" function')}function fe(J,M,A){var f;const P=M?.post;if(A&&P)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:F}=this;let B=P?F.post:F.rules.find(({type:ne})=>ne===A);if(B||(B={type:A,rules:[]},F.rules.push(B)),F.keywords[J]=!0,!M)return;const te={keyword:J,definition:{...M,type:(0,T.getJSONTypes)(M.type),schemaType:(0,T.getJSONTypes)(M.schemaType)}};M.before?ke.call(this,B,te,M.before):B.rules.push(te),F.all[J]=te,null===(f=M.implements)||void 0===f||f.forEach(ne=>this.addKeyword(ne))}function ke(J,M,A){const f=J.rules.findIndex(P=>P.keyword===A);f>=0?J.rules.splice(f,0,M):(J.rules.push(M),this.logger.warn(`rule ${A} is not defined`))}function Te(J){let{metaSchema:M}=J;void 0!==M&&(J.$data&&this.opts.$data&&(M=Oe(M)),J.validateSchema=this.compile(M,!0))}const le={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Oe(J){return{anyOf:[J,le]}}},17155(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(68986);t.code='require("ajv/dist/runtime/equal").default',r.default=t},68946(Y,r){function l(t){const _=t.length;let I,E=0,b=0;for(;b<_;)E++,I=t.charCodeAt(b++),I>=55296&&I<=56319&&b<_&&(I=t.charCodeAt(b),56320==(64512&I)&&b++);return E}Object.defineProperty(r,"__esModule",{value:!0}),r.default=l,l.code='require("ajv/dist/runtime/ucs2length").default'},67977(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(95484);t.code='require("ajv/dist/runtime/uri").default',r.default=t},46545(Y,r){Object.defineProperty(r,"__esModule",{value:!0});class l extends Error{constructor(_){super("validation failed"),this.errors=_,this.ajv=this.validation=!0}}r.default=l},90932(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0}),r.validateAdditionalItems=void 0;const t=l(22984),_=l(73612),b={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:h}})=>t.str`must NOT have more than ${h} items`,params:({params:{len:h}})=>t._`{limit: ${h}}`},code(h){const{parentSchema:v,it:c}=h,{items:m}=v;Array.isArray(m)?I(h,m):(0,_.checkStrictMode)(c,'"additionalItems" is ignored when "items" is not an array of schemas')}};function I(h,v){const{gen:c,schema:m,data:T,keyword:y,it:$}=h;$.items=!0;const w=c.const("len",t._`${T}.length`);if(!1===m)h.setParams({len:v.length}),h.pass(t._`${w} <= ${v.length}`);else if("object"==typeof m&&!(0,_.alwaysValidSchema)($,m)){const j=c.var("valid",t._`${w} <= ${v.length}`);c.if((0,t.not)(j),()=>function O(j){c.forRange("i",v.length,w,p=>{h.subschema({keyword:y,dataProp:p,dataPropType:_.Type.Num},j),$.allErrors||c.if((0,t.not)(j),()=>c.break())})}(j)),h.ok(j)}}r.validateAdditionalItems=I,r.default=b},72059(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(47904),_=l(22984),E=l(80794),b=l(73612);r.default={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:v})=>_._`{additionalProperty: ${v.additionalProperty}}`},code(v){const{gen:c,schema:m,parentSchema:T,data:y,errsCount:$,it:w}=v;if(!$)throw new Error("ajv implementation error");const{allErrors:O,opts:j}=w;if(w.props=!0,"all"!==j.removeAdditional&&(0,b.alwaysValidSchema)(w,m))return;const p=(0,t.allSchemaProperties)(T.properties),o=(0,t.allSchemaProperties)(T.patternProperties);function d(g){c.code(_._`delete ${y}[${g}]`)}function k(g){if("all"===j.removeAdditional||j.removeAdditional&&!1===m)d(g);else{if(!1===m)return v.setParams({additionalProperty:g}),v.error(),void(O||c.break());if("object"==typeof m&&!(0,b.alwaysValidSchema)(w,m)){const N=c.name("valid");"failing"===j.removeAdditional?(i(g,N,!1),c.if((0,_.not)(N),()=>{v.reset(),d(g)})):(i(g,N),O||c.if((0,_.not)(N),()=>c.break()))}}}function i(g,N,L){const H={keyword:"additionalProperties",dataProp:g,dataPropType:b.Type.Str};!1===L&&Object.assign(H,{compositeRule:!0,createErrors:!1,allErrors:!1}),v.subschema(H,N)}(function S(){c.forIn("key",y,g=>{p.length||o.length?c.if(function n(g){let N;if(p.length>8){const L=(0,b.schemaRefOrVal)(w,T.properties,"properties");N=(0,t.isOwnProperty)(c,L,g)}else N=p.length?(0,_.or)(...p.map(L=>_._`${g} === ${L}`)):_.nil;return o.length&&(N=(0,_.or)(N,...o.map(L=>_._`${(0,t.usePattern)(v,L)}.test(${g})`))),(0,_.not)(N)}(g),()=>k(g)):k(g)})})(),v.ok(_._`${$} === ${E.default.errors}`)}}},74153(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(73612);r.default={keyword:"allOf",schemaType:"array",code(E){const{gen:b,schema:I,it:h}=E;if(!Array.isArray(I))throw new Error("ajv implementation error");const v=b.name("valid");I.forEach((c,m)=>{if((0,t.alwaysValidSchema)(h,c))return;const T=E.subschema({keyword:"allOf",schemaProp:m},v);E.ok(v),E.mergeEvaluated(T)})}}},72304(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const _={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:l(47904).validateUnion,error:{message:"must match a schema in anyOf"}};r.default=_},62210(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(22984),_=l(73612);r.default={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:I,max:h}})=>void 0===h?t.str`must contain at least ${I} valid item(s)`:t.str`must contain at least ${I} and no more than ${h} valid item(s)`,params:({params:{min:I,max:h}})=>void 0===h?t._`{minContains: ${I}}`:t._`{minContains: ${I}, maxContains: ${h}}`},code(I){const{gen:h,schema:v,parentSchema:c,data:m,it:T}=I;let y,$;const{minContains:w,maxContains:O}=c;T.opts.next?(y=void 0===w?1:w,$=O):y=1;const j=h.const("len",t._`${m}.length`);if(I.setParams({min:y,max:$}),void 0===$&&0===y)return void(0,_.checkStrictMode)(T,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==$&&y>$)return(0,_.checkStrictMode)(T,'"minContains" > "maxContains" is always invalid'),void I.fail();if((0,_.alwaysValidSchema)(T,v)){let d=t._`${j} >= ${y}`;return void 0!==$&&(d=t._`${d} && ${j} <= ${$}`),void I.pass(d)}T.items=!0;const p=h.name("valid");function o(){const d=h.name("_valid"),k=h.let("count",0);S(d,()=>h.if(d,()=>function n(d){h.code(t._`${d}++`),void 0===$?h.if(t._`${d} >= ${y}`,()=>h.assign(p,!0).break()):(h.if(t._`${d} > ${$}`,()=>h.assign(p,!1).break()),1===y?h.assign(p,!0):h.if(t._`${d} >= ${y}`,()=>h.assign(p,!0)))}(k)))}function S(d,k){h.forRange("i",0,j,i=>{I.subschema({keyword:"contains",dataProp:i,dataPropType:_.Type.Num,compositeRule:!0},d),k()})}void 0===$&&1===y?S(p,()=>h.if(p,()=>h.break())):0===y?(h.let(p,!0),void 0!==$&&h.if(t._`${m}.length > 0`,o)):(h.let(p,!1),o()),I.result(p,()=>I.reset())}}},69758(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0}),r.validateSchemaDeps=r.validatePropertyDeps=r.error=void 0;const t=l(22984),_=l(73612),E=l(47904);r.error={message:({params:{property:c,depsCount:m,deps:T}})=>t.str`must have ${1===m?"property":"properties"} ${T} when property ${c} is present`,params:({params:{property:c,depsCount:m,deps:T,missingProperty:y}})=>t._`{property: ${c},
5
+ missingProperty: ${y},
6
+ depsCount: ${m},
7
+ deps: ${T}}`};const b={keyword:"dependencies",type:"object",schemaType:"object",error:r.error,code(c){const[m,T]=function I({schema:c}){const m={},T={};for(const y in c)"__proto__"!==y&&((Array.isArray(c[y])?m:T)[y]=c[y]);return[m,T]}(c);h(c,m),v(c,T)}};function h(c,m=c.schema){const{gen:T,data:y,it:$}=c;if(0===Object.keys(m).length)return;const w=T.let("missing");for(const O in m){const j=m[O];if(0===j.length)continue;const p=(0,E.propertyInData)(T,y,O,$.opts.ownProperties);c.setParams({property:O,depsCount:j.length,deps:j.join(", ")}),$.allErrors?T.if(p,()=>{for(const o of j)(0,E.checkReportMissingProp)(c,o)}):(T.if(t._`${p} && (${(0,E.checkMissingProp)(c,j,w)})`),(0,E.reportMissingProp)(c,w),T.else())}}function v(c,m=c.schema){const{gen:T,data:y,keyword:$,it:w}=c,O=T.name("valid");for(const j in m)(0,_.alwaysValidSchema)(w,m[j])||(T.if((0,E.propertyInData)(T,y,j,w.opts.ownProperties),()=>{const p=c.subschema({keyword:$,schemaProp:j},O);c.mergeValidEvaluated(p,O)},()=>T.var(O,!0)),c.ok(O))}r.validatePropertyDeps=h,r.validateSchemaDeps=v,r.default=b},65388(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(22984),_=l(73612);function I(h,v){const c=h.schema[v];return void 0!==c&&!(0,_.alwaysValidSchema)(h,c)}r.default={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:h})=>t.str`must match "${h.ifClause}" schema`,params:({params:h})=>t._`{failingKeyword: ${h.ifClause}}`},code(h){const{gen:v,parentSchema:c,it:m}=h;void 0===c.then&&void 0===c.else&&(0,_.checkStrictMode)(m,'"if" without "then" and "else" is ignored');const T=I(m,"then"),y=I(m,"else");if(!T&&!y)return;const $=v.let("valid",!0),w=v.name("_valid");if(function O(){const p=h.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},w);h.mergeEvaluated(p)}(),h.reset(),T&&y){const p=v.let("ifClause");h.setParams({ifClause:p}),v.if(w,j("then",p),j("else",p))}else T?v.if(w,j("then")):v.if((0,t.not)(w),j("else"));function j(p,o){return()=>{const S=h.subschema({keyword:p},w);v.assign($,w),h.mergeValidEvaluated(S,$),o?v.assign(o,t._`${p}`):h.setParams({ifClause:p})}}h.pass($,()=>h.error(!0))}}},38643(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(90932),_=l(38575),E=l(7579),b=l(49739),I=l(62210),h=l(69758),v=l(87920),c=l(72059),m=l(14662),T=l(3324),y=l(83402),$=l(72304),w=l(98374),O=l(74153),j=l(65388),p=l(88809);r.default=function o(S=!1){const n=[y.default,$.default,w.default,O.default,j.default,p.default,v.default,c.default,h.default,m.default,T.default];return S?n.push(_.default,b.default):n.push(t.default,E.default),n.push(I.default),n}},7579(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0}),r.validateTuple=void 0;const t=l(22984),_=l(73612),E=l(47904),b={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(h){const{schema:v,it:c}=h;if(Array.isArray(v))return I(h,"additionalItems",v);c.items=!0,!(0,_.alwaysValidSchema)(c,v)&&h.ok((0,E.validateArray)(h))}};function I(h,v,c=h.schema){const{gen:m,parentSchema:T,data:y,keyword:$,it:w}=h;(function p(o){const{opts:S,errSchemaPath:n}=w,d=c.length;S.strictTuples&&!(d===o.minItems&&(d===o.maxItems||!1===o[v]))&&(0,_.checkStrictMode)(w,`"${$}" is ${d}-tuple, but minItems or maxItems/${v} are not specified or different at path "${n}"`,S.strictTuples)})(T),w.opts.unevaluated&&c.length&&!0!==w.items&&(w.items=_.mergeEvaluated.items(m,c.length,w.items));const O=m.name("valid"),j=m.const("len",t._`${y}.length`);c.forEach((o,S)=>{(0,_.alwaysValidSchema)(w,o)||(m.if(t._`${j} > ${S}`,()=>h.subschema({keyword:$,schemaProp:S,dataProp:S},O)),h.ok(O))})}r.validateTuple=I,r.default=b},49739(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(22984),_=l(73612),E=l(47904),b=l(90932);r.default={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:v}})=>t.str`must NOT have more than ${v} items`,params:({params:{len:v}})=>t._`{limit: ${v}}`},code(v){const{schema:c,parentSchema:m,it:T}=v,{prefixItems:y}=m;T.items=!0,!(0,_.alwaysValidSchema)(T,c)&&(y?(0,b.validateAdditionalItems)(v,y):v.ok((0,E.validateArray)(v)))}}},83402(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(73612);r.default={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(E){const{gen:b,schema:I,it:h}=E;if((0,t.alwaysValidSchema)(h,I))return void E.fail();const v=b.name("valid");E.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},v),E.failResult(v,()=>E.reset(),()=>E.error())},error:{message:"must NOT be valid"}}},98374(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(22984),_=l(73612);r.default={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:I})=>t._`{passingSchemas: ${I.passing}}`},code(I){const{gen:h,schema:v,parentSchema:c,it:m}=I;if(!Array.isArray(v))throw new Error("ajv implementation error");if(m.opts.discriminator&&c.discriminator)return;const T=v,y=h.let("valid",!1),$=h.let("passing",null),w=h.name("_valid");I.setParams({passing:$}),h.block(function O(){T.forEach((j,p)=>{let o;(0,_.alwaysValidSchema)(m,j)?h.var(w,!0):o=I.subschema({keyword:"oneOf",schemaProp:p,compositeRule:!0},w),p>0&&h.if(t._`${w} && ${y}`).assign(y,!1).assign($,t._`[${$}, ${p}]`).else(),h.if(w,()=>{h.assign(y,!0),h.assign($,p),o&&I.mergeEvaluated(o,t.Name)})})}),I.result(y,()=>I.reset(),()=>I.error(!0))}}},3324(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(47904),_=l(22984),E=l(73612),b=l(73612);r.default={keyword:"patternProperties",type:"object",schemaType:"object",code(h){const{gen:v,schema:c,data:m,parentSchema:T,it:y}=h,{opts:$}=y,w=(0,t.allSchemaProperties)(c),O=w.filter(k=>(0,E.alwaysValidSchema)(y,c[k]));if(0===w.length||O.length===w.length&&(!y.opts.unevaluated||!0===y.props))return;const j=$.strictSchema&&!$.allowMatchingProperties&&T.properties,p=v.name("valid");!0!==y.props&&!(y.props instanceof _.Name)&&(y.props=(0,b.evaluatedPropsToName)(v,y.props));const{props:o}=y;function n(k){for(const i in j)new RegExp(k).test(i)&&(0,E.checkStrictMode)(y,`property ${i} matches pattern ${k} (use allowMatchingProperties)`)}function d(k){v.forIn("key",m,i=>{v.if(_._`${(0,t.usePattern)(h,k)}.test(${i})`,()=>{const g=O.includes(k);g||h.subschema({keyword:"patternProperties",schemaProp:k,dataProp:i,dataPropType:b.Type.Str},p),y.opts.unevaluated&&!0!==o?v.assign(_._`${o}[${i}]`,!0):!g&&!y.allErrors&&v.if((0,_.not)(p),()=>v.break())})})}!function S(){for(const k of w)j&&n(k),y.allErrors?d(k):(v.var(p,!0),d(k),v.if(p))}()}}},38575(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(7579);r.default={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:E=>(0,t.validateTuple)(E,"items")}},14662(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(99141),_=l(47904),E=l(73612),b=l(72059);r.default={keyword:"properties",type:"object",schemaType:"object",code(h){const{gen:v,schema:c,parentSchema:m,data:T,it:y}=h;"all"===y.opts.removeAdditional&&void 0===m.additionalProperties&&b.default.code(new t.KeywordCxt(y,b.default,"additionalProperties"));const $=(0,_.allSchemaProperties)(c);for(const o of $)y.definedProperties.add(o);y.opts.unevaluated&&$.length&&!0!==y.props&&(y.props=E.mergeEvaluated.props(v,(0,E.toHash)($),y.props));const w=$.filter(o=>!(0,E.alwaysValidSchema)(y,c[o]));if(0===w.length)return;const O=v.name("valid");for(const o of w)j(o)?p(o):(v.if((0,_.propertyInData)(v,T,o,y.opts.ownProperties)),p(o),y.allErrors||v.else().var(O,!0),v.endIf()),h.it.definedProperties.add(o),h.ok(O);function j(o){return y.opts.useDefaults&&!y.compositeRule&&void 0!==c[o].default}function p(o){h.subschema({keyword:"properties",schemaProp:o,dataProp:o},O)}}}},87920(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(22984),_=l(73612);r.default={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:I})=>t._`{propertyName: ${I.propertyName}}`},code(I){const{gen:h,schema:v,data:c,it:m}=I;if((0,_.alwaysValidSchema)(m,v))return;const T=h.name("valid");h.forIn("key",c,y=>{I.setParams({propertyName:y}),I.subschema({keyword:"propertyNames",data:y,dataTypes:["string"],propertyName:y,compositeRule:!0},T),h.if((0,t.not)(T),()=>{I.error(!0),m.allErrors||h.break()})}),I.ok(T)}}},88809(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(73612);r.default={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:E,parentSchema:b,it:I}){void 0===b.if&&(0,t.checkStrictMode)(I,`"${E}" without "if" is ignored`)}}},47904(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0}),r.validateUnion=r.validateArray=r.usePattern=r.callValidateCode=r.schemaProperties=r.allSchemaProperties=r.noPropertyInData=r.propertyInData=r.isOwnProperty=r.hasPropFunc=r.reportMissingProp=r.checkMissingProp=r.checkReportMissingProp=void 0;const t=l(22984),_=l(73612),E=l(80794),b=l(73612);function c(n){return n.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:t._`Object.prototype.hasOwnProperty`})}function m(n,d,k){return t._`${c(n)}.call(${d}, ${k})`}function y(n,d,k,i){const g=t._`${d}${(0,t.getProperty)(k)} === undefined`;return i?(0,t.or)(g,(0,t.not)(m(n,d,k))):g}function $(n){return n?Object.keys(n).filter(d=>"__proto__"!==d):[]}r.checkReportMissingProp=function I(n,d){const{gen:k,data:i,it:g}=n;k.if(y(k,i,d,g.opts.ownProperties),()=>{n.setParams({missingProperty:t._`${d}`},!0),n.error()})},r.checkMissingProp=function h({gen:n,data:d,it:{opts:k}},i,g){return(0,t.or)(...i.map(N=>(0,t.and)(y(n,d,N,k.ownProperties),t._`${g} = ${N}`)))},r.reportMissingProp=function v(n,d){n.setParams({missingProperty:d},!0),n.error()},r.hasPropFunc=c,r.isOwnProperty=m,r.propertyInData=function T(n,d,k,i){const g=t._`${d}${(0,t.getProperty)(k)} !== undefined`;return i?t._`${g} && ${m(n,d,k)}`:g},r.noPropertyInData=y,r.allSchemaProperties=$,r.schemaProperties=function w(n,d){return $(d).filter(k=>!(0,_.alwaysValidSchema)(n,d[k]))},r.callValidateCode=function O({schemaCode:n,data:d,it:{gen:k,topSchemaRef:i,schemaPath:g,errorPath:N},it:L},H,G,Q){const X=Q?t._`${n}, ${d}, ${i}${g}`:d,x=[[E.default.instancePath,(0,t.strConcat)(E.default.instancePath,N)],[E.default.parentData,L.parentData],[E.default.parentDataProperty,L.parentDataProperty],[E.default.rootData,E.default.rootData]];L.opts.dynamicRef&&x.push([E.default.dynamicAnchors,E.default.dynamicAnchors]);const ue=t._`${X}, ${k.object(...x)}`;return G!==t.nil?t._`${H}.call(${G}, ${ue})`:t._`${H}(${ue})`};const j=t._`new RegExp`;r.usePattern=function p({gen:n,it:{opts:d}},k){const i=d.unicodeRegExp?"u":"",{regExp:g}=d.code,N=g(k,i);return n.scopeValue("pattern",{key:N.toString(),ref:N,code:t._`${"new RegExp"===g.code?j:(0,b.useFunc)(n,g)}(${k}, ${i})`})},r.validateArray=function o(n){const{gen:d,data:k,keyword:i,it:g}=n,N=d.name("valid");if(g.allErrors){const H=d.let("valid",!0);return L(()=>d.assign(H,!1)),H}return d.var(N,!0),L(()=>d.break()),N;function L(H){const G=d.const("len",t._`${k}.length`);d.forRange("i",0,G,Q=>{n.subschema({keyword:i,dataProp:Q,dataPropType:_.Type.Num},N),d.if((0,t.not)(N),H)})}},r.validateUnion=function S(n){const{gen:d,schema:k,keyword:i,it:g}=n;if(!Array.isArray(k))throw new Error("ajv implementation error");if(k.some(G=>(0,_.alwaysValidSchema)(g,G))&&!g.opts.unevaluated)return;const L=d.let("valid",!1),H=d.name("_valid");d.block(()=>k.forEach((G,Q)=>{const X=n.subschema({keyword:i,schemaProp:Q,compositeRule:!0},H);d.assign(L,t._`${L} || ${H}`),n.mergeValidEvaluated(X,H)||d.if((0,t.not)(L))})),n.result(L,()=>n.reset(),()=>n.error(!0))}},48396(Y,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}}},51945(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(48396),_=l(2368);r.default=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,_.default]},2368(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0}),r.callRef=r.getValidate=void 0;const t=l(56798),_=l(47904),E=l(22984),b=l(80794),I=l(95938),h=l(73612),v={keyword:"$ref",schemaType:"string",code(T){const{gen:y,schema:$,it:w}=T,{baseId:O,schemaEnv:j,validateName:p,opts:o,self:S}=w,{root:n}=j;if(("#"===$||"#/"===$)&&O===n.baseId)return function k(){if(j===n)return m(T,p,j,j.$async);const N=y.scopeValue("root",{ref:n});return m(T,E._`${N}.validate`,n,n.$async)}();const d=I.resolveRef.call(S,n,O,$);if(void 0===d)throw new t.default(w.opts.uriResolver,O,$);return d instanceof I.SchemaEnv?function i(N){const L=c(T,N);m(T,L,N,N.$async)}(d):function g(N){const L=y.scopeValue("schema",!0===o.code.source?{ref:N,code:(0,E.stringify)(N)}:{ref:N}),H=y.name("valid"),G=T.subschema({schema:N,dataTypes:[],schemaPath:E.nil,topSchemaRef:L,errSchemaPath:$},H);T.mergeEvaluated(G),T.ok(H)}(d)}};function c(T,y){const{gen:$}=T;return y.validate?$.scopeValue("validate",{ref:y.validate}):E._`${$.scopeValue("wrapper",{ref:y})}.validate`}function m(T,y,$,w){const{gen:O,it:j}=T,{allErrors:p,schemaEnv:o,opts:S}=j,n=S.passContext?b.default.this:E.nil;function i(N){const L=E._`${N}.errors`;O.assign(b.default.vErrors,E._`${b.default.vErrors} === null ? ${L} : ${b.default.vErrors}.concat(${L})`),O.assign(b.default.errors,E._`${b.default.vErrors}.length`)}function g(N){var L;if(!j.opts.unevaluated)return;const H=null===(L=$?.validate)||void 0===L?void 0:L.evaluated;if(!0!==j.props)if(H&&!H.dynamicProps)void 0!==H.props&&(j.props=h.mergeEvaluated.props(O,H.props,j.props));else{const G=O.var("props",E._`${N}.evaluated.props`);j.props=h.mergeEvaluated.props(O,G,j.props,E.Name)}if(!0!==j.items)if(H&&!H.dynamicItems)void 0!==H.items&&(j.items=h.mergeEvaluated.items(O,H.items,j.items));else{const G=O.var("items",E._`${N}.evaluated.items`);j.items=h.mergeEvaluated.items(O,G,j.items,E.Name)}}w?function d(){if(!o.$async)throw new Error("async schema referenced by sync schema");const N=O.let("valid");O.try(()=>{O.code(E._`await ${(0,_.callValidateCode)(T,y,n)}`),g(y),p||O.assign(N,!0)},L=>{O.if(E._`!(${L} instanceof ${j.ValidationError})`,()=>O.throw(L)),i(L),p||O.assign(N,!1)}),T.ok(N)}():function k(){T.result((0,_.callValidateCode)(T,y,n),()=>g(y),()=>i(y))}()}r.getValidate=c,r.callRef=m,r.default=v},95962(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(22984),_=l(15031),E=l(95938),b=l(56798),I=l(73612);r.default={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:c,tagName:m}})=>c===_.DiscrError.Tag?`tag "${m}" must be string`:`value of tag "${m}" must be in oneOf`,params:({params:{discrError:c,tag:m,tagName:T}})=>t._`{error: ${c}, tag: ${T}, tagValue: ${m}}`},code(c){const{gen:m,data:T,schema:y,parentSchema:$,it:w}=c,{oneOf:O}=$;if(!w.opts.discriminator)throw new Error("discriminator: requires discriminator option");const j=y.propertyName;if("string"!=typeof j)throw new Error("discriminator: requires propertyName");if(y.mapping)throw new Error("discriminator: mapping is not supported");if(!O)throw new Error("discriminator: requires oneOf keyword");const p=m.let("valid",!1),o=m.const("tag",t._`${T}${(0,t.getProperty)(j)}`);function n(k){const i=m.name("valid"),g=c.subschema({keyword:"oneOf",schemaProp:k},i);return c.mergeEvaluated(g,t.Name),i}m.if(t._`typeof ${o} == "string"`,()=>function S(){const k=function d(){var k;const i={},g=L($);let N=!0;for(let Q=0;Q<O.length;Q++){let X=O[Q];if(X?.$ref&&!(0,I.schemaHasRulesButRef)(X,w.self.RULES)){const ue=X.$ref;if(X=E.resolveRef.call(w.self,w.schemaEnv.root,w.baseId,ue),X instanceof E.SchemaEnv&&(X=X.schema),void 0===X)throw new b.default(w.opts.uriResolver,w.baseId,ue)}const x=null===(k=X?.properties)||void 0===k?void 0:k[j];if("object"!=typeof x)throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${j}"`);N=N&&(g||L(X)),H(x,Q)}if(!N)throw new Error(`discriminator: "${j}" must be required`);return i;function L({required:Q}){return Array.isArray(Q)&&Q.includes(j)}function H(Q,X){if(Q.const)G(Q.const,X);else{if(!Q.enum)throw new Error(`discriminator: "properties/${j}" must have "const" or "enum"`);for(const x of Q.enum)G(x,X)}}function G(Q,X){if("string"!=typeof Q||Q in i)throw new Error(`discriminator: "${j}" values must be unique strings`);i[Q]=X}}();m.if(!1);for(const i in k)m.elseIf(t._`${o} === ${i}`),m.assign(p,n(k[i]));m.else(),c.error(!1,{discrError:_.DiscrError.Mapping,tag:o,tagName:j}),m.endIf()}(),()=>c.error(!1,{discrError:_.DiscrError.Tag,tag:o,tagName:j})),c.ok(p)}}},15031(Y,r){Object.defineProperty(r,"__esModule",{value:!0}),r.DiscrError=void 0;var l=function(t){return t.Tag="tag",t.Mapping="mapping",t}(l||(r.DiscrError=l={}))},94505(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(51945),_=l(96845),E=l(38643),b=l(21901),I=l(60680),h=[t.default,_.default,(0,E.default)(),b.default,I.metadataVocabulary,I.contentVocabulary];r.default=h},84326(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(22984);r.default={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:b})=>t.str`must match format "${b}"`,params:({schemaCode:b})=>t._`{format: ${b}}`},code(b,I){const{gen:h,data:v,$data:c,schema:m,schemaCode:T,it:y}=b,{opts:$,errSchemaPath:w,schemaEnv:O,self:j}=y;$.validateFormats&&(c?function p(){const S=h.scopeValue("formats",{ref:j.formats,code:$.code.formats}),n=h.const("fDef",t._`${S}[${T}]`),d=h.let("fType"),k=h.let("format");h.if(t._`typeof ${n} == "object" && !(${n} instanceof RegExp)`,()=>h.assign(d,t._`${n}.type || "string"`).assign(k,t._`${n}.validate`),()=>h.assign(d,t._`"string"`).assign(k,n)),b.fail$data((0,t.or)(function i(){return!1===$.strictSchema?t.nil:t._`${T} && !${k}`}(),function g(){const N=O.$async?t._`(${n}.async ? await ${k}(${v}) : ${k}(${v}))`:t._`${k}(${v})`,L=t._`(typeof ${k} == "function" ? ${N} : ${k}.test(${v}))`;return t._`${k} && ${k} !== true && ${d} === ${I} && !${L}`}()))}():function o(){const S=j.formats[m];if(!S)return void function i(){if(!1!==$.strictSchema)throw new Error(L());function L(){return`unknown format "${m}" ignored in schema at path "${w}"`}j.logger.warn(L())}();if(!0===S)return;const[n,d,k]=function g(L){const H=L instanceof RegExp?(0,t.regexpCode)(L):$.code.formats?t._`${$.code.formats}${(0,t.getProperty)(m)}`:void 0,G=h.scopeValue("formats",{key:m,ref:L,code:H});return"object"!=typeof L||L instanceof RegExp?["string",L,G]:[L.type||"string",L.validate,t._`${G}.validate`]}(S);n===I&&b.pass(function N(){if("object"==typeof S&&!(S instanceof RegExp)&&S.async){if(!O.$async)throw new Error("async format in sync schema");return t._`await ${k}(${v})`}return"function"==typeof d?t._`${k}(${v})`:t._`${k}.test(${v})`}())}())}}},21901(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const _=[l(84326).default];r.default=_},60680(Y,r){Object.defineProperty(r,"__esModule",{value:!0}),r.contentVocabulary=r.metadataVocabulary=void 0,r.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],r.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},49870(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(22984),_=l(73612),E=l(17155);r.default={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:h})=>t._`{allowedValue: ${h}}`},code(h){const{gen:v,data:c,$data:m,schemaCode:T,schema:y}=h;m||y&&"object"==typeof y?h.fail$data(t._`!${(0,_.useFunc)(v,E.default)}(${c}, ${T})`):h.fail(t._`${y} !== ${c}`)}}},70708(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(22984),_=l(73612),E=l(17155);r.default={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:h})=>t._`{allowedValues: ${h}}`},code(h){const{gen:v,data:c,$data:m,schema:T,schemaCode:y,it:$}=h;if(!m&&0===T.length)throw new Error("enum must have non-empty array");let O;const j=()=>O??(O=(0,_.useFunc)(v,E.default));let p;if(T.length>=$.opts.loopEnum||m)p=v.let("valid"),h.block$data(p,function o(){v.assign(p,!1),v.forOf("v",y,n=>v.if(t._`${j()}(${c}, ${n})`,()=>v.assign(p,!0).break()))});else{if(!Array.isArray(T))throw new Error("ajv implementation error");const n=v.const("vSchema",y);p=(0,t.or)(...T.map((d,k)=>function S(n,d){const k=T[d];return"object"==typeof k&&null!==k?t._`${j()}(${c}, ${n}[${d}])`:t._`${c} === ${k}`}(n,k)))}h.pass(p)}}},96845(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(72255),_=l(44696),E=l(1278),b=l(75363),I=l(17987),h=l(90620),v=l(75692),c=l(12112),m=l(49870),T=l(70708);r.default=[t.default,_.default,E.default,b.default,I.default,h.default,v.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},m.default,T.default]},75692(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(22984);r.default={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message:({keyword:b,schemaCode:I})=>t.str`must NOT have ${"maxItems"===b?"more":"fewer"} than ${I} items`,params:({schemaCode:b})=>t._`{limit: ${b}}`},code(b){const{keyword:I,data:h,schemaCode:v}=b;b.fail$data(t._`${h}.length ${"maxItems"===I?t.operators.GT:t.operators.LT} ${v}`)}}},1278(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(22984),_=l(73612),E=l(68946);r.default={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message:({keyword:h,schemaCode:v})=>t.str`must NOT have ${"maxLength"===h?"more":"fewer"} than ${v} characters`,params:({schemaCode:h})=>t._`{limit: ${h}}`},code(h){const{keyword:v,data:c,schemaCode:m,it:T}=h,y="maxLength"===v?t.operators.GT:t.operators.LT,$=!1===T.opts.unicode?t._`${c}.length`:t._`${(0,_.useFunc)(h.gen,E.default)}(${c})`;h.fail$data(t._`${$} ${y} ${m}`)}}},72255(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(22984),_=t.operators,E={maximum:{okStr:"<=",ok:_.LTE,fail:_.GT},minimum:{okStr:">=",ok:_.GTE,fail:_.LT},exclusiveMaximum:{okStr:"<",ok:_.LT,fail:_.GTE},exclusiveMinimum:{okStr:">",ok:_.GT,fail:_.LTE}},b={message:({keyword:h,schemaCode:v})=>t.str`must be ${E[h].okStr} ${v}`,params:({keyword:h,schemaCode:v})=>t._`{comparison: ${E[h].okStr}, limit: ${v}}`},I={keyword:Object.keys(E),type:"number",schemaType:"number",$data:!0,error:b,code(h){const{keyword:v,data:c,schemaCode:m}=h;h.fail$data(t._`${c} ${E[v].fail} ${m} || isNaN(${c})`)}};r.default=I},17987(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(22984);r.default={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message:({keyword:b,schemaCode:I})=>t.str`must NOT have ${"maxProperties"===b?"more":"fewer"} than ${I} properties`,params:({schemaCode:b})=>t._`{limit: ${b}}`},code(b){const{keyword:I,data:h,schemaCode:v}=b;b.fail$data(t._`Object.keys(${h}).length ${"maxProperties"===I?t.operators.GT:t.operators.LT} ${v}`)}}},44696(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(22984);r.default={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:b})=>t.str`must be multiple of ${b}`,params:({schemaCode:b})=>t._`{multipleOf: ${b}}`},code(b){const{gen:I,data:h,schemaCode:v,it:c}=b,m=c.opts.multipleOfPrecision,T=I.let("res"),y=m?t._`Math.abs(Math.round(${T}) - ${T}) > 1e-${m}`:t._`${T} !== parseInt(${T})`;b.fail$data(t._`(${v} === 0 || (${T} = ${h}/${v}, ${y}))`)}}},75363(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(47904),_=l(22984);r.default={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:I})=>_.str`must match pattern "${I}"`,params:({schemaCode:I})=>_._`{pattern: ${I}}`},code(I){const{data:h,$data:v,schema:c,schemaCode:m,it:T}=I,$=v?_._`(new RegExp(${m}, ${T.opts.unicodeRegExp?"u":""}))`:(0,t.usePattern)(I,c);I.fail$data(_._`!${$}.test(${h})`)}}},90620(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(47904),_=l(22984),E=l(73612);r.default={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:h}})=>_.str`must have required property '${h}'`,params:({params:{missingProperty:h}})=>_._`{missingProperty: ${h}}`},code(h){const{gen:v,schema:c,schemaCode:m,data:T,$data:y,it:$}=h,{opts:w}=$;if(!y&&0===c.length)return;const O=c.length>=w.loopRequired;if($.allErrors?function j(){if(O||y)h.block$data(_.nil,o);else for(const n of c)(0,t.checkReportMissingProp)(h,n)}():function p(){const n=v.let("missing");if(O||y){const d=v.let("valid",!0);h.block$data(d,()=>function S(n,d){h.setParams({missingProperty:n}),v.forOf(n,m,()=>{v.assign(d,(0,t.propertyInData)(v,T,n,w.ownProperties)),v.if((0,_.not)(d),()=>{h.error(),v.break()})},_.nil)}(n,d)),h.ok(d)}else v.if((0,t.checkMissingProp)(h,c,n)),(0,t.reportMissingProp)(h,n),v.else()}(),w.strictRequired){const n=h.parentSchema.properties,{definedProperties:d}=h.it;for(const k of c)void 0!==n?.[k]||d.has(k)||(0,E.checkStrictMode)($,`required property "${k}" is not defined at "${$.schemaEnv.baseId+$.errSchemaPath}" (strictRequired)`,$.opts.strictRequired)}function o(){v.forOf("prop",m,n=>{h.setParams({missingProperty:n}),v.if((0,t.noPropertyInData)(v,T,n,w.ownProperties),()=>h.error())})}}}},12112(Y,r,l){Object.defineProperty(r,"__esModule",{value:!0});const t=l(97465),_=l(22984),E=l(73612),b=l(17155);r.default={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:v,j:c}})=>_.str`must NOT have duplicate items (items ## ${c} and ${v} are identical)`,params:({params:{i:v,j:c}})=>_._`{i: ${v}, j: ${c}}`},code(v){const{gen:c,data:m,$data:T,schema:y,parentSchema:$,schemaCode:w,it:O}=v;if(!T&&!y)return;const j=c.let("valid"),p=$.items?(0,t.getSchemaTypes)($.items):[];function n(k,i){const g=c.name("item"),N=(0,t.checkDataTypes)(p,g,O.opts.strictNumbers,t.DataType.Wrong),L=c.const("indices",_._`{}`);c.for(_._`;${k}--;`,()=>{c.let(g,_._`${m}[${k}]`),c.if(N,_._`continue`),p.length>1&&c.if(_._`typeof ${g} == "string"`,_._`${g} += "_"`),c.if(_._`typeof ${L}[${g}] == "number"`,()=>{c.assign(i,_._`${L}[${g}]`),v.error(),c.assign(j,!1).break()}).code(_._`${L}[${g}] = ${k}`)})}function d(k,i){const g=(0,E.useFunc)(c,b.default),N=c.name("outer");c.label(N).for(_._`;${k}--;`,()=>c.for(_._`${i} = ${k}; ${i}--;`,()=>c.if(_._`${g}(${m}[${k}], ${m}[${i}])`,()=>{v.error(),c.assign(j,!1).break(N)})))}v.block$data(j,function o(){const k=c.let("i",_._`${m}.length`),i=c.let("j");v.setParams({i:k,j:i}),c.assign(j,!0),c.if(_._`${k} > 1`,()=>(function S(){return p.length>0&&!p.some(k=>"object"===k||"array"===k)}()?n:d)(k,i))},_._`${w} === false`),v.ok(j)}}},68986(Y){Y.exports=function r(l,t){if(l===t)return!0;if(l&&t&&"object"==typeof l&&"object"==typeof t){if(l.constructor!==t.constructor)return!1;var _,E,b;if(Array.isArray(l)){if((_=l.length)!=t.length)return!1;for(E=_;0!==E--;)if(!r(l[E],t[E]))return!1;return!0}if(l.constructor===RegExp)return l.source===t.source&&l.flags===t.flags;if(l.valueOf!==Object.prototype.valueOf)return l.valueOf()===t.valueOf();if(l.toString!==Object.prototype.toString)return l.toString()===t.toString();if((_=(b=Object.keys(l)).length)!==Object.keys(t).length)return!1;for(E=_;0!==E--;)if(!Object.prototype.hasOwnProperty.call(t,b[E]))return!1;for(E=_;0!==E--;){var I=b[E];if(!r(l[I],t[I]))return!1}return!0}return l!=l&&t!=t}},97915(Y){var r=Y.exports=function(_,E,b){"function"==typeof E&&(b=E,E={}),l(E,"function"==typeof(b=E.cb||b)?b:b.pre||function(){},b.post||function(){},_,"",_)};function l(_,E,b,I,h,v,c,m,T,y){if(I&&"object"==typeof I&&!Array.isArray(I)){for(var $ in E(I,h,v,c,m,T,y),I){var w=I[$];if(Array.isArray(w)){if($ in r.arrayKeywords)for(var O=0;O<w.length;O++)l(_,E,b,w[O],h+"/"+$+"/"+O,v,h,$,I,O)}else if($ in r.propsKeywords){if(w&&"object"==typeof w)for(var j in w)l(_,E,b,w[j],h+"/"+$+"/"+t(j),v,h,$,I,j)}else($ in r.keywords||_.allKeys&&!($ in r.skipKeywords))&&l(_,E,b,w,h+"/"+$,v,h,$,I)}b(I,h,v,c,m,T,y)}}function t(_){return _.replace(/~/g,"~0").replace(/\//g,"~1")}r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.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}},95484(Y,r,l){const{normalizeIPv6:t,removeDotSegments:_,recomposeAuthority:E,normalizeComponentEncoding:b,isIPv4:I,nonSimpleDomain:h}=l(3057),{SCHEMES:v,getSchemeHandler:c}=l(36128);function y(o,S,n,d){const k={};return d||(o=j(w(o,n),n),S=j(w(S,n),n)),!(n=n||{}).tolerant&&S.scheme?(k.scheme=S.scheme,k.userinfo=S.userinfo,k.host=S.host,k.port=S.port,k.path=_(S.path||""),k.query=S.query):(void 0!==S.userinfo||void 0!==S.host||void 0!==S.port?(k.userinfo=S.userinfo,k.host=S.host,k.port=S.port,k.path=_(S.path||""),k.query=S.query):(S.path?("/"===S.path[0]?k.path=_(S.path):(k.path=void 0===o.userinfo&&void 0===o.host&&void 0===o.port||o.path?o.path?o.path.slice(0,o.path.lastIndexOf("/")+1)+S.path:S.path:"/"+S.path,k.path=_(k.path)),k.query=S.query):(k.path=o.path,k.query=void 0!==S.query?S.query:o.query),k.userinfo=o.userinfo,k.host=o.host,k.port=o.port),k.scheme=o.scheme),k.fragment=S.fragment,k}function w(o,S){const n={host:o.host,scheme:o.scheme,userinfo:o.userinfo,port:o.port,path:o.path,query:o.query,nid:o.nid,nss:o.nss,uuid:o.uuid,fragment:o.fragment,reference:o.reference,resourceName:o.resourceName,secure:o.secure,error:""},d=Object.assign({},S),k=[],i=c(d.scheme||n.scheme);i&&i.serialize&&i.serialize(n,d),void 0!==n.path&&(d.skipEscape?n.path=unescape(n.path):(n.path=escape(n.path),void 0!==n.scheme&&(n.path=n.path.split("%3A").join(":")))),"suffix"!==d.reference&&n.scheme&&k.push(n.scheme,":");const g=E(n);if(void 0!==g&&("suffix"!==d.reference&&k.push("//"),k.push(g),n.path&&"/"!==n.path[0]&&k.push("/")),void 0!==n.path){let N=n.path;!d.absolutePath&&(!i||!i.absolutePath)&&(N=_(N)),void 0===g&&"/"===N[0]&&"/"===N[1]&&(N="/%2F"+N.slice(2)),k.push(N)}return void 0!==n.query&&k.push("?",n.query),void 0!==n.fragment&&k.push("#",n.fragment),k.join("")}const O=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function j(o,S){const n=Object.assign({},S),d={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let k=!1;"suffix"===n.reference&&(o=n.scheme?n.scheme+":"+o:"//"+o);const i=o.match(O);if(i){if(d.scheme=i[1],d.userinfo=i[3],d.host=i[4],d.port=parseInt(i[5],10),d.path=i[6]||"",d.query=i[7],d.fragment=i[8],isNaN(d.port)&&(d.port=i[5]),d.host)if(!1===I(d.host)){const L=t(d.host);d.host=L.host.toLowerCase(),k=L.isIPV6}else k=!0;d.reference=void 0!==d.scheme||void 0!==d.userinfo||void 0!==d.host||void 0!==d.port||void 0!==d.query||d.path?void 0===d.scheme?"relative":void 0===d.fragment?"absolute":"uri":"same-document",n.reference&&"suffix"!==n.reference&&n.reference!==d.reference&&(d.error=d.error||"URI is not a "+n.reference+" reference.");const g=c(n.scheme||d.scheme);if(!n.unicodeSupport&&(!g||!g.unicodeSupport)&&d.host&&(n.domainHost||g&&g.domainHost)&&!1===k&&h(d.host))try{d.host=URL.domainToASCII(d.host.toLowerCase())}catch(N){d.error=d.error||"Host's domain name can not be converted to ASCII: "+N}(!g||g&&!g.skipNormalize)&&(-1!==o.indexOf("%")&&(void 0!==d.scheme&&(d.scheme=unescape(d.scheme)),void 0!==d.host&&(d.host=unescape(d.host))),d.path&&(d.path=escape(unescape(d.path))),d.fragment&&(d.fragment=encodeURI(decodeURIComponent(d.fragment)))),g&&g.parse&&g.parse(d,n)}else d.error=d.error||"URI can not be parsed.";return d}const p={SCHEMES:v,normalize:function m(o,S){return"string"==typeof o?o=w(j(o,S),S):"object"==typeof o&&(o=j(w(o,S),S)),o},resolve:function T(o,S,n){const d=n?Object.assign({scheme:"null"},n):{scheme:"null"},k=y(j(o,d),j(S,d),d,!0);return d.skipEscape=!0,w(k,d)},resolveComponent:y,equal:function $(o,S,n){return"string"==typeof o?(o=unescape(o),o=w(b(j(o,n),!0),{...n,skipEscape:!0})):"object"==typeof o&&(o=w(b(o,!0),{...n,skipEscape:!0})),"string"==typeof S?(S=unescape(S),S=w(b(j(S,n),!0),{...n,skipEscape:!0})):"object"==typeof S&&(S=w(b(S,!0),{...n,skipEscape:!0})),o.toLowerCase()===S.toLowerCase()},serialize:w,parse:j};Y.exports=p,Y.exports.default=p,Y.exports.fastUri=p},36128(Y,r,l){const{isUUID:t}=l(3057),_=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,E=["http","https","ws","wss","urn","urn:uuid"];function I(i){return!0===i.secure||!1!==i.secure&&!!i.scheme&&!(3!==i.scheme.length||"w"!==i.scheme[0]&&"W"!==i.scheme[0]||"s"!==i.scheme[1]&&"S"!==i.scheme[1]||"s"!==i.scheme[2]&&"S"!==i.scheme[2])}function h(i){return i.host||(i.error=i.error||"HTTP URIs must have a host."),i}function v(i){const g="https"===String(i.scheme).toLowerCase();return(i.port===(g?443:80)||""===i.port)&&(i.port=void 0),i.path||(i.path="/"),i}const O={scheme:"http",domainHost:!0,parse:h,serialize:v},p={scheme:"ws",domainHost:!0,parse:function c(i){return i.secure=I(i),i.resourceName=(i.path||"/")+(i.query?"?"+i.query:""),i.path=void 0,i.query=void 0,i},serialize:function m(i){if((i.port===(I(i)?443:80)||""===i.port)&&(i.port=void 0),"boolean"==typeof i.secure&&(i.scheme=i.secure?"wss":"ws",i.secure=void 0),i.resourceName){const[g,N]=i.resourceName.split("?");i.path=g&&"/"!==g?g:void 0,i.query=N,i.resourceName=void 0}return i.fragment=void 0,i}},d={http:O,https:{scheme:"https",domainHost:O.domainHost,parse:h,serialize:v},ws:p,wss:{scheme:"wss",domainHost:p.domainHost,parse:p.parse,serialize:p.serialize},urn:{scheme:"urn",parse:function T(i,g){if(!i.path)return i.error="URN can not be parsed",i;const N=i.path.match(_);if(N){const L=g.scheme||i.scheme||"urn";i.nid=N[1].toLowerCase(),i.nss=N[2];const G=k(`${L}:${g.nid||i.nid}`);i.path=void 0,G&&(i=G.parse(i,g))}else i.error=i.error||"URN can not be parsed.";return i},serialize:function y(i,g){if(void 0===i.nid)throw new Error("URN without nid cannot be serialized");const N=g.scheme||i.scheme||"urn",L=i.nid.toLowerCase(),G=k(`${N}:${g.nid||L}`);G&&(i=G.serialize(i,g));const Q=i;return Q.path=`${L||g.nid}:${i.nss}`,g.skipEscape=!0,Q},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function $(i,g){const N=i;return N.uuid=N.nss,N.nss=void 0,!g.tolerant&&(!N.uuid||!t(N.uuid))&&(N.error=N.error||"UUID is not valid."),N},serialize:function w(i){const g=i;return g.nss=(i.uuid||"").toLowerCase(),g},skipNormalize:!0}};function k(i){return i&&(d[i]||d[i.toLowerCase()])||void 0}Object.setPrototypeOf(d,null),Y.exports={wsIsSecure:I,SCHEMES:d,isValidSchemeName:function b(i){return-1!==E.indexOf(i)},getSchemeHandler:k}},3057(Y){const r=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);function t(y){let $="",w=0,O=0;for(O=0;O<y.length;O++)if(w=y[O].charCodeAt(0),48!==w){if(!(w>=48&&w<=57||w>=65&&w<=70||w>=97&&w<=102))return"";$+=y[O];break}for(O+=1;O<y.length;O++){if(w=y[O].charCodeAt(0),!(w>=48&&w<=57||w>=65&&w<=70||w>=97&&w<=102))return"";$+=y[O]}return $}const _=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function E(y){return y.length=0,!0}function b(y,$,w){if(y.length){const O=t(y);if(""===O)return w.error=!0,!1;$.push(O),y.length=0}return!0}function h(y){if(function v(y,$){let w=0;for(let O=0;O<y.length;O++)y[O]===$&&w++;return w}(y,":")<2)return{host:y,isIPV6:!1};const $=function I(y){let $=0;const w={error:!1,address:"",zone:""},O=[],j=[];let p=!1,o=!1,S=b;for(let n=0;n<y.length;n++){const d=y[n];if("["!==d&&"]"!==d){if(":"===d){if(!0===p&&(o=!0),!S(j,O,w))break;if(++$>7){w.error=!0;break}n>0&&":"===y[n-1]&&(p=!0),O.push(":");continue}if("%"!==d){j.push(d);continue}if(!S(j,O,w))break;S=E}}return j.length&&(S===E?w.zone=j.join(""):O.push(o?j.join(""):t(j))),w.address=O.join(""),w}(y);if($.error)return{host:y,isIPV6:!1};{let w=$.address,O=$.address;return $.zone&&(w+="%"+$.zone,O+="%25"+$.zone),{host:w,isIPV6:!0,escapedHost:O}}}Y.exports={nonSimpleDomain:_,recomposeAuthority:function T(y){const $=[];if(void 0!==y.userinfo&&($.push(y.userinfo),$.push("@")),void 0!==y.host){let w=unescape(y.host);if(!l(w)){const O=h(w);w=!0===O.isIPV6?`[${O.escapedHost}]`:y.host}$.push(w)}return("number"==typeof y.port||"string"==typeof y.port)&&($.push(":"),$.push(String(y.port))),$.length?$.join(""):void 0},normalizeComponentEncoding:function m(y,$){const w=!0!==$?escape:unescape;return void 0!==y.scheme&&(y.scheme=w(y.scheme)),void 0!==y.userinfo&&(y.userinfo=w(y.userinfo)),void 0!==y.host&&(y.host=w(y.host)),void 0!==y.path&&(y.path=w(y.path)),void 0!==y.query&&(y.query=w(y.query)),void 0!==y.fragment&&(y.fragment=w(y.fragment)),y},removeDotSegments:function c(y){let $=y;const w=[];let O=-1,j=0;for(;j=$.length;){if(1===j){if("."===$)break;if("/"===$){w.push("/");break}w.push($);break}if(2===j){if("."===$[0]){if("."===$[1])break;if("/"===$[1]){$=$.slice(2);continue}}else if("/"===$[0]&&("."===$[1]||"/"===$[1])){w.push("/");break}}else if(3===j&&"/.."===$){0!==w.length&&w.pop(),w.push("/");break}if("."===$[0]){if("."===$[1]){if("/"===$[2]){$=$.slice(3);continue}}else if("/"===$[1]){$=$.slice(2);continue}}else if("/"===$[0]&&"."===$[1]){if("/"===$[2]){$=$.slice(2);continue}if("."===$[2]&&"/"===$[3]){$=$.slice(3),0!==w.length&&w.pop();continue}}if(-1===(O=$.indexOf("/",1))){w.push($);break}w.push($.slice(0,O)),$=$.slice(O)}return w.join("")},isIPv4:l,isUUID:r,normalizeIPv6:h,stringArrayToHexStripped:t}},53632(Y,r,l){l.r(r),l.d(r,{Client:()=>rr,getSupportedElicitationModes:()=>Xe});var t=l(10467),_=l(56218),E=l(10600),b=l(76912);function c(u){return!!u._zod}function T(u,e){return c(u)?b.xL(u,e):u.safeParse(e)}function w(u){if(!u)return;let e;if(e=c(u)?u._zod?.def?.shape:u.shape,e){if("function"==typeof e)try{return e()}catch{return}return e}}var n=l(46442);function d(u){return"completed"===u||"failed"===u||"cancelled"===u}function We(u){const s=w(u)?.method;if(!s)throw new Error("Schema is missing a method literal");const a=function S(u){if(c(u)){const V=u._zod?.def;if(V){if(void 0!==V.value)return V.value;if(Array.isArray(V.values)&&V.values.length>0)return V.values[0]}}const s=u._def;if(s){if(void 0!==s.value)return s.value;if(Array.isArray(s.values)&&s.values.length>0)return s.values[0]}const a=u.value;if(void 0!==a)return a}(s);if("string"!=typeof a)throw new Error("Schema method literal must be a string");return a}function Be(u,e){const s=T(u,e);if(!s.success)throw s.error;return s.data}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");class Gt{constructor(e){var s=this;this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(n.Sq,a=>{this._oncancel(a)}),this.setNotificationHandler(n._r,a=>{this._onprogress(a)}),this.setRequestHandler(n.tC,a=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(n.Ql,function(){var a=(0,t.A)(function*(R,V){const z=yield s._taskStore.getTask(R.params.taskId,V.sessionId);if(!z)throw new n.Nh(n.O4.InvalidParams,"Failed to retrieve task: Task not found");return{...z}});return function(R,V){return a.apply(this,arguments)}}()),this.setRequestHandler(n.oQ,function(){var a=(0,t.A)(function*(R,V){const z=function(){var Z=(0,t.A)(function*(){const K=R.params.taskId;if(s._taskMessageQueue){let se;for(;se=yield s._taskMessageQueue.dequeue(K,V.sessionId);){if("response"===se.type||"error"===se.type){const ce=se.message,ee=ce.id,ae=s._requestResolvers.get(ee);ae?(s._requestResolvers.delete(ee),ae("response"===se.type?ce:new n.Nh(ce.error.code,ce.error.message,ce.error.data))):s._onerror(new Error(`${"response"===se.type?"Response":"Error"} handler missing for request ${ee}`));continue}yield s._transport?.send(se.message,{relatedRequestId:V.requestId})}}const oe=yield s._taskStore.getTask(K,V.sessionId);if(!oe)throw new n.Nh(n.O4.InvalidParams,`Task not found: ${K}`);if(!d(oe.status))return yield s._waitForTaskUpdate(K,V.signal),yield z();if(d(oe.status)){const se=yield s._taskStore.getTaskResult(K,V.sessionId);return s._clearTaskQueue(K),{...se,_meta:{...se._meta,[n.EV]:{taskId:K}}}}return yield z()});return function(){return Z.apply(this,arguments)}}();return yield z()});return function(R,V){return a.apply(this,arguments)}}()),this.setRequestHandler(n.zR,function(){var a=(0,t.A)(function*(R,V){try{const{tasks:z,nextCursor:Z}=yield s._taskStore.listTasks(R.params?.cursor,V.sessionId);return{tasks:z,nextCursor:Z,_meta:{}}}catch(z){throw new n.Nh(n.O4.InvalidParams,`Failed to list tasks: ${z instanceof Error?z.message:String(z)}`)}});return function(R,V){return a.apply(this,arguments)}}()),this.setRequestHandler(n.gd,function(){var a=(0,t.A)(function*(R,V){try{const z=yield s._taskStore.getTask(R.params.taskId,V.sessionId);if(!z)throw new n.Nh(n.O4.InvalidParams,`Task not found: ${R.params.taskId}`);if(d(z.status))throw new n.Nh(n.O4.InvalidParams,`Cannot cancel task in terminal status: ${z.status}`);yield s._taskStore.updateTaskStatus(R.params.taskId,"cancelled","Client cancelled task execution.",V.sessionId),s._clearTaskQueue(R.params.taskId);const Z=yield s._taskStore.getTask(R.params.taskId,V.sessionId);if(!Z)throw new n.Nh(n.O4.InvalidParams,`Task not found after cancellation: ${R.params.taskId}`);return{_meta:{},...Z}}catch(z){throw z instanceof n.Nh?z:new n.Nh(n.O4.InvalidRequest,`Failed to cancel task: ${z instanceof Error?z.message:String(z)}`)}});return function(R,V){return a.apply(this,arguments)}}()))}_oncancel(e){var s=this;return(0,t.A)(function*(){e.params.requestId&&s._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)})()}_setupTimeout(e,s,a,R,V=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(R,s),startTime:Date.now(),timeout:s,maxTotalTimeout:a,resetTimeoutOnProgress:V,onTimeout:R})}_resetTimeout(e){const s=this._timeoutInfo.get(e);if(!s)return!1;const a=Date.now()-s.startTime;if(s.maxTotalTimeout&&a>=s.maxTotalTimeout)throw this._timeoutInfo.delete(e),n.Nh.fromError(n.O4.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:s.maxTotalTimeout,totalElapsed:a});return clearTimeout(s.timeoutId),s.timeoutId=setTimeout(s.onTimeout,s.timeout),!0}_cleanupTimeout(e){const s=this._timeoutInfo.get(e);s&&(clearTimeout(s.timeoutId),this._timeoutInfo.delete(e))}connect(e){var s=this;return(0,t.A)(function*(){if(s._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");s._transport=e;const a=s.transport?.onclose;s._transport.onclose=()=>{a?.(),s._onclose()};const R=s.transport?.onerror;s._transport.onerror=z=>{R?.(z),s._onerror(z)};const V=s._transport?.onmessage;s._transport.onmessage=(z,Z)=>{V?.(z,Z),(0,n.ig)(z)||(0,n.LW)(z)?s._onresponse(z):(0,n.vo)(z)?s._onrequest(z,Z):(0,n.lg)(z)?s._onnotification(z):s._onerror(new Error(`Unknown message type: ${JSON.stringify(z)}`))},yield s._transport.start()})()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const a of this._requestHandlerAbortControllers.values())a.abort();this._requestHandlerAbortControllers.clear();const s=n.Nh.fromError(n.O4.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const a of e.values())a(s)}_onerror(e){this.onerror?.(e)}_onnotification(e){const s=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;void 0!==s&&Promise.resolve().then(()=>s(e)).catch(a=>this._onerror(new Error(`Uncaught error in notification handler: ${a}`)))}_onrequest(e,s){var a=this;const R=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,V=this._transport,z=e.params?._meta?.[n.EV]?.taskId;if(void 0===R){const ce={jsonrpc:"2.0",id:e.id,error:{code:n.O4.MethodNotFound,message:"Method not found"}};return void(z&&this._taskMessageQueue?this._enqueueTaskMessage(z,{type:"error",message:ce,timestamp:Date.now()},V?.sessionId).catch(ee=>this._onerror(new Error(`Failed to enqueue error response: ${ee}`))):V?.send(ce).catch(ee=>this._onerror(new Error(`Failed to send an error response: ${ee}`))))}const Z=new AbortController;this._requestHandlerAbortControllers.set(e.id,Z);const K=(0,n.bZ)(e.params)?e.params.task:void 0,oe=this._taskStore?this.requestTaskStore(e,V?.sessionId):void 0,se={signal:Z.signal,sessionId:V?.sessionId,_meta:e.params?._meta,sendNotification:(ce=(0,t.A)(function*(ee){if(Z.signal.aborted)return;const ae={relatedRequestId:e.id};z&&(ae.relatedTask={taskId:z}),yield a.notification(ee,ae)}),function(ae){return ce.apply(this,arguments)}),sendRequest:function(){var ce=(0,t.A)(function*(ee,ae,pe){if(Z.signal.aborted)throw new n.Nh(n.O4.ConnectionClosed,"Request was cancelled");const ye={...pe,relatedRequestId:e.id};z&&!ye.relatedTask&&(ye.relatedTask={taskId:z});const Pe=ye.relatedTask?.taskId??z;return Pe&&oe&&(yield oe.updateTaskStatus(Pe,"input_required")),yield a.request(ee,ae,ye)});return function(ae,pe,ye){return ce.apply(this,arguments)}}(),authInfo:s?.authInfo,requestId:e.id,requestInfo:s?.requestInfo,taskId:z,taskStore:oe,taskRequestedTtl:K?.ttl,closeSSEStream:s?.closeSSEStream,closeStandaloneSSEStream:s?.closeStandaloneSSEStream};var ce;Promise.resolve().then(()=>{K&&this.assertTaskHandlerCapability(e.method)}).then(()=>R(e,se)).then(function(){var ce=(0,t.A)(function*(ee){if(Z.signal.aborted)return;const ae={result:ee,jsonrpc:"2.0",id:e.id};z&&a._taskMessageQueue?yield a._enqueueTaskMessage(z,{type:"response",message:ae,timestamp:Date.now()},V?.sessionId):yield V?.send(ae)});return function(ee){return ce.apply(this,arguments)}}(),function(){var ce=(0,t.A)(function*(ee){if(Z.signal.aborted)return;const ae={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(ee.code)?ee.code:n.O4.InternalError,message:ee.message??"Internal error",...void 0!==ee.data&&{data:ee.data}}};z&&a._taskMessageQueue?yield a._enqueueTaskMessage(z,{type:"error",message:ae,timestamp:Date.now()},V?.sessionId):yield V?.send(ae)});return function(ee){return ce.apply(this,arguments)}}()).catch(ce=>this._onerror(new Error(`Failed to send response: ${ce}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:s,...a}=e.params,R=Number(s),V=this._progressHandlers.get(R);if(!V)return void this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));const z=this._responseHandlers.get(R),Z=this._timeoutInfo.get(R);if(Z&&z&&Z.resetTimeoutOnProgress)try{this._resetTimeout(R)}catch(K){return this._responseHandlers.delete(R),this._progressHandlers.delete(R),this._cleanupTimeout(R),void z(K)}V(a)}_onresponse(e){const s=Number(e.id),a=this._requestResolvers.get(s);if(a)return this._requestResolvers.delete(s),void((0,n.ig)(e)?a(e):a(new n.Nh(e.error.code,e.error.message,e.error.data)));const R=this._responseHandlers.get(s);if(void 0===R)return void this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));this._responseHandlers.delete(s),this._cleanupTimeout(s);let V=!1;if((0,n.ig)(e)&&e.result&&"object"==typeof e.result){const z=e.result;if(z.task&&"object"==typeof z.task){const Z=z.task;"string"==typeof Z.taskId&&(V=!0,this._taskProgressTokens.set(Z.taskId,s))}}V||this._progressHandlers.delete(s),(0,n.ig)(e)?R(e):R(n.Nh.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}close(){var e=this;return(0,t.A)(function*(){yield e._transport?.close()})()}requestStream(e,s,a){var R=this;return(0,E.A)(function*(){const{task:V}=a??{};if(!V){try{yield{type:"result",result:yield(0,_.A)(R.request(e,s,a))}}catch(Z){yield{type:"error",error:Z instanceof n.Nh?Z:new n.Nh(n.O4.InternalError,String(Z))}}return}let z;try{const Z=yield(0,_.A)(R.request(e,n.Mg,a));if(!Z.task)throw new n.Nh(n.O4.InternalError,"Task creation did not return a task");for(z=Z.task.taskId,yield{type:"taskCreated",task:Z.task};;){const K=yield(0,_.A)(R.getTask({taskId:z},a));if(yield{type:"taskStatus",task:K},d(K.status))return void("completed"===K.status?yield{type:"result",result:yield(0,_.A)(R.getTaskResult({taskId:z},s,a))}:"failed"===K.status?yield{type:"error",error:new n.Nh(n.O4.InternalError,`Task ${z} failed`)}:"cancelled"===K.status&&(yield{type:"error",error:new n.Nh(n.O4.InternalError,`Task ${z} was cancelled`)}));if("input_required"===K.status)return void(yield{type:"result",result:yield(0,_.A)(R.getTaskResult({taskId:z},s,a))});const oe=K.pollInterval??R._options?.defaultTaskPollInterval??1e3;yield(0,_.A)(new Promise(se=>setTimeout(se,oe))),a?.signal?.throwIfAborted()}}catch(Z){yield{type:"error",error:Z instanceof n.Nh?Z:new n.Nh(n.O4.InternalError,String(Z))}}})()}request(e,s,a){const{relatedRequestId:R,resumptionToken:V,onresumptiontoken:z,task:Z,relatedTask:K}=a??{};return new Promise((oe,se)=>{const ce=de=>{se(de)};if(!this._transport)return void ce(new Error("Not connected"));if(!0===this._options?.enforceStrictCapabilities)try{this.assertCapabilityForMethod(e.method),Z&&this.assertTaskCapability(e.method)}catch(de){return void ce(de)}a?.signal?.throwIfAborted();const ee=this._requestMessageId++,ae={...e,jsonrpc:"2.0",id:ee};a?.onprogress&&(this._progressHandlers.set(ee,a.onprogress),ae.params={...e.params,_meta:{...e.params?._meta||{},progressToken:ee}}),Z&&(ae.params={...ae.params,task:Z}),K&&(ae.params={...ae.params,_meta:{...ae.params?._meta||{},[n.EV]:K}});const pe=de=>{this._responseHandlers.delete(ee),this._progressHandlers.delete(ee),this._cleanupTimeout(ee),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:ee,reason:String(de)}},{relatedRequestId:R,resumptionToken:V,onresumptiontoken:z}).catch(Ee=>this._onerror(new Error(`Failed to send cancellation: ${Ee}`)));const we=de instanceof n.Nh?de:new n.Nh(n.O4.RequestTimeout,String(de));se(we)};this._responseHandlers.set(ee,de=>{if(!a?.signal?.aborted){if(de instanceof Error)return se(de);try{const we=T(s,de.result);we.success?oe(we.data):se(we.error)}catch(we){se(we)}}}),a?.signal?.addEventListener("abort",()=>{pe(a?.signal?.reason)});const ye=a?.timeout??6e4;this._setupTimeout(ee,ye,a?.maxTotalTimeout,()=>pe(n.Nh.fromError(n.O4.RequestTimeout,"Request timed out",{timeout:ye})),a?.resetTimeoutOnProgress??!1);const me=K?.taskId;me?(this._requestResolvers.set(ee,we=>{const Ee=this._responseHandlers.get(ee);Ee?Ee(we):this._onerror(new Error(`Response handler missing for side-channeled request ${ee}`))}),this._enqueueTaskMessage(me,{type:"request",message:ae,timestamp:Date.now()}).catch(we=>{this._cleanupTimeout(ee),se(we)})):this._transport.send(ae,{relatedRequestId:R,resumptionToken:V,onresumptiontoken:z}).catch(de=>{this._cleanupTimeout(ee),se(de)})})}getTask(e,s){var a=this;return(0,t.A)(function*(){return a.request({method:"tasks/get",params:e},n.Sc,s)})()}getTaskResult(e,s,a){var R=this;return(0,t.A)(function*(){return R.request({method:"tasks/result",params:e},s,a)})()}listTasks(e,s){var a=this;return(0,t.A)(function*(){return a.request({method:"tasks/list",params:e},n.a5,s)})()}cancelTask(e,s){var a=this;return(0,t.A)(function*(){return a.request({method:"tasks/cancel",params:e},n.gH,s)})()}notification(e,s){var a=this;return(0,t.A)(function*(){if(!a._transport)throw new Error("Not connected");a.assertNotificationCapability(e.method);const R=s?.relatedTask?.taskId;if(R){const K={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[n.EV]:s.relatedTask}}};return void(yield a._enqueueTaskMessage(R,{type:"notification",message:K,timestamp:Date.now()}))}if((a._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!s?.relatedRequestId&&!s?.relatedTask){if(a._pendingDebouncedNotifications.has(e.method))return;return a._pendingDebouncedNotifications.add(e.method),void Promise.resolve().then(()=>{if(a._pendingDebouncedNotifications.delete(e.method),!a._transport)return;let K={...e,jsonrpc:"2.0"};s?.relatedTask&&(K={...K,params:{...K.params,_meta:{...K.params?._meta||{},[n.EV]:s.relatedTask}}}),a._transport?.send(K,s).catch(oe=>a._onerror(oe))})}let Z={...e,jsonrpc:"2.0"};s?.relatedTask&&(Z={...Z,params:{...Z.params,_meta:{...Z.params?._meta||{},[n.EV]:s.relatedTask}}}),yield a._transport.send(Z,s)})()}setRequestHandler(e,s){const a=We(e);this.assertRequestHandlerCapability(a),this._requestHandlers.set(a,(R,V)=>{const z=Be(e,R);return Promise.resolve(s(z,V))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,s){const a=We(e);this._notificationHandlers.set(a,R=>{const V=Be(e,R);return Promise.resolve(s(V))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const s=this._taskProgressTokens.get(e);void 0!==s&&(this._progressHandlers.delete(s),this._taskProgressTokens.delete(e))}_enqueueTaskMessage(e,s,a){var R=this;return(0,t.A)(function*(){if(!R._taskStore||!R._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const V=R._options?.maxTaskQueueSize;yield R._taskMessageQueue.enqueue(e,s,a,V)})()}_clearTaskQueue(e,s){var a=this;return(0,t.A)(function*(){if(a._taskMessageQueue){const R=yield a._taskMessageQueue.dequeueAll(e,s);for(const V of R)if("request"===V.type&&(0,n.vo)(V.message)){const z=V.message.id,Z=a._requestResolvers.get(z);Z?(Z(new n.Nh(n.O4.InternalError,"Task cancelled or completed")),a._requestResolvers.delete(z)):a._onerror(new Error(`Resolver missing for request ${z} during task ${e} cleanup`))}}})()}_waitForTaskUpdate(e,s){var a=this;return(0,t.A)(function*(){let R=a._options?.defaultTaskPollInterval??1e3;try{const V=yield a._taskStore?.getTask(e);V?.pollInterval&&(R=V.pollInterval)}catch{}return new Promise((V,z)=>{if(s.aborted)return void z(new n.Nh(n.O4.InvalidRequest,"Request cancelled"));const Z=setTimeout(V,R);s.addEventListener("abort",()=>{clearTimeout(Z),z(new n.Nh(n.O4.InvalidRequest,"Request cancelled"))},{once:!0})})})()}requestTaskStore(e,s){var a=this;const R=this._taskStore;if(!R)throw new Error("No task store configured");return{createTask:(V=(0,t.A)(function*(z){if(!e)throw new Error("No request provided");return yield R.createTask(z,e.id,{method:e.method,params:e.params},s)}),function(Z){return V.apply(this,arguments)}),getTask:function(){var V=(0,t.A)(function*(z){const Z=yield R.getTask(z,s);if(!Z)throw new n.Nh(n.O4.InvalidParams,"Failed to retrieve task: Task not found");return Z});return function(Z){return V.apply(this,arguments)}}(),storeTaskResult:function(){var V=(0,t.A)(function*(z,Z,K){yield R.storeTaskResult(z,Z,K,s);const oe=yield R.getTask(z,s);if(oe){const se=n.ki.parse({method:"notifications/tasks/status",params:oe});yield a.notification(se),d(oe.status)&&a._cleanupTaskProgressHandler(z)}});return function(Z,K,oe){return V.apply(this,arguments)}}(),getTaskResult:V=>R.getTaskResult(V,s),updateTaskStatus:function(){var V=(0,t.A)(function*(z,Z,K){const oe=yield R.getTask(z,s);if(!oe)throw new n.Nh(n.O4.InvalidParams,`Task "${z}" not found - it may have been cleaned up`);if(d(oe.status))throw new n.Nh(n.O4.InvalidParams,`Cannot update task "${z}" from terminal status "${oe.status}" to "${Z}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);yield R.updateTaskStatus(z,Z,K,s);const se=yield R.getTask(z,s);if(se){const ce=n.ki.parse({method:"notifications/tasks/status",params:se});yield a.notification(ce),d(se.status)&&a._cleanupTaskProgressHandler(z)}});return function(Z,K,oe){return V.apply(this,arguments)}}(),listTasks:V=>R.listTasks(V,s)};var V}}function Ye(u){return null!==u&&"object"==typeof u&&!Array.isArray(u)}var Qt=l(51435),Wt=l(71011);class Yt{constructor(e){this._ajv=e??function Bt(){const u=new Qt({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Wt(u),u}()}getValidator(e){const s="$id"in e&&"string"==typeof e.$id?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return a=>s(a)?{valid:!0,data:a,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(s.errors)}}}var Xt=l(19495);class xt{constructor(e){this._client=e}callToolStream(e){var s=this;return(0,E.A)(function*(a,R=n.TF,V){const z=s._client,Z={...V,task:V?.task??(z.isToolTask(a.name)?{}:void 0)},K=z.requestStream({method:"tools/call",params:a},R,Z),oe=z.getToolOutputValidator(a.name);var ee,se=!1,ce=!1;try{for(var pe,ae=(0,Xt.A)(K);se=!(pe=yield(0,_.A)(ae.next())).done;se=!1){const ye=pe.value;if("result"===ye.type&&oe){const Pe=ye.result;if(!Pe.structuredContent&&!Pe.isError)return void(yield{type:"error",error:new n.Nh(n.O4.InvalidRequest,`Tool ${a.name} has an output schema but did not return structured content`)});if(Pe.structuredContent)try{const me=oe(Pe.structuredContent);if(!me.valid)return void(yield{type:"error",error:new n.Nh(n.O4.InvalidParams,`Structured content does not match the tool's output schema: ${me.errorMessage}`)})}catch(me){return me instanceof n.Nh?void(yield{type:"error",error:me}):void(yield{type:"error",error:new n.Nh(n.O4.InvalidParams,`Failed to validate structured content: ${me instanceof Error?me.message:String(me)}`)})}}yield ye}}catch(ye){ce=!0,ee=ye}finally{try{se&&null!=ae.return&&(yield(0,_.A)(ae.return()))}finally{if(ce)throw ee}}}).apply(this,arguments)}getTask(e,s){var a=this;return(0,t.A)(function*(){return a._client.getTask({taskId:e},s)})()}getTaskResult(e,s,a){var R=this;return(0,t.A)(function*(){return R._client.getTaskResult({taskId:e},s,a)})()}listTasks(e,s){var a=this;return(0,t.A)(function*(){return a._client.listTasks(e?{cursor:e}:void 0,s)})()}cancelTask(e,s){var a=this;return(0,t.A)(function*(){return a._client.cancelTask({taskId:e},s)})()}requestStream(e,s,a){return this._client.requestStream(e,s,a)}}function Ve(u,e){if(u&&null!==e&&"object"==typeof e){if("object"===u.type&&u.properties&&"object"==typeof u.properties){const s=e,a=u.properties;for(const R of Object.keys(a)){const V=a[R];void 0===s[R]&&Object.prototype.hasOwnProperty.call(V,"default")&&(s[R]=V.default),void 0!==s[R]&&Ve(V,s[R])}}if(Array.isArray(u.anyOf))for(const s of u.anyOf)"boolean"!=typeof s&&Ve(s,e);if(Array.isArray(u.oneOf))for(const s of u.oneOf)"boolean"!=typeof s&&Ve(s,e)}}function Xe(u){if(!u)return{supportsFormMode:!1,supportsUrlMode:!1};const e=void 0!==u.form,s=void 0!==u.url;return{supportsFormMode:e||!e&&!s,supportsUrlMode:s}}class rr extends Gt{constructor(e,s){super(s),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=s?.capabilities??{},this._jsonSchemaValidator=s?.jsonSchemaValidator??new Yt,s?.listChanged&&(this._pendingListChangedConfig=s.listChanged)}_setupListChangedHandlers(e){var s=this;e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",n.fH,e.tools,(0,t.A)(function*(){return(yield s.listTools()).tools})),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",n.br,e.prompts,(0,t.A)(function*(){return(yield s.listPrompts()).prompts})),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",n.hh,e.resources,(0,t.A)(function*(){return(yield s.listResources()).resources}))}get experimental(){return this._experimental||(this._experimental={tasks:new xt(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=function Jt(u,e){const s={...u};for(const a in e){const R=a,V=e[R];if(void 0===V)continue;const z=s[R];s[R]=Ye(z)&&Ye(V)?{...z,...V}:V}return s}(this._capabilities,e)}setRequestHandler(e,s){var a=this;const V=w(e)?.method;if(!V)throw new Error("Schema is missing a method literal");let z;if(c(V)){const K=V;z=K._zod?.def?.value??K.value}else{const K=V;z=K._def?.value??K.value}if("string"!=typeof z)throw new Error("Schema method literal must be a string");const Z=z;if("elicitation/create"===Z){const K=function(){var oe=(0,t.A)(function*(se,ce){const ee=T(n.$9,se);if(!ee.success){const Ee=ee.error instanceof Error?ee.error.message:String(ee.error);throw new n.Nh(n.O4.InvalidParams,`Invalid elicitation request: ${Ee}`)}const{params:ae}=ee.data;ae.mode=ae.mode??"form";const{supportsFormMode:pe,supportsUrlMode:ye}=Xe(a._capabilities.elicitation);if("form"===ae.mode&&!pe)throw new n.Nh(n.O4.InvalidParams,"Client does not support form-mode elicitation requests");if("url"===ae.mode&&!ye)throw new n.Nh(n.O4.InvalidParams,"Client does not support URL-mode elicitation requests");const Pe=yield Promise.resolve(s(se,ce));if(ae.task){const Ee=T(n.Mg,Pe);if(!Ee.success){const nr=Ee.error instanceof Error?Ee.error.message:String(Ee.error);throw new n.Nh(n.O4.InvalidParams,`Invalid task creation result: ${nr}`)}return Ee.data}const me=T(n.n_,Pe);if(!me.success){const Ee=me.error instanceof Error?me.error.message:String(me.error);throw new n.Nh(n.O4.InvalidParams,`Invalid elicitation result: ${Ee}`)}const de=me.data,we="form"===ae.mode?ae.requestedSchema:void 0;if("form"===ae.mode&&"accept"===de.action&&de.content&&we&&a._capabilities.elicitation?.form?.applyDefaults)try{Ve(we,de.content)}catch{}return de});return function(ce,ee){return oe.apply(this,arguments)}}();return super.setRequestHandler(e,K)}if("sampling/createMessage"===Z){const K=function(){var oe=(0,t.A)(function*(se,ce){const ee=T(n.u9,se);if(!ee.success){const de=ee.error instanceof Error?ee.error.message:String(ee.error);throw new n.Nh(n.O4.InvalidParams,`Invalid sampling request: ${de}`)}const{params:ae}=ee.data,pe=yield Promise.resolve(s(se,ce));if(ae.task){const de=T(n.Mg,pe);if(!de.success){const we=de.error instanceof Error?de.error.message:String(de.error);throw new n.Nh(n.O4.InvalidParams,`Invalid task creation result: ${we}`)}return de.data}const me=T(ae.tools||ae.toolChoice?n.TI:n.K1,pe);if(!me.success){const de=me.error instanceof Error?me.error.message:String(me.error);throw new n.Nh(n.O4.InvalidParams,`Invalid sampling result: ${de}`)}return me.data});return function(ce,ee){return oe.apply(this,arguments)}}();return super.setRequestHandler(e,K)}return super.setRequestHandler(e,s)}assertCapability(e,s){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${s})`)}connect(e,s){var a=()=>super.connect,R=this;return(0,t.A)(function*(){if(yield a().call(R,e),void 0===e.sessionId)try{const V=yield R.request({method:"initialize",params:{protocolVersion:n.aE,capabilities:R._capabilities,clientInfo:R._clientInfo}},n.Rk,s);if(void 0===V)throw new Error(`Server sent invalid initialize result: ${V}`);if(!n.Iu.includes(V.protocolVersion))throw new Error(`Server's protocol version is not supported: ${V.protocolVersion}`);R._serverCapabilities=V.capabilities,R._serverVersion=V.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(V.protocolVersion),R._instructions=V.instructions,yield R.notification({method:"notifications/initialized"}),R._pendingListChangedConfig&&(R._setupListChangedHandlers(R._pendingListChangedConfig),R._pendingListChangedConfig=void 0)}catch(V){throw R.close(),V}})()}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if("resources/subscribe"===e&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`)}}assertNotificationCapability(e){if("notifications/roots/list_changed"===e&&!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`)}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`)}}assertTaskCapability(e){!function er(u,e,s){if(!u)throw new Error(`${s} does not support task creation (required for ${e})`);if("tools/call"===e&&!u.tools?.call)throw new Error(`${s} does not support task creation for tools/call (required for ${e})`)}(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&function tr(u,e,s){if(!u)throw new Error(`${s} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!u.sampling?.createMessage)throw new Error(`${s} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!u.elicitation?.create)throw new Error(`${s} does not support task creation for elicitation/create (required for ${e})`)}}(this._capabilities.tasks?.requests,e,"Client")}ping(e){var s=this;return(0,t.A)(function*(){return s.request({method:"ping"},n.wR,e)})()}complete(e,s){var a=this;return(0,t.A)(function*(){return a.request({method:"completion/complete",params:e},n.GU,s)})()}setLoggingLevel(e,s){var a=this;return(0,t.A)(function*(){return a.request({method:"logging/setLevel",params:{level:e}},n.wR,s)})()}getPrompt(e,s){var a=this;return(0,t.A)(function*(){return a.request({method:"prompts/get",params:e},n.HM,s)})()}listPrompts(e,s){var a=this;return(0,t.A)(function*(){return a.request({method:"prompts/list",params:e},n.Yu,s)})()}listResources(e,s){var a=this;return(0,t.A)(function*(){return a.request({method:"resources/list",params:e},n.cv,s)})()}listResourceTemplates(e,s){var a=this;return(0,t.A)(function*(){return a.request({method:"resources/templates/list",params:e},n.O$,s)})()}readResource(e,s){var a=this;return(0,t.A)(function*(){return a.request({method:"resources/read",params:e},n.ve,s)})()}subscribeResource(e,s){var a=this;return(0,t.A)(function*(){return a.request({method:"resources/subscribe",params:e},n.wR,s)})()}unsubscribeResource(e,s){var a=this;return(0,t.A)(function*(){return a.request({method:"resources/unsubscribe",params:e},n.wR,s)})()}callTool(e){var s=this;return(0,t.A)(function*(a,R=n.TF,V){if(s.isToolTaskRequired(a.name))throw new n.Nh(n.O4.InvalidRequest,`Tool "${a.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const z=yield s.request({method:"tools/call",params:a},R,V),Z=s.getToolOutputValidator(a.name);if(Z){if(!z.structuredContent&&!z.isError)throw new n.Nh(n.O4.InvalidRequest,`Tool ${a.name} has an output schema but did not return structured content`);if(z.structuredContent)try{const K=Z(z.structuredContent);if(!K.valid)throw new n.Nh(n.O4.InvalidParams,`Structured content does not match the tool's output schema: ${K.errorMessage}`)}catch(K){throw K instanceof n.Nh?K:new n.Nh(n.O4.InvalidParams,`Failed to validate structured content: ${K instanceof Error?K.message:String(K)}`)}}return z}).apply(this,arguments)}isToolTask(e){return!!this._serverCapabilities?.tasks?.requests?.tools?.call&&this._cachedKnownTaskTools.has(e)}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const s of e){if(s.outputSchema){const R=this._jsonSchemaValidator.getValidator(s.outputSchema);this._cachedToolOutputValidators.set(s.name,R)}const a=s.execution?.taskSupport;("required"===a||"optional"===a)&&this._cachedKnownTaskTools.add(s.name),"required"===a&&this._cachedRequiredTaskTools.add(s.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}listTools(e,s){var a=this;return(0,t.A)(function*(){const R=yield a.request({method:"tools/list",params:e},n.WT,s);return a.cacheToolMetadata(R.tools),R})()}_setupListChangedHandler(e,s,a,R){const V=n.xI.safeParse(a);if(!V.success)throw new Error(`Invalid ${e} listChanged options: ${V.error.message}`);if("function"!=typeof a.onChanged)throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:z,debounceMs:Z}=V.data,{onChanged:K}=a,oe=function(){var ce=(0,t.A)(function*(){if(z)try{const ee=yield R();K(null,ee)}catch(ee){const ae=ee instanceof Error?ee:new Error(String(ee));K(ae,null)}else K(null,null)});return function(){return ce.apply(this,arguments)}}();this.setNotificationHandler(s,()=>{if(Z){const ce=this._listChangedDebounceTimers.get(e);ce&&clearTimeout(ce);const ee=setTimeout(oe,Z);this._listChangedDebounceTimers.set(e,ee)}else oe()})}sendRootsListChanged(){var e=this;return(0,t.A)(function*(){return e.notification({method:"notifications/roots/list_changed"})})()}}},70545(Y){Y.exports=JSON.parse('{"$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":false}')},7595(Y){Y.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')}}]);