article-content-renderer-vue2 0.5.0 → 0.5.2

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/dist/index.cjs CHANGED
@@ -1,8 +1,8 @@
1
- "use strict";var Ys=Object.defineProperty,Ws=Object.defineProperties;var Zs=Object.getOwnPropertyDescriptors;var $n=Object.getOwnPropertySymbols;var Xs=Object.prototype.hasOwnProperty,ei=Object.prototype.propertyIsEnumerable;var Wt=(e,t,r)=>t in e?Ys(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,K=(e,t)=>{for(var r in t||(t={}))Xs.call(t,r)&&Wt(e,r,t[r]);if($n)for(var r of $n(t))ei.call(t,r)&&Wt(e,r,t[r]);return e},oe=(e,t)=>Ws(e,Zs(t));var he=(e,t,r)=>Wt(e,typeof t!="symbol"?t+"":t,r);var Ye=(e,t,r)=>new Promise((n,s)=>{var i=c=>{try{a(r.next(c))}catch(d){s(d)}},o=c=>{try{a(r.throw(c))}catch(d){s(d)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(i,o);a((r=r.apply(e,t)).next())});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const yr=require("vue"),ti=new Set(["http:","https:","mailto:","tel:"]),ri=new Set(["http:","https:","blob:"]),ni="https://article-content-renderer.invalid/",At="https://www.doitme.link/";function si(e,t){if(typeof e!="string")return e;const r=e.trim();if(!r.startsWith(At))return r;const s=(t.trim()||At).replace(/\/+$/u,""),i=r.slice(At.length).replace(/^\/+/,"");return`${s}/${i}`}function gr(e,t){if(typeof e!="string")return null;const r=e.trim();if(!r||/[\u0000-\u001F\u007F]/u.test(r))return null;try{const n=new URL(r,ni);return(t==="link"?ti:ri).has(n.protocol)?r:null}catch(n){return null}}function nr(e,t){const r=new Set(typeof e=="string"?e.trim().split(/\s+/u).filter(Boolean):[]);return t==="_blank"&&(r.add("noopener"),r.add("noreferrer")),r.size>0?[...r].join(" "):void 0}function Re(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ii(e,t=[]){const r=new Set(t),n=[];for(const s of e.content)if(n.push(s),s.type==="resourceQuestion"&&s.attrs.hideFollowing&&!r.has(s.attrs.revealKey))break;return n}class oi{constructor(t){he(this,"anchors",new Map);he(this,"allAnchors",new Set);he(this,"selections",new Map);he(this,"select",()=>{});this.options=t;const r=n=>{Re(n)&&((n.type==="paragraph"||n.type==="heading")&&Re(n.attrs)&&typeof n.attrs.anchorId=="string"&&this.allAnchors.add(n.attrs.anchorId),Array.isArray(n.content)&&n.content.forEach(r))};if(r(t.document),Re(t.document)&&Array.isArray(t.document.content)){const n=new Set(t.revealedKeys);for(const s of t.document.content){if(!Re(s)||s.type!=="resourceQuestion"||!Re(s.attrs))continue;const i=s.attrs,o=new Map;if(Array.isArray(i.options)&&i.options.forEach(a=>{o.set(a.id,Object.freeze(K({questionId:i.id,resourceId:i.resourceId,optionId:a.id,revealKey:i.revealKey},a.targetAnchorId!==void 0?{targetAnchorId:a.targetAnchorId}:{})))}),this.selections.set(i.id,o),i.hideFollowing===!0&&!n.has(i.revealKey))break}}Object.seal(this)}anchorHooks(t){const r=n=>{var s;((s=n.elm)==null?void 0:s.nodeType)===1&&this.anchors.set(t,n.elm)};return{insert:r,postpatch:(n,s)=>r(s),destroy:n=>{this.anchors.get(t)===n.elm&&this.anchors.delete(t)}}}}class ai{constructor(){he(this,"session");he(this,"pending");he(this,"generation",0);he(this,"frame");he(this,"disposed",!1);he(this,"api",Object.freeze({cancelPendingNavigation:()=>this.cancelPendingNavigation()}));Object.seal(this)}update(t){var n;const r=this.session;if(r&&(r.options.document!==t.options.document||r.options.articleKey!==t.options.articleKey||r.options.revealedKeys.some(s=>!t.options.revealedKeys.includes(s)))&&this.cancelPendingNavigation(),this.pending){const s=this.pending.event,i=(n=t.selections.get(s.questionId))==null?void 0:n.get(s.optionId);(!i||i.targetAnchorId!==s.targetAnchorId||i.revealKey!==s.revealKey||!t.allAnchors.has(s.targetAnchorId))&&this.cancelPendingNavigation()}this.session=t,t.select=s=>{if(this.disposed||this.session!==t)return;this.cancelPendingNavigation();const i=t.options.onAnchorNavigate,o=s.targetAnchorId&&t.allAnchors.has(s.targetAnchorId)?{event:oe(K({},s),{targetAnchorId:s.targetAnchorId}),scrollRequested:!i}:void 0;if(this.pending=o,t.options.emitSelect(s),o&&this.pending===o&&i&&!this.disposed){const a=c=>{this.pending!==o||this.disposed||(this.cancelPendingNavigation(),t.options.reportNavigationIssue({code:"NAVIGATION_CALLBACK_FAILED",path:"",nodeType:"resourceQuestion",message:`onAnchorNavigate failed: ${c instanceof Error?c.message:String(c)}`}))};try{const c=i(Object.freeze(oe(K({},o.event),{scrollToAnchor:()=>{this.pending!==o||this.disposed||(o.scrollRequested=!0,this.schedule())},cancel:()=>{this.pending===o&&this.cancelPendingNavigation()}})));c&&Promise.resolve(c).catch(a)}catch(c){a(c)}}this.schedule()}}cancelPendingNavigation(){var t;this.pending=void 0,this.generation+=1,this.frame!==void 0&&typeof window!="undefined"&&((t=window.cancelAnimationFrame)==null||t.call(window,this.frame)),this.frame=void 0}schedule(){var r,n;if(!((r=this.pending)!=null&&r.scrollRequested)||this.disposed||typeof window=="undefined")return;const t=++this.generation;this.frame!==void 0&&((n=window.cancelAnimationFrame)==null||n.call(window,this.frame)),yr.nextTick(()=>{if(this.disposed||t!==this.generation)return;const s=()=>{this.frame=void 0,!(this.disposed||t!==this.generation)&&this.navigate()};window.requestAnimationFrame?this.frame=window.requestAnimationFrame(s):s()})}navigate(){var d,u,f;const t=this.session,r=(d=this.pending)==null?void 0:d.event.targetAnchorId;if(!t||!r||!((u=this.pending)!=null&&u.scrollRequested))return;const n=t.anchors.get(r);if(!(n!=null&&n.isConnected))return;const s=t.options.scrollContainer,i=typeof s=="function"?s():s;if(i&&!i.contains(n))return;const o=Number.isFinite(t.options.scrollOffset)?t.options.scrollOffset:0,a=n.getBoundingClientRect().top,c=(f=window.matchMedia)!=null&&f.call(window,"(prefers-reduced-motion: reduce)").matches?"auto":"smooth";if(i){const _=Math.max(0,i.scrollTop+a-i.getBoundingClientRect().top-i.clientTop-o);i.scrollTo?i.scrollTo({top:_,behavior:c}):i.scrollTop=_}else window.scrollTo({top:Math.max(0,window.scrollY+a-o),behavior:c});n.focus({preventScroll:!0}),this.pending=void 0}dispose(){this.cancelPendingNavigation(),this.disposed=!0,this.session=void 0}}const ci=new Set(["paragraph","heading","blockquote","bulletList","orderedList","codeBlock","horizontalRule","image","articleButton","table"]);function te(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ke(e){return te(e)?e:{}}function x(e,t,r,n){var c;const s=te(r)?r:{},i=te(r)?n:r,o={},a={};for(const[d,u]of Object.entries(s))if(d==="class")o.class=u;else if(d==="style")o.style=u;else if(d==="hook")o.hook=u;else if(d.startsWith("on")&&typeof u=="function"){const f=d.slice(2).toLowerCase();o.on=oe(K({},(c=o.on)!=null?c:{}),{[f]:u})}else u!==void 0&&u!==!1&&(a[d]=u);return Object.keys(a).length>0&&(o.attrs=a),e.createElement(t,o,i)}function Ie(e){return Array.isArray(e)?e:[]}function ce(e,...t){return`${e}/${t.map(String).join("/")}`}function _n(e){return e==="left"||e==="center"||e==="right"||e==="justify"}function li(e){return e==="left"||e==="center"||e==="right"}function Lt(e){return e==="_blank"||e==="_self"}function Te(e,t){e.reportIssue(t)}function di(e,t,r){var i,o,a;if(!te(e)||e.type!=="text"||typeof e.text!="string"||!e.text)return null;let n=e.text;const s=Ie(e.marks);for(let c=0;c<s.length;c+=1){const d=s[c];if(!te(d)||typeof d.type!="string")continue;const u=ce(t,"marks",c);switch(d.type){case"bold":n=x(r,"strong",{class:"acp-mark acp-mark--bold"},[n]);break;case"italic":n=x(r,"em",{class:"acp-mark acp-mark--italic"},[n]);break;case"strike":n=x(r,"s",{class:"acp-mark acp-mark--strike"},[n]);break;case"underline":n=x(r,"u",{class:"acp-mark acp-mark--underline"},[n]);break;case"code":n=x(r,"code",{class:"acp-mark acp-mark--code"},[n]);break;case"textStyle":case"highlight":{const f=Ke(d.attrs);typeof f.color=="string"&&/^#[0-9a-fA-F]{6}$/.test(f.color)&&(n=x(r,d.type==="highlight"?"mark":"span",{class:`acp-mark acp-mark--${d.type}`,style:d.type==="highlight"?{backgroundColor:f.color,color:"inherit"}:{color:f.color}},[n]));break}case"link":{const f=Ke(d.attrs),_=Lt(f.target)?f.target:"_blank";if(f.type==="custom"){if(typeof f.id!="string"||!f.id||typeof f.title!="string"||!f.title)break;const g=Object.freeze(K({type:"custom",id:f.id,title:f.title},Lt(f.target)?{target:f.target}:{})),v=Object.freeze({type:"link",attrs:g});let m=null;if(!r.resolveCustomLink)Te(r,{code:"LINK_RESOLUTION_FAILED",path:u,message:"No resolveCustomLink callback was provided for a custom link mark.",nodeType:"link"});else try{const k=r.resolveCustomLink(g,v);m=sr(k,_),m||Te(r,{code:typeof k=="string"||te(k)&&typeof k.href=="string"?"UNSAFE_URL":"LINK_RESOLUTION_FAILED",path:u,message:"The custom link resolver returned no usable safe URL.",nodeType:"link"})}catch(k){Te(r,{code:"LINK_RESOLUTION_FAILED",path:u,message:`The custom link resolver threw an error: ${k instanceof Error?k.message:String(k)}`,nodeType:"link"})}const p=(i=m==null?void 0:m.href)!=null?i:null,E=(o=m==null?void 0:m.target)!=null?o:_;n=x(r,"a",{class:`acp-link acp-link--custom${p?"":" acp-link--disabled"}`,href:p!=null?p:void 0,target:E,rel:(a=m==null?void 0:m.rel)!=null?a:nr(void 0,E),title:g.title,"data-link-type":"custom","data-link-id":g.id,"aria-disabled":p?void 0:"true",onClick:p?void 0:k=>k.preventDefault()},[n]);break}if(f.type!==void 0&&f.type!=="href")break;const $=gr(f.href,"link");if(!$){Te(r,{code:"UNSAFE_URL",path:ce(u,"attrs","href"),message:"The link URL is empty, malformed, or uses a disallowed protocol.",nodeType:"link"});break}n=x(r,"a",{class:"acp-link",href:$,target:_,rel:nr(void 0,_),"data-link-type":"href"},[n]);break}}}return n}function vn(e,t,r){return Ie(e).map((n,s)=>di(n,ce(t,s),r)).filter(n=>n!==null)}function bn(e,t,r){return!te(e)||e.type!=="listItem"?null:x(r,"li",{class:"acp-list-item","data-node-type":"listItem"},$r(e.content,ce(t,"content"),r))}function ui(e,t,r){return!te(e)||e.type!=="tableCell"?null:x(r,"td",{class:"acp-table-cell","data-node-type":"tableCell"},$r(e.content,ce(t,"content"),r))}function fi(e,t,r){if(!te(e)||e.type!=="tableRow")return null;const n=Ie(e.content).map((s,i)=>ui(s,ce(t,"content",i),r)).filter(s=>s!==null);return x(r,"tr",{class:"acp-table-row","data-node-type":"tableRow"},n)}function sr(e,t="_self"){var i;if(te(e)&&e.target!==void 0&&!Lt(e.target)||te(e)&&e.rel!==void 0&&typeof e.rel!="string")return null;const r=typeof e=="string"?{href:e}:te(e)&&typeof e.href=="string"?K(K({href:e.href},Lt(e.target)?{target:e.target}:{}),typeof e.rel=="string"?{rel:e.rel}:{}):null;if(!r)return null;const n=gr(r.href,"link");if(!n)return null;const s=(i=r.target)!=null?i:t;return{href:n,target:s,rel:nr(r.rel,s)}}function hi(e,t,r){var u;const n=Ke(e.attrs),s=n.style==="text"||n.style==="button",i=n.style==="link";if(typeof n.text!="string"||!n.text||!s&&!i||s&&(typeof n.id!="string"||!n.id)||i&&n.id!==void 0&&(typeof n.id!="string"||!n.id))return null;const o=Object.freeze(i?K(oe(K(K({},typeof n.id=="string"?{id:n.id}:{}),typeof n.title=="string"?{title:n.title}:{}),{text:n.text,style:"link"}),typeof n.href=="string"?{href:n.href}:{}):oe(K({id:n.id},typeof n.title=="string"?{title:n.title}:{}),{text:n.text,style:n.style})),a=Object.freeze({type:"articleButton",attrs:o});let c=null;if(o.style==="link")o.href!==void 0&&(c=sr(o.href),c||Te(r,{code:"UNSAFE_URL",path:`${t}/attrs/href`,message:"The articleButton link href is not a usable safe URL.",nodeType:"articleButton"}));else if(!r.resolveArticleButtonLink)Te(r,{code:"LINK_RESOLUTION_FAILED",path:t,message:"No resolveArticleButtonLink callback was provided for an articleButton node.",nodeType:"articleButton"});else try{const f=Object.freeze({type:"articleButton",attrs:o}),_=r.resolveArticleButtonLink(o,f);c=sr(_),c||Te(r,{code:typeof _=="string"||te(_)&&typeof _.href=="string"?"UNSAFE_URL":"LINK_RESOLUTION_FAILED",path:t,message:"The articleButton link resolver returned no usable safe URL.",nodeType:"articleButton"})}catch(f){Te(r,{code:"LINK_RESOLUTION_FAILED",path:t,message:`The articleButton link resolver threw an error: ${f instanceof Error?f.message:String(f)}`,nodeType:"articleButton"})}const d=(u=c==null?void 0:c.href)!=null?u:null;return x(r,"a",{class:["acp-article-button",`acp-article-button--${o.style}`,!d&&"acp-article-button--disabled"],href:d!=null?d:void 0,target:c==null?void 0:c.target,rel:c==null?void 0:c.rel,title:o.title,"data-node-type":"articleButton","data-article-button-id":o.id,"data-article-button-style":o.style,"aria-disabled":d?void 0:"true",onClick:f=>{d||f.preventDefault(),r.emitArticleButtonClick({attrs:o,node:a,href:d,event:f})}},o.text)}function pi(e,t,r){if(!te(e)||typeof e.type!="string"||!ci.has(e.type))return null;const n=Ke(e.attrs);switch(e.type){case"paragraph":{const s=_n(n.textAlign)?n.textAlign:void 0;return x(r,"p",oe(K({class:"acp-paragraph","data-node-type":"paragraph"},wn(n,r)),{style:{textAlign:s,fontSize:Number.isInteger(n.fontSize)&&Number(n.fontSize)>=8&&Number(n.fontSize)<=96?`${n.fontSize}px`:void 0}}),vn(e.content,ce(t,"content"),r))}case"heading":{const s=Number.isInteger(n.level)&&Number(n.level)>=1&&Number(n.level)<=6?Number(n.level):1,i=_n(n.textAlign)?n.textAlign:void 0;return x(r,`h${s}`,oe(K({class:["acp-heading",`acp-heading--${s}`],"data-node-type":"heading"},wn(n,r)),{style:i?{textAlign:i}:void 0}),vn(e.content,ce(t,"content"),r))}case"blockquote":return x(r,"blockquote",{class:"acp-blockquote","data-node-type":"blockquote"},$r(e.content,ce(t,"content"),r));case"bulletList":{const s=Ie(e.content).map((i,o)=>bn(i,ce(t,"content",o),r)).filter(i=>i!==null);return x(r,"ul",{class:"acp-list acp-list--bullet","data-node-type":"bulletList"},s)}case"orderedList":{const s=Number.isInteger(n.start)&&Number(n.start)>=1?Number(n.start):1,i=Ie(e.content).map((o,a)=>bn(o,ce(t,"content",a),r)).filter(o=>o!==null);return x(r,"ol",{class:"acp-list acp-list--ordered","data-node-type":"orderedList",start:s},i)}case"codeBlock":{const s=typeof n.language=="string"&&n.language?n.language:void 0,i=Ie(e.content).filter(o=>te(o)&&o.type==="text"&&typeof o.text=="string").map(o=>o.text).join("");return x(r,"pre",{class:"acp-code-block","data-node-type":"codeBlock","data-language":s},[x(r,"code",{class:s?`language-${s}`:void 0},i)])}case"horizontalRule":return x(r,"hr",{class:"acp-horizontal-rule","data-node-type":"horizontalRule"});case"image":{const s=gr(si(n.src,r.imageBaseUrl),"image");if(!s)return Te(r,{code:"UNSAFE_URL",path:ce(t,"attrs","src"),message:"The image URL is empty, malformed, or uses a disallowed protocol.",nodeType:"image"}),null;const i=li(n.imageAlign)?n.imageAlign:"center",o=Number.isInteger(n.width)&&Number(n.width)>=1&&Number(n.width)<=1e4?Number(n.width):void 0,a=Number.isInteger(n.height)&&Number(n.height)>=1&&Number(n.height)<=1e4?Number(n.height):void 0;return x(r,"div",{class:["acp-image",`acp-image--${i}`],"data-node-type":"image","data-image-align":i,"data-image-layout":n.imageLayout==="two-column"?"two-column":void 0},[x(r,"img",{class:"acp-image__element",src:s,alt:typeof n.alt=="string"?n.alt:"",title:typeof n.title=="string"?n.title:void 0,width:o,height:a,"data-image-align":i})])}case"articleButton":return hi(e,t,r);case"table":{const s=Ie(e.content).map((i,o)=>fi(i,ce(t,"content",o),r)).filter(i=>i!==null);return x(r,"div",{class:"acp-table-wrapper","data-node-type":"table"},[x(r,"table",{class:"acp-table"},[x(r,"tbody",s)])])}}return null}function wn(e,t){return typeof e.anchorId!="string"||!/\S/.test(e.anchorId)?{}:{"data-anchor-id":e.anchorId,tabindex:-1,hook:t.navigation.anchorHooks(e.anchorId)}}function mi(e,t){const r=Ke(e.attrs),n=t.navigation.selections.get(r.id),s=[];return r.resourceId===""?s.push(x(t,"p",{class:"acp-resource-question__placeholder"},"暂无问题内容")):(s.push(x(t,"legend",{class:"acp-resource-question__title"},String(r.title))),r.description&&s.push(x(t,"p",{class:"acp-resource-question__description"},String(r.description))),s.push(x(t,"div",{class:"acp-resource-question__options"},Ie(r.options).filter(te).map(i=>x(t,"button",{type:"button",class:"acp-resource-question__option","data-option-id":i.id,onClick:()=>{const o=n==null?void 0:n.get(i.id);o&&t.navigation.select(o)}},String(i.label)))))),x(t,"fieldset",{class:"acp-resource-question","data-node-type":"resourceQuestion","data-question-id":r.id},s)}function yi(e){return te(e)&&e.type==="image"&&Ke(e.attrs).imageLayout==="two-column"}function Xn(e,t,r,n,s){var a,c;const i=pi(t,r,n);if(!yi(t)){i&&typeof i!="string"&&e.push(i);return}if(!i||typeof i=="string")return s;if(s&&((c=(a=s.children)==null?void 0:a.length)!=null?c:0)<2)return s.children.push(i),s;const o=x(n,"div",{class:"acp-image-row"},[i]);return e.push(o),o}function $r(e,t,r){const n=[];let s;return Ie(e).forEach((i,o)=>{s=Xn(n,i,ce(t,o),r,s)}),n}function gi(e,t){var a;const r=Ie(e.content),n=new Map;t.customSlots.forEach(c=>{var u;if(!Number.isInteger(c.location)||c.location<1||c.location>r.length)return;const d=(u=n.get(c.location))!=null?u:[];d.push(c),n.set(c.location,d)});const s=[],i=new Set(t.navigation.options.revealedKeys);let o;for(let c=0;c<r.length;c+=1){const d=r[c],u=c+1;if((a=n.get(u))==null||a.forEach(f=>{f.content.length&&(o=void 0),s.push(...f.content)}),te(d)&&d.type==="resourceQuestion"){o=void 0,s.push(mi(d,t));const f=Ke(d.attrs);if(f.hideFollowing===!0&&!i.has(f.revealKey))break}else o=Xn(s,d,ce("/content",c),t,o)}return s}function $i(e,t){return!te(e)||e.type!=="doc"?[]:gi(e,t)}function _i(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ir={exports:{}},es={},Ae={},Me={},vt={},z={},_t={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(E){if(super(),!e.IDENTIFIER.test(E))throw new Error("CodeGen: name must be a valid identifier");this.str=E}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(E){super(),this._items=typeof E=="string"?[E]:E}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const E=this._items[0];return E===""||E==='""'}get str(){var E;return(E=this._str)!==null&&E!==void 0?E:this._str=this._items.reduce((k,R)=>`${k}${R}`,"")}get names(){var E;return(E=this._names)!==null&&E!==void 0?E:this._names=this._items.reduce((k,R)=>(R instanceof r&&(k[R.str]=(k[R.str]||0)+1),k),{})}}e._Code=n,e.nil=new n("");function s(p,...E){const k=[p[0]];let R=0;for(;R<E.length;)a(k,E[R]),k.push(p[++R]);return new n(k)}e._=s;const i=new n("+");function o(p,...E){const k=[$(p[0])];let R=0;for(;R<E.length;)k.push(i),a(k,E[R]),k.push(i,$(p[++R]));return c(k),new n(k)}e.str=o;function a(p,E){E instanceof n?p.push(...E._items):E instanceof r?p.push(E):p.push(f(E))}e.addCodeArg=a;function c(p){let E=1;for(;E<p.length-1;){if(p[E]===i){const k=d(p[E-1],p[E+1]);if(k!==void 0){p.splice(E-1,3,k);continue}p[E++]="+"}E++}}function d(p,E){if(E==='""')return p;if(p==='""')return E;if(typeof p=="string")return E instanceof r||p[p.length-1]!=='"'?void 0:typeof E!="string"?`${p.slice(0,-1)}${E}"`:E[0]==='"'?p.slice(0,-1)+E.slice(1):void 0;if(typeof E=="string"&&E[0]==='"'&&!(p instanceof r))return`"${p}${E.slice(1)}`}function u(p,E){return E.emptyStr()?p:p.emptyStr()?E:o`${p}${E}`}e.strConcat=u;function f(p){return typeof p=="number"||typeof p=="boolean"||p===null?p:$(Array.isArray(p)?p.join(","):p)}function _(p){return new n($(p))}e.stringify=_;function $(p){return JSON.stringify(p).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=$;function g(p){return typeof p=="string"&&e.IDENTIFIER.test(p)?new n(`.${p}`):s`[${p}]`}e.getProperty=g;function v(p){if(typeof p=="string"&&e.IDENTIFIER.test(p))return new n(`${p}`);throw new Error(`CodeGen: invalid export name: ${p}, use explicit $id name mapping`)}e.getEsmExportName=v;function m(p){return new n(p.toString())}e.regexpCode=m})(_t);var or={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=_t;class r extends Error{constructor(d){super(`CodeGen: "code" for ${d} not defined`),this.value=d.value}}var n;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class s{constructor({prefixes:d,parent:u}={}){this._names={},this._prefixes=d,this._parent=u}toName(d){return d instanceof t.Name?d:this.name(d)}name(d){return new t.Name(this._newName(d))}_newName(d){const u=this._names[d]||this._nameGroup(d);return`${d}${u.index++}`}_nameGroup(d){var u,f;if(!((f=(u=this._parent)===null||u===void 0?void 0:u._prefixes)===null||f===void 0)&&f.has(d)||this._prefixes&&!this._prefixes.has(d))throw new Error(`CodeGen: prefix "${d}" is not allowed in this scope`);return this._names[d]={prefix:d,index:0}}}e.Scope=s;class i extends t.Name{constructor(d,u){super(u),this.prefix=d}setValue(d,{property:u,itemIndex:f}){this.value=d,this.scopePath=(0,t._)`.${new t.Name(u)}[${f}]`}}e.ValueScopeName=i;const o=(0,t._)`\n`;class a extends s{constructor(d){super(d),this._values={},this._scope=d.scope,this.opts=oe(K({},d),{_n:d.lines?o:t.nil})}get(){return this._scope}name(d){return new i(d,this._newName(d))}value(d,u){var f;if(u.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const _=this.toName(d),{prefix:$}=_,g=(f=u.key)!==null&&f!==void 0?f:u.ref;let v=this._values[$];if(v){const E=v.get(g);if(E)return E}else v=this._values[$]=new Map;v.set(g,_);const m=this._scope[$]||(this._scope[$]=[]),p=m.length;return m[p]=u.ref,_.setValue(u,{property:$,itemIndex:p}),_}getValue(d,u){const f=this._values[d];if(f)return f.get(u)}scopeRefs(d,u=this._values){return this._reduceValues(u,f=>{if(f.scopePath===void 0)throw new Error(`CodeGen: name "${f}" has no value`);return(0,t._)`${d}${f.scopePath}`})}scopeCode(d=this._values,u,f){return this._reduceValues(d,_=>{if(_.value===void 0)throw new Error(`CodeGen: name "${_}" has no value`);return _.value.code},u,f)}_reduceValues(d,u,f={},_){let $=t.nil;for(const g in d){const v=d[g];if(!v)continue;const m=f[g]=f[g]||new Map;v.forEach(p=>{if(m.has(p))return;m.set(p,n.Started);let E=u(p);if(E){const k=this.opts.es5?e.varKinds.var:e.varKinds.const;$=(0,t._)`${$}${k} ${p} = ${E};${this.opts._n}`}else if(E=_==null?void 0:_(p))$=(0,t._)`${$}${E}${this.opts._n}`;else throw new r(p);m.set(p,n.Completed)})}return $}}e.ValueScope=a})(or);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=_t,r=or;var n=_t;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var s=or;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class i{optimizeNodes(){return this}optimizeNames(l,h){return this}}class o extends i{constructor(l,h,P){super(),this.varKind=l,this.name=h,this.rhs=P}render({es5:l,_n:h}){const P=l?r.varKinds.var:this.varKind,C=this.rhs===void 0?"":` = ${this.rhs}`;return`${P} ${this.name}${C};`+h}optimizeNames(l,h){if(l[this.name.str])return this.rhs&&(this.rhs=X(this.rhs,l,h)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class a extends i{constructor(l,h,P){super(),this.lhs=l,this.rhs=h,this.sideEffects=P}render({_n:l}){return`${this.lhs} = ${this.rhs};`+l}optimizeNames(l,h){if(!(this.lhs instanceof t.Name&&!l[this.lhs.str]&&!this.sideEffects))return this.rhs=X(this.rhs,l,h),this}get names(){const l=this.lhs instanceof t.Name?{}:K({},this.lhs.names);return W(l,this.rhs)}}class c extends a{constructor(l,h,P,C){super(l,P,C),this.op=h}render({_n:l}){return`${this.lhs} ${this.op}= ${this.rhs};`+l}}class d extends i{constructor(l){super(),this.label=l,this.names={}}render({_n:l}){return`${this.label}:`+l}}class u extends i{constructor(l){super(),this.label=l,this.names={}}render({_n:l}){return`break${this.label?` ${this.label}`:""};`+l}}class f extends i{constructor(l){super(),this.error=l}render({_n:l}){return`throw ${this.error};`+l}get names(){return this.error.names}}class _ extends i{constructor(l){super(),this.code=l}render({_n:l}){return`${this.code};`+l}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(l,h){return this.code=X(this.code,l,h),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class $ extends i{constructor(l=[]){super(),this.nodes=l}render(l){return this.nodes.reduce((h,P)=>h+P.render(l),"")}optimizeNodes(){const{nodes:l}=this;let h=l.length;for(;h--;){const P=l[h].optimizeNodes();Array.isArray(P)?l.splice(h,1,...P):P?l[h]=P:l.splice(h,1)}return l.length>0?this:void 0}optimizeNames(l,h){const{nodes:P}=this;let C=P.length;for(;C--;){const q=P[C];q.optimizeNames(l,h)||(Ne(l,q.names),P.splice(C,1))}return P.length>0?this:void 0}get names(){return this.nodes.reduce((l,h)=>de(l,h.names),{})}}class g extends ${render(l){return"{"+l._n+super.render(l)+"}"+l._n}}class v extends ${}class m extends g{}m.kind="else";class p extends g{constructor(l,h){super(h),this.condition=l}render(l){let h=`if(${this.condition})`+super.render(l);return this.else&&(h+="else "+this.else.render(l)),h}optimizeNodes(){super.optimizeNodes();const l=this.condition;if(l===!0)return this.nodes;let h=this.else;if(h){const P=h.optimizeNodes();h=this.else=Array.isArray(P)?new m(P):P}if(h)return l===!1?h instanceof p?h:h.nodes:this.nodes.length?this:new p(Ve(l),h instanceof p?[h]:h.nodes);if(!(l===!1||!this.nodes.length))return this}optimizeNames(l,h){var P;if(this.else=(P=this.else)===null||P===void 0?void 0:P.optimizeNames(l,h),!!(super.optimizeNames(l,h)||this.else))return this.condition=X(this.condition,l,h),this}get names(){const l=super.names;return W(l,this.condition),this.else&&de(l,this.else.names),l}}p.kind="if";class E extends g{}E.kind="for";class k extends E{constructor(l){super(),this.iteration=l}render(l){return`for(${this.iteration})`+super.render(l)}optimizeNames(l,h){if(super.optimizeNames(l,h))return this.iteration=X(this.iteration,l,h),this}get names(){return de(super.names,this.iteration.names)}}class R extends E{constructor(l,h,P,C){super(),this.varKind=l,this.name=h,this.from=P,this.to=C}render(l){const h=l.es5?r.varKinds.var:this.varKind,{name:P,from:C,to:q}=this;return`for(${h} ${P}=${C}; ${P}<${q}; ${P}++)`+super.render(l)}get names(){const l=W(super.names,this.from);return W(l,this.to)}}class j extends E{constructor(l,h,P,C){super(),this.loop=l,this.varKind=h,this.name=P,this.iterable=C}render(l){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(l)}optimizeNames(l,h){if(super.optimizeNames(l,h))return this.iterable=X(this.iterable,l,h),this}get names(){return de(super.names,this.iterable.names)}}class H extends g{constructor(l,h,P){super(),this.name=l,this.args=h,this.async=P}render(l){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(l)}}H.kind="func";class Q extends ${render(l){return"return "+super.render(l)}}Q.kind="return";class le extends g{render(l){let h="try"+super.render(l);return this.catch&&(h+=this.catch.render(l)),this.finally&&(h+=this.finally.render(l)),h}optimizeNodes(){var l,h;return super.optimizeNodes(),(l=this.catch)===null||l===void 0||l.optimizeNodes(),(h=this.finally)===null||h===void 0||h.optimizeNodes(),this}optimizeNames(l,h){var P,C;return super.optimizeNames(l,h),(P=this.catch)===null||P===void 0||P.optimizeNames(l,h),(C=this.finally)===null||C===void 0||C.optimizeNames(l,h),this}get names(){const l=super.names;return this.catch&&de(l,this.catch.names),this.finally&&de(l,this.finally.names),l}}class ge extends g{constructor(l){super(),this.error=l}render(l){return`catch(${this.error})`+super.render(l)}}ge.kind="catch";class ve extends g{render(l){return"finally"+super.render(l)}}ve.kind="finally";class be{constructor(l,h={}){this._values={},this._blockStarts=[],this._constants={},this.opts=oe(K({},h),{_n:h.lines?`
2
- `:""}),this._extScope=l,this._scope=new r.Scope({parent:l}),this._nodes=[new v]}toString(){return this._root.render(this.opts)}name(l){return this._scope.name(l)}scopeName(l){return this._extScope.name(l)}scopeValue(l,h){const P=this._extScope.value(l,h);return(this._values[P.prefix]||(this._values[P.prefix]=new Set)).add(P),P}getScopeValue(l,h){return this._extScope.getValue(l,h)}scopeRefs(l){return this._extScope.scopeRefs(l,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(l,h,P,C){const q=this._scope.toName(h);return P!==void 0&&C&&(this._constants[q.str]=P),this._leafNode(new o(l,q,P)),q}const(l,h,P){return this._def(r.varKinds.const,l,h,P)}let(l,h,P){return this._def(r.varKinds.let,l,h,P)}var(l,h,P){return this._def(r.varKinds.var,l,h,P)}assign(l,h,P){return this._leafNode(new a(l,h,P))}add(l,h){return this._leafNode(new c(l,e.operators.ADD,h))}code(l){return typeof l=="function"?l():l!==t.nil&&this._leafNode(new _(l)),this}object(...l){const h=["{"];for(const[P,C]of l)h.length>1&&h.push(","),h.push(P),(P!==C||this.opts.es5)&&(h.push(":"),(0,t.addCodeArg)(h,C));return h.push("}"),new t._Code(h)}if(l,h,P){if(this._blockNode(new p(l)),h&&P)this.code(h).else().code(P).endIf();else if(h)this.code(h).endIf();else if(P)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(l){return this._elseNode(new p(l))}else(){return this._elseNode(new m)}endIf(){return this._endBlockNode(p,m)}_for(l,h){return this._blockNode(l),h&&this.code(h).endFor(),this}for(l,h){return this._for(new k(l),h)}forRange(l,h,P,C,q=this.opts.es5?r.varKinds.var:r.varKinds.let){const G=this._scope.toName(l);return this._for(new R(q,G,h,P),()=>C(G))}forOf(l,h,P,C=r.varKinds.const){const q=this._scope.toName(l);if(this.opts.es5){const G=h instanceof t.Name?h:this.var("_arr",h);return this.forRange("_i",0,(0,t._)`${G}.length`,B=>{this.var(q,(0,t._)`${G}[${B}]`),P(q)})}return this._for(new j("of",C,q,h),()=>P(q))}forIn(l,h,P,C=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(l,(0,t._)`Object.keys(${h})`,P);const q=this._scope.toName(l);return this._for(new j("in",C,q,h),()=>P(q))}endFor(){return this._endBlockNode(E)}label(l){return this._leafNode(new d(l))}break(l){return this._leafNode(new u(l))}return(l){const h=new Q;if(this._blockNode(h),this.code(l),h.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Q)}try(l,h,P){if(!h&&!P)throw new Error('CodeGen: "try" without "catch" and "finally"');const C=new le;if(this._blockNode(C),this.code(l),h){const q=this.name("e");this._currNode=C.catch=new ge(q),h(q)}return P&&(this._currNode=C.finally=new ve,this.code(P)),this._endBlockNode(ge,ve)}throw(l){return this._leafNode(new f(l))}block(l,h){return this._blockStarts.push(this._nodes.length),l&&this.code(l).endBlock(h),this}endBlock(l){const h=this._blockStarts.pop();if(h===void 0)throw new Error("CodeGen: not in self-balancing block");const P=this._nodes.length-h;if(P<0||l!==void 0&&P!==l)throw new Error(`CodeGen: wrong number of nodes: ${P} vs ${l} expected`);return this._nodes.length=h,this}func(l,h=t.nil,P,C){return this._blockNode(new H(l,h,P)),C&&this.code(C).endFunc(),this}endFunc(){return this._endBlockNode(H)}optimize(l=1){for(;l-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(l){return this._currNode.nodes.push(l),this}_blockNode(l){this._currNode.nodes.push(l),this._nodes.push(l)}_endBlockNode(l,h){const P=this._currNode;if(P instanceof l||h&&P instanceof h)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${h?`${l.kind}/${h.kind}`:l.kind}"`)}_elseNode(l){const h=this._currNode;if(!(h instanceof p))throw new Error('CodeGen: "else" without "if"');return this._currNode=h.else=l,this}get _root(){return this._nodes[0]}get _currNode(){const l=this._nodes;return l[l.length-1]}set _currNode(l){const h=this._nodes;h[h.length-1]=l}}e.CodeGen=be;function de(S,l){for(const h in l)S[h]=(S[h]||0)+(l[h]||0);return S}function W(S,l){return l instanceof t._CodeOrName?de(S,l.names):S}function X(S,l,h){if(S instanceof t.Name)return P(S);if(!C(S))return S;return new t._Code(S._items.reduce((q,G)=>(G instanceof t.Name&&(G=P(G)),G instanceof t._Code?q.push(...G._items):q.push(G),q),[]));function P(q){const G=h[q.str];return G===void 0||l[q.str]!==1?q:(delete l[q.str],G)}function C(q){return q instanceof t._Code&&q._items.some(G=>G instanceof t.Name&&l[G.str]===1&&h[G.str]!==void 0)}}function Ne(S,l){for(const h in l)S[h]=(S[h]||0)-(l[h]||0)}function Ve(S){return typeof S=="boolean"||typeof S=="number"||S===null?!S:(0,t._)`!${N(S)}`}e.not=Ve;const Ge=b(e.operators.AND);function at(...S){return S.reduce(Ge)}e.and=at;const Qe=b(e.operators.OR);function O(...S){return S.reduce(Qe)}e.or=O;function b(S){return(l,h)=>l===t.nil?h:h===t.nil?l:(0,t._)`${N(l)} ${S} ${N(h)}`}function N(S){return S instanceof t.Name?S:(0,t._)`(${S})`}})(z);var T={};Object.defineProperty(T,"__esModule",{value:!0});T.checkStrictMode=T.getErrorPath=T.Type=T.useFunc=T.setEvaluated=T.evaluatedPropsToName=T.mergeEvaluated=T.eachItem=T.unescapeJsonPointer=T.escapeJsonPointer=T.escapeFragment=T.unescapeFragment=T.schemaRefOrVal=T.schemaHasRulesButRef=T.schemaHasRules=T.checkUnknownRules=T.alwaysValidSchema=T.toHash=void 0;const J=z,vi=_t;function bi(e){const t={};for(const r of e)t[r]=!0;return t}T.toHash=bi;function wi(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(ts(e,t),!rs(t,e.self.RULES.all))}T.alwaysValidSchema=wi;function ts(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;const s=n.RULES.keywords;for(const i in t)s[i]||is(e,`unknown keyword: "${i}"`)}T.checkUnknownRules=ts;function rs(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(t[r])return!0;return!1}T.schemaHasRules=rs;function Ei(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}T.schemaHasRulesButRef=Ei;function Si({topSchemaRef:e,schemaPath:t},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,J._)`${r}`}return(0,J._)`${e}${t}${(0,J.getProperty)(n)}`}T.schemaRefOrVal=Si;function Pi(e){return ns(decodeURIComponent(e))}T.unescapeFragment=Pi;function ki(e){return encodeURIComponent(_r(e))}T.escapeFragment=ki;function _r(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}T.escapeJsonPointer=_r;function ns(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}T.unescapeJsonPointer=ns;function Ii(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)}T.eachItem=Ii;function En({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(s,i,o,a)=>{const c=o===void 0?i:o instanceof J.Name?(i instanceof J.Name?e(s,i,o):t(s,i,o),o):i instanceof J.Name?(t(s,o,i),i):r(i,o);return a===J.Name&&!(c instanceof J.Name)?n(s,c):c}}T.mergeEvaluated={props:En({mergeNames:(e,t,r)=>e.if((0,J._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,J._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,J._)`${r} || {}`).code((0,J._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,J._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,J._)`${r} || {}`),vr(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:K(K({},e),t),resultToName:ss}),items:En({mergeNames:(e,t,r)=>e.if((0,J._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,J._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,J._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,J._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function ss(e,t){if(t===!0)return e.var("props",!0);const r=e.var("props",(0,J._)`{}`);return t!==void 0&&vr(e,r,t),r}T.evaluatedPropsToName=ss;function vr(e,t,r){Object.keys(r).forEach(n=>e.assign((0,J._)`${t}${(0,J.getProperty)(n)}`,!0))}T.setEvaluated=vr;const Sn={};function Ni(e,t){return e.scopeValue("func",{ref:t,code:Sn[t.code]||(Sn[t.code]=new vi._Code(t.code))})}T.useFunc=Ni;var ar;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(ar||(T.Type=ar={}));function Ai(e,t,r){if(e instanceof J.Name){const n=t===ar.Num;return r?n?(0,J._)`"[" + ${e} + "]"`:(0,J._)`"['" + ${e} + "']"`:n?(0,J._)`"/" + ${e}`:(0,J._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,J.getProperty)(e).toString():"/"+_r(e)}T.getErrorPath=Ai;function is(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}T.checkStrictMode=is;var Et={},Pn;function qe(){if(Pn)return Et;Pn=1,Object.defineProperty(Et,"__esModule",{value:!0});const e=z,t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return Et.default=t,Et}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=z,r=T,n=qe();e.keywordError={message:({keyword:m})=>(0,t.str)`must pass "${m}" keyword validation`},e.keyword$DataError={message:({keyword:m,schemaType:p})=>p?(0,t.str)`"${m}" keyword must be ${p} ($data)`:(0,t.str)`"${m}" keyword is invalid ($data)`};function s(m,p=e.keywordError,E,k){const{it:R}=m,{gen:j,compositeRule:H,allErrors:Q}=R,le=f(m,p,E);(k!=null?k:H||Q)?c(j,le):d(R,(0,t._)`[${le}]`)}e.reportError=s;function i(m,p=e.keywordError,E){const{it:k}=m,{gen:R,compositeRule:j,allErrors:H}=k,Q=f(m,p,E);c(R,Q),j||H||d(k,n.default.vErrors)}e.reportExtraError=i;function o(m,p){m.assign(n.default.errors,p),m.if((0,t._)`${n.default.vErrors} !== null`,()=>m.if(p,()=>m.assign((0,t._)`${n.default.vErrors}.length`,p),()=>m.assign(n.default.vErrors,null)))}e.resetErrorsCount=o;function a({gen:m,keyword:p,schemaValue:E,data:k,errsCount:R,it:j}){if(R===void 0)throw new Error("ajv implementation error");const H=m.name("err");m.forRange("i",R,n.default.errors,Q=>{m.const(H,(0,t._)`${n.default.vErrors}[${Q}]`),m.if((0,t._)`${H}.instancePath === undefined`,()=>m.assign((0,t._)`${H}.instancePath`,(0,t.strConcat)(n.default.instancePath,j.errorPath))),m.assign((0,t._)`${H}.schemaPath`,(0,t.str)`${j.errSchemaPath}/${p}`),j.opts.verbose&&(m.assign((0,t._)`${H}.schema`,E),m.assign((0,t._)`${H}.data`,k))})}e.extendErrors=a;function c(m,p){const E=m.const("err",p);m.if((0,t._)`${n.default.vErrors} === null`,()=>m.assign(n.default.vErrors,(0,t._)`[${E}]`),(0,t._)`${n.default.vErrors}.push(${E})`),m.code((0,t._)`${n.default.errors}++`)}function d(m,p){const{gen:E,validateName:k,schemaEnv:R}=m;R.$async?E.throw((0,t._)`new ${m.ValidationError}(${p})`):(E.assign((0,t._)`${k}.errors`,p),E.return(!1))}const u={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 f(m,p,E){const{createErrors:k}=m.it;return k===!1?(0,t._)`{}`:_(m,p,E)}function _(m,p,E={}){const{gen:k,it:R}=m,j=[$(R,E),g(m,E)];return v(m,p,j),k.object(...j)}function $({errorPath:m},{instancePath:p}){const E=p?(0,t.str)`${m}${(0,r.getErrorPath)(p,r.Type.Str)}`:m;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,E)]}function g({keyword:m,it:{errSchemaPath:p}},{schemaPath:E,parentSchema:k}){let R=k?p:(0,t.str)`${p}/${m}`;return E&&(R=(0,t.str)`${R}${(0,r.getErrorPath)(E,r.Type.Str)}`),[u.schemaPath,R]}function v(m,{params:p,message:E},k){const{keyword:R,data:j,schemaValue:H,it:Q}=m,{opts:le,propertyName:ge,topSchemaRef:ve,schemaPath:be}=Q;k.push([u.keyword,R],[u.params,typeof p=="function"?p(m):p||(0,t._)`{}`]),le.messages&&k.push([u.message,typeof E=="function"?E(m):E]),le.verbose&&k.push([u.schema,H],[u.parentSchema,(0,t._)`${ve}${be}`],[n.default.data,j]),ge&&k.push([u.propertyName,ge])}})(vt);var kn;function Oi(){if(kn)return Me;kn=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.boolOrEmptySchema=Me.topBoolOrEmptySchema=void 0;const e=vt,t=z,r=qe(),n={message:"boolean schema is false"};function s(a){const{gen:c,schema:d,validateName:u}=a;d===!1?o(a,!1):typeof d=="object"&&d.$async===!0?c.return(r.default.data):(c.assign((0,t._)`${u}.errors`,null),c.return(!0))}Me.topBoolOrEmptySchema=s;function i(a,c){const{gen:d,schema:u}=a;u===!1?(d.var(c,!1),o(a)):d.var(c,!0)}Me.boolOrEmptySchema=i;function o(a,c){const{gen:d,data:u}=a,f={gen:d,keyword:"false schema",data:u,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:a};(0,e.reportError)(f,n,void 0,c)}return Me}var ee={},Be={};Object.defineProperty(Be,"__esModule",{value:!0});Be.getRules=Be.isJSONType=void 0;const Ri=["string","number","integer","boolean","null","object","array"],Ti=new Set(Ri);function ji(e){return typeof e=="string"&&Ti.has(e)}Be.isJSONType=ji;function Ci(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:oe(K({},e),{integer:!0,boolean:!0,null:!0}),rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Be.getRules=Ci;var je={};Object.defineProperty(je,"__esModule",{value:!0});je.shouldUseRule=je.shouldUseGroup=je.schemaHasRulesForType=void 0;function Li({schema:e,self:t},r){const n=t.RULES.types[r];return n&&n!==!0&&os(e,n)}je.schemaHasRulesForType=Li;function os(e,t){return t.rules.some(r=>as(e,r))}je.shouldUseGroup=os;function as(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}je.shouldUseRule=as;Object.defineProperty(ee,"__esModule",{value:!0});ee.reportTypeError=ee.checkDataTypes=ee.checkDataType=ee.coerceAndCheckDataType=ee.getJSONTypes=ee.getSchemaTypes=ee.DataType=void 0;const Di=Be,qi=je,Vi=vt,V=z,cs=T;var et;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(et||(ee.DataType=et={}));function Mi(e){const t=ls(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}ee.getSchemaTypes=Mi;function ls(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(Di.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}ee.getJSONTypes=ls;function Fi(e,t){const{gen:r,data:n,opts:s}=e,i=Ui(t,s.coerceTypes),o=t.length>0&&!(i.length===0&&t.length===1&&(0,qi.schemaHasRulesForType)(e,t[0]));if(o){const a=br(t,n,s.strictNumbers,et.Wrong);r.if(a,()=>{i.length?zi(e,t,i):wr(e)})}return o}ee.coerceAndCheckDataType=Fi;const ds=new Set(["string","number","integer","boolean","null"]);function Ui(e,t){return t?e.filter(r=>ds.has(r)||t==="array"&&r==="array"):[]}function zi(e,t,r){const{gen:n,data:s,opts:i}=e,o=n.let("dataType",(0,V._)`typeof ${s}`),a=n.let("coerced",(0,V._)`undefined`);i.coerceTypes==="array"&&n.if((0,V._)`${o} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,(0,V._)`${s}[0]`).assign(o,(0,V._)`typeof ${s}`).if(br(t,s,i.strictNumbers),()=>n.assign(a,s))),n.if((0,V._)`${a} !== undefined`);for(const d of r)(ds.has(d)||d==="array"&&i.coerceTypes==="array")&&c(d);n.else(),wr(e),n.endIf(),n.if((0,V._)`${a} !== undefined`,()=>{n.assign(s,a),Ki(e,a)});function c(d){switch(d){case"string":n.elseIf((0,V._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,V._)`"" + ${s}`).elseIf((0,V._)`${s} === null`).assign(a,(0,V._)`""`);return;case"number":n.elseIf((0,V._)`${o} == "boolean" || ${s} === null
3
- || (${o} == "string" && ${s} && ${s} == +${s})`).assign(a,(0,V._)`+${s}`);return;case"integer":n.elseIf((0,V._)`${o} === "boolean" || ${s} === null
4
- || (${o} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(a,(0,V._)`+${s}`);return;case"boolean":n.elseIf((0,V._)`${s} === "false" || ${s} === 0 || ${s} === null`).assign(a,!1).elseIf((0,V._)`${s} === "true" || ${s} === 1`).assign(a,!0);return;case"null":n.elseIf((0,V._)`${s} === "" || ${s} === 0 || ${s} === false`),n.assign(a,null);return;case"array":n.elseIf((0,V._)`${o} === "string" || ${o} === "number"
5
- || ${o} === "boolean" || ${s} === null`).assign(a,(0,V._)`[${s}]`)}}}function Ki({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,V._)`${t} !== undefined`,()=>e.assign((0,V._)`${t}[${r}]`,n))}function cr(e,t,r,n=et.Correct){const s=n===et.Correct?V.operators.EQ:V.operators.NEQ;let i;switch(e){case"null":return(0,V._)`${t} ${s} null`;case"array":i=(0,V._)`Array.isArray(${t})`;break;case"object":i=(0,V._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=o((0,V._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=o();break;default:return(0,V._)`typeof ${t} ${s} ${e}`}return n===et.Correct?i:(0,V.not)(i);function o(a=V.nil){return(0,V.and)((0,V._)`typeof ${t} == "number"`,a,r?(0,V._)`isFinite(${t})`:V.nil)}}ee.checkDataType=cr;function br(e,t,r,n){if(e.length===1)return cr(e[0],t,r,n);let s;const i=(0,cs.toHash)(e);if(i.array&&i.object){const o=(0,V._)`typeof ${t} != "object"`;s=i.null?o:(0,V._)`!${t} || ${o}`,delete i.null,delete i.array,delete i.object}else s=V.nil;i.number&&delete i.integer;for(const o in i)s=(0,V.and)(s,cr(o,t,r,n));return s}ee.checkDataTypes=br;const Bi={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,V._)`{type: ${e}}`:(0,V._)`{type: ${t}}`};function wr(e){const t=xi(e);(0,Vi.reportError)(t,Bi)}ee.reportTypeError=wr;function xi(e){const{gen:t,data:r,schema:n}=e,s=(0,cs.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:e}}var lt={},In;function Hi(){if(In)return lt;In=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.assignDefaults=void 0;const e=z,t=T;function r(s,i){const{properties:o,items:a}=s.schema;if(i==="object"&&o)for(const c in o)n(s,c,o[c].default);else i==="array"&&Array.isArray(a)&&a.forEach((c,d)=>n(s,d,c.default))}lt.assignDefaults=r;function n(s,i,o){const{gen:a,compositeRule:c,data:d,opts:u}=s;if(o===void 0)return;const f=(0,e._)`${d}${(0,e.getProperty)(i)}`;if(c){(0,t.checkStrictMode)(s,`default is ignored for: ${f}`);return}let _=(0,e._)`${f} === undefined`;u.useDefaults==="empty"&&(_=(0,e._)`${_} || ${f} === null || ${f} === ""`),a.if(_,(0,e._)`${f} = ${(0,e.stringify)(o)}`)}return lt}var Ee={},U={};Object.defineProperty(U,"__esModule",{value:!0});U.validateUnion=U.validateArray=U.usePattern=U.callValidateCode=U.schemaProperties=U.allSchemaProperties=U.noPropertyInData=U.propertyInData=U.isOwnProperty=U.hasPropFunc=U.reportMissingProp=U.checkMissingProp=U.checkReportMissingProp=void 0;const Y=z,Er=T,Ce=qe(),Gi=T;function Qi(e,t){const{gen:r,data:n,it:s}=e;r.if(Pr(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:(0,Y._)`${t}`},!0),e.error()})}U.checkReportMissingProp=Qi;function Ji({gen:e,data:t,it:{opts:r}},n,s){return(0,Y.or)(...n.map(i=>(0,Y.and)(Pr(e,t,i,r.ownProperties),(0,Y._)`${s} = ${i}`)))}U.checkMissingProp=Ji;function Yi(e,t){e.setParams({missingProperty:t},!0),e.error()}U.reportMissingProp=Yi;function us(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Y._)`Object.prototype.hasOwnProperty`})}U.hasPropFunc=us;function Sr(e,t,r){return(0,Y._)`${us(e)}.call(${t}, ${r})`}U.isOwnProperty=Sr;function Wi(e,t,r,n){const s=(0,Y._)`${t}${(0,Y.getProperty)(r)} !== undefined`;return n?(0,Y._)`${s} && ${Sr(e,t,r)}`:s}U.propertyInData=Wi;function Pr(e,t,r,n){const s=(0,Y._)`${t}${(0,Y.getProperty)(r)} === undefined`;return n?(0,Y.or)(s,(0,Y.not)(Sr(e,t,r))):s}U.noPropertyInData=Pr;function fs(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}U.allSchemaProperties=fs;function Zi(e,t){return fs(t).filter(r=>!(0,Er.alwaysValidSchema)(e,t[r]))}U.schemaProperties=Zi;function Xi({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:i},it:o},a,c,d){const u=d?(0,Y._)`${e}, ${t}, ${n}${s}`:t,f=[[Ce.default.instancePath,(0,Y.strConcat)(Ce.default.instancePath,i)],[Ce.default.parentData,o.parentData],[Ce.default.parentDataProperty,o.parentDataProperty],[Ce.default.rootData,Ce.default.rootData]];o.opts.dynamicRef&&f.push([Ce.default.dynamicAnchors,Ce.default.dynamicAnchors]);const _=(0,Y._)`${u}, ${r.object(...f)}`;return c!==Y.nil?(0,Y._)`${a}.call(${c}, ${_})`:(0,Y._)`${a}(${_})`}U.callValidateCode=Xi;const eo=(0,Y._)`new RegExp`;function to({gen:e,it:{opts:t}},r){const n=t.unicodeRegExp?"u":"",{regExp:s}=t.code,i=s(r,n);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,Y._)`${s.code==="new RegExp"?eo:(0,Gi.useFunc)(e,s)}(${r}, ${n})`})}U.usePattern=to;function ro(e){const{gen:t,data:r,keyword:n,it:s}=e,i=t.name("valid");if(s.allErrors){const a=t.let("valid",!0);return o(()=>t.assign(a,!1)),a}return t.var(i,!0),o(()=>t.break()),i;function o(a){const c=t.const("len",(0,Y._)`${r}.length`);t.forRange("i",0,c,d=>{e.subschema({keyword:n,dataProp:d,dataPropType:Er.Type.Num},i),t.if((0,Y.not)(i),a)})}}U.validateArray=ro;function no(e){const{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,Er.alwaysValidSchema)(s,c))&&!s.opts.unevaluated)return;const o=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((c,d)=>{const u=e.subschema({keyword:n,schemaProp:d,compositeRule:!0},a);t.assign(o,(0,Y._)`${o} || ${a}`),e.mergeValidEvaluated(u,a)||t.if((0,Y.not)(o))})),e.result(o,()=>e.reset(),()=>e.error(!0))}U.validateUnion=no;var Nn;function so(){if(Nn)return Ee;Nn=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.validateKeywordUsage=Ee.validSchemaType=Ee.funcKeywordCode=Ee.macroKeywordCode=void 0;const e=z,t=qe(),r=U,n=vt;function s(_,$){const{gen:g,keyword:v,schema:m,parentSchema:p,it:E}=_,k=$.macro.call(E.self,m,p,E),R=d(g,v,k);E.opts.validateSchema!==!1&&E.self.validateSchema(k,!0);const j=g.name("valid");_.subschema({schema:k,schemaPath:e.nil,errSchemaPath:`${E.errSchemaPath}/${v}`,topSchemaRef:R,compositeRule:!0},j),_.pass(j,()=>_.error(!0))}Ee.macroKeywordCode=s;function i(_,$){var g;const{gen:v,keyword:m,schema:p,parentSchema:E,$data:k,it:R}=_;c(R,$);const j=!k&&$.compile?$.compile.call(R.self,p,E,R):$.validate,H=d(v,m,j),Q=v.let("valid");_.block$data(Q,le),_.ok((g=$.valid)!==null&&g!==void 0?g:Q);function le(){if($.errors===!1)be(),$.modifying&&o(_),de(()=>_.error());else{const W=$.async?ge():ve();$.modifying&&o(_),de(()=>a(_,W))}}function ge(){const W=v.let("ruleErrs",null);return v.try(()=>be((0,e._)`await `),X=>v.assign(Q,!1).if((0,e._)`${X} instanceof ${R.ValidationError}`,()=>v.assign(W,(0,e._)`${X}.errors`),()=>v.throw(X))),W}function ve(){const W=(0,e._)`${H}.errors`;return v.assign(W,null),be(e.nil),W}function be(W=$.async?(0,e._)`await `:e.nil){const X=R.opts.passContext?t.default.this:t.default.self,Ne=!("compile"in $&&!k||$.schema===!1);v.assign(Q,(0,e._)`${W}${(0,r.callValidateCode)(_,H,X,Ne)}`,$.modifying)}function de(W){var X;v.if((0,e.not)((X=$.valid)!==null&&X!==void 0?X:Q),W)}}Ee.funcKeywordCode=i;function o(_){const{gen:$,data:g,it:v}=_;$.if(v.parentData,()=>$.assign(g,(0,e._)`${v.parentData}[${v.parentDataProperty}]`))}function a(_,$){const{gen:g}=_;g.if((0,e._)`Array.isArray(${$})`,()=>{g.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${$} : ${t.default.vErrors}.concat(${$})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,n.extendErrors)(_)},()=>_.error())}function c({schemaEnv:_},$){if($.async&&!_.$async)throw new Error("async keyword in sync schema")}function d(_,$,g){if(g===void 0)throw new Error(`keyword "${$}" failed to compile`);return _.scopeValue("keyword",typeof g=="function"?{ref:g}:{ref:g,code:(0,e.stringify)(g)})}function u(_,$,g=!1){return!$.length||$.some(v=>v==="array"?Array.isArray(_):v==="object"?_&&typeof _=="object"&&!Array.isArray(_):typeof _==v||g&&typeof _=="undefined")}Ee.validSchemaType=u;function f({schema:_,opts:$,self:g,errSchemaPath:v},m,p){if(Array.isArray(m.keyword)?!m.keyword.includes(p):m.keyword!==p)throw new Error("ajv implementation error");const E=m.dependencies;if(E!=null&&E.some(k=>!Object.prototype.hasOwnProperty.call(_,k)))throw new Error(`parent schema must have dependencies of ${p}: ${E.join(",")}`);if(m.validateSchema&&!m.validateSchema(_[p])){const R=`keyword "${p}" value is invalid at path "${v}": `+g.errorsText(m.validateSchema.errors);if($.validateSchema==="log")g.logger.error(R);else throw new Error(R)}}return Ee.validateKeywordUsage=f,Ee}var Oe={},An;function io(){if(An)return Oe;An=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.extendSubschemaMode=Oe.extendSubschemaData=Oe.getSubschema=void 0;const e=z,t=T;function r(i,{keyword:o,schemaProp:a,schema:c,schemaPath:d,errSchemaPath:u,topSchemaRef:f}){if(o!==void 0&&c!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(o!==void 0){const _=i.schema[o];return a===void 0?{schema:_,schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(o)}`,errSchemaPath:`${i.errSchemaPath}/${o}`}:{schema:_[a],schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(o)}${(0,e.getProperty)(a)}`,errSchemaPath:`${i.errSchemaPath}/${o}/${(0,t.escapeFragment)(a)}`}}if(c!==void 0){if(d===void 0||u===void 0||f===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:c,schemaPath:d,topSchemaRef:f,errSchemaPath:u}}throw new Error('either "keyword" or "schema" must be passed')}Oe.getSubschema=r;function n(i,o,{dataProp:a,dataPropType:c,data:d,dataTypes:u,propertyName:f}){if(d!==void 0&&a!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:_}=o;if(a!==void 0){const{errorPath:g,dataPathArr:v,opts:m}=o,p=_.let("data",(0,e._)`${o.data}${(0,e.getProperty)(a)}`,!0);$(p),i.errorPath=(0,e.str)`${g}${(0,t.getErrorPath)(a,c,m.jsPropertySyntax)}`,i.parentDataProperty=(0,e._)`${a}`,i.dataPathArr=[...v,i.parentDataProperty]}if(d!==void 0){const g=d instanceof e.Name?d:_.let("data",d,!0);$(g),f!==void 0&&(i.propertyName=f)}u&&(i.dataTypes=u);function $(g){i.data=g,i.dataLevel=o.dataLevel+1,i.dataTypes=[],o.definedProperties=new Set,i.parentData=o.data,i.dataNames=[...o.dataNames,g]}}Oe.extendSubschemaData=n;function s(i,{jtdDiscriminator:o,jtdMetadata:a,compositeRule:c,createErrors:d,allErrors:u}){c!==void 0&&(i.compositeRule=c),d!==void 0&&(i.createErrors=d),u!==void 0&&(i.allErrors=u),i.jtdDiscriminator=o,i.jtdMetadata=a}return Oe.extendSubschemaMode=s,Oe}var ie={},hs=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=n;s--!==0;){var o=i[s];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r},ps={exports:{}},De=ps.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};Ot(t,n,s,e,"",e)};De.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};De.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};De.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};De.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Ot(e,t,r,n,s,i,o,a,c,d){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,s,i,o,a,c,d);for(var u in n){var f=n[u];if(Array.isArray(f)){if(u in De.arrayKeywords)for(var _=0;_<f.length;_++)Ot(e,t,r,f[_],s+"/"+u+"/"+_,i,s,u,n,_)}else if(u in De.propsKeywords){if(f&&typeof f=="object")for(var $ in f)Ot(e,t,r,f[$],s+"/"+u+"/"+oo($),i,s,u,n,$)}else(u in De.keywords||e.allKeys&&!(u in De.skipKeywords))&&Ot(e,t,r,f,s+"/"+u,i,s,u,n)}r(n,s,i,o,a,c,d)}}function oo(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var ao=ps.exports;Object.defineProperty(ie,"__esModule",{value:!0});ie.getSchemaRefs=ie.resolveUrl=ie.normalizeId=ie._getFullPath=ie.getFullPath=ie.inlineRef=void 0;const co=T,lo=hs,uo=ao,fo=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function ho(e,t=!0){return typeof e=="boolean"?!0:t===!0?!lr(e):t?ms(e)<=t:!1}ie.inlineRef=ho;const po=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function lr(e){for(const t in e){if(po.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(lr)||typeof r=="object"&&lr(r))return!0}return!1}function ms(e){let t=0;for(const r in e){if(r==="$ref")return 1/0;if(t++,!fo.has(r)&&(typeof e[r]=="object"&&(0,co.eachItem)(e[r],n=>t+=ms(n)),t===1/0))return 1/0}return t}function ys(e,t="",r){r!==!1&&(t=tt(t));const n=e.parse(t);return gs(e,n)}ie.getFullPath=ys;function gs(e,t){return e.serialize(t).split("#")[0]+"#"}ie._getFullPath=gs;const mo=/#\/?$/;function tt(e){return e?e.replace(mo,""):""}ie.normalizeId=tt;function yo(e,t,r){return r=tt(r),e.resolve(t,r)}ie.resolveUrl=yo;const go=/^[a-z_][-a-z0-9._]*$/i;function $o(e,t){if(typeof e=="boolean")return{};const{schemaId:r,uriResolver:n}=this.opts,s=tt(e[r]||t),i={"":s},o=ys(n,s,!1),a={},c=new Set;return uo(e,{allKeys:!0},(f,_,$,g)=>{if(g===void 0)return;const v=o+_;let m=i[g];typeof f[r]=="string"&&(m=p.call(this,f[r])),E.call(this,f.$anchor),E.call(this,f.$dynamicAnchor),i[_]=m;function p(k){const R=this.opts.uriResolver.resolve;if(k=tt(m?R(m,k):k),c.has(k))throw u(k);c.add(k);let j=this.refs[k];return typeof j=="string"&&(j=this.refs[j]),typeof j=="object"?d(f,j.schema,k):k!==tt(v)&&(k[0]==="#"?(d(f,a[k],k),a[k]=f):this.refs[k]=v),k}function E(k){if(typeof k=="string"){if(!go.test(k))throw new Error(`invalid anchor "${k}"`);p.call(this,`#${k}`)}}}),a;function d(f,_,$){if(_!==void 0&&!lo(f,_))throw u($)}function u(f){return new Error(`reference "${f}" resolves to more than one schema`)}}ie.getSchemaRefs=$o;var On;function zt(){if(On)return Ae;On=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.getData=Ae.KeywordCxt=Ae.validateFunctionCode=void 0;const e=Oi(),t=ee,r=je,n=ee,s=Hi(),i=so(),o=io(),a=z,c=qe(),d=ie,u=T,f=vt;function _(y){if(j(y)&&(Q(y),R(y))){m(y);return}$(y,()=>(0,e.topBoolOrEmptySchema)(y))}Ae.validateFunctionCode=_;function $({gen:y,validateName:w,schema:I,schemaEnv:A,opts:D},F){D.code.es5?y.func(w,(0,a._)`${c.default.data}, ${c.default.valCxt}`,A.$async,()=>{y.code((0,a._)`"use strict"; ${E(I,D)}`),v(y,D),y.code(F)}):y.func(w,(0,a._)`${c.default.data}, ${g(D)}`,A.$async,()=>y.code(E(I,D)).code(F))}function g(y){return(0,a._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${y.dynamicRef?(0,a._)`, ${c.default.dynamicAnchors}={}`:a.nil}}={}`}function v(y,w){y.if(c.default.valCxt,()=>{y.var(c.default.instancePath,(0,a._)`${c.default.valCxt}.${c.default.instancePath}`),y.var(c.default.parentData,(0,a._)`${c.default.valCxt}.${c.default.parentData}`),y.var(c.default.parentDataProperty,(0,a._)`${c.default.valCxt}.${c.default.parentDataProperty}`),y.var(c.default.rootData,(0,a._)`${c.default.valCxt}.${c.default.rootData}`),w.dynamicRef&&y.var(c.default.dynamicAnchors,(0,a._)`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{y.var(c.default.instancePath,(0,a._)`""`),y.var(c.default.parentData,(0,a._)`undefined`),y.var(c.default.parentDataProperty,(0,a._)`undefined`),y.var(c.default.rootData,c.default.data),w.dynamicRef&&y.var(c.default.dynamicAnchors,(0,a._)`{}`)})}function m(y){const{schema:w,opts:I,gen:A}=y;$(y,()=>{I.$comment&&w.$comment&&W(y),ve(y),A.let(c.default.vErrors,null),A.let(c.default.errors,0),I.unevaluated&&p(y),le(y),X(y)})}function p(y){const{gen:w,validateName:I}=y;y.evaluated=w.const("evaluated",(0,a._)`${I}.evaluated`),w.if((0,a._)`${y.evaluated}.dynamicProps`,()=>w.assign((0,a._)`${y.evaluated}.props`,(0,a._)`undefined`)),w.if((0,a._)`${y.evaluated}.dynamicItems`,()=>w.assign((0,a._)`${y.evaluated}.items`,(0,a._)`undefined`))}function E(y,w){const I=typeof y=="object"&&y[w.schemaId];return I&&(w.code.source||w.code.process)?(0,a._)`/*# sourceURL=${I} */`:a.nil}function k(y,w){if(j(y)&&(Q(y),R(y))){H(y,w);return}(0,e.boolOrEmptySchema)(y,w)}function R({schema:y,self:w}){if(typeof y=="boolean")return!y;for(const I in y)if(w.RULES.all[I])return!0;return!1}function j(y){return typeof y.schema!="boolean"}function H(y,w){const{schema:I,gen:A,opts:D}=y;D.$comment&&I.$comment&&W(y),be(y),de(y);const F=A.const("_errs",c.default.errors);le(y,F),A.var(w,(0,a._)`${F} === ${c.default.errors}`)}function Q(y){(0,u.checkUnknownRules)(y),ge(y)}function le(y,w){if(y.opts.jtd)return Ve(y,[],!1,w);const I=(0,t.getSchemaTypes)(y.schema),A=(0,t.coerceAndCheckDataType)(y,I);Ve(y,I,!A,w)}function ge(y){const{schema:w,errSchemaPath:I,opts:A,self:D}=y;w.$ref&&A.ignoreKeywordsWithRef&&(0,u.schemaHasRulesButRef)(w,D.RULES)&&D.logger.warn(`$ref: keywords ignored in schema at path "${I}"`)}function ve(y){const{schema:w,opts:I}=y;w.default!==void 0&&I.useDefaults&&I.strictSchema&&(0,u.checkStrictMode)(y,"default is ignored in the schema root")}function be(y){const w=y.schema[y.opts.schemaId];w&&(y.baseId=(0,d.resolveUrl)(y.opts.uriResolver,y.baseId,w))}function de(y){if(y.schema.$async&&!y.schemaEnv.$async)throw new Error("async schema in sync schema")}function W({gen:y,schemaEnv:w,schema:I,errSchemaPath:A,opts:D}){const F=I.$comment;if(D.$comment===!0)y.code((0,a._)`${c.default.self}.logger.log(${F})`);else if(typeof D.$comment=="function"){const re=(0,a.str)`${A}/$comment`,we=y.scopeValue("root",{ref:w.root});y.code((0,a._)`${c.default.self}.opts.$comment(${F}, ${re}, ${we}.schema)`)}}function X(y){const{gen:w,schemaEnv:I,validateName:A,ValidationError:D,opts:F}=y;I.$async?w.if((0,a._)`${c.default.errors} === 0`,()=>w.return(c.default.data),()=>w.throw((0,a._)`new ${D}(${c.default.vErrors})`)):(w.assign((0,a._)`${A}.errors`,c.default.vErrors),F.unevaluated&&Ne(y),w.return((0,a._)`${c.default.errors} === 0`))}function Ne({gen:y,evaluated:w,props:I,items:A}){I instanceof a.Name&&y.assign((0,a._)`${w}.props`,I),A instanceof a.Name&&y.assign((0,a._)`${w}.items`,A)}function Ve(y,w,I,A){const{gen:D,schema:F,data:re,allErrors:we,opts:ue,self:fe}=y,{RULES:ne}=fe;if(F.$ref&&(ue.ignoreKeywordsWithRef||!(0,u.schemaHasRulesButRef)(F,ne))){D.block(()=>C(y,"$ref",ne.all.$ref.definition));return}ue.jtd||at(y,w),D.block(()=>{for(const $e of ne.rules)Je($e);Je(ne.post)});function Je($e){(0,r.shouldUseGroup)(F,$e)&&($e.type?(D.if((0,n.checkDataType)($e.type,re,ue.strictNumbers)),Ge(y,$e),w.length===1&&w[0]===$e.type&&I&&(D.else(),(0,n.reportTypeError)(y)),D.endIf()):Ge(y,$e),we||D.if((0,a._)`${c.default.errors} === ${A||0}`))}}function Ge(y,w){const{gen:I,schema:A,opts:{useDefaults:D}}=y;D&&(0,s.assignDefaults)(y,w.type),I.block(()=>{for(const F of w.rules)(0,r.shouldUseRule)(A,F)&&C(y,F.keyword,F.definition,w.type)})}function at(y,w){y.schemaEnv.meta||!y.opts.strictTypes||(Qe(y,w),y.opts.allowUnionTypes||O(y,w),b(y,y.dataTypes))}function Qe(y,w){if(w.length){if(!y.dataTypes.length){y.dataTypes=w;return}w.forEach(I=>{S(y.dataTypes,I)||h(y,`type "${I}" not allowed by context "${y.dataTypes.join(",")}"`)}),l(y,w)}}function O(y,w){w.length>1&&!(w.length===2&&w.includes("null"))&&h(y,"use allowUnionTypes to allow union type keyword")}function b(y,w){const I=y.self.RULES.all;for(const A in I){const D=I[A];if(typeof D=="object"&&(0,r.shouldUseRule)(y.schema,D)){const{type:F}=D.definition;F.length&&!F.some(re=>N(w,re))&&h(y,`missing type "${F.join(",")}" for keyword "${A}"`)}}}function N(y,w){return y.includes(w)||w==="number"&&y.includes("integer")}function S(y,w){return y.includes(w)||w==="integer"&&y.includes("number")}function l(y,w){const I=[];for(const A of y.dataTypes)S(w,A)?I.push(A):w.includes("integer")&&A==="number"&&I.push("integer");y.dataTypes=I}function h(y,w){const I=y.schemaEnv.baseId+y.errSchemaPath;w+=` at "${I}" (strictTypes)`,(0,u.checkStrictMode)(y,w,y.opts.strictTypes)}class P{constructor(w,I,A){if((0,i.validateKeywordUsage)(w,I,A),this.gen=w.gen,this.allErrors=w.allErrors,this.keyword=A,this.data=w.data,this.schema=w.schema[A],this.$data=I.$data&&w.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,u.schemaRefOrVal)(w,this.schema,A,this.$data),this.schemaType=I.schemaType,this.parentSchema=w.schema,this.params={},this.it=w,this.def=I,this.$data)this.schemaCode=w.gen.const("vSchema",B(this.$data,w));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,I.schemaType,I.allowUndefined))throw new Error(`${A} value must be ${JSON.stringify(I.schemaType)}`);("code"in I?I.trackErrors:I.errors!==!1)&&(this.errsCount=w.gen.const("_errs",c.default.errors))}result(w,I,A){this.failResult((0,a.not)(w),I,A)}failResult(w,I,A){this.gen.if(w),A?A():this.error(),I?(this.gen.else(),I(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(w,I){this.failResult((0,a.not)(w),void 0,I)}fail(w){if(w===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(w),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(w){if(!this.$data)return this.fail(w);const{schemaCode:I}=this;this.fail((0,a._)`${I} !== undefined && (${(0,a.or)(this.invalid$data(),w)})`)}error(w,I,A){if(I){this.setParams(I),this._error(w,A),this.setParams({});return}this._error(w,A)}_error(w,I){(w?f.reportExtraError:f.reportError)(this,this.def.error,I)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(w){this.allErrors||this.gen.if(w)}setParams(w,I){I?Object.assign(this.params,w):this.params=w}block$data(w,I,A=a.nil){this.gen.block(()=>{this.check$data(w,A),I()})}check$data(w=a.nil,I=a.nil){if(!this.$data)return;const{gen:A,schemaCode:D,schemaType:F,def:re}=this;A.if((0,a.or)((0,a._)`${D} === undefined`,I)),w!==a.nil&&A.assign(w,!0),(F.length||re.validateSchema)&&(A.elseIf(this.invalid$data()),this.$dataError(),w!==a.nil&&A.assign(w,!1)),A.else()}invalid$data(){const{gen:w,schemaCode:I,schemaType:A,def:D,it:F}=this;return(0,a.or)(re(),we());function re(){if(A.length){if(!(I instanceof a.Name))throw new Error("ajv implementation error");const ue=Array.isArray(A)?A:[A];return(0,a._)`${(0,n.checkDataTypes)(ue,I,F.opts.strictNumbers,n.DataType.Wrong)}`}return a.nil}function we(){if(D.validateSchema){const ue=w.scopeValue("validate$data",{ref:D.validateSchema});return(0,a._)`!${ue}(${I})`}return a.nil}}subschema(w,I){const A=(0,o.getSubschema)(this.it,w);(0,o.extendSubschemaData)(A,this.it,w),(0,o.extendSubschemaMode)(A,w);const D=oe(K(K({},this.it),A),{items:void 0,props:void 0});return k(D,I),D}mergeEvaluated(w,I){const{it:A,gen:D}=this;A.opts.unevaluated&&(A.props!==!0&&w.props!==void 0&&(A.props=u.mergeEvaluated.props(D,w.props,A.props,I)),A.items!==!0&&w.items!==void 0&&(A.items=u.mergeEvaluated.items(D,w.items,A.items,I)))}mergeValidEvaluated(w,I){const{it:A,gen:D}=this;if(A.opts.unevaluated&&(A.props!==!0||A.items!==!0))return D.if(I,()=>this.mergeEvaluated(w,a.Name)),!0}}Ae.KeywordCxt=P;function C(y,w,I,A){const D=new P(y,I,w);"code"in I?I.code(D,A):D.$data&&I.validate?(0,i.funcKeywordCode)(D,I):"macro"in I?(0,i.macroKeywordCode)(D,I):(I.compile||I.validate)&&(0,i.funcKeywordCode)(D,I)}const q=/^\/(?:[^~]|~0|~1)*$/,G=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function B(y,{dataLevel:w,dataNames:I,dataPathArr:A}){let D,F;if(y==="")return c.default.rootData;if(y[0]==="/"){if(!q.test(y))throw new Error(`Invalid JSON-pointer: ${y}`);D=y,F=c.default.rootData}else{const fe=G.exec(y);if(!fe)throw new Error(`Invalid JSON-pointer: ${y}`);const ne=+fe[1];if(D=fe[2],D==="#"){if(ne>=w)throw new Error(ue("property/index",ne));return A[w-ne]}if(ne>w)throw new Error(ue("data",ne));if(F=I[w-ne],!D)return F}let re=F;const we=D.split("/");for(const fe of we)fe&&(F=(0,a._)`${F}${(0,a.getProperty)((0,u.unescapeJsonPointer)(fe))}`,re=(0,a._)`${re} && ${F}`);return re;function ue(fe,ne){return`Cannot access ${fe} ${ne} levels up, current level is ${w}`}}return Ae.getData=B,Ae}var bt={};Object.defineProperty(bt,"__esModule",{value:!0});class _o extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}bt.default=_o;var nt={};Object.defineProperty(nt,"__esModule",{value:!0});const Zt=ie;class vo extends Error{constructor(t,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Zt.resolveUrl)(t,r,n),this.missingSchema=(0,Zt.normalizeId)((0,Zt.getFullPath)(t,this.missingRef))}}nt.default=vo;var ye={};Object.defineProperty(ye,"__esModule",{value:!0});ye.resolveSchema=ye.getCompilingSchema=ye.resolveRef=ye.compileSchema=ye.SchemaEnv=void 0;const Se=z,bo=bt,Fe=qe(),ke=ie,Rn=T,wo=zt();class Kt{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,ke.normalizeId)(n==null?void 0:n[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n==null?void 0:n.$async,this.refs={}}}ye.SchemaEnv=Kt;function kr(e){const t=$s.call(this,e);if(t)return t;const r=(0,ke.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new Se.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i});let a;e.$async&&(a=o.scopeValue("Error",{ref:bo.default,code:(0,Se._)`require("ajv/dist/runtime/validation_error").default`}));const c=o.scopeName("validate");e.validateName=c;const d={gen:o,allErrors:this.opts.allErrors,data:Fe.default.data,parentData:Fe.default.parentData,parentDataProperty:Fe.default.parentDataProperty,dataNames:[Fe.default.data],dataPathArr:[Se.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Se.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Se.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Se._)`""`,opts:this.opts,self:this};let u;try{this._compilations.add(e),(0,wo.validateFunctionCode)(d),o.optimize(this.opts.code.optimize);const f=o.toString();u=`${o.scopeRefs(Fe.default.scope)}return ${f}`,this.opts.code.process&&(u=this.opts.code.process(u,e));const $=new Function(`${Fe.default.self}`,`${Fe.default.scope}`,u)(this,this.scope.get());if(this.scope.value(c,{ref:$}),$.errors=null,$.schema=e.schema,$.schemaEnv=e,e.$async&&($.$async=!0),this.opts.code.source===!0&&($.source={validateName:c,validateCode:f,scopeValues:o._values}),this.opts.unevaluated){const{props:g,items:v}=d;$.evaluated={props:g instanceof Se.Name?void 0:g,items:v instanceof Se.Name?void 0:v,dynamicProps:g instanceof Se.Name,dynamicItems:v instanceof Se.Name},$.source&&($.source.evaluated=(0,Se.stringify)($.evaluated))}return e.validate=$,e}catch(f){throw delete e.validate,delete e.validateName,u&&this.logger.error("Error compiling schema, function code:",u),f}finally{this._compilations.delete(e)}}ye.compileSchema=kr;function Eo(e,t,r){var n;r=(0,ke.resolveUrl)(this.opts.uriResolver,t,r);const s=e.refs[r];if(s)return s;let i=ko.call(this,e,r);if(i===void 0){const o=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;o&&(i=new Kt({schema:o,schemaId:a,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=So.call(this,i)}ye.resolveRef=Eo;function So(e){return(0,ke.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:kr.call(this,e)}function $s(e){for(const t of this._compilations)if(Po(t,e))return t}ye.getCompilingSchema=$s;function Po(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function ko(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||Bt.call(this,e,t)}function Bt(e,t){const r=this.opts.uriResolver.parse(t),n=(0,ke._getFullPath)(this.opts.uriResolver,r);let s=(0,ke.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return Xt.call(this,r,e);const i=(0,ke.normalizeId)(n),o=this.refs[i]||this.schemas[i];if(typeof o=="string"){const a=Bt.call(this,e,o);return typeof(a==null?void 0:a.schema)!="object"?void 0:Xt.call(this,r,a)}if(typeof(o==null?void 0:o.schema)=="object"){if(o.validate||kr.call(this,o),i===(0,ke.normalizeId)(t)){const{schema:a}=o,{schemaId:c}=this.opts,d=a[c];return d&&(s=(0,ke.resolveUrl)(this.opts.uriResolver,s,d)),new Kt({schema:a,schemaId:c,root:e,baseId:s})}return Xt.call(this,r,o)}}ye.resolveSchema=Bt;const Io=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Xt(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(const a of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const c=r[(0,Rn.unescapeFragment)(a)];if(c===void 0)return;r=c;const d=typeof r=="object"&&r[this.opts.schemaId];!Io.has(a)&&d&&(t=(0,ke.resolveUrl)(this.opts.uriResolver,t,d))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,Rn.schemaHasRulesButRef)(r,this.RULES)){const a=(0,ke.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=Bt.call(this,n,a)}const{schemaId:o}=this.opts;if(i=i||new Kt({schema:r,schemaId:o,root:n,baseId:t}),i.schema!==i.root.schema)return i}const No="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Ao="Meta-schema for $data reference (JSON AnySchema extension proposal)",Oo="object",Ro=["$data"],To={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},jo=!1,Co={$id:No,description:Ao,type:Oo,required:Ro,properties:To,additionalProperties:jo};var Ir={},xt={exports:{}};const Lo=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Nr=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),Do=RegExp.prototype.test.bind(/^\d*$/u),st=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Ar=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),_s=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),Or=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),qo=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),me=new Array(256);{const e="0123456789ABCDEF";for(let t=0;t<256;t++)me[t]="%"+e[t>>4]+e[t&15]}function ae(e){return e<2048?me[192|e>>6]+me[128|e&63]:e<65536?me[224|e>>12]+me[128|e>>6&63]+me[128|e&63]:me[240|e>>18]+me[128|e>>12&63]+me[128|e>>6&63]+me[128|e&63]}const Vo=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),Mo=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),Fo=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),Uo=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function zo(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++)if(!Fo(e[t])){if(e[t]==="%"&&t+2<e.length&&st(e.slice(t+1,t+3))){t+=2;continue}return!1}return!0}function Tn(e){let t=-1,r=0,n=-1,s=0;for(let a=0;a<e.length;a++)e[a]==="0"?(n===-1&&(n=a),s++,s>r&&(r=s,t=n)):(n=-1,s=0);if(r<2)return e.join(":");const i=e.slice(0,t).join(":"),o=e.slice(t+r).join(":");return i+"::"+o}function Ko(e){const t=e.indexOf("::");if(t!==-1&&e.indexOf("::",t+1)!==-1)return;const r=t===-1?e.split(":"):e.slice(0,t).split(":"),n=t===-1?[]:e.slice(t+2).split(":");t!==-1&&(r.length===1&&r[0]===""&&(r.length=0),n.length===1&&n[0]===""&&(n.length=0));const s=r.concat(n);let i=0;for(let a=0;a<s.length;a++){const c=s[a];if(c==="")return;if(c.indexOf(".")!==-1){if(a!==s.length-1||t!==-1&&n.length===0||!Nr(c))return;i+=2;continue}if(!Vo(c))return;s[a]=parseInt(c,16).toString(16),i++}if(t===-1)return i!==8?void 0:Tn(s);if(i>=8)return;const o=s.slice(0,r.length);for(let a=i;a<8;a++)o.push("0");for(let a=r.length;a<s.length;a++)o.push(s[a]);return Tn(o)}function dr(e){const t=e[0]==="["&&e[e.length-1]==="]";if((e[0]==="["||e[e.length-1]==="]")&&!t)return{host:e,isIPV6:!1,error:!0};let n=t?e.slice(1,-1):e;if(t&&Mo(n))return n=n.toLowerCase(),{host:`[${n}]`,escapedHost:n,isIPV6:!1,isIPVFuture:!0};if(Bo(n,":")<2)return{host:e,isIPV6:!1,error:t};let s="";const i=n.indexOf("%");if(i!==-1){const a=n.slice(i,i+3).toLowerCase()==="%25"?3:1;if(s=n.slice(i+a),!zo(s))return{host:e,isIPV6:!1,error:!0};n=n.slice(0,i)}const o=Ko(n);return o===void 0?{host:e,isIPV6:!1,error:!0}:{host:o+(s?"%"+s:""),escapedHost:o+(s?"%25"+s:""),isIPV6:!0}}function Bo(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}function xo(e){let t=e;const r=[];let n=-1,s=0;for(;s=t.length;){if(s===1){if(t===".")break;if(t==="/"){r.push("/");break}else{r.push(t);break}}else if(s===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){r.push("/");break}}else if(s===3&&t==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),r.length!==0&&r.pop();continue}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}const Ho={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},Go=/[@/?#:]/g,Qo=/[@/?#]/g;function vs(e,t){const r=t?Qo:Go;return r.lastIndex=0,e.replace(r,n=>Ho[n])}function bs(e,t=!1){if(e.indexOf("%")===-1)return e;let r="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){const s=e.slice(n+1,n+3);if(st(s)){const i=s.toUpperCase(),o=String.fromCharCode(parseInt(i,16));t&&Ar(o)?r+=o:r+="%"+i,n+=2;continue}}r+=e[n]}return r}function Jo(e){let t="";for(let r=0;r<e.length;r++){const n=e[r];if(n==="%"&&r+2<e.length){const s=e.slice(r+1,r+3);if(st(s)){const i=s.toUpperCase(),o=String.fromCharCode(parseInt(i,16));o!=="."&&Ar(o)?t+=o:t+="%"+i,r+=2;continue}}if(_s(n))t+=n;else{const s=e.charCodeAt(r);if(s<128)t+=ws(s)?n:me[s];else if(s<55296||s>57343)t+=ae(s);else if(s<=56319&&r+1<e.length){const i=e.charCodeAt(r+1);i>=56320&&i<=57343?(t+=ae(65536+(s-55296<<10)+(i-56320)),r++):t+=ae(65533)}else t+=ae(65533)}}return t}function Yo(e,t=!1){let r="",n=t&&e[0]!=="/";for(let s=0;s<e.length;s++){const i=e[s];if(i==="%"&&s+2<e.length){const o=e.slice(s+1,s+3);if(st(o)){r+="%"+o.toUpperCase(),s+=2;continue}}if(i==="/"&&(n=!1),_s(i)&&(i!==":"||!n))r+=i;else{const o=e.charCodeAt(s);if(o<128)r+=me[o];else if(o<55296||o>57343)r+=ae(o);else if(o<=56319&&s+1<e.length){const a=e.charCodeAt(s+1);a>=56320&&a<=57343?(r+=ae(65536+(o-55296<<10)+(a-56320)),s++):r+=ae(65533)}else r+=ae(65533)}}return r}function Rr(e,t){let r="";for(let n=0;n<e.length;n++){const s=e[n];if(s==="%"&&n+2<e.length){const i=e.slice(n+1,n+3);if(st(i)){r+="%"+i.toUpperCase(),n+=2;continue}}if(t(s))r+=s;else{const i=e.charCodeAt(n);if(i<128)r+=me[i];else if(i<55296||i>57343)r+=ae(i);else if(i<=56319&&n+1<e.length){const o=e.charCodeAt(n+1);o>=56320&&o<=57343?(r+=ae(65536+(i-55296<<10)+(o-56320)),n++):r+=ae(65533)}else r+=ae(65533)}}return r}function Wo(e){return Rr(e,qo)}function Zo(e){return Rr(e,Or)}function Xo(e){return Rr(e,Or)}function ws(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===42||e===43||e===45||e===46||e===47||e===64||e===95}function ea(e){let t="";for(let r=0;r<e.length;r++){const n=e[r];if(n==="%"&&r+2<e.length){const s=e.slice(r+1,r+3);if(st(s)){const i=s.toUpperCase(),o=String.fromCharCode(parseInt(i,16));Ar(o)?t+=o:t+="%"+i,r+=2;continue}}if(Or(n))t+=n;else{const s=e.charCodeAt(r);if(s<128)t+=ws(s)?n:me[s];else if(s<55296||s>57343)t+=ae(s);else if(s<=56319&&r+1<e.length){const i=e.charCodeAt(r+1);i>=56320&&i<=57343?(t+=ae(65536+(s-55296<<10)+(i-56320)),r++):t+=ae(65533)}else t+=ae(65533)}}return t}function ta(e){const t=[];if(e.userinfo!==void 0&&(t.push(Wo(e.userinfo)),t.push("@")),e.host!==void 0){let r=e.host;if(!Nr(r)){let n=dr(r);n.isIPV6!==!0&&n.isIPVFuture!==!0&&(r=bs(r,!0),n=dr(r)),n.isIPV6===!0||n.isIPVFuture===!0?r=`[${n.escapedHost}]`:r=vs(r,!1)}t.push(r)}if(typeof e.port=="number"||typeof e.port=="string"){const r=String(e.port);if(!Do(r))throw new TypeError("URI port is malformed.");t.push(":"),t.push(r)}return t.length?t.join(""):void 0}var Es={nonSimpleDomain:Uo,recomposeAuthority:ta,reescapeHostDelimiters:vs,normalizePercentEncoding:bs,normalizePathEncoding:Jo,serializePathEncoding:Yo,normalizeQueryFragmentEncoding:ea,encodeQuery:Zo,encodeFragment:Xo,removeDotSegments:xo,isIPv4:Nr,isUUID:Lo,normalizeIPv6:dr};const{isUUID:ra}=Es,na=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu;function Ss(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function Ps(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function ks(e){const t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function sa(e){return e.secure=Ss(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function ia(e){if((e.port===(Ss(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const t=e.resourceName.indexOf("?"),r=t===-1?e.resourceName:e.resourceName.slice(0,t);e.path=r&&r!=="/"?r:void 0,e.query=t===-1?void 0:e.resourceName.slice(t+1),e.resourceName=void 0}return e.fragment=void 0,e}function oa(e,t){if(!e.path)return e.error="URN can not be parsed",e;const r=e.path.match(na);if(r&&r[0]===e.path){const n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];const s=`${n}:${t.nid||e.nid}`,i=Tr(s);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function aa(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");const r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),s=`${r}:${t.nid||n}`,i=Tr(s);i&&(e=i.serialize(e,t));const o=e,a=e.nss;return o.path=`${n||t.nid}:${a}`,t.skipEscape=!0,o}function ca(e,t){const r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!ra(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function la(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t}const Is={scheme:"http",domainHost:!0,parse:Ps,serialize:ks},da={scheme:"https",domainHost:Is.domainHost,parse:Ps,serialize:ks},Rt={scheme:"ws",domainHost:!0,parse:sa,serialize:ia},ua={scheme:"wss",domainHost:Rt.domainHost,parse:Rt.parse,serialize:Rt.serialize},fa={scheme:"urn",parse:oa,serialize:aa,skipNormalize:!0},ha={scheme:"urn:uuid",parse:ca,serialize:la,skipNormalize:!0},Dt={http:Is,https:da,ws:Rt,wss:ua,urn:fa,"urn:uuid":ha};Object.setPrototypeOf(Dt,null);function Tr(e){return e&&(Dt[e]||Dt[e.toLowerCase()])||void 0}var pa={SCHEMES:Dt,getSchemeHandler:Tr};const{normalizeIPv6:Ns,removeDotSegments:ht,recomposeAuthority:ma,normalizePercentEncoding:As,normalizePathEncoding:ya,serializePathEncoding:jn,normalizeQueryFragmentEncoding:Cn,encodeQuery:ga,encodeFragment:$a,reescapeHostDelimiters:_a,isIPv4:Os,nonSimpleDomain:va}=Es,{SCHEMES:Rs,getSchemeHandler:jr}=pa,Ts=/^[A-Za-z][A-Za-z0-9+.-]*$/u,js="URI scheme is malformed.";function Ln(e){const t=unescape(String(e));if(!Ts.test(t))throw new TypeError(js);return t}function ba(e,t){return typeof e=="string"?e=Aa(e,t):typeof e=="object"&&(e=Vt(xe(e,t),t)),e}function wa(e,t,r){const n=r?Object.assign({scheme:"null"},r):{scheme:"null"},{parsed:s,malformedAuthorityOrPort:i,malformedPercentEncoding:o,malformedSchemeSpecific:a,malformedHost:c,malformedScheme:d}=qt(e,n),{parsed:u,malformedAuthorityOrPort:f,malformedPercentEncoding:_,malformedSchemeSpecific:$,malformedHost:g,malformedScheme:v}=qt(t,n);if(i||f||o||_||a||$||c||g||d||v)throw new Error(s.error||u.error||"URI is malformed.");const m=Cs(s,u,n,!0),p=jr(r&&r.scheme||m.scheme),E=m.host,k=E!==void 0&&E!==""&&(Os(E)||Ns(E).isIPV6);Ls(m,r||{},p,k);const R=E&&E.indexOf("%")!==-1&&!new RegExp("\\P{ASCII}","u").test(E);if(m.error&&!R)throw new Error(m.error);return n.skipEscape=!0,xe(m,n)}function Cs(e,t,r,n){const s={};return n||(e=Vt(xe(e,r),r),t=Vt(xe(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(s.scheme=t.scheme,s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=ht(t.path||""),s.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=ht(t.path||""),s.query=t.query):(t.path?(t.path[0]==="/"?s.path=ht(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?s.path="/"+t.path:e.path?s.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:s.path=t.path,s.path=ht(s.path)),s.query=t.query):(s.path=e.path,t.query!==void 0?s.query=t.query:s.query=e.query),s.userinfo=e.userinfo,s.host=e.host,s.port=e.port),s.scheme=e.scheme),s.fragment=t.fragment,s}function Ea(e,t,r){const n=Dn(e,r),s=Dn(t,r);return n!==void 0&&s!==void 0&&n===s}function xe(e,t){const r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),s=[];r.scheme&&(r.scheme=Ln(r.scheme));const i=jr(n.scheme||r.scheme);i&&i.serialize&&i.serialize(r,n);const o=r.userinfo!==void 0||r.host!==void 0||r.port!==void 0,a=!n.skipEscape&&r.scheme===void 0&&!o;r.path!==void 0&&(n.skipEscape?r.path=As(r.path):r.path=jn(r.path,a)),n.reference!=="suffix"&&r.scheme&&(r.scheme=Ln(r.scheme),s.push(r.scheme,":"));const c=ma(r);if(c!==void 0&&(n.reference!=="suffix"&&s.push("//"),s.push(c),r.path&&r.path[0]!=="/"&&s.push("/")),r.path!==void 0){let d=r.path;!n.absolutePath&&(!i||!i.absolutePath)&&(d=ht(d)),a&&(d=jn(d,!0)),c===void 0&&d[0]==="/"&&d[1]==="/"&&(d="/%2F"+d.slice(2)),s.push(d)}return r.query!==void 0&&s.push("?",ga(r.query)),r.fragment!==void 0&&s.push("#",$a(r.fragment)),s.join("")}const Sa=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,Pa=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,ka=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function Ia(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port=="number"&&(e.port<0||e.port>65535))return"URI port is malformed."}function dt(e){if(e===void 0)return!1;let t=e.indexOf("%");for(;t!==-1;){if(t+2>=e.length||!/^[\da-f]{2}$/iu.test(e.slice(t+1,t+3)))return!0;t=e.indexOf("%",t+3)}return!1}function Cr(e){return e[0]==="["&&e[e.length-1]==="]"}function Na(e){const t=e[4];return dt(e[3])||t!==void 0&&!Cr(t)&&dt(t)||dt(e[6])||dt(e[7])||dt(e[8])}function Ls(e,t,r,n){if(!t.unicodeSupport&&(!r||!r.unicodeSupport)&&e.host&&!Cr(e.host)&&(t.domainHost||r&&r.domainHost)&&n===!1&&va(e.host))try{e.host=new URL("http://"+e.host).hostname}catch(s){return e.error=e.error||"Host's domain name can not be converted to ASCII: "+s,!0}return!1}function qt(e,t){const r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let s=!1,i=!1,o=!1,a=!1,c=!1,d=!1,u=!1;r.reference==="suffix"&&(r.scheme?e=r.scheme+":"+e:e="//"+e);const f=e.match(Pa);f!==null&&f[1].indexOf("\\")!==-1&&(n.error="URI authority must not contain a literal backslash.",s=!0);const _=e.match(ka);if(_!==null){const g=_[1],v=g.replace(/[\t\n\r]/g,"");v.length>=2&&(v.slice(0,2)!=="//"?(n.error=n.error||"URI authority must not contain a literal backslash.",s=!0):g.length!==v.length&&(n.error=n.error||"URI authority introducer must not contain whitespace.",s=!0))}const $=e.match(Sa);if($){if(n.scheme=$[1],n.userinfo=$[3],n.host=$[4],n.port=parseInt($[5],10),n.path=$[6]||"",n.query=$[7],n.fragment=$[8],n.scheme!==void 0){const m=unescape(n.scheme);Ts.test(m)?n.scheme=m.toLowerCase():(n.error=n.error||js,d=!0)}i=Na($),i&&(n.error=n.error||"URI contains malformed percent-encoding."),isNaN(n.port)&&(n.port=$[5]);const g=Ia(n,$);if(g!==void 0&&(n.error=n.error||g,s=!0),n.host)if(Os(n.host)===!1){const p=Cr(n.host),E=n.host.indexOf("[")!==-1||n.host.indexOf("]")!==-1,k=Ns(n.host);u=k.isIPV6||k.isIPVFuture===!0,c=E&&(!p||k.error===!0),n.host=u?k.host:k.host.toLowerCase(),c&&(n.error=n.error||"URI host is malformed.",s=!0)}else u=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");const v=jr(r.scheme||n.scheme);if(c||(a=Ls(n,r,v,u)),!v||v&&!v.skipNormalize){if(e.indexOf("%")!==-1&&n.host!==void 0&&!c){const m=u?n.host:As(n.host,!0);n.host=_a(m,u)}n.path&&(n.path=ya(n.path)),n.query&&(n.query=Cn(n.query)),n.fragment&&(n.fragment=Cn(n.fragment))}v&&v.parse&&(v.parse(n,r),v===Rs.urn&&n.nid===void 0&&(o=!0))}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:s,malformedPercentEncoding:i,malformedSchemeSpecific:o,malformedHost:a,malformedScheme:d}}function Vt(e,t){return qt(e,t).parsed}function Aa(e,t){return Ds(e,t).normalized}function Ds(e,t){const{parsed:r,malformedAuthorityOrPort:n,malformedPercentEncoding:s,malformedSchemeSpecific:i,malformedHost:o,malformedScheme:a}=qt(e,t);return{normalized:n||s||i||o||a?e:xe(r,t),malformedAuthorityOrPort:n,malformedPercentEncoding:s,malformedSchemeSpecific:i,malformedHost:o,malformedScheme:a}}function Dn(e,t){if(typeof e!="string"&&typeof e!="object")return;let r;try{r=typeof e=="string"?e:xe(e,t)}catch(d){return}const{normalized:n,malformedAuthorityOrPort:s,malformedPercentEncoding:i,malformedSchemeSpecific:o,malformedHost:a,malformedScheme:c}=Ds(r,t);return s||i||o||a||c?void 0:n}const Lr={SCHEMES:Rs,normalize:ba,resolve:wa,resolveComponent:Cs,equal:Ea,serialize:xe,parse:Vt};xt.exports=Lr;xt.exports.default=Lr;xt.exports.fastUri=Lr;var Oa=xt.exports;Object.defineProperty(Ir,"__esModule",{value:!0});const qs=Oa;qs.code='require("ajv/dist/runtime/uri").default';Ir.default=qs;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=zt();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=z;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=bt,s=nt,i=Be,o=ye,a=z,c=ie,d=ee,u=T,f=Co,_=Ir,$=(O,b)=>new RegExp(O,b);$.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],v=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),m={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},p={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},E=200;function k(O){var b,N,S,l,h,P,C,q,G,B,y,w,I,A,D,F,re,we,ue,fe,ne,Je,$e,Qt,Jt;const ct=O.strict,Yt=(b=O.code)===null||b===void 0?void 0:b.optimize,yn=Yt===!0||Yt===void 0?1:Yt||0,gn=(S=(N=O.code)===null||N===void 0?void 0:N.regExp)!==null&&S!==void 0?S:$,Js=(l=O.uriResolver)!==null&&l!==void 0?l:_.default;return{strictSchema:(P=(h=O.strictSchema)!==null&&h!==void 0?h:ct)!==null&&P!==void 0?P:!0,strictNumbers:(q=(C=O.strictNumbers)!==null&&C!==void 0?C:ct)!==null&&q!==void 0?q:!0,strictTypes:(B=(G=O.strictTypes)!==null&&G!==void 0?G:ct)!==null&&B!==void 0?B:"log",strictTuples:(w=(y=O.strictTuples)!==null&&y!==void 0?y:ct)!==null&&w!==void 0?w:"log",strictRequired:(A=(I=O.strictRequired)!==null&&I!==void 0?I:ct)!==null&&A!==void 0?A:!1,code:O.code?oe(K({},O.code),{optimize:yn,regExp:gn}):{optimize:yn,regExp:gn},loopRequired:(D=O.loopRequired)!==null&&D!==void 0?D:E,loopEnum:(F=O.loopEnum)!==null&&F!==void 0?F:E,meta:(re=O.meta)!==null&&re!==void 0?re:!0,messages:(we=O.messages)!==null&&we!==void 0?we:!0,inlineRefs:(ue=O.inlineRefs)!==null&&ue!==void 0?ue:!0,schemaId:(fe=O.schemaId)!==null&&fe!==void 0?fe:"$id",addUsedSchema:(ne=O.addUsedSchema)!==null&&ne!==void 0?ne:!0,validateSchema:(Je=O.validateSchema)!==null&&Je!==void 0?Je:!0,validateFormats:($e=O.validateFormats)!==null&&$e!==void 0?$e:!0,unicodeRegExp:(Qt=O.unicodeRegExp)!==null&&Qt!==void 0?Qt:!0,int32range:(Jt=O.int32range)!==null&&Jt!==void 0?Jt:!0,uriResolver:Js}}class R{constructor(b={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,b=this.opts=K(K({},b),k(b));const{es5:N,lines:S}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:v,es5:N,lines:S}),this.logger=de(b.logger);const l=b.validateFormats;b.validateFormats=!1,this.RULES=(0,i.getRules)(),j.call(this,m,b,"NOT SUPPORTED"),j.call(this,p,b,"DEPRECATED","warn"),this._metaOpts=ve.call(this),b.formats&&le.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),b.keywords&&ge.call(this,b.keywords),typeof b.meta=="object"&&this.addMetaSchema(b.meta),Q.call(this),b.validateFormats=l}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:b,meta:N,schemaId:S}=this.opts;let l=f;S==="id"&&(l=K({},f),l.id=l.$id,delete l.$id),N&&b&&this.addMetaSchema(l,l[S],!1)}defaultMeta(){const{meta:b,schemaId:N}=this.opts;return this.opts.defaultMeta=typeof b=="object"?b[N]||b:void 0}validate(b,N){let S;if(typeof b=="string"){if(S=this.getSchema(b),!S)throw new Error(`no schema with key or ref "${b}"`)}else S=this.compile(b);const l=S(N);return"$async"in S||(this.errors=S.errors),l}compile(b,N){const S=this._addSchema(b,N);return S.validate||this._compileSchemaEnv(S)}compileAsync(b,N){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:S}=this.opts;return l.call(this,b,N);function l(B,y){return Ye(this,null,function*(){yield h.call(this,B.$schema);const w=this._addSchema(B,y);return w.validate||P.call(this,w)})}function h(B){return Ye(this,null,function*(){B&&!this.getSchema(B)&&(yield l.call(this,{$ref:B},!0))})}function P(B){return Ye(this,null,function*(){try{return this._compileSchemaEnv(B)}catch(y){if(!(y instanceof s.default))throw y;return C.call(this,y),yield q.call(this,y.missingSchema),P.call(this,B)}})}function C({missingSchema:B,missingRef:y}){if(this.refs[B])throw new Error(`AnySchema ${B} is loaded but ${y} cannot be resolved`)}function q(B){return Ye(this,null,function*(){const y=yield G.call(this,B);this.refs[B]||(yield h.call(this,y.$schema)),this.refs[B]||this.addSchema(y,B,N)})}function G(B){return Ye(this,null,function*(){const y=this._loading[B];if(y)return y;try{return yield this._loading[B]=S(B)}finally{delete this._loading[B]}})}}addSchema(b,N,S,l=this.opts.validateSchema){if(Array.isArray(b)){for(const P of b)this.addSchema(P,void 0,S,l);return this}let h;if(typeof b=="object"){const{schemaId:P}=this.opts;if(h=b[P],h!==void 0&&typeof h!="string")throw new Error(`schema ${P} must be string`)}return N=(0,c.normalizeId)(N||h),this._checkUnique(N),this.schemas[N]=this._addSchema(b,S,N,l,!0),this}addMetaSchema(b,N,S=this.opts.validateSchema){return this.addSchema(b,N,!0,S),this}validateSchema(b,N){if(typeof b=="boolean")return!0;let S;if(S=b.$schema,S!==void 0&&typeof S!="string")throw new Error("$schema must be a string");if(S=S||this.opts.defaultMeta||this.defaultMeta(),!S)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const l=this.validate(S,b);if(!l&&N){const h="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(h);else throw new Error(h)}return l}getSchema(b){let N;for(;typeof(N=H.call(this,b))=="string";)b=N;if(N===void 0){const{schemaId:S}=this.opts,l=new o.SchemaEnv({schema:{},schemaId:S});if(N=o.resolveSchema.call(this,l,b),!N)return;this.refs[b]=N}return N.validate||this._compileSchemaEnv(N)}removeSchema(b){if(b instanceof RegExp)return this._removeAllSchemas(this.schemas,b),this._removeAllSchemas(this.refs,b),this;switch(typeof b){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const N=H.call(this,b);return typeof N=="object"&&this._cache.delete(N.schema),delete this.schemas[b],delete this.refs[b],this}case"object":{const N=b;this._cache.delete(N);let S=b[this.opts.schemaId];return S&&(S=(0,c.normalizeId)(S),delete this.schemas[S],delete this.refs[S]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(b){for(const N of b)this.addKeyword(N);return this}addKeyword(b,N){let S;if(typeof b=="string")S=b,typeof N=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),N.keyword=S);else if(typeof b=="object"&&N===void 0){if(N=b,S=N.keyword,Array.isArray(S)&&!S.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(X.call(this,S,N),!N)return(0,u.eachItem)(S,h=>Ne.call(this,h)),this;Ge.call(this,N);const l=oe(K({},N),{type:(0,d.getJSONTypes)(N.type),schemaType:(0,d.getJSONTypes)(N.schemaType)});return(0,u.eachItem)(S,l.type.length===0?h=>Ne.call(this,h,l):h=>l.type.forEach(P=>Ne.call(this,h,l,P))),this}getKeyword(b){const N=this.RULES.all[b];return typeof N=="object"?N.definition:!!N}removeKeyword(b){const{RULES:N}=this;delete N.keywords[b],delete N.all[b];for(const S of N.rules){const l=S.rules.findIndex(h=>h.keyword===b);l>=0&&S.rules.splice(l,1)}return this}addFormat(b,N){return typeof N=="string"&&(N=new RegExp(N)),this.formats[b]=N,this}errorsText(b=this.errors,{separator:N=", ",dataVar:S="data"}={}){return!b||b.length===0?"No errors":b.map(l=>`${S}${l.instancePath} ${l.message}`).reduce((l,h)=>l+N+h)}$dataMetaSchema(b,N){const S=this.RULES.all;b=JSON.parse(JSON.stringify(b));for(const l of N){const h=l.split("/").slice(1);let P=b;for(const C of h)P=P[C];for(const C in S){const q=S[C];if(typeof q!="object")continue;const{$data:G}=q.definition,B=P[C];G&&B&&(P[C]=Qe(B))}}return b}_removeAllSchemas(b,N){for(const S in b){const l=b[S];(!N||N.test(S))&&(typeof l=="string"?delete b[S]:l&&!l.meta&&(this._cache.delete(l.schema),delete b[S]))}}_addSchema(b,N,S,l=this.opts.validateSchema,h=this.opts.addUsedSchema){let P;const{schemaId:C}=this.opts;if(typeof b=="object")P=b[C];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof b!="boolean")throw new Error("schema must be object or boolean")}let q=this._cache.get(b);if(q!==void 0)return q;S=(0,c.normalizeId)(P||S);const G=c.getSchemaRefs.call(this,b,S);return q=new o.SchemaEnv({schema:b,schemaId:C,meta:N,baseId:S,localRefs:G}),this._cache.set(q.schema,q),h&&!S.startsWith("#")&&(S&&this._checkUnique(S),this.refs[S]=q),l&&this.validateSchema(b,!0),q}_checkUnique(b){if(this.schemas[b]||this.refs[b])throw new Error(`schema with key or id "${b}" already exists`)}_compileSchemaEnv(b){if(b.meta?this._compileMetaSchema(b):o.compileSchema.call(this,b),!b.validate)throw new Error("ajv implementation error");return b.validate}_compileMetaSchema(b){const N=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,b)}finally{this.opts=N}}}R.ValidationError=n.default,R.MissingRefError=s.default,e.default=R;function j(O,b,N,S="error"){for(const l in O){const h=l;h in b&&this.logger[S](`${N}: option ${l}. ${O[h]}`)}}function H(O){return O=(0,c.normalizeId)(O),this.schemas[O]||this.refs[O]}function Q(){const O=this.opts.schemas;if(O)if(Array.isArray(O))this.addSchema(O);else for(const b in O)this.addSchema(O[b],b)}function le(){for(const O in this.opts.formats){const b=this.opts.formats[O];b&&this.addFormat(O,b)}}function ge(O){if(Array.isArray(O)){this.addVocabulary(O);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const b in O){const N=O[b];N.keyword||(N.keyword=b),this.addKeyword(N)}}function ve(){const O=K({},this.opts);for(const b of g)delete O[b];return O}const be={log(){},warn(){},error(){}};function de(O){if(O===!1)return be;if(O===void 0)return console;if(O.log&&O.warn&&O.error)return O;throw new Error("logger must implement log, warn and error methods")}const W=/^[a-z_$][a-z0-9_$:-]*$/i;function X(O,b){const{RULES:N}=this;if((0,u.eachItem)(O,S=>{if(N.keywords[S])throw new Error(`Keyword ${S} is already defined`);if(!W.test(S))throw new Error(`Keyword ${S} has invalid name`)}),!!b&&b.$data&&!("code"in b||"validate"in b))throw new Error('$data keyword must have "code" or "validate" function')}function Ne(O,b,N){var S;const l=b==null?void 0:b.post;if(N&&l)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:h}=this;let P=l?h.post:h.rules.find(({type:q})=>q===N);if(P||(P={type:N,rules:[]},h.rules.push(P)),h.keywords[O]=!0,!b)return;const C={keyword:O,definition:oe(K({},b),{type:(0,d.getJSONTypes)(b.type),schemaType:(0,d.getJSONTypes)(b.schemaType)})};b.before?Ve.call(this,P,C,b.before):P.rules.push(C),h.all[O]=C,(S=b.implements)===null||S===void 0||S.forEach(q=>this.addKeyword(q))}function Ve(O,b,N){const S=O.rules.findIndex(l=>l.keyword===N);S>=0?O.rules.splice(S,0,b):(O.rules.push(b),this.logger.warn(`rule ${N} is not defined`))}function Ge(O){let{metaSchema:b}=O;b!==void 0&&(O.$data&&this.opts.$data&&(b=Qe(b)),O.validateSchema=this.compile(b,!0))}const at={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Qe(O){return{anyOf:[O,at]}}})(es);var Dr={},qr={},Vr={};Object.defineProperty(Vr,"__esModule",{value:!0});const Ra={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Vr.default=Ra;var He={};Object.defineProperty(He,"__esModule",{value:!0});He.callRef=He.getValidate=void 0;const Ta=nt,qn=U,pe=z,We=qe(),Vn=ye,St=T,ja={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:i,validateName:o,opts:a,self:c}=n,{root:d}=i;if((r==="#"||r==="#/")&&s===d.baseId)return f();const u=Vn.resolveRef.call(c,d,s,r);if(u===void 0)throw new Ta.default(n.opts.uriResolver,s,r);if(u instanceof Vn.SchemaEnv)return _(u);return $(u);function f(){if(i===d)return Tt(e,o,i,i.$async);const g=t.scopeValue("root",{ref:d});return Tt(e,(0,pe._)`${g}.validate`,d,d.$async)}function _(g){const v=Vs(e,g);Tt(e,v,g,g.$async)}function $(g){const v=t.scopeValue("schema",a.code.source===!0?{ref:g,code:(0,pe.stringify)(g)}:{ref:g}),m=t.name("valid"),p=e.subschema({schema:g,dataTypes:[],schemaPath:pe.nil,topSchemaRef:v,errSchemaPath:r},m);e.mergeEvaluated(p),e.ok(m)}}};function Vs(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,pe._)`${r.scopeValue("wrapper",{ref:t})}.validate`}He.getValidate=Vs;function Tt(e,t,r,n){const{gen:s,it:i}=e,{allErrors:o,schemaEnv:a,opts:c}=i,d=c.passContext?We.default.this:pe.nil;n?u():f();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");const g=s.let("valid");s.try(()=>{s.code((0,pe._)`await ${(0,qn.callValidateCode)(e,t,d)}`),$(t),o||s.assign(g,!0)},v=>{s.if((0,pe._)`!(${v} instanceof ${i.ValidationError})`,()=>s.throw(v)),_(v),o||s.assign(g,!1)}),e.ok(g)}function f(){e.result((0,qn.callValidateCode)(e,t,d),()=>$(t),()=>_(t))}function _(g){const v=(0,pe._)`${g}.errors`;s.assign(We.default.vErrors,(0,pe._)`${We.default.vErrors} === null ? ${v} : ${We.default.vErrors}.concat(${v})`),s.assign(We.default.errors,(0,pe._)`${We.default.vErrors}.length`)}function $(g){var v;if(!i.opts.unevaluated)return;const m=(v=r==null?void 0:r.validate)===null||v===void 0?void 0:v.evaluated;if(i.props!==!0)if(m&&!m.dynamicProps)m.props!==void 0&&(i.props=St.mergeEvaluated.props(s,m.props,i.props));else{const p=s.var("props",(0,pe._)`${g}.evaluated.props`);i.props=St.mergeEvaluated.props(s,p,i.props,pe.Name)}if(i.items!==!0)if(m&&!m.dynamicItems)m.items!==void 0&&(i.items=St.mergeEvaluated.items(s,m.items,i.items));else{const p=s.var("items",(0,pe._)`${g}.evaluated.items`);i.items=St.mergeEvaluated.items(s,p,i.items,pe.Name)}}}He.callRef=Tt;He.default=ja;Object.defineProperty(qr,"__esModule",{value:!0});const Ca=Vr,La=He,Da=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Ca.default,La.default];qr.default=Da;var Mr={},Fr={};Object.defineProperty(Fr,"__esModule",{value:!0});const Mt=z,Le=Mt.operators,Ft={maximum:{okStr:"<=",ok:Le.LTE,fail:Le.GT},minimum:{okStr:">=",ok:Le.GTE,fail:Le.LT},exclusiveMaximum:{okStr:"<",ok:Le.LT,fail:Le.GTE},exclusiveMinimum:{okStr:">",ok:Le.GT,fail:Le.LTE}},qa={message:({keyword:e,schemaCode:t})=>(0,Mt.str)`must be ${Ft[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Mt._)`{comparison: ${Ft[e].okStr}, limit: ${t}}`},Va={keyword:Object.keys(Ft),type:"number",schemaType:"number",$data:!0,error:qa,code(e){const{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,Mt._)`${r} ${Ft[t].fail} ${n} || isNaN(${r})`)}};Fr.default=Va;var Ur={};Object.defineProperty(Ur,"__esModule",{value:!0});const mt=z,Ma={message:({schemaCode:e})=>(0,mt.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,mt._)`{multipleOf: ${e}}`},Fa={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Ma,code(e){const{gen:t,data:r,schemaCode:n,it:s}=e,i=s.opts.multipleOfPrecision,o=t.let("res"),a=i?(0,mt._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}`:(0,mt._)`${o} !== parseInt(${o})`;e.fail$data((0,mt._)`(${n} === 0 || (${o} = ${r}/${n}, ${a}))`)}};Ur.default=Fa;var zr={},Kr={};Object.defineProperty(Kr,"__esModule",{value:!0});function Ms(e){const t=e.length;let r=0,n=0,s;for(;n<t;)r++,s=e.charCodeAt(n++),s>=55296&&s<=56319&&n<t&&(s=e.charCodeAt(n),(s&64512)===56320&&n++);return r}Kr.default=Ms;Ms.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(zr,"__esModule",{value:!0});const Ue=z,Ua=T,za=Kr,Ka={message({keyword:e,schemaCode:t}){const r=e==="maxLength"?"more":"fewer";return(0,Ue.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,Ue._)`{limit: ${e}}`},Ba={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Ka,code(e){const{keyword:t,data:r,schemaCode:n,it:s}=e,i=t==="maxLength"?Ue.operators.GT:Ue.operators.LT,o=s.opts.unicode===!1?(0,Ue._)`${r}.length`:(0,Ue._)`${(0,Ua.useFunc)(e.gen,za.default)}(${r})`;e.fail$data((0,Ue._)`${o} ${i} ${n}`)}};zr.default=Ba;var Br={};Object.defineProperty(Br,"__esModule",{value:!0});const xa=U,Ha=T,Xe=z,Ga={message:({schemaCode:e})=>(0,Xe.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,Xe._)`{pattern: ${e}}`},Qa={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Ga,code(e){const{gen:t,data:r,$data:n,schema:s,schemaCode:i,it:o}=e,a=o.opts.unicodeRegExp?"u":"";if(n){const{regExp:c}=o.opts.code,d=c.code==="new RegExp"?(0,Xe._)`new RegExp`:(0,Ha.useFunc)(t,c),u=t.let("valid");t.try(()=>t.assign(u,(0,Xe._)`${d}(${i}, ${a}).test(${r})`),()=>t.assign(u,!1)),e.fail$data((0,Xe._)`!${u}`)}else{const c=(0,xa.usePattern)(e,s);e.fail$data((0,Xe._)`!${c}.test(${r})`)}}};Br.default=Qa;var xr={};Object.defineProperty(xr,"__esModule",{value:!0});const yt=z,Ja={message({keyword:e,schemaCode:t}){const r=e==="maxProperties"?"more":"fewer";return(0,yt.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,yt._)`{limit: ${e}}`},Ya={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Ja,code(e){const{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?yt.operators.GT:yt.operators.LT;e.fail$data((0,yt._)`Object.keys(${r}).length ${s} ${n}`)}};xr.default=Ya;var Hr={};Object.defineProperty(Hr,"__esModule",{value:!0});const ut=U,gt=z,Wa=T,Za={message:({params:{missingProperty:e}})=>(0,gt.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,gt._)`{missingProperty: ${e}}`},Xa={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Za,code(e){const{gen:t,schema:r,schemaCode:n,data:s,$data:i,it:o}=e,{opts:a}=o;if(!i&&r.length===0)return;const c=r.length>=a.loopRequired;if(o.allErrors?d():u(),a.strictRequired){const $=e.parentSchema.properties,{definedProperties:g}=e.it;for(const v of r)if(($==null?void 0:$[v])===void 0&&!g.has(v)){const m=o.schemaEnv.baseId+o.errSchemaPath,p=`required property "${v}" is not defined at "${m}" (strictRequired)`;(0,Wa.checkStrictMode)(o,p,o.opts.strictRequired)}}function d(){if(c||i)e.block$data(gt.nil,f);else for(const $ of r)(0,ut.checkReportMissingProp)(e,$)}function u(){const $=t.let("missing");if(c||i){const g=t.let("valid",!0);e.block$data(g,()=>_($,g)),e.ok(g)}else t.if((0,ut.checkMissingProp)(e,r,$)),(0,ut.reportMissingProp)(e,$),t.else()}function f(){t.forOf("prop",n,$=>{e.setParams({missingProperty:$}),t.if((0,ut.noPropertyInData)(t,s,$,a.ownProperties),()=>e.error())})}function _($,g){e.setParams({missingProperty:$}),t.forOf($,n,()=>{t.assign(g,(0,ut.propertyInData)(t,s,$,a.ownProperties)),t.if((0,gt.not)(g),()=>{e.error(),t.break()})},gt.nil)}}};Hr.default=Xa;var Gr={};Object.defineProperty(Gr,"__esModule",{value:!0});const $t=z,ec={message({keyword:e,schemaCode:t}){const r=e==="maxItems"?"more":"fewer";return(0,$t.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,$t._)`{limit: ${e}}`},tc={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:ec,code(e){const{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?$t.operators.GT:$t.operators.LT;e.fail$data((0,$t._)`${r}.length ${s} ${n}`)}};Gr.default=tc;var Qr={},wt={};Object.defineProperty(wt,"__esModule",{value:!0});const Fs=hs;Fs.code='require("ajv/dist/runtime/equal").default';wt.default=Fs;Object.defineProperty(Qr,"__esModule",{value:!0});const er=ee,se=z,rc=T,nc=wt,sc={message:({params:{i:e,j:t}})=>(0,se.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,se._)`{i: ${e}, j: ${t}}`},ic={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:sc,code(e){const{gen:t,data:r,$data:n,schema:s,parentSchema:i,schemaCode:o,it:a}=e;if(!n&&!s)return;const c=t.let("valid"),d=i.items?(0,er.getSchemaTypes)(i.items):[];e.block$data(c,u,(0,se._)`${o} === false`),e.ok(c);function u(){const g=t.let("i",(0,se._)`${r}.length`),v=t.let("j");e.setParams({i:g,j:v}),t.assign(c,!0),t.if((0,se._)`${g} > 1`,()=>(f()?_:$)(g,v))}function f(){return d.length>0&&!d.some(g=>g==="object"||g==="array")}function _(g,v){const m=t.name("item"),p=(0,er.checkDataTypes)(d,m,a.opts.strictNumbers,er.DataType.Wrong),E=t.const("indices",(0,se._)`{}`);t.for((0,se._)`;${g}--;`,()=>{t.let(m,(0,se._)`${r}[${g}]`),t.if(p,(0,se._)`continue`),d.length>1&&t.if((0,se._)`typeof ${m} == "string"`,(0,se._)`${m} += "_"`),t.if((0,se._)`typeof ${E}[${m}] == "number"`,()=>{t.assign(v,(0,se._)`${E}[${m}]`),e.error(),t.assign(c,!1).break()}).code((0,se._)`${E}[${m}] = ${g}`)})}function $(g,v){const m=(0,rc.useFunc)(t,nc.default),p=t.name("outer");t.label(p).for((0,se._)`;${g}--;`,()=>t.for((0,se._)`${v} = ${g}; ${v}--;`,()=>t.if((0,se._)`${m}(${r}[${g}], ${r}[${v}])`,()=>{e.error(),t.assign(c,!1).break(p)})))}}};Qr.default=ic;var Jr={};Object.defineProperty(Jr,"__esModule",{value:!0});const ur=z,oc=T,ac=wt,cc={message:"must be equal to constant",params:({schemaCode:e})=>(0,ur._)`{allowedValue: ${e}}`},lc={keyword:"const",$data:!0,error:cc,code(e){const{gen:t,data:r,$data:n,schemaCode:s,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,ur._)`!${(0,oc.useFunc)(t,ac.default)}(${r}, ${s})`):e.fail((0,ur._)`${i} !== ${r}`)}};Jr.default=lc;var Yr={};Object.defineProperty(Yr,"__esModule",{value:!0});const pt=z,dc=T,uc=wt,fc={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,pt._)`{allowedValues: ${e}}`},hc={keyword:"enum",schemaType:"array",$data:!0,error:fc,code(e){const{gen:t,data:r,$data:n,schema:s,schemaCode:i,it:o}=e;if(!n&&s.length===0)throw new Error("enum must have non-empty array");const a=s.length>=o.opts.loopEnum;let c;const d=()=>c!=null?c:c=(0,dc.useFunc)(t,uc.default);let u;if(a||n)u=t.let("valid"),e.block$data(u,f);else{if(!Array.isArray(s))throw new Error("ajv implementation error");const $=t.const("vSchema",i);u=(0,pt.or)(...s.map((g,v)=>_($,v)))}e.pass(u);function f(){t.assign(u,!1),t.forOf("v",i,$=>t.if((0,pt._)`${d()}(${r}, ${$})`,()=>t.assign(u,!0).break()))}function _($,g){const v=s[g];return typeof v=="object"&&v!==null?(0,pt._)`${d()}(${r}, ${$}[${g}])`:(0,pt._)`${r} === ${v}`}}};Yr.default=hc;Object.defineProperty(Mr,"__esModule",{value:!0});const pc=Fr,mc=Ur,yc=zr,gc=Br,$c=xr,_c=Hr,vc=Gr,bc=Qr,wc=Jr,Ec=Yr,Sc=[pc.default,mc.default,yc.default,gc.default,$c.default,_c.default,vc.default,bc.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},wc.default,Ec.default];Mr.default=Sc;var Wr={},it={};Object.defineProperty(it,"__esModule",{value:!0});it.validateAdditionalItems=void 0;const ze=z,fr=T,Pc={message:({params:{len:e}})=>(0,ze.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,ze._)`{limit: ${e}}`},kc={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Pc,code(e){const{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,fr.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Us(e,n)}};function Us(e,t){const{gen:r,schema:n,data:s,keyword:i,it:o}=e;o.items=!0;const a=r.const("len",(0,ze._)`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,ze._)`${a} <= ${t.length}`);else if(typeof n=="object"&&!(0,fr.alwaysValidSchema)(o,n)){const d=r.var("valid",(0,ze._)`${a} <= ${t.length}`);r.if((0,ze.not)(d),()=>c(d)),e.ok(d)}function c(d){r.forRange("i",t.length,a,u=>{e.subschema({keyword:i,dataProp:u,dataPropType:fr.Type.Num},d),o.allErrors||r.if((0,ze.not)(d),()=>r.break())})}}it.validateAdditionalItems=Us;it.default=kc;var Zr={},ot={};Object.defineProperty(ot,"__esModule",{value:!0});ot.validateTuple=void 0;const Mn=z,jt=T,Ic=U,Nc={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return zs(e,"additionalItems",t);r.items=!0,!(0,jt.alwaysValidSchema)(r,t)&&e.ok((0,Ic.validateArray)(e))}};function zs(e,t,r=e.schema){const{gen:n,parentSchema:s,data:i,keyword:o,it:a}=e;u(s),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=jt.mergeEvaluated.items(n,r.length,a.items));const c=n.name("valid"),d=n.const("len",(0,Mn._)`${i}.length`);r.forEach((f,_)=>{(0,jt.alwaysValidSchema)(a,f)||(n.if((0,Mn._)`${d} > ${_}`,()=>e.subschema({keyword:o,schemaProp:_,dataProp:_},c)),e.ok(c))});function u(f){const{opts:_,errSchemaPath:$}=a,g=r.length,v=g===f.minItems&&(g===f.maxItems||f[t]===!1);if(_.strictTuples&&!v){const m=`"${o}" is ${g}-tuple, but minItems or maxItems/${t} are not specified or different at path "${$}"`;(0,jt.checkStrictMode)(a,m,_.strictTuples)}}}ot.validateTuple=zs;ot.default=Nc;Object.defineProperty(Zr,"__esModule",{value:!0});const Ac=ot,Oc={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,Ac.validateTuple)(e,"items")};Zr.default=Oc;var Xr={};Object.defineProperty(Xr,"__esModule",{value:!0});const Fn=z,Rc=T,Tc=U,jc=it,Cc={message:({params:{len:e}})=>(0,Fn.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Fn._)`{limit: ${e}}`},Lc={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:Cc,code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;n.items=!0,!(0,Rc.alwaysValidSchema)(n,t)&&(s?(0,jc.validateAdditionalItems)(e,s):e.ok((0,Tc.validateArray)(e)))}};Xr.default=Lc;var en={};Object.defineProperty(en,"__esModule",{value:!0});const _e=z,Pt=T,Dc={message:({params:{min:e,max:t}})=>t===void 0?(0,_e.str)`must contain at least ${e} valid item(s)`:(0,_e.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,_e._)`{minContains: ${e}}`:(0,_e._)`{minContains: ${e}, maxContains: ${t}}`},qc={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Dc,code(e){const{gen:t,schema:r,parentSchema:n,data:s,it:i}=e;let o,a;const{minContains:c,maxContains:d}=n;i.opts.next?(o=c===void 0?1:c,a=d):o=1;const u=t.const("len",(0,_e._)`${s}.length`);if(e.setParams({min:o,max:a}),a===void 0&&o===0){(0,Pt.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,Pt.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,Pt.alwaysValidSchema)(i,r)){let v=(0,_e._)`${u} >= ${o}`;a!==void 0&&(v=(0,_e._)`${v} && ${u} <= ${a}`),e.pass(v);return}i.items=!0;const f=t.name("valid");a===void 0&&o===1?$(f,()=>t.if(f,()=>t.break())):o===0?(t.let(f,!0),a!==void 0&&t.if((0,_e._)`${s}.length > 0`,_)):(t.let(f,!1),_()),e.result(f,()=>e.reset());function _(){const v=t.name("_valid"),m=t.let("count",0);$(v,()=>t.if(v,()=>g(m)))}function $(v,m){t.forRange("i",0,u,p=>{e.subschema({keyword:"contains",dataProp:p,dataPropType:Pt.Type.Num,compositeRule:!0},v),m()})}function g(v){t.code((0,_e._)`${v}++`),a===void 0?t.if((0,_e._)`${v} >= ${o}`,()=>t.assign(f,!0).break()):(t.if((0,_e._)`${v} > ${a}`,()=>t.assign(f,!1).break()),o===1?t.assign(f,!0):t.if((0,_e._)`${v} >= ${o}`,()=>t.assign(f,!0)))}}};en.default=qc;var Ks={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=z,r=T,n=U;e.error={message:({params:{property:c,depsCount:d,deps:u}})=>{const f=d===1?"property":"properties";return(0,t.str)`must have ${f} ${u} when property ${c} is present`},params:({params:{property:c,depsCount:d,deps:u,missingProperty:f}})=>(0,t._)`{property: ${c},
1
+ "use strict";var Pi=Object.defineProperty,ki=Object.defineProperties;var Ii=Object.getOwnPropertyDescriptors;var On=Object.getOwnPropertySymbols;var Ni=Object.prototype.hasOwnProperty,Ai=Object.prototype.propertyIsEnumerable;var or=(e,t,r)=>t in e?Pi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,V=(e,t)=>{for(var r in t||(t={}))Ni.call(t,r)&&or(e,r,t[r]);if(On)for(var r of On(t))Ai.call(t,r)&&or(e,r,t[r]);return e},ee=(e,t)=>ki(e,Ii(t));var se=(e,t,r)=>or(e,typeof t!="symbol"?t+"":t,r);var Fe=(e,t,r)=>new Promise((n,s)=>{var i=l=>{try{a(r.next(l))}catch(d){s(d)}},o=l=>{try{a(r.throw(l))}catch(d){s(d)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,o);a((r=r.apply(e,t)).next())});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const kr=require("vue"),Oi=new Set(["http:","https:","mailto:","tel:"]),Ri=new Set(["http:","https:","blob:"]),Ti="https://article-content-renderer.invalid/",St="https://www.doitme.link/";function us(e,t){if(typeof e!="string")return e;const r=e.trim();if(!r.startsWith(St))return r;const s=(t.trim()||St).replace(/\/+$/u,""),i=r.slice(St.length).replace(/^\/+/,"");return`${s}/${i}`}function Ir(e,t){if(typeof e!="string")return null;const r=e.trim();if(!r||/[\u0000-\u001F\u007F]/u.test(r))return null;try{const n=new URL(r,Ti);return(t==="link"?Oi:Ri).has(n.protocol)?r:null}catch(n){return null}}function hr(e,t){const r=new Set(typeof e=="string"?e.trim().split(/\s+/u).filter(Boolean):[]);return t==="_blank"&&(r.add("noopener"),r.add("noreferrer")),r.size>0?[...r].join(" "):void 0}function ve(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ji(e,t=[]){const r=new Set(t),n=[];for(const s of e.content)if(n.push(s),s.type==="resourceQuestion"&&s.attrs.hideFollowing&&!r.has(s.attrs.revealKey))break;return n}class Ci{constructor(t){se(this,"anchors",new Map);se(this,"allAnchors",new Set);se(this,"selections",new Map);se(this,"select",()=>{});this.options=t;const r=n=>{ve(n)&&((n.type==="paragraph"||n.type==="heading")&&ve(n.attrs)&&typeof n.attrs.anchorId=="string"&&this.allAnchors.add(n.attrs.anchorId),Array.isArray(n.content)&&n.content.forEach(r))};if(r(t.document),ve(t.document)&&Array.isArray(t.document.content)){const n=new Set(t.revealedKeys);for(const s of t.document.content){if(!ve(s)||s.type!=="resourceQuestion"||!ve(s.attrs))continue;const i=s.attrs,o=new Map;if(Array.isArray(i.options)&&i.options.forEach(a=>{o.set(a.id,Object.freeze(V({questionId:i.id,resourceId:i.resourceId,optionId:a.id,revealKey:i.revealKey,option:Object.freeze(V({},a))},a.targetAnchorId!==void 0?{targetAnchorId:a.targetAnchorId}:{})))}),this.selections.set(i.id,o),i.hideFollowing===!0&&!n.has(i.revealKey))break}}Object.seal(this)}anchorHooks(t){const r=n=>{var s;((s=n.elm)==null?void 0:s.nodeType)===1&&this.anchors.set(t,n.elm)};return{insert:r,postpatch:(n,s)=>r(s),destroy:n=>{this.anchors.get(t)===n.elm&&this.anchors.delete(t)}}}}class Li{constructor(){se(this,"session");se(this,"pending");se(this,"generation",0);se(this,"frame");se(this,"disposed",!1);se(this,"api",Object.freeze({cancelPendingNavigation:()=>this.cancelPendingNavigation()}));Object.seal(this)}update(t){var n;const r=this.session;if(r&&(r.options.document!==t.options.document||r.options.articleKey!==t.options.articleKey||r.options.revealedKeys.some(s=>!t.options.revealedKeys.includes(s)))&&this.cancelPendingNavigation(),this.pending){const s=this.pending.event,i=(n=t.selections.get(s.questionId))==null?void 0:n.get(s.optionId);(!i||i.targetAnchorId!==s.targetAnchorId||i.revealKey!==s.revealKey||!t.allAnchors.has(s.targetAnchorId))&&this.cancelPendingNavigation()}this.session=t,t.select=s=>{if(this.disposed||this.session!==t)return;this.cancelPendingNavigation();const i=t.options.onAnchorNavigate,o=s.targetAnchorId&&t.allAnchors.has(s.targetAnchorId)?{event:ee(V({},s),{targetAnchorId:s.targetAnchorId}),scrollRequested:!i}:void 0;if(this.pending=o,t.options.emitSelect(s),o&&this.pending===o&&i&&!this.disposed){const a=l=>{this.pending!==o||this.disposed||(this.cancelPendingNavigation(),t.options.reportNavigationIssue({code:"NAVIGATION_CALLBACK_FAILED",path:"",nodeType:"resourceQuestion",message:`onAnchorNavigate failed: ${l instanceof Error?l.message:String(l)}`}))};try{const l=i(Object.freeze(ee(V({},o.event),{scrollToAnchor:()=>{this.pending!==o||this.disposed||(o.scrollRequested=!0,this.schedule())},cancel:()=>{this.pending===o&&this.cancelPendingNavigation()}})));l&&Promise.resolve(l).catch(a)}catch(l){a(l)}}this.schedule()}}cancelPendingNavigation(){var t;this.pending=void 0,this.generation+=1,this.frame!==void 0&&typeof window!="undefined"&&((t=window.cancelAnimationFrame)==null||t.call(window,this.frame)),this.frame=void 0}schedule(){var r,n;if(!((r=this.pending)!=null&&r.scrollRequested)||this.disposed||typeof window=="undefined")return;const t=++this.generation;this.frame!==void 0&&((n=window.cancelAnimationFrame)==null||n.call(window,this.frame)),kr.nextTick(()=>{if(this.disposed||t!==this.generation)return;const s=()=>{this.frame=void 0,!(this.disposed||t!==this.generation)&&this.navigate()};window.requestAnimationFrame?this.frame=window.requestAnimationFrame(s):s()})}navigate(){var d,u,f;const t=this.session,r=(d=this.pending)==null?void 0:d.event.targetAnchorId;if(!t||!r||!((u=this.pending)!=null&&u.scrollRequested))return;const n=t.anchors.get(r);if(!(n!=null&&n.isConnected))return;const s=t.options.scrollContainer,i=typeof s=="function"?s():s;if(i&&!i.contains(n))return;const o=Number.isFinite(t.options.scrollOffset)?t.options.scrollOffset:0,a=n.getBoundingClientRect().top,l=(f=window.matchMedia)!=null&&f.call(window,"(prefers-reduced-motion: reduce)").matches?"auto":"smooth";if(i){const b=Math.max(0,i.scrollTop+a-i.getBoundingClientRect().top-i.clientTop-o);i.scrollTo?i.scrollTo({top:b,behavior:l}):i.scrollTop=b}else window.scrollTo({top:Math.max(0,window.scrollY+a-o),behavior:l});n.focus({preventScroll:!0}),this.pending=void 0}dispose(){this.cancelPendingNavigation(),this.disposed=!0,this.session=void 0}}const Di={$schema:"http://json-schema.org/draft-07/schema#",$id:"urn:article-content-protocol:v1:with-formatting-extensions",title:"Article Content Protocol v1 + Extensions",type:"object",additionalProperties:!1,required:["type","content"],properties:{type:{const:"doc"},content:{type:"array",items:{oneOf:[{$ref:"#/definitions/blockNode"},{$ref:"#/definitions/resourceQuestion"}]}}},definitions:{blockNode:{oneOf:[{$ref:"#/definitions/paragraph"},{$ref:"#/definitions/heading"},{$ref:"#/definitions/blockquote"},{$ref:"#/definitions/bulletList"},{$ref:"#/definitions/orderedList"},{$ref:"#/definitions/codeBlock"},{$ref:"#/definitions/horizontalRule"},{$ref:"#/definitions/image"},{$ref:"#/definitions/articleButton"},{$ref:"#/definitions/table"}]},paragraph:{type:"object",additionalProperties:!1,required:["type"],properties:{type:{const:"paragraph"},attrs:{type:"object",additionalProperties:!1,properties:{textAlign:{$ref:"#/definitions/textAlign"},fontSize:{$schema:"http://json-schema.org/draft-07/schema#",$id:"urn:article-content-protocol:paragraph-font-size:v1",title:"Optional paragraph fontSize attribute (pixels)",description:"Applied to paragraph.attrs.fontSize alongside the unchanged v1 paragraph attributes. Omit to inherit the default size. Consumers must support this optional extension.",type:"integer",minimum:8,maximum:96},anchorId:{type:"string",minLength:1,pattern:"\\S",description:"Stable paragraph/heading anchor, unique within the article. New resource option bindings use the external option ID; existing anchors remain valid."}}},content:{type:"array",items:{$ref:"#/definitions/text"}}}},heading:{type:"object",additionalProperties:!1,required:["type","attrs"],properties:{type:{const:"heading"},attrs:{type:"object",additionalProperties:!1,required:["level"],properties:{level:{type:"integer",minimum:1,maximum:6},textAlign:{$ref:"#/definitions/textAlign"},anchorId:{type:"string",minLength:1,pattern:"\\S",description:"Stable paragraph/heading anchor, unique within the article. New resource option bindings use the external option ID; existing anchors remain valid."}}},content:{type:"array",items:{$ref:"#/definitions/text"}}}},blockquote:{type:"object",additionalProperties:!1,required:["type","content"],properties:{type:{const:"blockquote"},content:{type:"array",items:{$ref:"#/definitions/blockNode"}}}},bulletList:{type:"object",additionalProperties:!1,required:["type","content"],properties:{type:{const:"bulletList"},content:{type:"array",items:{$ref:"#/definitions/listItem"}}}},orderedList:{type:"object",additionalProperties:!1,required:["type","attrs","content"],properties:{type:{const:"orderedList"},attrs:{type:"object",additionalProperties:!1,required:["start"],properties:{start:{type:"integer",minimum:1}}},content:{type:"array",items:{$ref:"#/definitions/listItem"}}}},listItem:{type:"object",additionalProperties:!1,required:["type","content"],properties:{type:{const:"listItem"},content:{type:"array",items:{$ref:"#/definitions/blockNode"}}}},codeBlock:{type:"object",additionalProperties:!1,required:["type","attrs"],properties:{type:{const:"codeBlock"},attrs:{type:"object",additionalProperties:!1,properties:{language:{type:"string",minLength:1,maxLength:32}}},content:{type:"array",items:{type:"object",additionalProperties:!1,required:["type","text"],properties:{type:{const:"text"},text:{type:"string",minLength:1}}}}}},horizontalRule:{type:"object",additionalProperties:!1,required:["type"],properties:{type:{const:"horizontalRule"}}},image:{type:"object",additionalProperties:!1,required:["type","attrs"],properties:{type:{const:"image"},attrs:{type:"object",additionalProperties:!1,required:["src"],properties:{src:{type:"string",minLength:1},alt:{type:"string"},title:{type:"string"},width:{type:"integer",minimum:1,maximum:1e4},height:{type:"integer",minimum:1,maximum:1e4},imageAlign:{$ref:"#/definitions/imageAlign"},imageLayout:{$schema:"http://json-schema.org/draft-07/schema#",$id:"urn:article-content-protocol:image-layout:v1",title:"Optional two-column image layout",description:"Applied to image.attrs.imageLayout. Adjacent two-column images flow two per row in document order. Other blocks break the row. Omit for the original full-row image layout.",type:"string",enum:["two-column"]}}}}},articleButton:{type:"object",additionalProperties:!1,required:["type","attrs"],properties:{type:{const:"articleButton"},attrs:{type:"object",additionalProperties:!1,required:["text","style"],properties:{id:{type:"string",minLength:1},title:{type:"string",minLength:1},text:{type:"string",minLength:1},style:{enum:["text","button","link"]},href:{type:"string",minLength:1}},allOf:[{if:{properties:{style:{enum:["text","button"]}},required:["style"]},then:{properties:{id:{}},required:["id"]}},{if:{properties:{href:{}},required:["href"]},then:{properties:{style:{const:"link"}}}}]}}},table:{type:"object",additionalProperties:!1,required:["type","content"],properties:{type:{const:"table"},content:{type:"array",items:{$ref:"#/definitions/tableRow"}}}},tableRow:{type:"object",additionalProperties:!1,required:["type","content"],properties:{type:{const:"tableRow"},content:{type:"array",items:{$ref:"#/definitions/tableCell"}}}},tableCell:{type:"object",additionalProperties:!1,required:["type","content"],properties:{type:{const:"tableCell"},content:{type:"array",items:{$ref:"#/definitions/blockNode"}}}},text:{type:"object",additionalProperties:!1,required:["type","text"],properties:{type:{const:"text"},text:{type:"string",minLength:1},marks:{type:"array",items:{$ref:"#/definitions/mark"}}}},textAlign:{type:"string",enum:["left","center","right","justify"]},imageAlign:{type:"string",enum:["left","center","right"]},mark:{oneOf:[{type:"object",additionalProperties:!1,required:["type"],properties:{type:{enum:["bold","italic","strike","underline","code"]}}},{type:"object",additionalProperties:!1,required:["type","attrs"],properties:{type:{const:"link"},attrs:{oneOf:[{type:"object",additionalProperties:!1,required:["href","target"],properties:{type:{const:"href",default:"href",description:"May be omitted in legacy documents; omission means href."},href:{type:"string",minLength:1,description:"Non-empty URI reference; fragment-only links such as # are valid."},target:{enum:["_blank","_self"]}}},{type:"object",additionalProperties:!1,required:["type","id","title","target"],properties:{type:{const:"custom"},id:{type:"string",minLength:1},title:{type:"string",minLength:1},target:{enum:["_blank","_self"]}}}]}}},{$schema:"http://json-schema.org/draft-07/schema#",$id:"urn:article-content-protocol:text-formatting:v1",title:"Optional text formatting marks for Article Content Protocol v1",description:"Additional marks accepted alongside the unchanged v1 marks. Existing v1 documents require no migration. Consumers must support these marks to render colored documents.",type:"object",additionalProperties:!1,required:["type","attrs"],properties:{type:{enum:["textStyle","highlight"]},attrs:{type:"object",additionalProperties:!1,required:["color"],properties:{color:{type:"string",pattern:"^#[0-9a-fA-F]{6}$"}}}}}]},resourceQuestion:{$id:"urn:article-content-protocol:resource-question:v1",type:"object",additionalProperties:!1,required:["type","attrs"],properties:{type:{const:"resourceQuestion"},attrs:{type:"object",additionalProperties:!1,required:["id","resourceId","title","description","options","hideFollowing","revealKey"],properties:{id:{type:"string",minLength:1,pattern:"\\S"},resourceId:{type:"string"},title:{type:"string"},description:{type:"string"},image:{$ref:"urn:article-content-protocol:resource-question-image:v1"},options:{type:"array",items:{type:"object",additionalProperties:!1,required:["id","label"],properties:{id:{type:"string",minLength:1,pattern:"\\S"},label:{type:"string",minLength:1,pattern:"\\S"},targetAnchorId:{type:"string",minLength:1,pattern:"\\S",description:"Target paragraph/heading anchorId. New editor bindings use this option's id; legacy anchor values remain supported."}}}},hideFollowing:{type:"boolean"},revealKey:{type:"string",minLength:1,pattern:"\\S"}},allOf:[{if:{properties:{resourceId:{const:""}}},then:{properties:{title:{const:""},description:{const:""},options:{maxItems:0}}},else:{properties:{resourceId:{pattern:"\\S"},title:{minLength:1,pattern:"\\S"},options:{minItems:1}}}}]}}},resourceQuestionImage:{$id:"urn:article-content-protocol:resource-question-image:v1",type:"object",additionalProperties:!1,required:["src"],description:"Optional image snapshot above the resource question title. Omit the image attribute when absent. Fit container width with proportional height, without cropping.",properties:{src:{type:"string",minLength:1,pattern:"^(?!.*[\\u0000-\\u0020\\u007f\\\\])(?:(?:[hH][tT][tT][pP][sS]?:)?//[^/?#]+\\S*|(?!(?:[a-zA-Z][a-zA-Z0-9+.-]*):)\\S+|data:image/(?:png|jpeg|webp|gif|avif|bmp);base64,[a-zA-Z0-9+/=]+)$"},alt:{type:"string"},title:{type:"string"},width:{type:"integer",minimum:1,maximum:1e4},height:{type:"integer",minimum:1,maximum:1e4}}}}},fs={documentSchema:Di},qi=new RegExp(fs.documentSchema.definitions.resourceQuestionImage.properties.src.pattern);function hs(e){if(typeof e!="string"||!qi.test(e))return null;try{const t=new URL(e,"https://article-content-renderer.invalid/");return["http:","https:","data:"].includes(t.protocol)?e:null}catch(t){return null}}const Mi=new Set(["paragraph","heading","blockquote","bulletList","orderedList","codeBlock","horizontalRule","image","articleButton","table"]);function G(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ce(e){return G(e)?e:{}}function F(e,t,r,n){var l;const s=G(r)?r:{},i=G(r)?n:r,o={},a={};for(const[d,u]of Object.entries(s))if(d==="class")o.class=u;else if(d==="style")o.style=u;else if(d==="hook")o.hook=u;else if(d.startsWith("on")&&typeof u=="function"){const f=d.slice(2).toLowerCase();o.on=ee(V({},(l=o.on)!=null?l:{}),{[f]:u})}else u!==void 0&&u!==!1&&(a[d]=u);return Object.keys(a).length>0&&(o.attrs=a),e.createElement(t,o,i)}function pe(e){return Array.isArray(e)?e:[]}function Z(e,...t){return`${e}/${t.map(String).join("/")}`}function Rn(e){return e==="left"||e==="center"||e==="right"||e==="justify"}function Vi(e){return e==="left"||e==="center"||e==="right"}function Ot(e){return e==="_blank"||e==="_self"}function me(e,t){e.reportIssue(t)}function Fi(e,t,r){var i,o,a;if(!G(e)||e.type!=="text"||typeof e.text!="string"||!e.text)return null;let n=e.text;const s=pe(e.marks);for(let l=0;l<s.length;l+=1){const d=s[l];if(!G(d)||typeof d.type!="string")continue;const u=Z(t,"marks",l);switch(d.type){case"bold":n=F(r,"strong",{class:"acp-mark acp-mark--bold"},[n]);break;case"italic":n=F(r,"em",{class:"acp-mark acp-mark--italic"},[n]);break;case"strike":n=F(r,"s",{class:"acp-mark acp-mark--strike"},[n]);break;case"underline":n=F(r,"u",{class:"acp-mark acp-mark--underline"},[n]);break;case"code":n=F(r,"code",{class:"acp-mark acp-mark--code"},[n]);break;case"textStyle":case"highlight":{const f=Ce(d.attrs);typeof f.color=="string"&&/^#[0-9a-fA-F]{6}$/.test(f.color)&&(n=F(r,d.type==="highlight"?"mark":"span",{class:`acp-mark acp-mark--${d.type}`,style:d.type==="highlight"?{backgroundColor:f.color,color:"inherit"}:{color:f.color}},[n]));break}case"link":{const f=Ce(d.attrs),b=Ot(f.target)?f.target:"_blank";if(f.type==="custom"){if(typeof f.id!="string"||!f.id||typeof f.title!="string"||!f.title)break;const _=Object.freeze(V({type:"custom",id:f.id,title:f.title},Ot(f.target)?{target:f.target}:{})),v=Object.freeze({type:"link",attrs:_});let m=null;if(!r.resolveCustomLink)me(r,{code:"LINK_RESOLUTION_FAILED",path:u,message:"No resolveCustomLink callback was provided for a custom link mark.",nodeType:"link"});else try{const S=r.resolveCustomLink(_,v);m=pr(S,b),m||me(r,{code:typeof S=="string"||G(S)&&typeof S.href=="string"?"UNSAFE_URL":"LINK_RESOLUTION_FAILED",path:u,message:"The custom link resolver returned no usable safe URL.",nodeType:"link"})}catch(S){me(r,{code:"LINK_RESOLUTION_FAILED",path:u,message:`The custom link resolver threw an error: ${S instanceof Error?S.message:String(S)}`,nodeType:"link"})}const p=(i=m==null?void 0:m.href)!=null?i:null,g=(o=m==null?void 0:m.target)!=null?o:b;n=F(r,"a",{class:`acp-link acp-link--custom${p?"":" acp-link--disabled"}`,href:p!=null?p:void 0,target:g,rel:(a=m==null?void 0:m.rel)!=null?a:hr(void 0,g),title:_.title,"data-link-type":"custom","data-link-id":_.id,"aria-disabled":p?void 0:"true",onClick:p?void 0:S=>S.preventDefault()},[n]);break}if(f.type!==void 0&&f.type!=="href")break;const w=Ir(f.href,"link");if(!w){me(r,{code:"UNSAFE_URL",path:Z(u,"attrs","href"),message:"The link URL is empty, malformed, or uses a disallowed protocol.",nodeType:"link"});break}n=F(r,"a",{class:"acp-link",href:w,target:b,rel:hr(void 0,b),"data-link-type":"href"},[n]);break}}}return n}function Tn(e,t,r){return pe(e).map((n,s)=>Fi(n,Z(t,s),r)).filter(n=>n!==null)}function jn(e,t,r){return!G(e)||e.type!=="listItem"?null:F(r,"li",{class:"acp-list-item","data-node-type":"listItem"},Nr(e.content,Z(t,"content"),r))}function Ui(e,t,r){return!G(e)||e.type!=="tableCell"?null:F(r,"td",{class:"acp-table-cell","data-node-type":"tableCell"},Nr(e.content,Z(t,"content"),r))}function zi(e,t,r){if(!G(e)||e.type!=="tableRow")return null;const n=pe(e.content).map((s,i)=>Ui(s,Z(t,"content",i),r)).filter(s=>s!==null);return F(r,"tr",{class:"acp-table-row","data-node-type":"tableRow"},n)}function pr(e,t="_self"){var i;if(G(e)&&e.target!==void 0&&!Ot(e.target)||G(e)&&e.rel!==void 0&&typeof e.rel!="string")return null;const r=typeof e=="string"?{href:e}:G(e)&&typeof e.href=="string"?V(V({href:e.href},Ot(e.target)?{target:e.target}:{}),typeof e.rel=="string"?{rel:e.rel}:{}):null;if(!r)return null;const n=Ir(r.href,"link");if(!n)return null;const s=(i=r.target)!=null?i:t;return{href:n,target:s,rel:hr(r.rel,s)}}function Ki(e,t,r){var u;const n=Ce(e.attrs),s=n.style==="text"||n.style==="button",i=n.style==="link";if(typeof n.text!="string"||!n.text||!s&&!i||s&&(typeof n.id!="string"||!n.id)||i&&n.id!==void 0&&(typeof n.id!="string"||!n.id))return null;const o=Object.freeze(i?V(ee(V(V({},typeof n.id=="string"?{id:n.id}:{}),typeof n.title=="string"?{title:n.title}:{}),{text:n.text,style:"link"}),typeof n.href=="string"?{href:n.href}:{}):ee(V({id:n.id},typeof n.title=="string"?{title:n.title}:{}),{text:n.text,style:n.style})),a=Object.freeze({type:"articleButton",attrs:o});let l=null;if(o.style==="link")o.href!==void 0&&(l=pr(o.href),l||me(r,{code:"UNSAFE_URL",path:`${t}/attrs/href`,message:"The articleButton link href is not a usable safe URL.",nodeType:"articleButton"}));else if(!r.resolveArticleButtonLink)me(r,{code:"LINK_RESOLUTION_FAILED",path:t,message:"No resolveArticleButtonLink callback was provided for an articleButton node.",nodeType:"articleButton"});else try{const f=Object.freeze({type:"articleButton",attrs:o}),b=r.resolveArticleButtonLink(o,f);l=pr(b),l||me(r,{code:typeof b=="string"||G(b)&&typeof b.href=="string"?"UNSAFE_URL":"LINK_RESOLUTION_FAILED",path:t,message:"The articleButton link resolver returned no usable safe URL.",nodeType:"articleButton"})}catch(f){me(r,{code:"LINK_RESOLUTION_FAILED",path:t,message:`The articleButton link resolver threw an error: ${f instanceof Error?f.message:String(f)}`,nodeType:"articleButton"})}const d=(u=l==null?void 0:l.href)!=null?u:null;return F(r,"a",{class:["acp-article-button",`acp-article-button--${o.style}`,!d&&"acp-article-button--disabled"],href:d!=null?d:void 0,target:l==null?void 0:l.target,rel:l==null?void 0:l.rel,title:o.title,"data-node-type":"articleButton","data-article-button-id":o.id,"data-article-button-style":o.style,"aria-disabled":d?void 0:"true",onClick:f=>{d||f.preventDefault(),r.emitArticleButtonClick({attrs:o,node:a,href:d,event:f})}},o.text)}function Bi(e,t,r){if(!G(e)||typeof e.type!="string"||!Mi.has(e.type))return null;const n=Ce(e.attrs);switch(e.type){case"paragraph":{const s=Rn(n.textAlign)?n.textAlign:void 0;return F(r,"p",ee(V({class:"acp-paragraph","data-node-type":"paragraph"},Cn(n,r)),{style:{textAlign:s,fontSize:Number.isInteger(n.fontSize)&&Number(n.fontSize)>=8&&Number(n.fontSize)<=96?`${n.fontSize}px`:void 0}}),Tn(e.content,Z(t,"content"),r))}case"heading":{const s=Number.isInteger(n.level)&&Number(n.level)>=1&&Number(n.level)<=6?Number(n.level):1,i=Rn(n.textAlign)?n.textAlign:void 0;return F(r,`h${s}`,ee(V({class:["acp-heading",`acp-heading--${s}`],"data-node-type":"heading"},Cn(n,r)),{style:i?{textAlign:i}:void 0}),Tn(e.content,Z(t,"content"),r))}case"blockquote":return F(r,"blockquote",{class:"acp-blockquote","data-node-type":"blockquote"},Nr(e.content,Z(t,"content"),r));case"bulletList":{const s=pe(e.content).map((i,o)=>jn(i,Z(t,"content",o),r)).filter(i=>i!==null);return F(r,"ul",{class:"acp-list acp-list--bullet","data-node-type":"bulletList"},s)}case"orderedList":{const s=Number.isInteger(n.start)&&Number(n.start)>=1?Number(n.start):1,i=pe(e.content).map((o,a)=>jn(o,Z(t,"content",a),r)).filter(o=>o!==null);return F(r,"ol",{class:"acp-list acp-list--ordered","data-node-type":"orderedList",start:s},i)}case"codeBlock":{const s=typeof n.language=="string"&&n.language?n.language:void 0,i=pe(e.content).filter(o=>G(o)&&o.type==="text"&&typeof o.text=="string").map(o=>o.text).join("");return F(r,"pre",{class:"acp-code-block","data-node-type":"codeBlock","data-language":s},[F(r,"code",{class:s?`language-${s}`:void 0},i)])}case"horizontalRule":return F(r,"hr",{class:"acp-horizontal-rule","data-node-type":"horizontalRule"});case"image":{const s=Ir(us(n.src,r.imageBaseUrl),"image");if(!s)return me(r,{code:"UNSAFE_URL",path:Z(t,"attrs","src"),message:"The image URL is empty, malformed, or uses a disallowed protocol.",nodeType:"image"}),null;const i=Vi(n.imageAlign)?n.imageAlign:"center",o=Number.isInteger(n.width)&&Number(n.width)>=1&&Number(n.width)<=1e4?Number(n.width):void 0,a=Number.isInteger(n.height)&&Number(n.height)>=1&&Number(n.height)<=1e4?Number(n.height):void 0;return F(r,"div",{class:["acp-image",`acp-image--${i}`],"data-node-type":"image","data-image-align":i,"data-image-layout":n.imageLayout==="two-column"?"two-column":void 0},[F(r,"img",{class:"acp-image__element",src:s,alt:typeof n.alt=="string"?n.alt:"",title:typeof n.title=="string"?n.title:void 0,width:o,height:a,"data-image-align":i})])}case"articleButton":return Ki(e,t,r);case"table":{const s=pe(e.content).map((i,o)=>zi(i,Z(t,"content",o),r)).filter(i=>i!==null);return F(r,"div",{class:"acp-table-wrapper","data-node-type":"table"},[F(r,"table",{class:"acp-table"},[F(r,"tbody",s)])])}}return null}function Cn(e,t){return typeof e.anchorId!="string"||!/\S/.test(e.anchorId)?{}:{"data-anchor-id":e.anchorId,tabindex:-1,hook:t.navigation.anchorHooks(e.anchorId)}}function xi(e,t,r){const n=Ce(e.attrs),s=r.navigation.selections.get(n.id);let i;if(G(n.image)){const l=hs(us(n.image.src,r.imageBaseUrl));l?i=F(r,"img",{class:"acp-resource-question__image",src:l,alt:typeof n.image.alt=="string"?n.image.alt:"",title:n.image.title,width:n.image.width,height:n.image.height}):me(r,{code:"UNSAFE_URL",path:Z(t,"attrs","image","src"),nodeType:"resourceQuestion",message:"The question image URL is malformed or uses a disallowed protocol."})}const o=i?[i]:[];n.resourceId===""?o.push(F(r,"p",{class:"acp-resource-question__placeholder"},"暂无问题内容")):(o.push(F(r,"div",{class:"acp-resource-question__title"},String(n.title))),n.description&&o.push(F(r,"p",{class:"acp-resource-question__description"},String(n.description))),o.push(F(r,"div",{class:"acp-resource-question__options"},pe(n.options).filter(G).map(l=>F(r,"button",{type:"button",class:"acp-resource-question__option","data-option-id":l.id,onClick:()=>{const d=s==null?void 0:s.get(l.id);d&&r.navigation.select(d)}},String(l.label))))));const a=r.resourceQuestionFooterText;return typeof a=="string"&&a.trim()&&o.push(F(r,"p",{class:"acp-resource-question__footer"},a)),F(r,"div",{class:"acp-resource-question","data-node-type":"resourceQuestion","data-question-id":n.id,role:"group","aria-label":n.title||"暂无问题内容"},o)}function Hi(e){return G(e)&&e.type==="image"&&Ce(e.attrs).imageLayout==="two-column"}function ps(e,t,r,n,s){var a,l;const i=Bi(t,r,n);if(!Hi(t)){i&&typeof i!="string"&&e.push(i);return}if(!i||typeof i=="string")return s;if(s&&((l=(a=s.children)==null?void 0:a.length)!=null?l:0)<2)return s.children.push(i),s;const o=F(n,"div",{class:"acp-image-row"},[i]);return e.push(o),o}function Nr(e,t,r){const n=[];let s;return pe(e).forEach((i,o)=>{s=ps(n,i,Z(t,o),r,s)}),n}function Gi(e,t){var a;const r=pe(e.content),n=new Map;t.customSlots.forEach(l=>{var u;if(!Number.isInteger(l.location)||l.location<1||l.location>r.length)return;const d=(u=n.get(l.location))!=null?u:[];d.push(l),n.set(l.location,d)});const s=[],i=new Set(t.navigation.options.revealedKeys);let o;for(let l=0;l<r.length;l+=1){const d=r[l],u=l+1;if((a=n.get(u))==null||a.forEach(f=>{f.content.length&&(o=void 0),s.push(...f.content)}),G(d)&&d.type==="resourceQuestion"){o=void 0,s.push(xi(d,Z("/content",l),t));const f=Ce(d.attrs);if(f.hideFollowing===!0&&!i.has(f.revealKey))break}else o=ps(s,d,Z("/content",l),t,o)}return s}function Qi(e,t){return!G(e)||e.type!=="doc"?[]:Gi(e,t)}function Ji(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var mr={exports:{}},ms={},fe={},Ge={},pt={},M={},ht={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(g){if(super(),!e.IDENTIFIER.test(g))throw new Error("CodeGen: name must be a valid identifier");this.str=g}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(g){super(),this._items=typeof g=="string"?[g]:g}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const g=this._items[0];return g===""||g==='""'}get str(){var g;return(g=this._str)!==null&&g!==void 0?g:this._str=this._items.reduce((S,A)=>`${S}${A}`,"")}get names(){var g;return(g=this._names)!==null&&g!==void 0?g:this._names=this._items.reduce((S,A)=>(A instanceof r&&(S[A.str]=(S[A.str]||0)+1),S),{})}}e._Code=n,e.nil=new n("");function s(p,...g){const S=[p[0]];let A=0;for(;A<g.length;)a(S,g[A]),S.push(p[++A]);return new n(S)}e._=s;const i=new n("+");function o(p,...g){const S=[w(p[0])];let A=0;for(;A<g.length;)S.push(i),a(S,g[A]),S.push(i,w(p[++A]));return l(S),new n(S)}e.str=o;function a(p,g){g instanceof n?p.push(...g._items):g instanceof r?p.push(g):p.push(f(g))}e.addCodeArg=a;function l(p){let g=1;for(;g<p.length-1;){if(p[g]===i){const S=d(p[g-1],p[g+1]);if(S!==void 0){p.splice(g-1,3,S);continue}p[g++]="+"}g++}}function d(p,g){if(g==='""')return p;if(p==='""')return g;if(typeof p=="string")return g instanceof r||p[p.length-1]!=='"'?void 0:typeof g!="string"?`${p.slice(0,-1)}${g}"`:g[0]==='"'?p.slice(0,-1)+g.slice(1):void 0;if(typeof g=="string"&&g[0]==='"'&&!(p instanceof r))return`"${p}${g.slice(1)}`}function u(p,g){return g.emptyStr()?p:p.emptyStr()?g:o`${p}${g}`}e.strConcat=u;function f(p){return typeof p=="number"||typeof p=="boolean"||p===null?p:w(Array.isArray(p)?p.join(","):p)}function b(p){return new n(w(p))}e.stringify=b;function w(p){return JSON.stringify(p).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=w;function _(p){return typeof p=="string"&&e.IDENTIFIER.test(p)?new n(`.${p}`):s`[${p}]`}e.getProperty=_;function v(p){if(typeof p=="string"&&e.IDENTIFIER.test(p))return new n(`${p}`);throw new Error(`CodeGen: invalid export name: ${p}, use explicit $id name mapping`)}e.getEsmExportName=v;function m(p){return new n(p.toString())}e.regexpCode=m})(ht);var yr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=ht;class r extends Error{constructor(d){super(`CodeGen: "code" for ${d} not defined`),this.value=d.value}}var n;(function(l){l[l.Started=0]="Started",l[l.Completed=1]="Completed"})(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class s{constructor({prefixes:d,parent:u}={}){this._names={},this._prefixes=d,this._parent=u}toName(d){return d instanceof t.Name?d:this.name(d)}name(d){return new t.Name(this._newName(d))}_newName(d){const u=this._names[d]||this._nameGroup(d);return`${d}${u.index++}`}_nameGroup(d){var u,f;if(!((f=(u=this._parent)===null||u===void 0?void 0:u._prefixes)===null||f===void 0)&&f.has(d)||this._prefixes&&!this._prefixes.has(d))throw new Error(`CodeGen: prefix "${d}" is not allowed in this scope`);return this._names[d]={prefix:d,index:0}}}e.Scope=s;class i extends t.Name{constructor(d,u){super(u),this.prefix=d}setValue(d,{property:u,itemIndex:f}){this.value=d,this.scopePath=(0,t._)`.${new t.Name(u)}[${f}]`}}e.ValueScopeName=i;const o=(0,t._)`\n`;class a extends s{constructor(d){super(d),this._values={},this._scope=d.scope,this.opts=ee(V({},d),{_n:d.lines?o:t.nil})}get(){return this._scope}name(d){return new i(d,this._newName(d))}value(d,u){var f;if(u.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const b=this.toName(d),{prefix:w}=b,_=(f=u.key)!==null&&f!==void 0?f:u.ref;let v=this._values[w];if(v){const g=v.get(_);if(g)return g}else v=this._values[w]=new Map;v.set(_,b);const m=this._scope[w]||(this._scope[w]=[]),p=m.length;return m[p]=u.ref,b.setValue(u,{property:w,itemIndex:p}),b}getValue(d,u){const f=this._values[d];if(f)return f.get(u)}scopeRefs(d,u=this._values){return this._reduceValues(u,f=>{if(f.scopePath===void 0)throw new Error(`CodeGen: name "${f}" has no value`);return(0,t._)`${d}${f.scopePath}`})}scopeCode(d=this._values,u,f){return this._reduceValues(d,b=>{if(b.value===void 0)throw new Error(`CodeGen: name "${b}" has no value`);return b.value.code},u,f)}_reduceValues(d,u,f={},b){let w=t.nil;for(const _ in d){const v=d[_];if(!v)continue;const m=f[_]=f[_]||new Map;v.forEach(p=>{if(m.has(p))return;m.set(p,n.Started);let g=u(p);if(g){const S=this.opts.es5?e.varKinds.var:e.varKinds.const;w=(0,t._)`${w}${S} ${p} = ${g};${this.opts._n}`}else if(g=b==null?void 0:b(p))w=(0,t._)`${w}${g}${this.opts._n}`;else throw new r(p);m.set(p,n.Completed)})}return w}}e.ValueScope=a})(yr);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=ht,r=yr;var n=ht;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var s=yr;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class i{optimizeNodes(){return this}optimizeNames(c,h){return this}}class o extends i{constructor(c,h,E){super(),this.varKind=c,this.name=h,this.rhs=E}render({es5:c,_n:h}){const E=c?r.varKinds.var:this.varKind,T=this.rhs===void 0?"":` = ${this.rhs}`;return`${E} ${this.name}${T};`+h}optimizeNames(c,h){if(c[this.name.str])return this.rhs&&(this.rhs=Se(this.rhs,c,h)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class a extends i{constructor(c,h,E){super(),this.lhs=c,this.rhs=h,this.sideEffects=E}render({_n:c}){return`${this.lhs} = ${this.rhs};`+c}optimizeNames(c,h){if(!(this.lhs instanceof t.Name&&!c[this.lhs.str]&&!this.sideEffects))return this.rhs=Se(this.rhs,c,h),this}get names(){const c=this.lhs instanceof t.Name?{}:V({},this.lhs.names);return Me(c,this.rhs)}}class l extends a{constructor(c,h,E,T){super(c,E,T),this.op=h}render({_n:c}){return`${this.lhs} ${this.op}= ${this.rhs};`+c}}class d extends i{constructor(c){super(),this.label=c,this.names={}}render({_n:c}){return`${this.label}:`+c}}class u extends i{constructor(c){super(),this.label=c,this.names={}}render({_n:c}){return`break${this.label?` ${this.label}`:""};`+c}}class f extends i{constructor(c){super(),this.error=c}render({_n:c}){return`throw ${this.error};`+c}get names(){return this.error.names}}class b extends i{constructor(c){super(),this.code=c}render({_n:c}){return`${this.code};`+c}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(c,h){return this.code=Se(this.code,c,h),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class w extends i{constructor(c=[]){super(),this.nodes=c}render(c){return this.nodes.reduce((h,E)=>h+E.render(c),"")}optimizeNodes(){const{nodes:c}=this;let h=c.length;for(;h--;){const E=c[h].optimizeNodes();Array.isArray(E)?c.splice(h,1,...E):E?c[h]=E:c.splice(h,1)}return c.length>0?this:void 0}optimizeNames(c,h){const{nodes:E}=this;let T=E.length;for(;T--;){const j=E[T];j.optimizeNames(c,h)||(et(c,j.names),E.splice(T,1))}return E.length>0?this:void 0}get names(){return this.nodes.reduce((c,h)=>_e(c,h.names),{})}}class _ extends w{render(c){return"{"+c._n+super.render(c)+"}"+c._n}}class v extends w{}class m extends _{}m.kind="else";class p extends _{constructor(c,h){super(h),this.condition=c}render(c){let h=`if(${this.condition})`+super.render(c);return this.else&&(h+="else "+this.else.render(c)),h}optimizeNodes(){super.optimizeNodes();const c=this.condition;if(c===!0)return this.nodes;let h=this.else;if(h){const E=h.optimizeNodes();h=this.else=Array.isArray(E)?new m(E):E}if(h)return c===!1?h instanceof p?h:h.nodes:this.nodes.length?this:new p(gt(c),h instanceof p?[h]:h.nodes);if(!(c===!1||!this.nodes.length))return this}optimizeNames(c,h){var E;if(this.else=(E=this.else)===null||E===void 0?void 0:E.optimizeNames(c,h),!!(super.optimizeNames(c,h)||this.else))return this.condition=Se(this.condition,c,h),this}get names(){const c=super.names;return Me(c,this.condition),this.else&&_e(c,this.else.names),c}}p.kind="if";class g extends _{}g.kind="for";class S extends g{constructor(c){super(),this.iteration=c}render(c){return`for(${this.iteration})`+super.render(c)}optimizeNames(c,h){if(super.optimizeNames(c,h))return this.iteration=Se(this.iteration,c,h),this}get names(){return _e(super.names,this.iteration.names)}}class A extends g{constructor(c,h,E,T){super(),this.varKind=c,this.name=h,this.from=E,this.to=T}render(c){const h=c.es5?r.varKinds.var:this.varKind,{name:E,from:T,to:j}=this;return`for(${h} ${E}=${T}; ${E}<${j}; ${E}++)`+super.render(c)}get names(){const c=Me(super.names,this.from);return Me(c,this.to)}}class O extends g{constructor(c,h,E,T){super(),this.loop=c,this.varKind=h,this.name=E,this.iterable=T}render(c){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(c)}optimizeNames(c,h){if(super.optimizeNames(c,h))return this.iterable=Se(this.iterable,c,h),this}get names(){return _e(super.names,this.iterable.names)}}class B extends _{constructor(c,h,E){super(),this.name=c,this.args=h,this.async=E}render(c){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(c)}}B.kind="func";class Q extends w{render(c){return"return "+super.render(c)}}Q.kind="return";class $e extends _{render(c){let h="try"+super.render(c);return this.catch&&(h+=this.catch.render(c)),this.finally&&(h+=this.finally.render(c)),h}optimizeNodes(){var c,h;return super.optimizeNodes(),(c=this.catch)===null||c===void 0||c.optimizeNodes(),(h=this.finally)===null||h===void 0||h.optimizeNodes(),this}optimizeNames(c,h){var E,T;return super.optimizeNames(c,h),(E=this.catch)===null||E===void 0||E.optimizeNames(c,h),(T=this.finally)===null||T===void 0||T.optimizeNames(c,h),this}get names(){const c=super.names;return this.catch&&_e(c,this.catch.names),this.finally&&_e(c,this.finally.names),c}}class Ee extends _{constructor(c){super(),this.error=c}render(c){return`catch(${this.error})`+super.render(c)}}Ee.kind="catch";class Ae extends _{render(c){return"finally"+super.render(c)}}Ae.kind="finally";class Xe{constructor(c,h={}){this._values={},this._blockStarts=[],this._constants={},this.opts=ee(V({},h),{_n:h.lines?`
2
+ `:""}),this._extScope=c,this._scope=new r.Scope({parent:c}),this._nodes=[new v]}toString(){return this._root.render(this.opts)}name(c){return this._scope.name(c)}scopeName(c){return this._extScope.name(c)}scopeValue(c,h){const E=this._extScope.value(c,h);return(this._values[E.prefix]||(this._values[E.prefix]=new Set)).add(E),E}getScopeValue(c,h){return this._extScope.getValue(c,h)}scopeRefs(c){return this._extScope.scopeRefs(c,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(c,h,E,T){const j=this._scope.toName(h);return E!==void 0&&T&&(this._constants[j.str]=E),this._leafNode(new o(c,j,E)),j}const(c,h,E){return this._def(r.varKinds.const,c,h,E)}let(c,h,E){return this._def(r.varKinds.let,c,h,E)}var(c,h,E){return this._def(r.varKinds.var,c,h,E)}assign(c,h,E){return this._leafNode(new a(c,h,E))}add(c,h){return this._leafNode(new l(c,e.operators.ADD,h))}code(c){return typeof c=="function"?c():c!==t.nil&&this._leafNode(new b(c)),this}object(...c){const h=["{"];for(const[E,T]of c)h.length>1&&h.push(","),h.push(E),(E!==T||this.opts.es5)&&(h.push(":"),(0,t.addCodeArg)(h,T));return h.push("}"),new t._Code(h)}if(c,h,E){if(this._blockNode(new p(c)),h&&E)this.code(h).else().code(E).endIf();else if(h)this.code(h).endIf();else if(E)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(c){return this._elseNode(new p(c))}else(){return this._elseNode(new m)}endIf(){return this._endBlockNode(p,m)}_for(c,h){return this._blockNode(c),h&&this.code(h).endFor(),this}for(c,h){return this._for(new S(c),h)}forRange(c,h,E,T,j=this.opts.es5?r.varKinds.var:r.varKinds.let){const z=this._scope.toName(c);return this._for(new A(j,z,h,E),()=>T(z))}forOf(c,h,E,T=r.varKinds.const){const j=this._scope.toName(c);if(this.opts.es5){const z=h instanceof t.Name?h:this.var("_arr",h);return this.forRange("_i",0,(0,t._)`${z}.length`,U=>{this.var(j,(0,t._)`${z}[${U}]`),E(j)})}return this._for(new O("of",T,j,h),()=>E(j))}forIn(c,h,E,T=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(c,(0,t._)`Object.keys(${h})`,E);const j=this._scope.toName(c);return this._for(new O("in",T,j,h),()=>E(j))}endFor(){return this._endBlockNode(g)}label(c){return this._leafNode(new d(c))}break(c){return this._leafNode(new u(c))}return(c){const h=new Q;if(this._blockNode(h),this.code(c),h.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Q)}try(c,h,E){if(!h&&!E)throw new Error('CodeGen: "try" without "catch" and "finally"');const T=new $e;if(this._blockNode(T),this.code(c),h){const j=this.name("e");this._currNode=T.catch=new Ee(j),h(j)}return E&&(this._currNode=T.finally=new Ae,this.code(E)),this._endBlockNode(Ee,Ae)}throw(c){return this._leafNode(new f(c))}block(c,h){return this._blockStarts.push(this._nodes.length),c&&this.code(c).endBlock(h),this}endBlock(c){const h=this._blockStarts.pop();if(h===void 0)throw new Error("CodeGen: not in self-balancing block");const E=this._nodes.length-h;if(E<0||c!==void 0&&E!==c)throw new Error(`CodeGen: wrong number of nodes: ${E} vs ${c} expected`);return this._nodes.length=h,this}func(c,h=t.nil,E,T){return this._blockNode(new B(c,h,E)),T&&this.code(T).endFunc(),this}endFunc(){return this._endBlockNode(B)}optimize(c=1){for(;c-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(c){return this._currNode.nodes.push(c),this}_blockNode(c){this._currNode.nodes.push(c),this._nodes.push(c)}_endBlockNode(c,h){const E=this._currNode;if(E instanceof c||h&&E instanceof h)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${h?`${c.kind}/${h.kind}`:c.kind}"`)}_elseNode(c){const h=this._currNode;if(!(h instanceof p))throw new Error('CodeGen: "else" without "if"');return this._currNode=h.else=c,this}get _root(){return this._nodes[0]}get _currNode(){const c=this._nodes;return c[c.length-1]}set _currNode(c){const h=this._nodes;h[h.length-1]=c}}e.CodeGen=Xe;function _e($,c){for(const h in c)$[h]=($[h]||0)+(c[h]||0);return $}function Me($,c){return c instanceof t._CodeOrName?_e($,c.names):$}function Se($,c,h){if($ instanceof t.Name)return E($);if(!T($))return $;return new t._Code($._items.reduce((j,z)=>(z instanceof t.Name&&(z=E(z)),z instanceof t._Code?j.push(...z._items):j.push(z),j),[]));function E(j){const z=h[j.str];return z===void 0||c[j.str]!==1?j:(delete c[j.str],z)}function T(j){return j instanceof t._Code&&j._items.some(z=>z instanceof t.Name&&c[z.str]===1&&h[z.str]!==void 0)}}function et($,c){for(const h in c)$[h]=($[h]||0)-(c[h]||0)}function gt($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:(0,t._)`!${P($)}`}e.not=gt;const Bt=y(e.operators.AND);function xt(...$){return $.reduce(Bt)}e.and=xt;const $t=y(e.operators.OR);function k(...$){return $.reduce($t)}e.or=k;function y($){return(c,h)=>c===t.nil?h:h===t.nil?c:(0,t._)`${P(c)} ${$} ${P(h)}`}function P($){return $ instanceof t.Name?$:(0,t._)`(${$})`}})(M);var I={};Object.defineProperty(I,"__esModule",{value:!0});I.checkStrictMode=I.getErrorPath=I.Type=I.useFunc=I.setEvaluated=I.evaluatedPropsToName=I.mergeEvaluated=I.eachItem=I.unescapeJsonPointer=I.escapeJsonPointer=I.escapeFragment=I.unescapeFragment=I.schemaRefOrVal=I.schemaHasRulesButRef=I.schemaHasRules=I.checkUnknownRules=I.alwaysValidSchema=I.toHash=void 0;const K=M,Yi=ht;function Wi(e){const t={};for(const r of e)t[r]=!0;return t}I.toHash=Wi;function Zi(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(ys(e,t),!gs(t,e.self.RULES.all))}I.alwaysValidSchema=Zi;function ys(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;const s=n.RULES.keywords;for(const i in t)s[i]||vs(e,`unknown keyword: "${i}"`)}I.checkUnknownRules=ys;function gs(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(t[r])return!0;return!1}I.schemaHasRules=gs;function Xi(e,t){if(typeof e=="boolean")return!e;for(const r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}I.schemaHasRulesButRef=Xi;function eo({topSchemaRef:e,schemaPath:t},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,K._)`${r}`}return(0,K._)`${e}${t}${(0,K.getProperty)(n)}`}I.schemaRefOrVal=eo;function to(e){return $s(decodeURIComponent(e))}I.unescapeFragment=to;function ro(e){return encodeURIComponent(Ar(e))}I.escapeFragment=ro;function Ar(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}I.escapeJsonPointer=Ar;function $s(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}I.unescapeJsonPointer=$s;function no(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)}I.eachItem=no;function Ln({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(s,i,o,a)=>{const l=o===void 0?i:o instanceof K.Name?(i instanceof K.Name?e(s,i,o):t(s,i,o),o):i instanceof K.Name?(t(s,o,i),i):r(i,o);return a===K.Name&&!(l instanceof K.Name)?n(s,l):l}}I.mergeEvaluated={props:Ln({mergeNames:(e,t,r)=>e.if((0,K._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,K._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,K._)`${r} || {}`).code((0,K._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,K._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,K._)`${r} || {}`),Or(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:V(V({},e),t),resultToName:_s}),items:Ln({mergeNames:(e,t,r)=>e.if((0,K._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,K._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,K._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,K._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function _s(e,t){if(t===!0)return e.var("props",!0);const r=e.var("props",(0,K._)`{}`);return t!==void 0&&Or(e,r,t),r}I.evaluatedPropsToName=_s;function Or(e,t,r){Object.keys(r).forEach(n=>e.assign((0,K._)`${t}${(0,K.getProperty)(n)}`,!0))}I.setEvaluated=Or;const Dn={};function so(e,t){return e.scopeValue("func",{ref:t,code:Dn[t.code]||(Dn[t.code]=new Yi._Code(t.code))})}I.useFunc=so;var gr;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(gr||(I.Type=gr={}));function io(e,t,r){if(e instanceof K.Name){const n=t===gr.Num;return r?n?(0,K._)`"[" + ${e} + "]"`:(0,K._)`"['" + ${e} + "']"`:n?(0,K._)`"/" + ${e}`:(0,K._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,K.getProperty)(e).toString():"/"+Ar(e)}I.getErrorPath=io;function vs(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}I.checkStrictMode=vs;var ge={};Object.defineProperty(ge,"__esModule",{value:!0});const te=M,oo={data:new te.Name("data"),valCxt:new te.Name("valCxt"),instancePath:new te.Name("instancePath"),parentData:new te.Name("parentData"),parentDataProperty:new te.Name("parentDataProperty"),rootData:new te.Name("rootData"),dynamicAnchors:new te.Name("dynamicAnchors"),vErrors:new te.Name("vErrors"),errors:new te.Name("errors"),this:new te.Name("this"),self:new te.Name("self"),scope:new te.Name("scope"),json:new te.Name("json"),jsonPos:new te.Name("jsonPos"),jsonLen:new te.Name("jsonLen"),jsonPart:new te.Name("jsonPart")};ge.default=oo;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=M,r=I,n=ge;e.keywordError={message:({keyword:m})=>(0,t.str)`must pass "${m}" keyword validation`},e.keyword$DataError={message:({keyword:m,schemaType:p})=>p?(0,t.str)`"${m}" keyword must be ${p} ($data)`:(0,t.str)`"${m}" keyword is invalid ($data)`};function s(m,p=e.keywordError,g,S){const{it:A}=m,{gen:O,compositeRule:B,allErrors:Q}=A,$e=f(m,p,g);(S!=null?S:B||Q)?l(O,$e):d(A,(0,t._)`[${$e}]`)}e.reportError=s;function i(m,p=e.keywordError,g){const{it:S}=m,{gen:A,compositeRule:O,allErrors:B}=S,Q=f(m,p,g);l(A,Q),O||B||d(S,n.default.vErrors)}e.reportExtraError=i;function o(m,p){m.assign(n.default.errors,p),m.if((0,t._)`${n.default.vErrors} !== null`,()=>m.if(p,()=>m.assign((0,t._)`${n.default.vErrors}.length`,p),()=>m.assign(n.default.vErrors,null)))}e.resetErrorsCount=o;function a({gen:m,keyword:p,schemaValue:g,data:S,errsCount:A,it:O}){if(A===void 0)throw new Error("ajv implementation error");const B=m.name("err");m.forRange("i",A,n.default.errors,Q=>{m.const(B,(0,t._)`${n.default.vErrors}[${Q}]`),m.if((0,t._)`${B}.instancePath === undefined`,()=>m.assign((0,t._)`${B}.instancePath`,(0,t.strConcat)(n.default.instancePath,O.errorPath))),m.assign((0,t._)`${B}.schemaPath`,(0,t.str)`${O.errSchemaPath}/${p}`),O.opts.verbose&&(m.assign((0,t._)`${B}.schema`,g),m.assign((0,t._)`${B}.data`,S))})}e.extendErrors=a;function l(m,p){const g=m.const("err",p);m.if((0,t._)`${n.default.vErrors} === null`,()=>m.assign(n.default.vErrors,(0,t._)`[${g}]`),(0,t._)`${n.default.vErrors}.push(${g})`),m.code((0,t._)`${n.default.errors}++`)}function d(m,p){const{gen:g,validateName:S,schemaEnv:A}=m;A.$async?g.throw((0,t._)`new ${m.ValidationError}(${p})`):(g.assign((0,t._)`${S}.errors`,p),g.return(!1))}const u={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 f(m,p,g){const{createErrors:S}=m.it;return S===!1?(0,t._)`{}`:b(m,p,g)}function b(m,p,g={}){const{gen:S,it:A}=m,O=[w(A,g),_(m,g)];return v(m,p,O),S.object(...O)}function w({errorPath:m},{instancePath:p}){const g=p?(0,t.str)`${m}${(0,r.getErrorPath)(p,r.Type.Str)}`:m;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,g)]}function _({keyword:m,it:{errSchemaPath:p}},{schemaPath:g,parentSchema:S}){let A=S?p:(0,t.str)`${p}/${m}`;return g&&(A=(0,t.str)`${A}${(0,r.getErrorPath)(g,r.Type.Str)}`),[u.schemaPath,A]}function v(m,{params:p,message:g},S){const{keyword:A,data:O,schemaValue:B,it:Q}=m,{opts:$e,propertyName:Ee,topSchemaRef:Ae,schemaPath:Xe}=Q;S.push([u.keyword,A],[u.params,typeof p=="function"?p(m):p||(0,t._)`{}`]),$e.messages&&S.push([u.message,typeof g=="function"?g(m):g]),$e.verbose&&S.push([u.schema,B],[u.parentSchema,(0,t._)`${Ae}${Xe}`],[n.default.data,O]),Ee&&S.push([u.propertyName,Ee])}})(pt);Object.defineProperty(Ge,"__esModule",{value:!0});Ge.boolOrEmptySchema=Ge.topBoolOrEmptySchema=void 0;const ao=pt,co=M,lo=ge,uo={message:"boolean schema is false"};function fo(e){const{gen:t,schema:r,validateName:n}=e;r===!1?bs(e,!1):typeof r=="object"&&r.$async===!0?t.return(lo.default.data):(t.assign((0,co._)`${n}.errors`,null),t.return(!0))}Ge.topBoolOrEmptySchema=fo;function ho(e,t){const{gen:r,schema:n}=e;n===!1?(r.var(t,!1),bs(e)):r.var(t,!0)}Ge.boolOrEmptySchema=ho;function bs(e,t){const{gen:r,data:n}=e,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,ao.reportError)(s,uo,void 0,t)}var J={},Le={};Object.defineProperty(Le,"__esModule",{value:!0});Le.getRules=Le.isJSONType=void 0;const po=["string","number","integer","boolean","null","object","array"],mo=new Set(po);function yo(e){return typeof e=="string"&&mo.has(e)}Le.isJSONType=yo;function go(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:ee(V({},e),{integer:!0,boolean:!0,null:!0}),rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Le.getRules=go;var be={};Object.defineProperty(be,"__esModule",{value:!0});be.shouldUseRule=be.shouldUseGroup=be.schemaHasRulesForType=void 0;function $o({schema:e,self:t},r){const n=t.RULES.types[r];return n&&n!==!0&&ws(e,n)}be.schemaHasRulesForType=$o;function ws(e,t){return t.rules.some(r=>Es(e,r))}be.shouldUseGroup=ws;function Es(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}be.shouldUseRule=Es;Object.defineProperty(J,"__esModule",{value:!0});J.reportTypeError=J.checkDataTypes=J.checkDataType=J.coerceAndCheckDataType=J.getJSONTypes=J.getSchemaTypes=J.DataType=void 0;const _o=Le,vo=be,bo=pt,L=M,Ss=I;var xe;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(xe||(J.DataType=xe={}));function wo(e){const t=Ps(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}J.getSchemaTypes=wo;function Ps(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(_o.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}J.getJSONTypes=Ps;function Eo(e,t){const{gen:r,data:n,opts:s}=e,i=So(t,s.coerceTypes),o=t.length>0&&!(i.length===0&&t.length===1&&(0,vo.schemaHasRulesForType)(e,t[0]));if(o){const a=Rr(t,n,s.strictNumbers,xe.Wrong);r.if(a,()=>{i.length?Po(e,t,i):Tr(e)})}return o}J.coerceAndCheckDataType=Eo;const ks=new Set(["string","number","integer","boolean","null"]);function So(e,t){return t?e.filter(r=>ks.has(r)||t==="array"&&r==="array"):[]}function Po(e,t,r){const{gen:n,data:s,opts:i}=e,o=n.let("dataType",(0,L._)`typeof ${s}`),a=n.let("coerced",(0,L._)`undefined`);i.coerceTypes==="array"&&n.if((0,L._)`${o} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,(0,L._)`${s}[0]`).assign(o,(0,L._)`typeof ${s}`).if(Rr(t,s,i.strictNumbers),()=>n.assign(a,s))),n.if((0,L._)`${a} !== undefined`);for(const d of r)(ks.has(d)||d==="array"&&i.coerceTypes==="array")&&l(d);n.else(),Tr(e),n.endIf(),n.if((0,L._)`${a} !== undefined`,()=>{n.assign(s,a),ko(e,a)});function l(d){switch(d){case"string":n.elseIf((0,L._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,L._)`"" + ${s}`).elseIf((0,L._)`${s} === null`).assign(a,(0,L._)`""`);return;case"number":n.elseIf((0,L._)`${o} == "boolean" || ${s} === null
3
+ || (${o} == "string" && ${s} && ${s} == +${s})`).assign(a,(0,L._)`+${s}`);return;case"integer":n.elseIf((0,L._)`${o} === "boolean" || ${s} === null
4
+ || (${o} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(a,(0,L._)`+${s}`);return;case"boolean":n.elseIf((0,L._)`${s} === "false" || ${s} === 0 || ${s} === null`).assign(a,!1).elseIf((0,L._)`${s} === "true" || ${s} === 1`).assign(a,!0);return;case"null":n.elseIf((0,L._)`${s} === "" || ${s} === 0 || ${s} === false`),n.assign(a,null);return;case"array":n.elseIf((0,L._)`${o} === "string" || ${o} === "number"
5
+ || ${o} === "boolean" || ${s} === null`).assign(a,(0,L._)`[${s}]`)}}}function ko({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,L._)`${t} !== undefined`,()=>e.assign((0,L._)`${t}[${r}]`,n))}function $r(e,t,r,n=xe.Correct){const s=n===xe.Correct?L.operators.EQ:L.operators.NEQ;let i;switch(e){case"null":return(0,L._)`${t} ${s} null`;case"array":i=(0,L._)`Array.isArray(${t})`;break;case"object":i=(0,L._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=o((0,L._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=o();break;default:return(0,L._)`typeof ${t} ${s} ${e}`}return n===xe.Correct?i:(0,L.not)(i);function o(a=L.nil){return(0,L.and)((0,L._)`typeof ${t} == "number"`,a,r?(0,L._)`isFinite(${t})`:L.nil)}}J.checkDataType=$r;function Rr(e,t,r,n){if(e.length===1)return $r(e[0],t,r,n);let s;const i=(0,Ss.toHash)(e);if(i.array&&i.object){const o=(0,L._)`typeof ${t} != "object"`;s=i.null?o:(0,L._)`!${t} || ${o}`,delete i.null,delete i.array,delete i.object}else s=L.nil;i.number&&delete i.integer;for(const o in i)s=(0,L.and)(s,$r(o,t,r,n));return s}J.checkDataTypes=Rr;const Io={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,L._)`{type: ${e}}`:(0,L._)`{type: ${t}}`};function Tr(e){const t=No(e);(0,bo.reportError)(t,Io)}J.reportTypeError=Tr;function No(e){const{gen:t,data:r,schema:n}=e,s=(0,Ss.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:e}}var Mt={};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.assignDefaults=void 0;const Ue=M,Ao=I;function Oo(e,t){const{properties:r,items:n}=e.schema;if(t==="object"&&r)for(const s in r)qn(e,s,r[s].default);else t==="array"&&Array.isArray(n)&&n.forEach((s,i)=>qn(e,i,s.default))}Mt.assignDefaults=Oo;function qn(e,t,r){const{gen:n,compositeRule:s,data:i,opts:o}=e;if(r===void 0)return;const a=(0,Ue._)`${i}${(0,Ue.getProperty)(t)}`;if(s){(0,Ao.checkStrictMode)(e,`default is ignored for: ${a}`);return}let l=(0,Ue._)`${a} === undefined`;o.useDefaults==="empty"&&(l=(0,Ue._)`${l} || ${a} === null || ${a} === ""`),n.if(l,(0,Ue._)`${a} = ${(0,Ue.stringify)(r)}`)}var ye={},q={};Object.defineProperty(q,"__esModule",{value:!0});q.validateUnion=q.validateArray=q.usePattern=q.callValidateCode=q.schemaProperties=q.allSchemaProperties=q.noPropertyInData=q.propertyInData=q.isOwnProperty=q.hasPropFunc=q.reportMissingProp=q.checkMissingProp=q.checkReportMissingProp=void 0;const x=M,jr=I,Pe=ge,Ro=I;function To(e,t){const{gen:r,data:n,it:s}=e;r.if(Lr(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:(0,x._)`${t}`},!0),e.error()})}q.checkReportMissingProp=To;function jo({gen:e,data:t,it:{opts:r}},n,s){return(0,x.or)(...n.map(i=>(0,x.and)(Lr(e,t,i,r.ownProperties),(0,x._)`${s} = ${i}`)))}q.checkMissingProp=jo;function Co(e,t){e.setParams({missingProperty:t},!0),e.error()}q.reportMissingProp=Co;function Is(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,x._)`Object.prototype.hasOwnProperty`})}q.hasPropFunc=Is;function Cr(e,t,r){return(0,x._)`${Is(e)}.call(${t}, ${r})`}q.isOwnProperty=Cr;function Lo(e,t,r,n){const s=(0,x._)`${t}${(0,x.getProperty)(r)} !== undefined`;return n?(0,x._)`${s} && ${Cr(e,t,r)}`:s}q.propertyInData=Lo;function Lr(e,t,r,n){const s=(0,x._)`${t}${(0,x.getProperty)(r)} === undefined`;return n?(0,x.or)(s,(0,x.not)(Cr(e,t,r))):s}q.noPropertyInData=Lr;function Ns(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}q.allSchemaProperties=Ns;function Do(e,t){return Ns(t).filter(r=>!(0,jr.alwaysValidSchema)(e,t[r]))}q.schemaProperties=Do;function qo({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:i},it:o},a,l,d){const u=d?(0,x._)`${e}, ${t}, ${n}${s}`:t,f=[[Pe.default.instancePath,(0,x.strConcat)(Pe.default.instancePath,i)],[Pe.default.parentData,o.parentData],[Pe.default.parentDataProperty,o.parentDataProperty],[Pe.default.rootData,Pe.default.rootData]];o.opts.dynamicRef&&f.push([Pe.default.dynamicAnchors,Pe.default.dynamicAnchors]);const b=(0,x._)`${u}, ${r.object(...f)}`;return l!==x.nil?(0,x._)`${a}.call(${l}, ${b})`:(0,x._)`${a}(${b})`}q.callValidateCode=qo;const Mo=(0,x._)`new RegExp`;function Vo({gen:e,it:{opts:t}},r){const n=t.unicodeRegExp?"u":"",{regExp:s}=t.code,i=s(r,n);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,x._)`${s.code==="new RegExp"?Mo:(0,Ro.useFunc)(e,s)}(${r}, ${n})`})}q.usePattern=Vo;function Fo(e){const{gen:t,data:r,keyword:n,it:s}=e,i=t.name("valid");if(s.allErrors){const a=t.let("valid",!0);return o(()=>t.assign(a,!1)),a}return t.var(i,!0),o(()=>t.break()),i;function o(a){const l=t.const("len",(0,x._)`${r}.length`);t.forRange("i",0,l,d=>{e.subschema({keyword:n,dataProp:d,dataPropType:jr.Type.Num},i),t.if((0,x.not)(i),a)})}}q.validateArray=Fo;function Uo(e){const{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(l=>(0,jr.alwaysValidSchema)(s,l))&&!s.opts.unevaluated)return;const o=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((l,d)=>{const u=e.subschema({keyword:n,schemaProp:d,compositeRule:!0},a);t.assign(o,(0,x._)`${o} || ${a}`),e.mergeValidEvaluated(u,a)||t.if((0,x.not)(o))})),e.result(o,()=>e.reset(),()=>e.error(!0))}q.validateUnion=Uo;Object.defineProperty(ye,"__esModule",{value:!0});ye.validateKeywordUsage=ye.validSchemaType=ye.funcKeywordCode=ye.macroKeywordCode=void 0;const ne=M,Re=ge,zo=q,Ko=pt;function Bo(e,t){const{gen:r,keyword:n,schema:s,parentSchema:i,it:o}=e,a=t.macro.call(o.self,s,i,o),l=As(r,n,a);o.opts.validateSchema!==!1&&o.self.validateSchema(a,!0);const d=r.name("valid");e.subschema({schema:a,schemaPath:ne.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:l,compositeRule:!0},d),e.pass(d,()=>e.error(!0))}ye.macroKeywordCode=Bo;function xo(e,t){var r;const{gen:n,keyword:s,schema:i,parentSchema:o,$data:a,it:l}=e;Go(l,t);const d=!a&&t.compile?t.compile.call(l.self,i,o,l):t.validate,u=As(n,s,d),f=n.let("valid");e.block$data(f,b),e.ok((r=t.valid)!==null&&r!==void 0?r:f);function b(){if(t.errors===!1)v(),t.modifying&&Mn(e),m(()=>e.error());else{const p=t.async?w():_();t.modifying&&Mn(e),m(()=>Ho(e,p))}}function w(){const p=n.let("ruleErrs",null);return n.try(()=>v((0,ne._)`await `),g=>n.assign(f,!1).if((0,ne._)`${g} instanceof ${l.ValidationError}`,()=>n.assign(p,(0,ne._)`${g}.errors`),()=>n.throw(g))),p}function _(){const p=(0,ne._)`${u}.errors`;return n.assign(p,null),v(ne.nil),p}function v(p=t.async?(0,ne._)`await `:ne.nil){const g=l.opts.passContext?Re.default.this:Re.default.self,S=!("compile"in t&&!a||t.schema===!1);n.assign(f,(0,ne._)`${p}${(0,zo.callValidateCode)(e,u,g,S)}`,t.modifying)}function m(p){var g;n.if((0,ne.not)((g=t.valid)!==null&&g!==void 0?g:f),p)}}ye.funcKeywordCode=xo;function Mn(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,ne._)`${n.parentData}[${n.parentDataProperty}]`))}function Ho(e,t){const{gen:r}=e;r.if((0,ne._)`Array.isArray(${t})`,()=>{r.assign(Re.default.vErrors,(0,ne._)`${Re.default.vErrors} === null ? ${t} : ${Re.default.vErrors}.concat(${t})`).assign(Re.default.errors,(0,ne._)`${Re.default.vErrors}.length`),(0,Ko.extendErrors)(e)},()=>e.error())}function Go({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function As(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,ne.stringify)(r)})}function Qo(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e=="undefined")}ye.validSchemaType=Qo;function Jo({schema:e,opts:t,self:r,errSchemaPath:n},s,i){if(Array.isArray(s.keyword)?!s.keyword.includes(i):s.keyword!==i)throw new Error("ajv implementation error");const o=s.dependencies;if(o!=null&&o.some(a=>!Object.prototype.hasOwnProperty.call(e,a)))throw new Error(`parent schema must have dependencies of ${i}: ${o.join(",")}`);if(s.validateSchema&&!s.validateSchema(e[i])){const l=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(l);else throw new Error(l)}}ye.validateKeywordUsage=Jo;var Ne={};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.extendSubschemaMode=Ne.extendSubschemaData=Ne.getSubschema=void 0;const he=M,Os=I;function Yo(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:i,topSchemaRef:o}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){const a=e.schema[t];return r===void 0?{schema:a,schemaPath:(0,he._)`${e.schemaPath}${(0,he.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:(0,he._)`${e.schemaPath}${(0,he.getProperty)(t)}${(0,he.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,Os.escapeFragment)(r)}`}}if(n!==void 0){if(s===void 0||i===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:o,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}Ne.getSubschema=Yo;function Wo(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:i,propertyName:o}){if(s!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:a}=t;if(r!==void 0){const{errorPath:d,dataPathArr:u,opts:f}=t,b=a.let("data",(0,he._)`${t.data}${(0,he.getProperty)(r)}`,!0);l(b),e.errorPath=(0,he.str)`${d}${(0,Os.getErrorPath)(r,n,f.jsPropertySyntax)}`,e.parentDataProperty=(0,he._)`${r}`,e.dataPathArr=[...u,e.parentDataProperty]}if(s!==void 0){const d=s instanceof he.Name?s:a.let("data",s,!0);l(d),o!==void 0&&(e.propertyName=o)}i&&(e.dataTypes=i);function l(d){e.data=d,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,d]}}Ne.extendSubschemaData=Wo;function Zo(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:i}){n!==void 0&&(e.compositeRule=n),s!==void 0&&(e.createErrors=s),i!==void 0&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}Ne.extendSubschemaMode=Zo;var X={},Rs=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=n;s--!==0;){var o=i[s];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r},Ts={exports:{}},Ie=Ts.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};Pt(t,n,s,e,"",e)};Ie.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Ie.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Ie.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Ie.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Pt(e,t,r,n,s,i,o,a,l,d){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,s,i,o,a,l,d);for(var u in n){var f=n[u];if(Array.isArray(f)){if(u in Ie.arrayKeywords)for(var b=0;b<f.length;b++)Pt(e,t,r,f[b],s+"/"+u+"/"+b,i,s,u,n,b)}else if(u in Ie.propsKeywords){if(f&&typeof f=="object")for(var w in f)Pt(e,t,r,f[w],s+"/"+u+"/"+Xo(w),i,s,u,n,w)}else(u in Ie.keywords||e.allKeys&&!(u in Ie.skipKeywords))&&Pt(e,t,r,f,s+"/"+u,i,s,u,n)}r(n,s,i,o,a,l,d)}}function Xo(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var ea=Ts.exports;Object.defineProperty(X,"__esModule",{value:!0});X.getSchemaRefs=X.resolveUrl=X.normalizeId=X._getFullPath=X.getFullPath=X.inlineRef=void 0;const ta=I,ra=Rs,na=ea,sa=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function ia(e,t=!0){return typeof e=="boolean"?!0:t===!0?!_r(e):t?js(e)<=t:!1}X.inlineRef=ia;const oa=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function _r(e){for(const t in e){if(oa.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(_r)||typeof r=="object"&&_r(r))return!0}return!1}function js(e){let t=0;for(const r in e){if(r==="$ref")return 1/0;if(t++,!sa.has(r)&&(typeof e[r]=="object"&&(0,ta.eachItem)(e[r],n=>t+=js(n)),t===1/0))return 1/0}return t}function Cs(e,t="",r){r!==!1&&(t=He(t));const n=e.parse(t);return Ls(e,n)}X.getFullPath=Cs;function Ls(e,t){return e.serialize(t).split("#")[0]+"#"}X._getFullPath=Ls;const aa=/#\/?$/;function He(e){return e?e.replace(aa,""):""}X.normalizeId=He;function ca(e,t,r){return r=He(r),e.resolve(t,r)}X.resolveUrl=ca;const la=/^[a-z_][-a-z0-9._]*$/i;function da(e,t){if(typeof e=="boolean")return{};const{schemaId:r,uriResolver:n}=this.opts,s=He(e[r]||t),i={"":s},o=Cs(n,s,!1),a={},l=new Set;return na(e,{allKeys:!0},(f,b,w,_)=>{if(_===void 0)return;const v=o+b;let m=i[_];typeof f[r]=="string"&&(m=p.call(this,f[r])),g.call(this,f.$anchor),g.call(this,f.$dynamicAnchor),i[b]=m;function p(S){const A=this.opts.uriResolver.resolve;if(S=He(m?A(m,S):S),l.has(S))throw u(S);l.add(S);let O=this.refs[S];return typeof O=="string"&&(O=this.refs[O]),typeof O=="object"?d(f,O.schema,S):S!==He(v)&&(S[0]==="#"?(d(f,a[S],S),a[S]=f):this.refs[S]=v),S}function g(S){if(typeof S=="string"){if(!la.test(S))throw new Error(`invalid anchor "${S}"`);p.call(this,`#${S}`)}}}),a;function d(f,b,w){if(b!==void 0&&!ra(f,b))throw u(w)}function u(f){return new Error(`reference "${f}" resolves to more than one schema`)}}X.getSchemaRefs=da;Object.defineProperty(fe,"__esModule",{value:!0});fe.getData=fe.KeywordCxt=fe.validateFunctionCode=void 0;const Ds=Ge,Vn=J,Dr=be,Rt=J,ua=Mt,ct=ye,ar=Ne,R=M,C=ge,fa=X,we=I,rt=pt;function ha(e){if(Vs(e)&&(Fs(e),Ms(e))){ya(e);return}qs(e,()=>(0,Ds.topBoolOrEmptySchema)(e))}fe.validateFunctionCode=ha;function qs({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},i){s.code.es5?e.func(t,(0,R._)`${C.default.data}, ${C.default.valCxt}`,n.$async,()=>{e.code((0,R._)`"use strict"; ${Fn(r,s)}`),ma(e,s),e.code(i)}):e.func(t,(0,R._)`${C.default.data}, ${pa(s)}`,n.$async,()=>e.code(Fn(r,s)).code(i))}function pa(e){return(0,R._)`{${C.default.instancePath}="", ${C.default.parentData}, ${C.default.parentDataProperty}, ${C.default.rootData}=${C.default.data}${e.dynamicRef?(0,R._)`, ${C.default.dynamicAnchors}={}`:R.nil}}={}`}function ma(e,t){e.if(C.default.valCxt,()=>{e.var(C.default.instancePath,(0,R._)`${C.default.valCxt}.${C.default.instancePath}`),e.var(C.default.parentData,(0,R._)`${C.default.valCxt}.${C.default.parentData}`),e.var(C.default.parentDataProperty,(0,R._)`${C.default.valCxt}.${C.default.parentDataProperty}`),e.var(C.default.rootData,(0,R._)`${C.default.valCxt}.${C.default.rootData}`),t.dynamicRef&&e.var(C.default.dynamicAnchors,(0,R._)`${C.default.valCxt}.${C.default.dynamicAnchors}`)},()=>{e.var(C.default.instancePath,(0,R._)`""`),e.var(C.default.parentData,(0,R._)`undefined`),e.var(C.default.parentDataProperty,(0,R._)`undefined`),e.var(C.default.rootData,C.default.data),t.dynamicRef&&e.var(C.default.dynamicAnchors,(0,R._)`{}`)})}function ya(e){const{schema:t,opts:r,gen:n}=e;qs(e,()=>{r.$comment&&t.$comment&&zs(e),ba(e),n.let(C.default.vErrors,null),n.let(C.default.errors,0),r.unevaluated&&ga(e),Us(e),Sa(e)})}function ga(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,R._)`${r}.evaluated`),t.if((0,R._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,R._)`${e.evaluated}.props`,(0,R._)`undefined`)),t.if((0,R._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,R._)`${e.evaluated}.items`,(0,R._)`undefined`))}function Fn(e,t){const r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,R._)`/*# sourceURL=${r} */`:R.nil}function $a(e,t){if(Vs(e)&&(Fs(e),Ms(e))){_a(e,t);return}(0,Ds.boolOrEmptySchema)(e,t)}function Ms({schema:e,self:t}){if(typeof e=="boolean")return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function Vs(e){return typeof e.schema!="boolean"}function _a(e,t){const{schema:r,gen:n,opts:s}=e;s.$comment&&r.$comment&&zs(e),wa(e),Ea(e);const i=n.const("_errs",C.default.errors);Us(e,i),n.var(t,(0,R._)`${i} === ${C.default.errors}`)}function Fs(e){(0,we.checkUnknownRules)(e),va(e)}function Us(e,t){if(e.opts.jtd)return Un(e,[],!1,t);const r=(0,Vn.getSchemaTypes)(e.schema),n=(0,Vn.coerceAndCheckDataType)(e,r);Un(e,r,!n,t)}function va(e){const{schema:t,errSchemaPath:r,opts:n,self:s}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,we.schemaHasRulesButRef)(t,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function ba(e){const{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,we.checkStrictMode)(e,"default is ignored in the schema root")}function wa(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,fa.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function Ea(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function zs({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:s}){const i=r.$comment;if(s.$comment===!0)e.code((0,R._)`${C.default.self}.logger.log(${i})`);else if(typeof s.$comment=="function"){const o=(0,R.str)`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,R._)`${C.default.self}.opts.$comment(${i}, ${o}, ${a}.schema)`)}}function Sa(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:i}=e;r.$async?t.if((0,R._)`${C.default.errors} === 0`,()=>t.return(C.default.data),()=>t.throw((0,R._)`new ${s}(${C.default.vErrors})`)):(t.assign((0,R._)`${n}.errors`,C.default.vErrors),i.unevaluated&&Pa(e),t.return((0,R._)`${C.default.errors} === 0`))}function Pa({gen:e,evaluated:t,props:r,items:n}){r instanceof R.Name&&e.assign((0,R._)`${t}.props`,r),n instanceof R.Name&&e.assign((0,R._)`${t}.items`,n)}function Un(e,t,r,n){const{gen:s,schema:i,data:o,allErrors:a,opts:l,self:d}=e,{RULES:u}=d;if(i.$ref&&(l.ignoreKeywordsWithRef||!(0,we.schemaHasRulesButRef)(i,u))){s.block(()=>xs(e,"$ref",u.all.$ref.definition));return}l.jtd||ka(e,t),s.block(()=>{for(const b of u.rules)f(b);f(u.post)});function f(b){(0,Dr.shouldUseGroup)(i,b)&&(b.type?(s.if((0,Rt.checkDataType)(b.type,o,l.strictNumbers)),zn(e,b),t.length===1&&t[0]===b.type&&r&&(s.else(),(0,Rt.reportTypeError)(e)),s.endIf()):zn(e,b),a||s.if((0,R._)`${C.default.errors} === ${n||0}`))}}function zn(e,t){const{gen:r,schema:n,opts:{useDefaults:s}}=e;s&&(0,ua.assignDefaults)(e,t.type),r.block(()=>{for(const i of t.rules)(0,Dr.shouldUseRule)(n,i)&&xs(e,i.keyword,i.definition,t.type)})}function ka(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(Ia(e,t),e.opts.allowUnionTypes||Na(e,t),Aa(e,e.dataTypes))}function Ia(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{Ks(e.dataTypes,r)||qr(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),Ra(e,t)}}function Na(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&qr(e,"use allowUnionTypes to allow union type keyword")}function Aa(e,t){const r=e.self.RULES.all;for(const n in r){const s=r[n];if(typeof s=="object"&&(0,Dr.shouldUseRule)(e.schema,s)){const{type:i}=s.definition;i.length&&!i.some(o=>Oa(t,o))&&qr(e,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function Oa(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function Ks(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function Ra(e,t){const r=[];for(const n of e.dataTypes)Ks(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function qr(e,t){const r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,we.checkStrictMode)(e,t,e.opts.strictTypes)}class Bs{constructor(t,r,n){if((0,ct.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,we.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",Hs(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,ct.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",C.default.errors))}result(t,r,n){this.failResult((0,R.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,R.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);const{schemaCode:r}=this;this.fail((0,R._)`${r} !== undefined && (${(0,R.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?rt.reportExtraError:rt.reportError)(this,this.def.error,r)}$dataError(){(0,rt.reportError)(this,this.def.$dataError||rt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,rt.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=R.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=R.nil,r=R.nil){if(!this.$data)return;const{gen:n,schemaCode:s,schemaType:i,def:o}=this;n.if((0,R.or)((0,R._)`${s} === undefined`,r)),t!==R.nil&&n.assign(t,!0),(i.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==R.nil&&n.assign(t,!1)),n.else()}invalid$data(){const{gen:t,schemaCode:r,schemaType:n,def:s,it:i}=this;return(0,R.or)(o(),a());function o(){if(n.length){if(!(r instanceof R.Name))throw new Error("ajv implementation error");const l=Array.isArray(n)?n:[n];return(0,R._)`${(0,Rt.checkDataTypes)(l,r,i.opts.strictNumbers,Rt.DataType.Wrong)}`}return R.nil}function a(){if(s.validateSchema){const l=t.scopeValue("validate$data",{ref:s.validateSchema});return(0,R._)`!${l}(${r})`}return R.nil}}subschema(t,r){const n=(0,ar.getSubschema)(this.it,t);(0,ar.extendSubschemaData)(n,this.it,t),(0,ar.extendSubschemaMode)(n,t);const s=ee(V(V({},this.it),n),{items:void 0,props:void 0});return $a(s,r),s}mergeEvaluated(t,r){const{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=we.mergeEvaluated.props(s,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=we.mergeEvaluated.items(s,t.items,n.items,r)))}mergeValidEvaluated(t,r){const{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(r,()=>this.mergeEvaluated(t,R.Name)),!0}}fe.KeywordCxt=Bs;function xs(e,t,r,n){const s=new Bs(e,r,t);"code"in r?r.code(s,n):s.$data&&r.validate?(0,ct.funcKeywordCode)(s,r):"macro"in r?(0,ct.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,ct.funcKeywordCode)(s,r)}const Ta=/^\/(?:[^~]|~0|~1)*$/,ja=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Hs(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,i;if(e==="")return C.default.rootData;if(e[0]==="/"){if(!Ta.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);s=e,i=C.default.rootData}else{const d=ja.exec(e);if(!d)throw new Error(`Invalid JSON-pointer: ${e}`);const u=+d[1];if(s=d[2],s==="#"){if(u>=t)throw new Error(l("property/index",u));return n[t-u]}if(u>t)throw new Error(l("data",u));if(i=r[t-u],!s)return i}let o=i;const a=s.split("/");for(const d of a)d&&(i=(0,R._)`${i}${(0,R.getProperty)((0,we.unescapeJsonPointer)(d))}`,o=(0,R._)`${o} && ${i}`);return o;function l(d,u){return`Cannot access ${d} ${u} levels up, current level is ${t}`}}fe.getData=Hs;var mt={};Object.defineProperty(mt,"__esModule",{value:!0});class Ca extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}mt.default=Ca;var Je={};Object.defineProperty(Je,"__esModule",{value:!0});const cr=X;class La extends Error{constructor(t,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,cr.resolveUrl)(t,r,n),this.missingSchema=(0,cr.normalizeId)((0,cr.getFullPath)(t,this.missingRef))}}Je.default=La;var ae={};Object.defineProperty(ae,"__esModule",{value:!0});ae.resolveSchema=ae.getCompilingSchema=ae.resolveRef=ae.compileSchema=ae.SchemaEnv=void 0;const le=M,Da=mt,Oe=ge,ue=X,Kn=I,qa=fe;class Vt{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,ue.normalizeId)(n==null?void 0:n[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n==null?void 0:n.$async,this.refs={}}}ae.SchemaEnv=Vt;function Mr(e){const t=Gs.call(this,e);if(t)return t;const r=(0,ue.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new le.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i});let a;e.$async&&(a=o.scopeValue("Error",{ref:Da.default,code:(0,le._)`require("ajv/dist/runtime/validation_error").default`}));const l=o.scopeName("validate");e.validateName=l;const d={gen:o,allErrors:this.opts.allErrors,data:Oe.default.data,parentData:Oe.default.parentData,parentDataProperty:Oe.default.parentDataProperty,dataNames:[Oe.default.data],dataPathArr:[le.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,le.stringify)(e.schema)}:{ref:e.schema}),validateName:l,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:le.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,le._)`""`,opts:this.opts,self:this};let u;try{this._compilations.add(e),(0,qa.validateFunctionCode)(d),o.optimize(this.opts.code.optimize);const f=o.toString();u=`${o.scopeRefs(Oe.default.scope)}return ${f}`,this.opts.code.process&&(u=this.opts.code.process(u,e));const w=new Function(`${Oe.default.self}`,`${Oe.default.scope}`,u)(this,this.scope.get());if(this.scope.value(l,{ref:w}),w.errors=null,w.schema=e.schema,w.schemaEnv=e,e.$async&&(w.$async=!0),this.opts.code.source===!0&&(w.source={validateName:l,validateCode:f,scopeValues:o._values}),this.opts.unevaluated){const{props:_,items:v}=d;w.evaluated={props:_ instanceof le.Name?void 0:_,items:v instanceof le.Name?void 0:v,dynamicProps:_ instanceof le.Name,dynamicItems:v instanceof le.Name},w.source&&(w.source.evaluated=(0,le.stringify)(w.evaluated))}return e.validate=w,e}catch(f){throw delete e.validate,delete e.validateName,u&&this.logger.error("Error compiling schema, function code:",u),f}finally{this._compilations.delete(e)}}ae.compileSchema=Mr;function Ma(e,t,r){var n;r=(0,ue.resolveUrl)(this.opts.uriResolver,t,r);const s=e.refs[r];if(s)return s;let i=Ua.call(this,e,r);if(i===void 0){const o=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;o&&(i=new Vt({schema:o,schemaId:a,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=Va.call(this,i)}ae.resolveRef=Ma;function Va(e){return(0,ue.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Mr.call(this,e)}function Gs(e){for(const t of this._compilations)if(Fa(t,e))return t}ae.getCompilingSchema=Gs;function Fa(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Ua(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||Ft.call(this,e,t)}function Ft(e,t){const r=this.opts.uriResolver.parse(t),n=(0,ue._getFullPath)(this.opts.uriResolver,r);let s=(0,ue.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return lr.call(this,r,e);const i=(0,ue.normalizeId)(n),o=this.refs[i]||this.schemas[i];if(typeof o=="string"){const a=Ft.call(this,e,o);return typeof(a==null?void 0:a.schema)!="object"?void 0:lr.call(this,r,a)}if(typeof(o==null?void 0:o.schema)=="object"){if(o.validate||Mr.call(this,o),i===(0,ue.normalizeId)(t)){const{schema:a}=o,{schemaId:l}=this.opts,d=a[l];return d&&(s=(0,ue.resolveUrl)(this.opts.uriResolver,s,d)),new Vt({schema:a,schemaId:l,root:e,baseId:s})}return lr.call(this,r,o)}}ae.resolveSchema=Ft;const za=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function lr(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(const a of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const l=r[(0,Kn.unescapeFragment)(a)];if(l===void 0)return;r=l;const d=typeof r=="object"&&r[this.opts.schemaId];!za.has(a)&&d&&(t=(0,ue.resolveUrl)(this.opts.uriResolver,t,d))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,Kn.schemaHasRulesButRef)(r,this.RULES)){const a=(0,ue.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=Ft.call(this,n,a)}const{schemaId:o}=this.opts;if(i=i||new Vt({schema:r,schemaId:o,root:n,baseId:t}),i.schema!==i.root.schema)return i}const Ka="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Ba="Meta-schema for $data reference (JSON AnySchema extension proposal)",xa="object",Ha=["$data"],Ga={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Qa=!1,Ja={$id:Ka,description:Ba,type:xa,required:Ha,properties:Ga,additionalProperties:Qa};var Vr={},Ut={exports:{}};const Ya=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Fr=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),Wa=RegExp.prototype.test.bind(/^\d*$/u),Ye=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),Ur=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),Qs=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),zr=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),Za=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),oe=new Array(256);{const e="0123456789ABCDEF";for(let t=0;t<256;t++)oe[t]="%"+e[t>>4]+e[t&15]}function re(e){return e<2048?oe[192|e>>6]+oe[128|e&63]:e<65536?oe[224|e>>12]+oe[128|e>>6&63]+oe[128|e&63]:oe[240|e>>18]+oe[128|e>>12&63]+oe[128|e>>6&63]+oe[128|e&63]}const Xa=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),ec=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),tc=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),rc=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function nc(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++)if(!tc(e[t])){if(e[t]==="%"&&t+2<e.length&&Ye(e.slice(t+1,t+3))){t+=2;continue}return!1}return!0}function Bn(e){let t=-1,r=0,n=-1,s=0;for(let a=0;a<e.length;a++)e[a]==="0"?(n===-1&&(n=a),s++,s>r&&(r=s,t=n)):(n=-1,s=0);if(r<2)return e.join(":");const i=e.slice(0,t).join(":"),o=e.slice(t+r).join(":");return i+"::"+o}function sc(e){const t=e.indexOf("::");if(t!==-1&&e.indexOf("::",t+1)!==-1)return;const r=t===-1?e.split(":"):e.slice(0,t).split(":"),n=t===-1?[]:e.slice(t+2).split(":");t!==-1&&(r.length===1&&r[0]===""&&(r.length=0),n.length===1&&n[0]===""&&(n.length=0));const s=r.concat(n);let i=0;for(let a=0;a<s.length;a++){const l=s[a];if(l==="")return;if(l.indexOf(".")!==-1){if(a!==s.length-1||t!==-1&&n.length===0||!Fr(l))return;i+=2;continue}if(!Xa(l))return;s[a]=parseInt(l,16).toString(16),i++}if(t===-1)return i!==8?void 0:Bn(s);if(i>=8)return;const o=s.slice(0,r.length);for(let a=i;a<8;a++)o.push("0");for(let a=r.length;a<s.length;a++)o.push(s[a]);return Bn(o)}function vr(e){const t=e[0]==="["&&e[e.length-1]==="]";if((e[0]==="["||e[e.length-1]==="]")&&!t)return{host:e,isIPV6:!1,error:!0};let n=t?e.slice(1,-1):e;if(t&&ec(n))return n=n.toLowerCase(),{host:`[${n}]`,escapedHost:n,isIPV6:!1,isIPVFuture:!0};if(ic(n,":")<2)return{host:e,isIPV6:!1,error:t};let s="";const i=n.indexOf("%");if(i!==-1){const a=n.slice(i,i+3).toLowerCase()==="%25"?3:1;if(s=n.slice(i+a),!nc(s))return{host:e,isIPV6:!1,error:!0};n=n.slice(0,i)}const o=sc(n);return o===void 0?{host:e,isIPV6:!1,error:!0}:{host:o+(s?"%"+s:""),escapedHost:o+(s?"%25"+s:""),isIPV6:!0}}function ic(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}function oc(e){let t=e;const r=[];let n=-1,s=0;for(;s=t.length;){if(s===1){if(t===".")break;if(t==="/"){r.push("/");break}else{r.push(t);break}}else if(s===2){if(t[0]==="."){if(t[1]===".")break;if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&(t[1]==="."||t[1]==="/")){r.push("/");break}}else if(s===3&&t==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"&&t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."&&t[3]==="/"){t=t.slice(3),r.length!==0&&r.pop();continue}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}const ac={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},cc=/[@/?#:]/g,lc=/[@/?#]/g;function Js(e,t){const r=t?lc:cc;return r.lastIndex=0,e.replace(r,n=>ac[n])}function Ys(e,t=!1){if(e.indexOf("%")===-1)return e;let r="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){const s=e.slice(n+1,n+3);if(Ye(s)){const i=s.toUpperCase(),o=String.fromCharCode(parseInt(i,16));t&&Ur(o)?r+=o:r+="%"+i,n+=2;continue}}r+=e[n]}return r}function dc(e){let t="";for(let r=0;r<e.length;r++){const n=e[r];if(n==="%"&&r+2<e.length){const s=e.slice(r+1,r+3);if(Ye(s)){const i=s.toUpperCase(),o=String.fromCharCode(parseInt(i,16));o!=="."&&Ur(o)?t+=o:t+="%"+i,r+=2;continue}}if(Qs(n))t+=n;else{const s=e.charCodeAt(r);if(s<128)t+=Ws(s)?n:oe[s];else if(s<55296||s>57343)t+=re(s);else if(s<=56319&&r+1<e.length){const i=e.charCodeAt(r+1);i>=56320&&i<=57343?(t+=re(65536+(s-55296<<10)+(i-56320)),r++):t+=re(65533)}else t+=re(65533)}}return t}function uc(e,t=!1){let r="",n=t&&e[0]!=="/";for(let s=0;s<e.length;s++){const i=e[s];if(i==="%"&&s+2<e.length){const o=e.slice(s+1,s+3);if(Ye(o)){r+="%"+o.toUpperCase(),s+=2;continue}}if(i==="/"&&(n=!1),Qs(i)&&(i!==":"||!n))r+=i;else{const o=e.charCodeAt(s);if(o<128)r+=oe[o];else if(o<55296||o>57343)r+=re(o);else if(o<=56319&&s+1<e.length){const a=e.charCodeAt(s+1);a>=56320&&a<=57343?(r+=re(65536+(o-55296<<10)+(a-56320)),s++):r+=re(65533)}else r+=re(65533)}}return r}function Kr(e,t){let r="";for(let n=0;n<e.length;n++){const s=e[n];if(s==="%"&&n+2<e.length){const i=e.slice(n+1,n+3);if(Ye(i)){r+="%"+i.toUpperCase(),n+=2;continue}}if(t(s))r+=s;else{const i=e.charCodeAt(n);if(i<128)r+=oe[i];else if(i<55296||i>57343)r+=re(i);else if(i<=56319&&n+1<e.length){const o=e.charCodeAt(n+1);o>=56320&&o<=57343?(r+=re(65536+(i-55296<<10)+(o-56320)),n++):r+=re(65533)}else r+=re(65533)}}return r}function fc(e){return Kr(e,Za)}function hc(e){return Kr(e,zr)}function pc(e){return Kr(e,zr)}function Ws(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===42||e===43||e===45||e===46||e===47||e===64||e===95}function mc(e){let t="";for(let r=0;r<e.length;r++){const n=e[r];if(n==="%"&&r+2<e.length){const s=e.slice(r+1,r+3);if(Ye(s)){const i=s.toUpperCase(),o=String.fromCharCode(parseInt(i,16));Ur(o)?t+=o:t+="%"+i,r+=2;continue}}if(zr(n))t+=n;else{const s=e.charCodeAt(r);if(s<128)t+=Ws(s)?n:oe[s];else if(s<55296||s>57343)t+=re(s);else if(s<=56319&&r+1<e.length){const i=e.charCodeAt(r+1);i>=56320&&i<=57343?(t+=re(65536+(s-55296<<10)+(i-56320)),r++):t+=re(65533)}else t+=re(65533)}}return t}function yc(e){const t=[];if(e.userinfo!==void 0&&(t.push(fc(e.userinfo)),t.push("@")),e.host!==void 0){let r=e.host;if(!Fr(r)){let n=vr(r);n.isIPV6!==!0&&n.isIPVFuture!==!0&&(r=Ys(r,!0),n=vr(r)),n.isIPV6===!0||n.isIPVFuture===!0?r=`[${n.escapedHost}]`:r=Js(r,!1)}t.push(r)}if(typeof e.port=="number"||typeof e.port=="string"){const r=String(e.port);if(!Wa(r))throw new TypeError("URI port is malformed.");t.push(":"),t.push(r)}return t.length?t.join(""):void 0}var Zs={nonSimpleDomain:rc,recomposeAuthority:yc,reescapeHostDelimiters:Js,normalizePercentEncoding:Ys,normalizePathEncoding:dc,serializePathEncoding:uc,normalizeQueryFragmentEncoding:mc,encodeQuery:hc,encodeFragment:pc,removeDotSegments:oc,isIPv4:Fr,isUUID:Ya,normalizeIPv6:vr};const{isUUID:gc}=Zs,$c=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu;function Xs(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S"):!1}function ei(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function ti(e){const t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function _c(e){return e.secure=Xs(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function vc(e){if((e.port===(Xs(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const t=e.resourceName.indexOf("?"),r=t===-1?e.resourceName:e.resourceName.slice(0,t);e.path=r&&r!=="/"?r:void 0,e.query=t===-1?void 0:e.resourceName.slice(t+1),e.resourceName=void 0}return e.fragment=void 0,e}function bc(e,t){if(!e.path)return e.error="URN can not be parsed",e;const r=e.path.match($c);if(r&&r[0]===e.path){const n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];const s=`${n}:${t.nid||e.nid}`,i=Br(s);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function wc(e,t){if(e.nid===void 0)throw new Error("URN without nid cannot be serialized");const r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),s=`${r}:${t.nid||n}`,i=Br(s);i&&(e=i.serialize(e,t));const o=e,a=e.nss;return o.path=`${n||t.nid}:${a}`,t.skipEscape=!0,o}function Ec(e,t){const r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!gc(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function Sc(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t}const ri={scheme:"http",domainHost:!0,parse:ei,serialize:ti},Pc={scheme:"https",domainHost:ri.domainHost,parse:ei,serialize:ti},kt={scheme:"ws",domainHost:!0,parse:_c,serialize:vc},kc={scheme:"wss",domainHost:kt.domainHost,parse:kt.parse,serialize:kt.serialize},Ic={scheme:"urn",parse:bc,serialize:wc,skipNormalize:!0},Nc={scheme:"urn:uuid",parse:Ec,serialize:Sc,skipNormalize:!0},Tt={http:ri,https:Pc,ws:kt,wss:kc,urn:Ic,"urn:uuid":Nc};Object.setPrototypeOf(Tt,null);function Br(e){return e&&(Tt[e]||Tt[e.toLowerCase()])||void 0}var Ac={SCHEMES:Tt,getSchemeHandler:Br};const{normalizeIPv6:ni,removeDotSegments:ot,recomposeAuthority:Oc,normalizePercentEncoding:si,normalizePathEncoding:Rc,serializePathEncoding:xn,normalizeQueryFragmentEncoding:Hn,encodeQuery:Tc,encodeFragment:jc,reescapeHostDelimiters:Cc,isIPv4:ii,nonSimpleDomain:Lc}=Zs,{SCHEMES:oi,getSchemeHandler:xr}=Ac,ai=/^[A-Za-z][A-Za-z0-9+.-]*$/u,ci="URI scheme is malformed.";function Gn(e){const t=unescape(String(e));if(!ai.test(t))throw new TypeError(ci);return t}function Dc(e,t){return typeof e=="string"?e=Bc(e,t):typeof e=="object"&&(e=Ct(De(e,t),t)),e}function qc(e,t,r){const n=r?Object.assign({scheme:"null"},r):{scheme:"null"},{parsed:s,malformedAuthorityOrPort:i,malformedPercentEncoding:o,malformedSchemeSpecific:a,malformedHost:l,malformedScheme:d}=jt(e,n),{parsed:u,malformedAuthorityOrPort:f,malformedPercentEncoding:b,malformedSchemeSpecific:w,malformedHost:_,malformedScheme:v}=jt(t,n);if(i||f||o||b||a||w||l||_||d||v)throw new Error(s.error||u.error||"URI is malformed.");const m=li(s,u,n,!0),p=xr(r&&r.scheme||m.scheme),g=m.host,S=g!==void 0&&g!==""&&(ii(g)||ni(g).isIPV6);di(m,r||{},p,S);const A=g&&g.indexOf("%")!==-1&&!new RegExp("\\P{ASCII}","u").test(g);if(m.error&&!A)throw new Error(m.error);return n.skipEscape=!0,De(m,n)}function li(e,t,r,n){const s={};return n||(e=Ct(De(e,r),r),t=Ct(De(t,r),r)),r=r||{},!r.tolerant&&t.scheme?(s.scheme=t.scheme,s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=ot(t.path||""),s.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=ot(t.path||""),s.query=t.query):(t.path?(t.path[0]==="/"?s.path=ot(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?s.path="/"+t.path:e.path?s.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:s.path=t.path,s.path=ot(s.path)),s.query=t.query):(s.path=e.path,t.query!==void 0?s.query=t.query:s.query=e.query),s.userinfo=e.userinfo,s.host=e.host,s.port=e.port),s.scheme=e.scheme),s.fragment=t.fragment,s}function Mc(e,t,r){const n=Qn(e,r),s=Qn(t,r);return n!==void 0&&s!==void 0&&n===s}function De(e,t){const r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),s=[];r.scheme&&(r.scheme=Gn(r.scheme));const i=xr(n.scheme||r.scheme);i&&i.serialize&&i.serialize(r,n);const o=r.userinfo!==void 0||r.host!==void 0||r.port!==void 0,a=!n.skipEscape&&r.scheme===void 0&&!o;r.path!==void 0&&(n.skipEscape?r.path=si(r.path):r.path=xn(r.path,a)),n.reference!=="suffix"&&r.scheme&&(r.scheme=Gn(r.scheme),s.push(r.scheme,":"));const l=Oc(r);if(l!==void 0&&(n.reference!=="suffix"&&s.push("//"),s.push(l),r.path&&r.path[0]!=="/"&&s.push("/")),r.path!==void 0){let d=r.path;!n.absolutePath&&(!i||!i.absolutePath)&&(d=ot(d)),a&&(d=xn(d,!0)),l===void 0&&d[0]==="/"&&d[1]==="/"&&(d="/%2F"+d.slice(2)),s.push(d)}return r.query!==void 0&&s.push("?",Tc(r.query)),r.fragment!==void 0&&s.push("#",jc(r.fragment)),s.join("")}const Vc=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,Fc=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,Uc=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function zc(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port=="number"&&(e.port<0||e.port>65535))return"URI port is malformed."}function nt(e){if(e===void 0)return!1;let t=e.indexOf("%");for(;t!==-1;){if(t+2>=e.length||!/^[\da-f]{2}$/iu.test(e.slice(t+1,t+3)))return!0;t=e.indexOf("%",t+3)}return!1}function Hr(e){return e[0]==="["&&e[e.length-1]==="]"}function Kc(e){const t=e[4];return nt(e[3])||t!==void 0&&!Hr(t)&&nt(t)||nt(e[6])||nt(e[7])||nt(e[8])}function di(e,t,r,n){if(!t.unicodeSupport&&(!r||!r.unicodeSupport)&&e.host&&!Hr(e.host)&&(t.domainHost||r&&r.domainHost)&&n===!1&&Lc(e.host))try{e.host=new URL("http://"+e.host).hostname}catch(s){return e.error=e.error||"Host's domain name can not be converted to ASCII: "+s,!0}return!1}function jt(e,t){const r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let s=!1,i=!1,o=!1,a=!1,l=!1,d=!1,u=!1;r.reference==="suffix"&&(r.scheme?e=r.scheme+":"+e:e="//"+e);const f=e.match(Fc);f!==null&&f[1].indexOf("\\")!==-1&&(n.error="URI authority must not contain a literal backslash.",s=!0);const b=e.match(Uc);if(b!==null){const _=b[1],v=_.replace(/[\t\n\r]/g,"");v.length>=2&&(v.slice(0,2)!=="//"?(n.error=n.error||"URI authority must not contain a literal backslash.",s=!0):_.length!==v.length&&(n.error=n.error||"URI authority introducer must not contain whitespace.",s=!0))}const w=e.match(Vc);if(w){if(n.scheme=w[1],n.userinfo=w[3],n.host=w[4],n.port=parseInt(w[5],10),n.path=w[6]||"",n.query=w[7],n.fragment=w[8],n.scheme!==void 0){const m=unescape(n.scheme);ai.test(m)?n.scheme=m.toLowerCase():(n.error=n.error||ci,d=!0)}i=Kc(w),i&&(n.error=n.error||"URI contains malformed percent-encoding."),isNaN(n.port)&&(n.port=w[5]);const _=zc(n,w);if(_!==void 0&&(n.error=n.error||_,s=!0),n.host)if(ii(n.host)===!1){const p=Hr(n.host),g=n.host.indexOf("[")!==-1||n.host.indexOf("]")!==-1,S=ni(n.host);u=S.isIPV6||S.isIPVFuture===!0,l=g&&(!p||S.error===!0),n.host=u?S.host:S.host.toLowerCase(),l&&(n.error=n.error||"URI host is malformed.",s=!0)}else u=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");const v=xr(r.scheme||n.scheme);if(l||(a=di(n,r,v,u)),!v||v&&!v.skipNormalize){if(e.indexOf("%")!==-1&&n.host!==void 0&&!l){const m=u?n.host:si(n.host,!0);n.host=Cc(m,u)}n.path&&(n.path=Rc(n.path)),n.query&&(n.query=Hn(n.query)),n.fragment&&(n.fragment=Hn(n.fragment))}v&&v.parse&&(v.parse(n,r),v===oi.urn&&n.nid===void 0&&(o=!0))}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:s,malformedPercentEncoding:i,malformedSchemeSpecific:o,malformedHost:a,malformedScheme:d}}function Ct(e,t){return jt(e,t).parsed}function Bc(e,t){return ui(e,t).normalized}function ui(e,t){const{parsed:r,malformedAuthorityOrPort:n,malformedPercentEncoding:s,malformedSchemeSpecific:i,malformedHost:o,malformedScheme:a}=jt(e,t);return{normalized:n||s||i||o||a?e:De(r,t),malformedAuthorityOrPort:n,malformedPercentEncoding:s,malformedSchemeSpecific:i,malformedHost:o,malformedScheme:a}}function Qn(e,t){if(typeof e!="string"&&typeof e!="object")return;let r;try{r=typeof e=="string"?e:De(e,t)}catch(d){return}const{normalized:n,malformedAuthorityOrPort:s,malformedPercentEncoding:i,malformedSchemeSpecific:o,malformedHost:a,malformedScheme:l}=ui(r,t);return s||i||o||a||l?void 0:n}const Gr={SCHEMES:oi,normalize:Dc,resolve:qc,resolveComponent:li,equal:Mc,serialize:De,parse:Ct};Ut.exports=Gr;Ut.exports.default=Gr;Ut.exports.fastUri=Gr;var xc=Ut.exports;Object.defineProperty(Vr,"__esModule",{value:!0});const fi=xc;fi.code='require("ajv/dist/runtime/uri").default';Vr.default=fi;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=fe;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=M;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=mt,s=Je,i=Le,o=ae,a=M,l=X,d=J,u=I,f=Ja,b=Vr,w=(k,y)=>new RegExp(k,y);w.code="new RegExp";const _=["removeAdditional","useDefaults","coerceTypes"],v=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),m={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},p={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},g=200;function S(k){var y,P,$,c,h,E,T,j,z,U,Y,Ve,Ht,Gt,Qt,Jt,Yt,Wt,Zt,Xt,er,tr,rr,nr,sr;const tt=k.strict,ir=(y=k.code)===null||y===void 0?void 0:y.optimize,Nn=ir===!0||ir===void 0?1:ir||0,An=($=(P=k.code)===null||P===void 0?void 0:P.regExp)!==null&&$!==void 0?$:w,Si=(c=k.uriResolver)!==null&&c!==void 0?c:b.default;return{strictSchema:(E=(h=k.strictSchema)!==null&&h!==void 0?h:tt)!==null&&E!==void 0?E:!0,strictNumbers:(j=(T=k.strictNumbers)!==null&&T!==void 0?T:tt)!==null&&j!==void 0?j:!0,strictTypes:(U=(z=k.strictTypes)!==null&&z!==void 0?z:tt)!==null&&U!==void 0?U:"log",strictTuples:(Ve=(Y=k.strictTuples)!==null&&Y!==void 0?Y:tt)!==null&&Ve!==void 0?Ve:"log",strictRequired:(Gt=(Ht=k.strictRequired)!==null&&Ht!==void 0?Ht:tt)!==null&&Gt!==void 0?Gt:!1,code:k.code?ee(V({},k.code),{optimize:Nn,regExp:An}):{optimize:Nn,regExp:An},loopRequired:(Qt=k.loopRequired)!==null&&Qt!==void 0?Qt:g,loopEnum:(Jt=k.loopEnum)!==null&&Jt!==void 0?Jt:g,meta:(Yt=k.meta)!==null&&Yt!==void 0?Yt:!0,messages:(Wt=k.messages)!==null&&Wt!==void 0?Wt:!0,inlineRefs:(Zt=k.inlineRefs)!==null&&Zt!==void 0?Zt:!0,schemaId:(Xt=k.schemaId)!==null&&Xt!==void 0?Xt:"$id",addUsedSchema:(er=k.addUsedSchema)!==null&&er!==void 0?er:!0,validateSchema:(tr=k.validateSchema)!==null&&tr!==void 0?tr:!0,validateFormats:(rr=k.validateFormats)!==null&&rr!==void 0?rr:!0,unicodeRegExp:(nr=k.unicodeRegExp)!==null&&nr!==void 0?nr:!0,int32range:(sr=k.int32range)!==null&&sr!==void 0?sr:!0,uriResolver:Si}}class A{constructor(y={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,y=this.opts=V(V({},y),S(y));const{es5:P,lines:$}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:v,es5:P,lines:$}),this.logger=_e(y.logger);const c=y.validateFormats;y.validateFormats=!1,this.RULES=(0,i.getRules)(),O.call(this,m,y,"NOT SUPPORTED"),O.call(this,p,y,"DEPRECATED","warn"),this._metaOpts=Ae.call(this),y.formats&&$e.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),y.keywords&&Ee.call(this,y.keywords),typeof y.meta=="object"&&this.addMetaSchema(y.meta),Q.call(this),y.validateFormats=c}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:y,meta:P,schemaId:$}=this.opts;let c=f;$==="id"&&(c=V({},f),c.id=c.$id,delete c.$id),P&&y&&this.addMetaSchema(c,c[$],!1)}defaultMeta(){const{meta:y,schemaId:P}=this.opts;return this.opts.defaultMeta=typeof y=="object"?y[P]||y:void 0}validate(y,P){let $;if(typeof y=="string"){if($=this.getSchema(y),!$)throw new Error(`no schema with key or ref "${y}"`)}else $=this.compile(y);const c=$(P);return"$async"in $||(this.errors=$.errors),c}compile(y,P){const $=this._addSchema(y,P);return $.validate||this._compileSchemaEnv($)}compileAsync(y,P){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:$}=this.opts;return c.call(this,y,P);function c(U,Y){return Fe(this,null,function*(){yield h.call(this,U.$schema);const Ve=this._addSchema(U,Y);return Ve.validate||E.call(this,Ve)})}function h(U){return Fe(this,null,function*(){U&&!this.getSchema(U)&&(yield c.call(this,{$ref:U},!0))})}function E(U){return Fe(this,null,function*(){try{return this._compileSchemaEnv(U)}catch(Y){if(!(Y instanceof s.default))throw Y;return T.call(this,Y),yield j.call(this,Y.missingSchema),E.call(this,U)}})}function T({missingSchema:U,missingRef:Y}){if(this.refs[U])throw new Error(`AnySchema ${U} is loaded but ${Y} cannot be resolved`)}function j(U){return Fe(this,null,function*(){const Y=yield z.call(this,U);this.refs[U]||(yield h.call(this,Y.$schema)),this.refs[U]||this.addSchema(Y,U,P)})}function z(U){return Fe(this,null,function*(){const Y=this._loading[U];if(Y)return Y;try{return yield this._loading[U]=$(U)}finally{delete this._loading[U]}})}}addSchema(y,P,$,c=this.opts.validateSchema){if(Array.isArray(y)){for(const E of y)this.addSchema(E,void 0,$,c);return this}let h;if(typeof y=="object"){const{schemaId:E}=this.opts;if(h=y[E],h!==void 0&&typeof h!="string")throw new Error(`schema ${E} must be string`)}return P=(0,l.normalizeId)(P||h),this._checkUnique(P),this.schemas[P]=this._addSchema(y,$,P,c,!0),this}addMetaSchema(y,P,$=this.opts.validateSchema){return this.addSchema(y,P,!0,$),this}validateSchema(y,P){if(typeof y=="boolean")return!0;let $;if($=y.$schema,$!==void 0&&typeof $!="string")throw new Error("$schema must be a string");if($=$||this.opts.defaultMeta||this.defaultMeta(),!$)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const c=this.validate($,y);if(!c&&P){const h="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(h);else throw new Error(h)}return c}getSchema(y){let P;for(;typeof(P=B.call(this,y))=="string";)y=P;if(P===void 0){const{schemaId:$}=this.opts,c=new o.SchemaEnv({schema:{},schemaId:$});if(P=o.resolveSchema.call(this,c,y),!P)return;this.refs[y]=P}return P.validate||this._compileSchemaEnv(P)}removeSchema(y){if(y instanceof RegExp)return this._removeAllSchemas(this.schemas,y),this._removeAllSchemas(this.refs,y),this;switch(typeof y){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const P=B.call(this,y);return typeof P=="object"&&this._cache.delete(P.schema),delete this.schemas[y],delete this.refs[y],this}case"object":{const P=y;this._cache.delete(P);let $=y[this.opts.schemaId];return $&&($=(0,l.normalizeId)($),delete this.schemas[$],delete this.refs[$]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(y){for(const P of y)this.addKeyword(P);return this}addKeyword(y,P){let $;if(typeof y=="string")$=y,typeof P=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),P.keyword=$);else if(typeof y=="object"&&P===void 0){if(P=y,$=P.keyword,Array.isArray($)&&!$.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(Se.call(this,$,P),!P)return(0,u.eachItem)($,h=>et.call(this,h)),this;Bt.call(this,P);const c=ee(V({},P),{type:(0,d.getJSONTypes)(P.type),schemaType:(0,d.getJSONTypes)(P.schemaType)});return(0,u.eachItem)($,c.type.length===0?h=>et.call(this,h,c):h=>c.type.forEach(E=>et.call(this,h,c,E))),this}getKeyword(y){const P=this.RULES.all[y];return typeof P=="object"?P.definition:!!P}removeKeyword(y){const{RULES:P}=this;delete P.keywords[y],delete P.all[y];for(const $ of P.rules){const c=$.rules.findIndex(h=>h.keyword===y);c>=0&&$.rules.splice(c,1)}return this}addFormat(y,P){return typeof P=="string"&&(P=new RegExp(P)),this.formats[y]=P,this}errorsText(y=this.errors,{separator:P=", ",dataVar:$="data"}={}){return!y||y.length===0?"No errors":y.map(c=>`${$}${c.instancePath} ${c.message}`).reduce((c,h)=>c+P+h)}$dataMetaSchema(y,P){const $=this.RULES.all;y=JSON.parse(JSON.stringify(y));for(const c of P){const h=c.split("/").slice(1);let E=y;for(const T of h)E=E[T];for(const T in $){const j=$[T];if(typeof j!="object")continue;const{$data:z}=j.definition,U=E[T];z&&U&&(E[T]=$t(U))}}return y}_removeAllSchemas(y,P){for(const $ in y){const c=y[$];(!P||P.test($))&&(typeof c=="string"?delete y[$]:c&&!c.meta&&(this._cache.delete(c.schema),delete y[$]))}}_addSchema(y,P,$,c=this.opts.validateSchema,h=this.opts.addUsedSchema){let E;const{schemaId:T}=this.opts;if(typeof y=="object")E=y[T];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof y!="boolean")throw new Error("schema must be object or boolean")}let j=this._cache.get(y);if(j!==void 0)return j;$=(0,l.normalizeId)(E||$);const z=l.getSchemaRefs.call(this,y,$);return j=new o.SchemaEnv({schema:y,schemaId:T,meta:P,baseId:$,localRefs:z}),this._cache.set(j.schema,j),h&&!$.startsWith("#")&&($&&this._checkUnique($),this.refs[$]=j),c&&this.validateSchema(y,!0),j}_checkUnique(y){if(this.schemas[y]||this.refs[y])throw new Error(`schema with key or id "${y}" already exists`)}_compileSchemaEnv(y){if(y.meta?this._compileMetaSchema(y):o.compileSchema.call(this,y),!y.validate)throw new Error("ajv implementation error");return y.validate}_compileMetaSchema(y){const P=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,y)}finally{this.opts=P}}}A.ValidationError=n.default,A.MissingRefError=s.default,e.default=A;function O(k,y,P,$="error"){for(const c in k){const h=c;h in y&&this.logger[$](`${P}: option ${c}. ${k[h]}`)}}function B(k){return k=(0,l.normalizeId)(k),this.schemas[k]||this.refs[k]}function Q(){const k=this.opts.schemas;if(k)if(Array.isArray(k))this.addSchema(k);else for(const y in k)this.addSchema(k[y],y)}function $e(){for(const k in this.opts.formats){const y=this.opts.formats[k];y&&this.addFormat(k,y)}}function Ee(k){if(Array.isArray(k)){this.addVocabulary(k);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const y in k){const P=k[y];P.keyword||(P.keyword=y),this.addKeyword(P)}}function Ae(){const k=V({},this.opts);for(const y of _)delete k[y];return k}const Xe={log(){},warn(){},error(){}};function _e(k){if(k===!1)return Xe;if(k===void 0)return console;if(k.log&&k.warn&&k.error)return k;throw new Error("logger must implement log, warn and error methods")}const Me=/^[a-z_$][a-z0-9_$:-]*$/i;function Se(k,y){const{RULES:P}=this;if((0,u.eachItem)(k,$=>{if(P.keywords[$])throw new Error(`Keyword ${$} is already defined`);if(!Me.test($))throw new Error(`Keyword ${$} has invalid name`)}),!!y&&y.$data&&!("code"in y||"validate"in y))throw new Error('$data keyword must have "code" or "validate" function')}function et(k,y,P){var $;const c=y==null?void 0:y.post;if(P&&c)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:h}=this;let E=c?h.post:h.rules.find(({type:j})=>j===P);if(E||(E={type:P,rules:[]},h.rules.push(E)),h.keywords[k]=!0,!y)return;const T={keyword:k,definition:ee(V({},y),{type:(0,d.getJSONTypes)(y.type),schemaType:(0,d.getJSONTypes)(y.schemaType)})};y.before?gt.call(this,E,T,y.before):E.rules.push(T),h.all[k]=T,($=y.implements)===null||$===void 0||$.forEach(j=>this.addKeyword(j))}function gt(k,y,P){const $=k.rules.findIndex(c=>c.keyword===P);$>=0?k.rules.splice($,0,y):(k.rules.push(y),this.logger.warn(`rule ${P} is not defined`))}function Bt(k){let{metaSchema:y}=k;y!==void 0&&(k.$data&&this.opts.$data&&(y=$t(y)),k.validateSchema=this.compile(y,!0))}const xt={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function $t(k){return{anyOf:[k,xt]}}})(ms);var Qr={},Jr={},Yr={};Object.defineProperty(Yr,"__esModule",{value:!0});const Hc={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Yr.default=Hc;var qe={};Object.defineProperty(qe,"__esModule",{value:!0});qe.callRef=qe.getValidate=void 0;const Gc=Je,Jn=q,ie=M,ze=ge,Yn=ae,_t=I,Qc={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:i,validateName:o,opts:a,self:l}=n,{root:d}=i;if((r==="#"||r==="#/")&&s===d.baseId)return f();const u=Yn.resolveRef.call(l,d,s,r);if(u===void 0)throw new Gc.default(n.opts.uriResolver,s,r);if(u instanceof Yn.SchemaEnv)return b(u);return w(u);function f(){if(i===d)return It(e,o,i,i.$async);const _=t.scopeValue("root",{ref:d});return It(e,(0,ie._)`${_}.validate`,d,d.$async)}function b(_){const v=hi(e,_);It(e,v,_,_.$async)}function w(_){const v=t.scopeValue("schema",a.code.source===!0?{ref:_,code:(0,ie.stringify)(_)}:{ref:_}),m=t.name("valid"),p=e.subschema({schema:_,dataTypes:[],schemaPath:ie.nil,topSchemaRef:v,errSchemaPath:r},m);e.mergeEvaluated(p),e.ok(m)}}};function hi(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,ie._)`${r.scopeValue("wrapper",{ref:t})}.validate`}qe.getValidate=hi;function It(e,t,r,n){const{gen:s,it:i}=e,{allErrors:o,schemaEnv:a,opts:l}=i,d=l.passContext?ze.default.this:ie.nil;n?u():f();function u(){if(!a.$async)throw new Error("async schema referenced by sync schema");const _=s.let("valid");s.try(()=>{s.code((0,ie._)`await ${(0,Jn.callValidateCode)(e,t,d)}`),w(t),o||s.assign(_,!0)},v=>{s.if((0,ie._)`!(${v} instanceof ${i.ValidationError})`,()=>s.throw(v)),b(v),o||s.assign(_,!1)}),e.ok(_)}function f(){e.result((0,Jn.callValidateCode)(e,t,d),()=>w(t),()=>b(t))}function b(_){const v=(0,ie._)`${_}.errors`;s.assign(ze.default.vErrors,(0,ie._)`${ze.default.vErrors} === null ? ${v} : ${ze.default.vErrors}.concat(${v})`),s.assign(ze.default.errors,(0,ie._)`${ze.default.vErrors}.length`)}function w(_){var v;if(!i.opts.unevaluated)return;const m=(v=r==null?void 0:r.validate)===null||v===void 0?void 0:v.evaluated;if(i.props!==!0)if(m&&!m.dynamicProps)m.props!==void 0&&(i.props=_t.mergeEvaluated.props(s,m.props,i.props));else{const p=s.var("props",(0,ie._)`${_}.evaluated.props`);i.props=_t.mergeEvaluated.props(s,p,i.props,ie.Name)}if(i.items!==!0)if(m&&!m.dynamicItems)m.items!==void 0&&(i.items=_t.mergeEvaluated.items(s,m.items,i.items));else{const p=s.var("items",(0,ie._)`${_}.evaluated.items`);i.items=_t.mergeEvaluated.items(s,p,i.items,ie.Name)}}}qe.callRef=It;qe.default=Qc;Object.defineProperty(Jr,"__esModule",{value:!0});const Jc=Yr,Yc=qe,Wc=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Jc.default,Yc.default];Jr.default=Wc;var Wr={},Zr={};Object.defineProperty(Zr,"__esModule",{value:!0});const Lt=M,ke=Lt.operators,Dt={maximum:{okStr:"<=",ok:ke.LTE,fail:ke.GT},minimum:{okStr:">=",ok:ke.GTE,fail:ke.LT},exclusiveMaximum:{okStr:"<",ok:ke.LT,fail:ke.GTE},exclusiveMinimum:{okStr:">",ok:ke.GT,fail:ke.LTE}},Zc={message:({keyword:e,schemaCode:t})=>(0,Lt.str)`must be ${Dt[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Lt._)`{comparison: ${Dt[e].okStr}, limit: ${t}}`},Xc={keyword:Object.keys(Dt),type:"number",schemaType:"number",$data:!0,error:Zc,code(e){const{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,Lt._)`${r} ${Dt[t].fail} ${n} || isNaN(${r})`)}};Zr.default=Xc;var Xr={};Object.defineProperty(Xr,"__esModule",{value:!0});const lt=M,el={message:({schemaCode:e})=>(0,lt.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,lt._)`{multipleOf: ${e}}`},tl={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:el,code(e){const{gen:t,data:r,schemaCode:n,it:s}=e,i=s.opts.multipleOfPrecision,o=t.let("res"),a=i?(0,lt._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}`:(0,lt._)`${o} !== parseInt(${o})`;e.fail$data((0,lt._)`(${n} === 0 || (${o} = ${r}/${n}, ${a}))`)}};Xr.default=tl;var en={},tn={};Object.defineProperty(tn,"__esModule",{value:!0});function pi(e){const t=e.length;let r=0,n=0,s;for(;n<t;)r++,s=e.charCodeAt(n++),s>=55296&&s<=56319&&n<t&&(s=e.charCodeAt(n),(s&64512)===56320&&n++);return r}tn.default=pi;pi.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(en,"__esModule",{value:!0});const Te=M,rl=I,nl=tn,sl={message({keyword:e,schemaCode:t}){const r=e==="maxLength"?"more":"fewer";return(0,Te.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,Te._)`{limit: ${e}}`},il={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:sl,code(e){const{keyword:t,data:r,schemaCode:n,it:s}=e,i=t==="maxLength"?Te.operators.GT:Te.operators.LT,o=s.opts.unicode===!1?(0,Te._)`${r}.length`:(0,Te._)`${(0,rl.useFunc)(e.gen,nl.default)}(${r})`;e.fail$data((0,Te._)`${o} ${i} ${n}`)}};en.default=il;var rn={};Object.defineProperty(rn,"__esModule",{value:!0});const ol=q,al=I,Be=M,cl={message:({schemaCode:e})=>(0,Be.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,Be._)`{pattern: ${e}}`},ll={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:cl,code(e){const{gen:t,data:r,$data:n,schema:s,schemaCode:i,it:o}=e,a=o.opts.unicodeRegExp?"u":"";if(n){const{regExp:l}=o.opts.code,d=l.code==="new RegExp"?(0,Be._)`new RegExp`:(0,al.useFunc)(t,l),u=t.let("valid");t.try(()=>t.assign(u,(0,Be._)`${d}(${i}, ${a}).test(${r})`),()=>t.assign(u,!1)),e.fail$data((0,Be._)`!${u}`)}else{const l=(0,ol.usePattern)(e,s);e.fail$data((0,Be._)`!${l}.test(${r})`)}}};rn.default=ll;var nn={};Object.defineProperty(nn,"__esModule",{value:!0});const dt=M,dl={message({keyword:e,schemaCode:t}){const r=e==="maxProperties"?"more":"fewer";return(0,dt.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,dt._)`{limit: ${e}}`},ul={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:dl,code(e){const{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?dt.operators.GT:dt.operators.LT;e.fail$data((0,dt._)`Object.keys(${r}).length ${s} ${n}`)}};nn.default=ul;var sn={};Object.defineProperty(sn,"__esModule",{value:!0});const st=q,ut=M,fl=I,hl={message:({params:{missingProperty:e}})=>(0,ut.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,ut._)`{missingProperty: ${e}}`},pl={keyword:"required",type:"object",schemaType:"array",$data:!0,error:hl,code(e){const{gen:t,schema:r,schemaCode:n,data:s,$data:i,it:o}=e,{opts:a}=o;if(!i&&r.length===0)return;const l=r.length>=a.loopRequired;if(o.allErrors?d():u(),a.strictRequired){const w=e.parentSchema.properties,{definedProperties:_}=e.it;for(const v of r)if((w==null?void 0:w[v])===void 0&&!_.has(v)){const m=o.schemaEnv.baseId+o.errSchemaPath,p=`required property "${v}" is not defined at "${m}" (strictRequired)`;(0,fl.checkStrictMode)(o,p,o.opts.strictRequired)}}function d(){if(l||i)e.block$data(ut.nil,f);else for(const w of r)(0,st.checkReportMissingProp)(e,w)}function u(){const w=t.let("missing");if(l||i){const _=t.let("valid",!0);e.block$data(_,()=>b(w,_)),e.ok(_)}else t.if((0,st.checkMissingProp)(e,r,w)),(0,st.reportMissingProp)(e,w),t.else()}function f(){t.forOf("prop",n,w=>{e.setParams({missingProperty:w}),t.if((0,st.noPropertyInData)(t,s,w,a.ownProperties),()=>e.error())})}function b(w,_){e.setParams({missingProperty:w}),t.forOf(w,n,()=>{t.assign(_,(0,st.propertyInData)(t,s,w,a.ownProperties)),t.if((0,ut.not)(_),()=>{e.error(),t.break()})},ut.nil)}}};sn.default=pl;var on={};Object.defineProperty(on,"__esModule",{value:!0});const ft=M,ml={message({keyword:e,schemaCode:t}){const r=e==="maxItems"?"more":"fewer";return(0,ft.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,ft._)`{limit: ${e}}`},yl={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:ml,code(e){const{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?ft.operators.GT:ft.operators.LT;e.fail$data((0,ft._)`${r}.length ${s} ${n}`)}};on.default=yl;var an={},yt={};Object.defineProperty(yt,"__esModule",{value:!0});const mi=Rs;mi.code='require("ajv/dist/runtime/equal").default';yt.default=mi;Object.defineProperty(an,"__esModule",{value:!0});const dr=J,W=M,gl=I,$l=yt,_l={message:({params:{i:e,j:t}})=>(0,W.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,W._)`{i: ${e}, j: ${t}}`},vl={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:_l,code(e){const{gen:t,data:r,$data:n,schema:s,parentSchema:i,schemaCode:o,it:a}=e;if(!n&&!s)return;const l=t.let("valid"),d=i.items?(0,dr.getSchemaTypes)(i.items):[];e.block$data(l,u,(0,W._)`${o} === false`),e.ok(l);function u(){const _=t.let("i",(0,W._)`${r}.length`),v=t.let("j");e.setParams({i:_,j:v}),t.assign(l,!0),t.if((0,W._)`${_} > 1`,()=>(f()?b:w)(_,v))}function f(){return d.length>0&&!d.some(_=>_==="object"||_==="array")}function b(_,v){const m=t.name("item"),p=(0,dr.checkDataTypes)(d,m,a.opts.strictNumbers,dr.DataType.Wrong),g=t.const("indices",(0,W._)`{}`);t.for((0,W._)`;${_}--;`,()=>{t.let(m,(0,W._)`${r}[${_}]`),t.if(p,(0,W._)`continue`),d.length>1&&t.if((0,W._)`typeof ${m} == "string"`,(0,W._)`${m} += "_"`),t.if((0,W._)`typeof ${g}[${m}] == "number"`,()=>{t.assign(v,(0,W._)`${g}[${m}]`),e.error(),t.assign(l,!1).break()}).code((0,W._)`${g}[${m}] = ${_}`)})}function w(_,v){const m=(0,gl.useFunc)(t,$l.default),p=t.name("outer");t.label(p).for((0,W._)`;${_}--;`,()=>t.for((0,W._)`${v} = ${_}; ${v}--;`,()=>t.if((0,W._)`${m}(${r}[${_}], ${r}[${v}])`,()=>{e.error(),t.assign(l,!1).break(p)})))}}};an.default=vl;var cn={};Object.defineProperty(cn,"__esModule",{value:!0});const br=M,bl=I,wl=yt,El={message:"must be equal to constant",params:({schemaCode:e})=>(0,br._)`{allowedValue: ${e}}`},Sl={keyword:"const",$data:!0,error:El,code(e){const{gen:t,data:r,$data:n,schemaCode:s,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,br._)`!${(0,bl.useFunc)(t,wl.default)}(${r}, ${s})`):e.fail((0,br._)`${i} !== ${r}`)}};cn.default=Sl;var ln={};Object.defineProperty(ln,"__esModule",{value:!0});const at=M,Pl=I,kl=yt,Il={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,at._)`{allowedValues: ${e}}`},Nl={keyword:"enum",schemaType:"array",$data:!0,error:Il,code(e){const{gen:t,data:r,$data:n,schema:s,schemaCode:i,it:o}=e;if(!n&&s.length===0)throw new Error("enum must have non-empty array");const a=s.length>=o.opts.loopEnum;let l;const d=()=>l!=null?l:l=(0,Pl.useFunc)(t,kl.default);let u;if(a||n)u=t.let("valid"),e.block$data(u,f);else{if(!Array.isArray(s))throw new Error("ajv implementation error");const w=t.const("vSchema",i);u=(0,at.or)(...s.map((_,v)=>b(w,v)))}e.pass(u);function f(){t.assign(u,!1),t.forOf("v",i,w=>t.if((0,at._)`${d()}(${r}, ${w})`,()=>t.assign(u,!0).break()))}function b(w,_){const v=s[_];return typeof v=="object"&&v!==null?(0,at._)`${d()}(${r}, ${w}[${_}])`:(0,at._)`${r} === ${v}`}}};ln.default=Nl;Object.defineProperty(Wr,"__esModule",{value:!0});const Al=Zr,Ol=Xr,Rl=en,Tl=rn,jl=nn,Cl=sn,Ll=on,Dl=an,ql=cn,Ml=ln,Vl=[Al.default,Ol.default,Rl.default,Tl.default,jl.default,Cl.default,Ll.default,Dl.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},ql.default,Ml.default];Wr.default=Vl;var dn={},We={};Object.defineProperty(We,"__esModule",{value:!0});We.validateAdditionalItems=void 0;const je=M,wr=I,Fl={message:({params:{len:e}})=>(0,je.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,je._)`{limit: ${e}}`},Ul={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Fl,code(e){const{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,wr.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}yi(e,n)}};function yi(e,t){const{gen:r,schema:n,data:s,keyword:i,it:o}=e;o.items=!0;const a=r.const("len",(0,je._)`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,je._)`${a} <= ${t.length}`);else if(typeof n=="object"&&!(0,wr.alwaysValidSchema)(o,n)){const d=r.var("valid",(0,je._)`${a} <= ${t.length}`);r.if((0,je.not)(d),()=>l(d)),e.ok(d)}function l(d){r.forRange("i",t.length,a,u=>{e.subschema({keyword:i,dataProp:u,dataPropType:wr.Type.Num},d),o.allErrors||r.if((0,je.not)(d),()=>r.break())})}}We.validateAdditionalItems=yi;We.default=Ul;var un={},Ze={};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.validateTuple=void 0;const Wn=M,Nt=I,zl=q,Kl={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return gi(e,"additionalItems",t);r.items=!0,!(0,Nt.alwaysValidSchema)(r,t)&&e.ok((0,zl.validateArray)(e))}};function gi(e,t,r=e.schema){const{gen:n,parentSchema:s,data:i,keyword:o,it:a}=e;u(s),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=Nt.mergeEvaluated.items(n,r.length,a.items));const l=n.name("valid"),d=n.const("len",(0,Wn._)`${i}.length`);r.forEach((f,b)=>{(0,Nt.alwaysValidSchema)(a,f)||(n.if((0,Wn._)`${d} > ${b}`,()=>e.subschema({keyword:o,schemaProp:b,dataProp:b},l)),e.ok(l))});function u(f){const{opts:b,errSchemaPath:w}=a,_=r.length,v=_===f.minItems&&(_===f.maxItems||f[t]===!1);if(b.strictTuples&&!v){const m=`"${o}" is ${_}-tuple, but minItems or maxItems/${t} are not specified or different at path "${w}"`;(0,Nt.checkStrictMode)(a,m,b.strictTuples)}}}Ze.validateTuple=gi;Ze.default=Kl;Object.defineProperty(un,"__esModule",{value:!0});const Bl=Ze,xl={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,Bl.validateTuple)(e,"items")};un.default=xl;var fn={};Object.defineProperty(fn,"__esModule",{value:!0});const Zn=M,Hl=I,Gl=q,Ql=We,Jl={message:({params:{len:e}})=>(0,Zn.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Zn._)`{limit: ${e}}`},Yl={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:Jl,code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;n.items=!0,!(0,Hl.alwaysValidSchema)(n,t)&&(s?(0,Ql.validateAdditionalItems)(e,s):e.ok((0,Gl.validateArray)(e)))}};fn.default=Yl;var hn={};Object.defineProperty(hn,"__esModule",{value:!0});const ce=M,vt=I,Wl={message:({params:{min:e,max:t}})=>t===void 0?(0,ce.str)`must contain at least ${e} valid item(s)`:(0,ce.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,ce._)`{minContains: ${e}}`:(0,ce._)`{minContains: ${e}, maxContains: ${t}}`},Zl={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Wl,code(e){const{gen:t,schema:r,parentSchema:n,data:s,it:i}=e;let o,a;const{minContains:l,maxContains:d}=n;i.opts.next?(o=l===void 0?1:l,a=d):o=1;const u=t.const("len",(0,ce._)`${s}.length`);if(e.setParams({min:o,max:a}),a===void 0&&o===0){(0,vt.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&o>a){(0,vt.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,vt.alwaysValidSchema)(i,r)){let v=(0,ce._)`${u} >= ${o}`;a!==void 0&&(v=(0,ce._)`${v} && ${u} <= ${a}`),e.pass(v);return}i.items=!0;const f=t.name("valid");a===void 0&&o===1?w(f,()=>t.if(f,()=>t.break())):o===0?(t.let(f,!0),a!==void 0&&t.if((0,ce._)`${s}.length > 0`,b)):(t.let(f,!1),b()),e.result(f,()=>e.reset());function b(){const v=t.name("_valid"),m=t.let("count",0);w(v,()=>t.if(v,()=>_(m)))}function w(v,m){t.forRange("i",0,u,p=>{e.subschema({keyword:"contains",dataProp:p,dataPropType:vt.Type.Num,compositeRule:!0},v),m()})}function _(v){t.code((0,ce._)`${v}++`),a===void 0?t.if((0,ce._)`${v} >= ${o}`,()=>t.assign(f,!0).break()):(t.if((0,ce._)`${v} > ${a}`,()=>t.assign(f,!1).break()),o===1?t.assign(f,!0):t.if((0,ce._)`${v} >= ${o}`,()=>t.assign(f,!0)))}}};hn.default=Zl;var $i={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=M,r=I,n=q;e.error={message:({params:{property:l,depsCount:d,deps:u}})=>{const f=d===1?"property":"properties";return(0,t.str)`must have ${f} ${u} when property ${l} is present`},params:({params:{property:l,depsCount:d,deps:u,missingProperty:f}})=>(0,t._)`{property: ${l},
6
6
  missingProperty: ${f},
7
7
  depsCount: ${d},
8
- deps: ${u}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){const[d,u]=i(c);o(c,d),a(c,u)}};function i({schema:c}){const d={},u={};for(const f in c){if(f==="__proto__")continue;const _=Array.isArray(c[f])?d:u;_[f]=c[f]}return[d,u]}function o(c,d=c.schema){const{gen:u,data:f,it:_}=c;if(Object.keys(d).length===0)return;const $=u.let("missing");for(const g in d){const v=d[g];if(v.length===0)continue;const m=(0,n.propertyInData)(u,f,g,_.opts.ownProperties);c.setParams({property:g,depsCount:v.length,deps:v.join(", ")}),_.allErrors?u.if(m,()=>{for(const p of v)(0,n.checkReportMissingProp)(c,p)}):(u.if((0,t._)`${m} && (${(0,n.checkMissingProp)(c,v,$)})`),(0,n.reportMissingProp)(c,$),u.else())}}e.validatePropertyDeps=o;function a(c,d=c.schema){const{gen:u,data:f,keyword:_,it:$}=c,g=u.name("valid");for(const v in d)(0,r.alwaysValidSchema)($,d[v])||(u.if((0,n.propertyInData)(u,f,v,$.opts.ownProperties),()=>{const m=c.subschema({keyword:_,schemaProp:v},g);c.mergeValidEvaluated(m,g)},()=>u.var(g,!0)),c.ok(g))}e.validateSchemaDeps=a,e.default=s})(Ks);var tn={};Object.defineProperty(tn,"__esModule",{value:!0});const Bs=z,Vc=T,Mc={message:"property name must be valid",params:({params:e})=>(0,Bs._)`{propertyName: ${e.propertyName}}`},Fc={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Mc,code(e){const{gen:t,schema:r,data:n,it:s}=e;if((0,Vc.alwaysValidSchema)(s,r))return;const i=t.name("valid");t.forIn("key",n,o=>{e.setParams({propertyName:o}),e.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},i),t.if((0,Bs.not)(i),()=>{e.error(!0),s.allErrors||t.break()})}),e.ok(i)}};tn.default=Fc;var Ht={};Object.defineProperty(Ht,"__esModule",{value:!0});const kt=U,Pe=z,Uc=qe(),It=T,zc={message:"must NOT have additional properties",params:({params:e})=>(0,Pe._)`{additionalProperty: ${e.additionalProperty}}`},Kc={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:zc,code(e){const{gen:t,schema:r,parentSchema:n,data:s,errsCount:i,it:o}=e;if(!i)throw new Error("ajv implementation error");const{allErrors:a,opts:c}=o;if(o.props=!0,c.removeAdditional!=="all"&&(0,It.alwaysValidSchema)(o,r))return;const d=(0,kt.allSchemaProperties)(n.properties),u=(0,kt.allSchemaProperties)(n.patternProperties);f(),e.ok((0,Pe._)`${i} === ${Uc.default.errors}`);function f(){t.forIn("key",s,m=>{!d.length&&!u.length?g(m):t.if(_(m),()=>g(m))})}function _(m){let p;if(d.length>8){const E=(0,It.schemaRefOrVal)(o,n.properties,"properties");p=(0,kt.isOwnProperty)(t,E,m)}else d.length?p=(0,Pe.or)(...d.map(E=>(0,Pe._)`${m} === ${E}`)):p=Pe.nil;return u.length&&(p=(0,Pe.or)(p,...u.map(E=>(0,Pe._)`${(0,kt.usePattern)(e,E)}.test(${m})`))),(0,Pe.not)(p)}function $(m){t.code((0,Pe._)`delete ${s}[${m}]`)}function g(m){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){$(m);return}if(r===!1){e.setParams({additionalProperty:m}),e.error(),a||t.break();return}if(typeof r=="object"&&!(0,It.alwaysValidSchema)(o,r)){const p=t.name("valid");c.removeAdditional==="failing"?(v(m,p,!1),t.if((0,Pe.not)(p),()=>{e.reset(),$(m)})):(v(m,p),a||t.if((0,Pe.not)(p),()=>t.break()))}}function v(m,p,E){const k={keyword:"additionalProperties",dataProp:m,dataPropType:It.Type.Str};E===!1&&Object.assign(k,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(k,p)}}};Ht.default=Kc;var rn={};Object.defineProperty(rn,"__esModule",{value:!0});const Bc=zt(),Un=U,tr=T,zn=Ht,xc={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:n,data:s,it:i}=e;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&zn.default.code(new Bc.KeywordCxt(i,zn.default,"additionalProperties"));const o=(0,Un.allSchemaProperties)(r);for(const f of o)i.definedProperties.add(f);i.opts.unevaluated&&o.length&&i.props!==!0&&(i.props=tr.mergeEvaluated.props(t,(0,tr.toHash)(o),i.props));const a=o.filter(f=>!(0,tr.alwaysValidSchema)(i,r[f]));if(a.length===0)return;const c=t.name("valid");for(const f of a)d(f)?u(f):(t.if((0,Un.propertyInData)(t,s,f,i.opts.ownProperties)),u(f),i.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(f),e.ok(c);function d(f){return i.opts.useDefaults&&!i.compositeRule&&r[f].default!==void 0}function u(f){e.subschema({keyword:"properties",schemaProp:f,dataProp:f},c)}}};rn.default=xc;var nn={};Object.defineProperty(nn,"__esModule",{value:!0});const Kn=U,Nt=z,Bn=T,xn=T,Hc={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:n,parentSchema:s,it:i}=e,{opts:o}=i,a=(0,Kn.allSchemaProperties)(r),c=a.filter(v=>(0,Bn.alwaysValidSchema)(i,r[v]));if(a.length===0||c.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;const d=o.strictSchema&&!o.allowMatchingProperties&&s.properties,u=t.name("valid");i.props!==!0&&!(i.props instanceof Nt.Name)&&(i.props=(0,xn.evaluatedPropsToName)(t,i.props));const{props:f}=i;_();function _(){for(const v of a)d&&$(v),i.allErrors?g(v):(t.var(u,!0),g(v),t.if(u))}function $(v){for(const m in d)new RegExp(v).test(m)&&(0,Bn.checkStrictMode)(i,`property ${m} matches pattern ${v} (use allowMatchingProperties)`)}function g(v){t.forIn("key",n,m=>{t.if((0,Nt._)`${(0,Kn.usePattern)(e,v)}.test(${m})`,()=>{const p=c.includes(v);p||e.subschema({keyword:"patternProperties",schemaProp:v,dataProp:m,dataPropType:xn.Type.Str},u),i.opts.unevaluated&&f!==!0?t.assign((0,Nt._)`${f}[${m}]`,!0):!p&&!i.allErrors&&t.if((0,Nt.not)(u),()=>t.break())})})}}};nn.default=Hc;var sn={};Object.defineProperty(sn,"__esModule",{value:!0});const Gc=T,Qc={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:n}=e;if((0,Gc.alwaysValidSchema)(n,r)){e.fail();return}const s=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),e.failResult(s,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};sn.default=Qc;var on={};Object.defineProperty(on,"__esModule",{value:!0});const Jc=U,Yc={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Jc.validateUnion,error:{message:"must match a schema in anyOf"}};on.default=Yc;var an={};Object.defineProperty(an,"__esModule",{value:!0});const Ct=z,Wc=T,Zc={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,Ct._)`{passingSchemas: ${e.passing}}`},Xc={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Zc,code(e){const{gen:t,schema:r,parentSchema:n,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;const i=r,o=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(d),e.result(o,()=>e.reset(),()=>e.error(!0));function d(){i.forEach((u,f)=>{let _;(0,Wc.alwaysValidSchema)(s,u)?t.var(c,!0):_=e.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},c),f>0&&t.if((0,Ct._)`${c} && ${o}`).assign(o,!1).assign(a,(0,Ct._)`[${a}, ${f}]`).else(),t.if(c,()=>{t.assign(o,!0),t.assign(a,f),_&&e.mergeEvaluated(_,Ct.Name)})})}}};an.default=Xc;var cn={};Object.defineProperty(cn,"__esModule",{value:!0});const el=T,tl={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const s=t.name("valid");r.forEach((i,o)=>{if((0,el.alwaysValidSchema)(n,i))return;const a=e.subschema({keyword:"allOf",schemaProp:o},s);e.ok(s),e.mergeEvaluated(a)})}};cn.default=tl;var ln={};Object.defineProperty(ln,"__esModule",{value:!0});const Ut=z,xs=T,rl={message:({params:e})=>(0,Ut.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Ut._)`{failingKeyword: ${e.ifClause}}`},nl={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:rl,code(e){const{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,xs.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const s=Hn(n,"then"),i=Hn(n,"else");if(!s&&!i)return;const o=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),s&&i){const u=t.let("ifClause");e.setParams({ifClause:u}),t.if(a,d("then",u),d("else",u))}else s?t.if(a,d("then")):t.if((0,Ut.not)(a),d("else"));e.pass(o,()=>e.error(!0));function c(){const u=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(u)}function d(u,f){return()=>{const _=e.subschema({keyword:u},a);t.assign(o,a),e.mergeValidEvaluated(_,o),f?t.assign(f,(0,Ut._)`${u}`):e.setParams({ifClause:u})}}}};function Hn(e,t){const r=e.schema[t];return r!==void 0&&!(0,xs.alwaysValidSchema)(e,r)}ln.default=nl;var dn={};Object.defineProperty(dn,"__esModule",{value:!0});const sl=T,il={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,sl.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};dn.default=il;Object.defineProperty(Wr,"__esModule",{value:!0});const ol=it,al=Zr,cl=ot,ll=Xr,dl=en,ul=Ks,fl=tn,hl=Ht,pl=rn,ml=nn,yl=sn,gl=on,$l=an,_l=cn,vl=ln,bl=dn;function wl(e=!1){const t=[yl.default,gl.default,$l.default,_l.default,vl.default,bl.default,fl.default,hl.default,ul.default,pl.default,ml.default];return e?t.push(al.default,ll.default):t.push(ol.default,cl.default),t.push(dl.default),t}Wr.default=wl;var un={},fn={};Object.defineProperty(fn,"__esModule",{value:!0});const Z=z,El={message:({schemaCode:e})=>(0,Z.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,Z._)`{format: ${e}}`},Sl={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:El,code(e,t){const{gen:r,data:n,$data:s,schema:i,schemaCode:o,it:a}=e,{opts:c,errSchemaPath:d,schemaEnv:u,self:f}=a;if(!c.validateFormats)return;s?_():$();function _(){const g=r.scopeValue("formats",{ref:f.formats,code:c.code.formats}),v=r.const("fDef",(0,Z._)`${g}[${o}]`),m=r.let("fType"),p=r.let("format");r.if((0,Z._)`typeof ${v} == "object" && !(${v} instanceof RegExp)`,()=>r.assign(m,(0,Z._)`${v}.type || "string"`).assign(p,(0,Z._)`${v}.validate`),()=>r.assign(m,(0,Z._)`"string"`).assign(p,v)),e.fail$data((0,Z.or)(E(),k()));function E(){return c.strictSchema===!1?Z.nil:(0,Z._)`${o} && !${p}`}function k(){const R=u.$async?(0,Z._)`(${v}.async ? await ${p}(${n}) : ${p}(${n}))`:(0,Z._)`${p}(${n})`,j=(0,Z._)`(typeof ${p} == "function" ? ${R} : ${p}.test(${n}))`;return(0,Z._)`${p} && ${p} !== true && ${m} === ${t} && !${j}`}}function $(){const g=f.formats[i];if(!g){E();return}if(g===!0)return;const[v,m,p]=k(g);v===t&&e.pass(R());function E(){if(c.strictSchema===!1){f.logger.warn(j());return}throw new Error(j());function j(){return`unknown format "${i}" ignored in schema at path "${d}"`}}function k(j){const H=j instanceof RegExp?(0,Z.regexpCode)(j):c.code.formats?(0,Z._)`${c.code.formats}${(0,Z.getProperty)(i)}`:void 0,Q=r.scopeValue("formats",{key:i,ref:j,code:H});return typeof j=="object"&&!(j instanceof RegExp)?[j.type||"string",j.validate,(0,Z._)`${Q}.validate`]:["string",j,Q]}function R(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!u.$async)throw new Error("async format in sync schema");return(0,Z._)`await ${p}(${n})`}return typeof m=="function"?(0,Z._)`${p}(${n})`:(0,Z._)`${p}.test(${n})`}}}};fn.default=Sl;Object.defineProperty(un,"__esModule",{value:!0});const Pl=fn,kl=[Pl.default];un.default=kl;var rt={};Object.defineProperty(rt,"__esModule",{value:!0});rt.contentVocabulary=rt.metadataVocabulary=void 0;rt.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];rt.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(Dr,"__esModule",{value:!0});const Il=qr,Nl=Mr,Al=Wr,Ol=un,Gn=rt,Rl=[Il.default,Nl.default,(0,Al.default)(),Ol.default,Gn.metadataVocabulary,Gn.contentVocabulary];Dr.default=Rl;var hn={},Gt={};Object.defineProperty(Gt,"__esModule",{value:!0});Gt.DiscrError=void 0;var Qn;(function(e){e.Tag="tag",e.Mapping="mapping"})(Qn||(Gt.DiscrError=Qn={}));Object.defineProperty(hn,"__esModule",{value:!0});const Ze=z,hr=Gt,Jn=ye,Tl=nt,jl=T,Cl={message:({params:{discrError:e,tagName:t}})=>e===hr.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Ze._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},Ll={keyword:"discriminator",type:"object",schemaType:"object",error:Cl,code(e){const{gen:t,data:r,schema:n,parentSchema:s,it:i}=e,{oneOf:o}=s;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");const a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");const c=t.let("valid",!1),d=t.const("tag",(0,Ze._)`${r}${(0,Ze.getProperty)(a)}`);t.if((0,Ze._)`typeof ${d} == "string"`,()=>u(),()=>e.error(!1,{discrError:hr.DiscrError.Tag,tag:d,tagName:a})),e.ok(c);function u(){const $=_();t.if(!1);for(const g in $)t.elseIf((0,Ze._)`${d} === ${g}`),t.assign(c,f($[g]));t.else(),e.error(!1,{discrError:hr.DiscrError.Mapping,tag:d,tagName:a}),t.endIf()}function f($){const g=t.name("valid"),v=e.subschema({keyword:"oneOf",schemaProp:$},g);return e.mergeEvaluated(v,Ze.Name),g}function _(){var $;const g={},v=p(s);let m=!0;for(let R=0;R<o.length;R++){let j=o[R];if(j!=null&&j.$ref&&!(0,jl.schemaHasRulesButRef)(j,i.self.RULES)){const Q=j.$ref;if(j=Jn.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,Q),j instanceof Jn.SchemaEnv&&(j=j.schema),j===void 0)throw new Tl.default(i.opts.uriResolver,i.baseId,Q)}const H=($=j==null?void 0:j.properties)===null||$===void 0?void 0:$[a];if(typeof H!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);m=m&&(v||p(j)),E(H,R)}if(!m)throw new Error(`discriminator: "${a}" must be required`);return g;function p({required:R}){return Array.isArray(R)&&R.includes(a)}function E(R,j){if(R.const)k(R.const,j);else if(R.enum)for(const H of R.enum)k(H,j);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function k(R,j){if(typeof R!="string"||R in g)throw new Error(`discriminator: "${a}" values must be unique strings`);g[R]=j}}}};hn.default=Ll;const Dl="http://json-schema.org/draft-07/schema#",ql="http://json-schema.org/draft-07/schema#",Vl="Core schema meta-schema",Ml={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},Fl=["object","boolean"],Ul={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},zl={$schema:Dl,$id:ql,title:Vl,definitions:Ml,type:Fl,properties:Ul,default:!0};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const r=es,n=Dr,s=hn,i=zl,o=["/properties"],a="http://json-schema.org/draft-07/schema";class c extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(g=>this.addVocabulary(g)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const g=this.opts.$data?this.$dataMetaSchema(i,o):i;this.addMetaSchema(g,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}t.Ajv=c,e.exports=t=c,e.exports.Ajv=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var d=zt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return d.KeywordCxt}});var u=z;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var f=bt;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return f.default}});var _=nt;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return _.default}})})(ir,ir.exports);var Kl=ir.exports;const Bl=_i(Kl),xl={$schema:"http://json-schema.org/draft-07/schema#",$id:"urn:article-content-protocol:v1:with-formatting-extensions",title:"Article Content Protocol v1 + Extensions",type:"object",additionalProperties:!1,required:["type","content"],properties:{type:{const:"doc"},content:{type:"array",items:{oneOf:[{$ref:"#/definitions/blockNode"},{$ref:"#/definitions/resourceQuestion"}]}}},definitions:{blockNode:{oneOf:[{$ref:"#/definitions/paragraph"},{$ref:"#/definitions/heading"},{$ref:"#/definitions/blockquote"},{$ref:"#/definitions/bulletList"},{$ref:"#/definitions/orderedList"},{$ref:"#/definitions/codeBlock"},{$ref:"#/definitions/horizontalRule"},{$ref:"#/definitions/image"},{$ref:"#/definitions/articleButton"},{$ref:"#/definitions/table"}]},paragraph:{type:"object",additionalProperties:!1,required:["type"],properties:{type:{const:"paragraph"},attrs:{type:"object",additionalProperties:!1,properties:{textAlign:{$ref:"#/definitions/textAlign"},fontSize:{$schema:"http://json-schema.org/draft-07/schema#",$id:"urn:article-content-protocol:paragraph-font-size:v1",title:"Optional paragraph fontSize attribute (pixels)",description:"Applied to paragraph.attrs.fontSize alongside the unchanged v1 paragraph attributes. Omit to inherit the default size. Consumers must support this optional extension.",type:"integer",minimum:8,maximum:96},anchorId:{type:"string",minLength:1,pattern:"\\S",description:"Stable paragraph/heading anchor, unique within the article."}}},content:{type:"array",items:{$ref:"#/definitions/text"}}}},heading:{type:"object",additionalProperties:!1,required:["type","attrs"],properties:{type:{const:"heading"},attrs:{type:"object",additionalProperties:!1,required:["level"],properties:{level:{type:"integer",minimum:1,maximum:6},textAlign:{$ref:"#/definitions/textAlign"},anchorId:{type:"string",minLength:1,pattern:"\\S",description:"Stable paragraph/heading anchor, unique within the article."}}},content:{type:"array",items:{$ref:"#/definitions/text"}}}},blockquote:{type:"object",additionalProperties:!1,required:["type","content"],properties:{type:{const:"blockquote"},content:{type:"array",items:{$ref:"#/definitions/blockNode"}}}},bulletList:{type:"object",additionalProperties:!1,required:["type","content"],properties:{type:{const:"bulletList"},content:{type:"array",items:{$ref:"#/definitions/listItem"}}}},orderedList:{type:"object",additionalProperties:!1,required:["type","attrs","content"],properties:{type:{const:"orderedList"},attrs:{type:"object",additionalProperties:!1,required:["start"],properties:{start:{type:"integer",minimum:1}}},content:{type:"array",items:{$ref:"#/definitions/listItem"}}}},listItem:{type:"object",additionalProperties:!1,required:["type","content"],properties:{type:{const:"listItem"},content:{type:"array",items:{$ref:"#/definitions/blockNode"}}}},codeBlock:{type:"object",additionalProperties:!1,required:["type","attrs"],properties:{type:{const:"codeBlock"},attrs:{type:"object",additionalProperties:!1,properties:{language:{type:"string",minLength:1,maxLength:32}}},content:{type:"array",items:{type:"object",additionalProperties:!1,required:["type","text"],properties:{type:{const:"text"},text:{type:"string",minLength:1}}}}}},horizontalRule:{type:"object",additionalProperties:!1,required:["type"],properties:{type:{const:"horizontalRule"}}},image:{type:"object",additionalProperties:!1,required:["type","attrs"],properties:{type:{const:"image"},attrs:{type:"object",additionalProperties:!1,required:["src"],properties:{src:{type:"string",minLength:1},alt:{type:"string"},title:{type:"string"},width:{type:"integer",minimum:1,maximum:1e4},height:{type:"integer",minimum:1,maximum:1e4},imageAlign:{$ref:"#/definitions/imageAlign"},imageLayout:{$schema:"http://json-schema.org/draft-07/schema#",$id:"urn:article-content-protocol:image-layout:v1",title:"Optional two-column image layout",description:"Applied to image.attrs.imageLayout. Adjacent two-column images flow two per row in document order. Other blocks break the row. Omit for the original full-row image layout.",type:"string",enum:["two-column"]}}}}},articleButton:{type:"object",additionalProperties:!1,required:["type","attrs"],properties:{type:{const:"articleButton"},attrs:{type:"object",additionalProperties:!1,required:["text","style"],properties:{id:{type:"string",minLength:1},title:{type:"string",minLength:1},text:{type:"string",minLength:1},style:{enum:["text","button","link"]},href:{type:"string",minLength:1}},allOf:[{if:{properties:{style:{enum:["text","button"]}},required:["style"]},then:{properties:{id:{}},required:["id"]}},{if:{properties:{href:{}},required:["href"]},then:{properties:{style:{const:"link"}}}}]}}},table:{type:"object",additionalProperties:!1,required:["type","content"],properties:{type:{const:"table"},content:{type:"array",items:{$ref:"#/definitions/tableRow"}}}},tableRow:{type:"object",additionalProperties:!1,required:["type","content"],properties:{type:{const:"tableRow"},content:{type:"array",items:{$ref:"#/definitions/tableCell"}}}},tableCell:{type:"object",additionalProperties:!1,required:["type","content"],properties:{type:{const:"tableCell"},content:{type:"array",items:{$ref:"#/definitions/blockNode"}}}},text:{type:"object",additionalProperties:!1,required:["type","text"],properties:{type:{const:"text"},text:{type:"string",minLength:1},marks:{type:"array",items:{$ref:"#/definitions/mark"}}}},textAlign:{type:"string",enum:["left","center","right","justify"]},imageAlign:{type:"string",enum:["left","center","right"]},mark:{oneOf:[{type:"object",additionalProperties:!1,required:["type"],properties:{type:{enum:["bold","italic","strike","underline","code"]}}},{type:"object",additionalProperties:!1,required:["type","attrs"],properties:{type:{const:"link"},attrs:{oneOf:[{type:"object",additionalProperties:!1,required:["href","target"],properties:{type:{const:"href",default:"href",description:"May be omitted in legacy documents; omission means href."},href:{type:"string",minLength:1,description:"Non-empty URI reference; fragment-only links such as # are valid."},target:{enum:["_blank","_self"]}}},{type:"object",additionalProperties:!1,required:["type","id","title","target"],properties:{type:{const:"custom"},id:{type:"string",minLength:1},title:{type:"string",minLength:1},target:{enum:["_blank","_self"]}}}]}}},{$schema:"http://json-schema.org/draft-07/schema#",$id:"urn:article-content-protocol:text-formatting:v1",title:"Optional text formatting marks for Article Content Protocol v1",description:"Additional marks accepted alongside the unchanged v1 marks. Existing v1 documents require no migration. Consumers must support these marks to render colored documents.",type:"object",additionalProperties:!1,required:["type","attrs"],properties:{type:{enum:["textStyle","highlight"]},attrs:{type:"object",additionalProperties:!1,required:["color"],properties:{color:{type:"string",pattern:"^#[0-9a-fA-F]{6}$"}}}}}]},resourceQuestion:{$id:"urn:article-content-protocol:resource-question:v1",type:"object",additionalProperties:!1,required:["type","attrs"],properties:{type:{const:"resourceQuestion"},attrs:{type:"object",additionalProperties:!1,required:["id","resourceId","title","description","options","hideFollowing","revealKey"],properties:{id:{type:"string",minLength:1,pattern:"\\S"},resourceId:{type:"string"},title:{type:"string"},description:{type:"string"},options:{type:"array",items:{type:"object",additionalProperties:!1,required:["id","label"],properties:{id:{type:"string",minLength:1,pattern:"\\S"},label:{type:"string",minLength:1,pattern:"\\S"},targetAnchorId:{type:"string",minLength:1,pattern:"\\S"}}}},hideFollowing:{type:"boolean"},revealKey:{type:"string",minLength:1,pattern:"\\S"}},allOf:[{if:{properties:{resourceId:{const:""}}},then:{properties:{title:{const:""},description:{const:""},options:{maxItems:0}}},else:{properties:{resourceId:{pattern:"\\S"},title:{minLength:1,pattern:"\\S"},options:{minItems:1}}}}]}}}}},Hl={documentSchema:xl},Yn=new Bl({strict:!1,allErrors:!0}).compile(Hl.documentSchema);function pr(e){if(!Re(e))return e;const t=K({},e);return Array.isArray(t.content)&&(t.content=t.content.map(pr)),Array.isArray(t.marks)&&(t.marks=t.marks.map(pr)),t.type==="orderedList"&&(t.attrs===void 0||Re(t.attrs))&&(t.attrs=K({start:1},Re(t.attrs)?t.attrs:{})),t.type==="codeBlock"&&t.attrs===void 0&&(t.attrs={}),t.type==="link"&&Re(t.attrs)&&(t.attrs=K({target:"_blank"},t.attrs)),t}function Gl(e){var t;return Yn(pr(e))?[]:((t=Yn.errors)!=null?t:[]).map(r=>{var n;return{code:"INVALID_VALUE",path:r.instancePath,message:`Protocol schema: ${(n=r.message)!=null?n:r.keyword}.`}})}const Ql=new Set(["paragraph","heading","blockquote","bulletList","orderedList","codeBlock","horizontalRule","image","articleButton","table"]),Jl=new Set(["left","center","right","justify"]),Yl=new Set(["left","center","right"]),Wl=new Set(["bold","italic","strike","underline","code"]);function ft(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function L(e,t){return`${e}/${String(t).replaceAll("~","~0").replaceAll("/","~1")}`}function M(e,...t){let r=e;for(const n of t)r=L(r,n);return r}class Zl{constructor(){he(this,"issues",[]);he(this,"identities",new Map);he(this,"targets",[])}validate(t){var n;if(!ft(t))return this.add("INVALID_ROOT","","The document must be an object."),this.result();this.checkProperties(t,"",["type","content"],["type","content"]),t.type!=="doc"&&this.add("INVALID_ROOT","/type",'The root node type must be "doc".');const r=this.requireArray(t.content,"/content");r==null||r.forEach((s,i)=>this.validateBlock(s,L("/content",i),!0));for(const s of this.targets)(n=this.identities.get("anchorId"))!=null&&n.has(s.id)||this.issues.push({code:"MISSING_ANCHOR",path:s.path,message:`Bound target "${s.id}" no longer exists.`,nodeType:"resourceQuestion",severity:"warning"});return this.result()}result(){return{valid:!this.issues.some(t=>t.severity!=="warning"),issues:this.issues}}add(t,r,n,s){this.issues.push(K({code:t,path:r,message:n},s?{nodeType:s}:{}))}checkProperties(t,r,n,s=[],i){const o=new Set(n);for(const a of Object.keys(t))o.has(a)||this.add("UNKNOWN_PROPERTY",L(r,a),`Property "${a}" is not allowed.`,i);for(const a of s)a in t||this.add("MISSING_PROPERTY",L(r,a),`Required property "${a}" is missing.`,i)}requireArray(t,r,n){return Array.isArray(t)?t:(this.add("INVALID_TYPE",r,"Expected an array.",n),null)}optionalArray(t,r,n){return t===void 0?[]:this.requireArray(t,r,n)}requireNonEmptyArray(t,r,n){const s=this.requireArray(t,r,n);return s&&s.length===0&&this.add("INVALID_CONTENT",r,`Node "${n}" must contain at least one child.`,n),s}requireRecord(t,r,n){return ft(t)?t:(this.add("INVALID_TYPE",r,"Expected an object.",n),null)}optionalRecord(t,r,n){return t===void 0?{}:this.requireRecord(t,r,n)}requireString(t,r,n,s={}){return typeof t!="string"?(this.add("INVALID_TYPE",r,"Expected a string.",n),!1):!s.allowEmpty&&t.length===0?(this.add("INVALID_VALUE",r,"The string must not be empty.",n),!1):s.maxLength!==void 0&&t.length>s.maxLength?(this.add("INVALID_VALUE",r,`The string must contain at most ${s.maxLength} characters.`,n),!1):!0}optionalString(t,r,n,s={}){t!==void 0&&this.requireString(t,r,n,s)}requireInteger(t,r,n,s,i){if(!Number.isInteger(t))return this.add("INVALID_TYPE",r,"Expected an integer.",n),!1;const o=t;return s!==void 0&&o<s?(this.add("INVALID_VALUE",r,`Value must be at least ${s}.`,n),!1):i!==void 0&&o>i?(this.add("INVALID_VALUE",r,`Value must be at most ${i}.`,n),!1):!0}validateBlock(t,r,n=!1){if(!ft(t)){this.add("INVALID_TYPE",r,"A block node must be an object.");return}const s=t.type;if(typeof s!="string"){this.add("MISSING_PROPERTY",L(r,"type"),"A block node requires a type.");return}if(s==="resourceQuestion"){n||this.add("INVALID_CONTENT",r,"resourceQuestion is only allowed directly inside doc.",s),this.validateResourceQuestion(t,r);return}if(!Ql.has(s)){this.add("UNKNOWN_NODE",L(r,"type"),`Unknown block node "${s}".`,s);return}switch(s){case"paragraph":this.validateParagraph(t,r);break;case"heading":this.validateHeading(t,r);break;case"blockquote":this.validateBlockquote(t,r);break;case"bulletList":this.validateBulletList(t,r);break;case"orderedList":this.validateOrderedList(t,r);break;case"codeBlock":this.validateCodeBlock(t,r);break;case"horizontalRule":this.checkProperties(t,r,["type"],["type"],s);break;case"image":this.validateImage(t,r);break;case"articleButton":this.validateArticleButton(t,r);break;case"table":this.validateTable(t,r);break}}validateParagraph(t,r){const n="paragraph";this.checkProperties(t,r,["type","attrs","content"],["type"],n),this.validateTextAlignAttrs(t.attrs,L(r,"attrs"),n,!1),this.validateInlineContent(t.content,L(r,"content"),n)}validateHeading(t,r){const n="heading";this.checkProperties(t,r,["type","attrs","content"],["type","attrs"],n);const s=this.requireRecord(t.attrs,L(r,"attrs"),n);s&&(this.checkProperties(s,L(r,"attrs"),["level","textAlign","anchorId"],["level"],n),this.validateAnchor(s,L(r,"attrs")),this.requireInteger(s.level,M(r,"attrs","level"),n,1,6),this.validateTextAlign(s.textAlign,M(r,"attrs","textAlign"),n)),this.validateInlineContent(t.content,L(r,"content"),n)}validateTextAlignAttrs(t,r,n,s){const i=s?this.requireRecord(t,r,n):this.optionalRecord(t,r,n);i&&(this.checkProperties(i,r,["textAlign","anchorId","fontSize"],[],n),this.validateAnchor(i,r),i.fontSize!==void 0&&this.requireInteger(i.fontSize,L(r,"fontSize"),n,8,96),this.validateTextAlign(i.textAlign,L(r,"textAlign"),n))}validateTextAlign(t,r,n){t!==void 0&&(typeof t!="string"?this.add("INVALID_TYPE",r,"Text alignment must be a string.",n):Jl.has(t)||this.add("INVALID_VALUE",r,`Unsupported text alignment "${t}".`,n))}validateInlineContent(t,r,n){const s=this.optionalArray(t,r,n);s==null||s.forEach((i,o)=>this.validateText(i,L(r,o),!0))}validateText(t,r,n){if(!ft(t)){this.add("INVALID_TYPE",r,"A text node must be an object.","text");return}const s=n?["type","text","marks"]:["type","text"];if(this.checkProperties(t,r,s,["type","text"],"text"),t.type!=="text"&&this.add("INVALID_CONTENT",L(r,"type"),"Expected a text node.","text"),this.requireString(t.text,L(r,"text"),"text"),n&&t.marks!==void 0){const i=this.requireArray(t.marks,L(r,"marks"),"text");i==null||i.forEach((o,a)=>this.validateMark(o,M(r,"marks",a)))}}validateMark(t,r){var i;if(!ft(t)){this.add("INVALID_TYPE",r,"A mark must be an object.");return}if(typeof t.type!="string"){this.add("MISSING_PROPERTY",L(r,"type"),"A mark requires a type.");return}if(Wl.has(t.type)){this.checkProperties(t,r,["type"],["type"],t.type);return}if(t.type==="textStyle"||t.type==="highlight"){this.checkProperties(t,r,["type","attrs"],["type","attrs"],t.type);const o=this.requireRecord(t.attrs,L(r,"attrs"),t.type);o&&(this.checkProperties(o,L(r,"attrs"),["color"],["color"],t.type),(typeof o.color!="string"||!/^#[0-9a-fA-F]{6}$/.test(o.color))&&this.add("INVALID_VALUE",M(r,"attrs","color"),"Color must be a six-digit hex value.",t.type));return}if(t.type!=="link"){this.add("UNKNOWN_MARK",L(r,"type"),`Unknown mark "${t.type}".`,t.type);return}this.checkProperties(t,r,["type","attrs"],["type","attrs"],"link");const n=this.requireRecord(t.attrs,L(r,"attrs"),"link");if(!n)return;this.checkProperties(n,L(r,"attrs"),["type","href","id","title","target"],[],"link"),n.type!==void 0&&n.type!=="href"&&n.type!=="custom"&&this.add("INVALID_VALUE",M(r,"attrs","type"),'Link type must be "href" or "custom".',"link");const s=(i=n.type)!=null?i:"href";if(s==="custom"){for(const o of["id","title"])o in n?this.requireString(n[o],M(r,"attrs",o),"link"):this.add("MISSING_PROPERTY",M(r,"attrs",o),`Required property "${o}" is missing for a custom link.`,"link");n.href!==void 0&&this.add("INVALID_VALUE",M(r,"attrs","href"),"A custom link must not contain href.","link")}else if(s==="href"){"href"in n?this.requireString(n.href,M(r,"attrs","href"),"link"):this.add("MISSING_PROPERTY",M(r,"attrs","href"),'Required property "href" is missing for an href link.',"link");for(const o of["id","title"])n[o]!==void 0&&this.add("INVALID_VALUE",M(r,"attrs",o),`An href link must not contain ${o}.`,"link")}n.target!==void 0&&n.target!=="_blank"&&n.target!=="_self"&&this.add("INVALID_VALUE",M(r,"attrs","target"),'Link target must be "_blank" or "_self".',"link")}validateBlockquote(t,r){const n="blockquote";this.checkProperties(t,r,["type","content"],["type","content"],n);const s=this.requireNonEmptyArray(t.content,L(r,"content"),n);s==null||s.forEach((i,o)=>this.validateBlock(i,M(r,"content",o)))}validateBulletList(t,r){const n="bulletList";this.checkProperties(t,r,["type","content"],["type","content"],n);const s=this.requireNonEmptyArray(t.content,L(r,"content"),n);s==null||s.forEach((i,o)=>this.validateListItem(i,M(r,"content",o)))}validateOrderedList(t,r){const n="orderedList";this.checkProperties(t,r,["type","attrs","content"],["type","content"],n);const s=this.optionalRecord(t.attrs,L(r,"attrs"),n);s&&(this.checkProperties(s,L(r,"attrs"),["start"],[],n),s.start!==void 0&&this.requireInteger(s.start,M(r,"attrs","start"),n,1));const i=this.requireNonEmptyArray(t.content,L(r,"content"),n);i==null||i.forEach((o,a)=>this.validateListItem(o,M(r,"content",a)))}validateListItem(t,r){const n="listItem",s=this.requireRecord(t,r,n);if(!s)return;this.checkProperties(s,r,["type","content"],["type","content"],n),s.type!==n&&this.add("INVALID_CONTENT",L(r,"type"),"Expected a listItem node.",n);const i=this.requireNonEmptyArray(s.content,L(r,"content"),n);i==null||i.forEach((o,a)=>this.validateBlock(o,M(r,"content",a)))}validateCodeBlock(t,r){const n="codeBlock";this.checkProperties(t,r,["type","attrs","content"],["type"],n);const s=this.optionalRecord(t.attrs,L(r,"attrs"),n);s&&(this.checkProperties(s,L(r,"attrs"),["language"],[],n),this.optionalString(s.language,M(r,"attrs","language"),n,{maxLength:32}));const i=this.optionalArray(t.content,L(r,"content"),n);i&&(i.length>1&&this.add("INVALID_CONTENT",L(r,"content"),"A codeBlock may contain at most one text node.",n),i.forEach((o,a)=>this.validateText(o,M(r,"content",a),!1)))}validateImage(t,r){const n="image";this.checkProperties(t,r,["type","attrs"],["type","attrs"],n);const s=this.requireRecord(t.attrs,L(r,"attrs"),n);s&&(this.checkProperties(s,L(r,"attrs"),["src","alt","title","width","height","imageAlign","imageLayout"],["src"],n),this.requireString(s.src,M(r,"attrs","src"),n),s.imageLayout!==void 0&&s.imageLayout!=="two-column"&&this.add("INVALID_VALUE",M(r,"attrs","imageLayout"),'Image layout must be "two-column".',n),this.optionalString(s.alt,M(r,"attrs","alt"),n,{allowEmpty:!0}),this.optionalString(s.title,M(r,"attrs","title"),n,{allowEmpty:!0}),s.width!==void 0&&this.requireInteger(s.width,M(r,"attrs","width"),n,1,1e4),s.height!==void 0&&this.requireInteger(s.height,M(r,"attrs","height"),n,1,1e4),s.imageAlign!==void 0&&(typeof s.imageAlign!="string"?this.add("INVALID_TYPE",M(r,"attrs","imageAlign"),"Image alignment must be a string.",n):Yl.has(s.imageAlign)||this.add("INVALID_VALUE",M(r,"attrs","imageAlign"),`Unsupported image alignment "${s.imageAlign}".`,n)))}nonBlank(t,r){return this.requireString(t,r)?/\S/.test(t)?!0:(this.add("INVALID_VALUE",r,"The string must contain a non-whitespace character."),!1):!1}identity(t,r,n){var i;if(!this.nonBlank(t,n))return;const s=(i=this.identities.get(r))!=null?i:new Set;s.has(t)&&this.add("DUPLICATE_IDENTITY",n,`Duplicate ${r}: "${t}".`),s.add(t),this.identities.set(r,s)}validateAnchor(t,r){"anchorId"in t&&this.identity(t.anchorId,"anchorId",L(r,"anchorId"))}validateResourceQuestion(t,r){const n="resourceQuestion";this.checkProperties(t,r,["type","attrs"],["type","attrs"],n);const s=L(r,"attrs"),i=this.requireRecord(t.attrs,s,n);if(!i)return;const o=["id","resourceId","title","description","options","hideFollowing","revealKey"];this.checkProperties(i,s,o,o,n),this.identity(i.id,"questionId",L(s,"id")),this.identity(i.revealKey,"revealKey",L(s,"revealKey"));for(const d of["resourceId","title","description"])this.requireString(i[d],L(s,d),n,{allowEmpty:!0});typeof i.hideFollowing!="boolean"&&this.add("INVALID_TYPE",L(s,"hideFollowing"),"Expected a boolean.",n);const a=this.requireArray(i.options,L(s,"options"),n);i.resourceId===""?(i.title!==""||i.description!==""||a&&a.length!==0)&&this.add("INVALID_VALUE",s,"An unconfigured question must have empty title, description and options.",n):(this.nonBlank(i.resourceId,L(s,"resourceId")),this.nonBlank(i.title,L(s,"title")),(a==null?void 0:a.length)===0&&this.add("INVALID_CONTENT",L(s,"options"),"A configured question requires an option.",n));const c=new Set;a==null||a.forEach((d,u)=>{const f=M(s,"options",u),_=this.requireRecord(d,f,n);_&&(this.checkProperties(_,f,["id","label","targetAnchorId"],["id","label"],n),this.nonBlank(_.id,L(f,"id"))&&(c.has(_.id)&&this.add("DUPLICATE_IDENTITY",L(f,"id"),`Duplicate optionId: "${_.id}".`,n),c.add(_.id)),this.nonBlank(_.label,L(f,"label")),"targetAnchorId"in _&&this.nonBlank(_.targetAnchorId,L(f,"targetAnchorId"))&&this.targets.push({id:_.targetAnchorId,path:L(f,"targetAnchorId")}))})}validateArticleButton(t,r){const n="articleButton";this.checkProperties(t,r,["type","attrs"],["type","attrs"],n);const s=this.requireRecord(t.attrs,L(r,"attrs"),n);s&&(this.checkProperties(s,L(r,"attrs"),["id","title","text","style","href"],["text","style"],n),s.style==="text"||s.style==="button"?"id"in s?this.requireString(s.id,M(r,"attrs","id"),n):this.add("MISSING_PROPERTY",M(r,"attrs","id"),'Required property "id" is missing for an articleButton with text or button style.',n):this.optionalString(s.id,M(r,"attrs","id"),n),this.optionalString(s.title,M(r,"attrs","title"),n),this.requireString(s.text,M(r,"attrs","text"),n),this.optionalString(s.href,M(r,"attrs","href"),n),s.style!=="text"&&s.style!=="button"&&s.style!=="link"&&this.add("INVALID_VALUE",M(r,"attrs","style"),'Article button style must be "text", "button", or "link".',n),s.href!==void 0&&s.style!=="link"&&this.add("INVALID_VALUE",M(r,"attrs","href"),'Article button href may only be present when style is "link".',n))}validateTable(t,r){const n="table";this.checkProperties(t,r,["type","content"],["type","content"],n);const s=this.requireNonEmptyArray(t.content,L(r,"content"),n);if(!s)return;let i=null;s.forEach((o,a)=>{const c=M(r,"content",a),d=this.validateTableRow(o,c);d!==null&&(i===null?i=d:d!==i&&this.add("TABLE_COLUMN_MISMATCH",L(c,"content"),`Expected ${i} table cells but received ${d}.`,"tableRow"))})}validateTableRow(t,r){var o;const n="tableRow",s=this.requireRecord(t,r,n);if(!s)return null;this.checkProperties(s,r,["type","content"],["type","content"],n),s.type!==n&&this.add("INVALID_CONTENT",L(r,"type"),"Expected a tableRow node.",n);const i=this.requireNonEmptyArray(s.content,L(r,"content"),n);return i==null||i.forEach((a,c)=>this.validateTableCell(a,M(r,"content",c))),(o=i==null?void 0:i.length)!=null?o:null}validateTableCell(t,r){const n="tableCell",s=this.requireRecord(t,r,n);if(!s)return;this.checkProperties(s,r,["type","content"],["type","content"],n),s.type!==n&&this.add("INVALID_CONTENT",L(r,"type"),"Expected a tableCell node.",n);const i=this.requireNonEmptyArray(s.content,L(r,"content"),n);i==null||i.forEach((o,a)=>this.validateBlock(o,M(r,"content",a)))}}function Xl(e){const t=Gl(e),r=new Zl().validate(e);return t.length&&r.valid?{valid:!1,issues:[...t,...r.issues]}:r}const Wn=Object.freeze({version:1,validate:Xl,render:$i}),Hs=new Map([[Wn.version,Wn]]),ed=Object.freeze([...Hs.keys()]),pn=1;function Gs(e){return Hs.get(e)}function Qs(e,t={}){var i;const r=(i=t.protocolVersion)!=null?i:pn,n=Gs(r);return n?n.validate(e):{valid:!1,issues:[{code:"UNSUPPORTED_PROTOCOL",path:"",message:`Article Content Protocol version ${r} is not supported.`}]}}function td(){return[]}function mr(e){return`${e.code}:${e.path}:${e.message}`}function rd(e){const t=e.slots();return e.props.customSlots.map(r=>{var i,o,a,c;const n={id:r.id,location:r.location},s=(c=(a=(o=(i=e.scopedSlots)[r.id])==null?void 0:o.call(i,n))!=null?a:t[r.id])!=null?c:[];return oe(K({},r),{content:s})})}function rr(e,t){Array.isArray(e)?e.forEach(r=>r(t)):e==null||e(t)}const nd=yr.extend({name:"ArticleContentRenderIssueReporter",props:{navigationSession:{type:Object,required:!0},issues:{type:Array,required:!0}},data(){return{reportedFingerprint:"",navigation:new ai}},watch:{issues:{immediate:!0,deep:!0,handler(e){const t=e.map(mr).join("|");if(t===this.reportedFingerprint)return;this.reportedFingerprint=t;const r=this.navigationSession;this.$nextTick(()=>{r===this.navigationSession&&!this.$isServer&&e.forEach(n=>this.$emit("render-error",n))})}}},mounted(){this.$emit("renderer-ready",this.navigation.api),this.navigation.schedule()},updated(){this.navigation.schedule()},beforeDestroy(){this.navigation.dispose()},render(e){var t,r;return this.navigation.update(this.navigationSession),(r=(t=this.$slots.default)==null?void 0:t[0])!=null?r:e()}});function Zn(e,t,r,n,s){var c;const i=(c=r[0])!=null?c:e(),o=t.listeners["render-error"],a=e(nd,{key:t.data.key,props:{issues:n,navigationSession:s},on:K(K({},o?{"render-error":o}:{}),t.listeners["renderer-ready"]?{"renderer-ready":t.listeners["renderer-ready"]}:{})},[i]);return r.length>1?[a,...r.slice(1)]:a}const sd={name:"ArticleContentRenderer",functional:!0,props:{document:{type:null,required:!0},protocolVersion:{type:Number,default:pn},strict:{type:Boolean,default:!1},customSlots:{type:Array,default:td},imageBaseUrl:{type:String,default:At},resolveArticleButtonLink:{type:Function,default:void 0},resolveCustomLink:{type:Function,default:void 0},revealedKeys:{type:Array,default:()=>[]},articleKey:{type:[String,Number],default:void 0},scrollContainer:{type:null,default:void 0,validator:e=>typeof e=="function"||typeof e=="object"&&e!==null&&"nodeType"in e&&e.nodeType===1},scrollOffset:{type:Number,default:0},onAnchorNavigate:{type:Function,default:void 0}},render(e,t){const{props:r}=t,n=Qs(r.document,{protocolVersion:r.protocolVersion}),s=Gs(r.protocolVersion),i=[],o=new oi({document:n.valid?r.document:null,articleKey:r.articleKey,revealedKeys:[...r.revealedKeys],scrollContainer:r.scrollContainer,scrollOffset:r.scrollOffset,onAnchorNavigate:r.onAnchorNavigate,reportNavigationIssue:u=>rr(t.listeners["render-error"],u),emitSelect:u=>rr(t.listeners["option-select"],u)}),a=n.issues.some(u=>u.severity!=="warning"&&(u.code==="DUPLICATE_IDENTITY"||u.nodeType==="resourceQuestion"||/\/(anchorId|revealKey)(\/|$)/.test(u.path))),c=o.selections.size>0||r.document&&typeof r.document=="object"&&"content"in r.document&&Array.isArray(r.document.content)&&r.document.content.some(u=>u&&typeof u=="object"&&"type"in u&&u.type==="resourceQuestion");if(!s||a||(r.strict||c)&&!n.valid){const u=e("div",{class:"acp-render-error",attrs:{role:"alert","data-render-error":"true"}},"Invalid article content");return Zn(e,t,[u],n.issues,o)}const d=s.render(r.document,{createElement:e,customSlots:rd(t),imageBaseUrl:r.imageBaseUrl,resolveArticleButtonLink:r.resolveArticleButtonLink,resolveCustomLink:r.resolveCustomLink,emitArticleButtonClick:u=>rr(t.listeners["article-button-click"],u),reportIssue:u=>i.push(u),navigation:o});return Zn(e,t,d,[...n.issues,...i.filter((u,f,_)=>_.findIndex($=>mr($)===mr(u))===f)],o)}},id=yr.extend(sd);function od(e,t,r,n,s,i,o,a){var c=typeof e=="function"?e.options:e;return{exports:e,options:c}}var ad=od(id);const mn=ad.exports,cd=Object.freeze({fileFormat:"article-content-protocol",fileFormatVersion:1,mediaType:"application/vnd.article-content-protocol+json",id:"article-content-v1-with-extensions",version:1,name:"Article Content Protocol v1 + Extensions",status:"draft",rootNode:"doc",nodeTypes:Object.freeze(["doc","paragraph","heading","blockquote","bulletList","orderedList","listItem","codeBlock","horizontalRule","image","articleButton","table","tableRow","tableCell","text","resourceQuestion"]),markTypes:Object.freeze(["bold","italic","strike","underline","code","link","textStyle","highlight"]),extensions:Object.freeze(["text-formatting","paragraph-font-size","image-layout","resource-question","paragraph-anchor"])}),ld={install(e){e.component("ArticleContentRenderer",mn)}};exports.ARTICLE_CONTENT_PROTOCOL_V1=cd;exports.ArticleContentRenderer=mn;exports.ArticleContentRendererPlugin=ld;exports.CURRENT_PROTOCOL_VERSION=pn;exports.SUPPORTED_PROTOCOL_VERSIONS=ed;exports.default=mn;exports.getVisibleContent=ii;exports.validateArticleDocument=Qs;
8
+ deps: ${u}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(l){const[d,u]=i(l);o(l,d),a(l,u)}};function i({schema:l}){const d={},u={};for(const f in l){if(f==="__proto__")continue;const b=Array.isArray(l[f])?d:u;b[f]=l[f]}return[d,u]}function o(l,d=l.schema){const{gen:u,data:f,it:b}=l;if(Object.keys(d).length===0)return;const w=u.let("missing");for(const _ in d){const v=d[_];if(v.length===0)continue;const m=(0,n.propertyInData)(u,f,_,b.opts.ownProperties);l.setParams({property:_,depsCount:v.length,deps:v.join(", ")}),b.allErrors?u.if(m,()=>{for(const p of v)(0,n.checkReportMissingProp)(l,p)}):(u.if((0,t._)`${m} && (${(0,n.checkMissingProp)(l,v,w)})`),(0,n.reportMissingProp)(l,w),u.else())}}e.validatePropertyDeps=o;function a(l,d=l.schema){const{gen:u,data:f,keyword:b,it:w}=l,_=u.name("valid");for(const v in d)(0,r.alwaysValidSchema)(w,d[v])||(u.if((0,n.propertyInData)(u,f,v,w.opts.ownProperties),()=>{const m=l.subschema({keyword:b,schemaProp:v},_);l.mergeValidEvaluated(m,_)},()=>u.var(_,!0)),l.ok(_))}e.validateSchemaDeps=a,e.default=s})($i);var pn={};Object.defineProperty(pn,"__esModule",{value:!0});const _i=M,Xl=I,ed={message:"property name must be valid",params:({params:e})=>(0,_i._)`{propertyName: ${e.propertyName}}`},td={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:ed,code(e){const{gen:t,schema:r,data:n,it:s}=e;if((0,Xl.alwaysValidSchema)(s,r))return;const i=t.name("valid");t.forIn("key",n,o=>{e.setParams({propertyName:o}),e.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},i),t.if((0,_i.not)(i),()=>{e.error(!0),s.allErrors||t.break()})}),e.ok(i)}};pn.default=td;var zt={};Object.defineProperty(zt,"__esModule",{value:!0});const bt=q,de=M,rd=ge,wt=I,nd={message:"must NOT have additional properties",params:({params:e})=>(0,de._)`{additionalProperty: ${e.additionalProperty}}`},sd={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:nd,code(e){const{gen:t,schema:r,parentSchema:n,data:s,errsCount:i,it:o}=e;if(!i)throw new Error("ajv implementation error");const{allErrors:a,opts:l}=o;if(o.props=!0,l.removeAdditional!=="all"&&(0,wt.alwaysValidSchema)(o,r))return;const d=(0,bt.allSchemaProperties)(n.properties),u=(0,bt.allSchemaProperties)(n.patternProperties);f(),e.ok((0,de._)`${i} === ${rd.default.errors}`);function f(){t.forIn("key",s,m=>{!d.length&&!u.length?_(m):t.if(b(m),()=>_(m))})}function b(m){let p;if(d.length>8){const g=(0,wt.schemaRefOrVal)(o,n.properties,"properties");p=(0,bt.isOwnProperty)(t,g,m)}else d.length?p=(0,de.or)(...d.map(g=>(0,de._)`${m} === ${g}`)):p=de.nil;return u.length&&(p=(0,de.or)(p,...u.map(g=>(0,de._)`${(0,bt.usePattern)(e,g)}.test(${m})`))),(0,de.not)(p)}function w(m){t.code((0,de._)`delete ${s}[${m}]`)}function _(m){if(l.removeAdditional==="all"||l.removeAdditional&&r===!1){w(m);return}if(r===!1){e.setParams({additionalProperty:m}),e.error(),a||t.break();return}if(typeof r=="object"&&!(0,wt.alwaysValidSchema)(o,r)){const p=t.name("valid");l.removeAdditional==="failing"?(v(m,p,!1),t.if((0,de.not)(p),()=>{e.reset(),w(m)})):(v(m,p),a||t.if((0,de.not)(p),()=>t.break()))}}function v(m,p,g){const S={keyword:"additionalProperties",dataProp:m,dataPropType:wt.Type.Str};g===!1&&Object.assign(S,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(S,p)}}};zt.default=sd;var mn={};Object.defineProperty(mn,"__esModule",{value:!0});const id=fe,Xn=q,ur=I,es=zt,od={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:n,data:s,it:i}=e;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&es.default.code(new id.KeywordCxt(i,es.default,"additionalProperties"));const o=(0,Xn.allSchemaProperties)(r);for(const f of o)i.definedProperties.add(f);i.opts.unevaluated&&o.length&&i.props!==!0&&(i.props=ur.mergeEvaluated.props(t,(0,ur.toHash)(o),i.props));const a=o.filter(f=>!(0,ur.alwaysValidSchema)(i,r[f]));if(a.length===0)return;const l=t.name("valid");for(const f of a)d(f)?u(f):(t.if((0,Xn.propertyInData)(t,s,f,i.opts.ownProperties)),u(f),i.allErrors||t.else().var(l,!0),t.endIf()),e.it.definedProperties.add(f),e.ok(l);function d(f){return i.opts.useDefaults&&!i.compositeRule&&r[f].default!==void 0}function u(f){e.subschema({keyword:"properties",schemaProp:f,dataProp:f},l)}}};mn.default=od;var yn={};Object.defineProperty(yn,"__esModule",{value:!0});const ts=q,Et=M,rs=I,ns=I,ad={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:n,parentSchema:s,it:i}=e,{opts:o}=i,a=(0,ts.allSchemaProperties)(r),l=a.filter(v=>(0,rs.alwaysValidSchema)(i,r[v]));if(a.length===0||l.length===a.length&&(!i.opts.unevaluated||i.props===!0))return;const d=o.strictSchema&&!o.allowMatchingProperties&&s.properties,u=t.name("valid");i.props!==!0&&!(i.props instanceof Et.Name)&&(i.props=(0,ns.evaluatedPropsToName)(t,i.props));const{props:f}=i;b();function b(){for(const v of a)d&&w(v),i.allErrors?_(v):(t.var(u,!0),_(v),t.if(u))}function w(v){for(const m in d)new RegExp(v).test(m)&&(0,rs.checkStrictMode)(i,`property ${m} matches pattern ${v} (use allowMatchingProperties)`)}function _(v){t.forIn("key",n,m=>{t.if((0,Et._)`${(0,ts.usePattern)(e,v)}.test(${m})`,()=>{const p=l.includes(v);p||e.subschema({keyword:"patternProperties",schemaProp:v,dataProp:m,dataPropType:ns.Type.Str},u),i.opts.unevaluated&&f!==!0?t.assign((0,Et._)`${f}[${m}]`,!0):!p&&!i.allErrors&&t.if((0,Et.not)(u),()=>t.break())})})}}};yn.default=ad;var gn={};Object.defineProperty(gn,"__esModule",{value:!0});const cd=I,ld={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:n}=e;if((0,cd.alwaysValidSchema)(n,r)){e.fail();return}const s=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),e.failResult(s,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};gn.default=ld;var $n={};Object.defineProperty($n,"__esModule",{value:!0});const dd=q,ud={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:dd.validateUnion,error:{message:"must match a schema in anyOf"}};$n.default=ud;var _n={};Object.defineProperty(_n,"__esModule",{value:!0});const At=M,fd=I,hd={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,At._)`{passingSchemas: ${e.passing}}`},pd={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:hd,code(e){const{gen:t,schema:r,parentSchema:n,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;const i=r,o=t.let("valid",!1),a=t.let("passing",null),l=t.name("_valid");e.setParams({passing:a}),t.block(d),e.result(o,()=>e.reset(),()=>e.error(!0));function d(){i.forEach((u,f)=>{let b;(0,fd.alwaysValidSchema)(s,u)?t.var(l,!0):b=e.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},l),f>0&&t.if((0,At._)`${l} && ${o}`).assign(o,!1).assign(a,(0,At._)`[${a}, ${f}]`).else(),t.if(l,()=>{t.assign(o,!0),t.assign(a,f),b&&e.mergeEvaluated(b,At.Name)})})}}};_n.default=pd;var vn={};Object.defineProperty(vn,"__esModule",{value:!0});const md=I,yd={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const s=t.name("valid");r.forEach((i,o)=>{if((0,md.alwaysValidSchema)(n,i))return;const a=e.subschema({keyword:"allOf",schemaProp:o},s);e.ok(s),e.mergeEvaluated(a)})}};vn.default=yd;var bn={};Object.defineProperty(bn,"__esModule",{value:!0});const qt=M,vi=I,gd={message:({params:e})=>(0,qt.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,qt._)`{failingKeyword: ${e.ifClause}}`},$d={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:gd,code(e){const{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,vi.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const s=ss(n,"then"),i=ss(n,"else");if(!s&&!i)return;const o=t.let("valid",!0),a=t.name("_valid");if(l(),e.reset(),s&&i){const u=t.let("ifClause");e.setParams({ifClause:u}),t.if(a,d("then",u),d("else",u))}else s?t.if(a,d("then")):t.if((0,qt.not)(a),d("else"));e.pass(o,()=>e.error(!0));function l(){const u=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(u)}function d(u,f){return()=>{const b=e.subschema({keyword:u},a);t.assign(o,a),e.mergeValidEvaluated(b,o),f?t.assign(f,(0,qt._)`${u}`):e.setParams({ifClause:u})}}}};function ss(e,t){const r=e.schema[t];return r!==void 0&&!(0,vi.alwaysValidSchema)(e,r)}bn.default=$d;var wn={};Object.defineProperty(wn,"__esModule",{value:!0});const _d=I,vd={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,_d.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};wn.default=vd;Object.defineProperty(dn,"__esModule",{value:!0});const bd=We,wd=un,Ed=Ze,Sd=fn,Pd=hn,kd=$i,Id=pn,Nd=zt,Ad=mn,Od=yn,Rd=gn,Td=$n,jd=_n,Cd=vn,Ld=bn,Dd=wn;function qd(e=!1){const t=[Rd.default,Td.default,jd.default,Cd.default,Ld.default,Dd.default,Id.default,Nd.default,kd.default,Ad.default,Od.default];return e?t.push(wd.default,Sd.default):t.push(bd.default,Ed.default),t.push(Pd.default),t}dn.default=qd;var En={},Sn={};Object.defineProperty(Sn,"__esModule",{value:!0});const H=M,Md={message:({schemaCode:e})=>(0,H.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,H._)`{format: ${e}}`},Vd={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Md,code(e,t){const{gen:r,data:n,$data:s,schema:i,schemaCode:o,it:a}=e,{opts:l,errSchemaPath:d,schemaEnv:u,self:f}=a;if(!l.validateFormats)return;s?b():w();function b(){const _=r.scopeValue("formats",{ref:f.formats,code:l.code.formats}),v=r.const("fDef",(0,H._)`${_}[${o}]`),m=r.let("fType"),p=r.let("format");r.if((0,H._)`typeof ${v} == "object" && !(${v} instanceof RegExp)`,()=>r.assign(m,(0,H._)`${v}.type || "string"`).assign(p,(0,H._)`${v}.validate`),()=>r.assign(m,(0,H._)`"string"`).assign(p,v)),e.fail$data((0,H.or)(g(),S()));function g(){return l.strictSchema===!1?H.nil:(0,H._)`${o} && !${p}`}function S(){const A=u.$async?(0,H._)`(${v}.async ? await ${p}(${n}) : ${p}(${n}))`:(0,H._)`${p}(${n})`,O=(0,H._)`(typeof ${p} == "function" ? ${A} : ${p}.test(${n}))`;return(0,H._)`${p} && ${p} !== true && ${m} === ${t} && !${O}`}}function w(){const _=f.formats[i];if(!_){g();return}if(_===!0)return;const[v,m,p]=S(_);v===t&&e.pass(A());function g(){if(l.strictSchema===!1){f.logger.warn(O());return}throw new Error(O());function O(){return`unknown format "${i}" ignored in schema at path "${d}"`}}function S(O){const B=O instanceof RegExp?(0,H.regexpCode)(O):l.code.formats?(0,H._)`${l.code.formats}${(0,H.getProperty)(i)}`:void 0,Q=r.scopeValue("formats",{key:i,ref:O,code:B});return typeof O=="object"&&!(O instanceof RegExp)?[O.type||"string",O.validate,(0,H._)`${Q}.validate`]:["string",O,Q]}function A(){if(typeof _=="object"&&!(_ instanceof RegExp)&&_.async){if(!u.$async)throw new Error("async format in sync schema");return(0,H._)`await ${p}(${n})`}return typeof m=="function"?(0,H._)`${p}(${n})`:(0,H._)`${p}.test(${n})`}}}};Sn.default=Vd;Object.defineProperty(En,"__esModule",{value:!0});const Fd=Sn,Ud=[Fd.default];En.default=Ud;var Qe={};Object.defineProperty(Qe,"__esModule",{value:!0});Qe.contentVocabulary=Qe.metadataVocabulary=void 0;Qe.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Qe.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(Qr,"__esModule",{value:!0});const zd=Jr,Kd=Wr,Bd=dn,xd=En,is=Qe,Hd=[zd.default,Kd.default,(0,Bd.default)(),xd.default,is.metadataVocabulary,is.contentVocabulary];Qr.default=Hd;var Pn={},Kt={};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.DiscrError=void 0;var os;(function(e){e.Tag="tag",e.Mapping="mapping"})(os||(Kt.DiscrError=os={}));Object.defineProperty(Pn,"__esModule",{value:!0});const Ke=M,Er=Kt,as=ae,Gd=Je,Qd=I,Jd={message:({params:{discrError:e,tagName:t}})=>e===Er.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Ke._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},Yd={keyword:"discriminator",type:"object",schemaType:"object",error:Jd,code(e){const{gen:t,data:r,schema:n,parentSchema:s,it:i}=e,{oneOf:o}=s;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");const a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");const l=t.let("valid",!1),d=t.const("tag",(0,Ke._)`${r}${(0,Ke.getProperty)(a)}`);t.if((0,Ke._)`typeof ${d} == "string"`,()=>u(),()=>e.error(!1,{discrError:Er.DiscrError.Tag,tag:d,tagName:a})),e.ok(l);function u(){const w=b();t.if(!1);for(const _ in w)t.elseIf((0,Ke._)`${d} === ${_}`),t.assign(l,f(w[_]));t.else(),e.error(!1,{discrError:Er.DiscrError.Mapping,tag:d,tagName:a}),t.endIf()}function f(w){const _=t.name("valid"),v=e.subschema({keyword:"oneOf",schemaProp:w},_);return e.mergeEvaluated(v,Ke.Name),_}function b(){var w;const _={},v=p(s);let m=!0;for(let A=0;A<o.length;A++){let O=o[A];if(O!=null&&O.$ref&&!(0,Qd.schemaHasRulesButRef)(O,i.self.RULES)){const Q=O.$ref;if(O=as.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,Q),O instanceof as.SchemaEnv&&(O=O.schema),O===void 0)throw new Gd.default(i.opts.uriResolver,i.baseId,Q)}const B=(w=O==null?void 0:O.properties)===null||w===void 0?void 0:w[a];if(typeof B!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);m=m&&(v||p(O)),g(B,A)}if(!m)throw new Error(`discriminator: "${a}" must be required`);return _;function p({required:A}){return Array.isArray(A)&&A.includes(a)}function g(A,O){if(A.const)S(A.const,O);else if(A.enum)for(const B of A.enum)S(B,O);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function S(A,O){if(typeof A!="string"||A in _)throw new Error(`discriminator: "${a}" values must be unique strings`);_[A]=O}}}};Pn.default=Yd;const Wd="http://json-schema.org/draft-07/schema#",Zd="http://json-schema.org/draft-07/schema#",Xd="Core schema meta-schema",eu={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},tu=["object","boolean"],ru={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},nu={$schema:Wd,$id:Zd,title:Xd,definitions:eu,type:tu,properties:ru,default:!0};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const r=ms,n=Qr,s=Pn,i=nu,o=["/properties"],a="http://json-schema.org/draft-07/schema";class l extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(_=>this.addVocabulary(_)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const _=this.opts.$data?this.$dataMetaSchema(i,o):i;this.addMetaSchema(_,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}t.Ajv=l,e.exports=t=l,e.exports.Ajv=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var d=fe;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return d.KeywordCxt}});var u=M;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var f=mt;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return f.default}});var b=Je;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return b.default}})})(mr,mr.exports);var su=mr.exports;const iu=Ji(su),cs=new iu({strict:!1,allErrors:!0}).compile(fs.documentSchema);function Sr(e){if(!ve(e))return e;const t=V({},e);return Array.isArray(t.content)&&(t.content=t.content.map(Sr)),Array.isArray(t.marks)&&(t.marks=t.marks.map(Sr)),t.type==="orderedList"&&(t.attrs===void 0||ve(t.attrs))&&(t.attrs=V({start:1},ve(t.attrs)?t.attrs:{})),t.type==="codeBlock"&&t.attrs===void 0&&(t.attrs={}),t.type==="link"&&ve(t.attrs)&&(t.attrs=V({target:"_blank"},t.attrs)),t}function ou(e){var t;return cs(Sr(e))?[]:((t=cs.errors)!=null?t:[]).map(r=>{var n;return{code:"INVALID_VALUE",path:r.instancePath,message:`Protocol schema: ${(n=r.message)!=null?n:r.keyword}.`}})}const au=new Set(["paragraph","heading","blockquote","bulletList","orderedList","codeBlock","horizontalRule","image","articleButton","table"]),cu=new Set(["left","center","right","justify"]),lu=new Set(["left","center","right"]),du=new Set(["bold","italic","strike","underline","code"]);function it(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function N(e,t){return`${e}/${String(t).replaceAll("~","~0").replaceAll("/","~1")}`}function D(e,...t){let r=e;for(const n of t)r=N(r,n);return r}class uu{constructor(){se(this,"issues",[]);se(this,"identities",new Map);se(this,"targets",[])}validate(t){var n;if(!it(t))return this.add("INVALID_ROOT","","The document must be an object."),this.result();this.checkProperties(t,"",["type","content"],["type","content"]),t.type!=="doc"&&this.add("INVALID_ROOT","/type",'The root node type must be "doc".');const r=this.requireArray(t.content,"/content");r==null||r.forEach((s,i)=>this.validateBlock(s,N("/content",i),!0));for(const s of this.targets)(n=this.identities.get("anchorId"))!=null&&n.has(s.id)||this.issues.push({code:"MISSING_ANCHOR",path:s.path,message:`Bound target "${s.id}" no longer exists.`,nodeType:"resourceQuestion",severity:"warning"});return this.result()}result(){return{valid:!this.issues.some(t=>t.severity!=="warning"),issues:this.issues}}add(t,r,n,s){this.issues.push(V({code:t,path:r,message:n},s?{nodeType:s}:{}))}checkProperties(t,r,n,s=[],i){const o=new Set(n);for(const a of Object.keys(t))o.has(a)||this.add("UNKNOWN_PROPERTY",N(r,a),`Property "${a}" is not allowed.`,i);for(const a of s)a in t||this.add("MISSING_PROPERTY",N(r,a),`Required property "${a}" is missing.`,i)}requireArray(t,r,n){return Array.isArray(t)?t:(this.add("INVALID_TYPE",r,"Expected an array.",n),null)}optionalArray(t,r,n){return t===void 0?[]:this.requireArray(t,r,n)}requireNonEmptyArray(t,r,n){const s=this.requireArray(t,r,n);return s&&s.length===0&&this.add("INVALID_CONTENT",r,`Node "${n}" must contain at least one child.`,n),s}requireRecord(t,r,n){return it(t)?t:(this.add("INVALID_TYPE",r,"Expected an object.",n),null)}optionalRecord(t,r,n){return t===void 0?{}:this.requireRecord(t,r,n)}requireString(t,r,n,s={}){return typeof t!="string"?(this.add("INVALID_TYPE",r,"Expected a string.",n),!1):!s.allowEmpty&&t.length===0?(this.add("INVALID_VALUE",r,"The string must not be empty.",n),!1):s.maxLength!==void 0&&t.length>s.maxLength?(this.add("INVALID_VALUE",r,`The string must contain at most ${s.maxLength} characters.`,n),!1):!0}optionalString(t,r,n,s={}){t!==void 0&&this.requireString(t,r,n,s)}requireInteger(t,r,n,s,i){if(!Number.isInteger(t))return this.add("INVALID_TYPE",r,"Expected an integer.",n),!1;const o=t;return s!==void 0&&o<s?(this.add("INVALID_VALUE",r,`Value must be at least ${s}.`,n),!1):i!==void 0&&o>i?(this.add("INVALID_VALUE",r,`Value must be at most ${i}.`,n),!1):!0}validateBlock(t,r,n=!1){if(!it(t)){this.add("INVALID_TYPE",r,"A block node must be an object.");return}const s=t.type;if(typeof s!="string"){this.add("MISSING_PROPERTY",N(r,"type"),"A block node requires a type.");return}if(s==="resourceQuestion"){n||this.add("INVALID_CONTENT",r,"resourceQuestion is only allowed directly inside doc.",s),this.validateResourceQuestion(t,r);return}if(!au.has(s)){this.add("UNKNOWN_NODE",N(r,"type"),`Unknown block node "${s}".`,s);return}switch(s){case"paragraph":this.validateParagraph(t,r);break;case"heading":this.validateHeading(t,r);break;case"blockquote":this.validateBlockquote(t,r);break;case"bulletList":this.validateBulletList(t,r);break;case"orderedList":this.validateOrderedList(t,r);break;case"codeBlock":this.validateCodeBlock(t,r);break;case"horizontalRule":this.checkProperties(t,r,["type"],["type"],s);break;case"image":this.validateImage(t,r);break;case"articleButton":this.validateArticleButton(t,r);break;case"table":this.validateTable(t,r);break}}validateParagraph(t,r){const n="paragraph";this.checkProperties(t,r,["type","attrs","content"],["type"],n),this.validateTextAlignAttrs(t.attrs,N(r,"attrs"),n,!1),this.validateInlineContent(t.content,N(r,"content"),n)}validateHeading(t,r){const n="heading";this.checkProperties(t,r,["type","attrs","content"],["type","attrs"],n);const s=this.requireRecord(t.attrs,N(r,"attrs"),n);s&&(this.checkProperties(s,N(r,"attrs"),["level","textAlign","anchorId"],["level"],n),this.validateAnchor(s,N(r,"attrs")),this.requireInteger(s.level,D(r,"attrs","level"),n,1,6),this.validateTextAlign(s.textAlign,D(r,"attrs","textAlign"),n)),this.validateInlineContent(t.content,N(r,"content"),n)}validateTextAlignAttrs(t,r,n,s){const i=s?this.requireRecord(t,r,n):this.optionalRecord(t,r,n);i&&(this.checkProperties(i,r,["textAlign","anchorId","fontSize"],[],n),this.validateAnchor(i,r),i.fontSize!==void 0&&this.requireInteger(i.fontSize,N(r,"fontSize"),n,8,96),this.validateTextAlign(i.textAlign,N(r,"textAlign"),n))}validateTextAlign(t,r,n){t!==void 0&&(typeof t!="string"?this.add("INVALID_TYPE",r,"Text alignment must be a string.",n):cu.has(t)||this.add("INVALID_VALUE",r,`Unsupported text alignment "${t}".`,n))}validateInlineContent(t,r,n){const s=this.optionalArray(t,r,n);s==null||s.forEach((i,o)=>this.validateText(i,N(r,o),!0))}validateText(t,r,n){if(!it(t)){this.add("INVALID_TYPE",r,"A text node must be an object.","text");return}const s=n?["type","text","marks"]:["type","text"];if(this.checkProperties(t,r,s,["type","text"],"text"),t.type!=="text"&&this.add("INVALID_CONTENT",N(r,"type"),"Expected a text node.","text"),this.requireString(t.text,N(r,"text"),"text"),n&&t.marks!==void 0){const i=this.requireArray(t.marks,N(r,"marks"),"text");i==null||i.forEach((o,a)=>this.validateMark(o,D(r,"marks",a)))}}validateMark(t,r){var i;if(!it(t)){this.add("INVALID_TYPE",r,"A mark must be an object.");return}if(typeof t.type!="string"){this.add("MISSING_PROPERTY",N(r,"type"),"A mark requires a type.");return}if(du.has(t.type)){this.checkProperties(t,r,["type"],["type"],t.type);return}if(t.type==="textStyle"||t.type==="highlight"){this.checkProperties(t,r,["type","attrs"],["type","attrs"],t.type);const o=this.requireRecord(t.attrs,N(r,"attrs"),t.type);o&&(this.checkProperties(o,N(r,"attrs"),["color"],["color"],t.type),(typeof o.color!="string"||!/^#[0-9a-fA-F]{6}$/.test(o.color))&&this.add("INVALID_VALUE",D(r,"attrs","color"),"Color must be a six-digit hex value.",t.type));return}if(t.type!=="link"){this.add("UNKNOWN_MARK",N(r,"type"),`Unknown mark "${t.type}".`,t.type);return}this.checkProperties(t,r,["type","attrs"],["type","attrs"],"link");const n=this.requireRecord(t.attrs,N(r,"attrs"),"link");if(!n)return;this.checkProperties(n,N(r,"attrs"),["type","href","id","title","target"],[],"link"),n.type!==void 0&&n.type!=="href"&&n.type!=="custom"&&this.add("INVALID_VALUE",D(r,"attrs","type"),'Link type must be "href" or "custom".',"link");const s=(i=n.type)!=null?i:"href";if(s==="custom"){for(const o of["id","title"])o in n?this.requireString(n[o],D(r,"attrs",o),"link"):this.add("MISSING_PROPERTY",D(r,"attrs",o),`Required property "${o}" is missing for a custom link.`,"link");n.href!==void 0&&this.add("INVALID_VALUE",D(r,"attrs","href"),"A custom link must not contain href.","link")}else if(s==="href"){"href"in n?this.requireString(n.href,D(r,"attrs","href"),"link"):this.add("MISSING_PROPERTY",D(r,"attrs","href"),'Required property "href" is missing for an href link.',"link");for(const o of["id","title"])n[o]!==void 0&&this.add("INVALID_VALUE",D(r,"attrs",o),`An href link must not contain ${o}.`,"link")}n.target!==void 0&&n.target!=="_blank"&&n.target!=="_self"&&this.add("INVALID_VALUE",D(r,"attrs","target"),'Link target must be "_blank" or "_self".',"link")}validateBlockquote(t,r){const n="blockquote";this.checkProperties(t,r,["type","content"],["type","content"],n);const s=this.requireNonEmptyArray(t.content,N(r,"content"),n);s==null||s.forEach((i,o)=>this.validateBlock(i,D(r,"content",o)))}validateBulletList(t,r){const n="bulletList";this.checkProperties(t,r,["type","content"],["type","content"],n);const s=this.requireNonEmptyArray(t.content,N(r,"content"),n);s==null||s.forEach((i,o)=>this.validateListItem(i,D(r,"content",o)))}validateOrderedList(t,r){const n="orderedList";this.checkProperties(t,r,["type","attrs","content"],["type","content"],n);const s=this.optionalRecord(t.attrs,N(r,"attrs"),n);s&&(this.checkProperties(s,N(r,"attrs"),["start"],[],n),s.start!==void 0&&this.requireInteger(s.start,D(r,"attrs","start"),n,1));const i=this.requireNonEmptyArray(t.content,N(r,"content"),n);i==null||i.forEach((o,a)=>this.validateListItem(o,D(r,"content",a)))}validateListItem(t,r){const n="listItem",s=this.requireRecord(t,r,n);if(!s)return;this.checkProperties(s,r,["type","content"],["type","content"],n),s.type!==n&&this.add("INVALID_CONTENT",N(r,"type"),"Expected a listItem node.",n);const i=this.requireNonEmptyArray(s.content,N(r,"content"),n);i==null||i.forEach((o,a)=>this.validateBlock(o,D(r,"content",a)))}validateCodeBlock(t,r){const n="codeBlock";this.checkProperties(t,r,["type","attrs","content"],["type"],n);const s=this.optionalRecord(t.attrs,N(r,"attrs"),n);s&&(this.checkProperties(s,N(r,"attrs"),["language"],[],n),this.optionalString(s.language,D(r,"attrs","language"),n,{maxLength:32}));const i=this.optionalArray(t.content,N(r,"content"),n);i&&(i.length>1&&this.add("INVALID_CONTENT",N(r,"content"),"A codeBlock may contain at most one text node.",n),i.forEach((o,a)=>this.validateText(o,D(r,"content",a),!1)))}validateImage(t,r){const n="image";this.checkProperties(t,r,["type","attrs"],["type","attrs"],n);const s=this.requireRecord(t.attrs,N(r,"attrs"),n);s&&(this.checkProperties(s,N(r,"attrs"),["src","alt","title","width","height","imageAlign","imageLayout"],["src"],n),this.requireString(s.src,D(r,"attrs","src"),n),s.imageLayout!==void 0&&s.imageLayout!=="two-column"&&this.add("INVALID_VALUE",D(r,"attrs","imageLayout"),'Image layout must be "two-column".',n),this.optionalString(s.alt,D(r,"attrs","alt"),n,{allowEmpty:!0}),this.optionalString(s.title,D(r,"attrs","title"),n,{allowEmpty:!0}),s.width!==void 0&&this.requireInteger(s.width,D(r,"attrs","width"),n,1,1e4),s.height!==void 0&&this.requireInteger(s.height,D(r,"attrs","height"),n,1,1e4),s.imageAlign!==void 0&&(typeof s.imageAlign!="string"?this.add("INVALID_TYPE",D(r,"attrs","imageAlign"),"Image alignment must be a string.",n):lu.has(s.imageAlign)||this.add("INVALID_VALUE",D(r,"attrs","imageAlign"),`Unsupported image alignment "${s.imageAlign}".`,n)))}nonBlank(t,r){return this.requireString(t,r)?/\S/.test(t)?!0:(this.add("INVALID_VALUE",r,"The string must contain a non-whitespace character."),!1):!1}identity(t,r,n){var i;if(!this.nonBlank(t,n))return;const s=(i=this.identities.get(r))!=null?i:new Set;s.has(t)&&this.add("DUPLICATE_IDENTITY",n,`Duplicate ${r}: "${t}".`),s.add(t),this.identities.set(r,s)}validateAnchor(t,r){"anchorId"in t&&this.identity(t.anchorId,"anchorId",N(r,"anchorId"))}validateResourceQuestion(t,r){const n="resourceQuestion";this.checkProperties(t,r,["type","attrs"],["type","attrs"],n);const s=N(r,"attrs"),i=this.requireRecord(t.attrs,s,n);if(!i)return;const o=["id","resourceId","title","description","options","hideFollowing","revealKey"];this.checkProperties(i,s,[...o,"image"],o,n),this.identity(i.id,"questionId",N(s,"id")),this.identity(i.revealKey,"revealKey",N(s,"revealKey"));for(const d of["resourceId","title","description"])this.requireString(i[d],N(s,d),n,{allowEmpty:!0});"image"in i&&this.validateResourceQuestionImage(i.image,N(s,"image")),typeof i.hideFollowing!="boolean"&&this.add("INVALID_TYPE",N(s,"hideFollowing"),"Expected a boolean.",n);const a=this.requireArray(i.options,N(s,"options"),n);i.resourceId===""?(i.title!==""||i.description!==""||a&&a.length!==0)&&this.add("INVALID_VALUE",s,"An unconfigured question must have empty title, description and options.",n):(this.nonBlank(i.resourceId,N(s,"resourceId")),this.nonBlank(i.title,N(s,"title")),(a==null?void 0:a.length)===0&&this.add("INVALID_CONTENT",N(s,"options"),"A configured question requires an option.",n));const l=new Set;a==null||a.forEach((d,u)=>{const f=D(s,"options",u),b=this.requireRecord(d,f,n);b&&(this.checkProperties(b,f,["id","label","targetAnchorId"],["id","label"],n),this.nonBlank(b.id,N(f,"id"))&&(l.has(b.id)&&this.add("DUPLICATE_IDENTITY",N(f,"id"),`Duplicate optionId: "${b.id}".`,n),l.add(b.id)),this.nonBlank(b.label,N(f,"label")),"targetAnchorId"in b&&this.nonBlank(b.targetAnchorId,N(f,"targetAnchorId"))&&this.targets.push({id:b.targetAnchorId,path:N(f,"targetAnchorId")}))})}validateResourceQuestionImage(t,r){const n="resourceQuestion",s=this.requireRecord(t,r,n);if(s){this.checkProperties(s,r,["src","alt","title","width","height"],["src"],n),this.requireString(s.src,N(r,"src"),n)&&!hs(s.src)&&this.add("UNSAFE_URL",N(r,"src"),"The question image URL is malformed or uses a disallowed protocol.",n);for(const i of["alt","title"])this.optionalString(s[i],N(r,i),n,{allowEmpty:!0});for(const i of["width","height"])i in s&&this.requireInteger(s[i],N(r,i),n,1,1e4)}}validateArticleButton(t,r){const n="articleButton";this.checkProperties(t,r,["type","attrs"],["type","attrs"],n);const s=this.requireRecord(t.attrs,N(r,"attrs"),n);s&&(this.checkProperties(s,N(r,"attrs"),["id","title","text","style","href"],["text","style"],n),s.style==="text"||s.style==="button"?"id"in s?this.requireString(s.id,D(r,"attrs","id"),n):this.add("MISSING_PROPERTY",D(r,"attrs","id"),'Required property "id" is missing for an articleButton with text or button style.',n):this.optionalString(s.id,D(r,"attrs","id"),n),this.optionalString(s.title,D(r,"attrs","title"),n),this.requireString(s.text,D(r,"attrs","text"),n),this.optionalString(s.href,D(r,"attrs","href"),n),s.style!=="text"&&s.style!=="button"&&s.style!=="link"&&this.add("INVALID_VALUE",D(r,"attrs","style"),'Article button style must be "text", "button", or "link".',n),s.href!==void 0&&s.style!=="link"&&this.add("INVALID_VALUE",D(r,"attrs","href"),'Article button href may only be present when style is "link".',n))}validateTable(t,r){const n="table";this.checkProperties(t,r,["type","content"],["type","content"],n);const s=this.requireNonEmptyArray(t.content,N(r,"content"),n);if(!s)return;let i=null;s.forEach((o,a)=>{const l=D(r,"content",a),d=this.validateTableRow(o,l);d!==null&&(i===null?i=d:d!==i&&this.add("TABLE_COLUMN_MISMATCH",N(l,"content"),`Expected ${i} table cells but received ${d}.`,"tableRow"))})}validateTableRow(t,r){var o;const n="tableRow",s=this.requireRecord(t,r,n);if(!s)return null;this.checkProperties(s,r,["type","content"],["type","content"],n),s.type!==n&&this.add("INVALID_CONTENT",N(r,"type"),"Expected a tableRow node.",n);const i=this.requireNonEmptyArray(s.content,N(r,"content"),n);return i==null||i.forEach((a,l)=>this.validateTableCell(a,D(r,"content",l))),(o=i==null?void 0:i.length)!=null?o:null}validateTableCell(t,r){const n="tableCell",s=this.requireRecord(t,r,n);if(!s)return;this.checkProperties(s,r,["type","content"],["type","content"],n),s.type!==n&&this.add("INVALID_CONTENT",N(r,"type"),"Expected a tableCell node.",n);const i=this.requireNonEmptyArray(s.content,N(r,"content"),n);i==null||i.forEach((o,a)=>this.validateBlock(o,D(r,"content",a)))}}function fu(e){const t=ou(e),r=new uu().validate(e);return t.length&&r.valid?{valid:!1,issues:[...t,...r.issues]}:r}const ls=Object.freeze({version:1,validate:fu,render:Qi}),bi=new Map([[ls.version,ls]]),hu=Object.freeze([...bi.keys()]),kn=1;function wi(e){return bi.get(e)}function Ei(e,t={}){var i;const r=(i=t.protocolVersion)!=null?i:kn,n=wi(r);return n?n.validate(e):{valid:!1,issues:[{code:"UNSUPPORTED_PROTOCOL",path:"",message:`Article Content Protocol version ${r} is not supported.`}]}}function pu(){return[]}function Pr(e){return`${e.code}:${e.path}:${e.message}`}function mu(e){const t=e.slots();return e.props.customSlots.map(r=>{var i,o,a,l;const n={id:r.id,location:r.location},s=(l=(a=(o=(i=e.scopedSlots)[r.id])==null?void 0:o.call(i,n))!=null?a:t[r.id])!=null?l:[];return ee(V({},r),{content:s})})}function fr(e,t){Array.isArray(e)?e.forEach(r=>r(t)):e==null||e(t)}const yu=kr.extend({name:"ArticleContentRenderIssueReporter",props:{navigationSession:{type:Object,required:!0},issues:{type:Array,required:!0}},data(){return{reportedFingerprint:"",navigation:new Li}},watch:{issues:{immediate:!0,deep:!0,handler(e){const t=e.map(Pr).join("|");if(t===this.reportedFingerprint)return;this.reportedFingerprint=t;const r=this.navigationSession;this.$nextTick(()=>{r===this.navigationSession&&!this.$isServer&&e.forEach(n=>this.$emit("render-error",n))})}}},mounted(){this.$emit("renderer-ready",this.navigation.api),this.navigation.schedule()},updated(){this.navigation.schedule()},beforeDestroy(){this.navigation.dispose()},render(e){var t,r;return this.navigation.update(this.navigationSession),(r=(t=this.$slots.default)==null?void 0:t[0])!=null?r:e()}});function ds(e,t,r,n,s){var l;const i=(l=r[0])!=null?l:e(),o=t.listeners["render-error"],a=e(yu,{key:t.data.key,props:{issues:n,navigationSession:s},on:V(V({},o?{"render-error":o}:{}),t.listeners["renderer-ready"]?{"renderer-ready":t.listeners["renderer-ready"]}:{})},[i]);return r.length>1?[a,...r.slice(1)]:a}const gu={name:"ArticleContentRenderer",functional:!0,props:{document:{type:null,required:!0},protocolVersion:{type:Number,default:kn},strict:{type:Boolean,default:!1},customSlots:{type:Array,default:pu},imageBaseUrl:{type:String,default:St},resolveArticleButtonLink:{type:Function,default:void 0},resolveCustomLink:{type:Function,default:void 0},revealedKeys:{type:Array,default:()=>[]},articleKey:{type:[String,Number],default:void 0},scrollContainer:{type:null,default:void 0,validator:e=>typeof e=="function"||typeof e=="object"&&e!==null&&"nodeType"in e&&e.nodeType===1},scrollOffset:{type:Number,default:0},onAnchorNavigate:{type:Function,default:void 0},resourceQuestionFooterText:{type:String,default:""}},render(e,t){const{props:r}=t,n=Ei(r.document,{protocolVersion:r.protocolVersion}),s=wi(r.protocolVersion),i=[],o=new Ci({document:n.valid?r.document:null,articleKey:r.articleKey,revealedKeys:[...r.revealedKeys],scrollContainer:r.scrollContainer,scrollOffset:r.scrollOffset,onAnchorNavigate:r.onAnchorNavigate,reportNavigationIssue:u=>fr(t.listeners["render-error"],u),emitSelect:u=>fr(t.listeners["option-select"],u)}),a=n.issues.some(u=>u.severity!=="warning"&&(u.code==="DUPLICATE_IDENTITY"||u.nodeType==="resourceQuestion"||/\/(anchorId|revealKey)(\/|$)/.test(u.path))),l=o.selections.size>0||r.document&&typeof r.document=="object"&&"content"in r.document&&Array.isArray(r.document.content)&&r.document.content.some(u=>u&&typeof u=="object"&&"type"in u&&u.type==="resourceQuestion");if(!s||a||(r.strict||l)&&!n.valid){const u=e("div",{class:"acp-render-error",attrs:{role:"alert","data-render-error":"true"}},"Invalid article content");return ds(e,t,[u],n.issues,o)}const d=s.render(r.document,{createElement:e,customSlots:mu(t),imageBaseUrl:r.imageBaseUrl,resourceQuestionFooterText:r.resourceQuestionFooterText,resolveArticleButtonLink:r.resolveArticleButtonLink,resolveCustomLink:r.resolveCustomLink,emitArticleButtonClick:u=>fr(t.listeners["article-button-click"],u),reportIssue:u=>i.push(u),navigation:o});return ds(e,t,d,[...n.issues,...i.filter((u,f,b)=>b.findIndex(w=>Pr(w)===Pr(u))===f)],o)}},$u=kr.extend(gu);function _u(e,t,r,n,s,i,o,a){var l=typeof e=="function"?e.options:e;return{exports:e,options:l}}var vu=_u($u);const In=vu.exports,bu=Object.freeze({fileFormat:"article-content-protocol",fileFormatVersion:1,mediaType:"application/vnd.article-content-protocol+json",id:"article-content-v1-with-extensions",version:1,name:"Article Content Protocol v1 + Extensions",status:"draft",rootNode:"doc",nodeTypes:Object.freeze(["doc","paragraph","heading","blockquote","bulletList","orderedList","listItem","codeBlock","horizontalRule","image","articleButton","table","tableRow","tableCell","text","resourceQuestion"]),markTypes:Object.freeze(["bold","italic","strike","underline","code","link","textStyle","highlight"]),extensions:Object.freeze(["text-formatting","paragraph-font-size","image-layout","resource-question","paragraph-anchor"])}),wu={install(e){e.component("ArticleContentRenderer",In)}};exports.ARTICLE_CONTENT_PROTOCOL_V1=bu;exports.ArticleContentRenderer=In;exports.ArticleContentRendererPlugin=wu;exports.CURRENT_PROTOCOL_VERSION=kn;exports.SUPPORTED_PROTOCOL_VERSIONS=hu;exports.default=In;exports.getVisibleContent=ji;exports.validateArticleDocument=Ei;