ai-client-sdk 3.0.8 → 3.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/ai-client-sdk.mjs +1493 -1482
- package/dist/ai-client-sdk.umd.js +27 -27
- package/dist/utils/agent.d.ts +1 -0
- package/package.json +2 -2
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
(function($e,an){typeof exports=="object"&&typeof module<"u"?an(exports):typeof define=="function"&&define.amd?define(["exports"],an):($e=typeof globalThis<"u"?globalThis:$e||self,an($e.AIClientSDK={}))})(this,(function($e){"use strict";function an(e){if(e)throw e}function Xn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Gi,La;function Uf(){if(La)return Gi;La=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):t.call(u)==="[object Array]"},s=function(u){if(!u||t.call(u)!=="[object Object]")return!1;var c=e.call(u,"constructor"),f=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!c&&!f)return!1;var h;for(h in u);return typeof h>"u"||e.call(u,h)},a=function(u,c){n&&c.name==="__proto__"?n(u,c.name,{enumerable:!0,configurable:!0,value:c.newValue,writable:!0}):u[c.name]=c.newValue},o=function(u,c){if(c==="__proto__")if(e.call(u,c)){if(r)return r(u,c).value}else return;return u[c]};return Gi=function l(){var u,c,f,h,d,g,T=arguments[0],y=1,m=arguments.length,p=!1;for(typeof T=="boolean"&&(p=T,T=arguments[1]||{},y=2),(T==null||typeof T!="object"&&typeof T!="function")&&(T={});y<m;++y)if(u=arguments[y],u!=null)for(c in u)f=o(T,c),h=o(u,c),T!==h&&(p&&h&&(s(h)||(d=i(h)))?(d?(d=!1,g=f&&i(f)?f:[]):g=f&&s(f)?f:{},a(T,{name:c,newValue:l(p,g,h)})):typeof h<"u"&&a(T,{name:c,newValue:h}));return T},Gi}var qf=Uf();const Ki=Xn(qf);function bk(){}function Zi(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Hf(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...i);function o(l,...u){const c=e[++s];let f=-1;if(l){a(l);return}for(;++f<i.length;)(u[f]===null||u[f]===void 0)&&(u[f]=i[f]);i=u,c?Bf(c,o)(...u):a(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Bf(e,t){let n;return r;function r(...a){const o=e.length>a.length;let l;o&&a.push(i);try{l=e.apply(this,a)}catch(u){const c=u;if(o&&n)throw c;return i(c)}o||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(a,...o){n||(n=!0,t(a,...o))}function s(a){i(null,a)}}function Pn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Fa(e.position):"start"in e||"end"in e?Fa(e):"line"in e||"column"in e?Ji(e):""}function Ji(e){return ja(e&&e.line)+":"+ja(e&&e.column)}function Fa(e){return Ji(e&&e.start)+"-"+Ji(e&&e.end)}function ja(e){return e&&typeof e=="number"?e:1}class Qe extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(a=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const o=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=Pn(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Qe.prototype.file="",Qe.prototype.name="",Qe.prototype.reason="",Qe.prototype.message="",Qe.prototype.stack="",Qe.prototype.column=void 0,Qe.prototype.line=void 0,Qe.prototype.ancestors=void 0,Qe.prototype.cause=void 0,Qe.prototype.fatal=void 0,Qe.prototype.place=void 0,Qe.prototype.ruleId=void 0,Qe.prototype.source=void 0;const vt={basename:Vf,dirname:Wf,extname:Yf,join:Gf,sep:"/"};function Vf(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');An(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function Wf(e){if(An(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Yf(e){An(e);let t=e.length,n=-1,r=0,i=-1,s=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),o===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Gf(...e){let t=-1,n;for(;++t<e.length;)An(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Kf(n)}function Kf(e){An(e);const t=e.codePointAt(0)===47;let n=Zf(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Zf(e,t){let n="",r=0,i=-1,s=0,a=-1,o,l;for(;++a<=e.length;){if(a<e.length)o=e.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||s===1))if(i!==a-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,s=0}else o===46&&s>-1?s++:s=-1}return n}function An(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Jf={cwd:Xf};function Xf(){return"/"}function Xi(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Qf(e){if(typeof e=="string")e=new URL(e);else if(!Xi(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return ed(e)}function ed(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Qi=["history","path","basename","stem","extname","dirname"];class td{constructor(t){let n;t?Xi(t)?n={path:t}:typeof t=="string"||nd(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Jf.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Qi.length;){const s=Qi[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)Qi.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?vt.basename(this.path):void 0}set basename(t){ts(t,"basename"),es(t,"basename"),this.path=vt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?vt.dirname(this.path):void 0}set dirname(t){za(this.basename,"dirname"),this.path=vt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?vt.extname(this.path):void 0}set extname(t){if(es(t,"extname"),za(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=vt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Xi(t)&&(t=Qf(t)),ts(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?vt.basename(this.path,this.extname):void 0}set stem(t){ts(t,"stem"),es(t,"stem"),this.path=vt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Qe(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function es(e,t){if(e&&e.includes(vt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+vt.sep+"`")}function ts(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function za(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function nd(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const rd=(function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),id={}.hasOwnProperty;class ns extends rd{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Hf()}copy(){const t=new ns;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Ki(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(ss("data",this.frozen),this.namespace[t]=n,this):id.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ss("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Qn(t),r=this.parser||this.Parser;return rs("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),rs("process",this.parser||this.Parser),is("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const o=Qn(t),l=r.parse(o);r.run(l,o,function(c,f,h){if(c||!f||!h)return u(c);const d=f,g=r.stringify(d,h);od(g)?h.value=g:h.result=g,u(c,h)});function u(c,f){c||!f?a(c):s?s(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),rs("processSync",this.parser||this.Parser),is("processSync",this.compiler||this.Compiler),this.process(t,i),qa("processSync","process",n),r;function i(s,a){n=!0,an(s),r=a}}run(t,n,r){Ua(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,o){const l=Qn(n);i.run(t,l,u);function u(c,f,h){const d=f||t;c?o(c):a?a(d):r(void 0,d,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),qa("runSync","run",r),i;function s(a,o){an(a),i=o,r=!0}}stringify(t,n){this.freeze();const r=Qn(n),i=this.compiler||this.Compiler;return is("stringify",i),Ua(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(ss("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[c,...f]=u;l(c,f)}else a(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function a(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(u.plugins),u.settings&&(i.settings=Ki(!0,i.settings,u.settings))}function o(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){const f=u[c];s(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,c){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===u){h=f;break}if(h===-1)r.push([u,...c]);else if(c.length>0){let[d,...g]=c;const T=r[h][1];Zi(T)&&Zi(d)&&(d=Ki(!0,T,d)),r[h]=[u,d,...g]}}}}const sd=new ns().freeze();function rs(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function is(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ss(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Ua(e){if(!Zi(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function qa(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Qn(e){return ad(e)?e:new td(e)}function ad(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function od(e){return typeof e=="string"||ld(e)}function ld(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ud={};function as(e,t){const n=ud,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Ha(e,r,i)}function Ha(e,t,n){if(cd(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Ba(e.children,t,n)}return Array.isArray(e)?Ba(e,t,n):""}function Ba(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Ha(e[i],t,n);return r.join("")}function cd(e){return!!(e&&typeof e=="object")}const Va=document.createElement("i");function os(e){const t="&"+e+";";Va.innerHTML=t;const n=Va.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function it(e,t,n,r){const i=e.length;let s=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);s<r.length;)a=r.slice(s,s+1e4),a.unshift(t,0),e.splice(...a),s+=1e4,t+=1e4}function ct(e,t){return e.length>0?(it(e,e.length,0,t),e):t}const Wa={}.hasOwnProperty;function Ya(e){const t={};let n=-1;for(;++n<e.length;)fd(t,e[n]);return t}function fd(e,t){let n;for(n in t){const i=(Wa.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let a;if(s)for(a in s){Wa.call(i,a)||(i[a]=[]);const o=s[a];dd(i[a],Array.isArray(o)?o:o?[o]:[])}}}function dd(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);it(e,0,0,r)}function Ga(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function mt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const He=jt(/[A-Za-z]/),ze=jt(/[\dA-Za-z]/),hd=jt(/[#-'*+\--9=?A-Z^-~]/);function er(e){return e!==null&&(e<32||e===127)}const ls=jt(/\d/),pd=jt(/[\dA-Fa-f]/),md=jt(/[!-/:-@[-`{-~]/);function ie(e){return e!==null&&e<-2}function we(e){return e!==null&&(e<0||e===32)}function de(e){return e===-2||e===-1||e===32}const tr=jt(new RegExp("\\p{P}|\\p{S}","u")),Wt=jt(/\s/);function jt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function on(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let a="";if(s===37&&ze(e.charCodeAt(n+1))&&ze(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const o=e.charCodeAt(n+1);s<56320&&o>56319&&o<57344?(a=String.fromCharCode(s,o),i=1):a="�"}else a=String.fromCharCode(s);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function pe(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(l){return de(l)?(e.enter(n),o(l)):t(l)}function o(l){return de(l)&&s++<i?(e.consume(l),o):(e.exit(n),t(l))}}const gd={tokenize:yd};function yd(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),pe(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),s(o)}function s(o){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(o)}function a(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return ie(o)?(e.consume(o),e.exit("chunkText"),s):(e.consume(o),a)}}const bd={tokenize:wd},Ka={tokenize:_d};function wd(e){const t=this,n=[];let r=0,i,s,a;return o;function o(b){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,l,u)(b)}return u(b)}function l(b){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&p();const S=t.events.length;let v=S,w;for(;v--;)if(t.events[v][0]==="exit"&&t.events[v][1].type==="chunkFlow"){w=t.events[v][1].end;break}m(r);let x=S;for(;x<t.events.length;)t.events[x][1].end={...w},x++;return it(t.events,v+1,0,t.events.slice(S)),t.events.length=x,u(b)}return o(b)}function u(b){if(r===n.length){if(!i)return h(b);if(i.currentConstruct&&i.currentConstruct.concrete)return g(b);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Ka,c,f)(b)}function c(b){return i&&p(),m(r),h(b)}function f(b){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,g(b)}function h(b){return t.containerState={},e.attempt(Ka,d,g)(b)}function d(b){return r++,n.push([t.currentConstruct,t.containerState]),h(b)}function g(b){if(b===null){i&&p(),m(0),e.consume(b);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),T(b)}function T(b){if(b===null){y(e.exit("chunkFlow"),!0),m(0),e.consume(b);return}return ie(b)?(e.consume(b),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(b),T)}function y(b,S){const v=t.sliceStream(b);if(S&&v.push(null),b.previous=s,s&&(s.next=b),s=b,i.defineSkip(b.start),i.write(v),t.parser.lazy[b.start.line]){let w=i.events.length;for(;w--;)if(i.events[w][1].start.offset<a&&(!i.events[w][1].end||i.events[w][1].end.offset>a))return;const x=t.events.length;let N=x,F,A;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){if(F){A=t.events[N][1].end;break}F=!0}for(m(r),w=x;w<t.events.length;)t.events[w][1].end={...A},w++;it(t.events,N+1,0,t.events.slice(x)),t.events.length=w}}function m(b){let S=n.length;for(;S-- >b;){const v=n[S];t.containerState=v[1],v[0].exit.call(t,e)}n.length=b}function p(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function _d(e,t,n){return pe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ln(e){if(e===null||we(e)||Wt(e))return 1;if(tr(e))return 2}function nr(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const us={name:"attention",resolveAll:vd,tokenize:Td};function vd(e,t){let n=-1,r,i,s,a,o,l,u,c;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},h={...e[n][1].start};Za(f,-l),Za(h,l),a={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[n][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=ct(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=ct(u,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",s,t]]),u=ct(u,nr(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=ct(u,[["exit",s,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=ct(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,it(e,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Td(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ln(r);let s;return a;function a(l){return s=l,e.enter("attentionSequence"),o(l)}function o(l){if(l===s)return e.consume(l),o;const u=e.exit("attentionSequence"),c=ln(l),f=!c||c===2&&i||n.includes(l),h=!i||i===2&&c||n.includes(r);return u._open=!!(s===42?f:f&&(i||!h)),u._close=!!(s===42?h:h&&(c||!f)),t(l)}}function Za(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const kd={name:"autolink",tokenize:Ed};function Ed(e,t,n){let r=0;return i;function i(d){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(d){return He(d)?(e.consume(d),a):d===64?n(d):u(d)}function a(d){return d===43||d===45||d===46||ze(d)?(r=1,o(d)):u(d)}function o(d){return d===58?(e.consume(d),r=0,l):(d===43||d===45||d===46||ze(d))&&r++<32?(e.consume(d),o):(r=0,u(d))}function l(d){return d===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):d===null||d===32||d===60||er(d)?n(d):(e.consume(d),l)}function u(d){return d===64?(e.consume(d),c):hd(d)?(e.consume(d),u):n(d)}function c(d){return ze(d)?f(d):n(d)}function f(d){return d===46?(e.consume(d),r=0,c):d===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):h(d)}function h(d){if((d===45||ze(d))&&r++<63){const g=d===45?h:f;return e.consume(d),g}return n(d)}}const Dn={partial:!0,tokenize:Sd};function Sd(e,t,n){return r;function r(s){return de(s)?pe(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||ie(s)?t(s):n(s)}}const Ja={continuation:{tokenize:Pd},exit:Ad,name:"blockQuote",tokenize:xd};function xd(e,t,n){const r=this;return i;function i(a){if(a===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),s}return n(a)}function s(a){return de(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function Pd(e,t,n){const r=this;return i;function i(a){return de(a)?pe(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return e.attempt(Ja,t,n)(a)}}function Ad(e){e.exit("blockQuote")}const Xa={name:"characterEscape",tokenize:Dd};function Dd(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return md(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const Qa={name:"characterReference",tokenize:$d};function $d(e,t,n){const r=this;let i=0,s,a;return o;function o(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),s=31,a=ze,c(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,a=pd,c):(e.enter("characterReferenceValue"),s=7,a=ls,c(f))}function c(f){if(f===59&&i){const h=e.exit("characterReferenceValue");return a===ze&&!os(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(f)&&i++<s?(e.consume(f),c):n(f)}}const eo={partial:!0,tokenize:Od},to={concrete:!0,name:"codeFenced",tokenize:Cd};function Cd(e,t,n){const r=this,i={partial:!0,tokenize:v};let s=0,a=0,o;return l;function l(w){return u(w)}function u(w){const x=r.events[r.events.length-1];return s=x&&x[1].type==="linePrefix"?x[2].sliceSerialize(x[1],!0).length:0,o=w,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(w)}function c(w){return w===o?(a++,e.consume(w),c):a<3?n(w):(e.exit("codeFencedFenceSequence"),de(w)?pe(e,f,"whitespace")(w):f(w))}function f(w){return w===null||ie(w)?(e.exit("codeFencedFence"),r.interrupt?t(w):e.check(eo,T,S)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(w))}function h(w){return w===null||ie(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(w)):de(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),pe(e,d,"whitespace")(w)):w===96&&w===o?n(w):(e.consume(w),h)}function d(w){return w===null||ie(w)?f(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===null||ie(w)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(w)):w===96&&w===o?n(w):(e.consume(w),g)}function T(w){return e.attempt(i,S,y)(w)}function y(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),m}function m(w){return s>0&&de(w)?pe(e,p,"linePrefix",s+1)(w):p(w)}function p(w){return w===null||ie(w)?e.check(eo,T,S)(w):(e.enter("codeFlowValue"),b(w))}function b(w){return w===null||ie(w)?(e.exit("codeFlowValue"),p(w)):(e.consume(w),b)}function S(w){return e.exit("codeFenced"),t(w)}function v(w,x,N){let F=0;return A;function A(j){return w.enter("lineEnding"),w.consume(j),w.exit("lineEnding"),O}function O(j){return w.enter("codeFencedFence"),de(j)?pe(w,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):U(j)}function U(j){return j===o?(w.enter("codeFencedFenceSequence"),K(j)):N(j)}function K(j){return j===o?(F++,w.consume(j),K):F>=a?(w.exit("codeFencedFenceSequence"),de(j)?pe(w,H,"whitespace")(j):H(j)):N(j)}function H(j){return j===null||ie(j)?(w.exit("codeFencedFence"),x(j)):N(j)}}}function Od(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const cs={name:"codeIndented",tokenize:Nd},Rd={partial:!0,tokenize:Md};function Nd(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),pe(e,s,"linePrefix",5)(u)}function s(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?l(u):ie(u)?e.attempt(Rd,a,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||ie(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function l(u){return e.exit("codeIndented"),t(u)}}function Md(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):ie(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):pe(e,s,"linePrefix",5)(a)}function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):ie(a)?i(a):n(a)}}const Id={name:"codeText",previous:Fd,resolve:Ld,tokenize:jd};function Ld(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Fd(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function jd(e,t,n){let r=0,i,s;return a;function a(f){return e.enter("codeText"),e.enter("codeTextSequence"),o(f)}function o(f){return f===96?(e.consume(f),r++,o):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(s=e.enter("codeTextSequence"),i=0,c(f)):ie(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||ie(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),u)}function c(f){return f===96?(e.consume(f),i++,c):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(s.type="codeTextData",u(f))}}class zd{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&$n(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),$n(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),$n(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);$n(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);$n(this.left,n.reverse())}}}function $n(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function no(e){const t={};let n=-1,r,i,s,a,o,l,u;const c=new zd(e);for(;++n<c.length;){for(;n in t;)n=t[n];if(r=c.get(n),n&&r[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Ud(c,n)),n=t[n],u=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(a=c.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...c.get(i)[1].start},o=c.slice(i,n),o.unshift(r),c.splice(i,n-i+1,o))}}return it(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function Ud(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,l=[],u={};let c,f,h=-1,d=n,g=0,T=0;const y=[T];for(;d;){for(;e.get(++i)[1]!==d;);s.push(i),d._tokenizer||(c=r.sliceStream(d),d.next||c.push(null),f&&a.defineSkip(d.start),d._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(c),d._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),f=d,d=d.next}for(d=n;++h<o.length;)o[h][0]==="exit"&&o[h-1][0]==="enter"&&o[h][1].type===o[h-1][1].type&&o[h][1].start.line!==o[h][1].end.line&&(T=h+1,y.push(T),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(a.events=[],d?(d._tokenizer=void 0,d.previous=void 0):y.pop(),h=y.length;h--;){const m=o.slice(y[h],y[h+1]),p=s.pop();l.push([p,p+m.length-1]),e.splice(p,2,m)}for(l.reverse(),h=-1;++h<l.length;)u[g+l[h][0]]=g+l[h][1],g+=l[h][1]-l[h][0]-1;return u}const qd={resolve:Bd,tokenize:Vd},Hd={partial:!0,tokenize:Wd};function Bd(e){return no(e),e}function Vd(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?s(o):ie(o)?e.check(Hd,a,s)(o):(e.consume(o),i)}function s(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function a(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Wd(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),pe(e,s,"linePrefix")}function s(a){if(a===null||ie(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function ro(e,t,n,r,i,s,a,o,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return f;function f(m){return m===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(m),e.exit(s),h):m===null||m===32||m===41||er(m)?n(m):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),T(m))}function h(m){return m===62?(e.enter(s),e.consume(m),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===62?(e.exit("chunkString"),e.exit(o),h(m)):m===null||m===60||ie(m)?n(m):(e.consume(m),m===92?g:d)}function g(m){return m===60||m===62||m===92?(e.consume(m),d):d(m)}function T(m){return!c&&(m===null||m===41||we(m))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(m)):c<u&&m===40?(e.consume(m),c++,T):m===41?(e.consume(m),c--,T):m===null||m===32||m===40||er(m)?n(m):(e.consume(m),m===92?y:T)}function y(m){return m===40||m===41||m===92?(e.consume(m),T):T(m)}}function io(e,t,n,r,i,s){const a=this;let o=0,l;return u;function u(d){return e.enter(r),e.enter(i),e.consume(d),e.exit(i),e.enter(s),c}function c(d){return o>999||d===null||d===91||d===93&&!l||d===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):d===93?(e.exit(s),e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):ie(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===null||d===91||d===93||ie(d)||o++>999?(e.exit("chunkString"),c(d)):(e.consume(d),l||(l=!de(d)),d===92?h:f)}function h(d){return d===91||d===92||d===93?(e.consume(d),o++,f):f(d)}}function so(e,t,n,r,i,s){let a;return o;function o(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),a=h===40?41:h,l):n(h)}function l(h){return h===a?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(s),u(h))}function u(h){return h===a?(e.exit(s),l(a)):h===null?n(h):ie(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),pe(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===a||h===null||ie(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:c)}function f(h){return h===a||h===92?(e.consume(h),c):c(h)}}function Cn(e,t){let n;return r;function r(i){return ie(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):de(i)?pe(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Yd={name:"definition",tokenize:Kd},Gd={partial:!0,tokenize:Zd};function Kd(e,t,n){const r=this;let i;return s;function s(d){return e.enter("definition"),a(d)}function a(d){return io.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function o(d){return i=mt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),l):n(d)}function l(d){return we(d)?Cn(e,u)(d):u(d)}function u(d){return ro(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return e.attempt(Gd,f,f)(d)}function f(d){return de(d)?pe(e,h,"whitespace")(d):h(d)}function h(d){return d===null||ie(d)?(e.exit("definition"),r.parser.defined.push(i),t(d)):n(d)}}function Zd(e,t,n){return r;function r(o){return we(o)?Cn(e,i)(o):n(o)}function i(o){return so(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return de(o)?pe(e,a,"whitespace")(o):a(o)}function a(o){return o===null||ie(o)?t(o):n(o)}}const Jd={name:"hardBreakEscape",tokenize:Xd};function Xd(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return ie(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const Qd={name:"headingAtx",resolve:eh,tokenize:th};function eh(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},it(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function th(e,t,n){let r=0;return i;function i(c){return e.enter("atxHeading"),s(c)}function s(c){return e.enter("atxHeadingSequence"),a(c)}function a(c){return c===35&&r++<6?(e.consume(c),a):c===null||we(c)?(e.exit("atxHeadingSequence"),o(c)):n(c)}function o(c){return c===35?(e.enter("atxHeadingSequence"),l(c)):c===null||ie(c)?(e.exit("atxHeading"),t(c)):de(c)?pe(e,o,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function l(c){return c===35?(e.consume(c),l):(e.exit("atxHeadingSequence"),o(c))}function u(c){return c===null||c===35||we(c)?(e.exit("atxHeadingText"),o(c)):(e.consume(c),u)}}const nh=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ao=["pre","script","style","textarea"],rh={concrete:!0,name:"htmlFlow",resolveTo:ah,tokenize:oh},ih={partial:!0,tokenize:uh},sh={partial:!0,tokenize:lh};function ah(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function oh(e,t,n){const r=this;let i,s,a,o,l;return u;function u(_){return c(_)}function c(_){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(_),f}function f(_){return _===33?(e.consume(_),h):_===47?(e.consume(_),s=!0,T):_===63?(e.consume(_),i=3,r.interrupt?t:k):He(_)?(e.consume(_),a=String.fromCharCode(_),y):n(_)}function h(_){return _===45?(e.consume(_),i=2,d):_===91?(e.consume(_),i=5,o=0,g):He(_)?(e.consume(_),i=4,r.interrupt?t:k):n(_)}function d(_){return _===45?(e.consume(_),r.interrupt?t:k):n(_)}function g(_){const E="CDATA[";return _===E.charCodeAt(o++)?(e.consume(_),o===E.length?r.interrupt?t:U:g):n(_)}function T(_){return He(_)?(e.consume(_),a=String.fromCharCode(_),y):n(_)}function y(_){if(_===null||_===47||_===62||we(_)){const E=_===47,P=a.toLowerCase();return!E&&!s&&ao.includes(P)?(i=1,r.interrupt?t(_):U(_)):nh.includes(a.toLowerCase())?(i=6,E?(e.consume(_),m):r.interrupt?t(_):U(_)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(_):s?p(_):b(_))}return _===45||ze(_)?(e.consume(_),a+=String.fromCharCode(_),y):n(_)}function m(_){return _===62?(e.consume(_),r.interrupt?t:U):n(_)}function p(_){return de(_)?(e.consume(_),p):A(_)}function b(_){return _===47?(e.consume(_),A):_===58||_===95||He(_)?(e.consume(_),S):de(_)?(e.consume(_),b):A(_)}function S(_){return _===45||_===46||_===58||_===95||ze(_)?(e.consume(_),S):v(_)}function v(_){return _===61?(e.consume(_),w):de(_)?(e.consume(_),v):b(_)}function w(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),l=_,x):de(_)?(e.consume(_),w):N(_)}function x(_){return _===l?(e.consume(_),l=null,F):_===null||ie(_)?n(_):(e.consume(_),x)}function N(_){return _===null||_===34||_===39||_===47||_===60||_===61||_===62||_===96||we(_)?v(_):(e.consume(_),N)}function F(_){return _===47||_===62||de(_)?b(_):n(_)}function A(_){return _===62?(e.consume(_),O):n(_)}function O(_){return _===null||ie(_)?U(_):de(_)?(e.consume(_),O):n(_)}function U(_){return _===45&&i===2?(e.consume(_),B):_===60&&i===1?(e.consume(_),Z):_===62&&i===4?(e.consume(_),D):_===63&&i===3?(e.consume(_),k):_===93&&i===5?(e.consume(_),ee):ie(_)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(ih,I,K)(_)):_===null||ie(_)?(e.exit("htmlFlowData"),K(_)):(e.consume(_),U)}function K(_){return e.check(sh,H,I)(_)}function H(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),j}function j(_){return _===null||ie(_)?K(_):(e.enter("htmlFlowData"),U(_))}function B(_){return _===45?(e.consume(_),k):U(_)}function Z(_){return _===47?(e.consume(_),a="",q):U(_)}function q(_){if(_===62){const E=a.toLowerCase();return ao.includes(E)?(e.consume(_),D):U(_)}return He(_)&&a.length<8?(e.consume(_),a+=String.fromCharCode(_),q):U(_)}function ee(_){return _===93?(e.consume(_),k):U(_)}function k(_){return _===62?(e.consume(_),D):_===45&&i===2?(e.consume(_),k):U(_)}function D(_){return _===null||ie(_)?(e.exit("htmlFlowData"),I(_)):(e.consume(_),D)}function I(_){return e.exit("htmlFlow"),t(_)}}function lh(e,t,n){const r=this;return i;function i(a){return ie(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function uh(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Dn,t,n)}}const ch={name:"htmlText",tokenize:fh};function fh(e,t,n){const r=this;let i,s,a;return o;function o(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),l}function l(k){return k===33?(e.consume(k),u):k===47?(e.consume(k),v):k===63?(e.consume(k),b):He(k)?(e.consume(k),N):n(k)}function u(k){return k===45?(e.consume(k),c):k===91?(e.consume(k),s=0,g):He(k)?(e.consume(k),p):n(k)}function c(k){return k===45?(e.consume(k),d):n(k)}function f(k){return k===null?n(k):k===45?(e.consume(k),h):ie(k)?(a=f,Z(k)):(e.consume(k),f)}function h(k){return k===45?(e.consume(k),d):f(k)}function d(k){return k===62?B(k):k===45?h(k):f(k)}function g(k){const D="CDATA[";return k===D.charCodeAt(s++)?(e.consume(k),s===D.length?T:g):n(k)}function T(k){return k===null?n(k):k===93?(e.consume(k),y):ie(k)?(a=T,Z(k)):(e.consume(k),T)}function y(k){return k===93?(e.consume(k),m):T(k)}function m(k){return k===62?B(k):k===93?(e.consume(k),m):T(k)}function p(k){return k===null||k===62?B(k):ie(k)?(a=p,Z(k)):(e.consume(k),p)}function b(k){return k===null?n(k):k===63?(e.consume(k),S):ie(k)?(a=b,Z(k)):(e.consume(k),b)}function S(k){return k===62?B(k):b(k)}function v(k){return He(k)?(e.consume(k),w):n(k)}function w(k){return k===45||ze(k)?(e.consume(k),w):x(k)}function x(k){return ie(k)?(a=x,Z(k)):de(k)?(e.consume(k),x):B(k)}function N(k){return k===45||ze(k)?(e.consume(k),N):k===47||k===62||we(k)?F(k):n(k)}function F(k){return k===47?(e.consume(k),B):k===58||k===95||He(k)?(e.consume(k),A):ie(k)?(a=F,Z(k)):de(k)?(e.consume(k),F):B(k)}function A(k){return k===45||k===46||k===58||k===95||ze(k)?(e.consume(k),A):O(k)}function O(k){return k===61?(e.consume(k),U):ie(k)?(a=O,Z(k)):de(k)?(e.consume(k),O):F(k)}function U(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),i=k,K):ie(k)?(a=U,Z(k)):de(k)?(e.consume(k),U):(e.consume(k),H)}function K(k){return k===i?(e.consume(k),i=void 0,j):k===null?n(k):ie(k)?(a=K,Z(k)):(e.consume(k),K)}function H(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||we(k)?F(k):(e.consume(k),H)}function j(k){return k===47||k===62||we(k)?F(k):n(k)}function B(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function Z(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),q}function q(k){return de(k)?pe(e,ee,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):ee(k)}function ee(k){return e.enter("htmlTextData"),a(k)}}const fs={name:"labelEnd",resolveAll:mh,resolveTo:gh,tokenize:yh},dh={tokenize:bh},hh={tokenize:wh},ph={tokenize:_h};function mh(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&it(e,0,e.length,n),e}function gh(e,t){let n=e.length,r=0,i,s,a,o;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[s][1].start},end:{...e[a][1].end}},c={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[a-2][1].start}};return o=[["enter",l,t],["enter",u,t]],o=ct(o,e.slice(s+1,s+r+3)),o=ct(o,[["enter",c,t]]),o=ct(o,nr(t.parser.constructs.insideSpan.null,e.slice(s+r+4,a-3),t)),o=ct(o,[["exit",c,t],e[a-2],e[a-1],["exit",u,t]]),o=ct(o,e.slice(a+1)),o=ct(o,[["exit",l,t]]),it(e,s,e.length,o),e}function yh(e,t,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return o;function o(h){return s?s._inactive?f(h):(a=r.parser.defined.includes(mt(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(dh,c,a?c:f)(h):h===91?e.attempt(hh,c,a?u:f)(h):a?c(h):f(h)}function u(h){return e.attempt(ph,c,f)(h)}function c(h){return t(h)}function f(h){return s._balanced=!0,n(h)}}function bh(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return we(f)?Cn(e,s)(f):s(f)}function s(f){return f===41?c(f):ro(e,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function a(f){return we(f)?Cn(e,l)(f):c(f)}function o(f){return n(f)}function l(f){return f===34||f===39||f===40?so(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function u(f){return we(f)?Cn(e,c)(f):c(f)}function c(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function wh(e,t,n){const r=this;return i;function i(o){return io.call(r,e,s,a,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(mt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function a(o){return n(o)}}function _h(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const vh={name:"labelStartImage",resolveAll:fs.resolveAll,tokenize:Th};function Th(e,t,n){const r=this;return i;function i(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),s}function s(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),a):n(o)}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const kh={name:"labelStartLink",resolveAll:fs.resolveAll,tokenize:Eh};function Eh(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const ds={name:"lineEnding",tokenize:Sh};function Sh(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),pe(e,t,"linePrefix")}}const rr={name:"thematicBreak",tokenize:xh};function xh(e,t,n){let r=0,i;return s;function s(u){return e.enter("thematicBreak"),a(u)}function a(u){return i=u,o(u)}function o(u){return u===i?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||ie(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),de(u)?pe(e,o,"whitespace")(u):o(u))}}const et={continuation:{tokenize:$h},exit:Oh,name:"list",tokenize:Dh},Ph={partial:!0,tokenize:Rh},Ah={partial:!0,tokenize:Ch};function Dh(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(d){const g=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:ls(d)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(rr,n,u)(d):u(d);if(!r.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(d)}return n(d)}function l(d){return ls(d)&&++a<10?(e.consume(d),l):(!r.interrupt||a<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),u(d)):n(d)}function u(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,e.check(Dn,r.interrupt?n:c,e.attempt(Ph,h,f))}function c(d){return r.containerState.initialBlankLine=!0,s++,h(d)}function f(d){return de(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),h):n(d)}function h(d){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function $h(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Dn,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,pe(e,t,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!de(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Ah,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,pe(e,e.attempt(et,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function Ch(e,t,n){const r=this;return pe(e,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(s):n(s)}}function Oh(e){e.exit(this.containerState.type)}function Rh(e,t,n){const r=this;return pe(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!de(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const oo={name:"setextUnderline",resolveTo:Nh,tokenize:Mh};function Nh(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",a,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function Mh(e,t,n){const r=this;let i;return s;function s(u){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===i?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),de(u)?pe(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ie(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Ih={tokenize:Lh};function Lh(e){const t=this,n=e.attempt(Dn,r,e.attempt(this.parser.constructs.flowInitial,i,pe(e,e.attempt(this.parser.constructs.flow,i,e.attempt(qd,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Fh={resolveAll:uo()},jh=lo("string"),zh=lo("text");function lo(e){return{resolveAll:uo(e==="text"?Uh:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,a,o);return a;function a(c){return u(c)?s(c):o(c)}function o(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),s(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;const f=i[c];let h=-1;if(f)for(;++h<f.length;){const d=f[h];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function uo(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function Uh(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,a=-1,o=0,l;for(;s--;){const u=i[s];if(typeof u=="string"){for(a=u.length;u.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(u===-2)l=!0,o++;else if(u!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const u={type:n===e.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:r.start._bufferIndex+a,_index:r.start._index+s,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const qh=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:Yd},disable:{null:[]},document:{42:et,43:et,45:et,48:et,49:et,50:et,51:et,52:et,53:et,54:et,55:et,56:et,57:et,62:Ja},flow:{35:Qd,42:rr,45:[oo,rr],60:rh,61:oo,95:rr,96:to,126:to},flowInitial:{[-2]:cs,[-1]:cs,32:cs},insideSpan:{null:[us,Fh]},string:{38:Qa,92:Xa},text:{[-5]:ds,[-4]:ds,[-3]:ds,33:vh,38:Qa,42:us,60:[kd,ch],91:kh,92:[Jd,Xa],93:fs,95:us,96:Id}},Symbol.toStringTag,{value:"Module"}));function Hh(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let a=[],o=[];const l={attempt:x(v),check:x(w),consume:p,enter:b,exit:S,interrupt:x(w,{interrupt:!0})},u={code:null,containerState:{},defineSkip:T,events:[],now:g,parser:e,previous:null,sliceSerialize:h,sliceStream:d,write:f};let c=t.tokenize.call(u,l);return t.resolveAll&&s.push(t),u;function f(O){return a=ct(a,O),y(),a[a.length-1]!==null?[]:(N(t,0),u.events=nr(s,u.events,u),u.events)}function h(O,U){return Vh(d(O),U)}function d(O){return Bh(a,O)}function g(){const{_bufferIndex:O,_index:U,line:K,column:H,offset:j}=r;return{_bufferIndex:O,_index:U,line:K,column:H,offset:j}}function T(O){i[O.line]=O.column,A()}function y(){let O;for(;r._index<a.length;){const U=a[r._index];if(typeof U=="string")for(O=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===O&&r._bufferIndex<U.length;)m(U.charCodeAt(r._bufferIndex));else m(U)}}function m(O){c=c(O)}function p(O){ie(O)?(r.line++,r.column=1,r.offset+=O===-3?2:1,A()):O!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=O}function b(O,U){const K=U||{};return K.type=O,K.start=g(),u.events.push(["enter",K,u]),o.push(K),K}function S(O){const U=o.pop();return U.end=g(),u.events.push(["exit",U,u]),U}function v(O,U){N(O,U.from)}function w(O,U){U.restore()}function x(O,U){return K;function K(H,j,B){let Z,q,ee,k;return Array.isArray(H)?I(H):"tokenize"in H?I([H]):D(H);function D(M){return X;function X(J){const ae=J!==null&&M[J],ne=J!==null&&M.null,C=[...Array.isArray(ae)?ae:ae?[ae]:[],...Array.isArray(ne)?ne:ne?[ne]:[]];return I(C)(J)}}function I(M){return Z=M,q=0,M.length===0?B:_(M[q])}function _(M){return X;function X(J){return k=F(),ee=M,M.partial||(u.currentConstruct=M),M.name&&u.parser.constructs.disable.null.includes(M.name)?P():M.tokenize.call(U?Object.assign(Object.create(u),U):u,l,E,P)(J)}}function E(M){return O(ee,k),j}function P(M){return k.restore(),++q<Z.length?_(Z[q]):B}}}function N(O,U){O.resolveAll&&!s.includes(O)&&s.push(O),O.resolve&&it(u.events,U,u.events.length-U,O.resolve(u.events.slice(U),u)),O.resolveTo&&(u.events=O.resolveTo(u.events,u))}function F(){const O=g(),U=u.previous,K=u.currentConstruct,H=u.events.length,j=Array.from(o);return{from:H,restore:B};function B(){r=O,u.previous=U,u.currentConstruct=K,u.events.length=H,o=j,A()}}function A(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Bh(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,s)];else{if(a=e.slice(n,i),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}s>0&&a.push(e[i].slice(0,s))}return a}function Vh(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=`
|
|
1
|
+
(function($e,on){typeof exports=="object"&&typeof module<"u"?on(exports):typeof define=="function"&&define.amd?define(["exports"],on):($e=typeof globalThis<"u"?globalThis:$e||self,on($e.AIClientSDK={}))})(this,(function($e){"use strict";function on(e){if(e)throw e}function er(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Gi,Fa;function qf(){if(Fa)return Gi;Fa=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):t.call(u)==="[object Array]"},s=function(u){if(!u||t.call(u)!=="[object Object]")return!1;var c=e.call(u,"constructor"),f=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!c&&!f)return!1;var h;for(h in u);return typeof h>"u"||e.call(u,h)},a=function(u,c){n&&c.name==="__proto__"?n(u,c.name,{enumerable:!0,configurable:!0,value:c.newValue,writable:!0}):u[c.name]=c.newValue},o=function(u,c){if(c==="__proto__")if(e.call(u,c)){if(r)return r(u,c).value}else return;return u[c]};return Gi=function l(){var u,c,f,h,d,g,T=arguments[0],y=1,m=arguments.length,p=!1;for(typeof T=="boolean"&&(p=T,T=arguments[1]||{},y=2),(T==null||typeof T!="object"&&typeof T!="function")&&(T={});y<m;++y)if(u=arguments[y],u!=null)for(c in u)f=o(T,c),h=o(u,c),T!==h&&(p&&h&&(s(h)||(d=i(h)))?(d?(d=!1,g=f&&i(f)?f:[]):g=f&&s(f)?f:{},a(T,{name:c,newValue:l(p,g,h)})):typeof h<"u"&&a(T,{name:c,newValue:h}));return T},Gi}var Hf=qf();const Ki=er(Hf);function bk(){}function Zi(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Bf(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...i);function o(l,...u){const c=e[++s];let f=-1;if(l){a(l);return}for(;++f<i.length;)(u[f]===null||u[f]===void 0)&&(u[f]=i[f]);i=u,c?Vf(c,o)(...u):a(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Vf(e,t){let n;return r;function r(...a){const o=e.length>a.length;let l;o&&a.push(i);try{l=e.apply(this,a)}catch(u){const c=u;if(o&&n)throw c;return i(c)}o||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(a,...o){n||(n=!0,t(a,...o))}function s(a){i(null,a)}}function An(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ja(e.position):"start"in e||"end"in e?ja(e):"line"in e||"column"in e?Ji(e):""}function Ji(e){return za(e&&e.line)+":"+za(e&&e.column)}function ja(e){return Ji(e&&e.start)+"-"+Ji(e&&e.end)}function za(e){return e&&typeof e=="number"?e:1}class Qe extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(a=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const o=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=An(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Qe.prototype.file="",Qe.prototype.name="",Qe.prototype.reason="",Qe.prototype.message="",Qe.prototype.stack="",Qe.prototype.column=void 0,Qe.prototype.line=void 0,Qe.prototype.ancestors=void 0,Qe.prototype.cause=void 0,Qe.prototype.fatal=void 0,Qe.prototype.place=void 0,Qe.prototype.ruleId=void 0,Qe.prototype.source=void 0;const kt={basename:Wf,dirname:Yf,extname:Gf,join:Kf,sep:"/"};function Wf(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Dn(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function Yf(e){if(Dn(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Gf(e){Dn(e);let t=e.length,n=-1,r=0,i=-1,s=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),o===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Kf(...e){let t=-1,n;for(;++t<e.length;)Dn(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Zf(n)}function Zf(e){Dn(e);const t=e.codePointAt(0)===47;let n=Jf(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Jf(e,t){let n="",r=0,i=-1,s=0,a=-1,o,l;for(;++a<=e.length;){if(a<e.length)o=e.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||s===1))if(i!==a-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,s=0}else o===46&&s>-1?s++:s=-1}return n}function Dn(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Xf={cwd:Qf};function Qf(){return"/"}function Xi(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function ed(e){if(typeof e=="string")e=new URL(e);else if(!Xi(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return td(e)}function td(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Qi=["history","path","basename","stem","extname","dirname"];class nd{constructor(t){let n;t?Xi(t)?n={path:t}:typeof t=="string"||rd(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Xf.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Qi.length;){const s=Qi[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)Qi.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?kt.basename(this.path):void 0}set basename(t){ts(t,"basename"),es(t,"basename"),this.path=kt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?kt.dirname(this.path):void 0}set dirname(t){Ua(this.basename,"dirname"),this.path=kt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?kt.extname(this.path):void 0}set extname(t){if(es(t,"extname"),Ua(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=kt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Xi(t)&&(t=ed(t)),ts(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?kt.basename(this.path,this.extname):void 0}set stem(t){ts(t,"stem"),es(t,"stem"),this.path=kt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Qe(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function es(e,t){if(e&&e.includes(kt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+kt.sep+"`")}function ts(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Ua(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function rd(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const id=(function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),sd={}.hasOwnProperty;class ns extends id{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Bf()}copy(){const t=new ns;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Ki(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(ss("data",this.frozen),this.namespace[t]=n,this):sd.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ss("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=tr(t),r=this.parser||this.Parser;return rs("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),rs("process",this.parser||this.Parser),is("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const o=tr(t),l=r.parse(o);r.run(l,o,function(c,f,h){if(c||!f||!h)return u(c);const d=f,g=r.stringify(d,h);ld(g)?h.value=g:h.result=g,u(c,h)});function u(c,f){c||!f?a(c):s?s(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),rs("processSync",this.parser||this.Parser),is("processSync",this.compiler||this.Compiler),this.process(t,i),Ha("processSync","process",n),r;function i(s,a){n=!0,on(s),r=a}}run(t,n,r){qa(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,o){const l=tr(n);i.run(t,l,u);function u(c,f,h){const d=f||t;c?o(c):a?a(d):r(void 0,d,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),Ha("runSync","run",r),i;function s(a,o){on(a),i=o,r=!0}}stringify(t,n){this.freeze();const r=tr(n),i=this.compiler||this.Compiler;return is("stringify",i),qa(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(ss("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[c,...f]=u;l(c,f)}else a(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function a(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(u.plugins),u.settings&&(i.settings=Ki(!0,i.settings,u.settings))}function o(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){const f=u[c];s(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,c){let f=-1,h=-1;for(;++f<r.length;)if(r[f][0]===u){h=f;break}if(h===-1)r.push([u,...c]);else if(c.length>0){let[d,...g]=c;const T=r[h][1];Zi(T)&&Zi(d)&&(d=Ki(!0,T,d)),r[h]=[u,d,...g]}}}}const ad=new ns().freeze();function rs(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function is(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ss(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function qa(e){if(!Zi(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ha(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function tr(e){return od(e)?e:new nd(e)}function od(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function ld(e){return typeof e=="string"||ud(e)}function ud(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const cd={};function as(e,t){const n=cd,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Ba(e,r,i)}function Ba(e,t,n){if(fd(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Va(e.children,t,n)}return Array.isArray(e)?Va(e,t,n):""}function Va(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Ba(e[i],t,n);return r.join("")}function fd(e){return!!(e&&typeof e=="object")}const Wa=document.createElement("i");function os(e){const t="&"+e+";";Wa.innerHTML=t;const n=Wa.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function it(e,t,n,r){const i=e.length;let s=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);s<r.length;)a=r.slice(s,s+1e4),a.unshift(t,0),e.splice(...a),s+=1e4,t+=1e4}function ct(e,t){return e.length>0?(it(e,e.length,0,t),e):t}const Ya={}.hasOwnProperty;function Ga(e){const t={};let n=-1;for(;++n<e.length;)dd(t,e[n]);return t}function dd(e,t){let n;for(n in t){const i=(Ya.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let a;if(s)for(a in s){Ya.call(i,a)||(i[a]=[]);const o=s[a];hd(i[a],Array.isArray(o)?o:o?[o]:[])}}}function hd(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);it(e,0,0,r)}function Ka(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function mt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Be=jt(/[A-Za-z]/),ze=jt(/[\dA-Za-z]/),pd=jt(/[#-'*+\--9=?A-Z^-~]/);function nr(e){return e!==null&&(e<32||e===127)}const ls=jt(/\d/),md=jt(/[\dA-Fa-f]/),gd=jt(/[!-/:-@[-`{-~]/);function ie(e){return e!==null&&e<-2}function we(e){return e!==null&&(e<0||e===32)}function de(e){return e===-2||e===-1||e===32}const rr=jt(new RegExp("\\p{P}|\\p{S}","u")),Yt=jt(/\s/);function jt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ln(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let a="";if(s===37&&ze(e.charCodeAt(n+1))&&ze(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const o=e.charCodeAt(n+1);s<56320&&o>56319&&o<57344?(a=String.fromCharCode(s,o),i=1):a="�"}else a=String.fromCharCode(s);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function pe(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(l){return de(l)?(e.enter(n),o(l)):t(l)}function o(l){return de(l)&&s++<i?(e.consume(l),o):(e.exit(n),t(l))}}const yd={tokenize:bd};function bd(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),pe(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),s(o)}function s(o){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(o)}function a(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return ie(o)?(e.consume(o),e.exit("chunkText"),s):(e.consume(o),a)}}const wd={tokenize:_d},Za={tokenize:vd};function _d(e){const t=this,n=[];let r=0,i,s,a;return o;function o(b){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,l,u)(b)}return u(b)}function l(b){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&p();const S=t.events.length;let v=S,w;for(;v--;)if(t.events[v][0]==="exit"&&t.events[v][1].type==="chunkFlow"){w=t.events[v][1].end;break}m(r);let x=S;for(;x<t.events.length;)t.events[x][1].end={...w},x++;return it(t.events,v+1,0,t.events.slice(S)),t.events.length=x,u(b)}return o(b)}function u(b){if(r===n.length){if(!i)return h(b);if(i.currentConstruct&&i.currentConstruct.concrete)return g(b);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Za,c,f)(b)}function c(b){return i&&p(),m(r),h(b)}function f(b){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,g(b)}function h(b){return t.containerState={},e.attempt(Za,d,g)(b)}function d(b){return r++,n.push([t.currentConstruct,t.containerState]),h(b)}function g(b){if(b===null){i&&p(),m(0),e.consume(b);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),T(b)}function T(b){if(b===null){y(e.exit("chunkFlow"),!0),m(0),e.consume(b);return}return ie(b)?(e.consume(b),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(b),T)}function y(b,S){const v=t.sliceStream(b);if(S&&v.push(null),b.previous=s,s&&(s.next=b),s=b,i.defineSkip(b.start),i.write(v),t.parser.lazy[b.start.line]){let w=i.events.length;for(;w--;)if(i.events[w][1].start.offset<a&&(!i.events[w][1].end||i.events[w][1].end.offset>a))return;const x=t.events.length;let N=x,F,A;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){if(F){A=t.events[N][1].end;break}F=!0}for(m(r),w=x;w<t.events.length;)t.events[w][1].end={...A},w++;it(t.events,N+1,0,t.events.slice(x)),t.events.length=w}}function m(b){let S=n.length;for(;S-- >b;){const v=n[S];t.containerState=v[1],v[0].exit.call(t,e)}n.length=b}function p(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function vd(e,t,n){return pe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function un(e){if(e===null||we(e)||Yt(e))return 1;if(rr(e))return 2}function ir(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const us={name:"attention",resolveAll:Td,tokenize:kd};function Td(e,t){let n=-1,r,i,s,a,o,l,u,c;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},h={...e[n][1].start};Ja(f,-l),Ja(h,l),a={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[n][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=ct(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=ct(u,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",s,t]]),u=ct(u,ir(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=ct(u,[["exit",s,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=ct(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,it(e,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function kd(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=un(r);let s;return a;function a(l){return s=l,e.enter("attentionSequence"),o(l)}function o(l){if(l===s)return e.consume(l),o;const u=e.exit("attentionSequence"),c=un(l),f=!c||c===2&&i||n.includes(l),h=!i||i===2&&c||n.includes(r);return u._open=!!(s===42?f:f&&(i||!h)),u._close=!!(s===42?h:h&&(c||!f)),t(l)}}function Ja(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Ed={name:"autolink",tokenize:Sd};function Sd(e,t,n){let r=0;return i;function i(d){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(d){return Be(d)?(e.consume(d),a):d===64?n(d):u(d)}function a(d){return d===43||d===45||d===46||ze(d)?(r=1,o(d)):u(d)}function o(d){return d===58?(e.consume(d),r=0,l):(d===43||d===45||d===46||ze(d))&&r++<32?(e.consume(d),o):(r=0,u(d))}function l(d){return d===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):d===null||d===32||d===60||nr(d)?n(d):(e.consume(d),l)}function u(d){return d===64?(e.consume(d),c):pd(d)?(e.consume(d),u):n(d)}function c(d){return ze(d)?f(d):n(d)}function f(d){return d===46?(e.consume(d),r=0,c):d===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):h(d)}function h(d){if((d===45||ze(d))&&r++<63){const g=d===45?h:f;return e.consume(d),g}return n(d)}}const $n={partial:!0,tokenize:xd};function xd(e,t,n){return r;function r(s){return de(s)?pe(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||ie(s)?t(s):n(s)}}const Xa={continuation:{tokenize:Ad},exit:Dd,name:"blockQuote",tokenize:Pd};function Pd(e,t,n){const r=this;return i;function i(a){if(a===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),s}return n(a)}function s(a){return de(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function Ad(e,t,n){const r=this;return i;function i(a){return de(a)?pe(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return e.attempt(Xa,t,n)(a)}}function Dd(e){e.exit("blockQuote")}const Qa={name:"characterEscape",tokenize:$d};function $d(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return gd(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const eo={name:"characterReference",tokenize:Cd};function Cd(e,t,n){const r=this;let i=0,s,a;return o;function o(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),s=31,a=ze,c(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,a=md,c):(e.enter("characterReferenceValue"),s=7,a=ls,c(f))}function c(f){if(f===59&&i){const h=e.exit("characterReferenceValue");return a===ze&&!os(r.sliceSerialize(h))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(f)&&i++<s?(e.consume(f),c):n(f)}}const to={partial:!0,tokenize:Rd},no={concrete:!0,name:"codeFenced",tokenize:Od};function Od(e,t,n){const r=this,i={partial:!0,tokenize:v};let s=0,a=0,o;return l;function l(w){return u(w)}function u(w){const x=r.events[r.events.length-1];return s=x&&x[1].type==="linePrefix"?x[2].sliceSerialize(x[1],!0).length:0,o=w,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(w)}function c(w){return w===o?(a++,e.consume(w),c):a<3?n(w):(e.exit("codeFencedFenceSequence"),de(w)?pe(e,f,"whitespace")(w):f(w))}function f(w){return w===null||ie(w)?(e.exit("codeFencedFence"),r.interrupt?t(w):e.check(to,T,S)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(w))}function h(w){return w===null||ie(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(w)):de(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),pe(e,d,"whitespace")(w)):w===96&&w===o?n(w):(e.consume(w),h)}function d(w){return w===null||ie(w)?f(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===null||ie(w)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(w)):w===96&&w===o?n(w):(e.consume(w),g)}function T(w){return e.attempt(i,S,y)(w)}function y(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),m}function m(w){return s>0&&de(w)?pe(e,p,"linePrefix",s+1)(w):p(w)}function p(w){return w===null||ie(w)?e.check(to,T,S)(w):(e.enter("codeFlowValue"),b(w))}function b(w){return w===null||ie(w)?(e.exit("codeFlowValue"),p(w)):(e.consume(w),b)}function S(w){return e.exit("codeFenced"),t(w)}function v(w,x,N){let F=0;return A;function A(j){return w.enter("lineEnding"),w.consume(j),w.exit("lineEnding"),O}function O(j){return w.enter("codeFencedFence"),de(j)?pe(w,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):U(j)}function U(j){return j===o?(w.enter("codeFencedFenceSequence"),K(j)):N(j)}function K(j){return j===o?(F++,w.consume(j),K):F>=a?(w.exit("codeFencedFenceSequence"),de(j)?pe(w,H,"whitespace")(j):H(j)):N(j)}function H(j){return j===null||ie(j)?(w.exit("codeFencedFence"),x(j)):N(j)}}}function Rd(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const cs={name:"codeIndented",tokenize:Md},Nd={partial:!0,tokenize:Id};function Md(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),pe(e,s,"linePrefix",5)(u)}function s(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?l(u):ie(u)?e.attempt(Nd,a,l)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||ie(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function l(u){return e.exit("codeIndented"),t(u)}}function Id(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):ie(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):pe(e,s,"linePrefix",5)(a)}function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):ie(a)?i(a):n(a)}}const Ld={name:"codeText",previous:jd,resolve:Fd,tokenize:zd};function Fd(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function jd(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function zd(e,t,n){let r=0,i,s;return a;function a(f){return e.enter("codeText"),e.enter("codeTextSequence"),o(f)}function o(f){return f===96?(e.consume(f),r++,o):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(s=e.enter("codeTextSequence"),i=0,c(f)):ie(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||ie(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),u)}function c(f){return f===96?(e.consume(f),i++,c):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(s.type="codeTextData",u(f))}}class Ud{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Cn(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Cn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Cn(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Cn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Cn(this.left,n.reverse())}}}function Cn(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function ro(e){const t={};let n=-1,r,i,s,a,o,l,u;const c=new Ud(e);for(;++n<c.length;){for(;n in t;)n=t[n];if(r=c.get(n),n&&r[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,qd(c,n)),n=t[n],u=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(a=c.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...c.get(i)[1].start},o=c.slice(i,n),o.unshift(r),c.splice(i,n-i+1,o))}}return it(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function qd(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,l=[],u={};let c,f,h=-1,d=n,g=0,T=0;const y=[T];for(;d;){for(;e.get(++i)[1]!==d;);s.push(i),d._tokenizer||(c=r.sliceStream(d),d.next||c.push(null),f&&a.defineSkip(d.start),d._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(c),d._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),f=d,d=d.next}for(d=n;++h<o.length;)o[h][0]==="exit"&&o[h-1][0]==="enter"&&o[h][1].type===o[h-1][1].type&&o[h][1].start.line!==o[h][1].end.line&&(T=h+1,y.push(T),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(a.events=[],d?(d._tokenizer=void 0,d.previous=void 0):y.pop(),h=y.length;h--;){const m=o.slice(y[h],y[h+1]),p=s.pop();l.push([p,p+m.length-1]),e.splice(p,2,m)}for(l.reverse(),h=-1;++h<l.length;)u[g+l[h][0]]=g+l[h][1],g+=l[h][1]-l[h][0]-1;return u}const Hd={resolve:Vd,tokenize:Wd},Bd={partial:!0,tokenize:Yd};function Vd(e){return ro(e),e}function Wd(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?s(o):ie(o)?e.check(Bd,a,s)(o):(e.consume(o),i)}function s(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function a(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Yd(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),pe(e,s,"linePrefix")}function s(a){if(a===null||ie(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function io(e,t,n,r,i,s,a,o,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return f;function f(m){return m===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(m),e.exit(s),h):m===null||m===32||m===41||nr(m)?n(m):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),T(m))}function h(m){return m===62?(e.enter(s),e.consume(m),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===62?(e.exit("chunkString"),e.exit(o),h(m)):m===null||m===60||ie(m)?n(m):(e.consume(m),m===92?g:d)}function g(m){return m===60||m===62||m===92?(e.consume(m),d):d(m)}function T(m){return!c&&(m===null||m===41||we(m))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(m)):c<u&&m===40?(e.consume(m),c++,T):m===41?(e.consume(m),c--,T):m===null||m===32||m===40||nr(m)?n(m):(e.consume(m),m===92?y:T)}function y(m){return m===40||m===41||m===92?(e.consume(m),T):T(m)}}function so(e,t,n,r,i,s){const a=this;let o=0,l;return u;function u(d){return e.enter(r),e.enter(i),e.consume(d),e.exit(i),e.enter(s),c}function c(d){return o>999||d===null||d===91||d===93&&!l||d===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):d===93?(e.exit(s),e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):ie(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===null||d===91||d===93||ie(d)||o++>999?(e.exit("chunkString"),c(d)):(e.consume(d),l||(l=!de(d)),d===92?h:f)}function h(d){return d===91||d===92||d===93?(e.consume(d),o++,f):f(d)}}function ao(e,t,n,r,i,s){let a;return o;function o(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),a=h===40?41:h,l):n(h)}function l(h){return h===a?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(s),u(h))}function u(h){return h===a?(e.exit(s),l(a)):h===null?n(h):ie(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),pe(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===a||h===null||ie(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:c)}function f(h){return h===a||h===92?(e.consume(h),c):c(h)}}function On(e,t){let n;return r;function r(i){return ie(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):de(i)?pe(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Gd={name:"definition",tokenize:Zd},Kd={partial:!0,tokenize:Jd};function Zd(e,t,n){const r=this;let i;return s;function s(d){return e.enter("definition"),a(d)}function a(d){return so.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function o(d){return i=mt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),l):n(d)}function l(d){return we(d)?On(e,u)(d):u(d)}function u(d){return io(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return e.attempt(Kd,f,f)(d)}function f(d){return de(d)?pe(e,h,"whitespace")(d):h(d)}function h(d){return d===null||ie(d)?(e.exit("definition"),r.parser.defined.push(i),t(d)):n(d)}}function Jd(e,t,n){return r;function r(o){return we(o)?On(e,i)(o):n(o)}function i(o){return ao(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return de(o)?pe(e,a,"whitespace")(o):a(o)}function a(o){return o===null||ie(o)?t(o):n(o)}}const Xd={name:"hardBreakEscape",tokenize:Qd};function Qd(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return ie(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const eh={name:"headingAtx",resolve:th,tokenize:nh};function th(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},it(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function nh(e,t,n){let r=0;return i;function i(c){return e.enter("atxHeading"),s(c)}function s(c){return e.enter("atxHeadingSequence"),a(c)}function a(c){return c===35&&r++<6?(e.consume(c),a):c===null||we(c)?(e.exit("atxHeadingSequence"),o(c)):n(c)}function o(c){return c===35?(e.enter("atxHeadingSequence"),l(c)):c===null||ie(c)?(e.exit("atxHeading"),t(c)):de(c)?pe(e,o,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function l(c){return c===35?(e.consume(c),l):(e.exit("atxHeadingSequence"),o(c))}function u(c){return c===null||c===35||we(c)?(e.exit("atxHeadingText"),o(c)):(e.consume(c),u)}}const rh=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],oo=["pre","script","style","textarea"],ih={concrete:!0,name:"htmlFlow",resolveTo:oh,tokenize:lh},sh={partial:!0,tokenize:ch},ah={partial:!0,tokenize:uh};function oh(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function lh(e,t,n){const r=this;let i,s,a,o,l;return u;function u(_){return c(_)}function c(_){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(_),f}function f(_){return _===33?(e.consume(_),h):_===47?(e.consume(_),s=!0,T):_===63?(e.consume(_),i=3,r.interrupt?t:k):Be(_)?(e.consume(_),a=String.fromCharCode(_),y):n(_)}function h(_){return _===45?(e.consume(_),i=2,d):_===91?(e.consume(_),i=5,o=0,g):Be(_)?(e.consume(_),i=4,r.interrupt?t:k):n(_)}function d(_){return _===45?(e.consume(_),r.interrupt?t:k):n(_)}function g(_){const E="CDATA[";return _===E.charCodeAt(o++)?(e.consume(_),o===E.length?r.interrupt?t:U:g):n(_)}function T(_){return Be(_)?(e.consume(_),a=String.fromCharCode(_),y):n(_)}function y(_){if(_===null||_===47||_===62||we(_)){const E=_===47,P=a.toLowerCase();return!E&&!s&&oo.includes(P)?(i=1,r.interrupt?t(_):U(_)):rh.includes(a.toLowerCase())?(i=6,E?(e.consume(_),m):r.interrupt?t(_):U(_)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(_):s?p(_):b(_))}return _===45||ze(_)?(e.consume(_),a+=String.fromCharCode(_),y):n(_)}function m(_){return _===62?(e.consume(_),r.interrupt?t:U):n(_)}function p(_){return de(_)?(e.consume(_),p):A(_)}function b(_){return _===47?(e.consume(_),A):_===58||_===95||Be(_)?(e.consume(_),S):de(_)?(e.consume(_),b):A(_)}function S(_){return _===45||_===46||_===58||_===95||ze(_)?(e.consume(_),S):v(_)}function v(_){return _===61?(e.consume(_),w):de(_)?(e.consume(_),v):b(_)}function w(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),l=_,x):de(_)?(e.consume(_),w):N(_)}function x(_){return _===l?(e.consume(_),l=null,F):_===null||ie(_)?n(_):(e.consume(_),x)}function N(_){return _===null||_===34||_===39||_===47||_===60||_===61||_===62||_===96||we(_)?v(_):(e.consume(_),N)}function F(_){return _===47||_===62||de(_)?b(_):n(_)}function A(_){return _===62?(e.consume(_),O):n(_)}function O(_){return _===null||ie(_)?U(_):de(_)?(e.consume(_),O):n(_)}function U(_){return _===45&&i===2?(e.consume(_),B):_===60&&i===1?(e.consume(_),Z):_===62&&i===4?(e.consume(_),D):_===63&&i===3?(e.consume(_),k):_===93&&i===5?(e.consume(_),ee):ie(_)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(sh,I,K)(_)):_===null||ie(_)?(e.exit("htmlFlowData"),K(_)):(e.consume(_),U)}function K(_){return e.check(ah,H,I)(_)}function H(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),j}function j(_){return _===null||ie(_)?K(_):(e.enter("htmlFlowData"),U(_))}function B(_){return _===45?(e.consume(_),k):U(_)}function Z(_){return _===47?(e.consume(_),a="",q):U(_)}function q(_){if(_===62){const E=a.toLowerCase();return oo.includes(E)?(e.consume(_),D):U(_)}return Be(_)&&a.length<8?(e.consume(_),a+=String.fromCharCode(_),q):U(_)}function ee(_){return _===93?(e.consume(_),k):U(_)}function k(_){return _===62?(e.consume(_),D):_===45&&i===2?(e.consume(_),k):U(_)}function D(_){return _===null||ie(_)?(e.exit("htmlFlowData"),I(_)):(e.consume(_),D)}function I(_){return e.exit("htmlFlow"),t(_)}}function uh(e,t,n){const r=this;return i;function i(a){return ie(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function ch(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt($n,t,n)}}const fh={name:"htmlText",tokenize:dh};function dh(e,t,n){const r=this;let i,s,a;return o;function o(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),l}function l(k){return k===33?(e.consume(k),u):k===47?(e.consume(k),v):k===63?(e.consume(k),b):Be(k)?(e.consume(k),N):n(k)}function u(k){return k===45?(e.consume(k),c):k===91?(e.consume(k),s=0,g):Be(k)?(e.consume(k),p):n(k)}function c(k){return k===45?(e.consume(k),d):n(k)}function f(k){return k===null?n(k):k===45?(e.consume(k),h):ie(k)?(a=f,Z(k)):(e.consume(k),f)}function h(k){return k===45?(e.consume(k),d):f(k)}function d(k){return k===62?B(k):k===45?h(k):f(k)}function g(k){const D="CDATA[";return k===D.charCodeAt(s++)?(e.consume(k),s===D.length?T:g):n(k)}function T(k){return k===null?n(k):k===93?(e.consume(k),y):ie(k)?(a=T,Z(k)):(e.consume(k),T)}function y(k){return k===93?(e.consume(k),m):T(k)}function m(k){return k===62?B(k):k===93?(e.consume(k),m):T(k)}function p(k){return k===null||k===62?B(k):ie(k)?(a=p,Z(k)):(e.consume(k),p)}function b(k){return k===null?n(k):k===63?(e.consume(k),S):ie(k)?(a=b,Z(k)):(e.consume(k),b)}function S(k){return k===62?B(k):b(k)}function v(k){return Be(k)?(e.consume(k),w):n(k)}function w(k){return k===45||ze(k)?(e.consume(k),w):x(k)}function x(k){return ie(k)?(a=x,Z(k)):de(k)?(e.consume(k),x):B(k)}function N(k){return k===45||ze(k)?(e.consume(k),N):k===47||k===62||we(k)?F(k):n(k)}function F(k){return k===47?(e.consume(k),B):k===58||k===95||Be(k)?(e.consume(k),A):ie(k)?(a=F,Z(k)):de(k)?(e.consume(k),F):B(k)}function A(k){return k===45||k===46||k===58||k===95||ze(k)?(e.consume(k),A):O(k)}function O(k){return k===61?(e.consume(k),U):ie(k)?(a=O,Z(k)):de(k)?(e.consume(k),O):F(k)}function U(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),i=k,K):ie(k)?(a=U,Z(k)):de(k)?(e.consume(k),U):(e.consume(k),H)}function K(k){return k===i?(e.consume(k),i=void 0,j):k===null?n(k):ie(k)?(a=K,Z(k)):(e.consume(k),K)}function H(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||we(k)?F(k):(e.consume(k),H)}function j(k){return k===47||k===62||we(k)?F(k):n(k)}function B(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function Z(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),q}function q(k){return de(k)?pe(e,ee,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):ee(k)}function ee(k){return e.enter("htmlTextData"),a(k)}}const fs={name:"labelEnd",resolveAll:gh,resolveTo:yh,tokenize:bh},hh={tokenize:wh},ph={tokenize:_h},mh={tokenize:vh};function gh(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&it(e,0,e.length,n),e}function yh(e,t){let n=e.length,r=0,i,s,a,o;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[s][1].start},end:{...e[a][1].end}},c={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[a-2][1].start}};return o=[["enter",l,t],["enter",u,t]],o=ct(o,e.slice(s+1,s+r+3)),o=ct(o,[["enter",c,t]]),o=ct(o,ir(t.parser.constructs.insideSpan.null,e.slice(s+r+4,a-3),t)),o=ct(o,[["exit",c,t],e[a-2],e[a-1],["exit",u,t]]),o=ct(o,e.slice(a+1)),o=ct(o,[["exit",l,t]]),it(e,s,e.length,o),e}function bh(e,t,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return o;function o(h){return s?s._inactive?f(h):(a=r.parser.defined.includes(mt(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(hh,c,a?c:f)(h):h===91?e.attempt(ph,c,a?u:f)(h):a?c(h):f(h)}function u(h){return e.attempt(mh,c,f)(h)}function c(h){return t(h)}function f(h){return s._balanced=!0,n(h)}}function wh(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return we(f)?On(e,s)(f):s(f)}function s(f){return f===41?c(f):io(e,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function a(f){return we(f)?On(e,l)(f):c(f)}function o(f){return n(f)}function l(f){return f===34||f===39||f===40?ao(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function u(f){return we(f)?On(e,c)(f):c(f)}function c(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function _h(e,t,n){const r=this;return i;function i(o){return so.call(r,e,s,a,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(mt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function a(o){return n(o)}}function vh(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const Th={name:"labelStartImage",resolveAll:fs.resolveAll,tokenize:kh};function kh(e,t,n){const r=this;return i;function i(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),s}function s(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),a):n(o)}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Eh={name:"labelStartLink",resolveAll:fs.resolveAll,tokenize:Sh};function Sh(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const ds={name:"lineEnding",tokenize:xh};function xh(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),pe(e,t,"linePrefix")}}const sr={name:"thematicBreak",tokenize:Ph};function Ph(e,t,n){let r=0,i;return s;function s(u){return e.enter("thematicBreak"),a(u)}function a(u){return i=u,o(u)}function o(u){return u===i?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||ie(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),de(u)?pe(e,o,"whitespace")(u):o(u))}}const et={continuation:{tokenize:Ch},exit:Rh,name:"list",tokenize:$h},Ah={partial:!0,tokenize:Nh},Dh={partial:!0,tokenize:Oh};function $h(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(d){const g=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:ls(d)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(sr,n,u)(d):u(d);if(!r.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(d)}return n(d)}function l(d){return ls(d)&&++a<10?(e.consume(d),l):(!r.interrupt||a<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),u(d)):n(d)}function u(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,e.check($n,r.interrupt?n:c,e.attempt(Ah,h,f))}function c(d){return r.containerState.initialBlankLine=!0,s++,h(d)}function f(d){return de(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),h):n(d)}function h(d){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function Ch(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check($n,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,pe(e,t,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!de(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Dh,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,pe(e,e.attempt(et,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function Oh(e,t,n){const r=this;return pe(e,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(s):n(s)}}function Rh(e){e.exit(this.containerState.type)}function Nh(e,t,n){const r=this;return pe(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!de(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const lo={name:"setextUnderline",resolveTo:Mh,tokenize:Ih};function Mh(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",a,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function Ih(e,t,n){const r=this;let i;return s;function s(u){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===i?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),de(u)?pe(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ie(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Lh={tokenize:Fh};function Fh(e){const t=this,n=e.attempt($n,r,e.attempt(this.parser.constructs.flowInitial,i,pe(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Hd,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const jh={resolveAll:co()},zh=uo("string"),Uh=uo("text");function uo(e){return{resolveAll:co(e==="text"?qh:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,a,o);return a;function a(c){return u(c)?s(c):o(c)}function o(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),s(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;const f=i[c];let h=-1;if(f)for(;++h<f.length;){const d=f[h];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function co(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function qh(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,a=-1,o=0,l;for(;s--;){const u=i[s];if(typeof u=="string"){for(a=u.length;u.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(u===-2)l=!0,o++;else if(u!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const u={type:n===e.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:r.start._bufferIndex+a,_index:r.start._index+s,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const Hh=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:Gd},disable:{null:[]},document:{42:et,43:et,45:et,48:et,49:et,50:et,51:et,52:et,53:et,54:et,55:et,56:et,57:et,62:Xa},flow:{35:eh,42:sr,45:[lo,sr],60:ih,61:lo,95:sr,96:no,126:no},flowInitial:{[-2]:cs,[-1]:cs,32:cs},insideSpan:{null:[us,jh]},string:{38:eo,92:Qa},text:{[-5]:ds,[-4]:ds,[-3]:ds,33:Th,38:eo,42:us,60:[Ed,fh],91:Eh,92:[Xd,Qa],93:fs,95:us,96:Ld}},Symbol.toStringTag,{value:"Module"}));function Bh(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let a=[],o=[];const l={attempt:x(v),check:x(w),consume:p,enter:b,exit:S,interrupt:x(w,{interrupt:!0})},u={code:null,containerState:{},defineSkip:T,events:[],now:g,parser:e,previous:null,sliceSerialize:h,sliceStream:d,write:f};let c=t.tokenize.call(u,l);return t.resolveAll&&s.push(t),u;function f(O){return a=ct(a,O),y(),a[a.length-1]!==null?[]:(N(t,0),u.events=ir(s,u.events,u),u.events)}function h(O,U){return Wh(d(O),U)}function d(O){return Vh(a,O)}function g(){const{_bufferIndex:O,_index:U,line:K,column:H,offset:j}=r;return{_bufferIndex:O,_index:U,line:K,column:H,offset:j}}function T(O){i[O.line]=O.column,A()}function y(){let O;for(;r._index<a.length;){const U=a[r._index];if(typeof U=="string")for(O=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===O&&r._bufferIndex<U.length;)m(U.charCodeAt(r._bufferIndex));else m(U)}}function m(O){c=c(O)}function p(O){ie(O)?(r.line++,r.column=1,r.offset+=O===-3?2:1,A()):O!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=O}function b(O,U){const K=U||{};return K.type=O,K.start=g(),u.events.push(["enter",K,u]),o.push(K),K}function S(O){const U=o.pop();return U.end=g(),u.events.push(["exit",U,u]),U}function v(O,U){N(O,U.from)}function w(O,U){U.restore()}function x(O,U){return K;function K(H,j,B){let Z,q,ee,k;return Array.isArray(H)?I(H):"tokenize"in H?I([H]):D(H);function D(M){return X;function X(J){const ae=J!==null&&M[J],ne=J!==null&&M.null,C=[...Array.isArray(ae)?ae:ae?[ae]:[],...Array.isArray(ne)?ne:ne?[ne]:[]];return I(C)(J)}}function I(M){return Z=M,q=0,M.length===0?B:_(M[q])}function _(M){return X;function X(J){return k=F(),ee=M,M.partial||(u.currentConstruct=M),M.name&&u.parser.constructs.disable.null.includes(M.name)?P():M.tokenize.call(U?Object.assign(Object.create(u),U):u,l,E,P)(J)}}function E(M){return O(ee,k),j}function P(M){return k.restore(),++q<Z.length?_(Z[q]):B}}}function N(O,U){O.resolveAll&&!s.includes(O)&&s.push(O),O.resolve&&it(u.events,U,u.events.length-U,O.resolve(u.events.slice(U),u)),O.resolveTo&&(u.events=O.resolveTo(u.events,u))}function F(){const O=g(),U=u.previous,K=u.currentConstruct,H=u.events.length,j=Array.from(o);return{from:H,restore:B};function B(){r=O,u.previous=U,u.currentConstruct=K,u.events.length=H,o=j,A()}}function A(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Vh(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,s)];else{if(a=e.slice(n,i),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}s>0&&a.push(e[i].slice(0,s))}return a}function Wh(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=`
|
|
2
2
|
`;break}case-3:{a=`\r
|
|
3
|
-
`;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(s)}i=s===-2,r.push(a)}return r.join("")}function Wh(e){const r={constructs:Ya([qh,...(e||{}).extensions||[]]),content:i(gd),defined:[],document:i(bd),flow:i(Ih),lazy:{},string:i(jh),text:i(zh)};return r;function i(s){return a;function a(o){return Hh(r,s,o)}}}function Yh(e){for(;!no(e););return e}const co=/[\0\t\n\r]/g;function Gh(){let e=1,t="",n=!0,r;return i;function i(s,a,o){const l=[];let u,c,f,h,d;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),f=0,t="",n&&(s.charCodeAt(0)===65279&&f++,n=void 0);f<s.length;){if(co.lastIndex=f,u=co.exec(s),h=u&&u.index!==void 0?u.index:s.length,d=s.charCodeAt(h),!u){t=s.slice(f);break}if(d===10&&f===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<h&&(l.push(s.slice(f,h)),e+=h-f),d){case 0:{l.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,l.push(-2);e++<c;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return o&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const Kh=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Zh(e){return e.replace(Kh,Jh)}function Jh(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return Ga(n.slice(s?2:1),s?16:10)}return os(n)||e}const fo={}.hasOwnProperty;function Xh(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Qh(n)(Yh(Wh(n).document().write(Gh()(e,t,!0))))}function Qh(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Pe),autolinkProtocol:F,autolinkEmail:F,atxHeading:s(Q),blockQuote:s(ne),characterEscape:F,characterReference:F,codeFenced:s(C),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(C,a),codeText:s(R,a),codeTextData:F,data:F,codeFlowValue:F,definition:s(z),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(G),hardBreakEscape:s(oe),hardBreakTrailing:s(oe),htmlFlow:s(Se,a),htmlFlowData:F,htmlText:s(Se,a),htmlTextData:F,image:s(Oe),label:a,link:s(Pe),listItem:s(De),listItemValue:h,listOrdered:s(Ae,f),listUnordered:s(Ae),paragraph:s(wt),reference:_,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(Q),strong:s(Ue),thematicBreak:s(_t)},exit:{atxHeading:l(),atxHeadingSequence:v,autolink:l(),autolinkEmail:ae,autolinkProtocol:J,blockQuote:l(),characterEscapeValue:A,characterReferenceMarkerHexadecimal:P,characterReferenceMarkerNumeric:P,characterReferenceValue:M,characterReference:X,codeFenced:l(y),codeFencedFence:T,codeFencedFenceInfo:d,codeFencedFenceMeta:g,codeFlowValue:A,codeIndented:l(m),codeText:l(j),codeTextData:A,data:A,definition:l(),definitionDestinationString:S,definitionLabelString:p,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(U),hardBreakTrailing:l(U),htmlFlow:l(K),htmlFlowData:A,htmlText:l(H),htmlTextData:A,image:l(Z),label:ee,labelText:q,lineEnding:O,link:l(B),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:E,resourceDestinationString:k,resourceTitleString:D,resource:I,setextHeading:l(N),setextHeadingLineSequence:x,setextHeadingText:w,strong:l(),thematicBreak:l()}};ho(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(L){let V={type:"root",children:[]};const se={stack:[V],tokenStack:[],config:t,enter:o,exit:u,buffer:a,resume:c,data:n},ue=[];let ge=-1;for(;++ge<L.length;)if(L[ge][1].type==="listOrdered"||L[ge][1].type==="listUnordered")if(L[ge][0]==="enter")ue.push(ge);else{const Je=ue.pop();ge=i(L,Je,ge)}for(ge=-1;++ge<L.length;){const Je=t[L[ge][0]];fo.call(Je,L[ge][1].type)&&Je[L[ge][1].type].call(Object.assign({sliceSerialize:L[ge][2].sliceSerialize},se),L[ge][1])}if(se.tokenStack.length>0){const Je=se.tokenStack[se.tokenStack.length-1];(Je[1]||po).call(se,void 0,Je[0])}for(V.position={start:zt(L.length>0?L[0][1].start:{line:1,column:1,offset:0}),end:zt(L.length>0?L[L.length-2][1].end:{line:1,column:1,offset:0})},ge=-1;++ge<t.transforms.length;)V=t.transforms[ge](V)||V;return V}function i(L,V,se){let ue=V-1,ge=-1,Je=!1,St,nt,xt,Xe;for(;++ue<=se;){const Re=L[ue];switch(Re[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Re[0]==="enter"?ge++:ge--,Xe=void 0;break}case"lineEndingBlank":{Re[0]==="enter"&&(St&&!Xe&&!ge&&!xt&&(xt=ue),Xe=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Xe=void 0}if(!ge&&Re[0]==="enter"&&Re[1].type==="listItemPrefix"||ge===-1&&Re[0]==="exit"&&(Re[1].type==="listUnordered"||Re[1].type==="listOrdered")){if(St){let Pt=ue;for(nt=void 0;Pt--;){const ut=L[Pt];if(ut[1].type==="lineEnding"||ut[1].type==="lineEndingBlank"){if(ut[0]==="exit")continue;nt&&(L[nt][1].type="lineEndingBlank",Je=!0),ut[1].type="lineEnding",nt=Pt}else if(!(ut[1].type==="linePrefix"||ut[1].type==="blockQuotePrefix"||ut[1].type==="blockQuotePrefixWhitespace"||ut[1].type==="blockQuoteMarker"||ut[1].type==="listItemIndent"))break}xt&&(!nt||xt<nt)&&(St._spread=!0),St.end=Object.assign({},nt?L[nt][1].start:Re[1].end),L.splice(nt||ue,0,["exit",St,Re[2]]),ue++,se++}if(Re[1].type==="listItemPrefix"){const Pt={type:"listItem",_spread:!1,start:Object.assign({},Re[1].start),end:void 0};St=Pt,L.splice(ue,0,["enter",Pt,Re[2]]),ue++,se++,xt=void 0,Xe=!0}}}return L[V][1]._spread=Je,se}function s(L,V){return se;function se(ue){o.call(this,L(ue),ue),V&&V.call(this,ue)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(L,V,se){this.stack[this.stack.length-1].children.push(L),this.stack.push(L),this.tokenStack.push([V,se||void 0]),L.position={start:zt(V.start),end:void 0}}function l(L){return V;function V(se){L&&L.call(this,se),u.call(this,se)}}function u(L,V){const se=this.stack.pop(),ue=this.tokenStack.pop();if(ue)ue[0].type!==L.type&&(V?V.call(this,L,ue[0]):(ue[1]||po).call(this,L,ue[0]));else throw new Error("Cannot close `"+L.type+"` ("+Pn({start:L.start,end:L.end})+"): it’s not open");se.position.end=zt(L.end)}function c(){return as(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(L){if(this.data.expectingFirstListItemValue){const V=this.stack[this.stack.length-2];V.start=Number.parseInt(this.sliceSerialize(L),10),this.data.expectingFirstListItemValue=void 0}}function d(){const L=this.resume(),V=this.stack[this.stack.length-1];V.lang=L}function g(){const L=this.resume(),V=this.stack[this.stack.length-1];V.meta=L}function T(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const L=this.resume(),V=this.stack[this.stack.length-1];V.value=L.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function m(){const L=this.resume(),V=this.stack[this.stack.length-1];V.value=L.replace(/(\r?\n|\r)$/g,"")}function p(L){const V=this.resume(),se=this.stack[this.stack.length-1];se.label=V,se.identifier=mt(this.sliceSerialize(L)).toLowerCase()}function b(){const L=this.resume(),V=this.stack[this.stack.length-1];V.title=L}function S(){const L=this.resume(),V=this.stack[this.stack.length-1];V.url=L}function v(L){const V=this.stack[this.stack.length-1];if(!V.depth){const se=this.sliceSerialize(L).length;V.depth=se}}function w(){this.data.setextHeadingSlurpLineEnding=!0}function x(L){const V=this.stack[this.stack.length-1];V.depth=this.sliceSerialize(L).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function F(L){const se=this.stack[this.stack.length-1].children;let ue=se[se.length-1];(!ue||ue.type!=="text")&&(ue=It(),ue.position={start:zt(L.start),end:void 0},se.push(ue)),this.stack.push(ue)}function A(L){const V=this.stack.pop();V.value+=this.sliceSerialize(L),V.position.end=zt(L.end)}function O(L){const V=this.stack[this.stack.length-1];if(this.data.atHardBreak){const se=V.children[V.children.length-1];se.position.end=zt(L.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(V.type)&&(F.call(this,L),A.call(this,L))}function U(){this.data.atHardBreak=!0}function K(){const L=this.resume(),V=this.stack[this.stack.length-1];V.value=L}function H(){const L=this.resume(),V=this.stack[this.stack.length-1];V.value=L}function j(){const L=this.resume(),V=this.stack[this.stack.length-1];V.value=L}function B(){const L=this.stack[this.stack.length-1];if(this.data.inReference){const V=this.data.referenceType||"shortcut";L.type+="Reference",L.referenceType=V,delete L.url,delete L.title}else delete L.identifier,delete L.label;this.data.referenceType=void 0}function Z(){const L=this.stack[this.stack.length-1];if(this.data.inReference){const V=this.data.referenceType||"shortcut";L.type+="Reference",L.referenceType=V,delete L.url,delete L.title}else delete L.identifier,delete L.label;this.data.referenceType=void 0}function q(L){const V=this.sliceSerialize(L),se=this.stack[this.stack.length-2];se.label=Zh(V),se.identifier=mt(V).toLowerCase()}function ee(){const L=this.stack[this.stack.length-1],V=this.resume(),se=this.stack[this.stack.length-1];if(this.data.inReference=!0,se.type==="link"){const ue=L.children;se.children=ue}else se.alt=V}function k(){const L=this.resume(),V=this.stack[this.stack.length-1];V.url=L}function D(){const L=this.resume(),V=this.stack[this.stack.length-1];V.title=L}function I(){this.data.inReference=void 0}function _(){this.data.referenceType="collapsed"}function E(L){const V=this.resume(),se=this.stack[this.stack.length-1];se.label=V,se.identifier=mt(this.sliceSerialize(L)).toLowerCase(),this.data.referenceType="full"}function P(L){this.data.characterReferenceType=L.type}function M(L){const V=this.sliceSerialize(L),se=this.data.characterReferenceType;let ue;se?(ue=Ga(V,se==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ue=os(V);const ge=this.stack[this.stack.length-1];ge.value+=ue}function X(L){const V=this.stack.pop();V.position.end=zt(L.end)}function J(L){A.call(this,L);const V=this.stack[this.stack.length-1];V.url=this.sliceSerialize(L)}function ae(L){A.call(this,L);const V=this.stack[this.stack.length-1];V.url="mailto:"+this.sliceSerialize(L)}function ne(){return{type:"blockquote",children:[]}}function C(){return{type:"code",lang:null,meta:null,value:""}}function R(){return{type:"inlineCode",value:""}}function z(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function G(){return{type:"emphasis",children:[]}}function Q(){return{type:"heading",depth:0,children:[]}}function oe(){return{type:"break"}}function Se(){return{type:"html",value:""}}function Oe(){return{type:"image",title:null,url:"",alt:null}}function Pe(){return{type:"link",title:null,url:"",children:[]}}function Ae(L){return{type:"list",ordered:L.type==="listOrdered",start:null,spread:L._spread,children:[]}}function De(L){return{type:"listItem",spread:L._spread,checked:null,children:[]}}function wt(){return{type:"paragraph",children:[]}}function Ue(){return{type:"strong",children:[]}}function It(){return{type:"text",value:""}}function _t(){return{type:"thematicBreak"}}}function zt(e){return{line:e.line,column:e.column,offset:e.offset}}function ho(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?ho(e,r):ep(e,r)}}function ep(e,t){let n;for(n in t)if(fo.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function po(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Pn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Pn({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Pn({start:t.start,end:t.end})+") is still open")}function tp(e){const t=this;t.parser=n;function n(r){return Xh(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function ir(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function np(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const sr=(function(e){if(e==null)return ap;if(typeof e=="function")return ar(e);if(typeof e=="object")return Array.isArray(e)?rp(e):ip(e);if(typeof e=="string")return sp(e);throw new Error("Expected function, string, or object as test")});function rp(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=sr(e[n]);return ar(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function ip(e){const t=e;return ar(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function sp(e){return ar(t);function t(n){return n&&n.type===e}}function ar(e){return t;function t(n,r,i){return!!(op(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function ap(){return!0}function op(e){return e!==null&&typeof e=="object"&&"type"in e}function Ak(e){return e}const mo=[],lp=!0,hs=!1,up="skip";function go(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=sr(i),a=r?-1:1;o(e,void 0,[])();function o(l,u,c){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const d=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(d?"<"+d+">":""))+")"})}return h;function h(){let d=mo,g,T,y;if((!t||s(l,u,c[c.length-1]||void 0))&&(d=cp(n(l,c)),d[0]===hs))return d;if("children"in l&&l.children){const m=l;if(m.children&&d[0]!==up)for(T=(r?m.children.length:-1)+a,y=c.concat(m);T>-1&&T<m.children.length;){const p=m.children[T];if(g=o(p,T,y)(),g[0]===hs)return g;T=typeof g[1]=="number"?g[1]:T+a}}return d}}}function cp(e){return Array.isArray(e)?e:typeof e=="number"?[lp,e]:e==null?mo:[e]}function fp(e,t,n){const i=sr((n||{}).ignore||[]),s=dp(t);let a=-1;for(;++a<s.length;)go(e,"text",o);function o(u,c){let f=-1,h;for(;++f<c.length;){const d=c[f],g=h?h.children:void 0;if(i(d,g?g.indexOf(d):void 0,h))return;h=d}if(h)return l(u,c)}function l(u,c){const f=c[c.length-1],h=s[a][0],d=s[a][1];let g=0;const y=f.children.indexOf(u);let m=!1,p=[];h.lastIndex=0;let b=h.exec(u.value);for(;b;){const S=b.index,v={index:b.index,input:b.input,stack:[...c,u]};let w=d(...b,v);if(typeof w=="string"&&(w=w.length>0?{type:"text",value:w}:void 0),w===!1?h.lastIndex=S+1:(g!==S&&p.push({type:"text",value:u.value.slice(g,S)}),Array.isArray(w)?p.push(...w):w&&p.push(w),g=S+b[0].length,m=!0),!h.global)break;b=h.exec(u.value)}return m?(g<u.value.length&&p.push({type:"text",value:u.value.slice(g)}),f.children.splice(y,1,...p)):p=[u],y+p.length}}function dp(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([hp(i[0]),pp(i[1])])}return t}function hp(e){return typeof e=="string"?new RegExp(np(e),"g"):e}function pp(e){return typeof e=="function"?e:function(){return e}}const ps="phrasing",ms=["autolink","link","image","label"];function mp(){return{transforms:[Tp],enter:{literalAutolink:yp,literalAutolinkEmail:gs,literalAutolinkHttp:gs,literalAutolinkWww:gs},exit:{literalAutolink:vp,literalAutolinkEmail:_p,literalAutolinkHttp:bp,literalAutolinkWww:wp}}}function gp(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ps,notInConstruct:ms},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ps,notInConstruct:ms},{character:":",before:"[ps]",after:"\\/",inConstruct:ps,notInConstruct:ms}]}}function yp(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function gs(e){this.config.enter.autolinkProtocol.call(this,e)}function bp(e){this.config.exit.autolinkProtocol.call(this,e)}function wp(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function _p(e){this.config.exit.autolinkEmail.call(this,e)}function vp(e){this.exit(e)}function Tp(e){fp(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,kp],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Ep]],{ignore:["link","linkReference"]})}function kp(e,t,n,r,i){let s="";if(!yo(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!Sp(n)))return!1;const a=xp(n+r);if(!a[0])return!1;const o={type:"link",title:null,url:s+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[o,{type:"text",value:a[1]}]:o}function Ep(e,t,n,r){return!yo(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Sp(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function xp(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=ir(e,"(");let s=ir(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function yo(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Wt(n)||tr(n))&&(!t||n!==47)}bo.peek=Mp;function Pp(){this.buffer()}function Ap(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Dp(){this.buffer()}function $p(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Cp(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=mt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Op(e){this.exit(e)}function Rp(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=mt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Np(e){this.exit(e)}function Mp(){return"["}function bo(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),o(),a(),s+=i.move("]"),s}function Ip(){return{enter:{gfmFootnoteCallString:Pp,gfmFootnoteCall:Ap,gfmFootnoteDefinitionLabelString:Dp,gfmFootnoteDefinition:$p},exit:{gfmFootnoteCallString:Cp,gfmFootnoteCall:Op,gfmFootnoteDefinitionLabelString:Rp,gfmFootnoteDefinition:Np}}}function Lp(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:bo},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,a){const o=s.createTracker(a);let l=o.move("[^");const u=s.enter("footnoteDefinition"),c=s.enter("label");return l+=o.move(s.safe(s.associationId(r),{before:l,after:"]"})),c(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((t?`
|
|
4
|
-
`:" ")+s.indentLines(s.containerFlow(r,o.current()),t?
|
|
5
|
-
`)}function
|
|
6
|
-
`&&
|
|
7
|
-
`}function
|
|
3
|
+
`;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(s)}i=s===-2,r.push(a)}return r.join("")}function Yh(e){const r={constructs:Ga([Hh,...(e||{}).extensions||[]]),content:i(yd),defined:[],document:i(wd),flow:i(Lh),lazy:{},string:i(zh),text:i(Uh)};return r;function i(s){return a;function a(o){return Bh(r,s,o)}}}function Gh(e){for(;!ro(e););return e}const fo=/[\0\t\n\r]/g;function Kh(){let e=1,t="",n=!0,r;return i;function i(s,a,o){const l=[];let u,c,f,h,d;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),f=0,t="",n&&(s.charCodeAt(0)===65279&&f++,n=void 0);f<s.length;){if(fo.lastIndex=f,u=fo.exec(s),h=u&&u.index!==void 0?u.index:s.length,d=s.charCodeAt(h),!u){t=s.slice(f);break}if(d===10&&f===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<h&&(l.push(s.slice(f,h)),e+=h-f),d){case 0:{l.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,l.push(-2);e++<c;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}f=h+1}return o&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const Zh=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Jh(e){return e.replace(Zh,Xh)}function Xh(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return Ka(n.slice(s?2:1),s?16:10)}return os(n)||e}const ho={}.hasOwnProperty;function Qh(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),ep(n)(Gh(Yh(n).document().write(Kh()(e,t,!0))))}function ep(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Pe),autolinkProtocol:F,autolinkEmail:F,atxHeading:s(Q),blockQuote:s(ne),characterEscape:F,characterReference:F,codeFenced:s(C),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(C,a),codeText:s(R,a),codeTextData:F,data:F,codeFlowValue:F,definition:s(z),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(G),hardBreakEscape:s(oe),hardBreakTrailing:s(oe),htmlFlow:s(Se,a),htmlFlowData:F,htmlText:s(Se,a),htmlTextData:F,image:s(Oe),label:a,link:s(Pe),listItem:s(De),listItemValue:h,listOrdered:s(Ae,f),listUnordered:s(Ae),paragraph:s(_t),reference:_,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(Q),strong:s(Ue),thematicBreak:s(vt)},exit:{atxHeading:l(),atxHeadingSequence:v,autolink:l(),autolinkEmail:ae,autolinkProtocol:J,blockQuote:l(),characterEscapeValue:A,characterReferenceMarkerHexadecimal:P,characterReferenceMarkerNumeric:P,characterReferenceValue:M,characterReference:X,codeFenced:l(y),codeFencedFence:T,codeFencedFenceInfo:d,codeFencedFenceMeta:g,codeFlowValue:A,codeIndented:l(m),codeText:l(j),codeTextData:A,data:A,definition:l(),definitionDestinationString:S,definitionLabelString:p,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(U),hardBreakTrailing:l(U),htmlFlow:l(K),htmlFlowData:A,htmlText:l(H),htmlTextData:A,image:l(Z),label:ee,labelText:q,lineEnding:O,link:l(B),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:E,resourceDestinationString:k,resourceTitleString:D,resource:I,setextHeading:l(N),setextHeadingLineSequence:x,setextHeadingText:w,strong:l(),thematicBreak:l()}};po(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(L){let V={type:"root",children:[]};const se={stack:[V],tokenStack:[],config:t,enter:o,exit:u,buffer:a,resume:c,data:n},ue=[];let ge=-1;for(;++ge<L.length;)if(L[ge][1].type==="listOrdered"||L[ge][1].type==="listUnordered")if(L[ge][0]==="enter")ue.push(ge);else{const Xe=ue.pop();ge=i(L,Xe,ge)}for(ge=-1;++ge<L.length;){const Xe=t[L[ge][0]];ho.call(Xe,L[ge][1].type)&&Xe[L[ge][1].type].call(Object.assign({sliceSerialize:L[ge][2].sliceSerialize},se),L[ge][1])}if(se.tokenStack.length>0){const Xe=se.tokenStack[se.tokenStack.length-1];(Xe[1]||mo).call(se,void 0,Xe[0])}for(V.position={start:zt(L.length>0?L[0][1].start:{line:1,column:1,offset:0}),end:zt(L.length>0?L[L.length-2][1].end:{line:1,column:1,offset:0})},ge=-1;++ge<t.transforms.length;)V=t.transforms[ge](V)||V;return V}function i(L,V,se){let ue=V-1,ge=-1,Xe=!1,Pt,nt,At,qe;for(;++ue<=se;){const Re=L[ue];switch(Re[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Re[0]==="enter"?ge++:ge--,qe=void 0;break}case"lineEndingBlank":{Re[0]==="enter"&&(Pt&&!qe&&!ge&&!At&&(At=ue),qe=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:qe=void 0}if(!ge&&Re[0]==="enter"&&Re[1].type==="listItemPrefix"||ge===-1&&Re[0]==="exit"&&(Re[1].type==="listUnordered"||Re[1].type==="listOrdered")){if(Pt){let Dt=ue;for(nt=void 0;Dt--;){const lt=L[Dt];if(lt[1].type==="lineEnding"||lt[1].type==="lineEndingBlank"){if(lt[0]==="exit")continue;nt&&(L[nt][1].type="lineEndingBlank",Xe=!0),lt[1].type="lineEnding",nt=Dt}else if(!(lt[1].type==="linePrefix"||lt[1].type==="blockQuotePrefix"||lt[1].type==="blockQuotePrefixWhitespace"||lt[1].type==="blockQuoteMarker"||lt[1].type==="listItemIndent"))break}At&&(!nt||At<nt)&&(Pt._spread=!0),Pt.end=Object.assign({},nt?L[nt][1].start:Re[1].end),L.splice(nt||ue,0,["exit",Pt,Re[2]]),ue++,se++}if(Re[1].type==="listItemPrefix"){const Dt={type:"listItem",_spread:!1,start:Object.assign({},Re[1].start),end:void 0};Pt=Dt,L.splice(ue,0,["enter",Dt,Re[2]]),ue++,se++,At=void 0,qe=!0}}}return L[V][1]._spread=Xe,se}function s(L,V){return se;function se(ue){o.call(this,L(ue),ue),V&&V.call(this,ue)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(L,V,se){this.stack[this.stack.length-1].children.push(L),this.stack.push(L),this.tokenStack.push([V,se||void 0]),L.position={start:zt(V.start),end:void 0}}function l(L){return V;function V(se){L&&L.call(this,se),u.call(this,se)}}function u(L,V){const se=this.stack.pop(),ue=this.tokenStack.pop();if(ue)ue[0].type!==L.type&&(V?V.call(this,L,ue[0]):(ue[1]||mo).call(this,L,ue[0]));else throw new Error("Cannot close `"+L.type+"` ("+An({start:L.start,end:L.end})+"): it’s not open");se.position.end=zt(L.end)}function c(){return as(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function h(L){if(this.data.expectingFirstListItemValue){const V=this.stack[this.stack.length-2];V.start=Number.parseInt(this.sliceSerialize(L),10),this.data.expectingFirstListItemValue=void 0}}function d(){const L=this.resume(),V=this.stack[this.stack.length-1];V.lang=L}function g(){const L=this.resume(),V=this.stack[this.stack.length-1];V.meta=L}function T(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const L=this.resume(),V=this.stack[this.stack.length-1];V.value=L.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function m(){const L=this.resume(),V=this.stack[this.stack.length-1];V.value=L.replace(/(\r?\n|\r)$/g,"")}function p(L){const V=this.resume(),se=this.stack[this.stack.length-1];se.label=V,se.identifier=mt(this.sliceSerialize(L)).toLowerCase()}function b(){const L=this.resume(),V=this.stack[this.stack.length-1];V.title=L}function S(){const L=this.resume(),V=this.stack[this.stack.length-1];V.url=L}function v(L){const V=this.stack[this.stack.length-1];if(!V.depth){const se=this.sliceSerialize(L).length;V.depth=se}}function w(){this.data.setextHeadingSlurpLineEnding=!0}function x(L){const V=this.stack[this.stack.length-1];V.depth=this.sliceSerialize(L).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function F(L){const se=this.stack[this.stack.length-1].children;let ue=se[se.length-1];(!ue||ue.type!=="text")&&(ue=Lt(),ue.position={start:zt(L.start),end:void 0},se.push(ue)),this.stack.push(ue)}function A(L){const V=this.stack.pop();V.value+=this.sliceSerialize(L),V.position.end=zt(L.end)}function O(L){const V=this.stack[this.stack.length-1];if(this.data.atHardBreak){const se=V.children[V.children.length-1];se.position.end=zt(L.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(V.type)&&(F.call(this,L),A.call(this,L))}function U(){this.data.atHardBreak=!0}function K(){const L=this.resume(),V=this.stack[this.stack.length-1];V.value=L}function H(){const L=this.resume(),V=this.stack[this.stack.length-1];V.value=L}function j(){const L=this.resume(),V=this.stack[this.stack.length-1];V.value=L}function B(){const L=this.stack[this.stack.length-1];if(this.data.inReference){const V=this.data.referenceType||"shortcut";L.type+="Reference",L.referenceType=V,delete L.url,delete L.title}else delete L.identifier,delete L.label;this.data.referenceType=void 0}function Z(){const L=this.stack[this.stack.length-1];if(this.data.inReference){const V=this.data.referenceType||"shortcut";L.type+="Reference",L.referenceType=V,delete L.url,delete L.title}else delete L.identifier,delete L.label;this.data.referenceType=void 0}function q(L){const V=this.sliceSerialize(L),se=this.stack[this.stack.length-2];se.label=Jh(V),se.identifier=mt(V).toLowerCase()}function ee(){const L=this.stack[this.stack.length-1],V=this.resume(),se=this.stack[this.stack.length-1];if(this.data.inReference=!0,se.type==="link"){const ue=L.children;se.children=ue}else se.alt=V}function k(){const L=this.resume(),V=this.stack[this.stack.length-1];V.url=L}function D(){const L=this.resume(),V=this.stack[this.stack.length-1];V.title=L}function I(){this.data.inReference=void 0}function _(){this.data.referenceType="collapsed"}function E(L){const V=this.resume(),se=this.stack[this.stack.length-1];se.label=V,se.identifier=mt(this.sliceSerialize(L)).toLowerCase(),this.data.referenceType="full"}function P(L){this.data.characterReferenceType=L.type}function M(L){const V=this.sliceSerialize(L),se=this.data.characterReferenceType;let ue;se?(ue=Ka(V,se==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ue=os(V);const ge=this.stack[this.stack.length-1];ge.value+=ue}function X(L){const V=this.stack.pop();V.position.end=zt(L.end)}function J(L){A.call(this,L);const V=this.stack[this.stack.length-1];V.url=this.sliceSerialize(L)}function ae(L){A.call(this,L);const V=this.stack[this.stack.length-1];V.url="mailto:"+this.sliceSerialize(L)}function ne(){return{type:"blockquote",children:[]}}function C(){return{type:"code",lang:null,meta:null,value:""}}function R(){return{type:"inlineCode",value:""}}function z(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function G(){return{type:"emphasis",children:[]}}function Q(){return{type:"heading",depth:0,children:[]}}function oe(){return{type:"break"}}function Se(){return{type:"html",value:""}}function Oe(){return{type:"image",title:null,url:"",alt:null}}function Pe(){return{type:"link",title:null,url:"",children:[]}}function Ae(L){return{type:"list",ordered:L.type==="listOrdered",start:null,spread:L._spread,children:[]}}function De(L){return{type:"listItem",spread:L._spread,checked:null,children:[]}}function _t(){return{type:"paragraph",children:[]}}function Ue(){return{type:"strong",children:[]}}function Lt(){return{type:"text",value:""}}function vt(){return{type:"thematicBreak"}}}function zt(e){return{line:e.line,column:e.column,offset:e.offset}}function po(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?po(e,r):tp(e,r)}}function tp(e,t){let n;for(n in t)if(ho.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function mo(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+An({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+An({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+An({start:t.start,end:t.end})+") is still open")}function np(e){const t=this;t.parser=n;function n(r){return Qh(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function ar(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function rp(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const or=(function(e){if(e==null)return op;if(typeof e=="function")return lr(e);if(typeof e=="object")return Array.isArray(e)?ip(e):sp(e);if(typeof e=="string")return ap(e);throw new Error("Expected function, string, or object as test")});function ip(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=or(e[n]);return lr(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function sp(e){const t=e;return lr(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function ap(e){return lr(t);function t(n){return n&&n.type===e}}function lr(e){return t;function t(n,r,i){return!!(lp(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function op(){return!0}function lp(e){return e!==null&&typeof e=="object"&&"type"in e}function Ak(e){return e}const go=[],up=!0,hs=!1,cp="skip";function yo(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=or(i),a=r?-1:1;o(e,void 0,[])();function o(l,u,c){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const d=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(d?"<"+d+">":""))+")"})}return h;function h(){let d=go,g,T,y;if((!t||s(l,u,c[c.length-1]||void 0))&&(d=fp(n(l,c)),d[0]===hs))return d;if("children"in l&&l.children){const m=l;if(m.children&&d[0]!==cp)for(T=(r?m.children.length:-1)+a,y=c.concat(m);T>-1&&T<m.children.length;){const p=m.children[T];if(g=o(p,T,y)(),g[0]===hs)return g;T=typeof g[1]=="number"?g[1]:T+a}}return d}}}function fp(e){return Array.isArray(e)?e:typeof e=="number"?[up,e]:e==null?go:[e]}function dp(e,t,n){const i=or((n||{}).ignore||[]),s=hp(t);let a=-1;for(;++a<s.length;)yo(e,"text",o);function o(u,c){let f=-1,h;for(;++f<c.length;){const d=c[f],g=h?h.children:void 0;if(i(d,g?g.indexOf(d):void 0,h))return;h=d}if(h)return l(u,c)}function l(u,c){const f=c[c.length-1],h=s[a][0],d=s[a][1];let g=0;const y=f.children.indexOf(u);let m=!1,p=[];h.lastIndex=0;let b=h.exec(u.value);for(;b;){const S=b.index,v={index:b.index,input:b.input,stack:[...c,u]};let w=d(...b,v);if(typeof w=="string"&&(w=w.length>0?{type:"text",value:w}:void 0),w===!1?h.lastIndex=S+1:(g!==S&&p.push({type:"text",value:u.value.slice(g,S)}),Array.isArray(w)?p.push(...w):w&&p.push(w),g=S+b[0].length,m=!0),!h.global)break;b=h.exec(u.value)}return m?(g<u.value.length&&p.push({type:"text",value:u.value.slice(g)}),f.children.splice(y,1,...p)):p=[u],y+p.length}}function hp(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([pp(i[0]),mp(i[1])])}return t}function pp(e){return typeof e=="string"?new RegExp(rp(e),"g"):e}function mp(e){return typeof e=="function"?e:function(){return e}}const ps="phrasing",ms=["autolink","link","image","label"];function gp(){return{transforms:[kp],enter:{literalAutolink:bp,literalAutolinkEmail:gs,literalAutolinkHttp:gs,literalAutolinkWww:gs},exit:{literalAutolink:Tp,literalAutolinkEmail:vp,literalAutolinkHttp:wp,literalAutolinkWww:_p}}}function yp(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ps,notInConstruct:ms},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ps,notInConstruct:ms},{character:":",before:"[ps]",after:"\\/",inConstruct:ps,notInConstruct:ms}]}}function bp(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function gs(e){this.config.enter.autolinkProtocol.call(this,e)}function wp(e){this.config.exit.autolinkProtocol.call(this,e)}function _p(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function vp(e){this.config.exit.autolinkEmail.call(this,e)}function Tp(e){this.exit(e)}function kp(e){dp(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Ep],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Sp]],{ignore:["link","linkReference"]})}function Ep(e,t,n,r,i){let s="";if(!bo(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!xp(n)))return!1;const a=Pp(n+r);if(!a[0])return!1;const o={type:"link",title:null,url:s+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[o,{type:"text",value:a[1]}]:o}function Sp(e,t,n,r){return!bo(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function xp(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Pp(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=ar(e,"(");let s=ar(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function bo(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Yt(n)||rr(n))&&(!t||n!==47)}wo.peek=Ip;function Ap(){this.buffer()}function Dp(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function $p(){this.buffer()}function Cp(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Op(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=mt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Rp(e){this.exit(e)}function Np(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=mt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Mp(e){this.exit(e)}function Ip(){return"["}function wo(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),o(),a(),s+=i.move("]"),s}function Lp(){return{enter:{gfmFootnoteCallString:Ap,gfmFootnoteCall:Dp,gfmFootnoteDefinitionLabelString:$p,gfmFootnoteDefinition:Cp},exit:{gfmFootnoteCallString:Op,gfmFootnoteCall:Rp,gfmFootnoteDefinitionLabelString:Np,gfmFootnoteDefinition:Mp}}}function Fp(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:wo},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,a){const o=s.createTracker(a);let l=o.move("[^");const u=s.enter("footnoteDefinition"),c=s.enter("label");return l+=o.move(s.safe(s.associationId(r),{before:l,after:"]"})),c(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((t?`
|
|
4
|
+
`:" ")+s.indentLines(s.containerFlow(r,o.current()),t?_o:jp))),u(),l}}function jp(e,t,n){return t===0?e:_o(e,t,n)}function _o(e,t,n){return(n?"":" ")+e}const zp=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];vo.peek=Vp;function Up(){return{canContainEols:["delete"],enter:{strikethrough:Hp},exit:{strikethrough:Bp}}}function qp(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:zp}],handlers:{delete:vo}}}function Hp(e){this.enter({type:"delete",children:[]},e)}function Bp(e){this.exit(e)}function vo(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),s(),a}function Vp(){return"~"}function Wp(e){return e.length}function Yp(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Wp,s=[],a=[],o=[],l=[];let u=0,c=-1;for(;++c<e.length;){const T=[],y=[];let m=-1;for(e[c].length>u&&(u=e[c].length);++m<e[c].length;){const p=Gp(e[c][m]);if(n.alignDelimiters!==!1){const b=i(p);y[m]=b,(l[m]===void 0||b>l[m])&&(l[m]=b)}T.push(p)}a[c]=T,o[c]=y}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<u;)s[f]=To(r[f]);else{const T=To(r);for(;++f<u;)s[f]=T}f=-1;const h=[],d=[];for(;++f<u;){const T=s[f];let y="",m="";T===99?(y=":",m=":"):T===108?y=":":T===114&&(m=":");let p=n.alignDelimiters===!1?1:Math.max(1,l[f]-y.length-m.length);const b=y+"-".repeat(p)+m;n.alignDelimiters!==!1&&(p=y.length+p+m.length,p>l[f]&&(l[f]=p),d[f]=p),h[f]=b}a.splice(1,0,h),o.splice(1,0,d),c=-1;const g=[];for(;++c<a.length;){const T=a[c],y=o[c];f=-1;const m=[];for(;++f<u;){const p=T[f]||"";let b="",S="";if(n.alignDelimiters!==!1){const v=l[f]-(y[f]||0),w=s[f];w===114?b=" ".repeat(v):w===99?v%2?(b=" ".repeat(v/2+.5),S=" ".repeat(v/2-.5)):(b=" ".repeat(v/2),S=b):S=" ".repeat(v)}n.delimiterStart!==!1&&!f&&m.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&p==="")&&(n.delimiterStart!==!1||f)&&m.push(" "),n.alignDelimiters!==!1&&m.push(b),m.push(p),n.alignDelimiters!==!1&&m.push(S),n.padding!==!1&&m.push(" "),(n.delimiterEnd!==!1||f!==u-1)&&m.push("|")}g.push(n.delimiterEnd===!1?m.join("").replace(/ +$/,""):m.join(""))}return g.join(`
|
|
5
|
+
`)}function Gp(e){return e==null?"":String(e)}function To(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}const ko={}.hasOwnProperty;function Kp(e,t){const n=t||{};function r(i,...s){let a=r.invalid;const o=r.handlers;if(i&&ko.call(i,e)){const l=String(i[e]);a=ko.call(o,l)?o[l]:r.unknown}if(a)return a.call(this,i,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}function Zp(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const a=n.indentLines(n.containerFlow(e,s.current()),Jp);return i(),a}function Jp(e,t,n){return">"+(n?"":" ")+e}function Xp(e,t){return Eo(e,t.inConstruct,!0)&&!Eo(e,t.notInConstruct,!1)}function Eo(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function So(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
6
|
+
`&&Xp(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
7
|
+
`}function Qp(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>a&&(a=s):s=1,i=r+t.length,r=n.indexOf(t,i);return a}function em(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function tm(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function nm(e,t,n,r){const i=tm(n),s=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(em(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(s,rm);return f(),h}const o=n.createTracker(r),l=i.repeat(Math.max(Qp(s,i)+1,3)),u=n.enter("codeFenced");let c=o.move(l);if(e.lang){const f=n.enter(`codeFencedLang${a}`);c+=o.move(n.safe(e.lang,{before:c,after:" ",encode:["`"],...o.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${a}`);c+=o.move(" "),c+=o.move(n.safe(e.meta,{before:c,after:`
|
|
8
8
|
`,encode:["`"],...o.current()})),f()}return c+=o.move(`
|
|
9
9
|
`),s&&(c+=o.move(s+`
|
|
10
|
-
`)),c+=o.move(l),u(),c}function
|
|
11
|
-
`,...l.current()}))),o(),e.title&&(o=n.enter(`title${s}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),o()),a(),u}function
|
|
10
|
+
`)),c+=o.move(l),u(),c}function rm(e,t,n){return(n?"":" ")+e}function ys(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function im(e,t,n,r){const i=ys(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":`
|
|
11
|
+
`,...l.current()}))),o(),e.title&&(o=n.enter(`title${s}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),o()),a(),u}function sm(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Rn(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ur(e,t,n){const r=un(e),i=un(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}xo.peek=am;function xo(e,t,n,r){const i=sm(n),s=n.enter("emphasis"),a=n.createTracker(r),o=a.move(i);let l=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const u=l.charCodeAt(0),c=ur(r.before.charCodeAt(r.before.length-1),u,i);c.inside&&(l=Rn(u)+l.slice(1));const f=l.charCodeAt(l.length-1),h=ur(r.after.charCodeAt(0),f,i);h.inside&&(l=l.slice(0,-1)+Rn(f));const d=a.move(i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:c.outside},o+l+d}function am(e,t,n){return n.options.emphasis||"*"}function Po(e,t,n,r){let i,s,a;typeof t=="function"&&typeof n!="function"?(s=void 0,a=t,i=n):(s=t,a=n,i=r),yo(e,s,o,i);function o(l,u){const c=u[u.length-1],f=c?c.children.indexOf(l):void 0;return a(l,f,c)}}function om(e,t){let n=!1;return Po(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,hs}),!!((!e.depth||e.depth<3)&&as(e)&&(t.options.setext||n))}function lm(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(om(e,n)){const c=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:`
|
|
12
12
|
`,after:`
|
|
13
13
|
`});return f(),c(),h+`
|
|
14
14
|
`+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
15
15
|
`))+1))}const a="#".repeat(i),o=n.enter("headingAtx"),l=n.enter("phrasing");s.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
|
|
16
|
-
`,...s.current()});return/^[\t ]/.test(u)&&(u=
|
|
16
|
+
`,...s.current()});return/^[\t ]/.test(u)&&(u=Rn(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),l(),o(),u}Ao.peek=um;function Ao(e){return e.value||""}function um(){return"<"}Do.peek=cm;function Do(e,t,n,r){const i=ys(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(o=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=n.enter(`title${s}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),o()),u+=l.move(")"),a(),u}function cm(){return"!"}$o.peek=fm;function $o(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("![");const u=n.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const c=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=c,s(),i==="full"||!u||u!==f?l+=o.move(f+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function fm(){return"!"}Co.peek=dm;function Co(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const a=n.unsafe[s],o=n.compilePattern(a);let l;if(a.atBreak)for(;l=o.exec(r);){let u=l.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(l.index+1)}}return i+r+i}function dm(){return"`"}function Oo(e,t){const n=as(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Ro.peek=hm;function Ro(e,t,n,r){const i=ys(n),s=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,l;if(Oo(e,n)){const c=n.stack;n.stack=[],o=n.enter("autolink");let f=a.move("<");return f+=a.move(n.containerPhrasing(e,{before:f,after:">",...a.current()})),f+=a.move(">"),o(),n.stack=c,f}o=n.enter("link"),l=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(l=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=a.move(" "+i),u+=a.move(n.safe(e.title,{before:u,after:i,...a.current()})),u+=a.move(i),l()),u+=a.move(")"),o(),u}function hm(e,t,n){return Oo(e,n)?"<":"["}No.peek=pm;function No(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(u+"]["),a();const c=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=c,s(),i==="full"||!u||u!==f?l+=o.move(f+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function pm(){return"["}function bs(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function mm(e){const t=bs(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function gm(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Mo(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function ym(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let a=e.ordered?gm(n):bs(n);const o=e.ordered?a==="."?")":".":mm(n);let l=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const c=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&c&&(!c.children||!c.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),Mo(n)===a&&c){let f=-1;for(;++f<e.children.length;){const h=e.children[f];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(a=o),n.bulletCurrent=a;const u=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=s,i(),u}function bm(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function wm(e,t,n,r){const i=bm(n);let s=n.bulletCurrent||bs(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let a=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(s+" ".repeat(a-s.length)),o.shift(a);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,o.current()),c);return l(),u;function c(f,h,d){return h?(d?"":" ".repeat(a))+f:(d?s:s+" ".repeat(a-s.length))+f}}function _m(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(e,r);return s(),i(),a}const vm=or(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Tm(e,t,n,r){return(e.children.some(function(a){return vm(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function km(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Io.peek=Em;function Io(e,t,n,r){const i=km(n),s=n.enter("strong"),a=n.createTracker(r),o=a.move(i+i);let l=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const u=l.charCodeAt(0),c=ur(r.before.charCodeAt(r.before.length-1),u,i);c.inside&&(l=Rn(u)+l.slice(1));const f=l.charCodeAt(l.length-1),h=ur(r.after.charCodeAt(0),f,i);h.inside&&(l=l.slice(0,-1)+Rn(f));const d=a.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:c.outside},o+l+d}function Em(e,t,n){return n.options.strong||"*"}function Sm(e,t,n,r){return n.safe(e.value,r)}function xm(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Pm(e,t,n){const r=(Mo(n)+(n.options.ruleSpaces?" ":"")).repeat(xm(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Lo={blockquote:Zp,break:So,code:nm,definition:im,emphasis:xo,hardBreak:So,heading:lm,html:Ao,image:Do,imageReference:$o,inlineCode:Co,link:Ro,linkReference:No,list:ym,listItem:wm,paragraph:_m,root:Tm,strong:Io,text:Sm,thematicBreak:Pm};function Am(){return{enter:{table:Dm,tableData:Fo,tableHeader:Fo,tableRow:Cm},exit:{codeText:Om,table:$m,tableData:ws,tableHeader:ws,tableRow:ws}}}function Dm(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function $m(e){this.exit(e),this.data.inTable=void 0}function Cm(e){this.enter({type:"tableRow",children:[]},e)}function ws(e){this.exit(e)}function Fo(e){this.enter({type:"tableCell",children:[]},e)}function Om(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Rm));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Rm(e,t){return t==="|"?t:e}function Nm(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
17
17
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:a,tableCell:l,tableRow:o}};function a(d,g,T,y){return u(c(d,T,y),d.align)}function o(d,g,T,y){const m=f(d,T,y),p=u([m]);return p.slice(0,p.indexOf(`
|
|
18
|
-
`))}function l(d,g,T,y){const m=T.enter("tableCell"),p=T.enter("phrasing"),b=T.containerPhrasing(d,{...y,before:s,after:s});return p(),m(),b}function u(d,g){return Wp(d,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function c(d,g,T){const y=d.children;let m=-1;const p=[],b=g.enter("table");for(;++m<y.length;)p[m]=f(y[m],g,T);return b(),p}function f(d,g,T){const y=d.children;let m=-1;const p=[],b=g.enter("tableRow");for(;++m<y.length;)p[m]=l(y[m],d,g,T);return b(),p}function h(d,g,T){let y=Io.inlineCode(d,g,T);return T.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function Nm(){return{exit:{taskListCheckValueChecked:Fo,taskListCheckValueUnchecked:Fo,paragraph:Im}}}function Mm(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Lm}}}function Fo(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Im(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,a;for(;++s<i.length;){const o=i[s];if(o.type==="paragraph"){a=o;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Lm(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);s&&o.move(a);let l=Io.listItem(e,t,n,{...r,...o.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(c){return c+a}}function Fm(){return[mp(),Ip(),zp(),Pm(),Nm()]}function jm(e){return{extensions:[gp(),Lp(e),Up(),Rm(e),Mm()]}}const zm={tokenize:Wm,partial:!0},jo={tokenize:Ym,partial:!0},zo={tokenize:Gm,partial:!0},Uo={tokenize:Km,partial:!0},Um={tokenize:Zm,partial:!0},qo={name:"wwwAutolink",tokenize:Bm,previous:Bo},Ho={name:"protocolAutolink",tokenize:Vm,previous:Vo},Dt={name:"emailAutolink",tokenize:Hm,previous:Wo},Tt={};function qm(){return{text:Tt}}let Yt=48;for(;Yt<123;)Tt[Yt]=Dt,Yt++,Yt===58?Yt=65:Yt===91&&(Yt=97);Tt[43]=Dt,Tt[45]=Dt,Tt[46]=Dt,Tt[95]=Dt,Tt[72]=[Dt,Ho],Tt[104]=[Dt,Ho],Tt[87]=[Dt,qo],Tt[119]=[Dt,qo];function Hm(e,t,n){const r=this;let i,s;return a;function a(f){return!_s(f)||!Wo.call(r,r.previous)||vs(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(f))}function o(f){return _s(f)?(e.consume(f),o):f===64?(e.consume(f),l):n(f)}function l(f){return f===46?e.check(Um,c,u)(f):f===45||f===95||ze(f)?(s=!0,e.consume(f),l):c(f)}function u(f){return e.consume(f),i=!0,l}function c(f){return s&&i&&He(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function Bm(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!Bo.call(r,r.previous)||vs(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(zm,e.attempt(jo,e.attempt(zo,s),n),n)(a))}function s(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function Vm(e,t,n){const r=this;let i="",s=!1;return a;function a(f){return(f===72||f===104)&&Vo.call(r,r.previous)&&!vs(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),o):n(f)}function o(f){if(He(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),o;if(f===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(f),l}return n(f)}function l(f){return f===47?(e.consume(f),s?u:(s=!0,l)):n(f)}function u(f){return f===null||er(f)||we(f)||Wt(f)||tr(f)?n(f):e.attempt(jo,e.attempt(zo,c),n)(f)}function c(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function Wm(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),s):n(a)}function s(a){return a===null?n(a):t(a)}}function Ym(e,t,n){let r,i,s;return a;function a(u){return u===46||u===95?e.check(Uo,l,o)(u):u===null||we(u)||Wt(u)||u!==45&&tr(u)?l(u):(s=!0,e.consume(u),a)}function o(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),a}function l(u){return i||r||!s?n(u):t(u)}}function Gm(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?s(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(Uo,t,s)(a):a===null||we(a)||Wt(a)?t(a):(e.consume(a),i)}function s(a){return a===41&&r++,e.consume(a),i}}function Km(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),s):o===93?(e.consume(o),i):o===60||o===null||we(o)||Wt(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||we(o)||Wt(o)?t(o):r(o)}function s(o){return He(o)?a(o):n(o)}function a(o){return o===59?(e.consume(o),r):He(o)?(e.consume(o),a):n(o)}}function Zm(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return ze(s)?n(s):t(s)}}function Bo(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||we(e)}function Vo(e){return!He(e)}function Wo(e){return!(e===47||_s(e))}function _s(e){return e===43||e===45||e===46||e===95||ze(e)}function vs(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Jm={tokenize:sg,partial:!0};function Xm(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:ng,continuation:{tokenize:rg},exit:ig}},text:{91:{name:"gfmFootnoteCall",tokenize:tg},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Qm,resolveTo:eg}}}}function Qm(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!a||!a._balanced)return n(l);const u=mt(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function eg(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function tg(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,a;return o;function o(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(s>999||f===93&&!a||f===null||f===91||we(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(mt(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return we(f)||(a=!0),s++,e.consume(f),f===92?c:u}function c(f){return f===91||f===92||f===93?(e.consume(f),s++,u):u(f)}}function ng(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,a=0,o;return l;function l(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(g)}function c(g){if(a>999||g===93&&!o||g===null||g===91||we(g))return n(g);if(g===93){e.exit("chunkString");const T=e.exit("gfmFootnoteDefinitionLabelString");return s=mt(r.sliceSerialize(T)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return we(g)||(o=!0),a++,e.consume(g),g===92?f:c}function f(g){return g===91||g===92||g===93?(e.consume(g),a++,c):c(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(s)||i.push(s),pe(e,d,"gfmFootnoteDefinitionWhitespace")):n(g)}function d(g){return t(g)}}function rg(e,t,n){return e.check(Dn,t,e.attempt(Jm,t,n))}function ig(e){e.exit("gfmFootnoteDefinition")}function sg(e,t,n){const r=this;return pe(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(s):n(s)}}function ag(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,o){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let u=l;for(;u--;)if(a[u][0]==="exit"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[u][1].end.offset-a[u][1].start.offset){a[l][1].type="strikethroughSequence",a[u][1].type="strikethroughSequence";const c={type:"strikethrough",start:Object.assign({},a[u][1].start),end:Object.assign({},a[l][1].end)},f={type:"strikethroughText",start:Object.assign({},a[u][1].end),end:Object.assign({},a[l][1].start)},h=[["enter",c,o],["enter",a[u][1],o],["exit",a[u][1],o],["enter",f,o]],d=o.parser.constructs.insideSpan.null;d&&it(h,h.length,0,nr(d,a.slice(u+1,l),o)),it(h,h.length,0,[["exit",f,o],["enter",a[l][1],o],["exit",a[l][1],o],["exit",c,o]]),it(a,u-1,l-u+3,h),l=u+h.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function s(a,o,l){const u=this.previous,c=this.events;let f=0;return h;function h(g){return u===126&&c[c.length-1][1].type!=="characterEscape"?l(g):(a.enter("strikethroughSequenceTemporary"),d(g))}function d(g){const T=ln(u);if(g===126)return f>1?l(g):(a.consume(g),f++,d);if(f<2&&!n)return l(g);const y=a.exit("strikethroughSequenceTemporary"),m=ln(g);return y._open=!m||m===2&&!!T,y._close=!T||T===2&&!!m,o(g)}}}class og{constructor(){this.map=[]}add(t,n,r){lg(this,t,n,r)}consume(t){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function lg(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function ug(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function cg(){return{flow:{null:{name:"table",tokenize:fg,resolveAll:dg}}}}function fg(e,t,n){const r=this;let i=0,s=0,a;return o;function o(A){let O=r.events.length-1;for(;O>-1;){const H=r.events[O][1].type;if(H==="lineEnding"||H==="linePrefix")O--;else break}const U=O>-1?r.events[O][1].type:null,K=U==="tableHead"||U==="tableRow"?w:l;return K===w&&r.parser.lazy[r.now().line]?n(A):K(A)}function l(A){return e.enter("tableHead"),e.enter("tableRow"),u(A)}function u(A){return A===124||(a=!0,s+=1),c(A)}function c(A){return A===null?n(A):ie(A)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),d):n(A):de(A)?pe(e,c,"whitespace")(A):(s+=1,a&&(a=!1,i+=1),A===124?(e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),a=!0,c):(e.enter("data"),f(A)))}function f(A){return A===null||A===124||we(A)?(e.exit("data"),c(A)):(e.consume(A),A===92?h:f)}function h(A){return A===92||A===124?(e.consume(A),f):f(A)}function d(A){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(A):(e.enter("tableDelimiterRow"),a=!1,de(A)?pe(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):g(A))}function g(A){return A===45||A===58?y(A):A===124?(a=!0,e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),T):v(A)}function T(A){return de(A)?pe(e,y,"whitespace")(A):y(A)}function y(A){return A===58?(s+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(A),e.exit("tableDelimiterMarker"),m):A===45?(s+=1,m(A)):A===null||ie(A)?S(A):v(A)}function m(A){return A===45?(e.enter("tableDelimiterFiller"),p(A)):v(A)}function p(A){return A===45?(e.consume(A),p):A===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(A),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(A))}function b(A){return de(A)?pe(e,S,"whitespace")(A):S(A)}function S(A){return A===124?g(A):A===null||ie(A)?!a||i!==s?v(A):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(A)):v(A)}function v(A){return n(A)}function w(A){return e.enter("tableRow"),x(A)}function x(A){return A===124?(e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),x):A===null||ie(A)?(e.exit("tableRow"),t(A)):de(A)?pe(e,x,"whitespace")(A):(e.enter("data"),N(A))}function N(A){return A===null||A===124||we(A)?(e.exit("data"),x(A)):(e.consume(A),A===92?F:N)}function F(A){return A===92||A===124?(e.consume(A),N):N(A)}}function dg(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,u,c,f;const h=new og;for(;++n<e.length;){const d=e[n],g=d[1];d[0]==="enter"?g.type==="tableHead"?(o=!1,l!==0&&(Yo(h,t,l,u,c),c=void 0,l=0),u={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",u,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,f=void 0,s=[0,0,0,0],a=[0,n+1,0,0],o&&(o=!1,c={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",c,t]])),i=g.type==="tableDelimiterRow"?2:c?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(s[1]!==0&&(a[0]=a[1],f=lr(h,t,s,i,void 0,f),s=[0,0,0,0]),a[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(a[0]=a[1],f=lr(h,t,s,i,void 0,f)),s=a,a=[s[1],n,0,0])):g.type==="tableHead"?(o=!0,l=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(l=n,s[1]!==0?(a[0]=a[1],f=lr(h,t,s,i,n,f)):a[1]!==0&&(f=lr(h,t,a,i,n,f)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&Yo(h,t,l,u,c),h.consume(t.events),n=-1;++n<t.events.length;){const d=t.events[n];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=ug(t.events,n))}return e}function lr(e,t,n,r,i,s){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(s.end=Object.assign({},un(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=un(t.events,n[1]);if(s={type:a,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const u=un(t.events,n[2]),c=un(t.events,n[3]),f={type:o,start:Object.assign({},u),end:Object.assign({},c)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const h=t.events[n[2]],d=t.events[n[3]];if(h[1].end=Object.assign({},d[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,T=n[3]-n[2]-1;e.add(g,T,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(s.end=Object.assign({},un(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function Yo(e,t,n,r,i){const s=[],a=un(t.events,n);i&&(i.end=Object.assign({},a),s.push(["exit",i,t])),r.end=Object.assign({},a),s.push(["exit",r,t]),e.add(n+1,0,s)}function un(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const hg={name:"tasklistCheck",tokenize:mg};function pg(){return{text:{91:hg}}}function mg(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return we(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(l)}function o(l){return ie(l)?t(l):de(l)?e.check({tokenize:gg},t,n)(l):n(l)}}function gg(e,t,n){return pe(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function yg(e){return Ya([qm(),Xm(),ag(e),cg(),pg()])}const bg={};function wg(e){const t=this,n=e||bg,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(yg(n)),s.push(Fm()),a.push(jm(n))}function _g(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function vg(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
19
|
-
`}]}function
|
|
20
|
-
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function
|
|
18
|
+
`))}function l(d,g,T,y){const m=T.enter("tableCell"),p=T.enter("phrasing"),b=T.containerPhrasing(d,{...y,before:s,after:s});return p(),m(),b}function u(d,g){return Yp(d,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function c(d,g,T){const y=d.children;let m=-1;const p=[],b=g.enter("table");for(;++m<y.length;)p[m]=f(y[m],g,T);return b(),p}function f(d,g,T){const y=d.children;let m=-1;const p=[],b=g.enter("tableRow");for(;++m<y.length;)p[m]=l(y[m],d,g,T);return b(),p}function h(d,g,T){let y=Lo.inlineCode(d,g,T);return T.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function Mm(){return{exit:{taskListCheckValueChecked:jo,taskListCheckValueUnchecked:jo,paragraph:Lm}}}function Im(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Fm}}}function jo(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Lm(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,a;for(;++s<i.length;){const o=i[s];if(o.type==="paragraph"){a=o;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Fm(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);s&&o.move(a);let l=Lo.listItem(e,t,n,{...r,...o.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(c){return c+a}}function jm(){return[gp(),Lp(),Up(),Am(),Mm()]}function zm(e){return{extensions:[yp(),Fp(e),qp(),Nm(e),Im()]}}const Um={tokenize:Ym,partial:!0},zo={tokenize:Gm,partial:!0},Uo={tokenize:Km,partial:!0},qo={tokenize:Zm,partial:!0},qm={tokenize:Jm,partial:!0},Ho={name:"wwwAutolink",tokenize:Vm,previous:Vo},Bo={name:"protocolAutolink",tokenize:Wm,previous:Wo},$t={name:"emailAutolink",tokenize:Bm,previous:Yo},Et={};function Hm(){return{text:Et}}let Gt=48;for(;Gt<123;)Et[Gt]=$t,Gt++,Gt===58?Gt=65:Gt===91&&(Gt=97);Et[43]=$t,Et[45]=$t,Et[46]=$t,Et[95]=$t,Et[72]=[$t,Bo],Et[104]=[$t,Bo],Et[87]=[$t,Ho],Et[119]=[$t,Ho];function Bm(e,t,n){const r=this;let i,s;return a;function a(f){return!_s(f)||!Yo.call(r,r.previous)||vs(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(f))}function o(f){return _s(f)?(e.consume(f),o):f===64?(e.consume(f),l):n(f)}function l(f){return f===46?e.check(qm,c,u)(f):f===45||f===95||ze(f)?(s=!0,e.consume(f),l):c(f)}function u(f){return e.consume(f),i=!0,l}function c(f){return s&&i&&Be(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function Vm(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!Vo.call(r,r.previous)||vs(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Um,e.attempt(zo,e.attempt(Uo,s),n),n)(a))}function s(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function Wm(e,t,n){const r=this;let i="",s=!1;return a;function a(f){return(f===72||f===104)&&Wo.call(r,r.previous)&&!vs(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),o):n(f)}function o(f){if(Be(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),o;if(f===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(f),l}return n(f)}function l(f){return f===47?(e.consume(f),s?u:(s=!0,l)):n(f)}function u(f){return f===null||nr(f)||we(f)||Yt(f)||rr(f)?n(f):e.attempt(zo,e.attempt(Uo,c),n)(f)}function c(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function Ym(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),s):n(a)}function s(a){return a===null?n(a):t(a)}}function Gm(e,t,n){let r,i,s;return a;function a(u){return u===46||u===95?e.check(qo,l,o)(u):u===null||we(u)||Yt(u)||u!==45&&rr(u)?l(u):(s=!0,e.consume(u),a)}function o(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),a}function l(u){return i||r||!s?n(u):t(u)}}function Km(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?s(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(qo,t,s)(a):a===null||we(a)||Yt(a)?t(a):(e.consume(a),i)}function s(a){return a===41&&r++,e.consume(a),i}}function Zm(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),s):o===93?(e.consume(o),i):o===60||o===null||we(o)||Yt(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||we(o)||Yt(o)?t(o):r(o)}function s(o){return Be(o)?a(o):n(o)}function a(o){return o===59?(e.consume(o),r):Be(o)?(e.consume(o),a):n(o)}}function Jm(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return ze(s)?n(s):t(s)}}function Vo(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||we(e)}function Wo(e){return!Be(e)}function Yo(e){return!(e===47||_s(e))}function _s(e){return e===43||e===45||e===46||e===95||ze(e)}function vs(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Xm={tokenize:ag,partial:!0};function Qm(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:rg,continuation:{tokenize:ig},exit:sg}},text:{91:{name:"gfmFootnoteCall",tokenize:ng},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:eg,resolveTo:tg}}}}function eg(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!a||!a._balanced)return n(l);const u=mt(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function tg(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function ng(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,a;return o;function o(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(s>999||f===93&&!a||f===null||f===91||we(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(mt(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return we(f)||(a=!0),s++,e.consume(f),f===92?c:u}function c(f){return f===91||f===92||f===93?(e.consume(f),s++,u):u(f)}}function rg(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,a=0,o;return l;function l(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(g)}function c(g){if(a>999||g===93&&!o||g===null||g===91||we(g))return n(g);if(g===93){e.exit("chunkString");const T=e.exit("gfmFootnoteDefinitionLabelString");return s=mt(r.sliceSerialize(T)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return we(g)||(o=!0),a++,e.consume(g),g===92?f:c}function f(g){return g===91||g===92||g===93?(e.consume(g),a++,c):c(g)}function h(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(s)||i.push(s),pe(e,d,"gfmFootnoteDefinitionWhitespace")):n(g)}function d(g){return t(g)}}function ig(e,t,n){return e.check($n,t,e.attempt(Xm,t,n))}function sg(e){e.exit("gfmFootnoteDefinition")}function ag(e,t,n){const r=this;return pe(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(s):n(s)}}function og(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,o){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let u=l;for(;u--;)if(a[u][0]==="exit"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[u][1].end.offset-a[u][1].start.offset){a[l][1].type="strikethroughSequence",a[u][1].type="strikethroughSequence";const c={type:"strikethrough",start:Object.assign({},a[u][1].start),end:Object.assign({},a[l][1].end)},f={type:"strikethroughText",start:Object.assign({},a[u][1].end),end:Object.assign({},a[l][1].start)},h=[["enter",c,o],["enter",a[u][1],o],["exit",a[u][1],o],["enter",f,o]],d=o.parser.constructs.insideSpan.null;d&&it(h,h.length,0,ir(d,a.slice(u+1,l),o)),it(h,h.length,0,[["exit",f,o],["enter",a[l][1],o],["exit",a[l][1],o],["exit",c,o]]),it(a,u-1,l-u+3,h),l=u+h.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function s(a,o,l){const u=this.previous,c=this.events;let f=0;return h;function h(g){return u===126&&c[c.length-1][1].type!=="characterEscape"?l(g):(a.enter("strikethroughSequenceTemporary"),d(g))}function d(g){const T=un(u);if(g===126)return f>1?l(g):(a.consume(g),f++,d);if(f<2&&!n)return l(g);const y=a.exit("strikethroughSequenceTemporary"),m=un(g);return y._open=!m||m===2&&!!T,y._close=!T||T===2&&!!m,o(g)}}}class lg{constructor(){this.map=[]}add(t,n,r){ug(this,t,n,r)}consume(t){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function ug(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function cg(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function fg(){return{flow:{null:{name:"table",tokenize:dg,resolveAll:hg}}}}function dg(e,t,n){const r=this;let i=0,s=0,a;return o;function o(A){let O=r.events.length-1;for(;O>-1;){const H=r.events[O][1].type;if(H==="lineEnding"||H==="linePrefix")O--;else break}const U=O>-1?r.events[O][1].type:null,K=U==="tableHead"||U==="tableRow"?w:l;return K===w&&r.parser.lazy[r.now().line]?n(A):K(A)}function l(A){return e.enter("tableHead"),e.enter("tableRow"),u(A)}function u(A){return A===124||(a=!0,s+=1),c(A)}function c(A){return A===null?n(A):ie(A)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),d):n(A):de(A)?pe(e,c,"whitespace")(A):(s+=1,a&&(a=!1,i+=1),A===124?(e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),a=!0,c):(e.enter("data"),f(A)))}function f(A){return A===null||A===124||we(A)?(e.exit("data"),c(A)):(e.consume(A),A===92?h:f)}function h(A){return A===92||A===124?(e.consume(A),f):f(A)}function d(A){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(A):(e.enter("tableDelimiterRow"),a=!1,de(A)?pe(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):g(A))}function g(A){return A===45||A===58?y(A):A===124?(a=!0,e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),T):v(A)}function T(A){return de(A)?pe(e,y,"whitespace")(A):y(A)}function y(A){return A===58?(s+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(A),e.exit("tableDelimiterMarker"),m):A===45?(s+=1,m(A)):A===null||ie(A)?S(A):v(A)}function m(A){return A===45?(e.enter("tableDelimiterFiller"),p(A)):v(A)}function p(A){return A===45?(e.consume(A),p):A===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(A),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(A))}function b(A){return de(A)?pe(e,S,"whitespace")(A):S(A)}function S(A){return A===124?g(A):A===null||ie(A)?!a||i!==s?v(A):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(A)):v(A)}function v(A){return n(A)}function w(A){return e.enter("tableRow"),x(A)}function x(A){return A===124?(e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),x):A===null||ie(A)?(e.exit("tableRow"),t(A)):de(A)?pe(e,x,"whitespace")(A):(e.enter("data"),N(A))}function N(A){return A===null||A===124||we(A)?(e.exit("data"),x(A)):(e.consume(A),A===92?F:N)}function F(A){return A===92||A===124?(e.consume(A),N):N(A)}}function hg(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,u,c,f;const h=new lg;for(;++n<e.length;){const d=e[n],g=d[1];d[0]==="enter"?g.type==="tableHead"?(o=!1,l!==0&&(Go(h,t,l,u,c),c=void 0,l=0),u={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",u,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,f=void 0,s=[0,0,0,0],a=[0,n+1,0,0],o&&(o=!1,c={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",c,t]])),i=g.type==="tableDelimiterRow"?2:c?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(s[1]!==0&&(a[0]=a[1],f=cr(h,t,s,i,void 0,f),s=[0,0,0,0]),a[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(a[0]=a[1],f=cr(h,t,s,i,void 0,f)),s=a,a=[s[1],n,0,0])):g.type==="tableHead"?(o=!0,l=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(l=n,s[1]!==0?(a[0]=a[1],f=cr(h,t,s,i,n,f)):a[1]!==0&&(f=cr(h,t,a,i,n,f)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&Go(h,t,l,u,c),h.consume(t.events),n=-1;++n<t.events.length;){const d=t.events[n];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=cg(t.events,n))}return e}function cr(e,t,n,r,i,s){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(s.end=Object.assign({},cn(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=cn(t.events,n[1]);if(s={type:a,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const u=cn(t.events,n[2]),c=cn(t.events,n[3]),f={type:o,start:Object.assign({},u),end:Object.assign({},c)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const h=t.events[n[2]],d=t.events[n[3]];if(h[1].end=Object.assign({},d[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,T=n[3]-n[2]-1;e.add(g,T,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(s.end=Object.assign({},cn(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function Go(e,t,n,r,i){const s=[],a=cn(t.events,n);i&&(i.end=Object.assign({},a),s.push(["exit",i,t])),r.end=Object.assign({},a),s.push(["exit",r,t]),e.add(n+1,0,s)}function cn(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const pg={name:"tasklistCheck",tokenize:gg};function mg(){return{text:{91:pg}}}function gg(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return we(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(l)}function o(l){return ie(l)?t(l):de(l)?e.check({tokenize:yg},t,n)(l):n(l)}}function yg(e,t,n){return pe(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function bg(e){return Ga([Hm(),Qm(),og(e),fg(),mg()])}const wg={};function _g(e){const t=this,n=e||wg,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(bg(n)),s.push(jm()),a.push(zm(n))}function vg(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Tg(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
19
|
+
`}]}function kg(e,t){const n=t.value?t.value+`
|
|
20
|
+
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function Eg(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Sg(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function xg(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=ln(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=s+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function Pg(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ag(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Ko(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function Dg(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ko(e,t);const i={src:ln(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function $g(e,t){const n={src:ln(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Cg(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Og(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ko(e,t);const i={href:ln(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function Rg(e,t){const n={href:ln(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Ng(e,t,n){const r=e.all(t),i=n?Mg(n):Zo(t),s={},a=[];if(typeof t.checked=="boolean"){const c=r[0];let f;c&&c.type==="element"&&c.tagName==="p"?f=c:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const c=r[o];(i||o!==0||c.type!=="element"||c.tagName!=="p")&&a.push({type:"text",value:`
|
|
21
21
|
`}),c.type==="element"&&c.tagName==="p"&&!i?a.push(...c.children):a.push(c)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&a.push({type:"text",value:`
|
|
22
|
-
`});const u={type:"element",tagName:"li",properties:s,children:a};return e.patch(t,u),e.applyData(t,u)}function
|
|
22
|
+
`});const u={type:"element",tagName:"li",properties:s,children:a};return e.patch(t,u),e.applyData(t,u)}function Mg(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Zo(n[r])}return t}function Zo(e){const t=e.spread;return t??e.children.length>1}function Ig(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function Lg(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Fg(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function jg(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Jo=Qo("end"),Xo=Qo("start");function Qo(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function zg(e){const t=Xo(e),n=Jo(e);if(t&&n)return{start:t,end:n}}function Ug(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=Xo(t.children[1]),l=Jo(t.children[t.children.length-1]);o&&l&&(a.position={start:o,end:l}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function qg(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:t.children.length;let l=-1;const u=[];for(;++l<o;){const f=t.children[l],h={},d=a?a[l]:void 0;d&&(h.align=d);let g={type:"element",tagName:s,properties:h,children:[]};f&&(g.children=e.all(f),e.patch(f,g),g=e.applyData(f,g)),u.push(g)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,c),e.applyData(t,c)}function Hg(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const el=9,tl=32;function Bg(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(nl(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(nl(t.slice(i),i>0,!1)),s.join("")}function nl(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===el||s===tl;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===el||s===tl;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Vg(e,t){const n={type:"text",value:Bg(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Wg(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Yg={blockquote:vg,break:Tg,code:kg,delete:Eg,emphasis:Sg,footnoteReference:xg,heading:Pg,html:Ag,imageReference:Dg,image:$g,inlineCode:Cg,linkReference:Og,link:Rg,listItem:Ng,list:Ig,paragraph:Lg,root:Fg,strong:jg,table:Ug,tableCell:Hg,tableRow:qg,text:Vg,thematicBreak:Wg,toml:fr,yaml:fr,definition:fr,footnoteDefinition:fr};function fr(){}const rl=-1,dr=0,Nn=1,hr=2,Ts=3,ks=4,Es=5,Ss=6,il=7,sl=8,al=typeof self=="object"?self:globalThis,Gg=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,a]=t[i];switch(s){case dr:case rl:return n(a,i);case Nn:{const o=n([],i);for(const l of a)o.push(r(l));return o}case hr:{const o=n({},i);for(const[l,u]of a)o[r(l)]=r(u);return o}case Ts:return n(new Date(a),i);case ks:{const{source:o,flags:l}=a;return n(new RegExp(o,l),i)}case Es:{const o=n(new Map,i);for(const[l,u]of a)o.set(r(l),r(u));return o}case Ss:{const o=n(new Set,i);for(const l of a)o.add(r(l));return o}case il:{const{name:o,message:l}=a;return n(new al[o](l),i)}case sl:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}}return n(new al[s](a),i)};return r},ol=e=>Gg(new Map,e)(0),fn="",{toString:Kg}={},{keys:Zg}=Object,Mn=e=>{const t=typeof e;if(t!=="object"||!e)return[dr,t];const n=Kg.call(e).slice(8,-1);switch(n){case"Array":return[Nn,fn];case"Object":return[hr,fn];case"Date":return[Ts,fn];case"RegExp":return[ks,fn];case"Map":return[Es,fn];case"Set":return[Ss,fn];case"DataView":return[Nn,n]}return n.includes("Array")?[Nn,n]:n.includes("Error")?[il,n]:[hr,n]},pr=([e,t])=>e===dr&&(t==="function"||t==="symbol"),Jg=(e,t,n,r)=>{const i=(a,o)=>{const l=r.push(a)-1;return n.set(o,l),l},s=a=>{if(n.has(a))return n.get(a);let[o,l]=Mn(a);switch(o){case dr:{let c=a;switch(l){case"bigint":o=sl,c=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);c=null;break;case"undefined":return i([rl],a)}return i([o,c],a)}case Nn:{if(l){let h=a;return l==="DataView"?h=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(a)),i([l,[...h]],a)}const c=[],f=i([o,c],a);for(const h of a)c.push(s(h));return f}case hr:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(t&&"toJSON"in a)return s(a.toJSON());const c=[],f=i([o,c],a);for(const h of Zg(a))(e||!pr(Mn(a[h])))&&c.push([s(h),s(a[h])]);return f}case Ts:return i([o,a.toISOString()],a);case ks:{const{source:c,flags:f}=a;return i([o,{source:c,flags:f}],a)}case Es:{const c=[],f=i([o,c],a);for(const[h,d]of a)(e||!(pr(Mn(h))||pr(Mn(d))))&&c.push([s(h),s(d)]);return f}case Ss:{const c=[],f=i([o,c],a);for(const h of a)(e||!pr(Mn(h)))&&c.push(s(h));return f}}const{message:u}=a;return i([o,{name:l,message:u}],a)};return s},ll=(e,{json:t,lossy:n}={})=>{const r=[];return Jg(!(t||n),!!t,new Map,r)(e),r},mr=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ol(ll(e,t)):structuredClone(e):(e,t)=>ol(ll(e,t));function Xg(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Qg(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function ey(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Xg,r=e.options.footnoteBackLabel||Qg,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const c=e.all(u),f=String(u.identifier).toUpperCase(),h=ln(f.toLowerCase());let d=0;const g=[],T=e.footnoteCounts.get(f);for(;T!==void 0&&++d<=T;){g.length>0&&g.push({type:"text",value:" "});let p=typeof n=="string"?n:n(l,d);typeof p=="string"&&(p={type:"text",value:p}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(p)?p:[p]})}const y=c[c.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const p=y.children[y.children.length-1];p&&p.type==="text"?p.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...g)}else c.push(...g);const m={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(c,!0)};e.patch(u,m),o.push(m)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...mr(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
23
23
|
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
|
|
24
|
-
`}]}}const xs={}.hasOwnProperty,
|
|
24
|
+
`}]}}const xs={}.hasOwnProperty,ty={};function ny(e,t){const n=t||ty,r=new Map,i=new Map,s=new Map,a={...Yg,...n.handlers},o={all:u,applyData:iy,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:l,options:n,patch:ry,wrap:ay};return Po(e,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){const f=c.type==="definition"?r:i,h=String(c.identifier).toUpperCase();f.has(h)||f.set(h,c)}}),o;function l(c,f){const h=c.type,d=o.handlers[h];if(xs.call(o.handlers,h)&&d)return d(o,c,f);if(o.options.passThrough&&o.options.passThrough.includes(h)){if("children"in c){const{children:T,...y}=c,m=mr(y);return m.children=o.all(c),m}return mr(c)}return(o.options.unknownHandler||sy)(o,c,f)}function u(c){const f=[];if("children"in c){const h=c.children;let d=-1;for(;++d<h.length;){const g=o.one(h[d],c);if(g){if(d&&h[d-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=ul(g.value)),!Array.isArray(g)&&g.type==="element")){const T=g.children[0];T&&T.type==="text"&&(T.value=ul(T.value))}Array.isArray(g)?f.push(...g):f.push(g)}}}return f}}function ry(e,t){e.position&&(t.position=zg(e))}function iy(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&s&&Object.assign(n.properties,mr(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function sy(e,t){const n=t.data||{},r="value"in t&&!(xs.call(n,"hProperties")||xs.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ay(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
25
25
|
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
26
26
|
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
27
|
-
`}),n}function
|
|
28
|
-
`},i),s}function ay(e,t){return e&&"run"in e?async function(n,r){const i=ul(n,{file:r,...t});await e.run(i,r)}:function(n,r){return ul(n,{file:r,...e||t})}}const oy=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Mn{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Mn.prototype.normal={},Mn.prototype.property={},Mn.prototype.space=void 0;function cl(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Mn(n,r,t)}function Ps(e){return e.toLowerCase()}class tt{constructor(t,n){this.attribute=n,this.property=t}}tt.prototype.attribute="",tt.prototype.booleanish=!1,tt.prototype.boolean=!1,tt.prototype.commaOrSpaceSeparated=!1,tt.prototype.commaSeparated=!1,tt.prototype.defined=!1,tt.prototype.mustUseProperty=!1,tt.prototype.number=!1,tt.prototype.overloadedBoolean=!1,tt.prototype.property="",tt.prototype.spaceSeparated=!1,tt.prototype.space=void 0;let ly=0;const le=Gt(),Ce=Gt(),As=Gt(),W=Gt(),_e=Gt(),fn=Gt(),st=Gt();function Gt(){return 2**++ly}const Ds=Object.freeze(Object.defineProperty({__proto__:null,boolean:le,booleanish:Ce,commaOrSpaceSeparated:st,commaSeparated:fn,number:W,overloadedBoolean:As,spaceSeparated:_e},Symbol.toStringTag,{value:"Module"})),$s=Object.keys(Ds);class Cs extends tt{constructor(t,n,r,i){let s=-1;if(super(t,n),fl(this,"space",i),typeof r=="number")for(;++s<$s.length;){const a=$s[s];fl(this,$s[s],(r&Ds[a])===Ds[a])}}}Cs.prototype.defined=!0;function fl(e,t,n){n&&(e[t]=n)}function dn(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new Cs(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Ps(r)]=r,n[Ps(s.attribute)]=r}return new Mn(t,n,e.space)}const dl=dn({properties:{ariaActiveDescendant:null,ariaAtomic:Ce,ariaAutoComplete:null,ariaBusy:Ce,ariaChecked:Ce,ariaColCount:W,ariaColIndex:W,ariaColSpan:W,ariaControls:_e,ariaCurrent:null,ariaDescribedBy:_e,ariaDetails:null,ariaDisabled:Ce,ariaDropEffect:_e,ariaErrorMessage:null,ariaExpanded:Ce,ariaFlowTo:_e,ariaGrabbed:Ce,ariaHasPopup:null,ariaHidden:Ce,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:_e,ariaLevel:W,ariaLive:null,ariaModal:Ce,ariaMultiLine:Ce,ariaMultiSelectable:Ce,ariaOrientation:null,ariaOwns:_e,ariaPlaceholder:null,ariaPosInSet:W,ariaPressed:Ce,ariaReadOnly:Ce,ariaRelevant:null,ariaRequired:Ce,ariaRoleDescription:_e,ariaRowCount:W,ariaRowIndex:W,ariaRowSpan:W,ariaSelected:Ce,ariaSetSize:W,ariaSort:null,ariaValueMax:W,ariaValueMin:W,ariaValueNow:W,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function hl(e,t){return t in e?e[t]:t}function pl(e,t){return hl(e,t.toLowerCase())}const uy=dn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:fn,acceptCharset:_e,accessKey:_e,action:null,allow:null,allowFullScreen:le,allowPaymentRequest:le,allowUserMedia:le,alt:null,as:null,async:le,autoCapitalize:null,autoComplete:_e,autoFocus:le,autoPlay:le,blocking:_e,capture:null,charSet:null,checked:le,cite:null,className:_e,cols:W,colSpan:null,content:null,contentEditable:Ce,controls:le,controlsList:_e,coords:W|fn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:le,defer:le,dir:null,dirName:null,disabled:le,download:As,draggable:Ce,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:le,formTarget:null,headers:_e,height:W,hidden:As,high:W,href:null,hrefLang:null,htmlFor:_e,httpEquiv:_e,id:null,imageSizes:null,imageSrcSet:null,inert:le,inputMode:null,integrity:null,is:null,isMap:le,itemId:null,itemProp:_e,itemRef:_e,itemScope:le,itemType:_e,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:le,low:W,manifest:null,max:null,maxLength:W,media:null,method:null,min:null,minLength:W,multiple:le,muted:le,name:null,nonce:null,noModule:le,noValidate:le,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:le,optimum:W,pattern:null,ping:_e,placeholder:null,playsInline:le,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:le,referrerPolicy:null,rel:_e,required:le,reversed:le,rows:W,rowSpan:W,sandbox:_e,scope:null,scoped:le,seamless:le,selected:le,shadowRootClonable:le,shadowRootDelegatesFocus:le,shadowRootMode:null,shape:null,size:W,sizes:null,slot:null,span:W,spellCheck:Ce,src:null,srcDoc:null,srcLang:null,srcSet:null,start:W,step:null,style:null,tabIndex:W,target:null,title:null,translate:null,type:null,typeMustMatch:le,useMap:null,value:Ce,width:W,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:_e,axis:null,background:null,bgColor:null,border:W,borderColor:null,bottomMargin:W,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:le,declare:le,event:null,face:null,frame:null,frameBorder:null,hSpace:W,leftMargin:W,link:null,longDesc:null,lowSrc:null,marginHeight:W,marginWidth:W,noResize:le,noHref:le,noShade:le,noWrap:le,object:null,profile:null,prompt:null,rev:null,rightMargin:W,rules:null,scheme:null,scrolling:Ce,standby:null,summary:null,text:null,topMargin:W,valueType:null,version:null,vAlign:null,vLink:null,vSpace:W,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:le,disableRemotePlayback:le,prefix:null,property:null,results:W,security:null,unselectable:null},space:"html",transform:pl}),cy=dn({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:st,accentHeight:W,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:W,amplitude:W,arabicForm:null,ascent:W,attributeName:null,attributeType:null,azimuth:W,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:W,by:null,calcMode:null,capHeight:W,className:_e,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:W,diffuseConstant:W,direction:null,display:null,dur:null,divisor:W,dominantBaseline:null,download:le,dx:null,dy:null,edgeMode:null,editable:null,elevation:W,enableBackground:null,end:null,event:null,exponent:W,externalResourcesRequired:null,fill:null,fillOpacity:W,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:fn,g2:fn,glyphName:fn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:W,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:W,horizOriginX:W,horizOriginY:W,id:null,ideographic:W,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:W,k:W,k1:W,k2:W,k3:W,k4:W,kernelMatrix:st,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:W,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:W,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:W,overlineThickness:W,paintOrder:null,panose1:null,path:null,pathLength:W,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:_e,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:W,pointsAtY:W,pointsAtZ:W,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:st,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:st,rev:st,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:st,requiredFeatures:st,requiredFonts:st,requiredFormats:st,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:W,specularExponent:W,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:W,strikethroughThickness:W,string:null,stroke:null,strokeDashArray:st,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:W,strokeOpacity:W,strokeWidth:null,style:null,surfaceScale:W,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:st,tabIndex:W,tableValues:null,target:null,targetX:W,targetY:W,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:st,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:W,underlineThickness:W,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:W,values:null,vAlphabetic:W,vMathematical:W,vectorEffect:null,vHanging:W,vIdeographic:W,version:null,vertAdvY:W,vertOriginX:W,vertOriginY:W,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:W,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:hl}),ml=dn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),gl=dn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:pl}),yl=dn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),fy=/[A-Z]/g,bl=/-[a-z]/g,dy=/^data[-\w.:]+$/i;function hy(e,t){const n=Ps(t);let r=t,i=tt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&dy.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(bl,my);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!bl.test(s)){let a=s.replace(fy,py);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Cs}return new i(r,t)}function py(e){return"-"+e.toLowerCase()}function my(e){return e.charAt(1).toUpperCase()}const gy=cl([dl,uy,ml,gl,yl],"html"),wl=cl([dl,cy,ml,gl,yl],"svg"),yy=/["&'<>`]/g,by=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,wy=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,_y=/[|\\{}()[\]^$+*?.]/g,_l=new WeakMap;function vy(e,t){if(e=e.replace(t.subset?Ty(t.subset):yy,r),t.subset||t.escapeOnly)return e;return e.replace(by,n).replace(wy,r);function n(i,s,a){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,a.charCodeAt(s+2),t)}function r(i,s,a){return t.format(i.charCodeAt(0),a.charCodeAt(s+1),t)}}function Ty(e){let t=_l.get(e);return t||(t=ky(e),_l.set(e,t)),t}function ky(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(_y,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const Ey=/[\dA-Fa-f]/;function Sy(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!Ey.test(String.fromCharCode(t))?r:r+";"}const xy=/\d/;function Py(e,t,n){const r="&#"+String(e);return n&&t&&!xy.test(String.fromCharCode(t))?r:r+";"}const Ay=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Os={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Dy=["cent","copy","divide","gt","lt","not","para","times"],vl={}.hasOwnProperty,Rs={};let pr;for(pr in Os)vl.call(Os,pr)&&(Rs[Os[pr]]=pr);const $y=/[^\dA-Za-z]/;function Cy(e,t,n,r){const i=String.fromCharCode(e);if(vl.call(Rs,i)){const s=Rs[i],a="&"+s;return n&&Ay.includes(s)&&!Dy.includes(s)&&(!r||t&&t!==61&&$y.test(String.fromCharCode(t)))?a:a+";"}return""}function Oy(e,t,n){let r=Sy(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Cy(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const s=Py(e,t,n.omitOptionalSemicolons);s.length<r.length&&(r=s)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function hn(e,t){return vy(e,Object.assign({format:Oy},t))}const Ry=/^>|^->|<!--|-->|--!>|<!-$/g,Ny=[">"],My=["<",">"];function Iy(e,t,n,r){return r.settings.bogusComments?"<?"+hn(e.value,Object.assign({},r.settings.characterReferences,{subset:Ny}))+">":"<!--"+e.value.replace(Ry,i)+"-->";function i(s){return hn(s,Object.assign({},r.settings.characterReferences,{subset:My}))}}function Ly(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function Fy(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function jy(e){return e.join(" ").trim()}const zy=/[ \t\n\f\r]/g;function Ns(e){return typeof e=="object"?e.type==="text"?Tl(e.value):!1:Tl(e)}function Tl(e){return e.replace(zy,"")===""}const Me=El(1),kl=El(-1),Uy=[];function El(e){return t;function t(n,r,i){const s=n?n.children:Uy;let a=(r||0)+e,o=s[a];if(!i)for(;o&&Ns(o);)a+=e,o=s[a];return o}}const qy={}.hasOwnProperty;function Sl(e){return t;function t(n,r,i){return qy.call(e,n.tagName)&&e[n.tagName](n,r,i)}}const Ms=Sl({body:By,caption:Is,colgroup:Is,dd:Gy,dt:Yy,head:Is,html:Hy,li:Wy,optgroup:Ky,option:Zy,p:Vy,rp:xl,rt:xl,tbody:Xy,td:Pl,tfoot:Qy,th:Pl,thead:Jy,tr:e0});function Is(e,t,n){const r=Me(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&Ns(r.value.charAt(0)))}function Hy(e,t,n){const r=Me(n,t);return!r||r.type!=="comment"}function By(e,t,n){const r=Me(n,t);return!r||r.type!=="comment"}function Vy(e,t,n){const r=Me(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function Wy(e,t,n){const r=Me(n,t);return!r||r.type==="element"&&r.tagName==="li"}function Yy(e,t,n){const r=Me(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Gy(e,t,n){const r=Me(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function xl(e,t,n){const r=Me(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Ky(e,t,n){const r=Me(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function Zy(e,t,n){const r=Me(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function Jy(e,t,n){const r=Me(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Xy(e,t,n){const r=Me(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Qy(e,t,n){return!Me(n,t)}function e0(e,t,n){const r=Me(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function Pl(e,t,n){const r=Me(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const t0=Sl({body:i0,colgroup:s0,head:r0,html:n0,tbody:a0});function n0(e){const t=Me(e,-1);return!t||t.type!=="comment"}function r0(e){const t=new Set;for(const r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}const n=e.children[0];return!n||n.type==="element"}function i0(e){const t=Me(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Ns(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function s0(e,t,n){const r=kl(n,t),i=Me(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&Ms(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function a0(e,t,n){const r=kl(n,t),i=Me(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&Ms(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const mr={name:[[`
|
|
27
|
+
`}),n}function ul(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function cl(e,t){const n=ny(e,t),r=n.one(e,void 0),i=ey(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
|
|
28
|
+
`},i),s}function oy(e,t){return e&&"run"in e?async function(n,r){const i=cl(n,{file:r,...t});await e.run(i,r)}:function(n,r){return cl(n,{file:r,...e||t})}}const ly=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class In{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}In.prototype.normal={},In.prototype.property={},In.prototype.space=void 0;function fl(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new In(n,r,t)}function Ps(e){return e.toLowerCase()}class tt{constructor(t,n){this.attribute=n,this.property=t}}tt.prototype.attribute="",tt.prototype.booleanish=!1,tt.prototype.boolean=!1,tt.prototype.commaOrSpaceSeparated=!1,tt.prototype.commaSeparated=!1,tt.prototype.defined=!1,tt.prototype.mustUseProperty=!1,tt.prototype.number=!1,tt.prototype.overloadedBoolean=!1,tt.prototype.property="",tt.prototype.spaceSeparated=!1,tt.prototype.space=void 0;let uy=0;const le=Kt(),Ce=Kt(),As=Kt(),Y=Kt(),_e=Kt(),dn=Kt(),st=Kt();function Kt(){return 2**++uy}const Ds=Object.freeze(Object.defineProperty({__proto__:null,boolean:le,booleanish:Ce,commaOrSpaceSeparated:st,commaSeparated:dn,number:Y,overloadedBoolean:As,spaceSeparated:_e},Symbol.toStringTag,{value:"Module"})),$s=Object.keys(Ds);class Cs extends tt{constructor(t,n,r,i){let s=-1;if(super(t,n),dl(this,"space",i),typeof r=="number")for(;++s<$s.length;){const a=$s[s];dl(this,$s[s],(r&Ds[a])===Ds[a])}}}Cs.prototype.defined=!0;function dl(e,t,n){n&&(e[t]=n)}function hn(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new Cs(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Ps(r)]=r,n[Ps(s.attribute)]=r}return new In(t,n,e.space)}const hl=hn({properties:{ariaActiveDescendant:null,ariaAtomic:Ce,ariaAutoComplete:null,ariaBusy:Ce,ariaChecked:Ce,ariaColCount:Y,ariaColIndex:Y,ariaColSpan:Y,ariaControls:_e,ariaCurrent:null,ariaDescribedBy:_e,ariaDetails:null,ariaDisabled:Ce,ariaDropEffect:_e,ariaErrorMessage:null,ariaExpanded:Ce,ariaFlowTo:_e,ariaGrabbed:Ce,ariaHasPopup:null,ariaHidden:Ce,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:_e,ariaLevel:Y,ariaLive:null,ariaModal:Ce,ariaMultiLine:Ce,ariaMultiSelectable:Ce,ariaOrientation:null,ariaOwns:_e,ariaPlaceholder:null,ariaPosInSet:Y,ariaPressed:Ce,ariaReadOnly:Ce,ariaRelevant:null,ariaRequired:Ce,ariaRoleDescription:_e,ariaRowCount:Y,ariaRowIndex:Y,ariaRowSpan:Y,ariaSelected:Ce,ariaSetSize:Y,ariaSort:null,ariaValueMax:Y,ariaValueMin:Y,ariaValueNow:Y,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function pl(e,t){return t in e?e[t]:t}function ml(e,t){return pl(e,t.toLowerCase())}const cy=hn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:dn,acceptCharset:_e,accessKey:_e,action:null,allow:null,allowFullScreen:le,allowPaymentRequest:le,allowUserMedia:le,alt:null,as:null,async:le,autoCapitalize:null,autoComplete:_e,autoFocus:le,autoPlay:le,blocking:_e,capture:null,charSet:null,checked:le,cite:null,className:_e,cols:Y,colSpan:null,content:null,contentEditable:Ce,controls:le,controlsList:_e,coords:Y|dn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:le,defer:le,dir:null,dirName:null,disabled:le,download:As,draggable:Ce,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:le,formTarget:null,headers:_e,height:Y,hidden:As,high:Y,href:null,hrefLang:null,htmlFor:_e,httpEquiv:_e,id:null,imageSizes:null,imageSrcSet:null,inert:le,inputMode:null,integrity:null,is:null,isMap:le,itemId:null,itemProp:_e,itemRef:_e,itemScope:le,itemType:_e,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:le,low:Y,manifest:null,max:null,maxLength:Y,media:null,method:null,min:null,minLength:Y,multiple:le,muted:le,name:null,nonce:null,noModule:le,noValidate:le,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:le,optimum:Y,pattern:null,ping:_e,placeholder:null,playsInline:le,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:le,referrerPolicy:null,rel:_e,required:le,reversed:le,rows:Y,rowSpan:Y,sandbox:_e,scope:null,scoped:le,seamless:le,selected:le,shadowRootClonable:le,shadowRootDelegatesFocus:le,shadowRootMode:null,shape:null,size:Y,sizes:null,slot:null,span:Y,spellCheck:Ce,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Y,step:null,style:null,tabIndex:Y,target:null,title:null,translate:null,type:null,typeMustMatch:le,useMap:null,value:Ce,width:Y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:_e,axis:null,background:null,bgColor:null,border:Y,borderColor:null,bottomMargin:Y,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:le,declare:le,event:null,face:null,frame:null,frameBorder:null,hSpace:Y,leftMargin:Y,link:null,longDesc:null,lowSrc:null,marginHeight:Y,marginWidth:Y,noResize:le,noHref:le,noShade:le,noWrap:le,object:null,profile:null,prompt:null,rev:null,rightMargin:Y,rules:null,scheme:null,scrolling:Ce,standby:null,summary:null,text:null,topMargin:Y,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Y,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:le,disableRemotePlayback:le,prefix:null,property:null,results:Y,security:null,unselectable:null},space:"html",transform:ml}),fy=hn({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:st,accentHeight:Y,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Y,amplitude:Y,arabicForm:null,ascent:Y,attributeName:null,attributeType:null,azimuth:Y,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Y,by:null,calcMode:null,capHeight:Y,className:_e,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Y,diffuseConstant:Y,direction:null,display:null,dur:null,divisor:Y,dominantBaseline:null,download:le,dx:null,dy:null,edgeMode:null,editable:null,elevation:Y,enableBackground:null,end:null,event:null,exponent:Y,externalResourcesRequired:null,fill:null,fillOpacity:Y,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:dn,g2:dn,glyphName:dn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Y,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Y,horizOriginX:Y,horizOriginY:Y,id:null,ideographic:Y,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Y,k:Y,k1:Y,k2:Y,k3:Y,k4:Y,kernelMatrix:st,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Y,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Y,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Y,overlineThickness:Y,paintOrder:null,panose1:null,path:null,pathLength:Y,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:_e,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Y,pointsAtY:Y,pointsAtZ:Y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:st,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:st,rev:st,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:st,requiredFeatures:st,requiredFonts:st,requiredFormats:st,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Y,specularExponent:Y,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Y,strikethroughThickness:Y,string:null,stroke:null,strokeDashArray:st,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Y,strokeOpacity:Y,strokeWidth:null,style:null,surfaceScale:Y,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:st,tabIndex:Y,tableValues:null,target:null,targetX:Y,targetY:Y,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:st,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Y,underlineThickness:Y,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Y,values:null,vAlphabetic:Y,vMathematical:Y,vectorEffect:null,vHanging:Y,vIdeographic:Y,version:null,vertAdvY:Y,vertOriginX:Y,vertOriginY:Y,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Y,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:pl}),gl=hn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),yl=hn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ml}),bl=hn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),dy=/[A-Z]/g,wl=/-[a-z]/g,hy=/^data[-\w.:]+$/i;function py(e,t){const n=Ps(t);let r=t,i=tt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&hy.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(wl,gy);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!wl.test(s)){let a=s.replace(dy,my);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Cs}return new i(r,t)}function my(e){return"-"+e.toLowerCase()}function gy(e){return e.charAt(1).toUpperCase()}const yy=fl([hl,cy,gl,yl,bl],"html"),_l=fl([hl,fy,gl,yl,bl],"svg"),by=/["&'<>`]/g,wy=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,_y=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,vy=/[|\\{}()[\]^$+*?.]/g,vl=new WeakMap;function Ty(e,t){if(e=e.replace(t.subset?ky(t.subset):by,r),t.subset||t.escapeOnly)return e;return e.replace(wy,n).replace(_y,r);function n(i,s,a){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,a.charCodeAt(s+2),t)}function r(i,s,a){return t.format(i.charCodeAt(0),a.charCodeAt(s+1),t)}}function ky(e){let t=vl.get(e);return t||(t=Ey(e),vl.set(e,t)),t}function Ey(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(vy,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const Sy=/[\dA-Fa-f]/;function xy(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!Sy.test(String.fromCharCode(t))?r:r+";"}const Py=/\d/;function Ay(e,t,n){const r="&#"+String(e);return n&&t&&!Py.test(String.fromCharCode(t))?r:r+";"}const Dy=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Os={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},$y=["cent","copy","divide","gt","lt","not","para","times"],Tl={}.hasOwnProperty,Rs={};let gr;for(gr in Os)Tl.call(Os,gr)&&(Rs[Os[gr]]=gr);const Cy=/[^\dA-Za-z]/;function Oy(e,t,n,r){const i=String.fromCharCode(e);if(Tl.call(Rs,i)){const s=Rs[i],a="&"+s;return n&&Dy.includes(s)&&!$y.includes(s)&&(!r||t&&t!==61&&Cy.test(String.fromCharCode(t)))?a:a+";"}return""}function Ry(e,t,n){let r=xy(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Oy(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const s=Ay(e,t,n.omitOptionalSemicolons);s.length<r.length&&(r=s)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function pn(e,t){return Ty(e,Object.assign({format:Ry},t))}const Ny=/^>|^->|<!--|-->|--!>|<!-$/g,My=[">"],Iy=["<",">"];function Ly(e,t,n,r){return r.settings.bogusComments?"<?"+pn(e.value,Object.assign({},r.settings.characterReferences,{subset:My}))+">":"<!--"+e.value.replace(Ny,i)+"-->";function i(s){return pn(s,Object.assign({},r.settings.characterReferences,{subset:Iy}))}}function Fy(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function jy(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function zy(e){return e.join(" ").trim()}const Uy=/[ \t\n\f\r]/g;function Ns(e){return typeof e=="object"?e.type==="text"?kl(e.value):!1:kl(e)}function kl(e){return e.replace(Uy,"")===""}const Me=Sl(1),El=Sl(-1),qy=[];function Sl(e){return t;function t(n,r,i){const s=n?n.children:qy;let a=(r||0)+e,o=s[a];if(!i)for(;o&&Ns(o);)a+=e,o=s[a];return o}}const Hy={}.hasOwnProperty;function xl(e){return t;function t(n,r,i){return Hy.call(e,n.tagName)&&e[n.tagName](n,r,i)}}const Ms=xl({body:Vy,caption:Is,colgroup:Is,dd:Ky,dt:Gy,head:Is,html:By,li:Yy,optgroup:Zy,option:Jy,p:Wy,rp:Pl,rt:Pl,tbody:Qy,td:Al,tfoot:e0,th:Al,thead:Xy,tr:t0});function Is(e,t,n){const r=Me(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&Ns(r.value.charAt(0)))}function By(e,t,n){const r=Me(n,t);return!r||r.type!=="comment"}function Vy(e,t,n){const r=Me(n,t);return!r||r.type!=="comment"}function Wy(e,t,n){const r=Me(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function Yy(e,t,n){const r=Me(n,t);return!r||r.type==="element"&&r.tagName==="li"}function Gy(e,t,n){const r=Me(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Ky(e,t,n){const r=Me(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function Pl(e,t,n){const r=Me(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Zy(e,t,n){const r=Me(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function Jy(e,t,n){const r=Me(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function Xy(e,t,n){const r=Me(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Qy(e,t,n){const r=Me(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function e0(e,t,n){return!Me(n,t)}function t0(e,t,n){const r=Me(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function Al(e,t,n){const r=Me(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const n0=xl({body:s0,colgroup:a0,head:i0,html:r0,tbody:o0});function r0(e){const t=Me(e,-1);return!t||t.type!=="comment"}function i0(e){const t=new Set;for(const r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}const n=e.children[0];return!n||n.type==="element"}function s0(e){const t=Me(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Ns(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function a0(e,t,n){const r=El(n,t),i=Me(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&Ms(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function o0(e,t,n){const r=El(n,t),i=Me(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&Ms(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const yr={name:[[`
|
|
29
29
|
\f\r &/=>`.split(""),`
|
|
30
30
|
\f\r "&'/=>\``.split("")],[`\0
|
|
31
31
|
\f\r "&'/<=>`.split(""),`\0
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
\f\r &>`.split(""),`\0
|
|
34
34
|
\f\r "&'<=>\``.split("")],[`\0
|
|
35
35
|
\f\r "&'<=>\``.split(""),`\0
|
|
36
|
-
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function o0(e,t,n,r){const i=r.schema,s=i.space==="svg"?!1:r.settings.omitOptionalTags;let a=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const o=[];let l;i.space==="html"&&e.tagName==="svg"&&(r.schema=wl);const u=l0(r,e.properties),c=r.all(i.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=i,c&&(a=!1),(u||!s||!t0(e,t,n))&&(o.push("<",e.tagName,u?" "+u:""),a&&(i.space==="svg"||r.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&o.push(" "),o.push("/")),o.push(">")),o.push(c),!a&&(!s||!Ms(e,t,n))&&o.push("</"+e.tagName+">"),o.join("")}function l0(e,t){const n=[];let r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){const s=u0(e,i,t[i]);s&&n.push(s)}}for(;++r<n.length;){const s=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&s!=='"'&&s!=="'"&&(n[r]+=" ")}return n.join("")}function u0(e,t,n){const r=hy(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,s=e.settings.allowDangerousCharacters?0:1;let a=e.quote,o;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const l=hn(r.attribute,Object.assign({},e.settings.characterReferences,{subset:mr.name[i][s]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?Fy:jy)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?l:(e.settings.preferUnquoted&&(o=hn(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:mr.unquoted[i][s]}))),o!==n&&(e.settings.quoteSmart&&ir(n,a)>ir(n,e.alternative)&&(a=e.alternative),o=a+hn(n,Object.assign({},e.settings.characterReferences,{subset:(a==="'"?mr.single:mr.double)[i][s],attribute:!0}))+a),l+(o&&"="+o))}const c0=["<","&"];function Al(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:hn(e.value,Object.assign({},r.settings.characterReferences,{subset:c0}))}function f0(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Al(e,t,n,r)}function d0(e,t,n,r){return r.all(e)}const h0=Gp("type",{invalid:p0,unknown:m0,handlers:{comment:Iy,doctype:Ly,element:o0,raw:f0,root:d0,text:Al}});function p0(e){throw new Error("Expected node, not `"+e+"`")}function m0(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const g0={},y0={},b0=[];function w0(e,t){const n=t||g0,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:_0,all:v0,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||oy,characterReferences:n.characterReferences||y0,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?wl:gy,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function _0(e,t,n){return h0(e,t,n,this)}function v0(e){const t=[],n=e&&e.children||b0;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}function T0(e){const t=this,n={...t.data("settings"),...e};t.compiler=r;function r(i){return w0(i,n)}}const{entries:Dl,setPrototypeOf:$l,isFrozen:k0,getPrototypeOf:E0,getOwnPropertyDescriptor:S0}=Object;let{freeze:Be,seal:ft,create:gr}=Object,{apply:Ls,construct:Fs}=typeof Reflect<"u"&&Reflect;Be||(Be=function(t){return t}),ft||(ft=function(t){return t}),Ls||(Ls=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];return t.apply(n,i)}),Fs||(Fs=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new t(...r)});const yr=We(Array.prototype.forEach),x0=We(Array.prototype.lastIndexOf),Cl=We(Array.prototype.pop),In=We(Array.prototype.push),P0=We(Array.prototype.splice),br=We(String.prototype.toLowerCase),js=We(String.prototype.toString),zs=We(String.prototype.match),Ln=We(String.prototype.replace),A0=We(String.prototype.indexOf),D0=We(String.prototype.trim),at=We(Object.prototype.hasOwnProperty),Ve=We(RegExp.prototype.test),Fn=$0(TypeError);function We(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Ls(e,t,r)}}function $0(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Fs(e,n)}}function fe(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:br;$l&&$l(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const s=n(i);s!==i&&(k0(t)||(t[r]=s),i=s)}e[i]=!0}return e}function C0(e){for(let t=0;t<e.length;t++)at(e,t)||(e[t]=null);return e}function kt(e){const t=gr(null);for(const[n,r]of Dl(e))at(e,n)&&(Array.isArray(r)?t[n]=C0(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=kt(r):t[n]=r);return t}function jn(e,t){for(;e!==null;){const r=S0(e,t);if(r){if(r.get)return We(r.get);if(typeof r.value=="function")return We(r.value)}e=E0(e)}function n(){return null}return n}const Ol=Be(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Us=Be(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),qs=Be(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),O0=Be(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Hs=Be(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),R0=Be(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Rl=Be(["#text"]),Nl=Be(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Bs=Be(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Ml=Be(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),wr=Be(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),N0=ft(/\{\{[\w\W]*|[\w\W]*\}\}/gm),M0=ft(/<%[\w\W]*|[\w\W]*%>/gm),I0=ft(/\$\{[\w\W]*/gm),L0=ft(/^data-[\-\w.\u00B7-\uFFFF]+$/),F0=ft(/^aria-[\-\w]+$/),Il=ft(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),j0=ft(/^(?:\w+script|data):/i),z0=ft(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ll=ft(/^html$/i),U0=ft(/^[a-z][.\w]*(-[.\w]+)+$/i);var Fl=Object.freeze({__proto__:null,ARIA_ATTR:F0,ATTR_WHITESPACE:z0,CUSTOM_ELEMENT:U0,DATA_ATTR:L0,DOCTYPE_NAME:Ll,ERB_EXPR:M0,IS_ALLOWED_URI:Il,IS_SCRIPT_OR_DATA:j0,MUSTACHE_EXPR:N0,TMPLIT_EXPR:I0});const zn={element:1,text:3,progressingInstruction:7,comment:8,document:9},q0=function(){return typeof window>"u"?null:window},H0=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const s="dompurify"+(r?"#"+r:"");try{return t.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},jl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function zl(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:q0();const t=re=>zl(re);if(t.version="3.3.3",t.removed=[],!e||!e.document||e.document.nodeType!==zn.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:o,Element:l,NodeFilter:u,NamedNodeMap:c=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:h,trustedTypes:d}=e,g=l.prototype,T=jn(g,"cloneNode"),y=jn(g,"remove"),m=jn(g,"nextSibling"),p=jn(g,"childNodes"),b=jn(g,"parentNode");if(typeof a=="function"){const re=n.createElement("template");re.content&&re.content.ownerDocument&&(n=re.content.ownerDocument)}let S,v="";const{implementation:w,createNodeIterator:x,createDocumentFragment:N,getElementsByTagName:F}=n,{importNode:A}=r;let O=jl();t.isSupported=typeof Dl=="function"&&typeof b=="function"&&w&&w.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:U,ERB_EXPR:K,TMPLIT_EXPR:H,DATA_ATTR:j,ARIA_ATTR:B,IS_SCRIPT_OR_DATA:Z,ATTR_WHITESPACE:q,CUSTOM_ELEMENT:ee}=Fl;let{IS_ALLOWED_URI:k}=Fl,D=null;const I=fe({},[...Ol,...Us,...qs,...Hs,...Rl]);let _=null;const E=fe({},[...Nl,...Bs,...Ml,...wr]);let P=Object.seal(gr(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),M=null,X=null;const J=Object.seal(gr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ae=!0,ne=!0,C=!1,R=!0,z=!1,G=!0,Q=!1,oe=!1,Se=!1,Oe=!1,Pe=!1,Ae=!1,De=!0,wt=!1;const Ue="user-content-";let It=!0,_t=!1,L={},V=null;const se=fe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ue=null;const ge=fe({},["audio","video","img","source","image","track"]);let Je=null;const St=fe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),nt="http://www.w3.org/1998/Math/MathML",xt="http://www.w3.org/2000/svg",Xe="http://www.w3.org/1999/xhtml";let Re=Xe,Pt=!1,ut=null;const fk=fe({},[nt,xt,Xe],js);let Wi=fe({},["mi","mo","mn","ms","mtext"]),Yi=fe({},["annotation-xml"]);const dk=fe({},["title","style","font","a","script"]);let Jn=null;const hk=["application/xhtml+xml","text/html"],pk="text/html";let Ie=null,Sn=null;const mk=n.createElement("form"),Df=function($){return $ instanceof RegExp||$ instanceof Function},Na=function(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Sn&&Sn===$)){if((!$||typeof $!="object")&&($={}),$=kt($),Jn=hk.indexOf($.PARSER_MEDIA_TYPE)===-1?pk:$.PARSER_MEDIA_TYPE,Ie=Jn==="application/xhtml+xml"?js:br,D=at($,"ALLOWED_TAGS")?fe({},$.ALLOWED_TAGS,Ie):I,_=at($,"ALLOWED_ATTR")?fe({},$.ALLOWED_ATTR,Ie):E,ut=at($,"ALLOWED_NAMESPACES")?fe({},$.ALLOWED_NAMESPACES,js):fk,Je=at($,"ADD_URI_SAFE_ATTR")?fe(kt(St),$.ADD_URI_SAFE_ATTR,Ie):St,ue=at($,"ADD_DATA_URI_TAGS")?fe(kt(ge),$.ADD_DATA_URI_TAGS,Ie):ge,V=at($,"FORBID_CONTENTS")?fe({},$.FORBID_CONTENTS,Ie):se,M=at($,"FORBID_TAGS")?fe({},$.FORBID_TAGS,Ie):kt({}),X=at($,"FORBID_ATTR")?fe({},$.FORBID_ATTR,Ie):kt({}),L=at($,"USE_PROFILES")?$.USE_PROFILES:!1,ae=$.ALLOW_ARIA_ATTR!==!1,ne=$.ALLOW_DATA_ATTR!==!1,C=$.ALLOW_UNKNOWN_PROTOCOLS||!1,R=$.ALLOW_SELF_CLOSE_IN_ATTR!==!1,z=$.SAFE_FOR_TEMPLATES||!1,G=$.SAFE_FOR_XML!==!1,Q=$.WHOLE_DOCUMENT||!1,Oe=$.RETURN_DOM||!1,Pe=$.RETURN_DOM_FRAGMENT||!1,Ae=$.RETURN_TRUSTED_TYPE||!1,Se=$.FORCE_BODY||!1,De=$.SANITIZE_DOM!==!1,wt=$.SANITIZE_NAMED_PROPS||!1,It=$.KEEP_CONTENT!==!1,_t=$.IN_PLACE||!1,k=$.ALLOWED_URI_REGEXP||Il,Re=$.NAMESPACE||Xe,Wi=$.MATHML_TEXT_INTEGRATION_POINTS||Wi,Yi=$.HTML_INTEGRATION_POINTS||Yi,P=$.CUSTOM_ELEMENT_HANDLING||{},$.CUSTOM_ELEMENT_HANDLING&&Df($.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(P.tagNameCheck=$.CUSTOM_ELEMENT_HANDLING.tagNameCheck),$.CUSTOM_ELEMENT_HANDLING&&Df($.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(P.attributeNameCheck=$.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),$.CUSTOM_ELEMENT_HANDLING&&typeof $.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(P.allowCustomizedBuiltInElements=$.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),z&&(ne=!1),Pe&&(Oe=!0),L&&(D=fe({},Rl),_=gr(null),L.html===!0&&(fe(D,Ol),fe(_,Nl)),L.svg===!0&&(fe(D,Us),fe(_,Bs),fe(_,wr)),L.svgFilters===!0&&(fe(D,qs),fe(_,Bs),fe(_,wr)),L.mathMl===!0&&(fe(D,Hs),fe(_,Ml),fe(_,wr))),at($,"ADD_TAGS")||(J.tagCheck=null),at($,"ADD_ATTR")||(J.attributeCheck=null),$.ADD_TAGS&&(typeof $.ADD_TAGS=="function"?J.tagCheck=$.ADD_TAGS:(D===I&&(D=kt(D)),fe(D,$.ADD_TAGS,Ie))),$.ADD_ATTR&&(typeof $.ADD_ATTR=="function"?J.attributeCheck=$.ADD_ATTR:(_===E&&(_=kt(_)),fe(_,$.ADD_ATTR,Ie))),$.ADD_URI_SAFE_ATTR&&fe(Je,$.ADD_URI_SAFE_ATTR,Ie),$.FORBID_CONTENTS&&(V===se&&(V=kt(V)),fe(V,$.FORBID_CONTENTS,Ie)),$.ADD_FORBID_CONTENTS&&(V===se&&(V=kt(V)),fe(V,$.ADD_FORBID_CONTENTS,Ie)),It&&(D["#text"]=!0),Q&&fe(D,["html","head","body"]),D.table&&(fe(D,["tbody"]),delete M.tbody),$.TRUSTED_TYPES_POLICY){if(typeof $.TRUSTED_TYPES_POLICY.createHTML!="function")throw Fn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof $.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Fn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=$.TRUSTED_TYPES_POLICY,v=S.createHTML("")}else S===void 0&&(S=H0(d,i)),S!==null&&typeof v=="string"&&(v=S.createHTML(""));Be&&Be($),Sn=$}},$f=fe({},[...Us,...qs,...O0]),Cf=fe({},[...Hs,...R0]),gk=function($){let Y=b($);(!Y||!Y.tagName)&&(Y={namespaceURI:Re,tagName:"template"});const te=br($.tagName),xe=br(Y.tagName);return ut[$.namespaceURI]?$.namespaceURI===xt?Y.namespaceURI===Xe?te==="svg":Y.namespaceURI===nt?te==="svg"&&(xe==="annotation-xml"||Wi[xe]):!!$f[te]:$.namespaceURI===nt?Y.namespaceURI===Xe?te==="math":Y.namespaceURI===xt?te==="math"&&Yi[xe]:!!Cf[te]:$.namespaceURI===Xe?Y.namespaceURI===xt&&!Yi[xe]||Y.namespaceURI===nt&&!Wi[xe]?!1:!Cf[te]&&(dk[te]||!$f[te]):!!(Jn==="application/xhtml+xml"&&ut[$.namespaceURI]):!1},At=function($){In(t.removed,{element:$});try{b($).removeChild($)}catch{y($)}},sn=function($,Y){try{In(t.removed,{attribute:Y.getAttributeNode($),from:Y})}catch{In(t.removed,{attribute:null,from:Y})}if(Y.removeAttribute($),$==="is")if(Oe||Pe)try{At(Y)}catch{}else try{Y.setAttribute($,"")}catch{}},Of=function($){let Y=null,te=null;if(Se)$="<remove></remove>"+$;else{const Ne=zs($,/^[\r\n\t ]+/);te=Ne&&Ne[0]}Jn==="application/xhtml+xml"&&Re===Xe&&($='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+$+"</body></html>");const xe=S?S.createHTML($):$;if(Re===Xe)try{Y=new h().parseFromString(xe,Jn)}catch{}if(!Y||!Y.documentElement){Y=w.createDocument(Re,"template",null);try{Y.documentElement.innerHTML=Pt?v:xe}catch{}}const qe=Y.body||Y.documentElement;return $&&te&&qe.insertBefore(n.createTextNode(te),qe.childNodes[0]||null),Re===Xe?F.call(Y,Q?"html":"body")[0]:Q?Y.documentElement:qe},Rf=function($){return x.call($.ownerDocument||$,$,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Ma=function($){return $ instanceof f&&(typeof $.nodeName!="string"||typeof $.textContent!="string"||typeof $.removeChild!="function"||!($.attributes instanceof c)||typeof $.removeAttribute!="function"||typeof $.setAttribute!="function"||typeof $.namespaceURI!="string"||typeof $.insertBefore!="function"||typeof $.hasChildNodes!="function")},Nf=function($){return typeof o=="function"&&$ instanceof o};function Lt(re,$,Y){yr(re,te=>{te.call(t,$,Y,Sn)})}const Mf=function($){let Y=null;if(Lt(O.beforeSanitizeElements,$,null),Ma($))return At($),!0;const te=Ie($.nodeName);if(Lt(O.uponSanitizeElement,$,{tagName:te,allowedTags:D}),G&&$.hasChildNodes()&&!Nf($.firstElementChild)&&Ve(/<[/\w!]/g,$.innerHTML)&&Ve(/<[/\w!]/g,$.textContent)||$.nodeType===zn.progressingInstruction||G&&$.nodeType===zn.comment&&Ve(/<[/\w]/g,$.data))return At($),!0;if(!(J.tagCheck instanceof Function&&J.tagCheck(te))&&(!D[te]||M[te])){if(!M[te]&&Lf(te)&&(P.tagNameCheck instanceof RegExp&&Ve(P.tagNameCheck,te)||P.tagNameCheck instanceof Function&&P.tagNameCheck(te)))return!1;if(It&&!V[te]){const xe=b($)||$.parentNode,qe=p($)||$.childNodes;if(qe&&xe){const Ne=qe.length;for(let rt=Ne-1;rt>=0;--rt){const Ft=T(qe[rt],!0);Ft.__removalCount=($.__removalCount||0)+1,xe.insertBefore(Ft,m($))}}}return At($),!0}return $ instanceof l&&!gk($)||(te==="noscript"||te==="noembed"||te==="noframes")&&Ve(/<\/no(script|embed|frames)/i,$.innerHTML)?(At($),!0):(z&&$.nodeType===zn.text&&(Y=$.textContent,yr([U,K,H],xe=>{Y=Ln(Y,xe," ")}),$.textContent!==Y&&(In(t.removed,{element:$.cloneNode()}),$.textContent=Y)),Lt(O.afterSanitizeElements,$,null),!1)},If=function($,Y,te){if(X[Y]||De&&(Y==="id"||Y==="name")&&(te in n||te in mk))return!1;if(!(ne&&!X[Y]&&Ve(j,Y))){if(!(ae&&Ve(B,Y))){if(!(J.attributeCheck instanceof Function&&J.attributeCheck(Y,$))){if(!_[Y]||X[Y]){if(!(Lf($)&&(P.tagNameCheck instanceof RegExp&&Ve(P.tagNameCheck,$)||P.tagNameCheck instanceof Function&&P.tagNameCheck($))&&(P.attributeNameCheck instanceof RegExp&&Ve(P.attributeNameCheck,Y)||P.attributeNameCheck instanceof Function&&P.attributeNameCheck(Y,$))||Y==="is"&&P.allowCustomizedBuiltInElements&&(P.tagNameCheck instanceof RegExp&&Ve(P.tagNameCheck,te)||P.tagNameCheck instanceof Function&&P.tagNameCheck(te))))return!1}else if(!Je[Y]){if(!Ve(k,Ln(te,q,""))){if(!((Y==="src"||Y==="xlink:href"||Y==="href")&&$!=="script"&&A0(te,"data:")===0&&ue[$])){if(!(C&&!Ve(Z,Ln(te,q,"")))){if(te)return!1}}}}}}}return!0},Lf=function($){return $!=="annotation-xml"&&zs($,ee)},Ff=function($){Lt(O.beforeSanitizeAttributes,$,null);const{attributes:Y}=$;if(!Y||Ma($))return;const te={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:_,forceKeepAttr:void 0};let xe=Y.length;for(;xe--;){const qe=Y[xe],{name:Ne,namespaceURI:rt,value:Ft}=qe,xn=Ie(Ne),Ia=Ft;let je=Ne==="value"?Ia:D0(Ia);if(te.attrName=xn,te.attrValue=je,te.keepAttr=!0,te.forceKeepAttr=void 0,Lt(O.uponSanitizeAttribute,$,te),je=te.attrValue,wt&&(xn==="id"||xn==="name")&&(sn(Ne,$),je=Ue+je),G&&Ve(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,je)){sn(Ne,$);continue}if(xn==="attributename"&&zs(je,"href")){sn(Ne,$);continue}if(te.forceKeepAttr)continue;if(!te.keepAttr){sn(Ne,$);continue}if(!R&&Ve(/\/>/i,je)){sn(Ne,$);continue}z&&yr([U,K,H],zf=>{je=Ln(je,zf," ")});const jf=Ie($.nodeName);if(!If(jf,xn,je)){sn(Ne,$);continue}if(S&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!rt)switch(d.getAttributeType(jf,xn)){case"TrustedHTML":{je=S.createHTML(je);break}case"TrustedScriptURL":{je=S.createScriptURL(je);break}}if(je!==Ia)try{rt?$.setAttributeNS(rt,Ne,je):$.setAttribute(Ne,je),Ma($)?At($):Cl(t.removed)}catch{sn(Ne,$)}}Lt(O.afterSanitizeAttributes,$,null)},yk=function re($){let Y=null;const te=Rf($);for(Lt(O.beforeSanitizeShadowDOM,$,null);Y=te.nextNode();)Lt(O.uponSanitizeShadowNode,Y,null),Mf(Y),Ff(Y),Y.content instanceof s&&re(Y.content);Lt(O.afterSanitizeShadowDOM,$,null)};return t.sanitize=function(re){let $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Y=null,te=null,xe=null,qe=null;if(Pt=!re,Pt&&(re="<!-->"),typeof re!="string"&&!Nf(re))if(typeof re.toString=="function"){if(re=re.toString(),typeof re!="string")throw Fn("dirty is not a string, aborting")}else throw Fn("toString is not a function");if(!t.isSupported)return re;if(oe||Na($),t.removed=[],typeof re=="string"&&(_t=!1),_t){if(re.nodeName){const Ft=Ie(re.nodeName);if(!D[Ft]||M[Ft])throw Fn("root node is forbidden and cannot be sanitized in-place")}}else if(re instanceof o)Y=Of("<!---->"),te=Y.ownerDocument.importNode(re,!0),te.nodeType===zn.element&&te.nodeName==="BODY"||te.nodeName==="HTML"?Y=te:Y.appendChild(te);else{if(!Oe&&!z&&!Q&&re.indexOf("<")===-1)return S&&Ae?S.createHTML(re):re;if(Y=Of(re),!Y)return Oe?null:Ae?v:""}Y&&Se&&At(Y.firstChild);const Ne=Rf(_t?re:Y);for(;xe=Ne.nextNode();)Mf(xe),Ff(xe),xe.content instanceof s&&yk(xe.content);if(_t)return re;if(Oe){if(Pe)for(qe=N.call(Y.ownerDocument);Y.firstChild;)qe.appendChild(Y.firstChild);else qe=Y;return(_.shadowroot||_.shadowrootmode)&&(qe=A.call(r,qe,!0)),qe}let rt=Q?Y.outerHTML:Y.innerHTML;return Q&&D["!doctype"]&&Y.ownerDocument&&Y.ownerDocument.doctype&&Y.ownerDocument.doctype.name&&Ve(Ll,Y.ownerDocument.doctype.name)&&(rt="<!DOCTYPE "+Y.ownerDocument.doctype.name+`>
|
|
37
|
-
`+rt),z&&
|
|
36
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function l0(e,t,n,r){const i=r.schema,s=i.space==="svg"?!1:r.settings.omitOptionalTags;let a=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const o=[];let l;i.space==="html"&&e.tagName==="svg"&&(r.schema=_l);const u=u0(r,e.properties),c=r.all(i.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=i,c&&(a=!1),(u||!s||!n0(e,t,n))&&(o.push("<",e.tagName,u?" "+u:""),a&&(i.space==="svg"||r.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&o.push(" "),o.push("/")),o.push(">")),o.push(c),!a&&(!s||!Ms(e,t,n))&&o.push("</"+e.tagName+">"),o.join("")}function u0(e,t){const n=[];let r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){const s=c0(e,i,t[i]);s&&n.push(s)}}for(;++r<n.length;){const s=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&s!=='"'&&s!=="'"&&(n[r]+=" ")}return n.join("")}function c0(e,t,n){const r=py(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,s=e.settings.allowDangerousCharacters?0:1;let a=e.quote,o;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const l=pn(r.attribute,Object.assign({},e.settings.characterReferences,{subset:yr.name[i][s]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?jy:zy)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?l:(e.settings.preferUnquoted&&(o=pn(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:yr.unquoted[i][s]}))),o!==n&&(e.settings.quoteSmart&&ar(n,a)>ar(n,e.alternative)&&(a=e.alternative),o=a+pn(n,Object.assign({},e.settings.characterReferences,{subset:(a==="'"?yr.single:yr.double)[i][s],attribute:!0}))+a),l+(o&&"="+o))}const f0=["<","&"];function Dl(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:pn(e.value,Object.assign({},r.settings.characterReferences,{subset:f0}))}function d0(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Dl(e,t,n,r)}function h0(e,t,n,r){return r.all(e)}const p0=Kp("type",{invalid:m0,unknown:g0,handlers:{comment:Ly,doctype:Fy,element:l0,raw:d0,root:h0,text:Dl}});function m0(e){throw new Error("Expected node, not `"+e+"`")}function g0(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const y0={},b0={},w0=[];function _0(e,t){const n=t||y0,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:v0,all:T0,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||ly,characterReferences:n.characterReferences||b0,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?_l:yy,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function v0(e,t,n){return p0(e,t,n,this)}function T0(e){const t=[],n=e&&e.children||w0;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}function k0(e){const t=this,n={...t.data("settings"),...e};t.compiler=r;function r(i){return _0(i,n)}}const{entries:$l,setPrototypeOf:Cl,isFrozen:E0,getPrototypeOf:S0,getOwnPropertyDescriptor:x0}=Object;let{freeze:Ve,seal:ft,create:Ln}=Object,{apply:Ls,construct:Fs}=typeof Reflect<"u"&&Reflect;Ve||(Ve=function(t){return t}),ft||(ft=function(t){return t}),Ls||(Ls=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];return t.apply(n,i)}),Fs||(Fs=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new t(...r)});const Fn=Ye(Array.prototype.forEach),P0=Ye(Array.prototype.lastIndexOf),Ol=Ye(Array.prototype.pop),jn=Ye(Array.prototype.push),A0=Ye(Array.prototype.splice),br=Ye(String.prototype.toLowerCase),js=Ye(String.prototype.toString),zs=Ye(String.prototype.match),mn=Ye(String.prototype.replace),D0=Ye(String.prototype.indexOf),$0=Ye(String.prototype.trim),gt=Ye(Object.prototype.hasOwnProperty),We=Ye(RegExp.prototype.test),zn=C0(TypeError);function Ye(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Ls(e,t,r)}}function C0(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Fs(e,n)}}function fe(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:br;Cl&&Cl(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const s=n(i);s!==i&&(E0(t)||(t[r]=s),i=s)}e[i]=!0}return e}function O0(e){for(let t=0;t<e.length;t++)gt(e,t)||(e[t]=null);return e}function St(e){const t=Ln(null);for(const[n,r]of $l(e))gt(e,n)&&(Array.isArray(r)?t[n]=O0(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=St(r):t[n]=r);return t}function Un(e,t){for(;e!==null;){const r=x0(e,t);if(r){if(r.get)return Ye(r.get);if(typeof r.value=="function")return Ye(r.value)}e=S0(e)}function n(){return null}return n}const Rl=Ve(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Us=Ve(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),qs=Ve(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),R0=Ve(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Hs=Ve(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),N0=Ve(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Nl=Ve(["#text"]),Ml=Ve(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Bs=Ve(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Il=Ve(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),wr=Ve(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),M0=ft(/\{\{[\w\W]*|[\w\W]*\}\}/gm),I0=ft(/<%[\w\W]*|[\w\W]*%>/gm),L0=ft(/\$\{[\w\W]*/gm),F0=ft(/^data-[\-\w.\u00B7-\uFFFF]+$/),j0=ft(/^aria-[\-\w]+$/),Ll=ft(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),z0=ft(/^(?:\w+script|data):/i),U0=ft(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Fl=ft(/^html$/i),q0=ft(/^[a-z][.\w]*(-[.\w]+)+$/i);var jl=Object.freeze({__proto__:null,ARIA_ATTR:j0,ATTR_WHITESPACE:U0,CUSTOM_ELEMENT:q0,DATA_ATTR:F0,DOCTYPE_NAME:Fl,ERB_EXPR:I0,IS_ALLOWED_URI:Ll,IS_SCRIPT_OR_DATA:z0,MUSTACHE_EXPR:M0,TMPLIT_EXPR:L0});const qn={element:1,text:3,progressingInstruction:7,comment:8,document:9},H0=function(){return typeof window>"u"?null:window},B0=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const s="dompurify"+(r?"#"+r:"");try{return t.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},zl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ul(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:H0();const t=re=>Ul(re);if(t.version="3.4.0",t.removed=[],!e||!e.document||e.document.nodeType!==qn.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:o,Element:l,NodeFilter:u,NamedNodeMap:c=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:h,trustedTypes:d}=e,g=l.prototype,T=Un(g,"cloneNode"),y=Un(g,"remove"),m=Un(g,"nextSibling"),p=Un(g,"childNodes"),b=Un(g,"parentNode");if(typeof a=="function"){const re=n.createElement("template");re.content&&re.content.ownerDocument&&(n=re.content.ownerDocument)}let S,v="";const{implementation:w,createNodeIterator:x,createDocumentFragment:N,getElementsByTagName:F}=n,{importNode:A}=r;let O=zl();t.isSupported=typeof $l=="function"&&typeof b=="function"&&w&&w.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:U,ERB_EXPR:K,TMPLIT_EXPR:H,DATA_ATTR:j,ARIA_ATTR:B,IS_SCRIPT_OR_DATA:Z,ATTR_WHITESPACE:q,CUSTOM_ELEMENT:ee}=jl;let{IS_ALLOWED_URI:k}=jl,D=null;const I=fe({},[...Rl,...Us,...qs,...Hs,...Nl]);let _=null;const E=fe({},[...Ml,...Bs,...Il,...wr]);let P=Object.seal(Ln(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),M=null,X=null;const J=Object.seal(Ln(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ae=!0,ne=!0,C=!1,R=!0,z=!1,G=!0,Q=!1,oe=!1,Se=!1,Oe=!1,Pe=!1,Ae=!1,De=!0,_t=!1;const Ue="user-content-";let Lt=!0,vt=!1,L={},V=null;const se=fe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ue=null;const ge=fe({},["audio","video","img","source","image","track"]);let Xe=null;const Pt=fe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),nt="http://www.w3.org/1998/Math/MathML",At="http://www.w3.org/2000/svg",qe="http://www.w3.org/1999/xhtml";let Re=qe,Dt=!1,lt=null;const dk=fe({},[nt,At,qe],js);let Wi=fe({},["mi","mo","mn","ms","mtext"]),Yi=fe({},["annotation-xml"]);const hk=fe({},["title","style","font","a","script"]);let Qn=null;const pk=["application/xhtml+xml","text/html"],mk="text/html";let Ie=null,Pn=null;const gk=n.createElement("form"),$f=function($){return $ instanceof RegExp||$ instanceof Function},Na=function(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Pn&&Pn===$)){if((!$||typeof $!="object")&&($={}),$=St($),Qn=pk.indexOf($.PARSER_MEDIA_TYPE)===-1?mk:$.PARSER_MEDIA_TYPE,Ie=Qn==="application/xhtml+xml"?js:br,D=gt($,"ALLOWED_TAGS")?fe({},$.ALLOWED_TAGS,Ie):I,_=gt($,"ALLOWED_ATTR")?fe({},$.ALLOWED_ATTR,Ie):E,lt=gt($,"ALLOWED_NAMESPACES")?fe({},$.ALLOWED_NAMESPACES,js):dk,Xe=gt($,"ADD_URI_SAFE_ATTR")?fe(St(Pt),$.ADD_URI_SAFE_ATTR,Ie):Pt,ue=gt($,"ADD_DATA_URI_TAGS")?fe(St(ge),$.ADD_DATA_URI_TAGS,Ie):ge,V=gt($,"FORBID_CONTENTS")?fe({},$.FORBID_CONTENTS,Ie):se,M=gt($,"FORBID_TAGS")?fe({},$.FORBID_TAGS,Ie):St({}),X=gt($,"FORBID_ATTR")?fe({},$.FORBID_ATTR,Ie):St({}),L=gt($,"USE_PROFILES")?$.USE_PROFILES:!1,ae=$.ALLOW_ARIA_ATTR!==!1,ne=$.ALLOW_DATA_ATTR!==!1,C=$.ALLOW_UNKNOWN_PROTOCOLS||!1,R=$.ALLOW_SELF_CLOSE_IN_ATTR!==!1,z=$.SAFE_FOR_TEMPLATES||!1,G=$.SAFE_FOR_XML!==!1,Q=$.WHOLE_DOCUMENT||!1,Oe=$.RETURN_DOM||!1,Pe=$.RETURN_DOM_FRAGMENT||!1,Ae=$.RETURN_TRUSTED_TYPE||!1,Se=$.FORCE_BODY||!1,De=$.SANITIZE_DOM!==!1,_t=$.SANITIZE_NAMED_PROPS||!1,Lt=$.KEEP_CONTENT!==!1,vt=$.IN_PLACE||!1,k=$.ALLOWED_URI_REGEXP||Ll,Re=$.NAMESPACE||qe,Wi=$.MATHML_TEXT_INTEGRATION_POINTS||Wi,Yi=$.HTML_INTEGRATION_POINTS||Yi,P=$.CUSTOM_ELEMENT_HANDLING||Ln(null),$.CUSTOM_ELEMENT_HANDLING&&$f($.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(P.tagNameCheck=$.CUSTOM_ELEMENT_HANDLING.tagNameCheck),$.CUSTOM_ELEMENT_HANDLING&&$f($.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(P.attributeNameCheck=$.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),$.CUSTOM_ELEMENT_HANDLING&&typeof $.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(P.allowCustomizedBuiltInElements=$.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),z&&(ne=!1),Pe&&(Oe=!0),L&&(D=fe({},Nl),_=Ln(null),L.html===!0&&(fe(D,Rl),fe(_,Ml)),L.svg===!0&&(fe(D,Us),fe(_,Bs),fe(_,wr)),L.svgFilters===!0&&(fe(D,qs),fe(_,Bs),fe(_,wr)),L.mathMl===!0&&(fe(D,Hs),fe(_,Il),fe(_,wr))),J.tagCheck=null,J.attributeCheck=null,$.ADD_TAGS&&(typeof $.ADD_TAGS=="function"?J.tagCheck=$.ADD_TAGS:(D===I&&(D=St(D)),fe(D,$.ADD_TAGS,Ie))),$.ADD_ATTR&&(typeof $.ADD_ATTR=="function"?J.attributeCheck=$.ADD_ATTR:(_===E&&(_=St(_)),fe(_,$.ADD_ATTR,Ie))),$.ADD_URI_SAFE_ATTR&&fe(Xe,$.ADD_URI_SAFE_ATTR,Ie),$.FORBID_CONTENTS&&(V===se&&(V=St(V)),fe(V,$.FORBID_CONTENTS,Ie)),$.ADD_FORBID_CONTENTS&&(V===se&&(V=St(V)),fe(V,$.ADD_FORBID_CONTENTS,Ie)),Lt&&(D["#text"]=!0),Q&&fe(D,["html","head","body"]),D.table&&(fe(D,["tbody"]),delete M.tbody),$.TRUSTED_TYPES_POLICY){if(typeof $.TRUSTED_TYPES_POLICY.createHTML!="function")throw zn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof $.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw zn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=$.TRUSTED_TYPES_POLICY,v=S.createHTML("")}else S===void 0&&(S=B0(d,i)),S!==null&&typeof v=="string"&&(v=S.createHTML(""));Ve&&Ve($),Pn=$}},Cf=fe({},[...Us,...qs,...R0]),Of=fe({},[...Hs,...N0]),yk=function($){let W=b($);(!W||!W.tagName)&&(W={namespaceURI:Re,tagName:"template"});const te=br($.tagName),xe=br(W.tagName);return lt[$.namespaceURI]?$.namespaceURI===At?W.namespaceURI===qe?te==="svg":W.namespaceURI===nt?te==="svg"&&(xe==="annotation-xml"||Wi[xe]):!!Cf[te]:$.namespaceURI===nt?W.namespaceURI===qe?te==="math":W.namespaceURI===At?te==="math"&&Yi[xe]:!!Of[te]:$.namespaceURI===qe?W.namespaceURI===At&&!Yi[xe]||W.namespaceURI===nt&&!Wi[xe]?!1:!Of[te]&&(hk[te]||!Cf[te]):!!(Qn==="application/xhtml+xml"&<[$.namespaceURI]):!1},Tt=function($){jn(t.removed,{element:$});try{b($).removeChild($)}catch{y($)}},an=function($,W){try{jn(t.removed,{attribute:W.getAttributeNode($),from:W})}catch{jn(t.removed,{attribute:null,from:W})}if(W.removeAttribute($),$==="is")if(Oe||Pe)try{Tt(W)}catch{}else try{W.setAttribute($,"")}catch{}},Rf=function($){let W=null,te=null;if(Se)$="<remove></remove>"+$;else{const Ne=zs($,/^[\r\n\t ]+/);te=Ne&&Ne[0]}Qn==="application/xhtml+xml"&&Re===qe&&($='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+$+"</body></html>");const xe=S?S.createHTML($):$;if(Re===qe)try{W=new h().parseFromString(xe,Qn)}catch{}if(!W||!W.documentElement){W=w.createDocument(Re,"template",null);try{W.documentElement.innerHTML=Dt?v:xe}catch{}}const He=W.body||W.documentElement;return $&&te&&He.insertBefore(n.createTextNode(te),He.childNodes[0]||null),Re===qe?F.call(W,Q?"html":"body")[0]:Q?W.documentElement:He},Nf=function($){return x.call($.ownerDocument||$,$,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Ma=function($){return $ instanceof f&&(typeof $.nodeName!="string"||typeof $.textContent!="string"||typeof $.removeChild!="function"||!($.attributes instanceof c)||typeof $.removeAttribute!="function"||typeof $.setAttribute!="function"||typeof $.namespaceURI!="string"||typeof $.insertBefore!="function"||typeof $.hasChildNodes!="function")},Ia=function($){return typeof o=="function"&&$ instanceof o};function Ft(re,$,W){Fn(re,te=>{te.call(t,$,W,Pn)})}const Mf=function($){let W=null;if(Ft(O.beforeSanitizeElements,$,null),Ma($))return Tt($),!0;const te=Ie($.nodeName);if(Ft(O.uponSanitizeElement,$,{tagName:te,allowedTags:D}),G&&$.hasChildNodes()&&!Ia($.firstElementChild)&&We(/<[/\w!]/g,$.innerHTML)&&We(/<[/\w!]/g,$.textContent)||G&&$.namespaceURI===qe&&te==="style"&&Ia($.firstElementChild)||$.nodeType===qn.progressingInstruction||G&&$.nodeType===qn.comment&&We(/<[/\w]/g,$.data))return Tt($),!0;if(M[te]||!(J.tagCheck instanceof Function&&J.tagCheck(te))&&!D[te]){if(!M[te]&&Lf(te)&&(P.tagNameCheck instanceof RegExp&&We(P.tagNameCheck,te)||P.tagNameCheck instanceof Function&&P.tagNameCheck(te)))return!1;if(Lt&&!V[te]){const xe=b($)||$.parentNode,He=p($)||$.childNodes;if(He&&xe){const Ne=He.length;for(let rt=Ne-1;rt>=0;--rt){const ut=T(He[rt],!0);ut.__removalCount=($.__removalCount||0)+1,xe.insertBefore(ut,m($))}}}return Tt($),!0}return $ instanceof l&&!yk($)||(te==="noscript"||te==="noembed"||te==="noframes")&&We(/<\/no(script|embed|frames)/i,$.innerHTML)?(Tt($),!0):(z&&$.nodeType===qn.text&&(W=$.textContent,Fn([U,K,H],xe=>{W=mn(W,xe," ")}),$.textContent!==W&&(jn(t.removed,{element:$.cloneNode()}),$.textContent=W)),Ft(O.afterSanitizeElements,$,null),!1)},If=function($,W,te){if(X[W]||De&&(W==="id"||W==="name")&&(te in n||te in gk))return!1;if(!(ne&&!X[W]&&We(j,W))){if(!(ae&&We(B,W))){if(!(J.attributeCheck instanceof Function&&J.attributeCheck(W,$))){if(!_[W]||X[W]){if(!(Lf($)&&(P.tagNameCheck instanceof RegExp&&We(P.tagNameCheck,$)||P.tagNameCheck instanceof Function&&P.tagNameCheck($))&&(P.attributeNameCheck instanceof RegExp&&We(P.attributeNameCheck,W)||P.attributeNameCheck instanceof Function&&P.attributeNameCheck(W,$))||W==="is"&&P.allowCustomizedBuiltInElements&&(P.tagNameCheck instanceof RegExp&&We(P.tagNameCheck,te)||P.tagNameCheck instanceof Function&&P.tagNameCheck(te))))return!1}else if(!Xe[W]){if(!We(k,mn(te,q,""))){if(!((W==="src"||W==="xlink:href"||W==="href")&&$!=="script"&&D0(te,"data:")===0&&ue[$])){if(!(C&&!We(Z,mn(te,q,"")))){if(te)return!1}}}}}}}return!0},Lf=function($){return $!=="annotation-xml"&&zs($,ee)},Ff=function($){Ft(O.beforeSanitizeAttributes,$,null);const{attributes:W}=$;if(!W||Ma($))return;const te={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:_,forceKeepAttr:void 0};let xe=W.length;for(;xe--;){const He=W[xe],{name:Ne,namespaceURI:rt,value:ut}=He,Wt=Ie(Ne),La=ut;let je=Ne==="value"?La:$0(La);if(te.attrName=Wt,te.attrValue=je,te.keepAttr=!0,te.forceKeepAttr=void 0,Ft(O.uponSanitizeAttribute,$,te),je=te.attrValue,_t&&(Wt==="id"||Wt==="name")&&(an(Ne,$),je=Ue+je),G&&We(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,je)){an(Ne,$);continue}if(Wt==="attributename"&&zs(je,"href")){an(Ne,$);continue}if(te.forceKeepAttr)continue;if(!te.keepAttr){an(Ne,$);continue}if(!R&&We(/\/>/i,je)){an(Ne,$);continue}z&&Fn([U,K,H],Uf=>{je=mn(je,Uf," ")});const zf=Ie($.nodeName);if(!If(zf,Wt,je)){an(Ne,$);continue}if(S&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!rt)switch(d.getAttributeType(zf,Wt)){case"TrustedHTML":{je=S.createHTML(je);break}case"TrustedScriptURL":{je=S.createScriptURL(je);break}}if(je!==La)try{rt?$.setAttributeNS(rt,Ne,je):$.setAttribute(Ne,je),Ma($)?Tt($):Ol(t.removed)}catch{an(Ne,$)}}Ft(O.afterSanitizeAttributes,$,null)},jf=function($){let W=null;const te=Nf($);for(Ft(O.beforeSanitizeShadowDOM,$,null);W=te.nextNode();)Ft(O.uponSanitizeShadowNode,W,null),Mf(W),Ff(W),W.content instanceof s&&jf(W.content);Ft(O.afterSanitizeShadowDOM,$,null)};return t.sanitize=function(re){let $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},W=null,te=null,xe=null,He=null;if(Dt=!re,Dt&&(re="<!-->"),typeof re!="string"&&!Ia(re))if(typeof re.toString=="function"){if(re=re.toString(),typeof re!="string")throw zn("dirty is not a string, aborting")}else throw zn("toString is not a function");if(!t.isSupported)return re;if(oe||Na($),t.removed=[],typeof re=="string"&&(vt=!1),vt){if(re.nodeName){const ut=Ie(re.nodeName);if(!D[ut]||M[ut])throw zn("root node is forbidden and cannot be sanitized in-place")}}else if(re instanceof o)W=Rf("<!---->"),te=W.ownerDocument.importNode(re,!0),te.nodeType===qn.element&&te.nodeName==="BODY"||te.nodeName==="HTML"?W=te:W.appendChild(te);else{if(!Oe&&!z&&!Q&&re.indexOf("<")===-1)return S&&Ae?S.createHTML(re):re;if(W=Rf(re),!W)return Oe?null:Ae?v:""}W&&Se&&Tt(W.firstChild);const Ne=Nf(vt?re:W);for(;xe=Ne.nextNode();)Mf(xe),Ff(xe),xe.content instanceof s&&jf(xe.content);if(vt)return re;if(Oe){if(z){W.normalize();let ut=W.innerHTML;Fn([U,K,H],Wt=>{ut=mn(ut,Wt," ")}),W.innerHTML=ut}if(Pe)for(He=N.call(W.ownerDocument);W.firstChild;)He.appendChild(W.firstChild);else He=W;return(_.shadowroot||_.shadowrootmode)&&(He=A.call(r,He,!0)),He}let rt=Q?W.outerHTML:W.innerHTML;return Q&&D["!doctype"]&&W.ownerDocument&&W.ownerDocument.doctype&&W.ownerDocument.doctype.name&&We(Fl,W.ownerDocument.doctype.name)&&(rt="<!DOCTYPE "+W.ownerDocument.doctype.name+`>
|
|
37
|
+
`+rt),z&&Fn([U,K,H],ut=>{rt=mn(rt,ut," ")}),S&&Ae?S.createHTML(rt):rt},t.setConfig=function(){let re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Na(re),oe=!0},t.clearConfig=function(){Pn=null,oe=!1},t.isValidAttribute=function(re,$,W){Pn||Na({});const te=Ie(re),xe=Ie($);return If(te,xe,W)},t.addHook=function(re,$){typeof $=="function"&&jn(O[re],$)},t.removeHook=function(re,$){if($!==void 0){const W=P0(O[re],$);return W===-1?void 0:A0(O[re],W,1)[0]}return Ol(O[re])},t.removeHooks=function(re){O[re]=[]},t.removeAllHooks=function(){O=zl()},t}var V0=Ul();async function ql(e){const t=await ad().use(np).use(_g).use(oy,{allowDangerousHtml:!0}).use(k0,{allowDangerousHtml:!0}).process(e),n=String(t);return V0.sanitize(n)}let Zt=null;const W0={userInputContainer:"user-input-container",userInput:"user-input",submitIcon:"submit-icon",stopIcon:"stop-icon",messagesContainer:"messages-container",createButton:"create-button"};function Y0(e){if(Zt)return Zt;Zt={},Zt.root=e;for(const[t,n]of Object.entries(W0)){const r=e.getElementById(n);r||console.warn(`Element with id '${n}' not found`),Zt[t]=r}return Zt}function Ge(){return Zt}class G0{#n={copyButton:null,initCopyButton(){if(!this.copyButton){const t=document.createElement("template");t.innerHTML=`
|
|
38
38
|
<div class="button-container">
|
|
39
39
|
<button class="icon square plain tooltip" type="button" data-action="copy" aria-label="复制">
|
|
40
40
|
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 1024 1024"><path d="M298.667 256V128a42.667 42.667 0 0 1 42.666-42.667h512A42.667 42.667 0 0 1 896 128v597.333A42.667 42.667 0 0 1 853.333 768h-128v128c0 23.552-19.2 42.667-42.965 42.667H170.965A42.71 42.71 0 0 1 128 896l.128-597.333c0-23.552 19.2-42.667 42.923-42.667h127.616zm-85.248 85.333-.086 512H640v-512H213.419zM384 256h341.333v426.667h85.334v-512H384V256z"/></svg>
|
|
@@ -50,18 +50,18 @@
|
|
|
50
50
|
</div>
|
|
51
51
|
<div class="reasoning-content"></div>
|
|
52
52
|
</div>
|
|
53
|
-
`,this.reasoningContainer=t}return this.reasoningContainer}};#r=0;#t=null;#e=null;createCopyButton(t){const i=this.#n.initCopyButton().content.cloneNode(!0).firstElementChild;if(!i)return null;const s=i.querySelector(".tooltip-text");return s&&s.classList.add(t.role==="user"?"bottom-left":"bottom-right"),i}createMessage(t){const n=document.createElement("div"),r=document.createElement("div");r.className="body-container",n.appendChild(r);const i=document.createElement("div");i.className="content-container",r.appendChild(i);const s=this.createCopyButton(t);return s&&n.appendChild(s),n}updateMessageContent(t,n){const r=t.querySelector(".content-container");r&&requestAnimationFrame(async()=>{const i=await Ul(n);r.innerHTML=i})}pushMessage=t=>{if(!t)return;const{messagesContainer:n}=Ye(),{role:r,content:i}=t,s=this.createMessage(t);s.className=`message ${r}`,this.updateMessageContent(s,i),n.appendChild(s),r==="user"&&n.scrollTo({top:s.offsetTop-12,behavior:"smooth"})};pushMessages=t=>{if(t.length)for(const n of t)this.pushMessage(n)};pushLoadingMessage=()=>{const{messagesContainer:t}=Ye();requestAnimationFrame(()=>{if(t.querySelector(".message.assistant.loading"))return;const n=this.createMessage({role:"assistant",content:""});n.className="message assistant loading";const r=n.querySelector(".body-container");if(!r)return;const i=document.createElement("p");i.className="loading-dots",r.appendChild(i),t.appendChild(n)})};finishLoadingMessage=()=>{const{messagesContainer:t}=Ye();requestAnimationFrame(()=>{const n=t.querySelector(".message.assistant.loading");if(!n)return;n.classList.remove("loading"),n.querySelector(".loading-dots")?.remove()})};updateLoadingMessageContent=t=>{const{messagesContainer:n}=Ye(),r=n.querySelector(".message.assistant.loading");r&&this.updateMessageContent(r,t)};updateLoadingMessageReasoningContent=t=>{const{messagesContainer:n}=Ye(),r=n.querySelector(".message.assistant.loading");if(!r)return;if(!r.querySelector(".reasoning-container")){const o=this.#n.initReasoningContainer().content.cloneNode(!0).firstElementChild;if(!o)return;r.prepend(o)}const i=r.querySelector(".reasoning-content");i&&requestAnimationFrame(async()=>{const s=await Ul(t);i.innerHTML=s})};clear(){const t=Ye();t.messagesContainer.innerHTML=""}setPaddingBottom(){this.#e&&(this.#e.disconnect(),this.#e=null);const{root:t,messagesContainer:n}=Ye(),r=t.querySelector(".app-container");if(!r)return;const i=12,s=142,a=12;this.#e=new ResizeObserver(o=>{for(const l of o){const{height:u}=l.contentRect;u!==this.#r&&(this.#r=u,this.#t!==null&&cancelAnimationFrame(this.#t),this.#t=requestAnimationFrame(()=>{n.style.paddingBottom=`${u-i-s-a*2}px`,this.#t=null}))}}),this.#e.observe(r)}}const Ut={get value(){return Ye().userInput.value.trim()},setValue(e){const t=Ye();t.userInput.value=e},clear(){const e=Ye();e.userInput.value=""},focus(){Ye().userInput.focus()}},Vs={default(){const{submitIcon:e,stopIcon:t}=Ye();e.style.display="flex",t.style.display="none"},chatting(){const{submitIcon:e,stopIcon:t}=Ye();e.style.display="none",t.style.display="flex"}},G0={show(e){const{root:t}=Ye(),n=t.querySelector(".alert");n&&n.remove();const r=document.createElement("div");r.className="alert",r.textContent=e,t.appendChild(r),r.addEventListener("animationend",()=>{r.remove()})}},ot=new Y0;var _r={exports:{}},Ws={},$t={},Zt={},Ys={},Gs={},Ks={},ql;function vr(){return ql||(ql=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(p){if(super(),!e.IDENTIFIER.test(p))throw new Error("CodeGen: name must be a valid identifier");this.str=p}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class r extends t{constructor(p){super(),this._items=typeof p=="string"?[p]:p}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const p=this._items[0];return p===""||p==='""'}get str(){var p;return(p=this._str)!==null&&p!==void 0?p:this._str=this._items.reduce((b,S)=>`${b}${S}`,"")}get names(){var p;return(p=this._names)!==null&&p!==void 0?p:this._names=this._items.reduce((b,S)=>(S instanceof n&&(b[S.str]=(b[S.str]||0)+1),b),{})}}e._Code=r,e.nil=new r("");function i(m,...p){const b=[m[0]];let S=0;for(;S<p.length;)o(b,p[S]),b.push(m[++S]);return new r(b)}e._=i;const s=new r("+");function a(m,...p){const b=[d(m[0])];let S=0;for(;S<p.length;)b.push(s),o(b,p[S]),b.push(s,d(m[++S]));return l(b),new r(b)}e.str=a;function o(m,p){p instanceof r?m.push(...p._items):p instanceof n?m.push(p):m.push(f(p))}e.addCodeArg=o;function l(m){let p=1;for(;p<m.length-1;){if(m[p]===s){const b=u(m[p-1],m[p+1]);if(b!==void 0){m.splice(p-1,3,b);continue}m[p++]="+"}p++}}function u(m,p){if(p==='""')return m;if(m==='""')return p;if(typeof m=="string")return p instanceof n||m[m.length-1]!=='"'?void 0:typeof p!="string"?`${m.slice(0,-1)}${p}"`:p[0]==='"'?m.slice(0,-1)+p.slice(1):void 0;if(typeof p=="string"&&p[0]==='"'&&!(m instanceof n))return`"${m}${p.slice(1)}`}function c(m,p){return p.emptyStr()?m:m.emptyStr()?p:a`${m}${p}`}e.strConcat=c;function f(m){return typeof m=="number"||typeof m=="boolean"||m===null?m:d(Array.isArray(m)?m.join(","):m)}function h(m){return new r(d(m))}e.stringify=h;function d(m){return JSON.stringify(m).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=d;function g(m){return typeof m=="string"&&e.IDENTIFIER.test(m)?new r(`.${m}`):i`[${m}]`}e.getProperty=g;function T(m){if(typeof m=="string"&&e.IDENTIFIER.test(m))return new r(`${m}`);throw new Error(`CodeGen: invalid export name: ${m}, use explicit $id name mapping`)}e.getEsmExportName=T;function y(m){return new r(m.toString())}e.regexpCode=y})(Ks)),Ks}var Zs={},Hl;function Bl(){return Hl||(Hl=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=vr();class n extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}}var r;(function(l){l[l.Started=0]="Started",l[l.Completed=1]="Completed"})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class i{constructor({prefixes:u,parent:c}={}){this._names={},this._prefixes=u,this._parent=c}toName(u){return u instanceof t.Name?u:this.name(u)}name(u){return new t.Name(this._newName(u))}_newName(u){const c=this._names[u]||this._nameGroup(u);return`${u}${c.index++}`}_nameGroup(u){var c,f;if(!((f=(c=this._parent)===null||c===void 0?void 0:c._prefixes)===null||f===void 0)&&f.has(u)||this._prefixes&&!this._prefixes.has(u))throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);return this._names[u]={prefix:u,index:0}}}e.Scope=i;class s extends t.Name{constructor(u,c){super(c),this.prefix=u}setValue(u,{property:c,itemIndex:f}){this.value=u,this.scopePath=(0,t._)`.${new t.Name(c)}[${f}]`}}e.ValueScopeName=s;const a=(0,t._)`\n`;class o extends i{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts={...u,_n:u.lines?a:t.nil}}get(){return this._scope}name(u){return new s(u,this._newName(u))}value(u,c){var f;if(c.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const h=this.toName(u),{prefix:d}=h,g=(f=c.key)!==null&&f!==void 0?f:c.ref;let T=this._values[d];if(T){const p=T.get(g);if(p)return p}else T=this._values[d]=new Map;T.set(g,h);const y=this._scope[d]||(this._scope[d]=[]),m=y.length;return y[m]=c.ref,h.setValue(c,{property:d,itemIndex:m}),h}getValue(u,c){const f=this._values[u];if(f)return f.get(c)}scopeRefs(u,c=this._values){return this._reduceValues(c,f=>{if(f.scopePath===void 0)throw new Error(`CodeGen: name "${f}" has no value`);return(0,t._)`${u}${f.scopePath}`})}scopeCode(u=this._values,c,f){return this._reduceValues(u,h=>{if(h.value===void 0)throw new Error(`CodeGen: name "${h}" has no value`);return h.value.code},c,f)}_reduceValues(u,c,f={},h){let d=t.nil;for(const g in u){const T=u[g];if(!T)continue;const y=f[g]=f[g]||new Map;T.forEach(m=>{if(y.has(m))return;y.set(m,r.Started);let p=c(m);if(p){const b=this.opts.es5?e.varKinds.var:e.varKinds.const;d=(0,t._)`${d}${b} ${m} = ${p};${this.opts._n}`}else if(p=h?.(m))d=(0,t._)`${d}${p}${this.opts._n}`;else throw new n(m);y.set(m,r.Completed)})}return d}}e.ValueScope=o})(Zs)),Zs}var Vl;function he(){return Vl||(Vl=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=vr(),n=Bl();var r=vr();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var i=Bl();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.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 s{optimizeNodes(){return this}optimizeNames(E,P){return this}}class a extends s{constructor(E,P,M){super(),this.varKind=E,this.name=P,this.rhs=M}render({es5:E,_n:P}){const M=E?n.varKinds.var:this.varKind,X=this.rhs===void 0?"":` = ${this.rhs}`;return`${M} ${this.name}${X};`+P}optimizeNames(E,P){if(E[this.name.str])return this.rhs&&(this.rhs=H(this.rhs,E,P)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class o extends s{constructor(E,P,M){super(),this.lhs=E,this.rhs=P,this.sideEffects=M}render({_n:E}){return`${this.lhs} = ${this.rhs};`+E}optimizeNames(E,P){if(!(this.lhs instanceof t.Name&&!E[this.lhs.str]&&!this.sideEffects))return this.rhs=H(this.rhs,E,P),this}get names(){const E=this.lhs instanceof t.Name?{}:{...this.lhs.names};return K(E,this.rhs)}}class l extends o{constructor(E,P,M,X){super(E,M,X),this.op=P}render({_n:E}){return`${this.lhs} ${this.op}= ${this.rhs};`+E}}class u extends s{constructor(E){super(),this.label=E,this.names={}}render({_n:E}){return`${this.label}:`+E}}class c extends s{constructor(E){super(),this.label=E,this.names={}}render({_n:E}){return`break${this.label?` ${this.label}`:""};`+E}}class f extends s{constructor(E){super(),this.error=E}render({_n:E}){return`throw ${this.error};`+E}get names(){return this.error.names}}class h extends s{constructor(E){super(),this.code=E}render({_n:E}){return`${this.code};`+E}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(E,P){return this.code=H(this.code,E,P),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class d extends s{constructor(E=[]){super(),this.nodes=E}render(E){return this.nodes.reduce((P,M)=>P+M.render(E),"")}optimizeNodes(){const{nodes:E}=this;let P=E.length;for(;P--;){const M=E[P].optimizeNodes();Array.isArray(M)?E.splice(P,1,...M):M?E[P]=M:E.splice(P,1)}return E.length>0?this:void 0}optimizeNames(E,P){const{nodes:M}=this;let X=M.length;for(;X--;){const J=M[X];J.optimizeNames(E,P)||(j(E,J.names),M.splice(X,1))}return M.length>0?this:void 0}get names(){return this.nodes.reduce((E,P)=>U(E,P.names),{})}}class g extends d{render(E){return"{"+E._n+super.render(E)+"}"+E._n}}class T extends d{}class y extends g{}y.kind="else";class m extends g{constructor(E,P){super(P),this.condition=E}render(E){let P=`if(${this.condition})`+super.render(E);return this.else&&(P+="else "+this.else.render(E)),P}optimizeNodes(){super.optimizeNodes();const E=this.condition;if(E===!0)return this.nodes;let P=this.else;if(P){const M=P.optimizeNodes();P=this.else=Array.isArray(M)?new y(M):M}if(P)return E===!1?P instanceof m?P:P.nodes:this.nodes.length?this:new m(B(E),P instanceof m?[P]:P.nodes);if(!(E===!1||!this.nodes.length))return this}optimizeNames(E,P){var M;if(this.else=(M=this.else)===null||M===void 0?void 0:M.optimizeNames(E,P),!!(super.optimizeNames(E,P)||this.else))return this.condition=H(this.condition,E,P),this}get names(){const E=super.names;return K(E,this.condition),this.else&&U(E,this.else.names),E}}m.kind="if";class p extends g{}p.kind="for";class b extends p{constructor(E){super(),this.iteration=E}render(E){return`for(${this.iteration})`+super.render(E)}optimizeNames(E,P){if(super.optimizeNames(E,P))return this.iteration=H(this.iteration,E,P),this}get names(){return U(super.names,this.iteration.names)}}class S extends p{constructor(E,P,M,X){super(),this.varKind=E,this.name=P,this.from=M,this.to=X}render(E){const P=E.es5?n.varKinds.var:this.varKind,{name:M,from:X,to:J}=this;return`for(${P} ${M}=${X}; ${M}<${J}; ${M}++)`+super.render(E)}get names(){const E=K(super.names,this.from);return K(E,this.to)}}class v extends p{constructor(E,P,M,X){super(),this.loop=E,this.varKind=P,this.name=M,this.iterable=X}render(E){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(E)}optimizeNames(E,P){if(super.optimizeNames(E,P))return this.iterable=H(this.iterable,E,P),this}get names(){return U(super.names,this.iterable.names)}}class w extends g{constructor(E,P,M){super(),this.name=E,this.args=P,this.async=M}render(E){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(E)}}w.kind="func";class x extends d{render(E){return"return "+super.render(E)}}x.kind="return";class N extends g{render(E){let P="try"+super.render(E);return this.catch&&(P+=this.catch.render(E)),this.finally&&(P+=this.finally.render(E)),P}optimizeNodes(){var E,P;return super.optimizeNodes(),(E=this.catch)===null||E===void 0||E.optimizeNodes(),(P=this.finally)===null||P===void 0||P.optimizeNodes(),this}optimizeNames(E,P){var M,X;return super.optimizeNames(E,P),(M=this.catch)===null||M===void 0||M.optimizeNames(E,P),(X=this.finally)===null||X===void 0||X.optimizeNames(E,P),this}get names(){const E=super.names;return this.catch&&U(E,this.catch.names),this.finally&&U(E,this.finally.names),E}}class F extends g{constructor(E){super(),this.error=E}render(E){return`catch(${this.error})`+super.render(E)}}F.kind="catch";class A extends g{render(E){return"finally"+super.render(E)}}A.kind="finally";class O{constructor(E,P={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...P,_n:P.lines?`
|
|
54
|
-
`:""},this._extScope=E,this._scope=new n.Scope({parent:E}),this._nodes=[new T]}toString(){return this._root.render(this.opts)}name(E){return this._scope.name(E)}scopeName(E){return this._extScope.name(E)}scopeValue(E,P){const M=this._extScope.value(E,P);return(this._values[M.prefix]||(this._values[M.prefix]=new Set)).add(M),M}getScopeValue(E,P){return this._extScope.getValue(E,P)}scopeRefs(E){return this._extScope.scopeRefs(E,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(E,P,M,X){const J=this._scope.toName(P);return M!==void 0&&X&&(this._constants[J.str]=M),this._leafNode(new a(E,J,M)),J}const(E,P,M){return this._def(n.varKinds.const,E,P,M)}let(E,P,M){return this._def(n.varKinds.let,E,P,M)}var(E,P,M){return this._def(n.varKinds.var,E,P,M)}assign(E,P,M){return this._leafNode(new o(E,P,M))}add(E,P){return this._leafNode(new l(E,e.operators.ADD,P))}code(E){return typeof E=="function"?E():E!==t.nil&&this._leafNode(new h(E)),this}object(...E){const P=["{"];for(const[M,X]of E)P.length>1&&P.push(","),P.push(M),(M!==X||this.opts.es5)&&(P.push(":"),(0,t.addCodeArg)(P,X));return P.push("}"),new t._Code(P)}if(E,P,M){if(this._blockNode(new m(E)),P&&M)this.code(P).else().code(M).endIf();else if(P)this.code(P).endIf();else if(M)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(E){return this._elseNode(new m(E))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(m,y)}_for(E,P){return this._blockNode(E),P&&this.code(P).endFor(),this}for(E,P){return this._for(new b(E),P)}forRange(E,P,M,X,J=this.opts.es5?n.varKinds.var:n.varKinds.let){const ae=this._scope.toName(E);return this._for(new S(J,ae,P,M),()=>X(ae))}forOf(E,P,M,X=n.varKinds.const){const J=this._scope.toName(E);if(this.opts.es5){const ae=P instanceof t.Name?P:this.var("_arr",P);return this.forRange("_i",0,(0,t._)`${ae}.length`,ne=>{this.var(J,(0,t._)`${ae}[${ne}]`),M(J)})}return this._for(new v("of",X,J,P),()=>M(J))}forIn(E,P,M,X=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(E,(0,t._)`Object.keys(${P})`,M);const J=this._scope.toName(E);return this._for(new v("in",X,J,P),()=>M(J))}endFor(){return this._endBlockNode(p)}label(E){return this._leafNode(new u(E))}break(E){return this._leafNode(new c(E))}return(E){const P=new x;if(this._blockNode(P),this.code(E),P.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(x)}try(E,P,M){if(!P&&!M)throw new Error('CodeGen: "try" without "catch" and "finally"');const X=new N;if(this._blockNode(X),this.code(E),P){const J=this.name("e");this._currNode=X.catch=new F(J),P(J)}return M&&(this._currNode=X.finally=new A,this.code(M)),this._endBlockNode(F,A)}throw(E){return this._leafNode(new f(E))}block(E,P){return this._blockStarts.push(this._nodes.length),E&&this.code(E).endBlock(P),this}endBlock(E){const P=this._blockStarts.pop();if(P===void 0)throw new Error("CodeGen: not in self-balancing block");const M=this._nodes.length-P;if(M<0||E!==void 0&&M!==E)throw new Error(`CodeGen: wrong number of nodes: ${M} vs ${E} expected`);return this._nodes.length=P,this}func(E,P=t.nil,M,X){return this._blockNode(new w(E,P,M)),X&&this.code(X).endFunc(),this}endFunc(){return this._endBlockNode(w)}optimize(E=1){for(;E-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(E){return this._currNode.nodes.push(E),this}_blockNode(E){this._currNode.nodes.push(E),this._nodes.push(E)}_endBlockNode(E,P){const M=this._currNode;if(M instanceof E||P&&M instanceof P)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${P?`${E.kind}/${P.kind}`:E.kind}"`)}_elseNode(E){const P=this._currNode;if(!(P instanceof m))throw new Error('CodeGen: "else" without "if"');return this._currNode=P.else=E,this}get _root(){return this._nodes[0]}get _currNode(){const E=this._nodes;return E[E.length-1]}set _currNode(E){const P=this._nodes;P[P.length-1]=E}}e.CodeGen=O;function U(_,E){for(const P in E)_[P]=(_[P]||0)+(E[P]||0);return _}function K(_,E){return E instanceof t._CodeOrName?U(_,E.names):_}function H(_,E,P){if(_ instanceof t.Name)return M(_);if(!X(_))return _;return new t._Code(_._items.reduce((J,ae)=>(ae instanceof t.Name&&(ae=M(ae)),ae instanceof t._Code?J.push(...ae._items):J.push(ae),J),[]));function M(J){const ae=P[J.str];return ae===void 0||E[J.str]!==1?J:(delete E[J.str],ae)}function X(J){return J instanceof t._Code&&J._items.some(ae=>ae instanceof t.Name&&E[ae.str]===1&&P[ae.str]!==void 0)}}function j(_,E){for(const P in E)_[P]=(_[P]||0)-(E[P]||0)}function B(_){return typeof _=="boolean"||typeof _=="number"||_===null?!_:(0,t._)`!${I(_)}`}e.not=B;const Z=D(e.operators.AND);function q(..._){return _.reduce(Z)}e.and=q;const ee=D(e.operators.OR);function k(..._){return _.reduce(ee)}e.or=k;function D(_){return(E,P)=>E===t.nil?P:P===t.nil?E:(0,t._)`${I(E)} ${_} ${I(P)}`}function I(_){return _ instanceof t.Name?_:(0,t._)`(${_})`}})(Gs)),Gs}var ce={},Wl;function me(){if(Wl)return ce;Wl=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.checkStrictMode=ce.getErrorPath=ce.Type=ce.useFunc=ce.setEvaluated=ce.evaluatedPropsToName=ce.mergeEvaluated=ce.eachItem=ce.unescapeJsonPointer=ce.escapeJsonPointer=ce.escapeFragment=ce.unescapeFragment=ce.schemaRefOrVal=ce.schemaHasRulesButRef=ce.schemaHasRules=ce.checkUnknownRules=ce.alwaysValidSchema=ce.toHash=void 0;const e=he(),t=vr();function n(v){const w={};for(const x of v)w[x]=!0;return w}ce.toHash=n;function r(v,w){return typeof w=="boolean"?w:Object.keys(w).length===0?!0:(i(v,w),!s(w,v.self.RULES.all))}ce.alwaysValidSchema=r;function i(v,w=v.schema){const{opts:x,self:N}=v;if(!x.strictSchema||typeof w=="boolean")return;const F=N.RULES.keywords;for(const A in w)F[A]||S(v,`unknown keyword: "${A}"`)}ce.checkUnknownRules=i;function s(v,w){if(typeof v=="boolean")return!v;for(const x in v)if(w[x])return!0;return!1}ce.schemaHasRules=s;function a(v,w){if(typeof v=="boolean")return!v;for(const x in v)if(x!=="$ref"&&w.all[x])return!0;return!1}ce.schemaHasRulesButRef=a;function o({topSchemaRef:v,schemaPath:w},x,N,F){if(!F){if(typeof x=="number"||typeof x=="boolean")return x;if(typeof x=="string")return(0,e._)`${x}`}return(0,e._)`${v}${w}${(0,e.getProperty)(N)}`}ce.schemaRefOrVal=o;function l(v){return f(decodeURIComponent(v))}ce.unescapeFragment=l;function u(v){return encodeURIComponent(c(v))}ce.escapeFragment=u;function c(v){return typeof v=="number"?`${v}`:v.replace(/~/g,"~0").replace(/\//g,"~1")}ce.escapeJsonPointer=c;function f(v){return v.replace(/~1/g,"/").replace(/~0/g,"~")}ce.unescapeJsonPointer=f;function h(v,w){if(Array.isArray(v))for(const x of v)w(x);else w(v)}ce.eachItem=h;function d({mergeNames:v,mergeToName:w,mergeValues:x,resultToName:N}){return(F,A,O,U)=>{const K=O===void 0?A:O instanceof e.Name?(A instanceof e.Name?v(F,A,O):w(F,A,O),O):A instanceof e.Name?(w(F,O,A),A):x(A,O);return U===e.Name&&!(K instanceof e.Name)?N(F,K):K}}ce.mergeEvaluated={props:d({mergeNames:(v,w,x)=>v.if((0,e._)`${x} !== true && ${w} !== undefined`,()=>{v.if((0,e._)`${w} === true`,()=>v.assign(x,!0),()=>v.assign(x,(0,e._)`${x} || {}`).code((0,e._)`Object.assign(${x}, ${w})`))}),mergeToName:(v,w,x)=>v.if((0,e._)`${x} !== true`,()=>{w===!0?v.assign(x,!0):(v.assign(x,(0,e._)`${x} || {}`),T(v,x,w))}),mergeValues:(v,w)=>v===!0?!0:{...v,...w},resultToName:g}),items:d({mergeNames:(v,w,x)=>v.if((0,e._)`${x} !== true && ${w} !== undefined`,()=>v.assign(x,(0,e._)`${w} === true ? true : ${x} > ${w} ? ${x} : ${w}`)),mergeToName:(v,w,x)=>v.if((0,e._)`${x} !== true`,()=>v.assign(x,w===!0?!0:(0,e._)`${x} > ${w} ? ${x} : ${w}`)),mergeValues:(v,w)=>v===!0?!0:Math.max(v,w),resultToName:(v,w)=>v.var("items",w)})};function g(v,w){if(w===!0)return v.var("props",!0);const x=v.var("props",(0,e._)`{}`);return w!==void 0&&T(v,x,w),x}ce.evaluatedPropsToName=g;function T(v,w,x){Object.keys(x).forEach(N=>v.assign((0,e._)`${w}${(0,e.getProperty)(N)}`,!0))}ce.setEvaluated=T;const y={};function m(v,w){return v.scopeValue("func",{ref:w,code:y[w.code]||(y[w.code]=new t._Code(w.code))})}ce.useFunc=m;var p;(function(v){v[v.Num=0]="Num",v[v.Str=1]="Str"})(p||(ce.Type=p={}));function b(v,w,x){if(v instanceof e.Name){const N=w===p.Num;return x?N?(0,e._)`"[" + ${v} + "]"`:(0,e._)`"['" + ${v} + "']"`:N?(0,e._)`"/" + ${v}`:(0,e._)`"/" + ${v}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return x?(0,e.getProperty)(v).toString():"/"+c(v)}ce.getErrorPath=b;function S(v,w,x=v.opts.strictSchema){if(x){if(w=`strict mode: ${w}`,x===!0)throw new Error(w);v.self.logger.warn(w)}}return ce.checkStrictMode=S,ce}var Tr={},Yl;function qt(){if(Yl)return Tr;Yl=1,Object.defineProperty(Tr,"__esModule",{value:!0});const e=he(),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 Tr.default=t,Tr}var Gl;function kr(){return Gl||(Gl=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=he(),n=me(),r=qt();e.keywordError={message:({keyword:y})=>(0,t.str)`must pass "${y}" keyword validation`},e.keyword$DataError={message:({keyword:y,schemaType:m})=>m?(0,t.str)`"${y}" keyword must be ${m} ($data)`:(0,t.str)`"${y}" keyword is invalid ($data)`};function i(y,m=e.keywordError,p,b){const{it:S}=y,{gen:v,compositeRule:w,allErrors:x}=S,N=f(y,m,p);b??(w||x)?l(v,N):u(S,(0,t._)`[${N}]`)}e.reportError=i;function s(y,m=e.keywordError,p){const{it:b}=y,{gen:S,compositeRule:v,allErrors:w}=b,x=f(y,m,p);l(S,x),v||w||u(b,r.default.vErrors)}e.reportExtraError=s;function a(y,m){y.assign(r.default.errors,m),y.if((0,t._)`${r.default.vErrors} !== null`,()=>y.if(m,()=>y.assign((0,t._)`${r.default.vErrors}.length`,m),()=>y.assign(r.default.vErrors,null)))}e.resetErrorsCount=a;function o({gen:y,keyword:m,schemaValue:p,data:b,errsCount:S,it:v}){if(S===void 0)throw new Error("ajv implementation error");const w=y.name("err");y.forRange("i",S,r.default.errors,x=>{y.const(w,(0,t._)`${r.default.vErrors}[${x}]`),y.if((0,t._)`${w}.instancePath === undefined`,()=>y.assign((0,t._)`${w}.instancePath`,(0,t.strConcat)(r.default.instancePath,v.errorPath))),y.assign((0,t._)`${w}.schemaPath`,(0,t.str)`${v.errSchemaPath}/${m}`),v.opts.verbose&&(y.assign((0,t._)`${w}.schema`,p),y.assign((0,t._)`${w}.data`,b))})}e.extendErrors=o;function l(y,m){const p=y.const("err",m);y.if((0,t._)`${r.default.vErrors} === null`,()=>y.assign(r.default.vErrors,(0,t._)`[${p}]`),(0,t._)`${r.default.vErrors}.push(${p})`),y.code((0,t._)`${r.default.errors}++`)}function u(y,m){const{gen:p,validateName:b,schemaEnv:S}=y;S.$async?p.throw((0,t._)`new ${y.ValidationError}(${m})`):(p.assign((0,t._)`${b}.errors`,m),p.return(!1))}const c={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(y,m,p){const{createErrors:b}=y.it;return b===!1?(0,t._)`{}`:h(y,m,p)}function h(y,m,p={}){const{gen:b,it:S}=y,v=[d(S,p),g(y,p)];return T(y,m,v),b.object(...v)}function d({errorPath:y},{instancePath:m}){const p=m?(0,t.str)`${y}${(0,n.getErrorPath)(m,n.Type.Str)}`:y;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,p)]}function g({keyword:y,it:{errSchemaPath:m}},{schemaPath:p,parentSchema:b}){let S=b?m:(0,t.str)`${m}/${y}`;return p&&(S=(0,t.str)`${S}${(0,n.getErrorPath)(p,n.Type.Str)}`),[c.schemaPath,S]}function T(y,{params:m,message:p},b){const{keyword:S,data:v,schemaValue:w,it:x}=y,{opts:N,propertyName:F,topSchemaRef:A,schemaPath:O}=x;b.push([c.keyword,S],[c.params,typeof m=="function"?m(y):m||(0,t._)`{}`]),N.messages&&b.push([c.message,typeof p=="function"?p(y):p]),N.verbose&&b.push([c.schema,w],[c.parentSchema,(0,t._)`${A}${O}`],[r.default.data,v]),F&&b.push([c.propertyName,F])}})(Ys)),Ys}var Kl;function K0(){if(Kl)return Zt;Kl=1,Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.boolOrEmptySchema=Zt.topBoolOrEmptySchema=void 0;const e=kr(),t=he(),n=qt(),r={message:"boolean schema is false"};function i(o){const{gen:l,schema:u,validateName:c}=o;u===!1?a(o,!1):typeof u=="object"&&u.$async===!0?l.return(n.default.data):(l.assign((0,t._)`${c}.errors`,null),l.return(!0))}Zt.topBoolOrEmptySchema=i;function s(o,l){const{gen:u,schema:c}=o;c===!1?(u.var(l,!1),a(o)):u.var(l,!0)}Zt.boolOrEmptySchema=s;function a(o,l){const{gen:u,data:c}=o,f={gen:u,keyword:"false schema",data:c,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:o};(0,e.reportError)(f,r,void 0,l)}return Zt}var Fe={},Jt={},Zl;function Jl(){if(Zl)return Jt;Zl=1,Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.getRules=Jt.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function n(i){return typeof i=="string"&&t.has(i)}Jt.isJSONType=n;function r(){const i={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...i,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},i.number,i.string,i.array,i.object],post:{rules:[]},all:{},keywords:{}}}return Jt.getRules=r,Jt}var Ct={},Xl;function Ql(){if(Xl)return Ct;Xl=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.shouldUseRule=Ct.shouldUseGroup=Ct.schemaHasRulesForType=void 0;function e({schema:r,self:i},s){const a=i.RULES.types[s];return a&&a!==!0&&t(r,a)}Ct.schemaHasRulesForType=e;function t(r,i){return i.rules.some(s=>n(r,s))}Ct.shouldUseGroup=t;function n(r,i){var s;return r[i.keyword]!==void 0||((s=i.definition.implements)===null||s===void 0?void 0:s.some(a=>r[a]!==void 0))}return Ct.shouldUseRule=n,Ct}var eu;function Er(){if(eu)return Fe;eu=1,Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.reportTypeError=Fe.checkDataTypes=Fe.checkDataType=Fe.coerceAndCheckDataType=Fe.getJSONTypes=Fe.getSchemaTypes=Fe.DataType=void 0;const e=Jl(),t=Ql(),n=kr(),r=he(),i=me();var s;(function(p){p[p.Correct=0]="Correct",p[p.Wrong=1]="Wrong"})(s||(Fe.DataType=s={}));function a(p){const b=o(p.type);if(b.includes("null")){if(p.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!b.length&&p.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');p.nullable===!0&&b.push("null")}return b}Fe.getSchemaTypes=a;function o(p){const b=Array.isArray(p)?p:p?[p]:[];if(b.every(e.isJSONType))return b;throw new Error("type must be JSONType or JSONType[]: "+b.join(","))}Fe.getJSONTypes=o;function l(p,b){const{gen:S,data:v,opts:w}=p,x=c(b,w.coerceTypes),N=b.length>0&&!(x.length===0&&b.length===1&&(0,t.schemaHasRulesForType)(p,b[0]));if(N){const F=g(b,v,w.strictNumbers,s.Wrong);S.if(F,()=>{x.length?f(p,b,x):y(p)})}return N}Fe.coerceAndCheckDataType=l;const u=new Set(["string","number","integer","boolean","null"]);function c(p,b){return b?p.filter(S=>u.has(S)||b==="array"&&S==="array"):[]}function f(p,b,S){const{gen:v,data:w,opts:x}=p,N=v.let("dataType",(0,r._)`typeof ${w}`),F=v.let("coerced",(0,r._)`undefined`);x.coerceTypes==="array"&&v.if((0,r._)`${N} == 'object' && Array.isArray(${w}) && ${w}.length == 1`,()=>v.assign(w,(0,r._)`${w}[0]`).assign(N,(0,r._)`typeof ${w}`).if(g(b,w,x.strictNumbers),()=>v.assign(F,w))),v.if((0,r._)`${F} !== undefined`);for(const O of S)(u.has(O)||O==="array"&&x.coerceTypes==="array")&&A(O);v.else(),y(p),v.endIf(),v.if((0,r._)`${F} !== undefined`,()=>{v.assign(w,F),h(p,F)});function A(O){switch(O){case"string":v.elseIf((0,r._)`${N} == "number" || ${N} == "boolean"`).assign(F,(0,r._)`"" + ${w}`).elseIf((0,r._)`${w} === null`).assign(F,(0,r._)`""`);return;case"number":v.elseIf((0,r._)`${N} == "boolean" || ${w} === null
|
|
53
|
+
`,this.reasoningContainer=t}return this.reasoningContainer}};#r=0;#t=null;#e=null;createCopyButton(t){const i=this.#n.initCopyButton().content.cloneNode(!0).firstElementChild;if(!i)return null;const s=i.querySelector(".tooltip-text");return s&&s.classList.add(t.role==="user"?"bottom-left":"bottom-right"),i}createMessage(t){const n=document.createElement("div"),r=document.createElement("div");r.className="body-container",n.appendChild(r);const i=document.createElement("div");i.className="content-container",r.appendChild(i);const s=this.createCopyButton(t);return s&&n.appendChild(s),n}updateMessageContent(t,n){const r=t.querySelector(".content-container");r&&requestAnimationFrame(async()=>{const i=await ql(n);r.innerHTML=i})}pushMessage=t=>{if(!t)return;const{messagesContainer:n}=Ge(),{role:r,content:i}=t,s=this.createMessage(t);s.className=`message ${r}`,this.updateMessageContent(s,i),n.appendChild(s),r==="user"&&n.scrollTo({top:s.offsetTop-12,behavior:"smooth"})};pushMessages=t=>{if(t.length)for(const n of t)this.pushMessage(n)};pushLoadingMessage=()=>{const{messagesContainer:t}=Ge();requestAnimationFrame(()=>{if(t.querySelector(".message.assistant.loading"))return;const n=this.createMessage({role:"assistant",content:""});n.className="message assistant loading";const r=n.querySelector(".body-container");if(!r)return;const i=document.createElement("p");i.className="loading-dots",r.appendChild(i),t.appendChild(n)})};finishLoadingMessage=()=>{const{messagesContainer:t}=Ge();requestAnimationFrame(()=>{const n=t.querySelector(".message.assistant.loading");if(!n)return;n.classList.remove("loading"),n.querySelector(".loading-dots")?.remove()})};updateLoadingMessageContent=t=>{const{messagesContainer:n}=Ge(),r=n.querySelector(".message.assistant.loading");r&&this.updateMessageContent(r,t)};updateLoadingMessageReasoningContent=t=>{const{messagesContainer:n}=Ge(),r=n.querySelector(".message.assistant.loading");if(!r)return;if(!r.querySelector(".reasoning-container")){const o=this.#n.initReasoningContainer().content.cloneNode(!0).firstElementChild;if(!o)return;r.prepend(o)}const i=r.querySelector(".reasoning-content");i&&requestAnimationFrame(async()=>{const s=await ql(t);i.innerHTML=s})};clear(){const t=Ge();t.messagesContainer.innerHTML=""}setPaddingBottom(){this.#e&&(this.#e.disconnect(),this.#e=null);const{root:t,messagesContainer:n}=Ge(),r=t.querySelector(".app-container");if(!r)return;const i=12,s=142,a=12;this.#e=new ResizeObserver(o=>{for(const l of o){const{height:u}=l.contentRect;u!==this.#r&&(this.#r=u,this.#t!==null&&cancelAnimationFrame(this.#t),this.#t=requestAnimationFrame(()=>{n.style.paddingBottom=`${u-i-s-a*2}px`,this.#t=null}))}}),this.#e.observe(r)}}const Ut={get value(){return Ge().userInput.value.trim()},setValue(e){const t=Ge();t.userInput.value=e},clear(){const e=Ge();e.userInput.value=""},focus(){Ge().userInput.focus()}},Vs={default(){const{submitIcon:e,stopIcon:t}=Ge();e.style.display="flex",t.style.display="none"},chatting(){const{submitIcon:e,stopIcon:t}=Ge();e.style.display="none",t.style.display="flex"}},K0={show(e){const{root:t}=Ge(),n=t.querySelector(".alert");n&&n.remove();const r=document.createElement("div");r.className="alert",r.textContent=e,t.appendChild(r),r.addEventListener("animationend",()=>{r.remove()})}},at=new G0;var _r={exports:{}},Ws={},Ct={},Jt={},Ys={},Gs={},Ks={},Hl;function vr(){return Hl||(Hl=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(p){if(super(),!e.IDENTIFIER.test(p))throw new Error("CodeGen: name must be a valid identifier");this.str=p}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class r extends t{constructor(p){super(),this._items=typeof p=="string"?[p]:p}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const p=this._items[0];return p===""||p==='""'}get str(){var p;return(p=this._str)!==null&&p!==void 0?p:this._str=this._items.reduce((b,S)=>`${b}${S}`,"")}get names(){var p;return(p=this._names)!==null&&p!==void 0?p:this._names=this._items.reduce((b,S)=>(S instanceof n&&(b[S.str]=(b[S.str]||0)+1),b),{})}}e._Code=r,e.nil=new r("");function i(m,...p){const b=[m[0]];let S=0;for(;S<p.length;)o(b,p[S]),b.push(m[++S]);return new r(b)}e._=i;const s=new r("+");function a(m,...p){const b=[d(m[0])];let S=0;for(;S<p.length;)b.push(s),o(b,p[S]),b.push(s,d(m[++S]));return l(b),new r(b)}e.str=a;function o(m,p){p instanceof r?m.push(...p._items):p instanceof n?m.push(p):m.push(f(p))}e.addCodeArg=o;function l(m){let p=1;for(;p<m.length-1;){if(m[p]===s){const b=u(m[p-1],m[p+1]);if(b!==void 0){m.splice(p-1,3,b);continue}m[p++]="+"}p++}}function u(m,p){if(p==='""')return m;if(m==='""')return p;if(typeof m=="string")return p instanceof n||m[m.length-1]!=='"'?void 0:typeof p!="string"?`${m.slice(0,-1)}${p}"`:p[0]==='"'?m.slice(0,-1)+p.slice(1):void 0;if(typeof p=="string"&&p[0]==='"'&&!(m instanceof n))return`"${m}${p.slice(1)}`}function c(m,p){return p.emptyStr()?m:m.emptyStr()?p:a`${m}${p}`}e.strConcat=c;function f(m){return typeof m=="number"||typeof m=="boolean"||m===null?m:d(Array.isArray(m)?m.join(","):m)}function h(m){return new r(d(m))}e.stringify=h;function d(m){return JSON.stringify(m).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=d;function g(m){return typeof m=="string"&&e.IDENTIFIER.test(m)?new r(`.${m}`):i`[${m}]`}e.getProperty=g;function T(m){if(typeof m=="string"&&e.IDENTIFIER.test(m))return new r(`${m}`);throw new Error(`CodeGen: invalid export name: ${m}, use explicit $id name mapping`)}e.getEsmExportName=T;function y(m){return new r(m.toString())}e.regexpCode=y})(Ks)),Ks}var Zs={},Bl;function Vl(){return Bl||(Bl=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=vr();class n extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}}var r;(function(l){l[l.Started=0]="Started",l[l.Completed=1]="Completed"})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class i{constructor({prefixes:u,parent:c}={}){this._names={},this._prefixes=u,this._parent=c}toName(u){return u instanceof t.Name?u:this.name(u)}name(u){return new t.Name(this._newName(u))}_newName(u){const c=this._names[u]||this._nameGroup(u);return`${u}${c.index++}`}_nameGroup(u){var c,f;if(!((f=(c=this._parent)===null||c===void 0?void 0:c._prefixes)===null||f===void 0)&&f.has(u)||this._prefixes&&!this._prefixes.has(u))throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);return this._names[u]={prefix:u,index:0}}}e.Scope=i;class s extends t.Name{constructor(u,c){super(c),this.prefix=u}setValue(u,{property:c,itemIndex:f}){this.value=u,this.scopePath=(0,t._)`.${new t.Name(c)}[${f}]`}}e.ValueScopeName=s;const a=(0,t._)`\n`;class o extends i{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts={...u,_n:u.lines?a:t.nil}}get(){return this._scope}name(u){return new s(u,this._newName(u))}value(u,c){var f;if(c.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const h=this.toName(u),{prefix:d}=h,g=(f=c.key)!==null&&f!==void 0?f:c.ref;let T=this._values[d];if(T){const p=T.get(g);if(p)return p}else T=this._values[d]=new Map;T.set(g,h);const y=this._scope[d]||(this._scope[d]=[]),m=y.length;return y[m]=c.ref,h.setValue(c,{property:d,itemIndex:m}),h}getValue(u,c){const f=this._values[u];if(f)return f.get(c)}scopeRefs(u,c=this._values){return this._reduceValues(c,f=>{if(f.scopePath===void 0)throw new Error(`CodeGen: name "${f}" has no value`);return(0,t._)`${u}${f.scopePath}`})}scopeCode(u=this._values,c,f){return this._reduceValues(u,h=>{if(h.value===void 0)throw new Error(`CodeGen: name "${h}" has no value`);return h.value.code},c,f)}_reduceValues(u,c,f={},h){let d=t.nil;for(const g in u){const T=u[g];if(!T)continue;const y=f[g]=f[g]||new Map;T.forEach(m=>{if(y.has(m))return;y.set(m,r.Started);let p=c(m);if(p){const b=this.opts.es5?e.varKinds.var:e.varKinds.const;d=(0,t._)`${d}${b} ${m} = ${p};${this.opts._n}`}else if(p=h?.(m))d=(0,t._)`${d}${p}${this.opts._n}`;else throw new n(m);y.set(m,r.Completed)})}return d}}e.ValueScope=o})(Zs)),Zs}var Wl;function he(){return Wl||(Wl=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=vr(),n=Vl();var r=vr();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var i=Vl();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.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 s{optimizeNodes(){return this}optimizeNames(E,P){return this}}class a extends s{constructor(E,P,M){super(),this.varKind=E,this.name=P,this.rhs=M}render({es5:E,_n:P}){const M=E?n.varKinds.var:this.varKind,X=this.rhs===void 0?"":` = ${this.rhs}`;return`${M} ${this.name}${X};`+P}optimizeNames(E,P){if(E[this.name.str])return this.rhs&&(this.rhs=H(this.rhs,E,P)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class o extends s{constructor(E,P,M){super(),this.lhs=E,this.rhs=P,this.sideEffects=M}render({_n:E}){return`${this.lhs} = ${this.rhs};`+E}optimizeNames(E,P){if(!(this.lhs instanceof t.Name&&!E[this.lhs.str]&&!this.sideEffects))return this.rhs=H(this.rhs,E,P),this}get names(){const E=this.lhs instanceof t.Name?{}:{...this.lhs.names};return K(E,this.rhs)}}class l extends o{constructor(E,P,M,X){super(E,M,X),this.op=P}render({_n:E}){return`${this.lhs} ${this.op}= ${this.rhs};`+E}}class u extends s{constructor(E){super(),this.label=E,this.names={}}render({_n:E}){return`${this.label}:`+E}}class c extends s{constructor(E){super(),this.label=E,this.names={}}render({_n:E}){return`break${this.label?` ${this.label}`:""};`+E}}class f extends s{constructor(E){super(),this.error=E}render({_n:E}){return`throw ${this.error};`+E}get names(){return this.error.names}}class h extends s{constructor(E){super(),this.code=E}render({_n:E}){return`${this.code};`+E}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(E,P){return this.code=H(this.code,E,P),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class d extends s{constructor(E=[]){super(),this.nodes=E}render(E){return this.nodes.reduce((P,M)=>P+M.render(E),"")}optimizeNodes(){const{nodes:E}=this;let P=E.length;for(;P--;){const M=E[P].optimizeNodes();Array.isArray(M)?E.splice(P,1,...M):M?E[P]=M:E.splice(P,1)}return E.length>0?this:void 0}optimizeNames(E,P){const{nodes:M}=this;let X=M.length;for(;X--;){const J=M[X];J.optimizeNames(E,P)||(j(E,J.names),M.splice(X,1))}return M.length>0?this:void 0}get names(){return this.nodes.reduce((E,P)=>U(E,P.names),{})}}class g extends d{render(E){return"{"+E._n+super.render(E)+"}"+E._n}}class T extends d{}class y extends g{}y.kind="else";class m extends g{constructor(E,P){super(P),this.condition=E}render(E){let P=`if(${this.condition})`+super.render(E);return this.else&&(P+="else "+this.else.render(E)),P}optimizeNodes(){super.optimizeNodes();const E=this.condition;if(E===!0)return this.nodes;let P=this.else;if(P){const M=P.optimizeNodes();P=this.else=Array.isArray(M)?new y(M):M}if(P)return E===!1?P instanceof m?P:P.nodes:this.nodes.length?this:new m(B(E),P instanceof m?[P]:P.nodes);if(!(E===!1||!this.nodes.length))return this}optimizeNames(E,P){var M;if(this.else=(M=this.else)===null||M===void 0?void 0:M.optimizeNames(E,P),!!(super.optimizeNames(E,P)||this.else))return this.condition=H(this.condition,E,P),this}get names(){const E=super.names;return K(E,this.condition),this.else&&U(E,this.else.names),E}}m.kind="if";class p extends g{}p.kind="for";class b extends p{constructor(E){super(),this.iteration=E}render(E){return`for(${this.iteration})`+super.render(E)}optimizeNames(E,P){if(super.optimizeNames(E,P))return this.iteration=H(this.iteration,E,P),this}get names(){return U(super.names,this.iteration.names)}}class S extends p{constructor(E,P,M,X){super(),this.varKind=E,this.name=P,this.from=M,this.to=X}render(E){const P=E.es5?n.varKinds.var:this.varKind,{name:M,from:X,to:J}=this;return`for(${P} ${M}=${X}; ${M}<${J}; ${M}++)`+super.render(E)}get names(){const E=K(super.names,this.from);return K(E,this.to)}}class v extends p{constructor(E,P,M,X){super(),this.loop=E,this.varKind=P,this.name=M,this.iterable=X}render(E){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(E)}optimizeNames(E,P){if(super.optimizeNames(E,P))return this.iterable=H(this.iterable,E,P),this}get names(){return U(super.names,this.iterable.names)}}class w extends g{constructor(E,P,M){super(),this.name=E,this.args=P,this.async=M}render(E){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(E)}}w.kind="func";class x extends d{render(E){return"return "+super.render(E)}}x.kind="return";class N extends g{render(E){let P="try"+super.render(E);return this.catch&&(P+=this.catch.render(E)),this.finally&&(P+=this.finally.render(E)),P}optimizeNodes(){var E,P;return super.optimizeNodes(),(E=this.catch)===null||E===void 0||E.optimizeNodes(),(P=this.finally)===null||P===void 0||P.optimizeNodes(),this}optimizeNames(E,P){var M,X;return super.optimizeNames(E,P),(M=this.catch)===null||M===void 0||M.optimizeNames(E,P),(X=this.finally)===null||X===void 0||X.optimizeNames(E,P),this}get names(){const E=super.names;return this.catch&&U(E,this.catch.names),this.finally&&U(E,this.finally.names),E}}class F extends g{constructor(E){super(),this.error=E}render(E){return`catch(${this.error})`+super.render(E)}}F.kind="catch";class A extends g{render(E){return"finally"+super.render(E)}}A.kind="finally";class O{constructor(E,P={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...P,_n:P.lines?`
|
|
54
|
+
`:""},this._extScope=E,this._scope=new n.Scope({parent:E}),this._nodes=[new T]}toString(){return this._root.render(this.opts)}name(E){return this._scope.name(E)}scopeName(E){return this._extScope.name(E)}scopeValue(E,P){const M=this._extScope.value(E,P);return(this._values[M.prefix]||(this._values[M.prefix]=new Set)).add(M),M}getScopeValue(E,P){return this._extScope.getValue(E,P)}scopeRefs(E){return this._extScope.scopeRefs(E,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(E,P,M,X){const J=this._scope.toName(P);return M!==void 0&&X&&(this._constants[J.str]=M),this._leafNode(new a(E,J,M)),J}const(E,P,M){return this._def(n.varKinds.const,E,P,M)}let(E,P,M){return this._def(n.varKinds.let,E,P,M)}var(E,P,M){return this._def(n.varKinds.var,E,P,M)}assign(E,P,M){return this._leafNode(new o(E,P,M))}add(E,P){return this._leafNode(new l(E,e.operators.ADD,P))}code(E){return typeof E=="function"?E():E!==t.nil&&this._leafNode(new h(E)),this}object(...E){const P=["{"];for(const[M,X]of E)P.length>1&&P.push(","),P.push(M),(M!==X||this.opts.es5)&&(P.push(":"),(0,t.addCodeArg)(P,X));return P.push("}"),new t._Code(P)}if(E,P,M){if(this._blockNode(new m(E)),P&&M)this.code(P).else().code(M).endIf();else if(P)this.code(P).endIf();else if(M)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(E){return this._elseNode(new m(E))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(m,y)}_for(E,P){return this._blockNode(E),P&&this.code(P).endFor(),this}for(E,P){return this._for(new b(E),P)}forRange(E,P,M,X,J=this.opts.es5?n.varKinds.var:n.varKinds.let){const ae=this._scope.toName(E);return this._for(new S(J,ae,P,M),()=>X(ae))}forOf(E,P,M,X=n.varKinds.const){const J=this._scope.toName(E);if(this.opts.es5){const ae=P instanceof t.Name?P:this.var("_arr",P);return this.forRange("_i",0,(0,t._)`${ae}.length`,ne=>{this.var(J,(0,t._)`${ae}[${ne}]`),M(J)})}return this._for(new v("of",X,J,P),()=>M(J))}forIn(E,P,M,X=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(E,(0,t._)`Object.keys(${P})`,M);const J=this._scope.toName(E);return this._for(new v("in",X,J,P),()=>M(J))}endFor(){return this._endBlockNode(p)}label(E){return this._leafNode(new u(E))}break(E){return this._leafNode(new c(E))}return(E){const P=new x;if(this._blockNode(P),this.code(E),P.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(x)}try(E,P,M){if(!P&&!M)throw new Error('CodeGen: "try" without "catch" and "finally"');const X=new N;if(this._blockNode(X),this.code(E),P){const J=this.name("e");this._currNode=X.catch=new F(J),P(J)}return M&&(this._currNode=X.finally=new A,this.code(M)),this._endBlockNode(F,A)}throw(E){return this._leafNode(new f(E))}block(E,P){return this._blockStarts.push(this._nodes.length),E&&this.code(E).endBlock(P),this}endBlock(E){const P=this._blockStarts.pop();if(P===void 0)throw new Error("CodeGen: not in self-balancing block");const M=this._nodes.length-P;if(M<0||E!==void 0&&M!==E)throw new Error(`CodeGen: wrong number of nodes: ${M} vs ${E} expected`);return this._nodes.length=P,this}func(E,P=t.nil,M,X){return this._blockNode(new w(E,P,M)),X&&this.code(X).endFunc(),this}endFunc(){return this._endBlockNode(w)}optimize(E=1){for(;E-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(E){return this._currNode.nodes.push(E),this}_blockNode(E){this._currNode.nodes.push(E),this._nodes.push(E)}_endBlockNode(E,P){const M=this._currNode;if(M instanceof E||P&&M instanceof P)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${P?`${E.kind}/${P.kind}`:E.kind}"`)}_elseNode(E){const P=this._currNode;if(!(P instanceof m))throw new Error('CodeGen: "else" without "if"');return this._currNode=P.else=E,this}get _root(){return this._nodes[0]}get _currNode(){const E=this._nodes;return E[E.length-1]}set _currNode(E){const P=this._nodes;P[P.length-1]=E}}e.CodeGen=O;function U(_,E){for(const P in E)_[P]=(_[P]||0)+(E[P]||0);return _}function K(_,E){return E instanceof t._CodeOrName?U(_,E.names):_}function H(_,E,P){if(_ instanceof t.Name)return M(_);if(!X(_))return _;return new t._Code(_._items.reduce((J,ae)=>(ae instanceof t.Name&&(ae=M(ae)),ae instanceof t._Code?J.push(...ae._items):J.push(ae),J),[]));function M(J){const ae=P[J.str];return ae===void 0||E[J.str]!==1?J:(delete E[J.str],ae)}function X(J){return J instanceof t._Code&&J._items.some(ae=>ae instanceof t.Name&&E[ae.str]===1&&P[ae.str]!==void 0)}}function j(_,E){for(const P in E)_[P]=(_[P]||0)-(E[P]||0)}function B(_){return typeof _=="boolean"||typeof _=="number"||_===null?!_:(0,t._)`!${I(_)}`}e.not=B;const Z=D(e.operators.AND);function q(..._){return _.reduce(Z)}e.and=q;const ee=D(e.operators.OR);function k(..._){return _.reduce(ee)}e.or=k;function D(_){return(E,P)=>E===t.nil?P:P===t.nil?E:(0,t._)`${I(E)} ${_} ${I(P)}`}function I(_){return _ instanceof t.Name?_:(0,t._)`(${_})`}})(Gs)),Gs}var ce={},Yl;function me(){if(Yl)return ce;Yl=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.checkStrictMode=ce.getErrorPath=ce.Type=ce.useFunc=ce.setEvaluated=ce.evaluatedPropsToName=ce.mergeEvaluated=ce.eachItem=ce.unescapeJsonPointer=ce.escapeJsonPointer=ce.escapeFragment=ce.unescapeFragment=ce.schemaRefOrVal=ce.schemaHasRulesButRef=ce.schemaHasRules=ce.checkUnknownRules=ce.alwaysValidSchema=ce.toHash=void 0;const e=he(),t=vr();function n(v){const w={};for(const x of v)w[x]=!0;return w}ce.toHash=n;function r(v,w){return typeof w=="boolean"?w:Object.keys(w).length===0?!0:(i(v,w),!s(w,v.self.RULES.all))}ce.alwaysValidSchema=r;function i(v,w=v.schema){const{opts:x,self:N}=v;if(!x.strictSchema||typeof w=="boolean")return;const F=N.RULES.keywords;for(const A in w)F[A]||S(v,`unknown keyword: "${A}"`)}ce.checkUnknownRules=i;function s(v,w){if(typeof v=="boolean")return!v;for(const x in v)if(w[x])return!0;return!1}ce.schemaHasRules=s;function a(v,w){if(typeof v=="boolean")return!v;for(const x in v)if(x!=="$ref"&&w.all[x])return!0;return!1}ce.schemaHasRulesButRef=a;function o({topSchemaRef:v,schemaPath:w},x,N,F){if(!F){if(typeof x=="number"||typeof x=="boolean")return x;if(typeof x=="string")return(0,e._)`${x}`}return(0,e._)`${v}${w}${(0,e.getProperty)(N)}`}ce.schemaRefOrVal=o;function l(v){return f(decodeURIComponent(v))}ce.unescapeFragment=l;function u(v){return encodeURIComponent(c(v))}ce.escapeFragment=u;function c(v){return typeof v=="number"?`${v}`:v.replace(/~/g,"~0").replace(/\//g,"~1")}ce.escapeJsonPointer=c;function f(v){return v.replace(/~1/g,"/").replace(/~0/g,"~")}ce.unescapeJsonPointer=f;function h(v,w){if(Array.isArray(v))for(const x of v)w(x);else w(v)}ce.eachItem=h;function d({mergeNames:v,mergeToName:w,mergeValues:x,resultToName:N}){return(F,A,O,U)=>{const K=O===void 0?A:O instanceof e.Name?(A instanceof e.Name?v(F,A,O):w(F,A,O),O):A instanceof e.Name?(w(F,O,A),A):x(A,O);return U===e.Name&&!(K instanceof e.Name)?N(F,K):K}}ce.mergeEvaluated={props:d({mergeNames:(v,w,x)=>v.if((0,e._)`${x} !== true && ${w} !== undefined`,()=>{v.if((0,e._)`${w} === true`,()=>v.assign(x,!0),()=>v.assign(x,(0,e._)`${x} || {}`).code((0,e._)`Object.assign(${x}, ${w})`))}),mergeToName:(v,w,x)=>v.if((0,e._)`${x} !== true`,()=>{w===!0?v.assign(x,!0):(v.assign(x,(0,e._)`${x} || {}`),T(v,x,w))}),mergeValues:(v,w)=>v===!0?!0:{...v,...w},resultToName:g}),items:d({mergeNames:(v,w,x)=>v.if((0,e._)`${x} !== true && ${w} !== undefined`,()=>v.assign(x,(0,e._)`${w} === true ? true : ${x} > ${w} ? ${x} : ${w}`)),mergeToName:(v,w,x)=>v.if((0,e._)`${x} !== true`,()=>v.assign(x,w===!0?!0:(0,e._)`${x} > ${w} ? ${x} : ${w}`)),mergeValues:(v,w)=>v===!0?!0:Math.max(v,w),resultToName:(v,w)=>v.var("items",w)})};function g(v,w){if(w===!0)return v.var("props",!0);const x=v.var("props",(0,e._)`{}`);return w!==void 0&&T(v,x,w),x}ce.evaluatedPropsToName=g;function T(v,w,x){Object.keys(x).forEach(N=>v.assign((0,e._)`${w}${(0,e.getProperty)(N)}`,!0))}ce.setEvaluated=T;const y={};function m(v,w){return v.scopeValue("func",{ref:w,code:y[w.code]||(y[w.code]=new t._Code(w.code))})}ce.useFunc=m;var p;(function(v){v[v.Num=0]="Num",v[v.Str=1]="Str"})(p||(ce.Type=p={}));function b(v,w,x){if(v instanceof e.Name){const N=w===p.Num;return x?N?(0,e._)`"[" + ${v} + "]"`:(0,e._)`"['" + ${v} + "']"`:N?(0,e._)`"/" + ${v}`:(0,e._)`"/" + ${v}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return x?(0,e.getProperty)(v).toString():"/"+c(v)}ce.getErrorPath=b;function S(v,w,x=v.opts.strictSchema){if(x){if(w=`strict mode: ${w}`,x===!0)throw new Error(w);v.self.logger.warn(w)}}return ce.checkStrictMode=S,ce}var Tr={},Gl;function qt(){if(Gl)return Tr;Gl=1,Object.defineProperty(Tr,"__esModule",{value:!0});const e=he(),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 Tr.default=t,Tr}var Kl;function kr(){return Kl||(Kl=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=he(),n=me(),r=qt();e.keywordError={message:({keyword:y})=>(0,t.str)`must pass "${y}" keyword validation`},e.keyword$DataError={message:({keyword:y,schemaType:m})=>m?(0,t.str)`"${y}" keyword must be ${m} ($data)`:(0,t.str)`"${y}" keyword is invalid ($data)`};function i(y,m=e.keywordError,p,b){const{it:S}=y,{gen:v,compositeRule:w,allErrors:x}=S,N=f(y,m,p);b??(w||x)?l(v,N):u(S,(0,t._)`[${N}]`)}e.reportError=i;function s(y,m=e.keywordError,p){const{it:b}=y,{gen:S,compositeRule:v,allErrors:w}=b,x=f(y,m,p);l(S,x),v||w||u(b,r.default.vErrors)}e.reportExtraError=s;function a(y,m){y.assign(r.default.errors,m),y.if((0,t._)`${r.default.vErrors} !== null`,()=>y.if(m,()=>y.assign((0,t._)`${r.default.vErrors}.length`,m),()=>y.assign(r.default.vErrors,null)))}e.resetErrorsCount=a;function o({gen:y,keyword:m,schemaValue:p,data:b,errsCount:S,it:v}){if(S===void 0)throw new Error("ajv implementation error");const w=y.name("err");y.forRange("i",S,r.default.errors,x=>{y.const(w,(0,t._)`${r.default.vErrors}[${x}]`),y.if((0,t._)`${w}.instancePath === undefined`,()=>y.assign((0,t._)`${w}.instancePath`,(0,t.strConcat)(r.default.instancePath,v.errorPath))),y.assign((0,t._)`${w}.schemaPath`,(0,t.str)`${v.errSchemaPath}/${m}`),v.opts.verbose&&(y.assign((0,t._)`${w}.schema`,p),y.assign((0,t._)`${w}.data`,b))})}e.extendErrors=o;function l(y,m){const p=y.const("err",m);y.if((0,t._)`${r.default.vErrors} === null`,()=>y.assign(r.default.vErrors,(0,t._)`[${p}]`),(0,t._)`${r.default.vErrors}.push(${p})`),y.code((0,t._)`${r.default.errors}++`)}function u(y,m){const{gen:p,validateName:b,schemaEnv:S}=y;S.$async?p.throw((0,t._)`new ${y.ValidationError}(${m})`):(p.assign((0,t._)`${b}.errors`,m),p.return(!1))}const c={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(y,m,p){const{createErrors:b}=y.it;return b===!1?(0,t._)`{}`:h(y,m,p)}function h(y,m,p={}){const{gen:b,it:S}=y,v=[d(S,p),g(y,p)];return T(y,m,v),b.object(...v)}function d({errorPath:y},{instancePath:m}){const p=m?(0,t.str)`${y}${(0,n.getErrorPath)(m,n.Type.Str)}`:y;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,p)]}function g({keyword:y,it:{errSchemaPath:m}},{schemaPath:p,parentSchema:b}){let S=b?m:(0,t.str)`${m}/${y}`;return p&&(S=(0,t.str)`${S}${(0,n.getErrorPath)(p,n.Type.Str)}`),[c.schemaPath,S]}function T(y,{params:m,message:p},b){const{keyword:S,data:v,schemaValue:w,it:x}=y,{opts:N,propertyName:F,topSchemaRef:A,schemaPath:O}=x;b.push([c.keyword,S],[c.params,typeof m=="function"?m(y):m||(0,t._)`{}`]),N.messages&&b.push([c.message,typeof p=="function"?p(y):p]),N.verbose&&b.push([c.schema,w],[c.parentSchema,(0,t._)`${A}${O}`],[r.default.data,v]),F&&b.push([c.propertyName,F])}})(Ys)),Ys}var Zl;function Z0(){if(Zl)return Jt;Zl=1,Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.boolOrEmptySchema=Jt.topBoolOrEmptySchema=void 0;const e=kr(),t=he(),n=qt(),r={message:"boolean schema is false"};function i(o){const{gen:l,schema:u,validateName:c}=o;u===!1?a(o,!1):typeof u=="object"&&u.$async===!0?l.return(n.default.data):(l.assign((0,t._)`${c}.errors`,null),l.return(!0))}Jt.topBoolOrEmptySchema=i;function s(o,l){const{gen:u,schema:c}=o;c===!1?(u.var(l,!1),a(o)):u.var(l,!0)}Jt.boolOrEmptySchema=s;function a(o,l){const{gen:u,data:c}=o,f={gen:u,keyword:"false schema",data:c,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:o};(0,e.reportError)(f,r,void 0,l)}return Jt}var Fe={},Xt={},Jl;function Xl(){if(Jl)return Xt;Jl=1,Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.getRules=Xt.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function n(i){return typeof i=="string"&&t.has(i)}Xt.isJSONType=n;function r(){const i={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...i,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},i.number,i.string,i.array,i.object],post:{rules:[]},all:{},keywords:{}}}return Xt.getRules=r,Xt}var Ot={},Ql;function eu(){if(Ql)return Ot;Ql=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.shouldUseRule=Ot.shouldUseGroup=Ot.schemaHasRulesForType=void 0;function e({schema:r,self:i},s){const a=i.RULES.types[s];return a&&a!==!0&&t(r,a)}Ot.schemaHasRulesForType=e;function t(r,i){return i.rules.some(s=>n(r,s))}Ot.shouldUseGroup=t;function n(r,i){var s;return r[i.keyword]!==void 0||((s=i.definition.implements)===null||s===void 0?void 0:s.some(a=>r[a]!==void 0))}return Ot.shouldUseRule=n,Ot}var tu;function Er(){if(tu)return Fe;tu=1,Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.reportTypeError=Fe.checkDataTypes=Fe.checkDataType=Fe.coerceAndCheckDataType=Fe.getJSONTypes=Fe.getSchemaTypes=Fe.DataType=void 0;const e=Xl(),t=eu(),n=kr(),r=he(),i=me();var s;(function(p){p[p.Correct=0]="Correct",p[p.Wrong=1]="Wrong"})(s||(Fe.DataType=s={}));function a(p){const b=o(p.type);if(b.includes("null")){if(p.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!b.length&&p.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');p.nullable===!0&&b.push("null")}return b}Fe.getSchemaTypes=a;function o(p){const b=Array.isArray(p)?p:p?[p]:[];if(b.every(e.isJSONType))return b;throw new Error("type must be JSONType or JSONType[]: "+b.join(","))}Fe.getJSONTypes=o;function l(p,b){const{gen:S,data:v,opts:w}=p,x=c(b,w.coerceTypes),N=b.length>0&&!(x.length===0&&b.length===1&&(0,t.schemaHasRulesForType)(p,b[0]));if(N){const F=g(b,v,w.strictNumbers,s.Wrong);S.if(F,()=>{x.length?f(p,b,x):y(p)})}return N}Fe.coerceAndCheckDataType=l;const u=new Set(["string","number","integer","boolean","null"]);function c(p,b){return b?p.filter(S=>u.has(S)||b==="array"&&S==="array"):[]}function f(p,b,S){const{gen:v,data:w,opts:x}=p,N=v.let("dataType",(0,r._)`typeof ${w}`),F=v.let("coerced",(0,r._)`undefined`);x.coerceTypes==="array"&&v.if((0,r._)`${N} == 'object' && Array.isArray(${w}) && ${w}.length == 1`,()=>v.assign(w,(0,r._)`${w}[0]`).assign(N,(0,r._)`typeof ${w}`).if(g(b,w,x.strictNumbers),()=>v.assign(F,w))),v.if((0,r._)`${F} !== undefined`);for(const O of S)(u.has(O)||O==="array"&&x.coerceTypes==="array")&&A(O);v.else(),y(p),v.endIf(),v.if((0,r._)`${F} !== undefined`,()=>{v.assign(w,F),h(p,F)});function A(O){switch(O){case"string":v.elseIf((0,r._)`${N} == "number" || ${N} == "boolean"`).assign(F,(0,r._)`"" + ${w}`).elseIf((0,r._)`${w} === null`).assign(F,(0,r._)`""`);return;case"number":v.elseIf((0,r._)`${N} == "boolean" || ${w} === null
|
|
55
55
|
|| (${N} == "string" && ${w} && ${w} == +${w})`).assign(F,(0,r._)`+${w}`);return;case"integer":v.elseIf((0,r._)`${N} === "boolean" || ${w} === null
|
|
56
56
|
|| (${N} === "string" && ${w} && ${w} == +${w} && !(${w} % 1))`).assign(F,(0,r._)`+${w}`);return;case"boolean":v.elseIf((0,r._)`${w} === "false" || ${w} === 0 || ${w} === null`).assign(F,!1).elseIf((0,r._)`${w} === "true" || ${w} === 1`).assign(F,!0);return;case"null":v.elseIf((0,r._)`${w} === "" || ${w} === 0 || ${w} === false`),v.assign(F,null);return;case"array":v.elseIf((0,r._)`${N} === "string" || ${N} === "number"
|
|
57
|
-
|| ${N} === "boolean" || ${w} === null`).assign(F,(0,r._)`[${w}]`)}}}function h({gen:p,parentData:b,parentDataProperty:S},v){p.if((0,r._)`${b} !== undefined`,()=>p.assign((0,r._)`${b}[${S}]`,v))}function d(p,b,S,v=s.Correct){const w=v===s.Correct?r.operators.EQ:r.operators.NEQ;let x;switch(p){case"null":return(0,r._)`${b} ${w} null`;case"array":x=(0,r._)`Array.isArray(${b})`;break;case"object":x=(0,r._)`${b} && typeof ${b} == "object" && !Array.isArray(${b})`;break;case"integer":x=N((0,r._)`!(${b} % 1) && !isNaN(${b})`);break;case"number":x=N();break;default:return(0,r._)`typeof ${b} ${w} ${p}`}return v===s.Correct?x:(0,r.not)(x);function N(F=r.nil){return(0,r.and)((0,r._)`typeof ${b} == "number"`,F,S?(0,r._)`isFinite(${b})`:r.nil)}}Fe.checkDataType=d;function g(p,b,S,v){if(p.length===1)return d(p[0],b,S,v);let w;const x=(0,i.toHash)(p);if(x.array&&x.object){const N=(0,r._)`typeof ${b} != "object"`;w=x.null?N:(0,r._)`!${b} || ${N}`,delete x.null,delete x.array,delete x.object}else w=r.nil;x.number&&delete x.integer;for(const N in x)w=(0,r.and)(w,d(N,b,S,v));return w}Fe.checkDataTypes=g;const T={message:({schema:p})=>`must be ${p}`,params:({schema:p,schemaValue:b})=>typeof p=="string"?(0,r._)`{type: ${p}}`:(0,r._)`{type: ${b}}`};function y(p){const b=m(p);(0,n.reportError)(b,T)}Fe.reportTypeError=y;function m(p){const{gen:b,data:S,schema:v}=p,w=(0,i.schemaRefOrVal)(p,v,"type");return{gen:b,keyword:"type",data:S,schema:v.type,schemaCode:w,schemaValue:w,parentSchema:v,params:{},it:p}}return Fe}var Un={},tu;function Z0(){if(tu)return Un;tu=1,Object.defineProperty(Un,"__esModule",{value:!0}),Un.assignDefaults=void 0;const e=he(),t=me();function n(i,s){const{properties:a,items:o}=i.schema;if(s==="object"&&a)for(const l in a)r(i,l,a[l].default);else s==="array"&&Array.isArray(o)&&o.forEach((l,u)=>r(i,u,l.default))}Un.assignDefaults=n;function r(i,s,a){const{gen:o,compositeRule:l,data:u,opts:c}=i;if(a===void 0)return;const f=(0,e._)`${u}${(0,e.getProperty)(s)}`;if(l){(0,t.checkStrictMode)(i,`default is ignored for: ${f}`);return}let h=(0,e._)`${f} === undefined`;c.useDefaults==="empty"&&(h=(0,e._)`${h} || ${f} === null || ${f} === ""`),o.if(h,(0,e._)`${f} = ${(0,e.stringify)(a)}`)}return Un}var gt={},be={},nu;function yt(){if(nu)return be;nu=1,Object.defineProperty(be,"__esModule",{value:!0}),be.validateUnion=be.validateArray=be.usePattern=be.callValidateCode=be.schemaProperties=be.allSchemaProperties=be.noPropertyInData=be.propertyInData=be.isOwnProperty=be.hasPropFunc=be.reportMissingProp=be.checkMissingProp=be.checkReportMissingProp=void 0;const e=he(),t=me(),n=qt(),r=me();function i(p,b){const{gen:S,data:v,it:w}=p;S.if(c(S,v,b,w.opts.ownProperties),()=>{p.setParams({missingProperty:(0,e._)`${b}`},!0),p.error()})}be.checkReportMissingProp=i;function s({gen:p,data:b,it:{opts:S}},v,w){return(0,e.or)(...v.map(x=>(0,e.and)(c(p,b,x,S.ownProperties),(0,e._)`${w} = ${x}`)))}be.checkMissingProp=s;function a(p,b){p.setParams({missingProperty:b},!0),p.error()}be.reportMissingProp=a;function o(p){return p.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}be.hasPropFunc=o;function l(p,b,S){return(0,e._)`${o(p)}.call(${b}, ${S})`}be.isOwnProperty=l;function u(p,b,S,v){const w=(0,e._)`${b}${(0,e.getProperty)(S)} !== undefined`;return v?(0,e._)`${w} && ${l(p,b,S)}`:w}be.propertyInData=u;function c(p,b,S,v){const w=(0,e._)`${b}${(0,e.getProperty)(S)} === undefined`;return v?(0,e.or)(w,(0,e.not)(l(p,b,S))):w}be.noPropertyInData=c;function f(p){return p?Object.keys(p).filter(b=>b!=="__proto__"):[]}be.allSchemaProperties=f;function h(p,b){return f(b).filter(S=>!(0,t.alwaysValidSchema)(p,b[S]))}be.schemaProperties=h;function d({schemaCode:p,data:b,it:{gen:S,topSchemaRef:v,schemaPath:w,errorPath:x},it:N},F,A,O){const U=O?(0,e._)`${p}, ${b}, ${v}${w}`:b,K=[[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,x)],[n.default.parentData,N.parentData],[n.default.parentDataProperty,N.parentDataProperty],[n.default.rootData,n.default.rootData]];N.opts.dynamicRef&&K.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);const H=(0,e._)`${U}, ${S.object(...K)}`;return A!==e.nil?(0,e._)`${F}.call(${A}, ${H})`:(0,e._)`${F}(${H})`}be.callValidateCode=d;const g=(0,e._)`new RegExp`;function T({gen:p,it:{opts:b}},S){const v=b.unicodeRegExp?"u":"",{regExp:w}=b.code,x=w(S,v);return p.scopeValue("pattern",{key:x.toString(),ref:x,code:(0,e._)`${w.code==="new RegExp"?g:(0,r.useFunc)(p,w)}(${S}, ${v})`})}be.usePattern=T;function y(p){const{gen:b,data:S,keyword:v,it:w}=p,x=b.name("valid");if(w.allErrors){const F=b.let("valid",!0);return N(()=>b.assign(F,!1)),F}return b.var(x,!0),N(()=>b.break()),x;function N(F){const A=b.const("len",(0,e._)`${S}.length`);b.forRange("i",0,A,O=>{p.subschema({keyword:v,dataProp:O,dataPropType:t.Type.Num},x),b.if((0,e.not)(x),F)})}}be.validateArray=y;function m(p){const{gen:b,schema:S,keyword:v,it:w}=p;if(!Array.isArray(S))throw new Error("ajv implementation error");if(S.some(A=>(0,t.alwaysValidSchema)(w,A))&&!w.opts.unevaluated)return;const N=b.let("valid",!1),F=b.name("_valid");b.block(()=>S.forEach((A,O)=>{const U=p.subschema({keyword:v,schemaProp:O,compositeRule:!0},F);b.assign(N,(0,e._)`${N} || ${F}`),p.mergeValidEvaluated(U,F)||b.if((0,e.not)(N))})),p.result(N,()=>p.reset(),()=>p.error(!0))}return be.validateUnion=m,be}var ru;function J0(){if(ru)return gt;ru=1,Object.defineProperty(gt,"__esModule",{value:!0}),gt.validateKeywordUsage=gt.validSchemaType=gt.funcKeywordCode=gt.macroKeywordCode=void 0;const e=he(),t=qt(),n=yt(),r=kr();function i(h,d){const{gen:g,keyword:T,schema:y,parentSchema:m,it:p}=h,b=d.macro.call(p.self,y,m,p),S=u(g,T,b);p.opts.validateSchema!==!1&&p.self.validateSchema(b,!0);const v=g.name("valid");h.subschema({schema:b,schemaPath:e.nil,errSchemaPath:`${p.errSchemaPath}/${T}`,topSchemaRef:S,compositeRule:!0},v),h.pass(v,()=>h.error(!0))}gt.macroKeywordCode=i;function s(h,d){var g;const{gen:T,keyword:y,schema:m,parentSchema:p,$data:b,it:S}=h;l(S,d);const v=!b&&d.compile?d.compile.call(S.self,m,p,S):d.validate,w=u(T,y,v),x=T.let("valid");h.block$data(x,N),h.ok((g=d.valid)!==null&&g!==void 0?g:x);function N(){if(d.errors===!1)O(),d.modifying&&a(h),U(()=>h.error());else{const K=d.async?F():A();d.modifying&&a(h),U(()=>o(h,K))}}function F(){const K=T.let("ruleErrs",null);return T.try(()=>O((0,e._)`await `),H=>T.assign(x,!1).if((0,e._)`${H} instanceof ${S.ValidationError}`,()=>T.assign(K,(0,e._)`${H}.errors`),()=>T.throw(H))),K}function A(){const K=(0,e._)`${w}.errors`;return T.assign(K,null),O(e.nil),K}function O(K=d.async?(0,e._)`await `:e.nil){const H=S.opts.passContext?t.default.this:t.default.self,j=!("compile"in d&&!b||d.schema===!1);T.assign(x,(0,e._)`${K}${(0,n.callValidateCode)(h,w,H,j)}`,d.modifying)}function U(K){var H;T.if((0,e.not)((H=d.valid)!==null&&H!==void 0?H:x),K)}}gt.funcKeywordCode=s;function a(h){const{gen:d,data:g,it:T}=h;d.if(T.parentData,()=>d.assign(g,(0,e._)`${T.parentData}[${T.parentDataProperty}]`))}function o(h,d){const{gen:g}=h;g.if((0,e._)`Array.isArray(${d})`,()=>{g.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${d} : ${t.default.vErrors}.concat(${d})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,r.extendErrors)(h)},()=>h.error())}function l({schemaEnv:h},d){if(d.async&&!h.$async)throw new Error("async keyword in sync schema")}function u(h,d,g){if(g===void 0)throw new Error(`keyword "${d}" failed to compile`);return h.scopeValue("keyword",typeof g=="function"?{ref:g}:{ref:g,code:(0,e.stringify)(g)})}function c(h,d,g=!1){return!d.length||d.some(T=>T==="array"?Array.isArray(h):T==="object"?h&&typeof h=="object"&&!Array.isArray(h):typeof h==T||g&&typeof h>"u")}gt.validSchemaType=c;function f({schema:h,opts:d,self:g,errSchemaPath:T},y,m){if(Array.isArray(y.keyword)?!y.keyword.includes(m):y.keyword!==m)throw new Error("ajv implementation error");const p=y.dependencies;if(p?.some(b=>!Object.prototype.hasOwnProperty.call(h,b)))throw new Error(`parent schema must have dependencies of ${m}: ${p.join(",")}`);if(y.validateSchema&&!y.validateSchema(h[m])){const S=`keyword "${m}" value is invalid at path "${T}": `+g.errorsText(y.validateSchema.errors);if(d.validateSchema==="log")g.logger.error(S);else throw new Error(S)}}return gt.validateKeywordUsage=f,gt}var Ot={},iu;function X0(){if(iu)return Ot;iu=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.extendSubschemaMode=Ot.extendSubschemaData=Ot.getSubschema=void 0;const e=he(),t=me();function n(s,{keyword:a,schemaProp:o,schema:l,schemaPath:u,errSchemaPath:c,topSchemaRef:f}){if(a!==void 0&&l!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(a!==void 0){const h=s.schema[a];return o===void 0?{schema:h,schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(a)}`,errSchemaPath:`${s.errSchemaPath}/${a}`}:{schema:h[o],schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(a)}${(0,e.getProperty)(o)}`,errSchemaPath:`${s.errSchemaPath}/${a}/${(0,t.escapeFragment)(o)}`}}if(l!==void 0){if(u===void 0||c===void 0||f===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:l,schemaPath:u,topSchemaRef:f,errSchemaPath:c}}throw new Error('either "keyword" or "schema" must be passed')}Ot.getSubschema=n;function r(s,a,{dataProp:o,dataPropType:l,data:u,dataTypes:c,propertyName:f}){if(u!==void 0&&o!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:h}=a;if(o!==void 0){const{errorPath:g,dataPathArr:T,opts:y}=a,m=h.let("data",(0,e._)`${a.data}${(0,e.getProperty)(o)}`,!0);d(m),s.errorPath=(0,e.str)`${g}${(0,t.getErrorPath)(o,l,y.jsPropertySyntax)}`,s.parentDataProperty=(0,e._)`${o}`,s.dataPathArr=[...T,s.parentDataProperty]}if(u!==void 0){const g=u instanceof e.Name?u:h.let("data",u,!0);d(g),f!==void 0&&(s.propertyName=f)}c&&(s.dataTypes=c);function d(g){s.data=g,s.dataLevel=a.dataLevel+1,s.dataTypes=[],a.definedProperties=new Set,s.parentData=a.data,s.dataNames=[...a.dataNames,g]}}Ot.extendSubschemaData=r;function i(s,{jtdDiscriminator:a,jtdMetadata:o,compositeRule:l,createErrors:u,allErrors:c}){l!==void 0&&(s.compositeRule=l),u!==void 0&&(s.createErrors=u),c!==void 0&&(s.allErrors=c),s.jtdDiscriminator=a,s.jtdMetadata=o}return Ot.extendSubschemaMode=i,Ot}var Ge={},Js,su;function au(){return su||(su=1,Js=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,i,s;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),r=s.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[i]))return!1;for(i=r;i--!==0;){var a=s[i];if(!e(t[a],n[a]))return!1}return!0}return t!==t&&n!==n}),Js}var Xs={exports:{}},ou;function Q0(){if(ou)return Xs.exports;ou=1;var e=Xs.exports=function(r,i,s){typeof i=="function"&&(s=i,i={}),s=i.cb||s;var a=typeof s=="function"?s:s.pre||function(){},o=s.post||function(){};t(i,a,o,r,"",r)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function t(r,i,s,a,o,l,u,c,f,h){if(a&&typeof a=="object"&&!Array.isArray(a)){i(a,o,l,u,c,f,h);for(var d in a){var g=a[d];if(Array.isArray(g)){if(d in e.arrayKeywords)for(var T=0;T<g.length;T++)t(r,i,s,g[T],o+"/"+d+"/"+T,l,o,d,a,T)}else if(d in e.propsKeywords){if(g&&typeof g=="object")for(var y in g)t(r,i,s,g[y],o+"/"+d+"/"+n(y),l,o,d,a,y)}else(d in e.keywords||r.allKeys&&!(d in e.skipKeywords))&&t(r,i,s,g,o+"/"+d,l,o,d,a)}s(a,o,l,u,c,f,h)}}function n(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}return Xs.exports}var lu;function Sr(){if(lu)return Ge;lu=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.getSchemaRefs=Ge.resolveUrl=Ge.normalizeId=Ge._getFullPath=Ge.getFullPath=Ge.inlineRef=void 0;const e=me(),t=au(),n=Q0(),r=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function i(T,y=!0){return typeof T=="boolean"?!0:y===!0?!a(T):y?o(T)<=y:!1}Ge.inlineRef=i;const s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function a(T){for(const y in T){if(s.has(y))return!0;const m=T[y];if(Array.isArray(m)&&m.some(a)||typeof m=="object"&&a(m))return!0}return!1}function o(T){let y=0;for(const m in T){if(m==="$ref")return 1/0;if(y++,!r.has(m)&&(typeof T[m]=="object"&&(0,e.eachItem)(T[m],p=>y+=o(p)),y===1/0))return 1/0}return y}function l(T,y="",m){m!==!1&&(y=f(y));const p=T.parse(y);return u(T,p)}Ge.getFullPath=l;function u(T,y){return T.serialize(y).split("#")[0]+"#"}Ge._getFullPath=u;const c=/#\/?$/;function f(T){return T?T.replace(c,""):""}Ge.normalizeId=f;function h(T,y,m){return m=f(m),T.resolve(y,m)}Ge.resolveUrl=h;const d=/^[a-z_][-a-z0-9._]*$/i;function g(T,y){if(typeof T=="boolean")return{};const{schemaId:m,uriResolver:p}=this.opts,b=f(T[m]||y),S={"":b},v=l(p,b,!1),w={},x=new Set;return n(T,{allKeys:!0},(A,O,U,K)=>{if(K===void 0)return;const H=v+O;let j=S[K];typeof A[m]=="string"&&(j=B.call(this,A[m])),Z.call(this,A.$anchor),Z.call(this,A.$dynamicAnchor),S[O]=j;function B(q){const ee=this.opts.uriResolver.resolve;if(q=f(j?ee(j,q):q),x.has(q))throw F(q);x.add(q);let k=this.refs[q];return typeof k=="string"&&(k=this.refs[k]),typeof k=="object"?N(A,k.schema,q):q!==f(H)&&(q[0]==="#"?(N(A,w[q],q),w[q]=A):this.refs[q]=H),q}function Z(q){if(typeof q=="string"){if(!d.test(q))throw new Error(`invalid anchor "${q}"`);B.call(this,`#${q}`)}}}),w;function N(A,O,U){if(O!==void 0&&!t(A,O))throw F(U)}function F(A){return new Error(`reference "${A}" resolves to more than one schema`)}}return Ge.getSchemaRefs=g,Ge}var uu;function xr(){if(uu)return $t;uu=1,Object.defineProperty($t,"__esModule",{value:!0}),$t.getData=$t.KeywordCxt=$t.validateFunctionCode=void 0;const e=K0(),t=Er(),n=Ql(),r=Er(),i=Z0(),s=J0(),a=X0(),o=he(),l=qt(),u=Sr(),c=me(),f=kr();function h(C){if(v(C)&&(x(C),S(C))){y(C);return}d(C,()=>(0,e.topBoolOrEmptySchema)(C))}$t.validateFunctionCode=h;function d({gen:C,validateName:R,schema:z,schemaEnv:G,opts:Q},oe){Q.code.es5?C.func(R,(0,o._)`${l.default.data}, ${l.default.valCxt}`,G.$async,()=>{C.code((0,o._)`"use strict"; ${p(z,Q)}`),T(C,Q),C.code(oe)}):C.func(R,(0,o._)`${l.default.data}, ${g(Q)}`,G.$async,()=>C.code(p(z,Q)).code(oe))}function g(C){return(0,o._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${C.dynamicRef?(0,o._)`, ${l.default.dynamicAnchors}={}`:o.nil}}={}`}function T(C,R){C.if(l.default.valCxt,()=>{C.var(l.default.instancePath,(0,o._)`${l.default.valCxt}.${l.default.instancePath}`),C.var(l.default.parentData,(0,o._)`${l.default.valCxt}.${l.default.parentData}`),C.var(l.default.parentDataProperty,(0,o._)`${l.default.valCxt}.${l.default.parentDataProperty}`),C.var(l.default.rootData,(0,o._)`${l.default.valCxt}.${l.default.rootData}`),R.dynamicRef&&C.var(l.default.dynamicAnchors,(0,o._)`${l.default.valCxt}.${l.default.dynamicAnchors}`)},()=>{C.var(l.default.instancePath,(0,o._)`""`),C.var(l.default.parentData,(0,o._)`undefined`),C.var(l.default.parentDataProperty,(0,o._)`undefined`),C.var(l.default.rootData,l.default.data),R.dynamicRef&&C.var(l.default.dynamicAnchors,(0,o._)`{}`)})}function y(C){const{schema:R,opts:z,gen:G}=C;d(C,()=>{z.$comment&&R.$comment&&K(C),A(C),G.let(l.default.vErrors,null),G.let(l.default.errors,0),z.unevaluated&&m(C),N(C),H(C)})}function m(C){const{gen:R,validateName:z}=C;C.evaluated=R.const("evaluated",(0,o._)`${z}.evaluated`),R.if((0,o._)`${C.evaluated}.dynamicProps`,()=>R.assign((0,o._)`${C.evaluated}.props`,(0,o._)`undefined`)),R.if((0,o._)`${C.evaluated}.dynamicItems`,()=>R.assign((0,o._)`${C.evaluated}.items`,(0,o._)`undefined`))}function p(C,R){const z=typeof C=="object"&&C[R.schemaId];return z&&(R.code.source||R.code.process)?(0,o._)`/*# sourceURL=${z} */`:o.nil}function b(C,R){if(v(C)&&(x(C),S(C))){w(C,R);return}(0,e.boolOrEmptySchema)(C,R)}function S({schema:C,self:R}){if(typeof C=="boolean")return!C;for(const z in C)if(R.RULES.all[z])return!0;return!1}function v(C){return typeof C.schema!="boolean"}function w(C,R){const{schema:z,gen:G,opts:Q}=C;Q.$comment&&z.$comment&&K(C),O(C),U(C);const oe=G.const("_errs",l.default.errors);N(C,oe),G.var(R,(0,o._)`${oe} === ${l.default.errors}`)}function x(C){(0,c.checkUnknownRules)(C),F(C)}function N(C,R){if(C.opts.jtd)return B(C,[],!1,R);const z=(0,t.getSchemaTypes)(C.schema),G=(0,t.coerceAndCheckDataType)(C,z);B(C,z,!G,R)}function F(C){const{schema:R,errSchemaPath:z,opts:G,self:Q}=C;R.$ref&&G.ignoreKeywordsWithRef&&(0,c.schemaHasRulesButRef)(R,Q.RULES)&&Q.logger.warn(`$ref: keywords ignored in schema at path "${z}"`)}function A(C){const{schema:R,opts:z}=C;R.default!==void 0&&z.useDefaults&&z.strictSchema&&(0,c.checkStrictMode)(C,"default is ignored in the schema root")}function O(C){const R=C.schema[C.opts.schemaId];R&&(C.baseId=(0,u.resolveUrl)(C.opts.uriResolver,C.baseId,R))}function U(C){if(C.schema.$async&&!C.schemaEnv.$async)throw new Error("async schema in sync schema")}function K({gen:C,schemaEnv:R,schema:z,errSchemaPath:G,opts:Q}){const oe=z.$comment;if(Q.$comment===!0)C.code((0,o._)`${l.default.self}.logger.log(${oe})`);else if(typeof Q.$comment=="function"){const Se=(0,o.str)`${G}/$comment`,Oe=C.scopeValue("root",{ref:R.root});C.code((0,o._)`${l.default.self}.opts.$comment(${oe}, ${Se}, ${Oe}.schema)`)}}function H(C){const{gen:R,schemaEnv:z,validateName:G,ValidationError:Q,opts:oe}=C;z.$async?R.if((0,o._)`${l.default.errors} === 0`,()=>R.return(l.default.data),()=>R.throw((0,o._)`new ${Q}(${l.default.vErrors})`)):(R.assign((0,o._)`${G}.errors`,l.default.vErrors),oe.unevaluated&&j(C),R.return((0,o._)`${l.default.errors} === 0`))}function j({gen:C,evaluated:R,props:z,items:G}){z instanceof o.Name&&C.assign((0,o._)`${R}.props`,z),G instanceof o.Name&&C.assign((0,o._)`${R}.items`,G)}function B(C,R,z,G){const{gen:Q,schema:oe,data:Se,allErrors:Oe,opts:Pe,self:Ae}=C,{RULES:De}=Ae;if(oe.$ref&&(Pe.ignoreKeywordsWithRef||!(0,c.schemaHasRulesButRef)(oe,De))){Q.block(()=>X(C,"$ref",De.all.$ref.definition));return}Pe.jtd||q(C,R),Q.block(()=>{for(const Ue of De.rules)wt(Ue);wt(De.post)});function wt(Ue){(0,n.shouldUseGroup)(oe,Ue)&&(Ue.type?(Q.if((0,r.checkDataType)(Ue.type,Se,Pe.strictNumbers)),Z(C,Ue),R.length===1&&R[0]===Ue.type&&z&&(Q.else(),(0,r.reportTypeError)(C)),Q.endIf()):Z(C,Ue),Oe||Q.if((0,o._)`${l.default.errors} === ${G||0}`))}}function Z(C,R){const{gen:z,schema:G,opts:{useDefaults:Q}}=C;Q&&(0,i.assignDefaults)(C,R.type),z.block(()=>{for(const oe of R.rules)(0,n.shouldUseRule)(G,oe)&&X(C,oe.keyword,oe.definition,R.type)})}function q(C,R){C.schemaEnv.meta||!C.opts.strictTypes||(ee(C,R),C.opts.allowUnionTypes||k(C,R),D(C,C.dataTypes))}function ee(C,R){if(R.length){if(!C.dataTypes.length){C.dataTypes=R;return}R.forEach(z=>{_(C.dataTypes,z)||P(C,`type "${z}" not allowed by context "${C.dataTypes.join(",")}"`)}),E(C,R)}}function k(C,R){R.length>1&&!(R.length===2&&R.includes("null"))&&P(C,"use allowUnionTypes to allow union type keyword")}function D(C,R){const z=C.self.RULES.all;for(const G in z){const Q=z[G];if(typeof Q=="object"&&(0,n.shouldUseRule)(C.schema,Q)){const{type:oe}=Q.definition;oe.length&&!oe.some(Se=>I(R,Se))&&P(C,`missing type "${oe.join(",")}" for keyword "${G}"`)}}}function I(C,R){return C.includes(R)||R==="number"&&C.includes("integer")}function _(C,R){return C.includes(R)||R==="integer"&&C.includes("number")}function E(C,R){const z=[];for(const G of C.dataTypes)_(R,G)?z.push(G):R.includes("integer")&&G==="number"&&z.push("integer");C.dataTypes=z}function P(C,R){const z=C.schemaEnv.baseId+C.errSchemaPath;R+=` at "${z}" (strictTypes)`,(0,c.checkStrictMode)(C,R,C.opts.strictTypes)}class M{constructor(R,z,G){if((0,s.validateKeywordUsage)(R,z,G),this.gen=R.gen,this.allErrors=R.allErrors,this.keyword=G,this.data=R.data,this.schema=R.schema[G],this.$data=z.$data&&R.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,c.schemaRefOrVal)(R,this.schema,G,this.$data),this.schemaType=z.schemaType,this.parentSchema=R.schema,this.params={},this.it=R,this.def=z,this.$data)this.schemaCode=R.gen.const("vSchema",ne(this.$data,R));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,z.schemaType,z.allowUndefined))throw new Error(`${G} value must be ${JSON.stringify(z.schemaType)}`);("code"in z?z.trackErrors:z.errors!==!1)&&(this.errsCount=R.gen.const("_errs",l.default.errors))}result(R,z,G){this.failResult((0,o.not)(R),z,G)}failResult(R,z,G){this.gen.if(R),G?G():this.error(),z?(this.gen.else(),z(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(R,z){this.failResult((0,o.not)(R),void 0,z)}fail(R){if(R===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(R),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(R){if(!this.$data)return this.fail(R);const{schemaCode:z}=this;this.fail((0,o._)`${z} !== undefined && (${(0,o.or)(this.invalid$data(),R)})`)}error(R,z,G){if(z){this.setParams(z),this._error(R,G),this.setParams({});return}this._error(R,G)}_error(R,z){(R?f.reportExtraError:f.reportError)(this,this.def.error,z)}$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(R){this.allErrors||this.gen.if(R)}setParams(R,z){z?Object.assign(this.params,R):this.params=R}block$data(R,z,G=o.nil){this.gen.block(()=>{this.check$data(R,G),z()})}check$data(R=o.nil,z=o.nil){if(!this.$data)return;const{gen:G,schemaCode:Q,schemaType:oe,def:Se}=this;G.if((0,o.or)((0,o._)`${Q} === undefined`,z)),R!==o.nil&&G.assign(R,!0),(oe.length||Se.validateSchema)&&(G.elseIf(this.invalid$data()),this.$dataError(),R!==o.nil&&G.assign(R,!1)),G.else()}invalid$data(){const{gen:R,schemaCode:z,schemaType:G,def:Q,it:oe}=this;return(0,o.or)(Se(),Oe());function Se(){if(G.length){if(!(z instanceof o.Name))throw new Error("ajv implementation error");const Pe=Array.isArray(G)?G:[G];return(0,o._)`${(0,r.checkDataTypes)(Pe,z,oe.opts.strictNumbers,r.DataType.Wrong)}`}return o.nil}function Oe(){if(Q.validateSchema){const Pe=R.scopeValue("validate$data",{ref:Q.validateSchema});return(0,o._)`!${Pe}(${z})`}return o.nil}}subschema(R,z){const G=(0,a.getSubschema)(this.it,R);(0,a.extendSubschemaData)(G,this.it,R),(0,a.extendSubschemaMode)(G,R);const Q={...this.it,...G,items:void 0,props:void 0};return b(Q,z),Q}mergeEvaluated(R,z){const{it:G,gen:Q}=this;G.opts.unevaluated&&(G.props!==!0&&R.props!==void 0&&(G.props=c.mergeEvaluated.props(Q,R.props,G.props,z)),G.items!==!0&&R.items!==void 0&&(G.items=c.mergeEvaluated.items(Q,R.items,G.items,z)))}mergeValidEvaluated(R,z){const{it:G,gen:Q}=this;if(G.opts.unevaluated&&(G.props!==!0||G.items!==!0))return Q.if(z,()=>this.mergeEvaluated(R,o.Name)),!0}}$t.KeywordCxt=M;function X(C,R,z,G){const Q=new M(C,z,R);"code"in z?z.code(Q,G):Q.$data&&z.validate?(0,s.funcKeywordCode)(Q,z):"macro"in z?(0,s.macroKeywordCode)(Q,z):(z.compile||z.validate)&&(0,s.funcKeywordCode)(Q,z)}const J=/^\/(?:[^~]|~0|~1)*$/,ae=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ne(C,{dataLevel:R,dataNames:z,dataPathArr:G}){let Q,oe;if(C==="")return l.default.rootData;if(C[0]==="/"){if(!J.test(C))throw new Error(`Invalid JSON-pointer: ${C}`);Q=C,oe=l.default.rootData}else{const Ae=ae.exec(C);if(!Ae)throw new Error(`Invalid JSON-pointer: ${C}`);const De=+Ae[1];if(Q=Ae[2],Q==="#"){if(De>=R)throw new Error(Pe("property/index",De));return G[R-De]}if(De>R)throw new Error(Pe("data",De));if(oe=z[R-De],!Q)return oe}let Se=oe;const Oe=Q.split("/");for(const Ae of Oe)Ae&&(oe=(0,o._)`${oe}${(0,o.getProperty)((0,c.unescapeJsonPointer)(Ae))}`,Se=(0,o._)`${Se} && ${oe}`);return Se;function Pe(Ae,De){return`Cannot access ${Ae} ${De} levels up, current level is ${R}`}}return $t.getData=ne,$t}var Pr={},cu;function Qs(){if(cu)return Pr;cu=1,Object.defineProperty(Pr,"__esModule",{value:!0});class e extends Error{constructor(n){super("validation failed"),this.errors=n,this.ajv=this.validation=!0}}return Pr.default=e,Pr}var Ar={},fu;function Dr(){if(fu)return Ar;fu=1,Object.defineProperty(Ar,"__esModule",{value:!0});const e=Sr();class t extends Error{constructor(r,i,s,a){super(a||`can't resolve reference ${s} from id ${i}`),this.missingRef=(0,e.resolveUrl)(r,i,s),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(r,this.missingRef))}}return Ar.default=t,Ar}var lt={},du;function ea(){if(du)return lt;du=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.resolveSchema=lt.getCompilingSchema=lt.resolveRef=lt.compileSchema=lt.SchemaEnv=void 0;const e=he(),t=Qs(),n=qt(),r=Sr(),i=me(),s=xr();class a{constructor(m){var p;this.refs={},this.dynamicAnchors={};let b;typeof m.schema=="object"&&(b=m.schema),this.schema=m.schema,this.schemaId=m.schemaId,this.root=m.root||this,this.baseId=(p=m.baseId)!==null&&p!==void 0?p:(0,r.normalizeId)(b?.[m.schemaId||"$id"]),this.schemaPath=m.schemaPath,this.localRefs=m.localRefs,this.meta=m.meta,this.$async=b?.$async,this.refs={}}}lt.SchemaEnv=a;function o(y){const m=c.call(this,y);if(m)return m;const p=(0,r.getFullPath)(this.opts.uriResolver,y.root.baseId),{es5:b,lines:S}=this.opts.code,{ownProperties:v}=this.opts,w=new e.CodeGen(this.scope,{es5:b,lines:S,ownProperties:v});let x;y.$async&&(x=w.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const N=w.scopeName("validate");y.validateName=N;const F={gen:w,allErrors:this.opts.allErrors,data:n.default.data,parentData:n.default.parentData,parentDataProperty:n.default.parentDataProperty,dataNames:[n.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:w.scopeValue("schema",this.opts.code.source===!0?{ref:y.schema,code:(0,e.stringify)(y.schema)}:{ref:y.schema}),validateName:N,ValidationError:x,schema:y.schema,schemaEnv:y,rootId:p,baseId:y.baseId||p,schemaPath:e.nil,errSchemaPath:y.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let A;try{this._compilations.add(y),(0,s.validateFunctionCode)(F),w.optimize(this.opts.code.optimize);const O=w.toString();A=`${w.scopeRefs(n.default.scope)}return ${O}`,this.opts.code.process&&(A=this.opts.code.process(A,y));const K=new Function(`${n.default.self}`,`${n.default.scope}`,A)(this,this.scope.get());if(this.scope.value(N,{ref:K}),K.errors=null,K.schema=y.schema,K.schemaEnv=y,y.$async&&(K.$async=!0),this.opts.code.source===!0&&(K.source={validateName:N,validateCode:O,scopeValues:w._values}),this.opts.unevaluated){const{props:H,items:j}=F;K.evaluated={props:H instanceof e.Name?void 0:H,items:j instanceof e.Name?void 0:j,dynamicProps:H instanceof e.Name,dynamicItems:j instanceof e.Name},K.source&&(K.source.evaluated=(0,e.stringify)(K.evaluated))}return y.validate=K,y}catch(O){throw delete y.validate,delete y.validateName,A&&this.logger.error("Error compiling schema, function code:",A),O}finally{this._compilations.delete(y)}}lt.compileSchema=o;function l(y,m,p){var b;p=(0,r.resolveUrl)(this.opts.uriResolver,m,p);const S=y.refs[p];if(S)return S;let v=h.call(this,y,p);if(v===void 0){const w=(b=y.localRefs)===null||b===void 0?void 0:b[p],{schemaId:x}=this.opts;w&&(v=new a({schema:w,schemaId:x,root:y,baseId:m}))}if(v!==void 0)return y.refs[p]=u.call(this,v)}lt.resolveRef=l;function u(y){return(0,r.inlineRef)(y.schema,this.opts.inlineRefs)?y.schema:y.validate?y:o.call(this,y)}function c(y){for(const m of this._compilations)if(f(m,y))return m}lt.getCompilingSchema=c;function f(y,m){return y.schema===m.schema&&y.root===m.root&&y.baseId===m.baseId}function h(y,m){let p;for(;typeof(p=this.refs[m])=="string";)m=p;return p||this.schemas[m]||d.call(this,y,m)}function d(y,m){const p=this.opts.uriResolver.parse(m),b=(0,r._getFullPath)(this.opts.uriResolver,p);let S=(0,r.getFullPath)(this.opts.uriResolver,y.baseId,void 0);if(Object.keys(y.schema).length>0&&b===S)return T.call(this,p,y);const v=(0,r.normalizeId)(b),w=this.refs[v]||this.schemas[v];if(typeof w=="string"){const x=d.call(this,y,w);return typeof x?.schema!="object"?void 0:T.call(this,p,x)}if(typeof w?.schema=="object"){if(w.validate||o.call(this,w),v===(0,r.normalizeId)(m)){const{schema:x}=w,{schemaId:N}=this.opts,F=x[N];return F&&(S=(0,r.resolveUrl)(this.opts.uriResolver,S,F)),new a({schema:x,schemaId:N,root:y,baseId:S})}return T.call(this,p,w)}}lt.resolveSchema=d;const g=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function T(y,{baseId:m,schema:p,root:b}){var S;if(((S=y.fragment)===null||S===void 0?void 0:S[0])!=="/")return;for(const x of y.fragment.slice(1).split("/")){if(typeof p=="boolean")return;const N=p[(0,i.unescapeFragment)(x)];if(N===void 0)return;p=N;const F=typeof p=="object"&&p[this.opts.schemaId];!g.has(x)&&F&&(m=(0,r.resolveUrl)(this.opts.uriResolver,m,F))}let v;if(typeof p!="boolean"&&p.$ref&&!(0,i.schemaHasRulesButRef)(p,this.RULES)){const x=(0,r.resolveUrl)(this.opts.uriResolver,m,p.$ref);v=d.call(this,b,x)}const{schemaId:w}=this.opts;if(v=v||new a({schema:p,schemaId:w,root:b,baseId:m}),v.schema!==v.root.schema)return v}return lt}const eb={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1};var $r={},qn={exports:{}},ta,hu;function pu(){if(hu)return ta;hu=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function n(h){let d="",g=0,T=0;for(T=0;T<h.length;T++)if(g=h[T].charCodeAt(0),g!==48){if(!(g>=48&&g<=57||g>=65&&g<=70||g>=97&&g<=102))return"";d+=h[T];break}for(T+=1;T<h.length;T++){if(g=h[T].charCodeAt(0),!(g>=48&&g<=57||g>=65&&g<=70||g>=97&&g<=102))return"";d+=h[T]}return d}const r=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function i(h){return h.length=0,!0}function s(h,d,g){if(h.length){const T=n(h);if(T!=="")d.push(T);else return g.error=!0,!1;h.length=0}return!0}function a(h){let d=0;const g={error:!1,address:"",zone:""},T=[],y=[];let m=!1,p=!1,b=s;for(let S=0;S<h.length;S++){const v=h[S];if(!(v==="["||v==="]"))if(v===":"){if(m===!0&&(p=!0),!b(y,T,g))break;if(++d>7){g.error=!0;break}S>0&&h[S-1]===":"&&(m=!0),T.push(":");continue}else if(v==="%"){if(!b(y,T,g))break;b=i}else{y.push(v);continue}}return y.length&&(b===i?g.zone=y.join(""):p?T.push(y.join("")):T.push(n(y))),g.address=T.join(""),g}function o(h){if(l(h,":")<2)return{host:h,isIPV6:!1};const d=a(h);if(d.error)return{host:h,isIPV6:!1};{let g=d.address,T=d.address;return d.zone&&(g+="%"+d.zone,T+="%25"+d.zone),{host:g,isIPV6:!0,escapedHost:T}}}function l(h,d){let g=0;for(let T=0;T<h.length;T++)h[T]===d&&g++;return g}function u(h){let d=h;const g=[];let T=-1,y=0;for(;y=d.length;){if(y===1){if(d===".")break;if(d==="/"){g.push("/");break}else{g.push(d);break}}else if(y===2){if(d[0]==="."){if(d[1]===".")break;if(d[1]==="/"){d=d.slice(2);continue}}else if(d[0]==="/"&&(d[1]==="."||d[1]==="/")){g.push("/");break}}else if(y===3&&d==="/.."){g.length!==0&&g.pop(),g.push("/");break}if(d[0]==="."){if(d[1]==="."){if(d[2]==="/"){d=d.slice(3);continue}}else if(d[1]==="/"){d=d.slice(2);continue}}else if(d[0]==="/"&&d[1]==="."){if(d[2]==="/"){d=d.slice(2);continue}else if(d[2]==="."&&d[3]==="/"){d=d.slice(3),g.length!==0&&g.pop();continue}}if((T=d.indexOf("/",1))===-1){g.push(d);break}else g.push(d.slice(0,T)),d=d.slice(T)}return g.join("")}function c(h,d){const g=d!==!0?escape:unescape;return h.scheme!==void 0&&(h.scheme=g(h.scheme)),h.userinfo!==void 0&&(h.userinfo=g(h.userinfo)),h.host!==void 0&&(h.host=g(h.host)),h.path!==void 0&&(h.path=g(h.path)),h.query!==void 0&&(h.query=g(h.query)),h.fragment!==void 0&&(h.fragment=g(h.fragment)),h}function f(h){const d=[];if(h.userinfo!==void 0&&(d.push(h.userinfo),d.push("@")),h.host!==void 0){let g=unescape(h.host);if(!t(g)){const T=o(g);T.isIPV6===!0?g=`[${T.escapedHost}]`:g=h.host}d.push(g)}return(typeof h.port=="number"||typeof h.port=="string")&&(d.push(":"),d.push(String(h.port))),d.length?d.join(""):void 0}return ta={nonSimpleDomain:r,recomposeAuthority:f,normalizeComponentEncoding:c,removeDotSegments:u,isIPv4:t,isUUID:e,normalizeIPv6:o,stringArrayToHexStripped:n},ta}var na,mu;function tb(){if(mu)return na;mu=1;const{isUUID:e}=pu(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,n=["http","https","ws","wss","urn","urn:uuid"];function r(v){return n.indexOf(v)!==-1}function i(v){return v.secure===!0?!0:v.secure===!1?!1:v.scheme?v.scheme.length===3&&(v.scheme[0]==="w"||v.scheme[0]==="W")&&(v.scheme[1]==="s"||v.scheme[1]==="S")&&(v.scheme[2]==="s"||v.scheme[2]==="S"):!1}function s(v){return v.host||(v.error=v.error||"HTTP URIs must have a host."),v}function a(v){const w=String(v.scheme).toLowerCase()==="https";return(v.port===(w?443:80)||v.port==="")&&(v.port=void 0),v.path||(v.path="/"),v}function o(v){return v.secure=i(v),v.resourceName=(v.path||"/")+(v.query?"?"+v.query:""),v.path=void 0,v.query=void 0,v}function l(v){if((v.port===(i(v)?443:80)||v.port==="")&&(v.port=void 0),typeof v.secure=="boolean"&&(v.scheme=v.secure?"wss":"ws",v.secure=void 0),v.resourceName){const[w,x]=v.resourceName.split("?");v.path=w&&w!=="/"?w:void 0,v.query=x,v.resourceName=void 0}return v.fragment=void 0,v}function u(v,w){if(!v.path)return v.error="URN can not be parsed",v;const x=v.path.match(t);if(x){const N=w.scheme||v.scheme||"urn";v.nid=x[1].toLowerCase(),v.nss=x[2];const F=`${N}:${w.nid||v.nid}`,A=S(F);v.path=void 0,A&&(v=A.parse(v,w))}else v.error=v.error||"URN can not be parsed.";return v}function c(v,w){if(v.nid===void 0)throw new Error("URN without nid cannot be serialized");const x=w.scheme||v.scheme||"urn",N=v.nid.toLowerCase(),F=`${x}:${w.nid||N}`,A=S(F);A&&(v=A.serialize(v,w));const O=v,U=v.nss;return O.path=`${N||w.nid}:${U}`,w.skipEscape=!0,O}function f(v,w){const x=v;return x.uuid=x.nss,x.nss=void 0,!w.tolerant&&(!x.uuid||!e(x.uuid))&&(x.error=x.error||"UUID is not valid."),x}function h(v){const w=v;return w.nss=(v.uuid||"").toLowerCase(),w}const d={scheme:"http",domainHost:!0,parse:s,serialize:a},g={scheme:"https",domainHost:d.domainHost,parse:s,serialize:a},T={scheme:"ws",domainHost:!0,parse:o,serialize:l},y={scheme:"wss",domainHost:T.domainHost,parse:T.parse,serialize:T.serialize},b={http:d,https:g,ws:T,wss:y,urn:{scheme:"urn",parse:u,serialize:c,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:f,serialize:h,skipNormalize:!0}};Object.setPrototypeOf(b,null);function S(v){return v&&(b[v]||b[v.toLowerCase()])||void 0}return na={wsIsSecure:i,SCHEMES:b,isValidSchemeName:r,getSchemeHandler:S},na}var gu;function nb(){if(gu)return qn.exports;gu=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:n,normalizeComponentEncoding:r,isIPv4:i,nonSimpleDomain:s}=pu(),{SCHEMES:a,getSchemeHandler:o}=tb();function l(y,m){return typeof y=="string"?y=h(g(y,m),m):typeof y=="object"&&(y=g(h(y,m),m)),y}function u(y,m,p){const b=p?Object.assign({scheme:"null"},p):{scheme:"null"},S=c(g(y,b),g(m,b),b,!0);return b.skipEscape=!0,h(S,b)}function c(y,m,p,b){const S={};return b||(y=g(h(y,p),p),m=g(h(m,p),p)),p=p||{},!p.tolerant&&m.scheme?(S.scheme=m.scheme,S.userinfo=m.userinfo,S.host=m.host,S.port=m.port,S.path=t(m.path||""),S.query=m.query):(m.userinfo!==void 0||m.host!==void 0||m.port!==void 0?(S.userinfo=m.userinfo,S.host=m.host,S.port=m.port,S.path=t(m.path||""),S.query=m.query):(m.path?(m.path[0]==="/"?S.path=t(m.path):((y.userinfo!==void 0||y.host!==void 0||y.port!==void 0)&&!y.path?S.path="/"+m.path:y.path?S.path=y.path.slice(0,y.path.lastIndexOf("/")+1)+m.path:S.path=m.path,S.path=t(S.path)),S.query=m.query):(S.path=y.path,m.query!==void 0?S.query=m.query:S.query=y.query),S.userinfo=y.userinfo,S.host=y.host,S.port=y.port),S.scheme=y.scheme),S.fragment=m.fragment,S}function f(y,m,p){return typeof y=="string"?(y=unescape(y),y=h(r(g(y,p),!0),{...p,skipEscape:!0})):typeof y=="object"&&(y=h(r(y,!0),{...p,skipEscape:!0})),typeof m=="string"?(m=unescape(m),m=h(r(g(m,p),!0),{...p,skipEscape:!0})):typeof m=="object"&&(m=h(r(m,!0),{...p,skipEscape:!0})),y.toLowerCase()===m.toLowerCase()}function h(y,m){const p={host:y.host,scheme:y.scheme,userinfo:y.userinfo,port:y.port,path:y.path,query:y.query,nid:y.nid,nss:y.nss,uuid:y.uuid,fragment:y.fragment,reference:y.reference,resourceName:y.resourceName,secure:y.secure,error:""},b=Object.assign({},m),S=[],v=o(b.scheme||p.scheme);v&&v.serialize&&v.serialize(p,b),p.path!==void 0&&(b.skipEscape?p.path=unescape(p.path):(p.path=escape(p.path),p.scheme!==void 0&&(p.path=p.path.split("%3A").join(":")))),b.reference!=="suffix"&&p.scheme&&S.push(p.scheme,":");const w=n(p);if(w!==void 0&&(b.reference!=="suffix"&&S.push("//"),S.push(w),p.path&&p.path[0]!=="/"&&S.push("/")),p.path!==void 0){let x=p.path;!b.absolutePath&&(!v||!v.absolutePath)&&(x=t(x)),w===void 0&&x[0]==="/"&&x[1]==="/"&&(x="/%2F"+x.slice(2)),S.push(x)}return p.query!==void 0&&S.push("?",p.query),p.fragment!==void 0&&S.push("#",p.fragment),S.join("")}const d=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function g(y,m){const p=Object.assign({},m),b={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let S=!1;p.reference==="suffix"&&(p.scheme?y=p.scheme+":"+y:y="//"+y);const v=y.match(d);if(v){if(b.scheme=v[1],b.userinfo=v[3],b.host=v[4],b.port=parseInt(v[5],10),b.path=v[6]||"",b.query=v[7],b.fragment=v[8],isNaN(b.port)&&(b.port=v[5]),b.host)if(i(b.host)===!1){const N=e(b.host);b.host=N.host.toLowerCase(),S=N.isIPV6}else S=!0;b.scheme===void 0&&b.userinfo===void 0&&b.host===void 0&&b.port===void 0&&b.query===void 0&&!b.path?b.reference="same-document":b.scheme===void 0?b.reference="relative":b.fragment===void 0?b.reference="absolute":b.reference="uri",p.reference&&p.reference!=="suffix"&&p.reference!==b.reference&&(b.error=b.error||"URI is not a "+p.reference+" reference.");const w=o(p.scheme||b.scheme);if(!p.unicodeSupport&&(!w||!w.unicodeSupport)&&b.host&&(p.domainHost||w&&w.domainHost)&&S===!1&&s(b.host))try{b.host=URL.domainToASCII(b.host.toLowerCase())}catch(x){b.error=b.error||"Host's domain name can not be converted to ASCII: "+x}(!w||w&&!w.skipNormalize)&&(y.indexOf("%")!==-1&&(b.scheme!==void 0&&(b.scheme=unescape(b.scheme)),b.host!==void 0&&(b.host=unescape(b.host))),b.path&&(b.path=escape(unescape(b.path))),b.fragment&&(b.fragment=encodeURI(decodeURIComponent(b.fragment)))),w&&w.parse&&w.parse(b,p)}else b.error=b.error||"URI can not be parsed.";return b}const T={SCHEMES:a,normalize:l,resolve:u,resolveComponent:c,equal:f,serialize:h,parse:g};return qn.exports=T,qn.exports.default=T,qn.exports.fastUri=T,qn.exports}var yu;function rb(){if(yu)return $r;yu=1,Object.defineProperty($r,"__esModule",{value:!0});const e=nb();return e.code='require("ajv/dist/runtime/uri").default',$r.default=e,$r}var bu;function ib(){return bu||(bu=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=xr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=he();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const r=Qs(),i=Dr(),s=Jl(),a=ea(),o=he(),l=Sr(),u=Er(),c=me(),f=eb,h=rb(),d=(k,D)=>new RegExp(k,D);d.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],T=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),y={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."},m={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},p=200;function b(k){var D,I,_,E,P,M,X,J,ae,ne,C,R,z,G,Q,oe,Se,Oe,Pe,Ae,De,wt,Ue,It,_t;const L=k.strict,V=(D=k.code)===null||D===void 0?void 0:D.optimize,se=V===!0||V===void 0?1:V||0,ue=(_=(I=k.code)===null||I===void 0?void 0:I.regExp)!==null&&_!==void 0?_:d,ge=(E=k.uriResolver)!==null&&E!==void 0?E:h.default;return{strictSchema:(M=(P=k.strictSchema)!==null&&P!==void 0?P:L)!==null&&M!==void 0?M:!0,strictNumbers:(J=(X=k.strictNumbers)!==null&&X!==void 0?X:L)!==null&&J!==void 0?J:!0,strictTypes:(ne=(ae=k.strictTypes)!==null&&ae!==void 0?ae:L)!==null&&ne!==void 0?ne:"log",strictTuples:(R=(C=k.strictTuples)!==null&&C!==void 0?C:L)!==null&&R!==void 0?R:"log",strictRequired:(G=(z=k.strictRequired)!==null&&z!==void 0?z:L)!==null&&G!==void 0?G:!1,code:k.code?{...k.code,optimize:se,regExp:ue}:{optimize:se,regExp:ue},loopRequired:(Q=k.loopRequired)!==null&&Q!==void 0?Q:p,loopEnum:(oe=k.loopEnum)!==null&&oe!==void 0?oe:p,meta:(Se=k.meta)!==null&&Se!==void 0?Se:!0,messages:(Oe=k.messages)!==null&&Oe!==void 0?Oe:!0,inlineRefs:(Pe=k.inlineRefs)!==null&&Pe!==void 0?Pe:!0,schemaId:(Ae=k.schemaId)!==null&&Ae!==void 0?Ae:"$id",addUsedSchema:(De=k.addUsedSchema)!==null&&De!==void 0?De:!0,validateSchema:(wt=k.validateSchema)!==null&&wt!==void 0?wt:!0,validateFormats:(Ue=k.validateFormats)!==null&&Ue!==void 0?Ue:!0,unicodeRegExp:(It=k.unicodeRegExp)!==null&&It!==void 0?It:!0,int32range:(_t=k.int32range)!==null&&_t!==void 0?_t:!0,uriResolver:ge}}class S{constructor(D={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,D=this.opts={...D,...b(D)};const{es5:I,lines:_}=this.opts.code;this.scope=new o.ValueScope({scope:{},prefixes:T,es5:I,lines:_}),this.logger=U(D.logger);const E=D.validateFormats;D.validateFormats=!1,this.RULES=(0,s.getRules)(),v.call(this,y,D,"NOT SUPPORTED"),v.call(this,m,D,"DEPRECATED","warn"),this._metaOpts=A.call(this),D.formats&&N.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),D.keywords&&F.call(this,D.keywords),typeof D.meta=="object"&&this.addMetaSchema(D.meta),x.call(this),D.validateFormats=E}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:D,meta:I,schemaId:_}=this.opts;let E=f;_==="id"&&(E={...f},E.id=E.$id,delete E.$id),I&&D&&this.addMetaSchema(E,E[_],!1)}defaultMeta(){const{meta:D,schemaId:I}=this.opts;return this.opts.defaultMeta=typeof D=="object"?D[I]||D:void 0}validate(D,I){let _;if(typeof D=="string"){if(_=this.getSchema(D),!_)throw new Error(`no schema with key or ref "${D}"`)}else _=this.compile(D);const E=_(I);return"$async"in _||(this.errors=_.errors),E}compile(D,I){const _=this._addSchema(D,I);return _.validate||this._compileSchemaEnv(_)}compileAsync(D,I){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:_}=this.opts;return E.call(this,D,I);async function E(ne,C){await P.call(this,ne.$schema);const R=this._addSchema(ne,C);return R.validate||M.call(this,R)}async function P(ne){ne&&!this.getSchema(ne)&&await E.call(this,{$ref:ne},!0)}async function M(ne){try{return this._compileSchemaEnv(ne)}catch(C){if(!(C instanceof i.default))throw C;return X.call(this,C),await J.call(this,C.missingSchema),M.call(this,ne)}}function X({missingSchema:ne,missingRef:C}){if(this.refs[ne])throw new Error(`AnySchema ${ne} is loaded but ${C} cannot be resolved`)}async function J(ne){const C=await ae.call(this,ne);this.refs[ne]||await P.call(this,C.$schema),this.refs[ne]||this.addSchema(C,ne,I)}async function ae(ne){const C=this._loading[ne];if(C)return C;try{return await(this._loading[ne]=_(ne))}finally{delete this._loading[ne]}}}addSchema(D,I,_,E=this.opts.validateSchema){if(Array.isArray(D)){for(const M of D)this.addSchema(M,void 0,_,E);return this}let P;if(typeof D=="object"){const{schemaId:M}=this.opts;if(P=D[M],P!==void 0&&typeof P!="string")throw new Error(`schema ${M} must be string`)}return I=(0,l.normalizeId)(I||P),this._checkUnique(I),this.schemas[I]=this._addSchema(D,_,I,E,!0),this}addMetaSchema(D,I,_=this.opts.validateSchema){return this.addSchema(D,I,!0,_),this}validateSchema(D,I){if(typeof D=="boolean")return!0;let _;if(_=D.$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 E=this.validate(_,D);if(!E&&I){const P="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(P);else throw new Error(P)}return E}getSchema(D){let I;for(;typeof(I=w.call(this,D))=="string";)D=I;if(I===void 0){const{schemaId:_}=this.opts,E=new a.SchemaEnv({schema:{},schemaId:_});if(I=a.resolveSchema.call(this,E,D),!I)return;this.refs[D]=I}return I.validate||this._compileSchemaEnv(I)}removeSchema(D){if(D instanceof RegExp)return this._removeAllSchemas(this.schemas,D),this._removeAllSchemas(this.refs,D),this;switch(typeof D){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const I=w.call(this,D);return typeof I=="object"&&this._cache.delete(I.schema),delete this.schemas[D],delete this.refs[D],this}case"object":{const I=D;this._cache.delete(I);let _=D[this.opts.schemaId];return _&&(_=(0,l.normalizeId)(_),delete this.schemas[_],delete this.refs[_]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(D){for(const I of D)this.addKeyword(I);return this}addKeyword(D,I){let _;if(typeof D=="string")_=D,typeof I=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),I.keyword=_);else if(typeof D=="object"&&I===void 0){if(I=D,_=I.keyword,Array.isArray(_)&&!_.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(H.call(this,_,I),!I)return(0,c.eachItem)(_,P=>j.call(this,P)),this;Z.call(this,I);const E={...I,type:(0,u.getJSONTypes)(I.type),schemaType:(0,u.getJSONTypes)(I.schemaType)};return(0,c.eachItem)(_,E.type.length===0?P=>j.call(this,P,E):P=>E.type.forEach(M=>j.call(this,P,E,M))),this}getKeyword(D){const I=this.RULES.all[D];return typeof I=="object"?I.definition:!!I}removeKeyword(D){const{RULES:I}=this;delete I.keywords[D],delete I.all[D];for(const _ of I.rules){const E=_.rules.findIndex(P=>P.keyword===D);E>=0&&_.rules.splice(E,1)}return this}addFormat(D,I){return typeof I=="string"&&(I=new RegExp(I)),this.formats[D]=I,this}errorsText(D=this.errors,{separator:I=", ",dataVar:_="data"}={}){return!D||D.length===0?"No errors":D.map(E=>`${_}${E.instancePath} ${E.message}`).reduce((E,P)=>E+I+P)}$dataMetaSchema(D,I){const _=this.RULES.all;D=JSON.parse(JSON.stringify(D));for(const E of I){const P=E.split("/").slice(1);let M=D;for(const X of P)M=M[X];for(const X in _){const J=_[X];if(typeof J!="object")continue;const{$data:ae}=J.definition,ne=M[X];ae&&ne&&(M[X]=ee(ne))}}return D}_removeAllSchemas(D,I){for(const _ in D){const E=D[_];(!I||I.test(_))&&(typeof E=="string"?delete D[_]:E&&!E.meta&&(this._cache.delete(E.schema),delete D[_]))}}_addSchema(D,I,_,E=this.opts.validateSchema,P=this.opts.addUsedSchema){let M;const{schemaId:X}=this.opts;if(typeof D=="object")M=D[X];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof D!="boolean")throw new Error("schema must be object or boolean")}let J=this._cache.get(D);if(J!==void 0)return J;_=(0,l.normalizeId)(M||_);const ae=l.getSchemaRefs.call(this,D,_);return J=new a.SchemaEnv({schema:D,schemaId:X,meta:I,baseId:_,localRefs:ae}),this._cache.set(J.schema,J),P&&!_.startsWith("#")&&(_&&this._checkUnique(_),this.refs[_]=J),E&&this.validateSchema(D,!0),J}_checkUnique(D){if(this.schemas[D]||this.refs[D])throw new Error(`schema with key or id "${D}" already exists`)}_compileSchemaEnv(D){if(D.meta?this._compileMetaSchema(D):a.compileSchema.call(this,D),!D.validate)throw new Error("ajv implementation error");return D.validate}_compileMetaSchema(D){const I=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,D)}finally{this.opts=I}}}S.ValidationError=r.default,S.MissingRefError=i.default,e.default=S;function v(k,D,I,_="error"){for(const E in k){const P=E;P in D&&this.logger[_](`${I}: option ${E}. ${k[P]}`)}}function w(k){return k=(0,l.normalizeId)(k),this.schemas[k]||this.refs[k]}function x(){const k=this.opts.schemas;if(k)if(Array.isArray(k))this.addSchema(k);else for(const D in k)this.addSchema(k[D],D)}function N(){for(const k in this.opts.formats){const D=this.opts.formats[k];D&&this.addFormat(k,D)}}function F(k){if(Array.isArray(k)){this.addVocabulary(k);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const D in k){const I=k[D];I.keyword||(I.keyword=D),this.addKeyword(I)}}function A(){const k={...this.opts};for(const D of g)delete k[D];return k}const O={log(){},warn(){},error(){}};function U(k){if(k===!1)return O;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 K=/^[a-z_$][a-z0-9_$:-]*$/i;function H(k,D){const{RULES:I}=this;if((0,c.eachItem)(k,_=>{if(I.keywords[_])throw new Error(`Keyword ${_} is already defined`);if(!K.test(_))throw new Error(`Keyword ${_} has invalid name`)}),!!D&&D.$data&&!("code"in D||"validate"in D))throw new Error('$data keyword must have "code" or "validate" function')}function j(k,D,I){var _;const E=D?.post;if(I&&E)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:P}=this;let M=E?P.post:P.rules.find(({type:J})=>J===I);if(M||(M={type:I,rules:[]},P.rules.push(M)),P.keywords[k]=!0,!D)return;const X={keyword:k,definition:{...D,type:(0,u.getJSONTypes)(D.type),schemaType:(0,u.getJSONTypes)(D.schemaType)}};D.before?B.call(this,M,X,D.before):M.rules.push(X),P.all[k]=X,(_=D.implements)===null||_===void 0||_.forEach(J=>this.addKeyword(J))}function B(k,D,I){const _=k.rules.findIndex(E=>E.keyword===I);_>=0?k.rules.splice(_,0,D):(k.rules.push(D),this.logger.warn(`rule ${I} is not defined`))}function Z(k){let{metaSchema:D}=k;D!==void 0&&(k.$data&&this.opts.$data&&(D=ee(D)),k.validateSchema=this.compile(D,!0))}const q={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ee(k){return{anyOf:[k,q]}}})(Ws)),Ws}var Cr={},Or={},Rr={},wu;function sb(){if(wu)return Rr;wu=1,Object.defineProperty(Rr,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Rr.default=e,Rr}var Ht={},_u;function ab(){if(_u)return Ht;_u=1,Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.callRef=Ht.getValidate=void 0;const e=Dr(),t=yt(),n=he(),r=qt(),i=ea(),s=me(),a={keyword:"$ref",schemaType:"string",code(u){const{gen:c,schema:f,it:h}=u,{baseId:d,schemaEnv:g,validateName:T,opts:y,self:m}=h,{root:p}=g;if((f==="#"||f==="#/")&&d===p.baseId)return S();const b=i.resolveRef.call(m,p,d,f);if(b===void 0)throw new e.default(h.opts.uriResolver,d,f);if(b instanceof i.SchemaEnv)return v(b);return w(b);function S(){if(g===p)return l(u,T,g,g.$async);const x=c.scopeValue("root",{ref:p});return l(u,(0,n._)`${x}.validate`,p,p.$async)}function v(x){const N=o(u,x);l(u,N,x,x.$async)}function w(x){const N=c.scopeValue("schema",y.code.source===!0?{ref:x,code:(0,n.stringify)(x)}:{ref:x}),F=c.name("valid"),A=u.subschema({schema:x,dataTypes:[],schemaPath:n.nil,topSchemaRef:N,errSchemaPath:f},F);u.mergeEvaluated(A),u.ok(F)}}};function o(u,c){const{gen:f}=u;return c.validate?f.scopeValue("validate",{ref:c.validate}):(0,n._)`${f.scopeValue("wrapper",{ref:c})}.validate`}Ht.getValidate=o;function l(u,c,f,h){const{gen:d,it:g}=u,{allErrors:T,schemaEnv:y,opts:m}=g,p=m.passContext?r.default.this:n.nil;h?b():S();function b(){if(!y.$async)throw new Error("async schema referenced by sync schema");const x=d.let("valid");d.try(()=>{d.code((0,n._)`await ${(0,t.callValidateCode)(u,c,p)}`),w(c),T||d.assign(x,!0)},N=>{d.if((0,n._)`!(${N} instanceof ${g.ValidationError})`,()=>d.throw(N)),v(N),T||d.assign(x,!1)}),u.ok(x)}function S(){u.result((0,t.callValidateCode)(u,c,p),()=>w(c),()=>v(c))}function v(x){const N=(0,n._)`${x}.errors`;d.assign(r.default.vErrors,(0,n._)`${r.default.vErrors} === null ? ${N} : ${r.default.vErrors}.concat(${N})`),d.assign(r.default.errors,(0,n._)`${r.default.vErrors}.length`)}function w(x){var N;if(!g.opts.unevaluated)return;const F=(N=f?.validate)===null||N===void 0?void 0:N.evaluated;if(g.props!==!0)if(F&&!F.dynamicProps)F.props!==void 0&&(g.props=s.mergeEvaluated.props(d,F.props,g.props));else{const A=d.var("props",(0,n._)`${x}.evaluated.props`);g.props=s.mergeEvaluated.props(d,A,g.props,n.Name)}if(g.items!==!0)if(F&&!F.dynamicItems)F.items!==void 0&&(g.items=s.mergeEvaluated.items(d,F.items,g.items));else{const A=d.var("items",(0,n._)`${x}.evaluated.items`);g.items=s.mergeEvaluated.items(d,A,g.items,n.Name)}}}return Ht.callRef=l,Ht.default=a,Ht}var vu;function ob(){if(vu)return Or;vu=1,Object.defineProperty(Or,"__esModule",{value:!0});const e=sb(),t=ab(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return Or.default=n,Or}var Nr={},Mr={},Tu;function lb(){if(Tu)return Mr;Tu=1,Object.defineProperty(Mr,"__esModule",{value:!0});const e=he(),t=e.operators,n={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},r={message:({keyword:s,schemaCode:a})=>(0,e.str)`must be ${n[s].okStr} ${a}`,params:({keyword:s,schemaCode:a})=>(0,e._)`{comparison: ${n[s].okStr}, limit: ${a}}`},i={keyword:Object.keys(n),type:"number",schemaType:"number",$data:!0,error:r,code(s){const{keyword:a,data:o,schemaCode:l}=s;s.fail$data((0,e._)`${o} ${n[a].fail} ${l} || isNaN(${o})`)}};return Mr.default=i,Mr}var Ir={},ku;function ub(){if(ku)return Ir;ku=1,Object.defineProperty(Ir,"__esModule",{value:!0});const e=he(),n={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must be multiple of ${r}`,params:({schemaCode:r})=>(0,e._)`{multipleOf: ${r}}`},code(r){const{gen:i,data:s,schemaCode:a,it:o}=r,l=o.opts.multipleOfPrecision,u=i.let("res"),c=l?(0,e._)`Math.abs(Math.round(${u}) - ${u}) > 1e-${l}`:(0,e._)`${u} !== parseInt(${u})`;r.fail$data((0,e._)`(${a} === 0 || (${u} = ${s}/${a}, ${c}))`)}};return Ir.default=n,Ir}var Lr={},Fr={},Eu;function cb(){if(Eu)return Fr;Eu=1,Object.defineProperty(Fr,"__esModule",{value:!0});function e(t){const n=t.length;let r=0,i=0,s;for(;i<n;)r++,s=t.charCodeAt(i++),s>=55296&&s<=56319&&i<n&&(s=t.charCodeAt(i),(s&64512)===56320&&i++);return r}return Fr.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Fr}var Su;function fb(){if(Su)return Lr;Su=1,Object.defineProperty(Lr,"__esModule",{value:!0});const e=he(),t=me(),n=cb(),i={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:a}){const o=s==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${a} characters`},params:({schemaCode:s})=>(0,e._)`{limit: ${s}}`},code(s){const{keyword:a,data:o,schemaCode:l,it:u}=s,c=a==="maxLength"?e.operators.GT:e.operators.LT,f=u.opts.unicode===!1?(0,e._)`${o}.length`:(0,e._)`${(0,t.useFunc)(s.gen,n.default)}(${o})`;s.fail$data((0,e._)`${f} ${c} ${l}`)}};return Lr.default=i,Lr}var jr={},xu;function db(){if(xu)return jr;xu=1,Object.defineProperty(jr,"__esModule",{value:!0});const e=yt(),t=me(),n=he(),i={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:s})=>(0,n.str)`must match pattern "${s}"`,params:({schemaCode:s})=>(0,n._)`{pattern: ${s}}`},code(s){const{gen:a,data:o,$data:l,schema:u,schemaCode:c,it:f}=s,h=f.opts.unicodeRegExp?"u":"";if(l){const{regExp:d}=f.opts.code,g=d.code==="new RegExp"?(0,n._)`new RegExp`:(0,t.useFunc)(a,d),T=a.let("valid");a.try(()=>a.assign(T,(0,n._)`${g}(${c}, ${h}).test(${o})`),()=>a.assign(T,!1)),s.fail$data((0,n._)`!${T}`)}else{const d=(0,e.usePattern)(s,u);s.fail$data((0,n._)`!${d}.test(${o})`)}}};return jr.default=i,jr}var zr={},Pu;function hb(){if(Pu)return zr;Pu=1,Object.defineProperty(zr,"__esModule",{value:!0});const e=he(),n={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:i}){const s=r==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${i} properties`},params:({schemaCode:r})=>(0,e._)`{limit: ${r}}`},code(r){const{keyword:i,data:s,schemaCode:a}=r,o=i==="maxProperties"?e.operators.GT:e.operators.LT;r.fail$data((0,e._)`Object.keys(${s}).length ${o} ${a}`)}};return zr.default=n,zr}var Ur={},Au;function pb(){if(Au)return Ur;Au=1,Object.defineProperty(Ur,"__esModule",{value:!0});const e=yt(),t=he(),n=me(),i={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>(0,t.str)`must have required property '${s}'`,params:({params:{missingProperty:s}})=>(0,t._)`{missingProperty: ${s}}`},code(s){const{gen:a,schema:o,schemaCode:l,data:u,$data:c,it:f}=s,{opts:h}=f;if(!c&&o.length===0)return;const d=o.length>=h.loopRequired;if(f.allErrors?g():T(),h.strictRequired){const p=s.parentSchema.properties,{definedProperties:b}=s.it;for(const S of o)if(p?.[S]===void 0&&!b.has(S)){const v=f.schemaEnv.baseId+f.errSchemaPath,w=`required property "${S}" is not defined at "${v}" (strictRequired)`;(0,n.checkStrictMode)(f,w,f.opts.strictRequired)}}function g(){if(d||c)s.block$data(t.nil,y);else for(const p of o)(0,e.checkReportMissingProp)(s,p)}function T(){const p=a.let("missing");if(d||c){const b=a.let("valid",!0);s.block$data(b,()=>m(p,b)),s.ok(b)}else a.if((0,e.checkMissingProp)(s,o,p)),(0,e.reportMissingProp)(s,p),a.else()}function y(){a.forOf("prop",l,p=>{s.setParams({missingProperty:p}),a.if((0,e.noPropertyInData)(a,u,p,h.ownProperties),()=>s.error())})}function m(p,b){s.setParams({missingProperty:p}),a.forOf(p,l,()=>{a.assign(b,(0,e.propertyInData)(a,u,p,h.ownProperties)),a.if((0,t.not)(b),()=>{s.error(),a.break()})},t.nil)}}};return Ur.default=i,Ur}var qr={},Du;function mb(){if(Du)return qr;Du=1,Object.defineProperty(qr,"__esModule",{value:!0});const e=he(),n={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:i}){const s=r==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${i} items`},params:({schemaCode:r})=>(0,e._)`{limit: ${r}}`},code(r){const{keyword:i,data:s,schemaCode:a}=r,o=i==="maxItems"?e.operators.GT:e.operators.LT;r.fail$data((0,e._)`${s}.length ${o} ${a}`)}};return qr.default=n,qr}var Hr={},Br={},$u;function ra(){if($u)return Br;$u=1,Object.defineProperty(Br,"__esModule",{value:!0});const e=au();return e.code='require("ajv/dist/runtime/equal").default',Br.default=e,Br}var Cu;function gb(){if(Cu)return Hr;Cu=1,Object.defineProperty(Hr,"__esModule",{value:!0});const e=Er(),t=he(),n=me(),r=ra(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:a,j:o}})=>(0,t.str)`must NOT have duplicate items (items ## ${o} and ${a} are identical)`,params:({params:{i:a,j:o}})=>(0,t._)`{i: ${a}, j: ${o}}`},code(a){const{gen:o,data:l,$data:u,schema:c,parentSchema:f,schemaCode:h,it:d}=a;if(!u&&!c)return;const g=o.let("valid"),T=f.items?(0,e.getSchemaTypes)(f.items):[];a.block$data(g,y,(0,t._)`${h} === false`),a.ok(g);function y(){const S=o.let("i",(0,t._)`${l}.length`),v=o.let("j");a.setParams({i:S,j:v}),o.assign(g,!0),o.if((0,t._)`${S} > 1`,()=>(m()?p:b)(S,v))}function m(){return T.length>0&&!T.some(S=>S==="object"||S==="array")}function p(S,v){const w=o.name("item"),x=(0,e.checkDataTypes)(T,w,d.opts.strictNumbers,e.DataType.Wrong),N=o.const("indices",(0,t._)`{}`);o.for((0,t._)`;${S}--;`,()=>{o.let(w,(0,t._)`${l}[${S}]`),o.if(x,(0,t._)`continue`),T.length>1&&o.if((0,t._)`typeof ${w} == "string"`,(0,t._)`${w} += "_"`),o.if((0,t._)`typeof ${N}[${w}] == "number"`,()=>{o.assign(v,(0,t._)`${N}[${w}]`),a.error(),o.assign(g,!1).break()}).code((0,t._)`${N}[${w}] = ${S}`)})}function b(S,v){const w=(0,n.useFunc)(o,r.default),x=o.name("outer");o.label(x).for((0,t._)`;${S}--;`,()=>o.for((0,t._)`${v} = ${S}; ${v}--;`,()=>o.if((0,t._)`${w}(${l}[${S}], ${l}[${v}])`,()=>{a.error(),o.assign(g,!1).break(x)})))}}};return Hr.default=s,Hr}var Vr={},Ou;function yb(){if(Ou)return Vr;Ou=1,Object.defineProperty(Vr,"__esModule",{value:!0});const e=he(),t=me(),n=ra(),i={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0,e._)`{allowedValue: ${s}}`},code(s){const{gen:a,data:o,$data:l,schemaCode:u,schema:c}=s;l||c&&typeof c=="object"?s.fail$data((0,e._)`!${(0,t.useFunc)(a,n.default)}(${o}, ${u})`):s.fail((0,e._)`${c} !== ${o}`)}};return Vr.default=i,Vr}var Wr={},Ru;function bb(){if(Ru)return Wr;Ru=1,Object.defineProperty(Wr,"__esModule",{value:!0});const e=he(),t=me(),n=ra(),i={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>(0,e._)`{allowedValues: ${s}}`},code(s){const{gen:a,data:o,$data:l,schema:u,schemaCode:c,it:f}=s;if(!l&&u.length===0)throw new Error("enum must have non-empty array");const h=u.length>=f.opts.loopEnum;let d;const g=()=>d??(d=(0,t.useFunc)(a,n.default));let T;if(h||l)T=a.let("valid"),s.block$data(T,y);else{if(!Array.isArray(u))throw new Error("ajv implementation error");const p=a.const("vSchema",c);T=(0,e.or)(...u.map((b,S)=>m(p,S)))}s.pass(T);function y(){a.assign(T,!1),a.forOf("v",c,p=>a.if((0,e._)`${g()}(${o}, ${p})`,()=>a.assign(T,!0).break()))}function m(p,b){const S=u[b];return typeof S=="object"&&S!==null?(0,e._)`${g()}(${o}, ${p}[${b}])`:(0,e._)`${o} === ${S}`}}};return Wr.default=i,Wr}var Nu;function wb(){if(Nu)return Nr;Nu=1,Object.defineProperty(Nr,"__esModule",{value:!0});const e=lb(),t=ub(),n=fb(),r=db(),i=hb(),s=pb(),a=mb(),o=gb(),l=yb(),u=bb(),c=[e.default,t.default,n.default,r.default,i.default,s.default,a.default,o.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},l.default,u.default];return Nr.default=c,Nr}var Yr={},pn={},Mu;function Iu(){if(Mu)return pn;Mu=1,Object.defineProperty(pn,"__esModule",{value:!0}),pn.validateAdditionalItems=void 0;const e=he(),t=me(),r={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>(0,e.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,e._)`{limit: ${s}}`},code(s){const{parentSchema:a,it:o}=s,{items:l}=a;if(!Array.isArray(l)){(0,t.checkStrictMode)(o,'"additionalItems" is ignored when "items" is not an array of schemas');return}i(s,l)}};function i(s,a){const{gen:o,schema:l,data:u,keyword:c,it:f}=s;f.items=!0;const h=o.const("len",(0,e._)`${u}.length`);if(l===!1)s.setParams({len:a.length}),s.pass((0,e._)`${h} <= ${a.length}`);else if(typeof l=="object"&&!(0,t.alwaysValidSchema)(f,l)){const g=o.var("valid",(0,e._)`${h} <= ${a.length}`);o.if((0,e.not)(g),()=>d(g)),s.ok(g)}function d(g){o.forRange("i",a.length,h,T=>{s.subschema({keyword:c,dataProp:T,dataPropType:t.Type.Num},g),f.allErrors||o.if((0,e.not)(g),()=>o.break())})}}return pn.validateAdditionalItems=i,pn.default=r,pn}var Gr={},mn={},Lu;function Fu(){if(Lu)return mn;Lu=1,Object.defineProperty(mn,"__esModule",{value:!0}),mn.validateTuple=void 0;const e=he(),t=me(),n=yt(),r={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(s){const{schema:a,it:o}=s;if(Array.isArray(a))return i(s,"additionalItems",a);o.items=!0,!(0,t.alwaysValidSchema)(o,a)&&s.ok((0,n.validateArray)(s))}};function i(s,a,o=s.schema){const{gen:l,parentSchema:u,data:c,keyword:f,it:h}=s;T(u),h.opts.unevaluated&&o.length&&h.items!==!0&&(h.items=t.mergeEvaluated.items(l,o.length,h.items));const d=l.name("valid"),g=l.const("len",(0,e._)`${c}.length`);o.forEach((y,m)=>{(0,t.alwaysValidSchema)(h,y)||(l.if((0,e._)`${g} > ${m}`,()=>s.subschema({keyword:f,schemaProp:m,dataProp:m},d)),s.ok(d))});function T(y){const{opts:m,errSchemaPath:p}=h,b=o.length,S=b===y.minItems&&(b===y.maxItems||y[a]===!1);if(m.strictTuples&&!S){const v=`"${f}" is ${b}-tuple, but minItems or maxItems/${a} are not specified or different at path "${p}"`;(0,t.checkStrictMode)(h,v,m.strictTuples)}}}return mn.validateTuple=i,mn.default=r,mn}var ju;function _b(){if(ju)return Gr;ju=1,Object.defineProperty(Gr,"__esModule",{value:!0});const e=Fu(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:n=>(0,e.validateTuple)(n,"items")};return Gr.default=t,Gr}var Kr={},zu;function vb(){if(zu)return Kr;zu=1,Object.defineProperty(Kr,"__esModule",{value:!0});const e=he(),t=me(),n=yt(),r=Iu(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:a}})=>(0,e.str)`must NOT have more than ${a} items`,params:({params:{len:a}})=>(0,e._)`{limit: ${a}}`},code(a){const{schema:o,parentSchema:l,it:u}=a,{prefixItems:c}=l;u.items=!0,!(0,t.alwaysValidSchema)(u,o)&&(c?(0,r.validateAdditionalItems)(a,c):a.ok((0,n.validateArray)(a)))}};return Kr.default=s,Kr}var Zr={},Uu;function Tb(){if(Uu)return Zr;Uu=1,Object.defineProperty(Zr,"__esModule",{value:!0});const e=he(),t=me(),r={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:i,max:s}})=>s===void 0?(0,e.str)`must contain at least ${i} valid item(s)`:(0,e.str)`must contain at least ${i} and no more than ${s} valid item(s)`,params:({params:{min:i,max:s}})=>s===void 0?(0,e._)`{minContains: ${i}}`:(0,e._)`{minContains: ${i}, maxContains: ${s}}`},code(i){const{gen:s,schema:a,parentSchema:o,data:l,it:u}=i;let c,f;const{minContains:h,maxContains:d}=o;u.opts.next?(c=h===void 0?1:h,f=d):c=1;const g=s.const("len",(0,e._)`${l}.length`);if(i.setParams({min:c,max:f}),f===void 0&&c===0){(0,t.checkStrictMode)(u,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(f!==void 0&&c>f){(0,t.checkStrictMode)(u,'"minContains" > "maxContains" is always invalid'),i.fail();return}if((0,t.alwaysValidSchema)(u,a)){let b=(0,e._)`${g} >= ${c}`;f!==void 0&&(b=(0,e._)`${b} && ${g} <= ${f}`),i.pass(b);return}u.items=!0;const T=s.name("valid");f===void 0&&c===1?m(T,()=>s.if(T,()=>s.break())):c===0?(s.let(T,!0),f!==void 0&&s.if((0,e._)`${l}.length > 0`,y)):(s.let(T,!1),y()),i.result(T,()=>i.reset());function y(){const b=s.name("_valid"),S=s.let("count",0);m(b,()=>s.if(b,()=>p(S)))}function m(b,S){s.forRange("i",0,g,v=>{i.subschema({keyword:"contains",dataProp:v,dataPropType:t.Type.Num,compositeRule:!0},b),S()})}function p(b){s.code((0,e._)`${b}++`),f===void 0?s.if((0,e._)`${b} >= ${c}`,()=>s.assign(T,!0).break()):(s.if((0,e._)`${b} > ${f}`,()=>s.assign(T,!1).break()),c===1?s.assign(T,!0):s.if((0,e._)`${b} >= ${c}`,()=>s.assign(T,!0)))}}};return Zr.default=r,Zr}var ia={},qu;function kb(){return qu||(qu=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=he(),n=me(),r=yt();e.error={message:({params:{property:l,depsCount:u,deps:c}})=>{const f=u===1?"property":"properties";return(0,t.str)`must have ${f} ${c} when property ${l} is present`},params:({params:{property:l,depsCount:u,deps:c,missingProperty:f}})=>(0,t._)`{property: ${l},
|
|
57
|
+
|| ${N} === "boolean" || ${w} === null`).assign(F,(0,r._)`[${w}]`)}}}function h({gen:p,parentData:b,parentDataProperty:S},v){p.if((0,r._)`${b} !== undefined`,()=>p.assign((0,r._)`${b}[${S}]`,v))}function d(p,b,S,v=s.Correct){const w=v===s.Correct?r.operators.EQ:r.operators.NEQ;let x;switch(p){case"null":return(0,r._)`${b} ${w} null`;case"array":x=(0,r._)`Array.isArray(${b})`;break;case"object":x=(0,r._)`${b} && typeof ${b} == "object" && !Array.isArray(${b})`;break;case"integer":x=N((0,r._)`!(${b} % 1) && !isNaN(${b})`);break;case"number":x=N();break;default:return(0,r._)`typeof ${b} ${w} ${p}`}return v===s.Correct?x:(0,r.not)(x);function N(F=r.nil){return(0,r.and)((0,r._)`typeof ${b} == "number"`,F,S?(0,r._)`isFinite(${b})`:r.nil)}}Fe.checkDataType=d;function g(p,b,S,v){if(p.length===1)return d(p[0],b,S,v);let w;const x=(0,i.toHash)(p);if(x.array&&x.object){const N=(0,r._)`typeof ${b} != "object"`;w=x.null?N:(0,r._)`!${b} || ${N}`,delete x.null,delete x.array,delete x.object}else w=r.nil;x.number&&delete x.integer;for(const N in x)w=(0,r.and)(w,d(N,b,S,v));return w}Fe.checkDataTypes=g;const T={message:({schema:p})=>`must be ${p}`,params:({schema:p,schemaValue:b})=>typeof p=="string"?(0,r._)`{type: ${p}}`:(0,r._)`{type: ${b}}`};function y(p){const b=m(p);(0,n.reportError)(b,T)}Fe.reportTypeError=y;function m(p){const{gen:b,data:S,schema:v}=p,w=(0,i.schemaRefOrVal)(p,v,"type");return{gen:b,keyword:"type",data:S,schema:v.type,schemaCode:w,schemaValue:w,parentSchema:v,params:{},it:p}}return Fe}var Hn={},nu;function J0(){if(nu)return Hn;nu=1,Object.defineProperty(Hn,"__esModule",{value:!0}),Hn.assignDefaults=void 0;const e=he(),t=me();function n(i,s){const{properties:a,items:o}=i.schema;if(s==="object"&&a)for(const l in a)r(i,l,a[l].default);else s==="array"&&Array.isArray(o)&&o.forEach((l,u)=>r(i,u,l.default))}Hn.assignDefaults=n;function r(i,s,a){const{gen:o,compositeRule:l,data:u,opts:c}=i;if(a===void 0)return;const f=(0,e._)`${u}${(0,e.getProperty)(s)}`;if(l){(0,t.checkStrictMode)(i,`default is ignored for: ${f}`);return}let h=(0,e._)`${f} === undefined`;c.useDefaults==="empty"&&(h=(0,e._)`${h} || ${f} === null || ${f} === ""`),o.if(h,(0,e._)`${f} = ${(0,e.stringify)(a)}`)}return Hn}var yt={},be={},ru;function bt(){if(ru)return be;ru=1,Object.defineProperty(be,"__esModule",{value:!0}),be.validateUnion=be.validateArray=be.usePattern=be.callValidateCode=be.schemaProperties=be.allSchemaProperties=be.noPropertyInData=be.propertyInData=be.isOwnProperty=be.hasPropFunc=be.reportMissingProp=be.checkMissingProp=be.checkReportMissingProp=void 0;const e=he(),t=me(),n=qt(),r=me();function i(p,b){const{gen:S,data:v,it:w}=p;S.if(c(S,v,b,w.opts.ownProperties),()=>{p.setParams({missingProperty:(0,e._)`${b}`},!0),p.error()})}be.checkReportMissingProp=i;function s({gen:p,data:b,it:{opts:S}},v,w){return(0,e.or)(...v.map(x=>(0,e.and)(c(p,b,x,S.ownProperties),(0,e._)`${w} = ${x}`)))}be.checkMissingProp=s;function a(p,b){p.setParams({missingProperty:b},!0),p.error()}be.reportMissingProp=a;function o(p){return p.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}be.hasPropFunc=o;function l(p,b,S){return(0,e._)`${o(p)}.call(${b}, ${S})`}be.isOwnProperty=l;function u(p,b,S,v){const w=(0,e._)`${b}${(0,e.getProperty)(S)} !== undefined`;return v?(0,e._)`${w} && ${l(p,b,S)}`:w}be.propertyInData=u;function c(p,b,S,v){const w=(0,e._)`${b}${(0,e.getProperty)(S)} === undefined`;return v?(0,e.or)(w,(0,e.not)(l(p,b,S))):w}be.noPropertyInData=c;function f(p){return p?Object.keys(p).filter(b=>b!=="__proto__"):[]}be.allSchemaProperties=f;function h(p,b){return f(b).filter(S=>!(0,t.alwaysValidSchema)(p,b[S]))}be.schemaProperties=h;function d({schemaCode:p,data:b,it:{gen:S,topSchemaRef:v,schemaPath:w,errorPath:x},it:N},F,A,O){const U=O?(0,e._)`${p}, ${b}, ${v}${w}`:b,K=[[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,x)],[n.default.parentData,N.parentData],[n.default.parentDataProperty,N.parentDataProperty],[n.default.rootData,n.default.rootData]];N.opts.dynamicRef&&K.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);const H=(0,e._)`${U}, ${S.object(...K)}`;return A!==e.nil?(0,e._)`${F}.call(${A}, ${H})`:(0,e._)`${F}(${H})`}be.callValidateCode=d;const g=(0,e._)`new RegExp`;function T({gen:p,it:{opts:b}},S){const v=b.unicodeRegExp?"u":"",{regExp:w}=b.code,x=w(S,v);return p.scopeValue("pattern",{key:x.toString(),ref:x,code:(0,e._)`${w.code==="new RegExp"?g:(0,r.useFunc)(p,w)}(${S}, ${v})`})}be.usePattern=T;function y(p){const{gen:b,data:S,keyword:v,it:w}=p,x=b.name("valid");if(w.allErrors){const F=b.let("valid",!0);return N(()=>b.assign(F,!1)),F}return b.var(x,!0),N(()=>b.break()),x;function N(F){const A=b.const("len",(0,e._)`${S}.length`);b.forRange("i",0,A,O=>{p.subschema({keyword:v,dataProp:O,dataPropType:t.Type.Num},x),b.if((0,e.not)(x),F)})}}be.validateArray=y;function m(p){const{gen:b,schema:S,keyword:v,it:w}=p;if(!Array.isArray(S))throw new Error("ajv implementation error");if(S.some(A=>(0,t.alwaysValidSchema)(w,A))&&!w.opts.unevaluated)return;const N=b.let("valid",!1),F=b.name("_valid");b.block(()=>S.forEach((A,O)=>{const U=p.subschema({keyword:v,schemaProp:O,compositeRule:!0},F);b.assign(N,(0,e._)`${N} || ${F}`),p.mergeValidEvaluated(U,F)||b.if((0,e.not)(N))})),p.result(N,()=>p.reset(),()=>p.error(!0))}return be.validateUnion=m,be}var iu;function X0(){if(iu)return yt;iu=1,Object.defineProperty(yt,"__esModule",{value:!0}),yt.validateKeywordUsage=yt.validSchemaType=yt.funcKeywordCode=yt.macroKeywordCode=void 0;const e=he(),t=qt(),n=bt(),r=kr();function i(h,d){const{gen:g,keyword:T,schema:y,parentSchema:m,it:p}=h,b=d.macro.call(p.self,y,m,p),S=u(g,T,b);p.opts.validateSchema!==!1&&p.self.validateSchema(b,!0);const v=g.name("valid");h.subschema({schema:b,schemaPath:e.nil,errSchemaPath:`${p.errSchemaPath}/${T}`,topSchemaRef:S,compositeRule:!0},v),h.pass(v,()=>h.error(!0))}yt.macroKeywordCode=i;function s(h,d){var g;const{gen:T,keyword:y,schema:m,parentSchema:p,$data:b,it:S}=h;l(S,d);const v=!b&&d.compile?d.compile.call(S.self,m,p,S):d.validate,w=u(T,y,v),x=T.let("valid");h.block$data(x,N),h.ok((g=d.valid)!==null&&g!==void 0?g:x);function N(){if(d.errors===!1)O(),d.modifying&&a(h),U(()=>h.error());else{const K=d.async?F():A();d.modifying&&a(h),U(()=>o(h,K))}}function F(){const K=T.let("ruleErrs",null);return T.try(()=>O((0,e._)`await `),H=>T.assign(x,!1).if((0,e._)`${H} instanceof ${S.ValidationError}`,()=>T.assign(K,(0,e._)`${H}.errors`),()=>T.throw(H))),K}function A(){const K=(0,e._)`${w}.errors`;return T.assign(K,null),O(e.nil),K}function O(K=d.async?(0,e._)`await `:e.nil){const H=S.opts.passContext?t.default.this:t.default.self,j=!("compile"in d&&!b||d.schema===!1);T.assign(x,(0,e._)`${K}${(0,n.callValidateCode)(h,w,H,j)}`,d.modifying)}function U(K){var H;T.if((0,e.not)((H=d.valid)!==null&&H!==void 0?H:x),K)}}yt.funcKeywordCode=s;function a(h){const{gen:d,data:g,it:T}=h;d.if(T.parentData,()=>d.assign(g,(0,e._)`${T.parentData}[${T.parentDataProperty}]`))}function o(h,d){const{gen:g}=h;g.if((0,e._)`Array.isArray(${d})`,()=>{g.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${d} : ${t.default.vErrors}.concat(${d})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,r.extendErrors)(h)},()=>h.error())}function l({schemaEnv:h},d){if(d.async&&!h.$async)throw new Error("async keyword in sync schema")}function u(h,d,g){if(g===void 0)throw new Error(`keyword "${d}" failed to compile`);return h.scopeValue("keyword",typeof g=="function"?{ref:g}:{ref:g,code:(0,e.stringify)(g)})}function c(h,d,g=!1){return!d.length||d.some(T=>T==="array"?Array.isArray(h):T==="object"?h&&typeof h=="object"&&!Array.isArray(h):typeof h==T||g&&typeof h>"u")}yt.validSchemaType=c;function f({schema:h,opts:d,self:g,errSchemaPath:T},y,m){if(Array.isArray(y.keyword)?!y.keyword.includes(m):y.keyword!==m)throw new Error("ajv implementation error");const p=y.dependencies;if(p?.some(b=>!Object.prototype.hasOwnProperty.call(h,b)))throw new Error(`parent schema must have dependencies of ${m}: ${p.join(",")}`);if(y.validateSchema&&!y.validateSchema(h[m])){const S=`keyword "${m}" value is invalid at path "${T}": `+g.errorsText(y.validateSchema.errors);if(d.validateSchema==="log")g.logger.error(S);else throw new Error(S)}}return yt.validateKeywordUsage=f,yt}var Rt={},su;function Q0(){if(su)return Rt;su=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.extendSubschemaMode=Rt.extendSubschemaData=Rt.getSubschema=void 0;const e=he(),t=me();function n(s,{keyword:a,schemaProp:o,schema:l,schemaPath:u,errSchemaPath:c,topSchemaRef:f}){if(a!==void 0&&l!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(a!==void 0){const h=s.schema[a];return o===void 0?{schema:h,schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(a)}`,errSchemaPath:`${s.errSchemaPath}/${a}`}:{schema:h[o],schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(a)}${(0,e.getProperty)(o)}`,errSchemaPath:`${s.errSchemaPath}/${a}/${(0,t.escapeFragment)(o)}`}}if(l!==void 0){if(u===void 0||c===void 0||f===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:l,schemaPath:u,topSchemaRef:f,errSchemaPath:c}}throw new Error('either "keyword" or "schema" must be passed')}Rt.getSubschema=n;function r(s,a,{dataProp:o,dataPropType:l,data:u,dataTypes:c,propertyName:f}){if(u!==void 0&&o!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:h}=a;if(o!==void 0){const{errorPath:g,dataPathArr:T,opts:y}=a,m=h.let("data",(0,e._)`${a.data}${(0,e.getProperty)(o)}`,!0);d(m),s.errorPath=(0,e.str)`${g}${(0,t.getErrorPath)(o,l,y.jsPropertySyntax)}`,s.parentDataProperty=(0,e._)`${o}`,s.dataPathArr=[...T,s.parentDataProperty]}if(u!==void 0){const g=u instanceof e.Name?u:h.let("data",u,!0);d(g),f!==void 0&&(s.propertyName=f)}c&&(s.dataTypes=c);function d(g){s.data=g,s.dataLevel=a.dataLevel+1,s.dataTypes=[],a.definedProperties=new Set,s.parentData=a.data,s.dataNames=[...a.dataNames,g]}}Rt.extendSubschemaData=r;function i(s,{jtdDiscriminator:a,jtdMetadata:o,compositeRule:l,createErrors:u,allErrors:c}){l!==void 0&&(s.compositeRule=l),u!==void 0&&(s.createErrors=u),c!==void 0&&(s.allErrors=c),s.jtdDiscriminator=a,s.jtdMetadata=o}return Rt.extendSubschemaMode=i,Rt}var Ke={},Js,au;function ou(){return au||(au=1,Js=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,i,s;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),r=s.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[i]))return!1;for(i=r;i--!==0;){var a=s[i];if(!e(t[a],n[a]))return!1}return!0}return t!==t&&n!==n}),Js}var Xs={exports:{}},lu;function eb(){if(lu)return Xs.exports;lu=1;var e=Xs.exports=function(r,i,s){typeof i=="function"&&(s=i,i={}),s=i.cb||s;var a=typeof s=="function"?s:s.pre||function(){},o=s.post||function(){};t(i,a,o,r,"",r)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function t(r,i,s,a,o,l,u,c,f,h){if(a&&typeof a=="object"&&!Array.isArray(a)){i(a,o,l,u,c,f,h);for(var d in a){var g=a[d];if(Array.isArray(g)){if(d in e.arrayKeywords)for(var T=0;T<g.length;T++)t(r,i,s,g[T],o+"/"+d+"/"+T,l,o,d,a,T)}else if(d in e.propsKeywords){if(g&&typeof g=="object")for(var y in g)t(r,i,s,g[y],o+"/"+d+"/"+n(y),l,o,d,a,y)}else(d in e.keywords||r.allKeys&&!(d in e.skipKeywords))&&t(r,i,s,g,o+"/"+d,l,o,d,a)}s(a,o,l,u,c,f,h)}}function n(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}return Xs.exports}var uu;function Sr(){if(uu)return Ke;uu=1,Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.getSchemaRefs=Ke.resolveUrl=Ke.normalizeId=Ke._getFullPath=Ke.getFullPath=Ke.inlineRef=void 0;const e=me(),t=ou(),n=eb(),r=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function i(T,y=!0){return typeof T=="boolean"?!0:y===!0?!a(T):y?o(T)<=y:!1}Ke.inlineRef=i;const s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function a(T){for(const y in T){if(s.has(y))return!0;const m=T[y];if(Array.isArray(m)&&m.some(a)||typeof m=="object"&&a(m))return!0}return!1}function o(T){let y=0;for(const m in T){if(m==="$ref")return 1/0;if(y++,!r.has(m)&&(typeof T[m]=="object"&&(0,e.eachItem)(T[m],p=>y+=o(p)),y===1/0))return 1/0}return y}function l(T,y="",m){m!==!1&&(y=f(y));const p=T.parse(y);return u(T,p)}Ke.getFullPath=l;function u(T,y){return T.serialize(y).split("#")[0]+"#"}Ke._getFullPath=u;const c=/#\/?$/;function f(T){return T?T.replace(c,""):""}Ke.normalizeId=f;function h(T,y,m){return m=f(m),T.resolve(y,m)}Ke.resolveUrl=h;const d=/^[a-z_][-a-z0-9._]*$/i;function g(T,y){if(typeof T=="boolean")return{};const{schemaId:m,uriResolver:p}=this.opts,b=f(T[m]||y),S={"":b},v=l(p,b,!1),w={},x=new Set;return n(T,{allKeys:!0},(A,O,U,K)=>{if(K===void 0)return;const H=v+O;let j=S[K];typeof A[m]=="string"&&(j=B.call(this,A[m])),Z.call(this,A.$anchor),Z.call(this,A.$dynamicAnchor),S[O]=j;function B(q){const ee=this.opts.uriResolver.resolve;if(q=f(j?ee(j,q):q),x.has(q))throw F(q);x.add(q);let k=this.refs[q];return typeof k=="string"&&(k=this.refs[k]),typeof k=="object"?N(A,k.schema,q):q!==f(H)&&(q[0]==="#"?(N(A,w[q],q),w[q]=A):this.refs[q]=H),q}function Z(q){if(typeof q=="string"){if(!d.test(q))throw new Error(`invalid anchor "${q}"`);B.call(this,`#${q}`)}}}),w;function N(A,O,U){if(O!==void 0&&!t(A,O))throw F(U)}function F(A){return new Error(`reference "${A}" resolves to more than one schema`)}}return Ke.getSchemaRefs=g,Ke}var cu;function xr(){if(cu)return Ct;cu=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.getData=Ct.KeywordCxt=Ct.validateFunctionCode=void 0;const e=Z0(),t=Er(),n=eu(),r=Er(),i=J0(),s=X0(),a=Q0(),o=he(),l=qt(),u=Sr(),c=me(),f=kr();function h(C){if(v(C)&&(x(C),S(C))){y(C);return}d(C,()=>(0,e.topBoolOrEmptySchema)(C))}Ct.validateFunctionCode=h;function d({gen:C,validateName:R,schema:z,schemaEnv:G,opts:Q},oe){Q.code.es5?C.func(R,(0,o._)`${l.default.data}, ${l.default.valCxt}`,G.$async,()=>{C.code((0,o._)`"use strict"; ${p(z,Q)}`),T(C,Q),C.code(oe)}):C.func(R,(0,o._)`${l.default.data}, ${g(Q)}`,G.$async,()=>C.code(p(z,Q)).code(oe))}function g(C){return(0,o._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${C.dynamicRef?(0,o._)`, ${l.default.dynamicAnchors}={}`:o.nil}}={}`}function T(C,R){C.if(l.default.valCxt,()=>{C.var(l.default.instancePath,(0,o._)`${l.default.valCxt}.${l.default.instancePath}`),C.var(l.default.parentData,(0,o._)`${l.default.valCxt}.${l.default.parentData}`),C.var(l.default.parentDataProperty,(0,o._)`${l.default.valCxt}.${l.default.parentDataProperty}`),C.var(l.default.rootData,(0,o._)`${l.default.valCxt}.${l.default.rootData}`),R.dynamicRef&&C.var(l.default.dynamicAnchors,(0,o._)`${l.default.valCxt}.${l.default.dynamicAnchors}`)},()=>{C.var(l.default.instancePath,(0,o._)`""`),C.var(l.default.parentData,(0,o._)`undefined`),C.var(l.default.parentDataProperty,(0,o._)`undefined`),C.var(l.default.rootData,l.default.data),R.dynamicRef&&C.var(l.default.dynamicAnchors,(0,o._)`{}`)})}function y(C){const{schema:R,opts:z,gen:G}=C;d(C,()=>{z.$comment&&R.$comment&&K(C),A(C),G.let(l.default.vErrors,null),G.let(l.default.errors,0),z.unevaluated&&m(C),N(C),H(C)})}function m(C){const{gen:R,validateName:z}=C;C.evaluated=R.const("evaluated",(0,o._)`${z}.evaluated`),R.if((0,o._)`${C.evaluated}.dynamicProps`,()=>R.assign((0,o._)`${C.evaluated}.props`,(0,o._)`undefined`)),R.if((0,o._)`${C.evaluated}.dynamicItems`,()=>R.assign((0,o._)`${C.evaluated}.items`,(0,o._)`undefined`))}function p(C,R){const z=typeof C=="object"&&C[R.schemaId];return z&&(R.code.source||R.code.process)?(0,o._)`/*# sourceURL=${z} */`:o.nil}function b(C,R){if(v(C)&&(x(C),S(C))){w(C,R);return}(0,e.boolOrEmptySchema)(C,R)}function S({schema:C,self:R}){if(typeof C=="boolean")return!C;for(const z in C)if(R.RULES.all[z])return!0;return!1}function v(C){return typeof C.schema!="boolean"}function w(C,R){const{schema:z,gen:G,opts:Q}=C;Q.$comment&&z.$comment&&K(C),O(C),U(C);const oe=G.const("_errs",l.default.errors);N(C,oe),G.var(R,(0,o._)`${oe} === ${l.default.errors}`)}function x(C){(0,c.checkUnknownRules)(C),F(C)}function N(C,R){if(C.opts.jtd)return B(C,[],!1,R);const z=(0,t.getSchemaTypes)(C.schema),G=(0,t.coerceAndCheckDataType)(C,z);B(C,z,!G,R)}function F(C){const{schema:R,errSchemaPath:z,opts:G,self:Q}=C;R.$ref&&G.ignoreKeywordsWithRef&&(0,c.schemaHasRulesButRef)(R,Q.RULES)&&Q.logger.warn(`$ref: keywords ignored in schema at path "${z}"`)}function A(C){const{schema:R,opts:z}=C;R.default!==void 0&&z.useDefaults&&z.strictSchema&&(0,c.checkStrictMode)(C,"default is ignored in the schema root")}function O(C){const R=C.schema[C.opts.schemaId];R&&(C.baseId=(0,u.resolveUrl)(C.opts.uriResolver,C.baseId,R))}function U(C){if(C.schema.$async&&!C.schemaEnv.$async)throw new Error("async schema in sync schema")}function K({gen:C,schemaEnv:R,schema:z,errSchemaPath:G,opts:Q}){const oe=z.$comment;if(Q.$comment===!0)C.code((0,o._)`${l.default.self}.logger.log(${oe})`);else if(typeof Q.$comment=="function"){const Se=(0,o.str)`${G}/$comment`,Oe=C.scopeValue("root",{ref:R.root});C.code((0,o._)`${l.default.self}.opts.$comment(${oe}, ${Se}, ${Oe}.schema)`)}}function H(C){const{gen:R,schemaEnv:z,validateName:G,ValidationError:Q,opts:oe}=C;z.$async?R.if((0,o._)`${l.default.errors} === 0`,()=>R.return(l.default.data),()=>R.throw((0,o._)`new ${Q}(${l.default.vErrors})`)):(R.assign((0,o._)`${G}.errors`,l.default.vErrors),oe.unevaluated&&j(C),R.return((0,o._)`${l.default.errors} === 0`))}function j({gen:C,evaluated:R,props:z,items:G}){z instanceof o.Name&&C.assign((0,o._)`${R}.props`,z),G instanceof o.Name&&C.assign((0,o._)`${R}.items`,G)}function B(C,R,z,G){const{gen:Q,schema:oe,data:Se,allErrors:Oe,opts:Pe,self:Ae}=C,{RULES:De}=Ae;if(oe.$ref&&(Pe.ignoreKeywordsWithRef||!(0,c.schemaHasRulesButRef)(oe,De))){Q.block(()=>X(C,"$ref",De.all.$ref.definition));return}Pe.jtd||q(C,R),Q.block(()=>{for(const Ue of De.rules)_t(Ue);_t(De.post)});function _t(Ue){(0,n.shouldUseGroup)(oe,Ue)&&(Ue.type?(Q.if((0,r.checkDataType)(Ue.type,Se,Pe.strictNumbers)),Z(C,Ue),R.length===1&&R[0]===Ue.type&&z&&(Q.else(),(0,r.reportTypeError)(C)),Q.endIf()):Z(C,Ue),Oe||Q.if((0,o._)`${l.default.errors} === ${G||0}`))}}function Z(C,R){const{gen:z,schema:G,opts:{useDefaults:Q}}=C;Q&&(0,i.assignDefaults)(C,R.type),z.block(()=>{for(const oe of R.rules)(0,n.shouldUseRule)(G,oe)&&X(C,oe.keyword,oe.definition,R.type)})}function q(C,R){C.schemaEnv.meta||!C.opts.strictTypes||(ee(C,R),C.opts.allowUnionTypes||k(C,R),D(C,C.dataTypes))}function ee(C,R){if(R.length){if(!C.dataTypes.length){C.dataTypes=R;return}R.forEach(z=>{_(C.dataTypes,z)||P(C,`type "${z}" not allowed by context "${C.dataTypes.join(",")}"`)}),E(C,R)}}function k(C,R){R.length>1&&!(R.length===2&&R.includes("null"))&&P(C,"use allowUnionTypes to allow union type keyword")}function D(C,R){const z=C.self.RULES.all;for(const G in z){const Q=z[G];if(typeof Q=="object"&&(0,n.shouldUseRule)(C.schema,Q)){const{type:oe}=Q.definition;oe.length&&!oe.some(Se=>I(R,Se))&&P(C,`missing type "${oe.join(",")}" for keyword "${G}"`)}}}function I(C,R){return C.includes(R)||R==="number"&&C.includes("integer")}function _(C,R){return C.includes(R)||R==="integer"&&C.includes("number")}function E(C,R){const z=[];for(const G of C.dataTypes)_(R,G)?z.push(G):R.includes("integer")&&G==="number"&&z.push("integer");C.dataTypes=z}function P(C,R){const z=C.schemaEnv.baseId+C.errSchemaPath;R+=` at "${z}" (strictTypes)`,(0,c.checkStrictMode)(C,R,C.opts.strictTypes)}class M{constructor(R,z,G){if((0,s.validateKeywordUsage)(R,z,G),this.gen=R.gen,this.allErrors=R.allErrors,this.keyword=G,this.data=R.data,this.schema=R.schema[G],this.$data=z.$data&&R.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,c.schemaRefOrVal)(R,this.schema,G,this.$data),this.schemaType=z.schemaType,this.parentSchema=R.schema,this.params={},this.it=R,this.def=z,this.$data)this.schemaCode=R.gen.const("vSchema",ne(this.$data,R));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,z.schemaType,z.allowUndefined))throw new Error(`${G} value must be ${JSON.stringify(z.schemaType)}`);("code"in z?z.trackErrors:z.errors!==!1)&&(this.errsCount=R.gen.const("_errs",l.default.errors))}result(R,z,G){this.failResult((0,o.not)(R),z,G)}failResult(R,z,G){this.gen.if(R),G?G():this.error(),z?(this.gen.else(),z(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(R,z){this.failResult((0,o.not)(R),void 0,z)}fail(R){if(R===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(R),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(R){if(!this.$data)return this.fail(R);const{schemaCode:z}=this;this.fail((0,o._)`${z} !== undefined && (${(0,o.or)(this.invalid$data(),R)})`)}error(R,z,G){if(z){this.setParams(z),this._error(R,G),this.setParams({});return}this._error(R,G)}_error(R,z){(R?f.reportExtraError:f.reportError)(this,this.def.error,z)}$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(R){this.allErrors||this.gen.if(R)}setParams(R,z){z?Object.assign(this.params,R):this.params=R}block$data(R,z,G=o.nil){this.gen.block(()=>{this.check$data(R,G),z()})}check$data(R=o.nil,z=o.nil){if(!this.$data)return;const{gen:G,schemaCode:Q,schemaType:oe,def:Se}=this;G.if((0,o.or)((0,o._)`${Q} === undefined`,z)),R!==o.nil&&G.assign(R,!0),(oe.length||Se.validateSchema)&&(G.elseIf(this.invalid$data()),this.$dataError(),R!==o.nil&&G.assign(R,!1)),G.else()}invalid$data(){const{gen:R,schemaCode:z,schemaType:G,def:Q,it:oe}=this;return(0,o.or)(Se(),Oe());function Se(){if(G.length){if(!(z instanceof o.Name))throw new Error("ajv implementation error");const Pe=Array.isArray(G)?G:[G];return(0,o._)`${(0,r.checkDataTypes)(Pe,z,oe.opts.strictNumbers,r.DataType.Wrong)}`}return o.nil}function Oe(){if(Q.validateSchema){const Pe=R.scopeValue("validate$data",{ref:Q.validateSchema});return(0,o._)`!${Pe}(${z})`}return o.nil}}subschema(R,z){const G=(0,a.getSubschema)(this.it,R);(0,a.extendSubschemaData)(G,this.it,R),(0,a.extendSubschemaMode)(G,R);const Q={...this.it,...G,items:void 0,props:void 0};return b(Q,z),Q}mergeEvaluated(R,z){const{it:G,gen:Q}=this;G.opts.unevaluated&&(G.props!==!0&&R.props!==void 0&&(G.props=c.mergeEvaluated.props(Q,R.props,G.props,z)),G.items!==!0&&R.items!==void 0&&(G.items=c.mergeEvaluated.items(Q,R.items,G.items,z)))}mergeValidEvaluated(R,z){const{it:G,gen:Q}=this;if(G.opts.unevaluated&&(G.props!==!0||G.items!==!0))return Q.if(z,()=>this.mergeEvaluated(R,o.Name)),!0}}Ct.KeywordCxt=M;function X(C,R,z,G){const Q=new M(C,z,R);"code"in z?z.code(Q,G):Q.$data&&z.validate?(0,s.funcKeywordCode)(Q,z):"macro"in z?(0,s.macroKeywordCode)(Q,z):(z.compile||z.validate)&&(0,s.funcKeywordCode)(Q,z)}const J=/^\/(?:[^~]|~0|~1)*$/,ae=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ne(C,{dataLevel:R,dataNames:z,dataPathArr:G}){let Q,oe;if(C==="")return l.default.rootData;if(C[0]==="/"){if(!J.test(C))throw new Error(`Invalid JSON-pointer: ${C}`);Q=C,oe=l.default.rootData}else{const Ae=ae.exec(C);if(!Ae)throw new Error(`Invalid JSON-pointer: ${C}`);const De=+Ae[1];if(Q=Ae[2],Q==="#"){if(De>=R)throw new Error(Pe("property/index",De));return G[R-De]}if(De>R)throw new Error(Pe("data",De));if(oe=z[R-De],!Q)return oe}let Se=oe;const Oe=Q.split("/");for(const Ae of Oe)Ae&&(oe=(0,o._)`${oe}${(0,o.getProperty)((0,c.unescapeJsonPointer)(Ae))}`,Se=(0,o._)`${Se} && ${oe}`);return Se;function Pe(Ae,De){return`Cannot access ${Ae} ${De} levels up, current level is ${R}`}}return Ct.getData=ne,Ct}var Pr={},fu;function Qs(){if(fu)return Pr;fu=1,Object.defineProperty(Pr,"__esModule",{value:!0});class e extends Error{constructor(n){super("validation failed"),this.errors=n,this.ajv=this.validation=!0}}return Pr.default=e,Pr}var Ar={},du;function Dr(){if(du)return Ar;du=1,Object.defineProperty(Ar,"__esModule",{value:!0});const e=Sr();class t extends Error{constructor(r,i,s,a){super(a||`can't resolve reference ${s} from id ${i}`),this.missingRef=(0,e.resolveUrl)(r,i,s),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(r,this.missingRef))}}return Ar.default=t,Ar}var ot={},hu;function ea(){if(hu)return ot;hu=1,Object.defineProperty(ot,"__esModule",{value:!0}),ot.resolveSchema=ot.getCompilingSchema=ot.resolveRef=ot.compileSchema=ot.SchemaEnv=void 0;const e=he(),t=Qs(),n=qt(),r=Sr(),i=me(),s=xr();class a{constructor(m){var p;this.refs={},this.dynamicAnchors={};let b;typeof m.schema=="object"&&(b=m.schema),this.schema=m.schema,this.schemaId=m.schemaId,this.root=m.root||this,this.baseId=(p=m.baseId)!==null&&p!==void 0?p:(0,r.normalizeId)(b?.[m.schemaId||"$id"]),this.schemaPath=m.schemaPath,this.localRefs=m.localRefs,this.meta=m.meta,this.$async=b?.$async,this.refs={}}}ot.SchemaEnv=a;function o(y){const m=c.call(this,y);if(m)return m;const p=(0,r.getFullPath)(this.opts.uriResolver,y.root.baseId),{es5:b,lines:S}=this.opts.code,{ownProperties:v}=this.opts,w=new e.CodeGen(this.scope,{es5:b,lines:S,ownProperties:v});let x;y.$async&&(x=w.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const N=w.scopeName("validate");y.validateName=N;const F={gen:w,allErrors:this.opts.allErrors,data:n.default.data,parentData:n.default.parentData,parentDataProperty:n.default.parentDataProperty,dataNames:[n.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:w.scopeValue("schema",this.opts.code.source===!0?{ref:y.schema,code:(0,e.stringify)(y.schema)}:{ref:y.schema}),validateName:N,ValidationError:x,schema:y.schema,schemaEnv:y,rootId:p,baseId:y.baseId||p,schemaPath:e.nil,errSchemaPath:y.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let A;try{this._compilations.add(y),(0,s.validateFunctionCode)(F),w.optimize(this.opts.code.optimize);const O=w.toString();A=`${w.scopeRefs(n.default.scope)}return ${O}`,this.opts.code.process&&(A=this.opts.code.process(A,y));const K=new Function(`${n.default.self}`,`${n.default.scope}`,A)(this,this.scope.get());if(this.scope.value(N,{ref:K}),K.errors=null,K.schema=y.schema,K.schemaEnv=y,y.$async&&(K.$async=!0),this.opts.code.source===!0&&(K.source={validateName:N,validateCode:O,scopeValues:w._values}),this.opts.unevaluated){const{props:H,items:j}=F;K.evaluated={props:H instanceof e.Name?void 0:H,items:j instanceof e.Name?void 0:j,dynamicProps:H instanceof e.Name,dynamicItems:j instanceof e.Name},K.source&&(K.source.evaluated=(0,e.stringify)(K.evaluated))}return y.validate=K,y}catch(O){throw delete y.validate,delete y.validateName,A&&this.logger.error("Error compiling schema, function code:",A),O}finally{this._compilations.delete(y)}}ot.compileSchema=o;function l(y,m,p){var b;p=(0,r.resolveUrl)(this.opts.uriResolver,m,p);const S=y.refs[p];if(S)return S;let v=h.call(this,y,p);if(v===void 0){const w=(b=y.localRefs)===null||b===void 0?void 0:b[p],{schemaId:x}=this.opts;w&&(v=new a({schema:w,schemaId:x,root:y,baseId:m}))}if(v!==void 0)return y.refs[p]=u.call(this,v)}ot.resolveRef=l;function u(y){return(0,r.inlineRef)(y.schema,this.opts.inlineRefs)?y.schema:y.validate?y:o.call(this,y)}function c(y){for(const m of this._compilations)if(f(m,y))return m}ot.getCompilingSchema=c;function f(y,m){return y.schema===m.schema&&y.root===m.root&&y.baseId===m.baseId}function h(y,m){let p;for(;typeof(p=this.refs[m])=="string";)m=p;return p||this.schemas[m]||d.call(this,y,m)}function d(y,m){const p=this.opts.uriResolver.parse(m),b=(0,r._getFullPath)(this.opts.uriResolver,p);let S=(0,r.getFullPath)(this.opts.uriResolver,y.baseId,void 0);if(Object.keys(y.schema).length>0&&b===S)return T.call(this,p,y);const v=(0,r.normalizeId)(b),w=this.refs[v]||this.schemas[v];if(typeof w=="string"){const x=d.call(this,y,w);return typeof x?.schema!="object"?void 0:T.call(this,p,x)}if(typeof w?.schema=="object"){if(w.validate||o.call(this,w),v===(0,r.normalizeId)(m)){const{schema:x}=w,{schemaId:N}=this.opts,F=x[N];return F&&(S=(0,r.resolveUrl)(this.opts.uriResolver,S,F)),new a({schema:x,schemaId:N,root:y,baseId:S})}return T.call(this,p,w)}}ot.resolveSchema=d;const g=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function T(y,{baseId:m,schema:p,root:b}){var S;if(((S=y.fragment)===null||S===void 0?void 0:S[0])!=="/")return;for(const x of y.fragment.slice(1).split("/")){if(typeof p=="boolean")return;const N=p[(0,i.unescapeFragment)(x)];if(N===void 0)return;p=N;const F=typeof p=="object"&&p[this.opts.schemaId];!g.has(x)&&F&&(m=(0,r.resolveUrl)(this.opts.uriResolver,m,F))}let v;if(typeof p!="boolean"&&p.$ref&&!(0,i.schemaHasRulesButRef)(p,this.RULES)){const x=(0,r.resolveUrl)(this.opts.uriResolver,m,p.$ref);v=d.call(this,b,x)}const{schemaId:w}=this.opts;if(v=v||new a({schema:p,schemaId:w,root:b,baseId:m}),v.schema!==v.root.schema)return v}return ot}const tb={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1};var $r={},Bn={exports:{}},ta,pu;function mu(){if(pu)return ta;pu=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function n(h){let d="",g=0,T=0;for(T=0;T<h.length;T++)if(g=h[T].charCodeAt(0),g!==48){if(!(g>=48&&g<=57||g>=65&&g<=70||g>=97&&g<=102))return"";d+=h[T];break}for(T+=1;T<h.length;T++){if(g=h[T].charCodeAt(0),!(g>=48&&g<=57||g>=65&&g<=70||g>=97&&g<=102))return"";d+=h[T]}return d}const r=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function i(h){return h.length=0,!0}function s(h,d,g){if(h.length){const T=n(h);if(T!=="")d.push(T);else return g.error=!0,!1;h.length=0}return!0}function a(h){let d=0;const g={error:!1,address:"",zone:""},T=[],y=[];let m=!1,p=!1,b=s;for(let S=0;S<h.length;S++){const v=h[S];if(!(v==="["||v==="]"))if(v===":"){if(m===!0&&(p=!0),!b(y,T,g))break;if(++d>7){g.error=!0;break}S>0&&h[S-1]===":"&&(m=!0),T.push(":");continue}else if(v==="%"){if(!b(y,T,g))break;b=i}else{y.push(v);continue}}return y.length&&(b===i?g.zone=y.join(""):p?T.push(y.join("")):T.push(n(y))),g.address=T.join(""),g}function o(h){if(l(h,":")<2)return{host:h,isIPV6:!1};const d=a(h);if(d.error)return{host:h,isIPV6:!1};{let g=d.address,T=d.address;return d.zone&&(g+="%"+d.zone,T+="%25"+d.zone),{host:g,isIPV6:!0,escapedHost:T}}}function l(h,d){let g=0;for(let T=0;T<h.length;T++)h[T]===d&&g++;return g}function u(h){let d=h;const g=[];let T=-1,y=0;for(;y=d.length;){if(y===1){if(d===".")break;if(d==="/"){g.push("/");break}else{g.push(d);break}}else if(y===2){if(d[0]==="."){if(d[1]===".")break;if(d[1]==="/"){d=d.slice(2);continue}}else if(d[0]==="/"&&(d[1]==="."||d[1]==="/")){g.push("/");break}}else if(y===3&&d==="/.."){g.length!==0&&g.pop(),g.push("/");break}if(d[0]==="."){if(d[1]==="."){if(d[2]==="/"){d=d.slice(3);continue}}else if(d[1]==="/"){d=d.slice(2);continue}}else if(d[0]==="/"&&d[1]==="."){if(d[2]==="/"){d=d.slice(2);continue}else if(d[2]==="."&&d[3]==="/"){d=d.slice(3),g.length!==0&&g.pop();continue}}if((T=d.indexOf("/",1))===-1){g.push(d);break}else g.push(d.slice(0,T)),d=d.slice(T)}return g.join("")}function c(h,d){const g=d!==!0?escape:unescape;return h.scheme!==void 0&&(h.scheme=g(h.scheme)),h.userinfo!==void 0&&(h.userinfo=g(h.userinfo)),h.host!==void 0&&(h.host=g(h.host)),h.path!==void 0&&(h.path=g(h.path)),h.query!==void 0&&(h.query=g(h.query)),h.fragment!==void 0&&(h.fragment=g(h.fragment)),h}function f(h){const d=[];if(h.userinfo!==void 0&&(d.push(h.userinfo),d.push("@")),h.host!==void 0){let g=unescape(h.host);if(!t(g)){const T=o(g);T.isIPV6===!0?g=`[${T.escapedHost}]`:g=h.host}d.push(g)}return(typeof h.port=="number"||typeof h.port=="string")&&(d.push(":"),d.push(String(h.port))),d.length?d.join(""):void 0}return ta={nonSimpleDomain:r,recomposeAuthority:f,normalizeComponentEncoding:c,removeDotSegments:u,isIPv4:t,isUUID:e,normalizeIPv6:o,stringArrayToHexStripped:n},ta}var na,gu;function nb(){if(gu)return na;gu=1;const{isUUID:e}=mu(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,n=["http","https","ws","wss","urn","urn:uuid"];function r(v){return n.indexOf(v)!==-1}function i(v){return v.secure===!0?!0:v.secure===!1?!1:v.scheme?v.scheme.length===3&&(v.scheme[0]==="w"||v.scheme[0]==="W")&&(v.scheme[1]==="s"||v.scheme[1]==="S")&&(v.scheme[2]==="s"||v.scheme[2]==="S"):!1}function s(v){return v.host||(v.error=v.error||"HTTP URIs must have a host."),v}function a(v){const w=String(v.scheme).toLowerCase()==="https";return(v.port===(w?443:80)||v.port==="")&&(v.port=void 0),v.path||(v.path="/"),v}function o(v){return v.secure=i(v),v.resourceName=(v.path||"/")+(v.query?"?"+v.query:""),v.path=void 0,v.query=void 0,v}function l(v){if((v.port===(i(v)?443:80)||v.port==="")&&(v.port=void 0),typeof v.secure=="boolean"&&(v.scheme=v.secure?"wss":"ws",v.secure=void 0),v.resourceName){const[w,x]=v.resourceName.split("?");v.path=w&&w!=="/"?w:void 0,v.query=x,v.resourceName=void 0}return v.fragment=void 0,v}function u(v,w){if(!v.path)return v.error="URN can not be parsed",v;const x=v.path.match(t);if(x){const N=w.scheme||v.scheme||"urn";v.nid=x[1].toLowerCase(),v.nss=x[2];const F=`${N}:${w.nid||v.nid}`,A=S(F);v.path=void 0,A&&(v=A.parse(v,w))}else v.error=v.error||"URN can not be parsed.";return v}function c(v,w){if(v.nid===void 0)throw new Error("URN without nid cannot be serialized");const x=w.scheme||v.scheme||"urn",N=v.nid.toLowerCase(),F=`${x}:${w.nid||N}`,A=S(F);A&&(v=A.serialize(v,w));const O=v,U=v.nss;return O.path=`${N||w.nid}:${U}`,w.skipEscape=!0,O}function f(v,w){const x=v;return x.uuid=x.nss,x.nss=void 0,!w.tolerant&&(!x.uuid||!e(x.uuid))&&(x.error=x.error||"UUID is not valid."),x}function h(v){const w=v;return w.nss=(v.uuid||"").toLowerCase(),w}const d={scheme:"http",domainHost:!0,parse:s,serialize:a},g={scheme:"https",domainHost:d.domainHost,parse:s,serialize:a},T={scheme:"ws",domainHost:!0,parse:o,serialize:l},y={scheme:"wss",domainHost:T.domainHost,parse:T.parse,serialize:T.serialize},b={http:d,https:g,ws:T,wss:y,urn:{scheme:"urn",parse:u,serialize:c,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:f,serialize:h,skipNormalize:!0}};Object.setPrototypeOf(b,null);function S(v){return v&&(b[v]||b[v.toLowerCase()])||void 0}return na={wsIsSecure:i,SCHEMES:b,isValidSchemeName:r,getSchemeHandler:S},na}var yu;function rb(){if(yu)return Bn.exports;yu=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:n,normalizeComponentEncoding:r,isIPv4:i,nonSimpleDomain:s}=mu(),{SCHEMES:a,getSchemeHandler:o}=nb();function l(y,m){return typeof y=="string"?y=h(g(y,m),m):typeof y=="object"&&(y=g(h(y,m),m)),y}function u(y,m,p){const b=p?Object.assign({scheme:"null"},p):{scheme:"null"},S=c(g(y,b),g(m,b),b,!0);return b.skipEscape=!0,h(S,b)}function c(y,m,p,b){const S={};return b||(y=g(h(y,p),p),m=g(h(m,p),p)),p=p||{},!p.tolerant&&m.scheme?(S.scheme=m.scheme,S.userinfo=m.userinfo,S.host=m.host,S.port=m.port,S.path=t(m.path||""),S.query=m.query):(m.userinfo!==void 0||m.host!==void 0||m.port!==void 0?(S.userinfo=m.userinfo,S.host=m.host,S.port=m.port,S.path=t(m.path||""),S.query=m.query):(m.path?(m.path[0]==="/"?S.path=t(m.path):((y.userinfo!==void 0||y.host!==void 0||y.port!==void 0)&&!y.path?S.path="/"+m.path:y.path?S.path=y.path.slice(0,y.path.lastIndexOf("/")+1)+m.path:S.path=m.path,S.path=t(S.path)),S.query=m.query):(S.path=y.path,m.query!==void 0?S.query=m.query:S.query=y.query),S.userinfo=y.userinfo,S.host=y.host,S.port=y.port),S.scheme=y.scheme),S.fragment=m.fragment,S}function f(y,m,p){return typeof y=="string"?(y=unescape(y),y=h(r(g(y,p),!0),{...p,skipEscape:!0})):typeof y=="object"&&(y=h(r(y,!0),{...p,skipEscape:!0})),typeof m=="string"?(m=unescape(m),m=h(r(g(m,p),!0),{...p,skipEscape:!0})):typeof m=="object"&&(m=h(r(m,!0),{...p,skipEscape:!0})),y.toLowerCase()===m.toLowerCase()}function h(y,m){const p={host:y.host,scheme:y.scheme,userinfo:y.userinfo,port:y.port,path:y.path,query:y.query,nid:y.nid,nss:y.nss,uuid:y.uuid,fragment:y.fragment,reference:y.reference,resourceName:y.resourceName,secure:y.secure,error:""},b=Object.assign({},m),S=[],v=o(b.scheme||p.scheme);v&&v.serialize&&v.serialize(p,b),p.path!==void 0&&(b.skipEscape?p.path=unescape(p.path):(p.path=escape(p.path),p.scheme!==void 0&&(p.path=p.path.split("%3A").join(":")))),b.reference!=="suffix"&&p.scheme&&S.push(p.scheme,":");const w=n(p);if(w!==void 0&&(b.reference!=="suffix"&&S.push("//"),S.push(w),p.path&&p.path[0]!=="/"&&S.push("/")),p.path!==void 0){let x=p.path;!b.absolutePath&&(!v||!v.absolutePath)&&(x=t(x)),w===void 0&&x[0]==="/"&&x[1]==="/"&&(x="/%2F"+x.slice(2)),S.push(x)}return p.query!==void 0&&S.push("?",p.query),p.fragment!==void 0&&S.push("#",p.fragment),S.join("")}const d=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function g(y,m){const p=Object.assign({},m),b={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let S=!1;p.reference==="suffix"&&(p.scheme?y=p.scheme+":"+y:y="//"+y);const v=y.match(d);if(v){if(b.scheme=v[1],b.userinfo=v[3],b.host=v[4],b.port=parseInt(v[5],10),b.path=v[6]||"",b.query=v[7],b.fragment=v[8],isNaN(b.port)&&(b.port=v[5]),b.host)if(i(b.host)===!1){const N=e(b.host);b.host=N.host.toLowerCase(),S=N.isIPV6}else S=!0;b.scheme===void 0&&b.userinfo===void 0&&b.host===void 0&&b.port===void 0&&b.query===void 0&&!b.path?b.reference="same-document":b.scheme===void 0?b.reference="relative":b.fragment===void 0?b.reference="absolute":b.reference="uri",p.reference&&p.reference!=="suffix"&&p.reference!==b.reference&&(b.error=b.error||"URI is not a "+p.reference+" reference.");const w=o(p.scheme||b.scheme);if(!p.unicodeSupport&&(!w||!w.unicodeSupport)&&b.host&&(p.domainHost||w&&w.domainHost)&&S===!1&&s(b.host))try{b.host=URL.domainToASCII(b.host.toLowerCase())}catch(x){b.error=b.error||"Host's domain name can not be converted to ASCII: "+x}(!w||w&&!w.skipNormalize)&&(y.indexOf("%")!==-1&&(b.scheme!==void 0&&(b.scheme=unescape(b.scheme)),b.host!==void 0&&(b.host=unescape(b.host))),b.path&&(b.path=escape(unescape(b.path))),b.fragment&&(b.fragment=encodeURI(decodeURIComponent(b.fragment)))),w&&w.parse&&w.parse(b,p)}else b.error=b.error||"URI can not be parsed.";return b}const T={SCHEMES:a,normalize:l,resolve:u,resolveComponent:c,equal:f,serialize:h,parse:g};return Bn.exports=T,Bn.exports.default=T,Bn.exports.fastUri=T,Bn.exports}var bu;function ib(){if(bu)return $r;bu=1,Object.defineProperty($r,"__esModule",{value:!0});const e=rb();return e.code='require("ajv/dist/runtime/uri").default',$r.default=e,$r}var wu;function sb(){return wu||(wu=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=xr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=he();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const r=Qs(),i=Dr(),s=Xl(),a=ea(),o=he(),l=Sr(),u=Er(),c=me(),f=tb,h=ib(),d=(k,D)=>new RegExp(k,D);d.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],T=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),y={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."},m={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},p=200;function b(k){var D,I,_,E,P,M,X,J,ae,ne,C,R,z,G,Q,oe,Se,Oe,Pe,Ae,De,_t,Ue,Lt,vt;const L=k.strict,V=(D=k.code)===null||D===void 0?void 0:D.optimize,se=V===!0||V===void 0?1:V||0,ue=(_=(I=k.code)===null||I===void 0?void 0:I.regExp)!==null&&_!==void 0?_:d,ge=(E=k.uriResolver)!==null&&E!==void 0?E:h.default;return{strictSchema:(M=(P=k.strictSchema)!==null&&P!==void 0?P:L)!==null&&M!==void 0?M:!0,strictNumbers:(J=(X=k.strictNumbers)!==null&&X!==void 0?X:L)!==null&&J!==void 0?J:!0,strictTypes:(ne=(ae=k.strictTypes)!==null&&ae!==void 0?ae:L)!==null&&ne!==void 0?ne:"log",strictTuples:(R=(C=k.strictTuples)!==null&&C!==void 0?C:L)!==null&&R!==void 0?R:"log",strictRequired:(G=(z=k.strictRequired)!==null&&z!==void 0?z:L)!==null&&G!==void 0?G:!1,code:k.code?{...k.code,optimize:se,regExp:ue}:{optimize:se,regExp:ue},loopRequired:(Q=k.loopRequired)!==null&&Q!==void 0?Q:p,loopEnum:(oe=k.loopEnum)!==null&&oe!==void 0?oe:p,meta:(Se=k.meta)!==null&&Se!==void 0?Se:!0,messages:(Oe=k.messages)!==null&&Oe!==void 0?Oe:!0,inlineRefs:(Pe=k.inlineRefs)!==null&&Pe!==void 0?Pe:!0,schemaId:(Ae=k.schemaId)!==null&&Ae!==void 0?Ae:"$id",addUsedSchema:(De=k.addUsedSchema)!==null&&De!==void 0?De:!0,validateSchema:(_t=k.validateSchema)!==null&&_t!==void 0?_t:!0,validateFormats:(Ue=k.validateFormats)!==null&&Ue!==void 0?Ue:!0,unicodeRegExp:(Lt=k.unicodeRegExp)!==null&&Lt!==void 0?Lt:!0,int32range:(vt=k.int32range)!==null&&vt!==void 0?vt:!0,uriResolver:ge}}class S{constructor(D={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,D=this.opts={...D,...b(D)};const{es5:I,lines:_}=this.opts.code;this.scope=new o.ValueScope({scope:{},prefixes:T,es5:I,lines:_}),this.logger=U(D.logger);const E=D.validateFormats;D.validateFormats=!1,this.RULES=(0,s.getRules)(),v.call(this,y,D,"NOT SUPPORTED"),v.call(this,m,D,"DEPRECATED","warn"),this._metaOpts=A.call(this),D.formats&&N.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),D.keywords&&F.call(this,D.keywords),typeof D.meta=="object"&&this.addMetaSchema(D.meta),x.call(this),D.validateFormats=E}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:D,meta:I,schemaId:_}=this.opts;let E=f;_==="id"&&(E={...f},E.id=E.$id,delete E.$id),I&&D&&this.addMetaSchema(E,E[_],!1)}defaultMeta(){const{meta:D,schemaId:I}=this.opts;return this.opts.defaultMeta=typeof D=="object"?D[I]||D:void 0}validate(D,I){let _;if(typeof D=="string"){if(_=this.getSchema(D),!_)throw new Error(`no schema with key or ref "${D}"`)}else _=this.compile(D);const E=_(I);return"$async"in _||(this.errors=_.errors),E}compile(D,I){const _=this._addSchema(D,I);return _.validate||this._compileSchemaEnv(_)}compileAsync(D,I){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:_}=this.opts;return E.call(this,D,I);async function E(ne,C){await P.call(this,ne.$schema);const R=this._addSchema(ne,C);return R.validate||M.call(this,R)}async function P(ne){ne&&!this.getSchema(ne)&&await E.call(this,{$ref:ne},!0)}async function M(ne){try{return this._compileSchemaEnv(ne)}catch(C){if(!(C instanceof i.default))throw C;return X.call(this,C),await J.call(this,C.missingSchema),M.call(this,ne)}}function X({missingSchema:ne,missingRef:C}){if(this.refs[ne])throw new Error(`AnySchema ${ne} is loaded but ${C} cannot be resolved`)}async function J(ne){const C=await ae.call(this,ne);this.refs[ne]||await P.call(this,C.$schema),this.refs[ne]||this.addSchema(C,ne,I)}async function ae(ne){const C=this._loading[ne];if(C)return C;try{return await(this._loading[ne]=_(ne))}finally{delete this._loading[ne]}}}addSchema(D,I,_,E=this.opts.validateSchema){if(Array.isArray(D)){for(const M of D)this.addSchema(M,void 0,_,E);return this}let P;if(typeof D=="object"){const{schemaId:M}=this.opts;if(P=D[M],P!==void 0&&typeof P!="string")throw new Error(`schema ${M} must be string`)}return I=(0,l.normalizeId)(I||P),this._checkUnique(I),this.schemas[I]=this._addSchema(D,_,I,E,!0),this}addMetaSchema(D,I,_=this.opts.validateSchema){return this.addSchema(D,I,!0,_),this}validateSchema(D,I){if(typeof D=="boolean")return!0;let _;if(_=D.$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 E=this.validate(_,D);if(!E&&I){const P="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(P);else throw new Error(P)}return E}getSchema(D){let I;for(;typeof(I=w.call(this,D))=="string";)D=I;if(I===void 0){const{schemaId:_}=this.opts,E=new a.SchemaEnv({schema:{},schemaId:_});if(I=a.resolveSchema.call(this,E,D),!I)return;this.refs[D]=I}return I.validate||this._compileSchemaEnv(I)}removeSchema(D){if(D instanceof RegExp)return this._removeAllSchemas(this.schemas,D),this._removeAllSchemas(this.refs,D),this;switch(typeof D){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const I=w.call(this,D);return typeof I=="object"&&this._cache.delete(I.schema),delete this.schemas[D],delete this.refs[D],this}case"object":{const I=D;this._cache.delete(I);let _=D[this.opts.schemaId];return _&&(_=(0,l.normalizeId)(_),delete this.schemas[_],delete this.refs[_]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(D){for(const I of D)this.addKeyword(I);return this}addKeyword(D,I){let _;if(typeof D=="string")_=D,typeof I=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),I.keyword=_);else if(typeof D=="object"&&I===void 0){if(I=D,_=I.keyword,Array.isArray(_)&&!_.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(H.call(this,_,I),!I)return(0,c.eachItem)(_,P=>j.call(this,P)),this;Z.call(this,I);const E={...I,type:(0,u.getJSONTypes)(I.type),schemaType:(0,u.getJSONTypes)(I.schemaType)};return(0,c.eachItem)(_,E.type.length===0?P=>j.call(this,P,E):P=>E.type.forEach(M=>j.call(this,P,E,M))),this}getKeyword(D){const I=this.RULES.all[D];return typeof I=="object"?I.definition:!!I}removeKeyword(D){const{RULES:I}=this;delete I.keywords[D],delete I.all[D];for(const _ of I.rules){const E=_.rules.findIndex(P=>P.keyword===D);E>=0&&_.rules.splice(E,1)}return this}addFormat(D,I){return typeof I=="string"&&(I=new RegExp(I)),this.formats[D]=I,this}errorsText(D=this.errors,{separator:I=", ",dataVar:_="data"}={}){return!D||D.length===0?"No errors":D.map(E=>`${_}${E.instancePath} ${E.message}`).reduce((E,P)=>E+I+P)}$dataMetaSchema(D,I){const _=this.RULES.all;D=JSON.parse(JSON.stringify(D));for(const E of I){const P=E.split("/").slice(1);let M=D;for(const X of P)M=M[X];for(const X in _){const J=_[X];if(typeof J!="object")continue;const{$data:ae}=J.definition,ne=M[X];ae&&ne&&(M[X]=ee(ne))}}return D}_removeAllSchemas(D,I){for(const _ in D){const E=D[_];(!I||I.test(_))&&(typeof E=="string"?delete D[_]:E&&!E.meta&&(this._cache.delete(E.schema),delete D[_]))}}_addSchema(D,I,_,E=this.opts.validateSchema,P=this.opts.addUsedSchema){let M;const{schemaId:X}=this.opts;if(typeof D=="object")M=D[X];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof D!="boolean")throw new Error("schema must be object or boolean")}let J=this._cache.get(D);if(J!==void 0)return J;_=(0,l.normalizeId)(M||_);const ae=l.getSchemaRefs.call(this,D,_);return J=new a.SchemaEnv({schema:D,schemaId:X,meta:I,baseId:_,localRefs:ae}),this._cache.set(J.schema,J),P&&!_.startsWith("#")&&(_&&this._checkUnique(_),this.refs[_]=J),E&&this.validateSchema(D,!0),J}_checkUnique(D){if(this.schemas[D]||this.refs[D])throw new Error(`schema with key or id "${D}" already exists`)}_compileSchemaEnv(D){if(D.meta?this._compileMetaSchema(D):a.compileSchema.call(this,D),!D.validate)throw new Error("ajv implementation error");return D.validate}_compileMetaSchema(D){const I=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,D)}finally{this.opts=I}}}S.ValidationError=r.default,S.MissingRefError=i.default,e.default=S;function v(k,D,I,_="error"){for(const E in k){const P=E;P in D&&this.logger[_](`${I}: option ${E}. ${k[P]}`)}}function w(k){return k=(0,l.normalizeId)(k),this.schemas[k]||this.refs[k]}function x(){const k=this.opts.schemas;if(k)if(Array.isArray(k))this.addSchema(k);else for(const D in k)this.addSchema(k[D],D)}function N(){for(const k in this.opts.formats){const D=this.opts.formats[k];D&&this.addFormat(k,D)}}function F(k){if(Array.isArray(k)){this.addVocabulary(k);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const D in k){const I=k[D];I.keyword||(I.keyword=D),this.addKeyword(I)}}function A(){const k={...this.opts};for(const D of g)delete k[D];return k}const O={log(){},warn(){},error(){}};function U(k){if(k===!1)return O;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 K=/^[a-z_$][a-z0-9_$:-]*$/i;function H(k,D){const{RULES:I}=this;if((0,c.eachItem)(k,_=>{if(I.keywords[_])throw new Error(`Keyword ${_} is already defined`);if(!K.test(_))throw new Error(`Keyword ${_} has invalid name`)}),!!D&&D.$data&&!("code"in D||"validate"in D))throw new Error('$data keyword must have "code" or "validate" function')}function j(k,D,I){var _;const E=D?.post;if(I&&E)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:P}=this;let M=E?P.post:P.rules.find(({type:J})=>J===I);if(M||(M={type:I,rules:[]},P.rules.push(M)),P.keywords[k]=!0,!D)return;const X={keyword:k,definition:{...D,type:(0,u.getJSONTypes)(D.type),schemaType:(0,u.getJSONTypes)(D.schemaType)}};D.before?B.call(this,M,X,D.before):M.rules.push(X),P.all[k]=X,(_=D.implements)===null||_===void 0||_.forEach(J=>this.addKeyword(J))}function B(k,D,I){const _=k.rules.findIndex(E=>E.keyword===I);_>=0?k.rules.splice(_,0,D):(k.rules.push(D),this.logger.warn(`rule ${I} is not defined`))}function Z(k){let{metaSchema:D}=k;D!==void 0&&(k.$data&&this.opts.$data&&(D=ee(D)),k.validateSchema=this.compile(D,!0))}const q={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ee(k){return{anyOf:[k,q]}}})(Ws)),Ws}var Cr={},Or={},Rr={},_u;function ab(){if(_u)return Rr;_u=1,Object.defineProperty(Rr,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Rr.default=e,Rr}var Ht={},vu;function ob(){if(vu)return Ht;vu=1,Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.callRef=Ht.getValidate=void 0;const e=Dr(),t=bt(),n=he(),r=qt(),i=ea(),s=me(),a={keyword:"$ref",schemaType:"string",code(u){const{gen:c,schema:f,it:h}=u,{baseId:d,schemaEnv:g,validateName:T,opts:y,self:m}=h,{root:p}=g;if((f==="#"||f==="#/")&&d===p.baseId)return S();const b=i.resolveRef.call(m,p,d,f);if(b===void 0)throw new e.default(h.opts.uriResolver,d,f);if(b instanceof i.SchemaEnv)return v(b);return w(b);function S(){if(g===p)return l(u,T,g,g.$async);const x=c.scopeValue("root",{ref:p});return l(u,(0,n._)`${x}.validate`,p,p.$async)}function v(x){const N=o(u,x);l(u,N,x,x.$async)}function w(x){const N=c.scopeValue("schema",y.code.source===!0?{ref:x,code:(0,n.stringify)(x)}:{ref:x}),F=c.name("valid"),A=u.subschema({schema:x,dataTypes:[],schemaPath:n.nil,topSchemaRef:N,errSchemaPath:f},F);u.mergeEvaluated(A),u.ok(F)}}};function o(u,c){const{gen:f}=u;return c.validate?f.scopeValue("validate",{ref:c.validate}):(0,n._)`${f.scopeValue("wrapper",{ref:c})}.validate`}Ht.getValidate=o;function l(u,c,f,h){const{gen:d,it:g}=u,{allErrors:T,schemaEnv:y,opts:m}=g,p=m.passContext?r.default.this:n.nil;h?b():S();function b(){if(!y.$async)throw new Error("async schema referenced by sync schema");const x=d.let("valid");d.try(()=>{d.code((0,n._)`await ${(0,t.callValidateCode)(u,c,p)}`),w(c),T||d.assign(x,!0)},N=>{d.if((0,n._)`!(${N} instanceof ${g.ValidationError})`,()=>d.throw(N)),v(N),T||d.assign(x,!1)}),u.ok(x)}function S(){u.result((0,t.callValidateCode)(u,c,p),()=>w(c),()=>v(c))}function v(x){const N=(0,n._)`${x}.errors`;d.assign(r.default.vErrors,(0,n._)`${r.default.vErrors} === null ? ${N} : ${r.default.vErrors}.concat(${N})`),d.assign(r.default.errors,(0,n._)`${r.default.vErrors}.length`)}function w(x){var N;if(!g.opts.unevaluated)return;const F=(N=f?.validate)===null||N===void 0?void 0:N.evaluated;if(g.props!==!0)if(F&&!F.dynamicProps)F.props!==void 0&&(g.props=s.mergeEvaluated.props(d,F.props,g.props));else{const A=d.var("props",(0,n._)`${x}.evaluated.props`);g.props=s.mergeEvaluated.props(d,A,g.props,n.Name)}if(g.items!==!0)if(F&&!F.dynamicItems)F.items!==void 0&&(g.items=s.mergeEvaluated.items(d,F.items,g.items));else{const A=d.var("items",(0,n._)`${x}.evaluated.items`);g.items=s.mergeEvaluated.items(d,A,g.items,n.Name)}}}return Ht.callRef=l,Ht.default=a,Ht}var Tu;function lb(){if(Tu)return Or;Tu=1,Object.defineProperty(Or,"__esModule",{value:!0});const e=ab(),t=ob(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return Or.default=n,Or}var Nr={},Mr={},ku;function ub(){if(ku)return Mr;ku=1,Object.defineProperty(Mr,"__esModule",{value:!0});const e=he(),t=e.operators,n={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},r={message:({keyword:s,schemaCode:a})=>(0,e.str)`must be ${n[s].okStr} ${a}`,params:({keyword:s,schemaCode:a})=>(0,e._)`{comparison: ${n[s].okStr}, limit: ${a}}`},i={keyword:Object.keys(n),type:"number",schemaType:"number",$data:!0,error:r,code(s){const{keyword:a,data:o,schemaCode:l}=s;s.fail$data((0,e._)`${o} ${n[a].fail} ${l} || isNaN(${o})`)}};return Mr.default=i,Mr}var Ir={},Eu;function cb(){if(Eu)return Ir;Eu=1,Object.defineProperty(Ir,"__esModule",{value:!0});const e=he(),n={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must be multiple of ${r}`,params:({schemaCode:r})=>(0,e._)`{multipleOf: ${r}}`},code(r){const{gen:i,data:s,schemaCode:a,it:o}=r,l=o.opts.multipleOfPrecision,u=i.let("res"),c=l?(0,e._)`Math.abs(Math.round(${u}) - ${u}) > 1e-${l}`:(0,e._)`${u} !== parseInt(${u})`;r.fail$data((0,e._)`(${a} === 0 || (${u} = ${s}/${a}, ${c}))`)}};return Ir.default=n,Ir}var Lr={},Fr={},Su;function fb(){if(Su)return Fr;Su=1,Object.defineProperty(Fr,"__esModule",{value:!0});function e(t){const n=t.length;let r=0,i=0,s;for(;i<n;)r++,s=t.charCodeAt(i++),s>=55296&&s<=56319&&i<n&&(s=t.charCodeAt(i),(s&64512)===56320&&i++);return r}return Fr.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Fr}var xu;function db(){if(xu)return Lr;xu=1,Object.defineProperty(Lr,"__esModule",{value:!0});const e=he(),t=me(),n=fb(),i={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:a}){const o=s==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${a} characters`},params:({schemaCode:s})=>(0,e._)`{limit: ${s}}`},code(s){const{keyword:a,data:o,schemaCode:l,it:u}=s,c=a==="maxLength"?e.operators.GT:e.operators.LT,f=u.opts.unicode===!1?(0,e._)`${o}.length`:(0,e._)`${(0,t.useFunc)(s.gen,n.default)}(${o})`;s.fail$data((0,e._)`${f} ${c} ${l}`)}};return Lr.default=i,Lr}var jr={},Pu;function hb(){if(Pu)return jr;Pu=1,Object.defineProperty(jr,"__esModule",{value:!0});const e=bt(),t=me(),n=he(),i={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:s})=>(0,n.str)`must match pattern "${s}"`,params:({schemaCode:s})=>(0,n._)`{pattern: ${s}}`},code(s){const{gen:a,data:o,$data:l,schema:u,schemaCode:c,it:f}=s,h=f.opts.unicodeRegExp?"u":"";if(l){const{regExp:d}=f.opts.code,g=d.code==="new RegExp"?(0,n._)`new RegExp`:(0,t.useFunc)(a,d),T=a.let("valid");a.try(()=>a.assign(T,(0,n._)`${g}(${c}, ${h}).test(${o})`),()=>a.assign(T,!1)),s.fail$data((0,n._)`!${T}`)}else{const d=(0,e.usePattern)(s,u);s.fail$data((0,n._)`!${d}.test(${o})`)}}};return jr.default=i,jr}var zr={},Au;function pb(){if(Au)return zr;Au=1,Object.defineProperty(zr,"__esModule",{value:!0});const e=he(),n={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:i}){const s=r==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${i} properties`},params:({schemaCode:r})=>(0,e._)`{limit: ${r}}`},code(r){const{keyword:i,data:s,schemaCode:a}=r,o=i==="maxProperties"?e.operators.GT:e.operators.LT;r.fail$data((0,e._)`Object.keys(${s}).length ${o} ${a}`)}};return zr.default=n,zr}var Ur={},Du;function mb(){if(Du)return Ur;Du=1,Object.defineProperty(Ur,"__esModule",{value:!0});const e=bt(),t=he(),n=me(),i={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>(0,t.str)`must have required property '${s}'`,params:({params:{missingProperty:s}})=>(0,t._)`{missingProperty: ${s}}`},code(s){const{gen:a,schema:o,schemaCode:l,data:u,$data:c,it:f}=s,{opts:h}=f;if(!c&&o.length===0)return;const d=o.length>=h.loopRequired;if(f.allErrors?g():T(),h.strictRequired){const p=s.parentSchema.properties,{definedProperties:b}=s.it;for(const S of o)if(p?.[S]===void 0&&!b.has(S)){const v=f.schemaEnv.baseId+f.errSchemaPath,w=`required property "${S}" is not defined at "${v}" (strictRequired)`;(0,n.checkStrictMode)(f,w,f.opts.strictRequired)}}function g(){if(d||c)s.block$data(t.nil,y);else for(const p of o)(0,e.checkReportMissingProp)(s,p)}function T(){const p=a.let("missing");if(d||c){const b=a.let("valid",!0);s.block$data(b,()=>m(p,b)),s.ok(b)}else a.if((0,e.checkMissingProp)(s,o,p)),(0,e.reportMissingProp)(s,p),a.else()}function y(){a.forOf("prop",l,p=>{s.setParams({missingProperty:p}),a.if((0,e.noPropertyInData)(a,u,p,h.ownProperties),()=>s.error())})}function m(p,b){s.setParams({missingProperty:p}),a.forOf(p,l,()=>{a.assign(b,(0,e.propertyInData)(a,u,p,h.ownProperties)),a.if((0,t.not)(b),()=>{s.error(),a.break()})},t.nil)}}};return Ur.default=i,Ur}var qr={},$u;function gb(){if($u)return qr;$u=1,Object.defineProperty(qr,"__esModule",{value:!0});const e=he(),n={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:i}){const s=r==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${i} items`},params:({schemaCode:r})=>(0,e._)`{limit: ${r}}`},code(r){const{keyword:i,data:s,schemaCode:a}=r,o=i==="maxItems"?e.operators.GT:e.operators.LT;r.fail$data((0,e._)`${s}.length ${o} ${a}`)}};return qr.default=n,qr}var Hr={},Br={},Cu;function ra(){if(Cu)return Br;Cu=1,Object.defineProperty(Br,"__esModule",{value:!0});const e=ou();return e.code='require("ajv/dist/runtime/equal").default',Br.default=e,Br}var Ou;function yb(){if(Ou)return Hr;Ou=1,Object.defineProperty(Hr,"__esModule",{value:!0});const e=Er(),t=he(),n=me(),r=ra(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:a,j:o}})=>(0,t.str)`must NOT have duplicate items (items ## ${o} and ${a} are identical)`,params:({params:{i:a,j:o}})=>(0,t._)`{i: ${a}, j: ${o}}`},code(a){const{gen:o,data:l,$data:u,schema:c,parentSchema:f,schemaCode:h,it:d}=a;if(!u&&!c)return;const g=o.let("valid"),T=f.items?(0,e.getSchemaTypes)(f.items):[];a.block$data(g,y,(0,t._)`${h} === false`),a.ok(g);function y(){const S=o.let("i",(0,t._)`${l}.length`),v=o.let("j");a.setParams({i:S,j:v}),o.assign(g,!0),o.if((0,t._)`${S} > 1`,()=>(m()?p:b)(S,v))}function m(){return T.length>0&&!T.some(S=>S==="object"||S==="array")}function p(S,v){const w=o.name("item"),x=(0,e.checkDataTypes)(T,w,d.opts.strictNumbers,e.DataType.Wrong),N=o.const("indices",(0,t._)`{}`);o.for((0,t._)`;${S}--;`,()=>{o.let(w,(0,t._)`${l}[${S}]`),o.if(x,(0,t._)`continue`),T.length>1&&o.if((0,t._)`typeof ${w} == "string"`,(0,t._)`${w} += "_"`),o.if((0,t._)`typeof ${N}[${w}] == "number"`,()=>{o.assign(v,(0,t._)`${N}[${w}]`),a.error(),o.assign(g,!1).break()}).code((0,t._)`${N}[${w}] = ${S}`)})}function b(S,v){const w=(0,n.useFunc)(o,r.default),x=o.name("outer");o.label(x).for((0,t._)`;${S}--;`,()=>o.for((0,t._)`${v} = ${S}; ${v}--;`,()=>o.if((0,t._)`${w}(${l}[${S}], ${l}[${v}])`,()=>{a.error(),o.assign(g,!1).break(x)})))}}};return Hr.default=s,Hr}var Vr={},Ru;function bb(){if(Ru)return Vr;Ru=1,Object.defineProperty(Vr,"__esModule",{value:!0});const e=he(),t=me(),n=ra(),i={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0,e._)`{allowedValue: ${s}}`},code(s){const{gen:a,data:o,$data:l,schemaCode:u,schema:c}=s;l||c&&typeof c=="object"?s.fail$data((0,e._)`!${(0,t.useFunc)(a,n.default)}(${o}, ${u})`):s.fail((0,e._)`${c} !== ${o}`)}};return Vr.default=i,Vr}var Wr={},Nu;function wb(){if(Nu)return Wr;Nu=1,Object.defineProperty(Wr,"__esModule",{value:!0});const e=he(),t=me(),n=ra(),i={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>(0,e._)`{allowedValues: ${s}}`},code(s){const{gen:a,data:o,$data:l,schema:u,schemaCode:c,it:f}=s;if(!l&&u.length===0)throw new Error("enum must have non-empty array");const h=u.length>=f.opts.loopEnum;let d;const g=()=>d??(d=(0,t.useFunc)(a,n.default));let T;if(h||l)T=a.let("valid"),s.block$data(T,y);else{if(!Array.isArray(u))throw new Error("ajv implementation error");const p=a.const("vSchema",c);T=(0,e.or)(...u.map((b,S)=>m(p,S)))}s.pass(T);function y(){a.assign(T,!1),a.forOf("v",c,p=>a.if((0,e._)`${g()}(${o}, ${p})`,()=>a.assign(T,!0).break()))}function m(p,b){const S=u[b];return typeof S=="object"&&S!==null?(0,e._)`${g()}(${o}, ${p}[${b}])`:(0,e._)`${o} === ${S}`}}};return Wr.default=i,Wr}var Mu;function _b(){if(Mu)return Nr;Mu=1,Object.defineProperty(Nr,"__esModule",{value:!0});const e=ub(),t=cb(),n=db(),r=hb(),i=pb(),s=mb(),a=gb(),o=yb(),l=bb(),u=wb(),c=[e.default,t.default,n.default,r.default,i.default,s.default,a.default,o.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},l.default,u.default];return Nr.default=c,Nr}var Yr={},gn={},Iu;function Lu(){if(Iu)return gn;Iu=1,Object.defineProperty(gn,"__esModule",{value:!0}),gn.validateAdditionalItems=void 0;const e=he(),t=me(),r={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>(0,e.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,e._)`{limit: ${s}}`},code(s){const{parentSchema:a,it:o}=s,{items:l}=a;if(!Array.isArray(l)){(0,t.checkStrictMode)(o,'"additionalItems" is ignored when "items" is not an array of schemas');return}i(s,l)}};function i(s,a){const{gen:o,schema:l,data:u,keyword:c,it:f}=s;f.items=!0;const h=o.const("len",(0,e._)`${u}.length`);if(l===!1)s.setParams({len:a.length}),s.pass((0,e._)`${h} <= ${a.length}`);else if(typeof l=="object"&&!(0,t.alwaysValidSchema)(f,l)){const g=o.var("valid",(0,e._)`${h} <= ${a.length}`);o.if((0,e.not)(g),()=>d(g)),s.ok(g)}function d(g){o.forRange("i",a.length,h,T=>{s.subschema({keyword:c,dataProp:T,dataPropType:t.Type.Num},g),f.allErrors||o.if((0,e.not)(g),()=>o.break())})}}return gn.validateAdditionalItems=i,gn.default=r,gn}var Gr={},yn={},Fu;function ju(){if(Fu)return yn;Fu=1,Object.defineProperty(yn,"__esModule",{value:!0}),yn.validateTuple=void 0;const e=he(),t=me(),n=bt(),r={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(s){const{schema:a,it:o}=s;if(Array.isArray(a))return i(s,"additionalItems",a);o.items=!0,!(0,t.alwaysValidSchema)(o,a)&&s.ok((0,n.validateArray)(s))}};function i(s,a,o=s.schema){const{gen:l,parentSchema:u,data:c,keyword:f,it:h}=s;T(u),h.opts.unevaluated&&o.length&&h.items!==!0&&(h.items=t.mergeEvaluated.items(l,o.length,h.items));const d=l.name("valid"),g=l.const("len",(0,e._)`${c}.length`);o.forEach((y,m)=>{(0,t.alwaysValidSchema)(h,y)||(l.if((0,e._)`${g} > ${m}`,()=>s.subschema({keyword:f,schemaProp:m,dataProp:m},d)),s.ok(d))});function T(y){const{opts:m,errSchemaPath:p}=h,b=o.length,S=b===y.minItems&&(b===y.maxItems||y[a]===!1);if(m.strictTuples&&!S){const v=`"${f}" is ${b}-tuple, but minItems or maxItems/${a} are not specified or different at path "${p}"`;(0,t.checkStrictMode)(h,v,m.strictTuples)}}}return yn.validateTuple=i,yn.default=r,yn}var zu;function vb(){if(zu)return Gr;zu=1,Object.defineProperty(Gr,"__esModule",{value:!0});const e=ju(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:n=>(0,e.validateTuple)(n,"items")};return Gr.default=t,Gr}var Kr={},Uu;function Tb(){if(Uu)return Kr;Uu=1,Object.defineProperty(Kr,"__esModule",{value:!0});const e=he(),t=me(),n=bt(),r=Lu(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:a}})=>(0,e.str)`must NOT have more than ${a} items`,params:({params:{len:a}})=>(0,e._)`{limit: ${a}}`},code(a){const{schema:o,parentSchema:l,it:u}=a,{prefixItems:c}=l;u.items=!0,!(0,t.alwaysValidSchema)(u,o)&&(c?(0,r.validateAdditionalItems)(a,c):a.ok((0,n.validateArray)(a)))}};return Kr.default=s,Kr}var Zr={},qu;function kb(){if(qu)return Zr;qu=1,Object.defineProperty(Zr,"__esModule",{value:!0});const e=he(),t=me(),r={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:i,max:s}})=>s===void 0?(0,e.str)`must contain at least ${i} valid item(s)`:(0,e.str)`must contain at least ${i} and no more than ${s} valid item(s)`,params:({params:{min:i,max:s}})=>s===void 0?(0,e._)`{minContains: ${i}}`:(0,e._)`{minContains: ${i}, maxContains: ${s}}`},code(i){const{gen:s,schema:a,parentSchema:o,data:l,it:u}=i;let c,f;const{minContains:h,maxContains:d}=o;u.opts.next?(c=h===void 0?1:h,f=d):c=1;const g=s.const("len",(0,e._)`${l}.length`);if(i.setParams({min:c,max:f}),f===void 0&&c===0){(0,t.checkStrictMode)(u,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(f!==void 0&&c>f){(0,t.checkStrictMode)(u,'"minContains" > "maxContains" is always invalid'),i.fail();return}if((0,t.alwaysValidSchema)(u,a)){let b=(0,e._)`${g} >= ${c}`;f!==void 0&&(b=(0,e._)`${b} && ${g} <= ${f}`),i.pass(b);return}u.items=!0;const T=s.name("valid");f===void 0&&c===1?m(T,()=>s.if(T,()=>s.break())):c===0?(s.let(T,!0),f!==void 0&&s.if((0,e._)`${l}.length > 0`,y)):(s.let(T,!1),y()),i.result(T,()=>i.reset());function y(){const b=s.name("_valid"),S=s.let("count",0);m(b,()=>s.if(b,()=>p(S)))}function m(b,S){s.forRange("i",0,g,v=>{i.subschema({keyword:"contains",dataProp:v,dataPropType:t.Type.Num,compositeRule:!0},b),S()})}function p(b){s.code((0,e._)`${b}++`),f===void 0?s.if((0,e._)`${b} >= ${c}`,()=>s.assign(T,!0).break()):(s.if((0,e._)`${b} > ${f}`,()=>s.assign(T,!1).break()),c===1?s.assign(T,!0):s.if((0,e._)`${b} >= ${c}`,()=>s.assign(T,!0)))}}};return Zr.default=r,Zr}var ia={},Hu;function Eb(){return Hu||(Hu=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=he(),n=me(),r=bt();e.error={message:({params:{property:l,depsCount:u,deps:c}})=>{const f=u===1?"property":"properties";return(0,t.str)`must have ${f} ${c} when property ${l} is present`},params:({params:{property:l,depsCount:u,deps:c,missingProperty:f}})=>(0,t._)`{property: ${l},
|
|
58
58
|
missingProperty: ${f},
|
|
59
59
|
depsCount: ${u},
|
|
60
|
-
deps: ${c}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(l){const[u,c]=s(l);a(l,u),o(l,c)}};function s({schema:l}){const u={},c={};for(const f in l){if(f==="__proto__")continue;const h=Array.isArray(l[f])?u:c;h[f]=l[f]}return[u,c]}function a(l,u=l.schema){const{gen:c,data:f,it:h}=l;if(Object.keys(u).length===0)return;const d=c.let("missing");for(const g in u){const T=u[g];if(T.length===0)continue;const y=(0,r.propertyInData)(c,f,g,h.opts.ownProperties);l.setParams({property:g,depsCount:T.length,deps:T.join(", ")}),h.allErrors?c.if(y,()=>{for(const m of T)(0,r.checkReportMissingProp)(l,m)}):(c.if((0,t._)`${y} && (${(0,r.checkMissingProp)(l,T,d)})`),(0,r.reportMissingProp)(l,d),c.else())}}e.validatePropertyDeps=a;function o(l,u=l.schema){const{gen:c,data:f,keyword:h,it:d}=l,g=c.name("valid");for(const T in u)(0,n.alwaysValidSchema)(d,u[T])||(c.if((0,r.propertyInData)(c,f,T,d.opts.ownProperties),()=>{const y=l.subschema({keyword:h,schemaProp:T},g);l.mergeValidEvaluated(y,g)},()=>c.var(g,!0)),l.ok(g))}e.validateSchemaDeps=o,e.default=i})(ia)),ia}var Jr={},Hu;function Eb(){if(Hu)return Jr;Hu=1,Object.defineProperty(Jr,"__esModule",{value:!0});const e=he(),t=me(),r={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:i})=>(0,e._)`{propertyName: ${i.propertyName}}`},code(i){const{gen:s,schema:a,data:o,it:l}=i;if((0,t.alwaysValidSchema)(l,a))return;const u=s.name("valid");s.forIn("key",o,c=>{i.setParams({propertyName:c}),i.subschema({keyword:"propertyNames",data:c,dataTypes:["string"],propertyName:c,compositeRule:!0},u),s.if((0,e.not)(u),()=>{i.error(!0),l.allErrors||s.break()})}),i.ok(u)}};return Jr.default=r,Jr}var Xr={},Bu;function Vu(){if(Bu)return Xr;Bu=1,Object.defineProperty(Xr,"__esModule",{value:!0});const e=yt(),t=he(),n=qt(),r=me(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:a})=>(0,t._)`{additionalProperty: ${a.additionalProperty}}`},code(a){const{gen:o,schema:l,parentSchema:u,data:c,errsCount:f,it:h}=a;if(!f)throw new Error("ajv implementation error");const{allErrors:d,opts:g}=h;if(h.props=!0,g.removeAdditional!=="all"&&(0,r.alwaysValidSchema)(h,l))return;const T=(0,e.allSchemaProperties)(u.properties),y=(0,e.allSchemaProperties)(u.patternProperties);m(),a.ok((0,t._)`${f} === ${n.default.errors}`);function m(){o.forIn("key",c,w=>{!T.length&&!y.length?S(w):o.if(p(w),()=>S(w))})}function p(w){let x;if(T.length>8){const N=(0,r.schemaRefOrVal)(h,u.properties,"properties");x=(0,e.isOwnProperty)(o,N,w)}else T.length?x=(0,t.or)(...T.map(N=>(0,t._)`${w} === ${N}`)):x=t.nil;return y.length&&(x=(0,t.or)(x,...y.map(N=>(0,t._)`${(0,e.usePattern)(a,N)}.test(${w})`))),(0,t.not)(x)}function b(w){o.code((0,t._)`delete ${c}[${w}]`)}function S(w){if(g.removeAdditional==="all"||g.removeAdditional&&l===!1){b(w);return}if(l===!1){a.setParams({additionalProperty:w}),a.error(),d||o.break();return}if(typeof l=="object"&&!(0,r.alwaysValidSchema)(h,l)){const x=o.name("valid");g.removeAdditional==="failing"?(v(w,x,!1),o.if((0,t.not)(x),()=>{a.reset(),b(w)})):(v(w,x),d||o.if((0,t.not)(x),()=>o.break()))}}function v(w,x,N){const F={keyword:"additionalProperties",dataProp:w,dataPropType:r.Type.Str};N===!1&&Object.assign(F,{compositeRule:!0,createErrors:!1,allErrors:!1}),a.subschema(F,x)}}};return Xr.default=s,Xr}var Qr={},Wu;function Sb(){if(Wu)return Qr;Wu=1,Object.defineProperty(Qr,"__esModule",{value:!0});const e=xr(),t=yt(),n=me(),r=Vu(),i={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:a,schema:o,parentSchema:l,data:u,it:c}=s;c.opts.removeAdditional==="all"&&l.additionalProperties===void 0&&r.default.code(new e.KeywordCxt(c,r.default,"additionalProperties"));const f=(0,t.allSchemaProperties)(o);for(const y of f)c.definedProperties.add(y);c.opts.unevaluated&&f.length&&c.props!==!0&&(c.props=n.mergeEvaluated.props(a,(0,n.toHash)(f),c.props));const h=f.filter(y=>!(0,n.alwaysValidSchema)(c,o[y]));if(h.length===0)return;const d=a.name("valid");for(const y of h)g(y)?T(y):(a.if((0,t.propertyInData)(a,u,y,c.opts.ownProperties)),T(y),c.allErrors||a.else().var(d,!0),a.endIf()),s.it.definedProperties.add(y),s.ok(d);function g(y){return c.opts.useDefaults&&!c.compositeRule&&o[y].default!==void 0}function T(y){s.subschema({keyword:"properties",schemaProp:y,dataProp:y},d)}}};return Qr.default=i,Qr}var ei={},Yu;function xb(){if(Yu)return ei;Yu=1,Object.defineProperty(ei,"__esModule",{value:!0});const e=yt(),t=he(),n=me(),r=me(),i={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:a,schema:o,data:l,parentSchema:u,it:c}=s,{opts:f}=c,h=(0,e.allSchemaProperties)(o),d=h.filter(S=>(0,n.alwaysValidSchema)(c,o[S]));if(h.length===0||d.length===h.length&&(!c.opts.unevaluated||c.props===!0))return;const g=f.strictSchema&&!f.allowMatchingProperties&&u.properties,T=a.name("valid");c.props!==!0&&!(c.props instanceof t.Name)&&(c.props=(0,r.evaluatedPropsToName)(a,c.props));const{props:y}=c;m();function m(){for(const S of h)g&&p(S),c.allErrors?b(S):(a.var(T,!0),b(S),a.if(T))}function p(S){for(const v in g)new RegExp(S).test(v)&&(0,n.checkStrictMode)(c,`property ${v} matches pattern ${S} (use allowMatchingProperties)`)}function b(S){a.forIn("key",l,v=>{a.if((0,t._)`${(0,e.usePattern)(s,S)}.test(${v})`,()=>{const w=d.includes(S);w||s.subschema({keyword:"patternProperties",schemaProp:S,dataProp:v,dataPropType:r.Type.Str},T),c.opts.unevaluated&&y!==!0?a.assign((0,t._)`${y}[${v}]`,!0):!w&&!c.allErrors&&a.if((0,t.not)(T),()=>a.break())})})}}};return ei.default=i,ei}var ti={},Gu;function Pb(){if(Gu)return ti;Gu=1,Object.defineProperty(ti,"__esModule",{value:!0});const e=me(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){const{gen:r,schema:i,it:s}=n;if((0,e.alwaysValidSchema)(s,i)){n.fail();return}const a=r.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},a),n.failResult(a,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};return ti.default=t,ti}var ni={},Ku;function Ab(){if(Ku)return ni;Ku=1,Object.defineProperty(ni,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:yt().validateUnion,error:{message:"must match a schema in anyOf"}};return ni.default=t,ni}var ri={},Zu;function Db(){if(Zu)return ri;Zu=1,Object.defineProperty(ri,"__esModule",{value:!0});const e=he(),t=me(),r={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:i})=>(0,e._)`{passingSchemas: ${i.passing}}`},code(i){const{gen:s,schema:a,parentSchema:o,it:l}=i;if(!Array.isArray(a))throw new Error("ajv implementation error");if(l.opts.discriminator&&o.discriminator)return;const u=a,c=s.let("valid",!1),f=s.let("passing",null),h=s.name("_valid");i.setParams({passing:f}),s.block(d),i.result(c,()=>i.reset(),()=>i.error(!0));function d(){u.forEach((g,T)=>{let y;(0,t.alwaysValidSchema)(l,g)?s.var(h,!0):y=i.subschema({keyword:"oneOf",schemaProp:T,compositeRule:!0},h),T>0&&s.if((0,e._)`${h} && ${c}`).assign(c,!1).assign(f,(0,e._)`[${f}, ${T}]`).else(),s.if(h,()=>{s.assign(c,!0),s.assign(f,T),y&&i.mergeEvaluated(y,e.Name)})})}}};return ri.default=r,ri}var ii={},Ju;function $b(){if(Ju)return ii;Ju=1,Object.defineProperty(ii,"__esModule",{value:!0});const e=me(),t={keyword:"allOf",schemaType:"array",code(n){const{gen:r,schema:i,it:s}=n;if(!Array.isArray(i))throw new Error("ajv implementation error");const a=r.name("valid");i.forEach((o,l)=>{if((0,e.alwaysValidSchema)(s,o))return;const u=n.subschema({keyword:"allOf",schemaProp:l},a);n.ok(a),n.mergeEvaluated(u)})}};return ii.default=t,ii}var si={},Xu;function Cb(){if(Xu)return si;Xu=1,Object.defineProperty(si,"__esModule",{value:!0});const e=he(),t=me(),r={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,e.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,e._)`{failingKeyword: ${s.ifClause}}`},code(s){const{gen:a,parentSchema:o,it:l}=s;o.then===void 0&&o.else===void 0&&(0,t.checkStrictMode)(l,'"if" without "then" and "else" is ignored');const u=i(l,"then"),c=i(l,"else");if(!u&&!c)return;const f=a.let("valid",!0),h=a.name("_valid");if(d(),s.reset(),u&&c){const T=a.let("ifClause");s.setParams({ifClause:T}),a.if(h,g("then",T),g("else",T))}else u?a.if(h,g("then")):a.if((0,e.not)(h),g("else"));s.pass(f,()=>s.error(!0));function d(){const T=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},h);s.mergeEvaluated(T)}function g(T,y){return()=>{const m=s.subschema({keyword:T},h);a.assign(f,h),s.mergeValidEvaluated(m,f),y?a.assign(y,(0,e._)`${T}`):s.setParams({ifClause:T})}}}};function i(s,a){const o=s.schema[a];return o!==void 0&&!(0,t.alwaysValidSchema)(s,o)}return si.default=r,si}var ai={},Qu;function Ob(){if(Qu)return ai;Qu=1,Object.defineProperty(ai,"__esModule",{value:!0});const e=me(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:r,it:i}){r.if===void 0&&(0,e.checkStrictMode)(i,`"${n}" without "if" is ignored`)}};return ai.default=t,ai}var ec;function Rb(){if(ec)return Yr;ec=1,Object.defineProperty(Yr,"__esModule",{value:!0});const e=Iu(),t=_b(),n=Fu(),r=vb(),i=Tb(),s=kb(),a=Eb(),o=Vu(),l=Sb(),u=xb(),c=Pb(),f=Ab(),h=Db(),d=$b(),g=Cb(),T=Ob();function y(m=!1){const p=[c.default,f.default,h.default,d.default,g.default,T.default,a.default,o.default,s.default,l.default,u.default];return m?p.push(t.default,r.default):p.push(e.default,n.default),p.push(i.default),p}return Yr.default=y,Yr}var oi={},li={},tc;function Nb(){if(tc)return li;tc=1,Object.defineProperty(li,"__esModule",{value:!0});const e=he(),n={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,e._)`{format: ${r}}`},code(r,i){const{gen:s,data:a,$data:o,schema:l,schemaCode:u,it:c}=r,{opts:f,errSchemaPath:h,schemaEnv:d,self:g}=c;if(!f.validateFormats)return;o?T():y();function T(){const m=s.scopeValue("formats",{ref:g.formats,code:f.code.formats}),p=s.const("fDef",(0,e._)`${m}[${u}]`),b=s.let("fType"),S=s.let("format");s.if((0,e._)`typeof ${p} == "object" && !(${p} instanceof RegExp)`,()=>s.assign(b,(0,e._)`${p}.type || "string"`).assign(S,(0,e._)`${p}.validate`),()=>s.assign(b,(0,e._)`"string"`).assign(S,p)),r.fail$data((0,e.or)(v(),w()));function v(){return f.strictSchema===!1?e.nil:(0,e._)`${u} && !${S}`}function w(){const x=d.$async?(0,e._)`(${p}.async ? await ${S}(${a}) : ${S}(${a}))`:(0,e._)`${S}(${a})`,N=(0,e._)`(typeof ${S} == "function" ? ${x} : ${S}.test(${a}))`;return(0,e._)`${S} && ${S} !== true && ${b} === ${i} && !${N}`}}function y(){const m=g.formats[l];if(!m){v();return}if(m===!0)return;const[p,b,S]=w(m);p===i&&r.pass(x());function v(){if(f.strictSchema===!1){g.logger.warn(N());return}throw new Error(N());function N(){return`unknown format "${l}" ignored in schema at path "${h}"`}}function w(N){const F=N instanceof RegExp?(0,e.regexpCode)(N):f.code.formats?(0,e._)`${f.code.formats}${(0,e.getProperty)(l)}`:void 0,A=s.scopeValue("formats",{key:l,ref:N,code:F});return typeof N=="object"&&!(N instanceof RegExp)?[N.type||"string",N.validate,(0,e._)`${A}.validate`]:["string",N,A]}function x(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!d.$async)throw new Error("async format in sync schema");return(0,e._)`await ${S}(${a})`}return typeof b=="function"?(0,e._)`${S}(${a})`:(0,e._)`${S}.test(${a})`}}}};return li.default=n,li}var nc;function Mb(){if(nc)return oi;nc=1,Object.defineProperty(oi,"__esModule",{value:!0});const t=[Nb().default];return oi.default=t,oi}var Xt={},rc;function Ib(){return rc||(rc=1,Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.contentVocabulary=Xt.metadataVocabulary=void 0,Xt.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Xt.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Xt}var ic;function Lb(){if(ic)return Cr;ic=1,Object.defineProperty(Cr,"__esModule",{value:!0});const e=ob(),t=wb(),n=Rb(),r=Mb(),i=Ib(),s=[e.default,t.default,(0,n.default)(),r.default,i.metadataVocabulary,i.contentVocabulary];return Cr.default=s,Cr}var ui={},Hn={},sc;function Fb(){if(sc)return Hn;sc=1,Object.defineProperty(Hn,"__esModule",{value:!0}),Hn.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(Hn.DiscrError=e={})),Hn}var ac;function jb(){if(ac)return ui;ac=1,Object.defineProperty(ui,"__esModule",{value:!0});const e=he(),t=Fb(),n=ea(),r=Dr(),i=me(),a={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:o,tagName:l}})=>o===t.DiscrError.Tag?`tag "${l}" must be string`:`value of tag "${l}" must be in oneOf`,params:({params:{discrError:o,tag:l,tagName:u}})=>(0,e._)`{error: ${o}, tag: ${u}, tagValue: ${l}}`},code(o){const{gen:l,data:u,schema:c,parentSchema:f,it:h}=o,{oneOf:d}=f;if(!h.opts.discriminator)throw new Error("discriminator: requires discriminator option");const g=c.propertyName;if(typeof g!="string")throw new Error("discriminator: requires propertyName");if(c.mapping)throw new Error("discriminator: mapping is not supported");if(!d)throw new Error("discriminator: requires oneOf keyword");const T=l.let("valid",!1),y=l.const("tag",(0,e._)`${u}${(0,e.getProperty)(g)}`);l.if((0,e._)`typeof ${y} == "string"`,()=>m(),()=>o.error(!1,{discrError:t.DiscrError.Tag,tag:y,tagName:g})),o.ok(T);function m(){const S=b();l.if(!1);for(const v in S)l.elseIf((0,e._)`${y} === ${v}`),l.assign(T,p(S[v]));l.else(),o.error(!1,{discrError:t.DiscrError.Mapping,tag:y,tagName:g}),l.endIf()}function p(S){const v=l.name("valid"),w=o.subschema({keyword:"oneOf",schemaProp:S},v);return o.mergeEvaluated(w,e.Name),v}function b(){var S;const v={},w=N(f);let x=!0;for(let O=0;O<d.length;O++){let U=d[O];if(U?.$ref&&!(0,i.schemaHasRulesButRef)(U,h.self.RULES)){const H=U.$ref;if(U=n.resolveRef.call(h.self,h.schemaEnv.root,h.baseId,H),U instanceof n.SchemaEnv&&(U=U.schema),U===void 0)throw new r.default(h.opts.uriResolver,h.baseId,H)}const K=(S=U?.properties)===null||S===void 0?void 0:S[g];if(typeof K!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${g}"`);x=x&&(w||N(U)),F(K,O)}if(!x)throw new Error(`discriminator: "${g}" must be required`);return v;function N({required:O}){return Array.isArray(O)&&O.includes(g)}function F(O,U){if(O.const)A(O.const,U);else if(O.enum)for(const K of O.enum)A(K,U);else throw new Error(`discriminator: "properties/${g}" must have "const" or "enum"`)}function A(O,U){if(typeof O!="string"||O in v)throw new Error(`discriminator: "${g}" values must be unique strings`);v[O]=U}}}};return ui.default=a,ui}const zb={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!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:"#"}},default:!0};var oc;function Ub(){return oc||(oc=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=ib(),r=Lb(),i=jb(),s=zb,a=["/properties"],o="http://json-schema.org/draft-07/schema";class l extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(g=>this.addVocabulary(g)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const g=this.opts.$data?this.$dataMetaSchema(s,a):s;this.addMetaSchema(g,o,!1),this.refs["http://json-schema.org/schema"]=o}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(o)?o:void 0)}}t.Ajv=l,e.exports=t=l,e.exports.Ajv=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var u=xr();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var c=he();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return c._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return c.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return c.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return c.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return c.CodeGen}});var f=Qs();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return f.default}});var h=Dr();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return h.default}})})(_r,_r.exports)),_r.exports}var qb=Ub();const Hb=Xn(qb);var lc=typeof global=="object"&&global&&global.Object===Object&&global,Bb=typeof self=="object"&&self&&self.Object===Object&&self,gn=lc||Bb||Function("return this")(),ci=gn.Symbol,uc=Object.prototype,Vb=uc.hasOwnProperty,Wb=uc.toString,Bn=ci?ci.toStringTag:void 0;function Yb(e){var t=Vb.call(e,Bn),n=e[Bn];try{e[Bn]=void 0;var r=!0}catch{}var i=Wb.call(e);return r&&(t?e[Bn]=n:delete e[Bn]),i}var Gb=Object.prototype,Kb=Gb.toString;function Zb(e){return Kb.call(e)}var Jb="[object Null]",Xb="[object Undefined]",cc=ci?ci.toStringTag:void 0;function fi(e){return e==null?e===void 0?Xb:Jb:cc&&cc in Object(e)?Yb(e):Zb(e)}function Vn(e){return e!=null&&typeof e=="object"}var sa=Array.isArray;function Qt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function fc(e){return e}var Qb="[object AsyncFunction]",e1="[object Function]",t1="[object GeneratorFunction]",n1="[object Proxy]";function aa(e){if(!Qt(e))return!1;var t=fi(e);return t==e1||t==t1||t==Qb||t==n1}var oa=gn["__core-js_shared__"],dc=(function(){var e=/[^.]+$/.exec(oa&&oa.keys&&oa.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function r1(e){return!!dc&&dc in e}var i1=Function.prototype,s1=i1.toString;function a1(e){if(e!=null){try{return s1.call(e)}catch{}try{return e+""}catch{}}return""}var o1=/[\\^$.*+?()[\]{}|]/g,l1=/^\[object .+?Constructor\]$/,u1=Function.prototype,c1=Object.prototype,f1=u1.toString,d1=c1.hasOwnProperty,h1=RegExp("^"+f1.call(d1).replace(o1,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p1(e){if(!Qt(e)||r1(e))return!1;var t=aa(e)?h1:l1;return t.test(a1(e))}function m1(e,t){return e?.[t]}function la(e,t){var n=m1(e,t);return p1(n)?n:void 0}var hc=Object.create,g1=(function(){function e(){}return function(t){if(!Qt(t))return{};if(hc)return hc(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})();function y1(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function b1(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var w1=800,_1=16,v1=Date.now;function T1(e){var t=0,n=0;return function(){var r=v1(),i=_1-(r-n);if(n=r,i>0){if(++t>=w1)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function k1(e){return function(){return e}}var di=(function(){try{var e=la(Object,"defineProperty");return e({},"",{}),e}catch{}})(),E1=di?function(e,t){return di(e,"toString",{configurable:!0,enumerable:!1,value:k1(t),writable:!0})}:fc,S1=T1(E1),x1=9007199254740991,P1=/^(?:0|[1-9]\d*)$/;function pc(e,t){var n=typeof e;return t=t??x1,!!t&&(n=="number"||n!="symbol"&&P1.test(e))&&e>-1&&e%1==0&&e<t}function ua(e,t,n){t=="__proto__"&&di?di(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function hi(e,t){return e===t||e!==e&&t!==t}var A1=Object.prototype,D1=A1.hasOwnProperty;function $1(e,t,n){var r=e[t];(!(D1.call(e,t)&&hi(r,n))||n===void 0&&!(t in e))&&ua(e,t,n)}function C1(e,t,n,r){var i=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var o=t[s],l=void 0;l===void 0&&(l=e[o]),i?ua(n,o,l):$1(n,o,l)}return n}var mc=Math.max;function O1(e,t,n){return t=mc(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=mc(r.length-t,0),a=Array(s);++i<s;)a[i]=r[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=r[i];return o[t]=n(a),y1(e,this,o)}}function R1(e,t){return S1(O1(e,t,fc),e+"")}var N1=9007199254740991;function gc(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=N1}function ca(e){return e!=null&&gc(e.length)&&!aa(e)}function M1(e,t,n){if(!Qt(n))return!1;var r=typeof t;return(r=="number"?ca(n)&&pc(t,n.length):r=="string"&&t in n)?hi(n[t],e):!1}function I1(e){return R1(function(t,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(s=e.length>3&&typeof s=="function"?(i--,s):void 0,a&&M1(n[0],n[1],a)&&(s=i<3?void 0:s,i=1),t=Object(t);++r<i;){var o=n[r];o&&e(t,o,r,s)}return t})}var L1=Object.prototype;function yc(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||L1;return e===n}function F1(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var j1="[object Arguments]";function bc(e){return Vn(e)&&fi(e)==j1}var wc=Object.prototype,z1=wc.hasOwnProperty,U1=wc.propertyIsEnumerable,fa=bc((function(){return arguments})())?bc:function(e){return Vn(e)&&z1.call(e,"callee")&&!U1.call(e,"callee")};function q1(){return!1}var _c=typeof $e=="object"&&$e&&!$e.nodeType&&$e,vc=_c&&typeof module=="object"&&module&&!module.nodeType&&module,H1=vc&&vc.exports===_c,Tc=H1?gn.Buffer:void 0,B1=Tc?Tc.isBuffer:void 0,kc=B1||q1,V1="[object Arguments]",W1="[object Array]",Y1="[object Boolean]",G1="[object Date]",K1="[object Error]",Z1="[object Function]",J1="[object Map]",X1="[object Number]",Q1="[object Object]",ew="[object RegExp]",tw="[object Set]",nw="[object String]",rw="[object WeakMap]",iw="[object ArrayBuffer]",sw="[object DataView]",aw="[object Float32Array]",ow="[object Float64Array]",lw="[object Int8Array]",uw="[object Int16Array]",cw="[object Int32Array]",fw="[object Uint8Array]",dw="[object Uint8ClampedArray]",hw="[object Uint16Array]",pw="[object Uint32Array]",ve={};ve[aw]=ve[ow]=ve[lw]=ve[uw]=ve[cw]=ve[fw]=ve[dw]=ve[hw]=ve[pw]=!0,ve[V1]=ve[W1]=ve[iw]=ve[Y1]=ve[sw]=ve[G1]=ve[K1]=ve[Z1]=ve[J1]=ve[X1]=ve[Q1]=ve[ew]=ve[tw]=ve[nw]=ve[rw]=!1;function mw(e){return Vn(e)&&gc(e.length)&&!!ve[fi(e)]}function gw(e){return function(t){return e(t)}}var Ec=typeof $e=="object"&&$e&&!$e.nodeType&&$e,Wn=Ec&&typeof module=="object"&&module&&!module.nodeType&&module,yw=Wn&&Wn.exports===Ec,da=yw&&lc.process,Sc=(function(){try{var e=Wn&&Wn.require&&Wn.require("util").types;return e||da&&da.binding&&da.binding("util")}catch{}})(),xc=Sc&&Sc.isTypedArray,Pc=xc?gw(xc):mw;function bw(e,t){var n=sa(e),r=!n&&fa(e),i=!n&&!r&&kc(e),s=!n&&!r&&!i&&Pc(e),a=n||r||i||s,o=a?F1(e.length,String):[],l=o.length;for(var u in e)a&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||pc(u,l))||o.push(u);return o}function ww(e,t){return function(n){return e(t(n))}}function _w(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var vw=Object.prototype,Tw=vw.hasOwnProperty;function kw(e){if(!Qt(e))return _w(e);var t=yc(e),n=[];for(var r in e)r=="constructor"&&(t||!Tw.call(e,r))||n.push(r);return n}function Ac(e){return ca(e)?bw(e):kw(e)}var Yn=la(Object,"create");function Ew(){this.__data__=Yn?Yn(null):{},this.size=0}function Sw(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var xw="__lodash_hash_undefined__",Pw=Object.prototype,Aw=Pw.hasOwnProperty;function Dw(e){var t=this.__data__;if(Yn){var n=t[e];return n===xw?void 0:n}return Aw.call(t,e)?t[e]:void 0}var $w=Object.prototype,Cw=$w.hasOwnProperty;function Ow(e){var t=this.__data__;return Yn?t[e]!==void 0:Cw.call(t,e)}var Rw="__lodash_hash_undefined__";function Nw(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Yn&&t===void 0?Rw:t,this}function en(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}en.prototype.clear=Ew,en.prototype.delete=Sw,en.prototype.get=Dw,en.prototype.has=Ow,en.prototype.set=Nw;function Mw(){this.__data__=[],this.size=0}function pi(e,t){for(var n=e.length;n--;)if(hi(e[n][0],t))return n;return-1}var Iw=Array.prototype,Lw=Iw.splice;function Fw(e){var t=this.__data__,n=pi(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Lw.call(t,n,1),--this.size,!0}function jw(e){var t=this.__data__,n=pi(t,e);return n<0?void 0:t[n][1]}function zw(e){return pi(this.__data__,e)>-1}function Uw(e,t){var n=this.__data__,r=pi(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Rt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Rt.prototype.clear=Mw,Rt.prototype.delete=Fw,Rt.prototype.get=jw,Rt.prototype.has=zw,Rt.prototype.set=Uw;var Dc=la(gn,"Map");function qw(){this.size=0,this.__data__={hash:new en,map:new(Dc||Rt),string:new en}}function Hw(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function mi(e,t){var n=e.__data__;return Hw(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Bw(e){var t=mi(this,e).delete(e);return this.size-=t?1:0,t}function Vw(e){return mi(this,e).get(e)}function Ww(e){return mi(this,e).has(e)}function Yw(e,t){var n=mi(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function yn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}yn.prototype.clear=qw,yn.prototype.delete=Bw,yn.prototype.get=Vw,yn.prototype.has=Ww,yn.prototype.set=Yw;var $c=ww(Object.getPrototypeOf,Object),Gw="[object Object]",Kw=Function.prototype,Zw=Object.prototype,Cc=Kw.toString,Jw=Zw.hasOwnProperty,Xw=Cc.call(Object);function Qw(e){if(!Vn(e)||fi(e)!=Gw)return!1;var t=$c(e);if(t===null)return!0;var n=Jw.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Cc.call(n)==Xw}function e_(){this.__data__=new Rt,this.size=0}function t_(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function n_(e){return this.__data__.get(e)}function r_(e){return this.__data__.has(e)}var i_=200;function s_(e,t){var n=this.__data__;if(n instanceof Rt){var r=n.__data__;if(!Dc||r.length<i_-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new yn(r)}return n.set(e,t),this.size=n.size,this}function bn(e){var t=this.__data__=new Rt(e);this.size=t.size}bn.prototype.clear=e_,bn.prototype.delete=t_,bn.prototype.get=n_,bn.prototype.has=r_,bn.prototype.set=s_;var Oc=typeof $e=="object"&&$e&&!$e.nodeType&&$e,Rc=Oc&&typeof module=="object"&&module&&!module.nodeType&&module,a_=Rc&&Rc.exports===Oc,Nc=a_?gn.Buffer:void 0;Nc&&Nc.allocUnsafe;function o_(e,t){return e.slice()}var Mc=gn.Uint8Array;function l_(e){var t=new e.constructor(e.byteLength);return new Mc(t).set(new Mc(e)),t}function u_(e,t){var n=l_(e.buffer);return new e.constructor(n,e.byteOffset,e.length)}function c_(e){return typeof e.constructor=="function"&&!yc(e)?g1($c(e)):{}}function f_(e){return function(t,n,r){for(var i=-1,s=Object(t),a=r(t),o=a.length;o--;){var l=a[++i];if(n(s[l],l,s)===!1)break}return t}}var d_=f_();function ha(e,t,n){(n!==void 0&&!hi(e[t],n)||n===void 0&&!(t in e))&&ua(e,t,n)}function h_(e){return Vn(e)&&ca(e)}function pa(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function p_(e){return C1(e,Ac(e))}function m_(e,t,n,r,i,s,a){var o=pa(e,n),l=pa(t,n),u=a.get(l);if(u){ha(e,n,u);return}var c=s?s(o,l,n+"",e,t,a):void 0,f=c===void 0;if(f){var h=sa(l),d=!h&&kc(l),g=!h&&!d&&Pc(l);c=l,h||d||g?sa(o)?c=o:h_(o)?c=b1(o):d?(f=!1,c=o_(l)):g?(f=!1,c=u_(l)):c=[]:Qw(l)||fa(l)?(c=o,fa(o)?c=p_(o):(!Qt(o)||aa(o))&&(c=c_(l))):f=!1}f&&(a.set(l,c),i(c,l,r,s,a),a.delete(l)),ha(e,n,c)}function Ic(e,t,n,r,i){e!==t&&d_(t,function(s,a){if(i||(i=new bn),Qt(s))m_(e,t,a,n,Ic,r,i);else{var o=r?r(pa(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),ha(e,a,o)}},Ac)}var g_=I1(function(e,t,n,r){Ic(e,t,n,r)});let bt=null;function ma(){bt&&(bt.abort(),bt=null)}class y_{tools=Object.create(null);ajv=new Hb({allErrors:!0,strict:!1,allowUnionTypes:!0});validatorCache=Object.create(null);register(t,n){if(this.tools[t.function.name])throw new Error(`${t.function.name} 已存在`);this.tools[t.function.name]={def:t,handler:n}}getDefinition(t){return this.tools[t]?.def}getHandler(t){return this.tools[t]?.handler}remove(t){delete this.tools[t],delete this.validatorCache[t]}get definitions(){return Object.values(this.tools).map(t=>t.def)}getDefinitions(t){return t.length?t.map(n=>this.getDefinition(n)).filter(n=>!!n):null}getValidator(t,n){return this.validatorCache[t]||(this.validatorCache[t]=this.ajv.compile(n)),this.validatorCache[t]}validate(t,n){const r=this.tools[t];if(!r)throw new Error(`${t} 未注册`);const i=r.def.function.parameters,s=this.getValidator(t,i);if(!s(n)){const a=this.ajv.errorsText(s.errors,{separator:", "});throw new Error(`参数验证失败: ${a}`)}return!0}async call(t,n){this.validate(t,n);const r=this.getHandler(t);if(!r)throw new Error(`${t} 没有 handler`);return r(n)}}class b_ extends y_{model="";url="";messages=[];maxRounds=4;defaultParams={tools:[],roundsLeft:this.maxRounds};constructor(t){super();const{model:n,url:r,systemMessageContent:i,maxRounds:s}=t;this.model=n,this.url=r,typeof s=="number"&&(this.maxRounds=s),i&&(this.messages[0]={role:"system",content:i})}pushMessage(t){t&&this.messages.push(t)}pushMessages(t){if(t.length)for(const n of t)this.pushMessage(n)}merge(t,n,r=[]){return g_({},t,n,(i,s,a)=>{if(r.includes(a))return(typeof i=="string"?i:"")+(typeof s=="string"?s:"")})}async invoke(t=this.defaultParams){const{tools:n=[],roundsLeft:r=this.maxRounds}=t;ma(),bt=new AbortController;try{const i=await fetch(this.url,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:this.model,messages:this.messages,tools:this.getDefinitions(n),stream:!1}),signal:bt.signal});if(bt.signal.aborted)throw new DOMException("请求已被取消","AbortError");const a=(await i.json())?.choices?.[0]?.message;if(!a)return;a.role===null&&(a.role="assistant");const{content:o,role:l,tool_calls:u}=a;if(!u?.length)return a;o&&(ot.pushLoadingMessage(),requestAnimationFrame(()=>ot.updateLoadingMessageContent(o)),ot.finishLoadingMessage()),this.messages.push({content:o,role:l,tool_calls:u});const c=u.map(async f=>{const{function:{name:h,arguments:d},id:g}=f,T=await this.call(h,JSON.parse(d));this.messages.push({content:T,role:"tool",tool_call_id:g})});if(await Promise.all(c),r-1>0)return ot.pushLoadingMessage(),await this.invoke({tools:[],roundsLeft:r-1})}finally{bt=null}}async*invokeStream(t=this.defaultParams){const{tools:n=[],roundsLeft:r=this.maxRounds}=t;ma(),bt=new AbortController;try{const i=await fetch(this.url,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:this.model,messages:this.messages,tools:this.getDefinitions(n),stream:!0}),signal:bt.signal});if(bt.signal.aborted)throw new DOMException("请求已被取消","AbortError");const s=i.body?.getReader();if(!s)throw new Error("Failed to get response reader");let a=null;const o=new TextDecoder;let l="";for(;;){const{done:g,value:T}=await s.read();if(g)break;const m=o.decode(T,{stream:!0}).split(`
|
|
60
|
+
deps: ${c}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(l){const[u,c]=s(l);a(l,u),o(l,c)}};function s({schema:l}){const u={},c={};for(const f in l){if(f==="__proto__")continue;const h=Array.isArray(l[f])?u:c;h[f]=l[f]}return[u,c]}function a(l,u=l.schema){const{gen:c,data:f,it:h}=l;if(Object.keys(u).length===0)return;const d=c.let("missing");for(const g in u){const T=u[g];if(T.length===0)continue;const y=(0,r.propertyInData)(c,f,g,h.opts.ownProperties);l.setParams({property:g,depsCount:T.length,deps:T.join(", ")}),h.allErrors?c.if(y,()=>{for(const m of T)(0,r.checkReportMissingProp)(l,m)}):(c.if((0,t._)`${y} && (${(0,r.checkMissingProp)(l,T,d)})`),(0,r.reportMissingProp)(l,d),c.else())}}e.validatePropertyDeps=a;function o(l,u=l.schema){const{gen:c,data:f,keyword:h,it:d}=l,g=c.name("valid");for(const T in u)(0,n.alwaysValidSchema)(d,u[T])||(c.if((0,r.propertyInData)(c,f,T,d.opts.ownProperties),()=>{const y=l.subschema({keyword:h,schemaProp:T},g);l.mergeValidEvaluated(y,g)},()=>c.var(g,!0)),l.ok(g))}e.validateSchemaDeps=o,e.default=i})(ia)),ia}var Jr={},Bu;function Sb(){if(Bu)return Jr;Bu=1,Object.defineProperty(Jr,"__esModule",{value:!0});const e=he(),t=me(),r={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:i})=>(0,e._)`{propertyName: ${i.propertyName}}`},code(i){const{gen:s,schema:a,data:o,it:l}=i;if((0,t.alwaysValidSchema)(l,a))return;const u=s.name("valid");s.forIn("key",o,c=>{i.setParams({propertyName:c}),i.subschema({keyword:"propertyNames",data:c,dataTypes:["string"],propertyName:c,compositeRule:!0},u),s.if((0,e.not)(u),()=>{i.error(!0),l.allErrors||s.break()})}),i.ok(u)}};return Jr.default=r,Jr}var Xr={},Vu;function Wu(){if(Vu)return Xr;Vu=1,Object.defineProperty(Xr,"__esModule",{value:!0});const e=bt(),t=he(),n=qt(),r=me(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:a})=>(0,t._)`{additionalProperty: ${a.additionalProperty}}`},code(a){const{gen:o,schema:l,parentSchema:u,data:c,errsCount:f,it:h}=a;if(!f)throw new Error("ajv implementation error");const{allErrors:d,opts:g}=h;if(h.props=!0,g.removeAdditional!=="all"&&(0,r.alwaysValidSchema)(h,l))return;const T=(0,e.allSchemaProperties)(u.properties),y=(0,e.allSchemaProperties)(u.patternProperties);m(),a.ok((0,t._)`${f} === ${n.default.errors}`);function m(){o.forIn("key",c,w=>{!T.length&&!y.length?S(w):o.if(p(w),()=>S(w))})}function p(w){let x;if(T.length>8){const N=(0,r.schemaRefOrVal)(h,u.properties,"properties");x=(0,e.isOwnProperty)(o,N,w)}else T.length?x=(0,t.or)(...T.map(N=>(0,t._)`${w} === ${N}`)):x=t.nil;return y.length&&(x=(0,t.or)(x,...y.map(N=>(0,t._)`${(0,e.usePattern)(a,N)}.test(${w})`))),(0,t.not)(x)}function b(w){o.code((0,t._)`delete ${c}[${w}]`)}function S(w){if(g.removeAdditional==="all"||g.removeAdditional&&l===!1){b(w);return}if(l===!1){a.setParams({additionalProperty:w}),a.error(),d||o.break();return}if(typeof l=="object"&&!(0,r.alwaysValidSchema)(h,l)){const x=o.name("valid");g.removeAdditional==="failing"?(v(w,x,!1),o.if((0,t.not)(x),()=>{a.reset(),b(w)})):(v(w,x),d||o.if((0,t.not)(x),()=>o.break()))}}function v(w,x,N){const F={keyword:"additionalProperties",dataProp:w,dataPropType:r.Type.Str};N===!1&&Object.assign(F,{compositeRule:!0,createErrors:!1,allErrors:!1}),a.subschema(F,x)}}};return Xr.default=s,Xr}var Qr={},Yu;function xb(){if(Yu)return Qr;Yu=1,Object.defineProperty(Qr,"__esModule",{value:!0});const e=xr(),t=bt(),n=me(),r=Wu(),i={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:a,schema:o,parentSchema:l,data:u,it:c}=s;c.opts.removeAdditional==="all"&&l.additionalProperties===void 0&&r.default.code(new e.KeywordCxt(c,r.default,"additionalProperties"));const f=(0,t.allSchemaProperties)(o);for(const y of f)c.definedProperties.add(y);c.opts.unevaluated&&f.length&&c.props!==!0&&(c.props=n.mergeEvaluated.props(a,(0,n.toHash)(f),c.props));const h=f.filter(y=>!(0,n.alwaysValidSchema)(c,o[y]));if(h.length===0)return;const d=a.name("valid");for(const y of h)g(y)?T(y):(a.if((0,t.propertyInData)(a,u,y,c.opts.ownProperties)),T(y),c.allErrors||a.else().var(d,!0),a.endIf()),s.it.definedProperties.add(y),s.ok(d);function g(y){return c.opts.useDefaults&&!c.compositeRule&&o[y].default!==void 0}function T(y){s.subschema({keyword:"properties",schemaProp:y,dataProp:y},d)}}};return Qr.default=i,Qr}var ei={},Gu;function Pb(){if(Gu)return ei;Gu=1,Object.defineProperty(ei,"__esModule",{value:!0});const e=bt(),t=he(),n=me(),r=me(),i={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:a,schema:o,data:l,parentSchema:u,it:c}=s,{opts:f}=c,h=(0,e.allSchemaProperties)(o),d=h.filter(S=>(0,n.alwaysValidSchema)(c,o[S]));if(h.length===0||d.length===h.length&&(!c.opts.unevaluated||c.props===!0))return;const g=f.strictSchema&&!f.allowMatchingProperties&&u.properties,T=a.name("valid");c.props!==!0&&!(c.props instanceof t.Name)&&(c.props=(0,r.evaluatedPropsToName)(a,c.props));const{props:y}=c;m();function m(){for(const S of h)g&&p(S),c.allErrors?b(S):(a.var(T,!0),b(S),a.if(T))}function p(S){for(const v in g)new RegExp(S).test(v)&&(0,n.checkStrictMode)(c,`property ${v} matches pattern ${S} (use allowMatchingProperties)`)}function b(S){a.forIn("key",l,v=>{a.if((0,t._)`${(0,e.usePattern)(s,S)}.test(${v})`,()=>{const w=d.includes(S);w||s.subschema({keyword:"patternProperties",schemaProp:S,dataProp:v,dataPropType:r.Type.Str},T),c.opts.unevaluated&&y!==!0?a.assign((0,t._)`${y}[${v}]`,!0):!w&&!c.allErrors&&a.if((0,t.not)(T),()=>a.break())})})}}};return ei.default=i,ei}var ti={},Ku;function Ab(){if(Ku)return ti;Ku=1,Object.defineProperty(ti,"__esModule",{value:!0});const e=me(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){const{gen:r,schema:i,it:s}=n;if((0,e.alwaysValidSchema)(s,i)){n.fail();return}const a=r.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},a),n.failResult(a,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};return ti.default=t,ti}var ni={},Zu;function Db(){if(Zu)return ni;Zu=1,Object.defineProperty(ni,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:bt().validateUnion,error:{message:"must match a schema in anyOf"}};return ni.default=t,ni}var ri={},Ju;function $b(){if(Ju)return ri;Ju=1,Object.defineProperty(ri,"__esModule",{value:!0});const e=he(),t=me(),r={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:i})=>(0,e._)`{passingSchemas: ${i.passing}}`},code(i){const{gen:s,schema:a,parentSchema:o,it:l}=i;if(!Array.isArray(a))throw new Error("ajv implementation error");if(l.opts.discriminator&&o.discriminator)return;const u=a,c=s.let("valid",!1),f=s.let("passing",null),h=s.name("_valid");i.setParams({passing:f}),s.block(d),i.result(c,()=>i.reset(),()=>i.error(!0));function d(){u.forEach((g,T)=>{let y;(0,t.alwaysValidSchema)(l,g)?s.var(h,!0):y=i.subschema({keyword:"oneOf",schemaProp:T,compositeRule:!0},h),T>0&&s.if((0,e._)`${h} && ${c}`).assign(c,!1).assign(f,(0,e._)`[${f}, ${T}]`).else(),s.if(h,()=>{s.assign(c,!0),s.assign(f,T),y&&i.mergeEvaluated(y,e.Name)})})}}};return ri.default=r,ri}var ii={},Xu;function Cb(){if(Xu)return ii;Xu=1,Object.defineProperty(ii,"__esModule",{value:!0});const e=me(),t={keyword:"allOf",schemaType:"array",code(n){const{gen:r,schema:i,it:s}=n;if(!Array.isArray(i))throw new Error("ajv implementation error");const a=r.name("valid");i.forEach((o,l)=>{if((0,e.alwaysValidSchema)(s,o))return;const u=n.subschema({keyword:"allOf",schemaProp:l},a);n.ok(a),n.mergeEvaluated(u)})}};return ii.default=t,ii}var si={},Qu;function Ob(){if(Qu)return si;Qu=1,Object.defineProperty(si,"__esModule",{value:!0});const e=he(),t=me(),r={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,e.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,e._)`{failingKeyword: ${s.ifClause}}`},code(s){const{gen:a,parentSchema:o,it:l}=s;o.then===void 0&&o.else===void 0&&(0,t.checkStrictMode)(l,'"if" without "then" and "else" is ignored');const u=i(l,"then"),c=i(l,"else");if(!u&&!c)return;const f=a.let("valid",!0),h=a.name("_valid");if(d(),s.reset(),u&&c){const T=a.let("ifClause");s.setParams({ifClause:T}),a.if(h,g("then",T),g("else",T))}else u?a.if(h,g("then")):a.if((0,e.not)(h),g("else"));s.pass(f,()=>s.error(!0));function d(){const T=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},h);s.mergeEvaluated(T)}function g(T,y){return()=>{const m=s.subschema({keyword:T},h);a.assign(f,h),s.mergeValidEvaluated(m,f),y?a.assign(y,(0,e._)`${T}`):s.setParams({ifClause:T})}}}};function i(s,a){const o=s.schema[a];return o!==void 0&&!(0,t.alwaysValidSchema)(s,o)}return si.default=r,si}var ai={},ec;function Rb(){if(ec)return ai;ec=1,Object.defineProperty(ai,"__esModule",{value:!0});const e=me(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:r,it:i}){r.if===void 0&&(0,e.checkStrictMode)(i,`"${n}" without "if" is ignored`)}};return ai.default=t,ai}var tc;function Nb(){if(tc)return Yr;tc=1,Object.defineProperty(Yr,"__esModule",{value:!0});const e=Lu(),t=vb(),n=ju(),r=Tb(),i=kb(),s=Eb(),a=Sb(),o=Wu(),l=xb(),u=Pb(),c=Ab(),f=Db(),h=$b(),d=Cb(),g=Ob(),T=Rb();function y(m=!1){const p=[c.default,f.default,h.default,d.default,g.default,T.default,a.default,o.default,s.default,l.default,u.default];return m?p.push(t.default,r.default):p.push(e.default,n.default),p.push(i.default),p}return Yr.default=y,Yr}var oi={},li={},nc;function Mb(){if(nc)return li;nc=1,Object.defineProperty(li,"__esModule",{value:!0});const e=he(),n={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:r})=>(0,e.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,e._)`{format: ${r}}`},code(r,i){const{gen:s,data:a,$data:o,schema:l,schemaCode:u,it:c}=r,{opts:f,errSchemaPath:h,schemaEnv:d,self:g}=c;if(!f.validateFormats)return;o?T():y();function T(){const m=s.scopeValue("formats",{ref:g.formats,code:f.code.formats}),p=s.const("fDef",(0,e._)`${m}[${u}]`),b=s.let("fType"),S=s.let("format");s.if((0,e._)`typeof ${p} == "object" && !(${p} instanceof RegExp)`,()=>s.assign(b,(0,e._)`${p}.type || "string"`).assign(S,(0,e._)`${p}.validate`),()=>s.assign(b,(0,e._)`"string"`).assign(S,p)),r.fail$data((0,e.or)(v(),w()));function v(){return f.strictSchema===!1?e.nil:(0,e._)`${u} && !${S}`}function w(){const x=d.$async?(0,e._)`(${p}.async ? await ${S}(${a}) : ${S}(${a}))`:(0,e._)`${S}(${a})`,N=(0,e._)`(typeof ${S} == "function" ? ${x} : ${S}.test(${a}))`;return(0,e._)`${S} && ${S} !== true && ${b} === ${i} && !${N}`}}function y(){const m=g.formats[l];if(!m){v();return}if(m===!0)return;const[p,b,S]=w(m);p===i&&r.pass(x());function v(){if(f.strictSchema===!1){g.logger.warn(N());return}throw new Error(N());function N(){return`unknown format "${l}" ignored in schema at path "${h}"`}}function w(N){const F=N instanceof RegExp?(0,e.regexpCode)(N):f.code.formats?(0,e._)`${f.code.formats}${(0,e.getProperty)(l)}`:void 0,A=s.scopeValue("formats",{key:l,ref:N,code:F});return typeof N=="object"&&!(N instanceof RegExp)?[N.type||"string",N.validate,(0,e._)`${A}.validate`]:["string",N,A]}function x(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!d.$async)throw new Error("async format in sync schema");return(0,e._)`await ${S}(${a})`}return typeof b=="function"?(0,e._)`${S}(${a})`:(0,e._)`${S}.test(${a})`}}}};return li.default=n,li}var rc;function Ib(){if(rc)return oi;rc=1,Object.defineProperty(oi,"__esModule",{value:!0});const t=[Mb().default];return oi.default=t,oi}var Qt={},ic;function Lb(){return ic||(ic=1,Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.contentVocabulary=Qt.metadataVocabulary=void 0,Qt.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Qt.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Qt}var sc;function Fb(){if(sc)return Cr;sc=1,Object.defineProperty(Cr,"__esModule",{value:!0});const e=lb(),t=_b(),n=Nb(),r=Ib(),i=Lb(),s=[e.default,t.default,(0,n.default)(),r.default,i.metadataVocabulary,i.contentVocabulary];return Cr.default=s,Cr}var ui={},Vn={},ac;function jb(){if(ac)return Vn;ac=1,Object.defineProperty(Vn,"__esModule",{value:!0}),Vn.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(Vn.DiscrError=e={})),Vn}var oc;function zb(){if(oc)return ui;oc=1,Object.defineProperty(ui,"__esModule",{value:!0});const e=he(),t=jb(),n=ea(),r=Dr(),i=me(),a={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:o,tagName:l}})=>o===t.DiscrError.Tag?`tag "${l}" must be string`:`value of tag "${l}" must be in oneOf`,params:({params:{discrError:o,tag:l,tagName:u}})=>(0,e._)`{error: ${o}, tag: ${u}, tagValue: ${l}}`},code(o){const{gen:l,data:u,schema:c,parentSchema:f,it:h}=o,{oneOf:d}=f;if(!h.opts.discriminator)throw new Error("discriminator: requires discriminator option");const g=c.propertyName;if(typeof g!="string")throw new Error("discriminator: requires propertyName");if(c.mapping)throw new Error("discriminator: mapping is not supported");if(!d)throw new Error("discriminator: requires oneOf keyword");const T=l.let("valid",!1),y=l.const("tag",(0,e._)`${u}${(0,e.getProperty)(g)}`);l.if((0,e._)`typeof ${y} == "string"`,()=>m(),()=>o.error(!1,{discrError:t.DiscrError.Tag,tag:y,tagName:g})),o.ok(T);function m(){const S=b();l.if(!1);for(const v in S)l.elseIf((0,e._)`${y} === ${v}`),l.assign(T,p(S[v]));l.else(),o.error(!1,{discrError:t.DiscrError.Mapping,tag:y,tagName:g}),l.endIf()}function p(S){const v=l.name("valid"),w=o.subschema({keyword:"oneOf",schemaProp:S},v);return o.mergeEvaluated(w,e.Name),v}function b(){var S;const v={},w=N(f);let x=!0;for(let O=0;O<d.length;O++){let U=d[O];if(U?.$ref&&!(0,i.schemaHasRulesButRef)(U,h.self.RULES)){const H=U.$ref;if(U=n.resolveRef.call(h.self,h.schemaEnv.root,h.baseId,H),U instanceof n.SchemaEnv&&(U=U.schema),U===void 0)throw new r.default(h.opts.uriResolver,h.baseId,H)}const K=(S=U?.properties)===null||S===void 0?void 0:S[g];if(typeof K!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${g}"`);x=x&&(w||N(U)),F(K,O)}if(!x)throw new Error(`discriminator: "${g}" must be required`);return v;function N({required:O}){return Array.isArray(O)&&O.includes(g)}function F(O,U){if(O.const)A(O.const,U);else if(O.enum)for(const K of O.enum)A(K,U);else throw new Error(`discriminator: "properties/${g}" must have "const" or "enum"`)}function A(O,U){if(typeof O!="string"||O in v)throw new Error(`discriminator: "${g}" values must be unique strings`);v[O]=U}}}};return ui.default=a,ui}const Ub={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!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:"#"}},default:!0};var lc;function qb(){return lc||(lc=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=sb(),r=Fb(),i=zb(),s=Ub,a=["/properties"],o="http://json-schema.org/draft-07/schema";class l extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(g=>this.addVocabulary(g)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const g=this.opts.$data?this.$dataMetaSchema(s,a):s;this.addMetaSchema(g,o,!1),this.refs["http://json-schema.org/schema"]=o}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(o)?o:void 0)}}t.Ajv=l,e.exports=t=l,e.exports.Ajv=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var u=xr();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var c=he();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return c._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return c.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return c.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return c.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return c.CodeGen}});var f=Qs();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return f.default}});var h=Dr();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return h.default}})})(_r,_r.exports)),_r.exports}var Hb=qb();const Bb=er(Hb);var uc=typeof global=="object"&&global&&global.Object===Object&&global,Vb=typeof self=="object"&&self&&self.Object===Object&&self,bn=uc||Vb||Function("return this")(),ci=bn.Symbol,cc=Object.prototype,Wb=cc.hasOwnProperty,Yb=cc.toString,Wn=ci?ci.toStringTag:void 0;function Gb(e){var t=Wb.call(e,Wn),n=e[Wn];try{e[Wn]=void 0;var r=!0}catch{}var i=Yb.call(e);return r&&(t?e[Wn]=n:delete e[Wn]),i}var Kb=Object.prototype,Zb=Kb.toString;function Jb(e){return Zb.call(e)}var Xb="[object Null]",Qb="[object Undefined]",fc=ci?ci.toStringTag:void 0;function fi(e){return e==null?e===void 0?Qb:Xb:fc&&fc in Object(e)?Gb(e):Jb(e)}function Yn(e){return e!=null&&typeof e=="object"}var sa=Array.isArray;function en(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function dc(e){return e}var e1="[object AsyncFunction]",t1="[object Function]",n1="[object GeneratorFunction]",r1="[object Proxy]";function aa(e){if(!en(e))return!1;var t=fi(e);return t==t1||t==n1||t==e1||t==r1}var oa=bn["__core-js_shared__"],hc=(function(){var e=/[^.]+$/.exec(oa&&oa.keys&&oa.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function i1(e){return!!hc&&hc in e}var s1=Function.prototype,a1=s1.toString;function o1(e){if(e!=null){try{return a1.call(e)}catch{}try{return e+""}catch{}}return""}var l1=/[\\^$.*+?()[\]{}|]/g,u1=/^\[object .+?Constructor\]$/,c1=Function.prototype,f1=Object.prototype,d1=c1.toString,h1=f1.hasOwnProperty,p1=RegExp("^"+d1.call(h1).replace(l1,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function m1(e){if(!en(e)||i1(e))return!1;var t=aa(e)?p1:u1;return t.test(o1(e))}function g1(e,t){return e?.[t]}function la(e,t){var n=g1(e,t);return m1(n)?n:void 0}var pc=Object.create,y1=(function(){function e(){}return function(t){if(!en(t))return{};if(pc)return pc(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})();function b1(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function w1(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var _1=800,v1=16,T1=Date.now;function k1(e){var t=0,n=0;return function(){var r=T1(),i=v1-(r-n);if(n=r,i>0){if(++t>=_1)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function E1(e){return function(){return e}}var di=(function(){try{var e=la(Object,"defineProperty");return e({},"",{}),e}catch{}})(),S1=di?function(e,t){return di(e,"toString",{configurable:!0,enumerable:!1,value:E1(t),writable:!0})}:dc,x1=k1(S1),P1=9007199254740991,A1=/^(?:0|[1-9]\d*)$/;function mc(e,t){var n=typeof e;return t=t??P1,!!t&&(n=="number"||n!="symbol"&&A1.test(e))&&e>-1&&e%1==0&&e<t}function ua(e,t,n){t=="__proto__"&&di?di(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function hi(e,t){return e===t||e!==e&&t!==t}var D1=Object.prototype,$1=D1.hasOwnProperty;function C1(e,t,n){var r=e[t];(!($1.call(e,t)&&hi(r,n))||n===void 0&&!(t in e))&&ua(e,t,n)}function O1(e,t,n,r){var i=!n;n||(n={});for(var s=-1,a=t.length;++s<a;){var o=t[s],l=void 0;l===void 0&&(l=e[o]),i?ua(n,o,l):C1(n,o,l)}return n}var gc=Math.max;function R1(e,t,n){return t=gc(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=gc(r.length-t,0),a=Array(s);++i<s;)a[i]=r[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=r[i];return o[t]=n(a),b1(e,this,o)}}function N1(e,t){return x1(R1(e,t,dc),e+"")}var M1=9007199254740991;function yc(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=M1}function ca(e){return e!=null&&yc(e.length)&&!aa(e)}function I1(e,t,n){if(!en(n))return!1;var r=typeof t;return(r=="number"?ca(n)&&mc(t,n.length):r=="string"&&t in n)?hi(n[t],e):!1}function L1(e){return N1(function(t,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(s=e.length>3&&typeof s=="function"?(i--,s):void 0,a&&I1(n[0],n[1],a)&&(s=i<3?void 0:s,i=1),t=Object(t);++r<i;){var o=n[r];o&&e(t,o,r,s)}return t})}var F1=Object.prototype;function bc(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||F1;return e===n}function j1(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var z1="[object Arguments]";function wc(e){return Yn(e)&&fi(e)==z1}var _c=Object.prototype,U1=_c.hasOwnProperty,q1=_c.propertyIsEnumerable,fa=wc((function(){return arguments})())?wc:function(e){return Yn(e)&&U1.call(e,"callee")&&!q1.call(e,"callee")};function H1(){return!1}var vc=typeof $e=="object"&&$e&&!$e.nodeType&&$e,Tc=vc&&typeof module=="object"&&module&&!module.nodeType&&module,B1=Tc&&Tc.exports===vc,kc=B1?bn.Buffer:void 0,V1=kc?kc.isBuffer:void 0,Ec=V1||H1,W1="[object Arguments]",Y1="[object Array]",G1="[object Boolean]",K1="[object Date]",Z1="[object Error]",J1="[object Function]",X1="[object Map]",Q1="[object Number]",ew="[object Object]",tw="[object RegExp]",nw="[object Set]",rw="[object String]",iw="[object WeakMap]",sw="[object ArrayBuffer]",aw="[object DataView]",ow="[object Float32Array]",lw="[object Float64Array]",uw="[object Int8Array]",cw="[object Int16Array]",fw="[object Int32Array]",dw="[object Uint8Array]",hw="[object Uint8ClampedArray]",pw="[object Uint16Array]",mw="[object Uint32Array]",ve={};ve[ow]=ve[lw]=ve[uw]=ve[cw]=ve[fw]=ve[dw]=ve[hw]=ve[pw]=ve[mw]=!0,ve[W1]=ve[Y1]=ve[sw]=ve[G1]=ve[aw]=ve[K1]=ve[Z1]=ve[J1]=ve[X1]=ve[Q1]=ve[ew]=ve[tw]=ve[nw]=ve[rw]=ve[iw]=!1;function gw(e){return Yn(e)&&yc(e.length)&&!!ve[fi(e)]}function yw(e){return function(t){return e(t)}}var Sc=typeof $e=="object"&&$e&&!$e.nodeType&&$e,Gn=Sc&&typeof module=="object"&&module&&!module.nodeType&&module,bw=Gn&&Gn.exports===Sc,da=bw&&uc.process,xc=(function(){try{var e=Gn&&Gn.require&&Gn.require("util").types;return e||da&&da.binding&&da.binding("util")}catch{}})(),Pc=xc&&xc.isTypedArray,Ac=Pc?yw(Pc):gw;function ww(e,t){var n=sa(e),r=!n&&fa(e),i=!n&&!r&&Ec(e),s=!n&&!r&&!i&&Ac(e),a=n||r||i||s,o=a?j1(e.length,String):[],l=o.length;for(var u in e)a&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||mc(u,l))||o.push(u);return o}function _w(e,t){return function(n){return e(t(n))}}function vw(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Tw=Object.prototype,kw=Tw.hasOwnProperty;function Ew(e){if(!en(e))return vw(e);var t=bc(e),n=[];for(var r in e)r=="constructor"&&(t||!kw.call(e,r))||n.push(r);return n}function Dc(e){return ca(e)?ww(e):Ew(e)}var Kn=la(Object,"create");function Sw(){this.__data__=Kn?Kn(null):{},this.size=0}function xw(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Pw="__lodash_hash_undefined__",Aw=Object.prototype,Dw=Aw.hasOwnProperty;function $w(e){var t=this.__data__;if(Kn){var n=t[e];return n===Pw?void 0:n}return Dw.call(t,e)?t[e]:void 0}var Cw=Object.prototype,Ow=Cw.hasOwnProperty;function Rw(e){var t=this.__data__;return Kn?t[e]!==void 0:Ow.call(t,e)}var Nw="__lodash_hash_undefined__";function Mw(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Kn&&t===void 0?Nw:t,this}function tn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}tn.prototype.clear=Sw,tn.prototype.delete=xw,tn.prototype.get=$w,tn.prototype.has=Rw,tn.prototype.set=Mw;function Iw(){this.__data__=[],this.size=0}function pi(e,t){for(var n=e.length;n--;)if(hi(e[n][0],t))return n;return-1}var Lw=Array.prototype,Fw=Lw.splice;function jw(e){var t=this.__data__,n=pi(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Fw.call(t,n,1),--this.size,!0}function zw(e){var t=this.__data__,n=pi(t,e);return n<0?void 0:t[n][1]}function Uw(e){return pi(this.__data__,e)>-1}function qw(e,t){var n=this.__data__,r=pi(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Nt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Nt.prototype.clear=Iw,Nt.prototype.delete=jw,Nt.prototype.get=zw,Nt.prototype.has=Uw,Nt.prototype.set=qw;var $c=la(bn,"Map");function Hw(){this.size=0,this.__data__={hash:new tn,map:new($c||Nt),string:new tn}}function Bw(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function mi(e,t){var n=e.__data__;return Bw(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Vw(e){var t=mi(this,e).delete(e);return this.size-=t?1:0,t}function Ww(e){return mi(this,e).get(e)}function Yw(e){return mi(this,e).has(e)}function Gw(e,t){var n=mi(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function wn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}wn.prototype.clear=Hw,wn.prototype.delete=Vw,wn.prototype.get=Ww,wn.prototype.has=Yw,wn.prototype.set=Gw;var Cc=_w(Object.getPrototypeOf,Object),Kw="[object Object]",Zw=Function.prototype,Jw=Object.prototype,Oc=Zw.toString,Xw=Jw.hasOwnProperty,Qw=Oc.call(Object);function e_(e){if(!Yn(e)||fi(e)!=Kw)return!1;var t=Cc(e);if(t===null)return!0;var n=Xw.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Oc.call(n)==Qw}function t_(){this.__data__=new Nt,this.size=0}function n_(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function r_(e){return this.__data__.get(e)}function i_(e){return this.__data__.has(e)}var s_=200;function a_(e,t){var n=this.__data__;if(n instanceof Nt){var r=n.__data__;if(!$c||r.length<s_-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new wn(r)}return n.set(e,t),this.size=n.size,this}function _n(e){var t=this.__data__=new Nt(e);this.size=t.size}_n.prototype.clear=t_,_n.prototype.delete=n_,_n.prototype.get=r_,_n.prototype.has=i_,_n.prototype.set=a_;var Rc=typeof $e=="object"&&$e&&!$e.nodeType&&$e,Nc=Rc&&typeof module=="object"&&module&&!module.nodeType&&module,o_=Nc&&Nc.exports===Rc,Mc=o_?bn.Buffer:void 0;Mc&&Mc.allocUnsafe;function l_(e,t){return e.slice()}var Ic=bn.Uint8Array;function u_(e){var t=new e.constructor(e.byteLength);return new Ic(t).set(new Ic(e)),t}function c_(e,t){var n=u_(e.buffer);return new e.constructor(n,e.byteOffset,e.length)}function f_(e){return typeof e.constructor=="function"&&!bc(e)?y1(Cc(e)):{}}function d_(e){return function(t,n,r){for(var i=-1,s=Object(t),a=r(t),o=a.length;o--;){var l=a[++i];if(n(s[l],l,s)===!1)break}return t}}var h_=d_();function ha(e,t,n){(n!==void 0&&!hi(e[t],n)||n===void 0&&!(t in e))&&ua(e,t,n)}function p_(e){return Yn(e)&&ca(e)}function pa(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function m_(e){return O1(e,Dc(e))}function g_(e,t,n,r,i,s,a){var o=pa(e,n),l=pa(t,n),u=a.get(l);if(u){ha(e,n,u);return}var c=s?s(o,l,n+"",e,t,a):void 0,f=c===void 0;if(f){var h=sa(l),d=!h&&Ec(l),g=!h&&!d&&Ac(l);c=l,h||d||g?sa(o)?c=o:p_(o)?c=w1(o):d?(f=!1,c=l_(l)):g?(f=!1,c=c_(l)):c=[]:e_(l)||fa(l)?(c=o,fa(o)?c=m_(o):(!en(o)||aa(o))&&(c=f_(l))):f=!1}f&&(a.set(l,c),i(c,l,r,s,a),a.delete(l)),ha(e,n,c)}function Lc(e,t,n,r,i){e!==t&&h_(t,function(s,a){if(i||(i=new _n),en(s))g_(e,t,a,n,Lc,r,i);else{var o=r?r(pa(e,a),s,a+"",e,t,i):void 0;o===void 0&&(o=s),ha(e,a,o)}},Dc)}var y_=L1(function(e,t,n,r){Lc(e,t,n,r)});let wt=null;function ma(){wt&&(wt.abort(),wt=null)}class b_{tools=Object.create(null);ajv=new Bb({allErrors:!0,strict:!1,allowUnionTypes:!0});validatorCache=Object.create(null);register(t,n){if(this.tools[t.function.name])throw new Error(`${t.function.name} 已存在`);this.tools[t.function.name]={def:t,handler:n}}getDefinition(t){return this.tools[t]?.def}getHandler(t){return this.tools[t]?.handler}remove(t){delete this.tools[t],delete this.validatorCache[t]}get definitions(){return Object.values(this.tools).map(t=>t.def)}getDefinitions(t){return t.length?t.map(n=>this.getDefinition(n)).filter(n=>!!n):null}getValidator(t,n){return this.validatorCache[t]||(this.validatorCache[t]=this.ajv.compile(n)),this.validatorCache[t]}validate(t,n){const r=this.tools[t];if(!r)throw new Error(`${t} 未注册`);const i=r.def.function.parameters,s=this.getValidator(t,i);if(!s(n)){const a=this.ajv.errorsText(s.errors,{separator:", "});throw new Error(`参数验证失败: ${a}`)}return!0}async call(t,n){this.validate(t,n);const r=this.getHandler(t);if(!r)throw new Error(`${t} 没有 handler`);return r(n)}}class w_ extends b_{model="";url="";messages=[];maxRounds=4;defaultParams={tools:[],roundsLeft:this.maxRounds};constructor(t){super();const{model:n,url:r,systemMessageContent:i,maxRounds:s}=t;this.model=n,this.url=r,typeof s=="number"&&(this.maxRounds=s),i&&(this.messages[0]={role:"system",content:i})}pushMessage(t){t&&this.messages.push(t)}pushMessages(t){if(t.length)for(const n of t)this.pushMessage(n)}resetMessages(){const t=this.messages.find(n=>n.role==="system");this.messages=t?[t]:[]}merge(t,n,r=[]){return y_({},t,n,(i,s,a)=>{if(r.includes(a))return(typeof i=="string"?i:"")+(typeof s=="string"?s:"")})}async invoke(t=this.defaultParams){const{tools:n=[],roundsLeft:r=this.maxRounds}=t;ma(),wt=new AbortController;try{const i=await fetch(this.url,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:this.model,messages:this.messages,tools:this.getDefinitions(n),stream:!1}),signal:wt.signal});if(wt.signal.aborted)throw new DOMException("请求已被取消","AbortError");const a=(await i.json())?.choices?.[0]?.message;if(!a)return;a.role===null&&(a.role="assistant");const{content:o,role:l,tool_calls:u}=a;if(!u?.length)return a;o&&(at.pushLoadingMessage(),requestAnimationFrame(()=>at.updateLoadingMessageContent(o)),at.finishLoadingMessage()),this.messages.push({content:o,role:l,tool_calls:u});const c=u.map(async f=>{const{function:{name:h,arguments:d},id:g}=f,T=await this.call(h,JSON.parse(d));this.messages.push({content:T,role:"tool",tool_call_id:g})});if(await Promise.all(c),r-1>0)return at.pushLoadingMessage(),await this.invoke({tools:[],roundsLeft:r-1})}finally{wt=null}}async*invokeStream(t=this.defaultParams){const{tools:n=[],roundsLeft:r=this.maxRounds}=t;ma(),wt=new AbortController;try{const i=await fetch(this.url,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:this.model,messages:this.messages,tools:this.getDefinitions(n),stream:!0}),signal:wt.signal});if(wt.signal.aborted)throw new DOMException("请求已被取消","AbortError");const s=i.body?.getReader();if(!s)throw new Error("Failed to get response reader");let a=null;const o=new TextDecoder;let l="";for(;;){const{done:g,value:T}=await s.read();if(g)break;const m=o.decode(T,{stream:!0}).split(`
|
|
61
61
|
|
|
62
|
-
`).filter(p=>p.trim()!=="");for(const p of m){if(p==="data: [DONE]")break;const b=p.trim().replace(/^data: /,"");try{const S=JSON.parse(l+b);a=this.merge(a,S,["content","arguments"]),yield S,l=""}catch(S){console.log("JSON 解析失败,等待下一个数据块继续拼接",{error:S,jsonStr:b}),l+=b}}}const u=a?.choices?.[0]?.delta;if(!u)return;u.role===null&&(u.role="assistant");const{content:c,role:f,tool_calls:h}=u;if(!h?.length)return u;this.messages.push({content:c,role:f,tool_calls:h});const d=h.map(async g=>{const{function:{name:T,arguments:y},id:m}=g,p=await this.call(T,JSON.parse(y));this.messages.push({content:p,role:"tool",tool_call_id:m})});if(await Promise.all(d),r-1>0)return this.invokeStream({tools:[],roundsLeft:r-1})}finally{
|
|
63
|
-
`),
|
|
64
|
-
<style>${
|
|
62
|
+
`).filter(p=>p.trim()!=="");for(const p of m){if(p==="data: [DONE]")break;const b=p.trim().replace(/^data: /,"");try{const S=JSON.parse(l+b);a=this.merge(a,S,["content","arguments"]),yield S,l=""}catch(S){console.log("JSON 解析失败,等待下一个数据块继续拼接",{error:S,jsonStr:b}),l+=b}}}const u=a?.choices?.[0]?.delta;if(!u)return;u.role===null&&(u.role="assistant");const{content:c,role:f,tool_calls:h}=u;if(!h?.length)return u;this.messages.push({content:c,role:f,tool_calls:h});const d=h.map(async g=>{const{function:{name:T,arguments:y},id:m}=g,p=await this.call(T,JSON.parse(y));this.messages.push({content:p,role:"tool",tool_call_id:m})});if(await Promise.all(d),r-1>0)return this.invokeStream({tools:[],roundsLeft:r-1})}finally{wt=null}}}const __=e=>{const t=document.createElement("div");return t.textContent=e,t.innerHTML},Fc=async()=>{if(Ut.value)try{const e=__(Ut.value);Vs.chatting(),Ut.clear();const t={role:"user",content:e};at.pushMessage(t),await ga.emit("send",t)}finally{Vs.default(),Ut.focus()}},v_=()=>{ma(),Vs.default(),Ut.focus()},T_=async()=>{at.clear(),K0.show("新对话已创建"),Ut.focus(),await ga.emit("create")};function k_(){const{submitIcon:e,createButton:t,messagesContainer:n,userInputContainer:r,userInput:i,stopIcon:s}=Ge();r.addEventListener("click",a=>{!e.contains(a.target)&&!s.contains(a.target)&&Ut.focus()}),i.addEventListener("keydown",a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),Fc())}),e.addEventListener("click",Fc),s.addEventListener("click",v_),t.addEventListener("click",T_),n.addEventListener("click",function(a){const o=a.target,l=o.closest('[data-action="copy"]'),u=o.closest(".reasoning-header");if(l&&!l.classList.contains("copied")){a.stopPropagation();const c=l.closest(".message");if(!c)return;const f=c.querySelector(".content-container");if(!f)return;const h=f.textContent;if(!h)return;l.classList.add("copied"),navigator.clipboard.writeText(h).catch(d=>{console.error("Failed to copy text: ",d)}).finally(()=>{setTimeout(()=>{l.classList.remove("copied")},1500)})}if(u){const c=u.parentElement;c&&c.classList.toggle("collapse")}})}class E_{events={send:[],create:[]};on=(t,n)=>{this.events[t].push(n)};emit=async(t,...n)=>{for(const r of this.events[t])try{await r(...n)}catch(i){console.error(`Error in event listener for ${t}:`,i)}}}const ga=new E_,S_=e=>{Y0(e),k_(),at.setPaddingBottom()},x_=["button{outline:0;border:0;display:flex;justify-content:center;align-items:center;cursor:pointer}button.icon{padding:4px}button.text{padding:0 12px;height:28px}button.square{border-radius:6px}button.circle{border-radius:50%}button.primary{background-color:#0000000a}button.plain{background-color:transparent}button.error{background-color:#ff4d4f;color:#fff}button.primary:hover{background-color:#0000000f}button.plain:hover{background-color:#0000000a}button.error:hover{background-color:#ff7875}button[data-action=copy] .copied-text{display:none}button[data-action=copy].copied .copied-text{display:block}button[data-action=copy].copied svg{display:none}",".tooltip{position:relative}.tooltip .tooltip-text{visibility:hidden;opacity:0;background-color:#000000b3;color:#fff;border-radius:4px;padding:4px 8px;position:absolute;z-index:1;white-space:nowrap;font-size:12px;transition:opacity .3s}.tooltip .tooltip-text.top-left{bottom:115%;right:0}.tooltip .tooltip-text.top-right{bottom:115%;left:0}.tooltip .tooltip-text.bottom-left{top:115%;right:0}.tooltip .tooltip-text.bottom-right{top:115%;left:0}.tooltip:hover .tooltip-text{visibility:visible;opacity:1}",".alert{position:absolute;left:50%;transform:translate(-50%);background-color:#fff;border-radius:8px;box-shadow:0 6px 16px #00000014,0 3px 6px -4px #0000001f,0 9px 28px 8px #0000000d;z-index:1000;pointer-events:all;padding:9px 12px;animation:slide 3s ease-in-out forwards;font-size:12px;white-space:nowrap}@keyframes slide{0%{top:0;opacity:0}10%{top:50px;opacity:1}75%{top:50px;opacity:1}to{top:0;opacity:0}}",'.loading-dots{font-weight:700;margin-left:3px}.loading-dots:after{content:"";animation:typing 1.5s infinite}@keyframes typing{0%{content:"."}33%{content:".."}66%{content:"..."}to{content:"."}}',".app-container{height:100%;display:flex;flex-direction:column;background:#fff}.bottom-container{margin:12px}.action-bar{margin-bottom:12px;display:flex;align-items:center;gap:12px}.user-input-container{padding:12px;border-radius:16px;border:1px solid rgba(114,118,139,.16);box-shadow:0 10px 30px #0003;display:flex;flex-direction:column}.user-input{border:0;resize:none;width:100%;font-size:14px;line-height:1.5}.button-wrap{display:flex;justify-content:flex-end;align-items:center;gap:12px}.messages-container{flex:1;padding-top:12px;padding-left:12px;padding-right:12px;overflow-x:hidden;overflow-y:auto}.message{max-width:80%;margin-bottom:12px;font-size:14px;line-height:1.5}.body-container{padding:0 14px;border-radius:8px;overflow-x:auto;color:#000}.message.user{margin-left:auto}.message.user .body-container{background:#e3f2fd}.message.assistant{margin-right:auto}.message.assistant .body-container{background:#f1f1f1}.button-container{display:flex;margin-top:4px}.button-container button{height:26px;display:flex;align-items:center}.message.user .button-container{justify-content:flex-end}.message.assistant .button-container{justify-content:flex-start}.submit-icon,.stop-icon{width:28px;height:28px;display:flex;justify-content:center;align-items:center;background-color:#000;border-radius:50%;color:#fff}.content-container{word-wrap:break-word}.message.assistant table{border-collapse:collapse;margin-block-start:1em;margin-block-end:1em}.message.assistant table th,.message.assistant table td{border:1px solid #ccc;padding:8px}.message.assistant table th{background-color:#e0e0e0}.message.assistant .reasoning-container{padding:0 14px;border-radius:8px;overflow-x:auto;color:#6b7280;background-color:#f9fafb;font-size:12px;margin-bottom:8px}.message.assistant .reasoning-container .reasoning-header{display:flex;align-items:center;gap:4px;padding-top:8px;margin-bottom:8px;cursor:pointer}.message.assistant .reasoning-container .reasoning-header svg{transform:rotate(90deg);transition:transform .3s}.message.assistant .reasoning-container.collapse .reasoning-header svg{transform:rotate(0);transition:transform .3s}.message.assistant .reasoning-container.collapse .reasoning-content{height:0;overflow:hidden}","*{box-sizing:border-box}textarea{padding:0}textarea:focus-visible,select:focus-visible{outline:0}.flex{display:flex}:host{position:relative}"].join(`
|
|
63
|
+
`),jc=document.createElement("template");jc.innerHTML=`
|
|
64
|
+
<style>${x_}</style>
|
|
65
65
|
<div class="app-container">
|
|
66
66
|
<div class="messages-container" id="messages-container"></div>
|
|
67
67
|
<div class="bottom-container">
|
|
@@ -90,8 +90,8 @@
|
|
|
90
90
|
</div>
|
|
91
91
|
</div>
|
|
92
92
|
</div>
|
|
93
|
-
`;var ye;(function(e){e[e.AM=0]="AM",e[e.PM=1]="PM"})(ye||(ye={}));var Ee;(function(e){e[e.SUNDAY=0]="SUNDAY",e[e.MONDAY=1]="MONDAY",e[e.TUESDAY=2]="TUESDAY",e[e.WEDNESDAY=3]="WEDNESDAY",e[e.THURSDAY=4]="THURSDAY",e[e.FRIDAY=5]="FRIDAY",e[e.SATURDAY=6]="SATURDAY"})(Ee||(Ee={}));var dt;(function(e){e[e.JANUARY=1]="JANUARY",e[e.FEBRUARY=2]="FEBRUARY",e[e.MARCH=3]="MARCH",e[e.APRIL=4]="APRIL",e[e.MAY=5]="MAY",e[e.JUNE=6]="JUNE",e[e.JULY=7]="JULY",e[e.AUGUST=8]="AUGUST",e[e.SEPTEMBER=9]="SEPTEMBER",e[e.OCTOBER=10]="OCTOBER",e[e.NOVEMBER=11]="NOVEMBER",e[e.DECEMBER=12]="DECEMBER"})(dt||(dt={}));function
|
|
93
|
+
`;var ye;(function(e){e[e.AM=0]="AM",e[e.PM=1]="PM"})(ye||(ye={}));var Ee;(function(e){e[e.SUNDAY=0]="SUNDAY",e[e.MONDAY=1]="MONDAY",e[e.TUESDAY=2]="TUESDAY",e[e.WEDNESDAY=3]="WEDNESDAY",e[e.THURSDAY=4]="THURSDAY",e[e.FRIDAY=5]="FRIDAY",e[e.SATURDAY=6]="SATURDAY"})(Ee||(Ee={}));var dt;(function(e){e[e.JANUARY=1]="JANUARY",e[e.FEBRUARY=2]="FEBRUARY",e[e.MARCH=3]="MARCH",e[e.APRIL=4]="APRIL",e[e.MAY=5]="MAY",e[e.JUNE=6]="JUNE",e[e.JULY=7]="JULY",e[e.AUGUST=8]="AUGUST",e[e.SEPTEMBER=9]="SEPTEMBER",e[e.OCTOBER=10]="OCTOBER",e[e.NOVEMBER=11]="NOVEMBER",e[e.DECEMBER=12]="DECEMBER"})(dt||(dt={}));function nn(e,t){e.assign("day",t.getDate()),e.assign("month",t.getMonth()+1),e.assign("year",t.getFullYear())}function zc(e,t){e.assign("hour",t.getHours()),e.assign("minute",t.getMinutes()),e.assign("second",t.getSeconds()),e.assign("millisecond",t.getMilliseconds()),e.assign("meridiem",t.getHours()<12?ye.AM:ye.PM)}function vn(e,t){e.imply("day",t.getDate()),e.imply("month",t.getMonth()+1),e.imply("year",t.getFullYear())}function ya(e,t){e.imply("hour",t.getHours()),e.imply("minute",t.getMinutes()),e.imply("second",t.getSeconds()),e.imply("millisecond",t.getMilliseconds()),e.imply("meridiem",t.getHours()<12?ye.AM:ye.PM)}const P_={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:{timezoneOffsetDuringDst:120,timezoneOffsetNonDst:60,dstStart:e=>Uc(e,dt.MARCH,Ee.SUNDAY,2),dstEnd:e=>Uc(e,dt.OCTOBER,Ee.SUNDAY,3)},CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CT:{timezoneOffsetDuringDst:-300,timezoneOffsetNonDst:-360,dstStart:e=>Bt(e,dt.MARCH,Ee.SUNDAY,2,2),dstEnd:e=>Bt(e,dt.NOVEMBER,Ee.SUNDAY,1,2)},CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:{timezoneOffsetDuringDst:-240,timezoneOffsetNonDst:-300,dstStart:e=>Bt(e,dt.MARCH,Ee.SUNDAY,2,2),dstEnd:e=>Bt(e,dt.NOVEMBER,Ee.SUNDAY,1,2)},FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:180,MST:-420,MT:{timezoneOffsetDuringDst:-360,timezoneOffsetNonDst:-420,dstStart:e=>Bt(e,dt.MARCH,Ee.SUNDAY,2,2),dstEnd:e=>Bt(e,dt.NOVEMBER,Ee.SUNDAY,1,2)},MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:{timezoneOffsetDuringDst:-420,timezoneOffsetNonDst:-480,dstStart:e=>Bt(e,dt.MARCH,Ee.SUNDAY,2,2),dstEnd:e=>Bt(e,dt.NOVEMBER,Ee.SUNDAY,1,2)},PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360};function Bt(e,t,n,r,i=0){let s=0,a=0;for(;a<r;)s++,new Date(e,t-1,s).getDay()===n&&a++;return new Date(e,t-1,s,i)}function Uc(e,t,n,r=0){const i=n===0?7:n,s=new Date(e,t-1+1,1,12),a=s.getDay()===0?7:s.getDay();let o;return a===i?o=7:a<i?o=7+a-i:o=a-i,s.setDate(s.getDate()-o),new Date(e,t-1,s.getDate(),r)}function qc(e,t,n={}){if(e==null)return null;if(typeof e=="number")return e;const r=n[e]??P_[e];return r==null?null:typeof r=="number"?r:t==null?null:t>r.dstStart(t.getFullYear())&&!(t>r.dstEnd(t.getFullYear()))?r.timezoneOffsetDuringDst:r.timezoneOffsetNonDst}const A_={day:0,second:0,millisecond:0};function Le(e,t){let n=new Date(e);if(t.y&&(t.year=t.y,delete t.y),t.mo&&(t.month=t.mo,delete t.mo),t.M&&(t.month=t.M,delete t.M),t.w&&(t.week=t.w,delete t.w),t.d&&(t.day=t.d,delete t.d),t.h&&(t.hour=t.h,delete t.h),t.m&&(t.minute=t.m,delete t.m),t.s&&(t.second=t.s,delete t.s),t.ms&&(t.millisecond=t.ms,delete t.ms),"year"in t){const r=Math.floor(t.year);n.setFullYear(n.getFullYear()+r);const i=t.year-r;i>0&&(t.month=t?.month??0,t.month+=i*12)}if("quarter"in t){const r=Math.floor(t.quarter);n.setMonth(n.getMonth()+r*3)}if("month"in t){const r=Math.floor(t.month);n.setMonth(n.getMonth()+r);const i=t.month-r;i>0&&(t.week=t?.week??0,t.week+=i*4)}if("week"in t){const r=Math.floor(t.week);n.setDate(n.getDate()+r*7);const i=t.week-r;i>0&&(t.day=t?.day??0,t.day+=Math.round(i*7))}if("day"in t){const r=Math.floor(t.day);n.setDate(n.getDate()+r);const i=t.day-r;i>0&&(t.hour=t?.hour??0,t.hour+=Math.round(i*24))}if("hour"in t){const r=Math.floor(t.hour);n.setHours(n.getHours()+r);const i=t.hour-r;i>0&&(t.minute=t?.minute??0,t.minute+=Math.round(i*60))}if("minute"in t){const r=Math.floor(t.minute);n.setMinutes(n.getMinutes()+r);const i=t.minute-r;i>0&&(t.second=t?.second??0,t.second+=Math.round(i*60))}if("second"in t){const r=Math.floor(t.second);n.setSeconds(n.getSeconds()+r);const i=t.second-r;i>0&&(t.millisecond=t?.millisecond??0,t.millisecond+=Math.round(i*1e3))}if("millisecond"in t){const r=Math.floor(t.millisecond);n.setMilliseconds(n.getMilliseconds()+r)}return n}function gi(e){const t={};for(const n in e)t[n]=-e[n];return t}class rn{instant;timezoneOffset;constructor(t,n){this.instant=t??new Date,this.timezoneOffset=n??null}static fromDate(t){return new rn(t)}static fromInput(t,n){if(t instanceof Date)return rn.fromDate(t);const r=t?.instant??new Date,i=qc(t?.timezone,r,n);return new rn(r,i)}getDateWithAdjustedTimezone(){const t=new Date(this.instant);return this.timezoneOffset!==null&&t.setMinutes(t.getMinutes()-this.getSystemTimezoneAdjustmentMinute(this.instant)),t}getSystemTimezoneAdjustmentMinute(t,n){(!t||t.getTime()<0)&&(t=new Date);const r=-t.getTimezoneOffset(),i=n??this.timezoneOffset??r;return r-i}getTimezoneOffset(){return this.timezoneOffset??-this.instant.getTimezoneOffset()}}class Te{knownValues;impliedValues;reference;_tags=new Set;constructor(t,n){if(this.reference=t,this.knownValues={},this.impliedValues={},n)for(const i in n)this.knownValues[i]=n[i];const r=t.getDateWithAdjustedTimezone();this.imply("day",r.getDate()),this.imply("month",r.getMonth()+1),this.imply("year",r.getFullYear()),this.imply("hour",12),this.imply("minute",0),this.imply("second",0),this.imply("millisecond",0)}static createRelativeFromReference(t,n=A_){let r=Le(t.getDateWithAdjustedTimezone(),n);const i=new Te(t);return i.addTag("result/relativeDate"),"hour"in n||"minute"in n||"second"in n||"millisecond"in n?(i.addTag("result/relativeDateAndTime"),zc(i,r),nn(i,r),i.assign("timezoneOffset",t.getTimezoneOffset())):(ya(i,r),i.imply("timezoneOffset",t.getTimezoneOffset()),"day"in n?(i.assign("day",r.getDate()),i.assign("month",r.getMonth()+1),i.assign("year",r.getFullYear()),i.assign("weekday",r.getDay())):"week"in n?(i.assign("day",r.getDate()),i.assign("month",r.getMonth()+1),i.assign("year",r.getFullYear()),i.imply("weekday",r.getDay())):(i.imply("day",r.getDate()),"month"in n?(i.assign("month",r.getMonth()+1),i.assign("year",r.getFullYear())):(i.imply("month",r.getMonth()+1),"year"in n?i.assign("year",r.getFullYear()):i.imply("year",r.getFullYear())))),i}get(t){return t in this.knownValues?this.knownValues[t]:t in this.impliedValues?this.impliedValues[t]:null}isCertain(t){return t in this.knownValues}getCertainComponents(){return Object.keys(this.knownValues)}imply(t,n){return t in this.knownValues?this:(this.impliedValues[t]=n,this)}assign(t,n){return this.knownValues[t]=n,delete this.impliedValues[t],this}addDurationAsImplied(t){const n=this.dateWithoutTimezoneAdjustment(),r=Le(n,t);return("day"in t||"week"in t||"month"in t||"year"in t)&&(this.delete(["day","weekday","month","year"]),this.imply("day",r.getDate()),this.imply("weekday",r.getDay()),this.imply("month",r.getMonth()+1),this.imply("year",r.getFullYear())),("second"in t||"minute"in t||"hour"in t)&&(this.delete(["second","minute","hour"]),this.imply("second",r.getSeconds()),this.imply("minute",r.getMinutes()),this.imply("hour",r.getHours())),this}delete(t){typeof t=="string"&&(t=[t]);for(const n of t)delete this.knownValues[n],delete this.impliedValues[n]}clone(){const t=new Te(this.reference);t.knownValues={},t.impliedValues={};for(const n in this.knownValues)t.knownValues[n]=this.knownValues[n];for(const n in this.impliedValues)t.impliedValues[n]=this.impliedValues[n];return t}isOnlyDate(){return!this.isCertain("hour")&&!this.isCertain("minute")&&!this.isCertain("second")}isOnlyTime(){return!this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")&&!this.isCertain("year")}isOnlyWeekdayComponent(){return this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isDateWithUnknownYear(){return this.isCertain("month")&&!this.isCertain("year")}isValidDate(){const t=this.dateWithoutTimezoneAdjustment();return!(t.getFullYear()!==this.get("year")||t.getMonth()!==this.get("month")-1||t.getDate()!==this.get("day")||this.get("hour")!=null&&t.getHours()!=this.get("hour")||this.get("minute")!=null&&t.getMinutes()!=this.get("minute"))}toString(){return`[ParsingComponents {
|
|
94
94
|
tags: ${JSON.stringify(Array.from(this._tags).sort())},
|
|
95
95
|
knownValues: ${JSON.stringify(this.knownValues)},
|
|
96
96
|
impliedValues: ${JSON.stringify(this.impliedValues)}},
|
|
97
|
-
reference: ${JSON.stringify(this.reference)}]`}date(){const t=this.dateWithoutTimezoneAdjustment(),n=this.reference.getSystemTimezoneAdjustmentMinute(t,this.get("timezoneOffset"));return new Date(t.getTime()+n*6e4)}addTag(t){return this._tags.add(t),this}addTags(t){for(const n of t)this._tags.add(n);return this}tags(){return new Set(this._tags)}dateWithoutTimezoneAdjustment(){const t=new Date(this.get("year"),this.get("month")-1,this.get("day"),this.get("hour"),this.get("minute"),this.get("second"),this.get("millisecond"));return t.setFullYear(this.get("year")),t}}class _n{refDate;index;text;reference;start;end;constructor(t,n,r,i,s){this.reference=t,this.refDate=t.instant,this.index=n,this.text=r,this.start=i||new Te(t),this.end=s}clone(){const t=new _n(this.reference,this.index,this.text);return t.start=this.start?this.start.clone():null,t.end=this.end?this.end.clone():null,t}date(){return this.start.date()}addTag(t){return this.start.addTag(t),this.end&&this.end.addTag(t),this}addTags(t){return this.start.addTags(t),this.end&&this.end.addTags(t),this}tags(){const t=new Set(this.start.tags());if(this.end)for(const n of this.end.tags())t.add(n);return t}toString(){const t=Array.from(this.tags()).sort();return`[ParsingResult {index: ${this.index}, text: '${this.text}', tags: ${JSON.stringify(t)} ...}]`}}function qc(e,t,n="\\s{0,5},?\\s{0,5}"){const r=t.replace(/\((?!\?)/g,"(?:");return`${e}${r}(?:${n}${r}){0,10}`}function A_(e){let t;return e instanceof Array?t=[...e]:e instanceof Map?t=Array.from(e.keys()):t=Object.keys(e),t}function Et(e){return`(?:${A_(e).sort((n,r)=>r.length-n.length).join("|").replace(/\./g,"\\.")})`}function Hc(e){return e<100&&(e>50?e=e+1900:e=e+2e3),e}function yi(e,t,n){let r=new Date(e);r.setMonth(n-1),r.setDate(t);const i=Le(r,{year:1}),s=Le(r,{year:-1});return Math.abs(i.getTime()-e.getTime())<Math.abs(r.getTime()-e.getTime())?r=i:Math.abs(s.getTime()-e.getTime())<Math.abs(r.getTime()-e.getTime())&&(r=s),r.getFullYear()}const ba={sunday:0,sun:0,"sun.":0,monday:1,mon:1,"mon.":1,tuesday:2,tue:2,"tue.":2,wednesday:3,wed:3,"wed.":3,thursday:4,thurs:4,"thurs.":4,thur:4,"thur.":4,thu:4,"thu.":4,friday:5,fri:5,"fri.":5,saturday:6,sat:6,"sat.":6},Bc={january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12},Vt={...Bc,jan:1,"jan.":1,feb:2,"feb.":2,mar:3,"mar.":3,apr:4,"apr.":4,jun:6,"jun.":6,jul:7,"jul.":7,aug:8,"aug.":8,sep:9,"sep.":9,sept:9,"sept.":9,oct:10,"oct.":10,nov:11,"nov.":11,dec:12,"dec.":12},wa={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12},_a={first:1,second:2,third:3,fourth:4,fifth:5,sixth:6,seventh:7,eighth:8,ninth:9,tenth:10,eleventh:11,twelfth:12,thirteenth:13,fourteenth:14,fifteenth:15,sixteenth:16,seventeenth:17,eighteenth:18,nineteenth:19,twentieth:20,"twenty first":21,"twenty-first":21,"twenty second":22,"twenty-second":22,"twenty third":23,"twenty-third":23,"twenty fourth":24,"twenty-fourth":24,"twenty fifth":25,"twenty-fifth":25,"twenty sixth":26,"twenty-sixth":26,"twenty seventh":27,"twenty-seventh":27,"twenty eighth":28,"twenty-eighth":28,"twenty ninth":29,"twenty-ninth":29,thirtieth:30,"thirty first":31,"thirty-first":31},Vc={second:"second",seconds:"second",minute:"minute",minutes:"minute",hour:"hour",hours:"hour",day:"day",days:"day",week:"week",weeks:"week",month:"month",months:"month",quarter:"quarter",quarters:"quarter",year:"year",years:"year"},bi={s:"second",sec:"second",second:"second",seconds:"second",m:"minute",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",hour:"hour",hours:"hour",d:"day",day:"day",days:"day",w:"week",week:"week",weeks:"week",mo:"month",mon:"month",mos:"month",month:"month",months:"month",qtr:"quarter",quarter:"quarter",quarters:"quarter",y:"year",yr:"year",year:"year",years:"year",...Vc},Wc=`(?:${Et(wa)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s{0,2}an?)?|an?\\b(?:\\s{0,2}few)?|few|several|the|a?\\s{0,2}couple\\s{0,2}(?:of)?)`;function D_(e){const t=e.toLowerCase();return wa[t]!==void 0?wa[t]:t==="a"||t==="an"||t=="the"?1:t.match(/few/)?3:t.match(/half/)?.5:t.match(/couple/)?2:t.match(/several/)?7:parseFloat(t)}const wi=`(?:${Et(_a)}|[0-9]{1,2}(?:st|nd|rd|th)?)`;function _i(e){let t=e.toLowerCase();return _a[t]!==void 0?_a[t]:(t=t.replace(/(?:st|nd|rd|th)$/i,""),parseInt(t))}const vi="(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-2][0-9]{3}|[5-9][0-9]|2[0-5])";function Ti(e){if(/BE/i.test(e))return e=e.replace(/BE/i,""),parseInt(e)-543;if(/BCE?/i.test(e))return e=e.replace(/BCE?/i,""),-parseInt(e);if(/(AD|CE)/i.test(e))return e=e.replace(/(AD|CE)/i,""),parseInt(e);const t=parseInt(e);return Hc(t)}const Yc=`(${Wc})\\s{0,3}(${Et(bi)})`,Gc=new RegExp(Yc,"i"),$_=`(${Wc})\\s{0,3}(${Et(Vc)})`,Kc="\\s{0,5},?(?:\\s*and)?\\s{0,5}",Gn=qc("(?:(?:about|around)\\s{0,3})?",Yc,Kc),ki=qc("(?:(?:about|around)\\s{0,3})?",$_,Kc);function vn(e){const t={};let n=e,r=Gc.exec(n);for(;r;)C_(t,r),n=n.substring(r[0].length).trim(),r=Gc.exec(n);return Object.keys(t).length==0?null:t}function C_(e,t){if(t[0].match(/^[a-zA-Z]+$/))return;const n=D_(t[1]),r=bi[t[2].toLowerCase()];e[r]=n}class ke{innerPatternHasChange(t,n){return this.innerPattern(t)!==n}patternLeftBoundary(){return"(\\W|^)"}cachedInnerPattern=null;cachedPattern=null;pattern(t){return this.cachedInnerPattern&&!this.innerPatternHasChange(t,this.cachedInnerPattern)?this.cachedPattern:(this.cachedInnerPattern=this.innerPattern(t),this.cachedPattern=new RegExp(`${this.patternLeftBoundary()}${this.cachedInnerPattern.source}`,this.cachedInnerPattern.flags),this.cachedPattern)}extract(t,n){const r=n[1]??"";n.index=n.index+r.length,n[0]=n[0].substring(r.length);for(let i=2;i<n.length;i++)n[i-1]=n[i];return this.innerExtract(t,n)}}const O_=new RegExp(`(?:(?:within|in|for)\\s*)?(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Gn})(?=\\W|$)`,"i"),R_=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Gn})(?=\\W|$)`,"i"),N_=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${ki})(?=\\W|$)`,"i");class M_ extends ke{strictMode;constructor(t){super(),this.strictMode=t}innerPattern(t){return this.strictMode?N_:t.option.forwardDate?O_:R_}innerExtract(t,n){if(n[0].match(/^for\s*the\s*\w+/))return null;const r=vn(n[1]);return r?Te.createRelativeFromReference(t.reference,r):null}}const I_=new RegExp(`(?:on\\s{0,3})?(${wi})(?:\\s{0,3}(?:to|\\-|\\–|until|through|till)?\\s{0,3}(${wi}))?(?:-|/|\\s{0,3}(?:of)?\\s{0,3})(${Et(Vt)})(?:(?:-|/|,?\\s{0,3})(${vi}(?!\\w)))?(?=\\W|$)`,"i"),Zc=1,Jc=2,L_=3,Xc=4;class F_ extends ke{innerPattern(){return I_}innerExtract(t,n){const r=t.createParsingResult(n.index,n[0]),i=Vt[n[L_].toLowerCase()],s=_i(n[Zc]);if(s>31)return n.index=n.index+n[Zc].length,null;if(r.start.assign("month",i),r.start.assign("day",s),n[Xc]){const a=Ti(n[Xc]);r.start.assign("year",a)}else{const a=yi(t.refDate,s,i);r.start.imply("year",a)}if(n[Jc]){const a=_i(n[Jc]);r.end=r.start.clone(),r.end.assign("day",a)}return r}}const j_=new RegExp(`(${Et(Vt)})(?:-|/|\\s*,?\\s*)(${wi})(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(${wi})\\s*)?(?:(?:-|/|\\s*,\\s*|\\s+)(${vi}))?(?=\\W|$)(?!\\:\\d)`,"i"),z_=1,Qc=2,va=3,Ta=4;class U_ extends ke{shouldSkipYearLikeDate;constructor(t){super(),this.shouldSkipYearLikeDate=t}innerPattern(){return j_}innerExtract(t,n){const r=Vt[n[z_].toLowerCase()],i=_i(n[Qc]);if(i>31||this.shouldSkipYearLikeDate&&!n[va]&&!n[Ta]&&n[Qc].match(/^2[0-5]$/))return null;const s=t.createParsingComponents({day:i,month:r}).addTag("parser/ENMonthNameMiddleEndianParser");if(n[Ta]){const l=Ti(n[Ta]);s.assign("year",l)}else{const l=yi(t.refDate,i,r);s.imply("year",l)}if(!n[va])return s;const a=_i(n[va]),o=t.createParsingResult(n.index,n[0]);return o.start=s,o.end=s.clone(),o.end.assign("day",a),o}}const q_=new RegExp(`((?:in)\\s*)?(${Et(Vt)})\\s*(?:(?:,|-|of)?\\s*(${vi})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),H_=1,B_=2,ef=3;class V_ extends ke{innerPattern(){return q_}innerExtract(t,n){const r=n[B_].toLowerCase();if(n[0].length<=3&&!Bc[r])return null;const i=t.createParsingResult(n.index+(n[H_]||"").length,n.index+n[0].length);i.start.imply("day",1),i.start.addTag("parser/ENMonthNameParser");const s=Vt[r];if(i.start.assign("month",s),n[ef]){const a=Ti(n[ef]);i.start.assign("year",a)}else{const a=yi(t.refDate,1,s);i.start.imply("year",a)}return i}}const W_=new RegExp(`([0-9]{4})[-\\.\\/\\s](?:(${Et(Vt)})|([0-9]{1,2}))[-\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),Y_=1,G_=2,tf=3,K_=4;class Z_ extends ke{strictMonthDateOrder;constructor(t){super(),this.strictMonthDateOrder=t}innerPattern(){return W_}innerExtract(t,n){const r=parseInt(n[Y_]);let i=parseInt(n[K_]),s=n[tf]?parseInt(n[tf]):Vt[n[G_].toLowerCase()];if(s<1||s>12){if(this.strictMonthDateOrder)return null;i>=1&&i<=12&&([s,i]=[i,s])}return i<1||i>31?null:{day:i,month:s,year:r}}}const J_=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),X_=1,Q_=2;class ev extends ke{innerPattern(){return J_}innerExtract(t,n){const r=parseInt(n[Q_]),i=parseInt(n[X_]);return t.createParsingComponents().imply("day",1).assign("month",i).assign("year",r)}}function tv(e,t,n,r){return new RegExp(`${e}${t}(\\d{1,4})(?:(?:\\.|:|:)(\\d{1,2})(?:(?::|:)(\\d{2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${n}`,r)}function nv(e,t){return new RegExp(`^(${e})(\\d{1,4})(?:(?:\\.|\\:|\\:)(\\d{1,2})(?:(?:\\.|\\:|\\:)(\\d{1,2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${t}`,"i")}const ka=2,rn=3,Ei=4,Si=5,Tn=6;class rv{strictMode;constructor(t=!1){this.strictMode=t}patternFlags(){return"i"}primaryPatternLeftBoundary(){return"(^|\\s|T|\\b)"}primarySuffix(){return"(?!/)(?=\\W|$)"}followingSuffix(){return"(?!/)(?=\\W|$)"}pattern(t){return this.getPrimaryTimePatternThroughCache()}extract(t,n){const r=this.extractPrimaryTimeComponents(t,n);if(!r)return n[0].match(/^\d{4}/)?(n.index+=4,null):(n.index+=n[0].length,null);const i=n.index+n[1].length,s=n[0].substring(n[1].length),a=t.createParsingResult(i,s,r);n.index+=n[0].length;const o=t.text.substring(n.index),u=this.getFollowingTimePatternThroughCache().exec(o);return s.match(/^\d{3,4}/)&&u&&(u[0].match(/^\s*([+-])\s*\d{2,4}$/)||u[0].match(/^\s*([+-])\s*\d{2}\W\d{2}/))?null:!u||u[0].match(/^\s*([+-])\s*\d{3,4}$/)?this.checkAndReturnWithoutFollowingPattern(a):(a.end=this.extractFollowingTimeComponents(t,u,a),a.end&&(a.text+=u[0]),this.checkAndReturnWithFollowingPattern(a))}extractPrimaryTimeComponents(t,n,r=!1){const i=t.createParsingComponents();let s=0,a=null,o=parseInt(n[ka]);if(o>100){if(n[ka].length==4&&n[rn]==null&&!n[Tn]||this.strictMode||n[rn]!=null)return null;s=o%100,o=Math.floor(o/100)}if(o>24)return null;if(n[rn]!=null){if(n[rn].length==1&&!n[Tn])return null;s=parseInt(n[rn])}if(s>=60)return null;if(o>12&&(a=ye.PM),n[Tn]!=null){if(o>12)return null;const l=n[Tn][0].toLowerCase();l=="a"&&(a=ye.AM,o==12&&(o=0)),l=="p"&&(a=ye.PM,o!=12&&(o+=12))}if(i.assign("hour",o),i.assign("minute",s),a!==null?i.assign("meridiem",a):o<12?i.imply("meridiem",ye.AM):i.imply("meridiem",ye.PM),n[Si]!=null){const l=parseInt(n[Si].substring(0,3));if(l>=1e3)return null;i.assign("millisecond",l)}if(n[Ei]!=null){const l=parseInt(n[Ei]);if(l>=60)return null;i.assign("second",l)}return i}extractFollowingTimeComponents(t,n,r){const i=t.createParsingComponents();if(n[Si]!=null){const l=parseInt(n[Si].substring(0,3));if(l>=1e3)return null;i.assign("millisecond",l)}if(n[Ei]!=null){const l=parseInt(n[Ei]);if(l>=60)return null;i.assign("second",l)}let s=parseInt(n[ka]),a=0,o=-1;if(n[rn]!=null?a=parseInt(n[rn]):s>100&&(a=s%100,s=Math.floor(s/100)),a>=60||s>24)return null;if(s>=12&&(o=ye.PM),n[Tn]!=null){if(s>12)return null;const l=n[Tn][0].toLowerCase();l=="a"&&(o=ye.AM,s==12&&(s=0,i.isCertain("day")||i.imply("day",i.get("day")+1))),l=="p"&&(o=ye.PM,s!=12&&(s+=12)),r.start.isCertain("meridiem")||(o==ye.AM?(r.start.imply("meridiem",ye.AM),r.start.get("hour")==12&&r.start.assign("hour",0)):(r.start.imply("meridiem",ye.PM),r.start.get("hour")!=12&&r.start.assign("hour",r.start.get("hour")+12)))}return i.assign("hour",s),i.assign("minute",a),o>=0?i.assign("meridiem",o):r.start.isCertain("meridiem")&&r.start.get("hour")>12?r.start.get("hour")-12>s?i.imply("meridiem",ye.AM):s<=12&&(i.assign("hour",s+12),i.assign("meridiem",ye.PM)):s>12?i.imply("meridiem",ye.PM):s<=12&&i.imply("meridiem",ye.AM),i.date().getTime()<r.start.date().getTime()&&i.imply("day",i.get("day")+1),i}checkAndReturnWithoutFollowingPattern(t){if(t.text.match(/^\d$/)||t.text.match(/^\d\d\d+$/)||t.text.match(/\d[apAP]$/))return null;const n=t.text.match(/[^\d:.](\d[\d.]+)$/);if(n){const r=n[1];if(this.strictMode||r.includes(".")&&!r.match(/\d(\.\d{2})+$/)||parseInt(r)>24)return null}return t}checkAndReturnWithFollowingPattern(t){if(t.text.match(/^\d+-\d+$/))return null;const n=t.text.match(/[^\d:.](\d[\d.]+)\s*-\s*(\d[\d.]+)$/);if(n){if(this.strictMode)return null;const r=n[1],i=n[2];if(i.includes(".")&&!i.match(/\d(\.\d{2})+$/))return null;const s=parseInt(i),a=parseInt(r);if(s>24||a>24)return null}return t}cachedPrimaryPrefix=null;cachedPrimarySuffix=null;cachedPrimaryTimePattern=null;getPrimaryTimePatternThroughCache(){const t=this.primaryPrefix(),n=this.primarySuffix();return this.cachedPrimaryPrefix===t&&this.cachedPrimarySuffix===n?this.cachedPrimaryTimePattern:(this.cachedPrimaryTimePattern=tv(this.primaryPatternLeftBoundary(),t,n,this.patternFlags()),this.cachedPrimaryPrefix=t,this.cachedPrimarySuffix=n,this.cachedPrimaryTimePattern)}cachedFollowingPhase=null;cachedFollowingSuffix=null;cachedFollowingTimePatten=null;getFollowingTimePatternThroughCache(){const t=this.followingPhase(),n=this.followingSuffix();return this.cachedFollowingPhase===t&&this.cachedFollowingSuffix===n?this.cachedFollowingTimePatten:(this.cachedFollowingTimePatten=nv(t,n),this.cachedFollowingPhase=t,this.cachedFollowingSuffix=n,this.cachedFollowingTimePatten)}}class iv extends rv{constructor(t){super(t)}followingPhase(){return"\\s*(?:\\-|\\–|\\~|\\〜|to|until|through|till|\\?)\\s*"}primaryPrefix(){return"(?:(?:at|from)\\s*)??"}primarySuffix(){return"(?:\\s*(?:o\\W*clock|at\\s*night|in\\s*the\\s*(?:morning|afternoon)))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(t,n){const r=super.extractPrimaryTimeComponents(t,n);if(!r)return r;if(n[0].endsWith("night")){const i=r.get("hour");i>=6&&i<12?(r.assign("hour",r.get("hour")+12),r.assign("meridiem",ye.PM)):i<6&&r.assign("meridiem",ye.AM)}if(n[0].endsWith("afternoon")){r.assign("meridiem",ye.PM);const i=r.get("hour");i>=0&&i<=6&&r.assign("hour",r.get("hour")+12)}return n[0].endsWith("morning")&&(r.assign("meridiem",ye.AM),r.get("hour")<12&&r.assign("hour",r.get("hour"))),r.addTag("parser/ENTimeExpressionParser")}extractFollowingTimeComponents(t,n,r){const i=super.extractFollowingTimeComponents(t,n,r);return i&&i.addTag("parser/ENTimeExpressionParser"),i}}const sv=new RegExp(`(${Gn})\\s{0,5}(?:ago|before|earlier)(?=\\W|$)`,"i"),av=new RegExp(`(${ki})\\s{0,5}(?:ago|before|earlier)(?=\\W|$)`,"i");class ov extends ke{strictMode;constructor(t){super(),this.strictMode=t}innerPattern(){return this.strictMode?av:sv}innerExtract(t,n){const r=vn(n[1]);return r?Te.createRelativeFromReference(t.reference,gi(r)):null}}const lv=new RegExp(`(${Gn})\\s{0,5}(?:later|after|from now|henceforth|forward|out)(?=(?:\\W|$))`,"i"),uv=new RegExp(`(${ki})\\s{0,5}(later|after|from now)(?=\\W|$)`,"i"),cv=1;class fv extends ke{strictMode;constructor(t){super(),this.strictMode=t}innerPattern(){return this.strictMode?uv:lv}innerExtract(t,n){const r=vn(n[cv]);return r?Te.createRelativeFromReference(t.reference,r):null}}class nf{refine(t,n){return n.filter(r=>this.isValid(t,r))}}class Kn{refine(t,n){if(n.length<2)return n;const r=[];let i=n[0],s=null;for(let a=1;a<n.length;a++){s=n[a];const o=t.text.substring(i.index+i.text.length,s.index);if(!this.shouldMergeResults(o,i,s,t))r.push(i),i=s;else{const l=i,u=s,c=this.mergeResults(o,l,u,t);t.debug(()=>{console.log(`${this.constructor.name} merged ${l} and ${u} into ${c}`)}),i=c}}return i!=null&&r.push(i),r}}class rf extends Kn{shouldMergeResults(t,n,r){return!n.end&&!r.end&&t.match(this.patternBetween())!=null}mergeResults(t,n,r){if(!n.start.isOnlyWeekdayComponent()&&!r.start.isOnlyWeekdayComponent()&&(r.start.getCertainComponents().forEach(s=>{n.start.isCertain(s)||n.start.imply(s,r.start.get(s))}),n.start.getCertainComponents().forEach(s=>{r.start.isCertain(s)||r.start.imply(s,n.start.get(s))})),n.start.date()>r.start.date()){let s=n.start.date(),a=r.start.date();r.start.isOnlyWeekdayComponent()&&Le(a,{day:7})>s?(a=Le(a,{day:7}),r.start.imply("day",a.getDate()),r.start.imply("month",a.getMonth()+1),r.start.imply("year",a.getFullYear())):n.start.isOnlyWeekdayComponent()&&Le(s,{day:-7})<a?(s=Le(s,{day:-7}),n.start.imply("day",s.getDate()),n.start.imply("month",s.getMonth()+1),n.start.imply("year",s.getFullYear())):r.start.isDateWithUnknownYear()&&Le(a,{year:1})>s?(a=Le(a,{year:1}),r.start.imply("year",a.getFullYear())):n.start.isDateWithUnknownYear()&&Le(s,{year:-1})<a?(s=Le(s,{year:-1}),n.start.imply("year",s.getFullYear())):[r,n]=[n,r]}const i=n.clone();return i.start=n.start,i.end=r.start,i.index=Math.min(n.index,r.index),n.index<r.index?i.text=n.text+t+r.text:i.text=r.text+t+n.text,i}}class dv extends rf{patternBetween(){return/^\s*(to|-|–|until|through|till)\s*$/i}}function sf(e,t){const n=e.clone(),r=e.start,i=t.start;if(n.start=af(r,i),e.end!=null||t.end!=null){const s=e.end==null?e.start:e.end,a=t.end==null?t.start:t.end,o=af(s,a);if(e.end==null&&o.date().getTime()<n.start.date().getTime()){const l=new Date(o.date().getTime());l.setDate(l.getDate()+1),o.isCertain("day")?tn(o,l):wn(o,l)}n.end=o}return n}function af(e,t){const n=e.clone();return t.isCertain("hour")?(n.assign("hour",t.get("hour")),n.assign("minute",t.get("minute")),t.isCertain("second")?(n.assign("second",t.get("second")),t.isCertain("millisecond")?n.assign("millisecond",t.get("millisecond")):n.imply("millisecond",t.get("millisecond"))):(n.imply("second",t.get("second")),n.imply("millisecond",t.get("millisecond")))):(n.imply("hour",t.get("hour")),n.imply("minute",t.get("minute")),n.imply("second",t.get("second")),n.imply("millisecond",t.get("millisecond"))),t.isCertain("timezoneOffset")&&n.assign("timezoneOffset",t.get("timezoneOffset")),t.isCertain("meridiem")?n.assign("meridiem",t.get("meridiem")):t.get("meridiem")!=null&&n.get("meridiem")==null&&n.imply("meridiem",t.get("meridiem")),n.get("meridiem")==ye.PM&&n.get("hour")<12&&(t.isCertain("hour")?n.assign("hour",n.get("hour")+12):n.imply("hour",n.get("hour")+12)),n.addTags(e.tags()),n.addTags(t.tags()),n}class of extends Kn{shouldMergeResults(t,n,r){return(n.start.isOnlyDate()&&r.start.isOnlyTime()||r.start.isOnlyDate()&&n.start.isOnlyTime())&&t.match(this.patternBetween())!=null}mergeResults(t,n,r){const i=n.start.isOnlyDate()?sf(n,r):sf(r,n);return i.index=n.index,i.text=n.text+t+r.text,i}}class lf extends of{patternBetween(){return new RegExp("^\\s*(T|at|after|before|on|of|,|-|\\.|∙|:)?\\s*$")}}const hv=new RegExp("^\\s*,?\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)","i");class pv{timezoneOverrides;constructor(t){this.timezoneOverrides=t}refine(t,n){const r=t.option.timezones??{};return n.forEach(i=>{const s=t.text.substring(i.index+i.text.length),a=hv.exec(s);if(!a)return;const o=a[1].toUpperCase(),l=i.start.date()??i.refDate??new Date,u={...this.timezoneOverrides,...r},c=Uc(o,l,u);if(c==null)return;t.debug(()=>{console.log(`Extracting timezone: '${o}' into: ${c} for: ${i.start}`)});const f=i.start.get("timezoneOffset");f!==null&&c!=f&&(i.start.isCertain("timezoneOffset")||o!=a[1])||i.start.isOnlyDate()&&o!=a[1]||(i.text+=a[0],i.start.isCertain("timezoneOffset")||i.start.assign("timezoneOffset",c),i.end!=null&&!i.end.isCertain("timezoneOffset")&&i.end.assign("timezoneOffset",c))}),n}}const mv=new RegExp("^\\s*(?:\\(?(?:GMT|UTC)\\s?)?([+-])(\\d{1,2})(?::?(\\d{2}))?\\)?","i"),gv=1,yv=2,bv=3;class uf{refine(t,n){return n.forEach(function(r){if(r.start.isCertain("timezoneOffset"))return;const i=t.text.substring(r.index+r.text.length),s=mv.exec(i);if(!s)return;t.debug(()=>{console.log(`Extracting timezone: '${s[0]}' into : ${r}`)});const a=parseInt(s[yv]),o=parseInt(s[bv]||"0");let l=a*60+o;l>840||(s[gv]==="-"&&(l=-l),r.end!=null&&r.end.assign("timezoneOffset",l),r.start.assign("timezoneOffset",l),r.text+=s[0])}),n}}class Ea{refine(t,n){if(n.length<2)return n;const r=[];let i=n[0];for(let s=1;s<n.length;s++){const a=n[s];if(a.index>=i.index+i.text.length){r.push(i),i=a;continue}let o=null,l=null;a.text.length>i.text.length?(o=a,l=i):(o=i,l=a),t.debug(()=>{console.log(`${this.constructor.name} remove ${l} by ${o}`)}),i=o}return i!=null&&r.push(i),r}}class wv{refine(t,n){return t.option.forwardDate&&n.forEach(r=>{let i=t.reference.getDateWithAdjustedTimezone();if(r.start.isOnlyTime()&&t.reference.instant>r.start.date()){const s=t.reference.getDateWithAdjustedTimezone(),a=new Date(s);a.setDate(a.getDate()+1),wn(r.start,a),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} time from the ref date (${s}) to the following day (${a})`)}),r.end&&r.end.isOnlyTime()&&(wn(r.end,a),r.start.date()>r.end.date()&&(a.setDate(a.getDate()+1),wn(r.end,a)))}if(r.start.isOnlyWeekdayComponent()&&i>r.start.date()){let s=r.start.get("weekday")-i.getDay();if(s<=0&&(s+=7),i=Le(i,{day:s}),wn(r.start,i),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} weekday (${r.start})`)}),r.end&&r.end.isOnlyWeekdayComponent()){let a=r.end.get("weekday")-i.getDay();a<=0&&(a+=7),i=Le(i,{day:a}),wn(r.end,i),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} weekday (${r.end})`)})}}if(r.start.isDateWithUnknownYear()&&i>r.start.date())for(let s=0;s<3&&i>r.start.date();s++)r.start.imply("year",r.start.get("year")+1),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} year (${r.start})`)}),r.end&&!r.end.isCertain("year")&&(r.end.imply("year",r.end.get("year")+1),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} month (${r.start})`)}))}),n}}class _v extends nf{strictMode;constructor(t){super(),this.strictMode=t}isValid(t,n){return n.text.replace(" ","").match(/^\d*(\.\d*)?$/)?(t.debug(()=>{console.log(`Removing unlikely result '${n.text}'`)}),!1):n.start.isValidDate()?n.end&&!n.end.isValidDate()?(t.debug(()=>{console.log(`Removing invalid result: ${n} (${n.end})`)}),!1):this.strictMode?this.isStrictModeValid(t,n):!0:(t.debug(()=>{console.log(`Removing invalid result: ${n} (${n.start})`)}),!1)}isStrictModeValid(t,n){return n.start.isOnlyWeekdayComponent()?(t.debug(()=>{console.log(`(Strict) Removing weekday only component: ${n} (${n.end})`)}),!1):!0}}const vv=new RegExp("([0-9]{4})\\-([0-9]{1,2})\\-([0-9]{1,2})(?:T([0-9]{1,2}):([0-9]{1,2})(?::([0-9]{1,2})(?:\\.(\\d{1,4}))?)?(Z|([+-]\\d{2}):?(\\d{2})?)?)?(?=\\W|$)","i"),Tv=1,kv=2,Ev=3,cf=4,Sv=5,ff=6,df=7,xv=8,hf=9,pf=10;class Pv extends ke{innerPattern(){return vv}innerExtract(t,n){const r=t.createParsingComponents({year:parseInt(n[Tv]),month:parseInt(n[kv]),day:parseInt(n[Ev])});if(n[cf]!=null&&(r.assign("hour",parseInt(n[cf])),r.assign("minute",parseInt(n[Sv])),n[ff]!=null&&r.assign("second",parseInt(n[ff])),n[df]!=null&&r.assign("millisecond",parseInt(n[df])),n[xv]!=null)){let i=0;if(n[hf]){const s=parseInt(n[hf]);let a=0;n[pf]!=null&&(a=parseInt(n[pf])),i=s*60,i<0?i-=a:i+=a}r.assign("timezoneOffset",i)}return r.addTag("parser/ISOFormatParser")}}class Av extends Kn{mergeResults(t,n,r){const i=r.clone();return i.index=n.index,i.text=n.text+t+i.text,i.start.assign("weekday",n.start.get("weekday")),i.end&&i.end.assign("weekday",n.start.get("weekday")),i}shouldMergeResults(t,n,r){return n.start.isOnlyWeekdayComponent()&&!n.start.isCertain("hour")&&r.start.isCertain("day")&&t.match(/^,?\s*$/)!=null}}function mf(e,t=!1){return e.parsers.unshift(new Pv),e.refiners.unshift(new Av),e.refiners.unshift(new uf),e.refiners.unshift(new Ea),e.refiners.push(new pv),e.refiners.push(new Ea),e.refiners.push(new wv),e.refiners.push(new _v(t)),e}function Dv(e){const t=e.getDateWithAdjustedTimezone(),n=new Te(e,{});return tn(n,t),jc(n,t),n.assign("timezoneOffset",e.getTimezoneOffset()),n.addTag("casualReference/now"),n}function $v(e){const t=e.getDateWithAdjustedTimezone(),n=new Te(e,{});return tn(n,t),ya(n,t),n.delete("meridiem"),n.addTag("casualReference/today"),n}function Cv(e){return Rv(e).addTag("casualReference/yesterday")}function Ov(e){return Sa(e,1).addTag("casualReference/tomorrow")}function Rv(e,t){return Sa(e,-1)}function Sa(e,t){const n=e.getDateWithAdjustedTimezone(),r=new Te(e,{}),i=new Date(n.getTime());return i.setDate(i.getDate()+t),tn(r,i),ya(r,i),r.delete("meridiem"),r}function Nv(e,t=22){const n=e.getDateWithAdjustedTimezone(),r=new Te(e,{});return tn(r,n),r.imply("hour",t),r.imply("meridiem",ye.PM),r.addTag("casualReference/tonight"),r}function Mv(e,t=20){const n=new Te(e,{});return n.imply("meridiem",ye.PM),n.imply("hour",t),n.addTag("casualReference/evening"),n}function Iv(e){const t=new Te(e,{});return e.getDateWithAdjustedTimezone().getHours()>2&&t.addDurationAsImplied({day:1}),t.assign("hour",0),t.imply("minute",0),t.imply("second",0),t.imply("millisecond",0),t.addTag("casualReference/midnight"),t}function Lv(e,t=6){const n=new Te(e,{});return n.imply("meridiem",ye.AM),n.imply("hour",t),n.imply("minute",0),n.imply("second",0),n.imply("millisecond",0),n.addTag("casualReference/morning"),n}function Fv(e,t=15){const n=new Te(e,{});return n.imply("meridiem",ye.PM),n.imply("hour",t),n.imply("minute",0),n.imply("second",0),n.imply("millisecond",0),n.addTag("casualReference/afternoon"),n}function jv(e){const t=new Te(e,{});return t.imply("meridiem",ye.AM),t.assign("hour",12),t.imply("minute",0),t.imply("second",0),t.imply("millisecond",0),t.addTag("casualReference/noon"),t}const zv=/(now|today|tonight|tomorrow|overmorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i;class Uv extends ke{innerPattern(t){return zv}innerExtract(t,n){let r=t.refDate;const i=n[0].toLowerCase();let s=t.createParsingComponents();switch(i){case"now":s=Dv(t.reference);break;case"today":s=$v(t.reference);break;case"yesterday":s=Cv(t.reference);break;case"tomorrow":case"tmr":case"tmrw":s=Ov(t.reference);break;case"tonight":s=Nv(t.reference);break;case"overmorrow":s=Sa(t.reference,2);break;default:if(i.match(/last\s*night/)){if(r.getHours()>6){const a=new Date(r.getTime());a.setDate(a.getDate()-1),r=a}tn(s,r),s.imply("hour",0)}break}return s.addTag("parser/ENCasualDateParser"),s}}const qv=/(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|midday|noon)(?=\W|$)/i;class Hv extends ke{innerPattern(){return qv}innerExtract(t,n){let r=null;switch(n[1].toLowerCase()){case"afternoon":r=Fv(t.reference);break;case"evening":case"night":r=Mv(t.reference);break;case"midnight":r=Iv(t.reference);break;case"morning":r=Lv(t.reference);break;case"noon":case"midday":r=jv(t.reference);break}return r&&r.addTag("parser/ENCasualTimeParser"),r}}function Bv(e,t,n){const r=e.getDateWithAdjustedTimezone(),i=Vv(r,t,n);let s=new Te(e);return s=s.addDurationAsImplied({day:i}),s.assign("weekday",t),s}function Vv(e,t,n){const r=e.getDay();switch(n){case"this":return xi(e,t);case"last":return gf(e,t);case"next":return r==Ee.SUNDAY?t==Ee.SUNDAY?7:t:r==Ee.SATURDAY?t==Ee.SATURDAY?7:t==Ee.SUNDAY?8:1+t:t<r&&t!=Ee.SUNDAY?xi(e,t):xi(e,t)+7}return Wv(e,t)}function Wv(e,t){const n=gf(e,t),r=xi(e,t);return r<-n?r:n}function xi(e,t){const n=e.getDay();let r=t-n;return r<0&&(r+=7),r}function gf(e,t){const n=e.getDay();let r=t-n;return r>=0&&(r-=7),r}const Yv=new RegExp(`(?:(?:\\,|\\(|\\()\\s*)?(?:on\\s*?)?(?:(this|last|past|next)\\s*)?(${Et(ba)}|weekend|weekday)(?:\\s*(?:\\,|\\)|\\)))?(?:\\s*(this|last|past|next)\\s*week)?(?=\\W|$)`,"i"),Gv=1,Kv=2,Zv=3;class Jv extends ke{innerPattern(){return Yv}innerExtract(t,n){const r=n[Gv],i=n[Zv];let s=r||i;s=s||"",s=s.toLowerCase();let a=null;s=="last"||s=="past"?a="last":s=="next"?a="next":s=="this"&&(a="this");const o=n[Kv].toLowerCase();let l;if(ba[o]!==void 0)l=ba[o];else if(o=="weekend")l=a=="last"?Ee.SUNDAY:Ee.SATURDAY;else if(o=="weekday"){const u=t.reference.getDateWithAdjustedTimezone().getDay();u==Ee.SUNDAY||u==Ee.SATURDAY?l=a=="last"?Ee.FRIDAY:Ee.MONDAY:(l=u-1,l=a=="last"?l-1:l+1,l=l%5+1)}else return null;return Bv(t.reference,l,a)}}const Xv=new RegExp(`(this|last|past|next|after\\s*this)\\s*(${Et(bi)})(?=\\s*)(?=\\W|$)`,"i"),Qv=1,eT=2;class tT extends ke{innerPattern(){return Xv}innerExtract(t,n){const r=n[Qv].toLowerCase(),i=n[eT].toLowerCase(),s=bi[i];if(r=="next"||r.startsWith("after")){const l={};return l[s]=1,Te.createRelativeFromReference(t.reference,l)}if(r=="last"||r=="past"){const l={};return l[s]=-1,Te.createRelativeFromReference(t.reference,l)}const a=t.createParsingComponents();let o=new Date(t.reference.instant.getTime());return i.match(/week/i)?(o.setDate(o.getDate()-o.getDay()),a.imply("day",o.getDate()),a.imply("month",o.getMonth()+1),a.imply("year",o.getFullYear())):i.match(/month/i)?(o.setDate(1),a.imply("day",o.getDate()),a.assign("year",o.getFullYear()),a.assign("month",o.getMonth()+1)):i.match(/year/i)&&(o.setDate(1),o.setMonth(0),a.imply("day",o.getDate()),a.imply("month",o.getMonth()+1),a.assign("year",o.getFullYear())),a}}const nT=new RegExp("([^\\d]|^)([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})(?:[\\/\\.\\-]([0-9]{4}|[0-9]{2}))?(\\W|$)","i"),rT=1,iT=5,yf=2,bf=3,xa=4;class sT{groupNumberMonth;groupNumberDay;constructor(t){this.groupNumberMonth=t?bf:yf,this.groupNumberDay=t?yf:bf}pattern(){return nT}extract(t,n){const r=n.index+n[rT].length,i=n.index+n[0].length-n[iT].length;if(r>0&&t.text.substring(0,r).match("\\d/?$")||i<t.text.length&&t.text.substring(i).match("^/?\\d"))return;const s=t.text.substring(r,i);if(s.match(/^\d\.\d$/)||s.match(/^\d\.\d{1,2}\.\d{1,2}\s*$/)||!n[xa]&&s.indexOf("/")<0)return;const a=t.createParsingResult(r,s);let o=parseInt(n[this.groupNumberMonth]),l=parseInt(n[this.groupNumberDay]);if((o<1||o>12)&&o>12)if(l>=1&&l<=12&&o<=31)[l,o]=[o,l];else return null;if(l<1||l>31)return null;if(a.start.assign("day",l),a.start.assign("month",o),n[xa]){const u=parseInt(n[xa]),c=Hc(u);a.start.assign("year",c)}else{const u=yi(t.refDate,l,o);a.start.imply("year",u)}return a.addTag("parser/SlashDateFormatParser")}}const aT=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${Gn})(?=\\W|$)`,"i"),oT=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${ki})(?=\\W|$)`,"i");class lT extends ke{allowAbbreviations;constructor(t=!0){super(),this.allowAbbreviations=t}innerPattern(){return this.allowAbbreviations?aT:oT}innerExtract(t,n){const r=n[1].toLowerCase();let i=vn(n[2]);if(!i)return null;switch(r){case"last":case"past":case"-":i=gi(i);break}return Te.createRelativeFromReference(t.reference,i)}}function uT(e){return e.text.match(/^[+-]/i)!=null}function wf(e){return e.text.match(/^-/i)!=null}class cT extends Kn{shouldMergeResults(t,n,r){return t.match(/^\s*$/i)?uT(r)||wf(r):!1}mergeResults(t,n,r,i){let s=vn(r.text);wf(r)&&(s=gi(s));const a=Te.createRelativeFromReference(nn.fromDate(n.start.date()),s);return new _n(n.reference,n.index,`${n.text}${t}${r.text}`,a)}}function _f(e){return e.text.match(/\s+(before|from)$/i)!=null}function fT(e){return e.text.match(/\s+(after|since)$/i)!=null}class dT extends Kn{patternBetween(){return/^\s*$/i}shouldMergeResults(t,n,r){return!t.match(this.patternBetween())||!_f(n)&&!fT(n)?!1:!!r.start.get("day")&&!!r.start.get("month")&&!!r.start.get("year")}mergeResults(t,n,r){let i=vn(n.text);_f(n)&&(i=gi(i));const s=Te.createRelativeFromReference(nn.fromDate(r.start.date()),i);return new _n(r.reference,n.index,`${n.text}${t}${r.text}`,s)}}const hT=new RegExp(`^\\s*(${vi})`,"i"),pT=1;class mT{refine(t,n){return n.forEach(function(r){if(!r.start.isDateWithUnknownYear())return;const i=t.text.substring(r.index+r.text.length),s=hT.exec(i);if(!s||s[0].trim().length<=3)return;t.debug(()=>{console.log(`Extracting year: '${s[0]}' into : ${r}`)});const a=Ti(s[pT]);r.end!=null&&r.end.assign("year",a),r.start.assign("year",a),r.text+=s[0]}),n}}class gT extends nf{constructor(){super()}isValid(t,n){const r=n.text.trim();return r===t.text.trim()?!0:r.toLowerCase()==="may"&&!t.text.substring(0,n.index).trim().match(/\b(in)$/i)?(t.debug(()=>{console.log(`Removing unlikely result: ${n}`)}),!1):r.toLowerCase().endsWith("the second")?(t.text.substring(n.index+n.text.length).trim().length>0&&t.debug(()=>{console.log(`Removing unlikely result: ${n}`)}),!1):!0}}class yT{createCasualConfiguration(t=!1){const n=this.createConfiguration(!1,t);return n.parsers.push(new Uv),n.parsers.push(new Hv),n.parsers.push(new V_),n.parsers.push(new tT),n.parsers.push(new lT),n.refiners.push(new gT),n}createConfiguration(t=!0,n=!1){const r=mf({parsers:[new sT(n),new M_(t),new F_,new U_(n),new Jv,new ev,new iv(t),new ov(t),new fv(t)],refiners:[new lf]},t);return r.parsers.unshift(new Z_(t)),r.refiners.unshift(new dT),r.refiners.unshift(new cT),r.refiners.unshift(new Ea),r.refiners.push(new lf),r.refiners.push(new mT),r.refiners.push(new dv),r}}class Zn{parsers;refiners;defaultConfig=new yT;constructor(t){t=t||this.defaultConfig.createCasualConfiguration(),this.parsers=[...t.parsers],this.refiners=[...t.refiners]}clone(){return new Zn({parsers:[...this.parsers],refiners:[...this.refiners]})}parseDate(t,n,r){const i=this.parse(t,n,r);return i.length>0?i[0].start.date():null}parse(t,n,r){const i=new bT(t,n,r);let s=[];return this.parsers.forEach(a=>{const o=Zn.executeParser(i,a);s=s.concat(o)}),s.sort((a,o)=>a.index-o.index),this.refiners.forEach(function(a){s=a.refine(i,s)}),s}static executeParser(t,n){const r=[],i=n.pattern(t),s=t.text;let a=t.text,o=i.exec(a);for(;o;){const l=o.index+s.length-a.length;o.index=l;const u=n.extract(t,o);if(!u){a=s.substring(o.index+1),o=i.exec(a);continue}let c=null;u instanceof _n?c=u:u instanceof Te?(c=t.createParsingResult(o.index,o[0]),c.start=u):c=t.createParsingResult(o.index,o[0],u);const f=c.index,h=c.text;t.debug(()=>console.log(`${n.constructor.name} extracted (at index=${f}) '${h}'`)),r.push(c),a=s.substring(f+h.length),o=i.exec(a)}return r}}class bT{text;option;reference;refDate;constructor(t,n,r){this.text=t,this.option=r??{},this.reference=nn.fromInput(n,this.option.timezones),this.refDate=this.reference.instant}createParsingComponents(t){return t instanceof Te?t:new Te(this.reference,t)}createParsingResult(t,n,r,i){const s=typeof n=="string"?n:this.text.substring(t,n),a=r?this.createParsingComponents(r):null,o=i?this.createParsingComponents(i):null;return new _n(this.reference,t,s,a,o)}debug(t){this.option.debug&&(this.option.debug instanceof Function?this.option.debug(t):this.option.debug.debug(t))}}const Ke={零:0,"〇":0,一:1,二:2,两:2,三:3,四:4,五:5,六:6,七:7,八:8,九:9,十:10},Pi={天:0,日:0,一:1,二:2,三:3,四:4,五:5,六:6};function Nt(e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];r==="十"?t=t===0?Ke[r]:t*Ke[r]:t+=Ke[r]}return t}function wT(e){let t="";for(let n=0;n<e.length;n++){const r=e[n];t=t+Ke[r]}return parseInt(t)}const Pa=1,vf=2,Aa=3;class _T extends ke{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(Ke).join("")+"]{4}|["+Object.keys(Ke).join("")+"]{2})?(?:\\s*)(?:年)?(?:[\\s|,|,]*)(\\d{1,2}|["+Object.keys(Ke).join("")+"]{1,3})(?:\\s*)(?:月)(?:\\s*)(\\d{1,2}|["+Object.keys(Ke).join("")+"]{1,3})?(?:\\s*)(?:日|号)?")}innerExtract(t,n){const r=t.createParsingResult(n.index,n[0]);let i=parseInt(n[vf]);if(isNaN(i)&&(i=Nt(n[vf])),r.start.assign("month",i),n[Aa]){let s=parseInt(n[Aa]);isNaN(s)&&(s=Nt(n[Aa])),r.start.assign("day",s)}else r.start.imply("day",t.refDate.getDate());if(n[Pa]){let s=parseInt(n[Pa]);isNaN(s)&&(s=wT(n[Pa])),r.start.assign("year",s)}else r.start.imply("year",t.refDate.getFullYear());return r}}const vT=new RegExp("(\\d+|["+Object.keys(Ke).join("")+"]+|半|几)(?:\\s*)(?:个)?(秒(?:钟)?|分钟|小时|钟|日|天|星期|礼拜|月|年)(?:(?:之|过)?后|(?:之)?内)","i"),Da=1,TT=2;class kT extends ke{innerPattern(){return vT}innerExtract(t,n){const r=t.createParsingResult(n.index,n[0]);let i=parseInt(n[Da]);if(isNaN(i)&&(i=Nt(n[Da])),isNaN(i)){const u=n[Da];if(u==="几")i=3;else if(u==="半")i=.5;else return null}const s={},o=n[TT][0];if(o.match(/[日天星礼月年]/)){o=="日"||o=="天"?s.day=i:o=="星"||o=="礼"?s.week=i:o=="月"?s.month=i:o=="年"&&(s.year=i);const u=Le(t.refDate,s);return r.start.assign("year",u.getFullYear()),r.start.assign("month",u.getMonth()+1),r.start.assign("day",u.getDate()),r}o=="秒"?s.second=i:o=="分"?s.minute=i:(o=="小"||o=="钟")&&(s.hour=i);const l=Le(t.refDate,s);return r.start.imply("year",l.getFullYear()),r.start.imply("month",l.getMonth()+1),r.start.imply("day",l.getDate()),r.start.assign("hour",l.getHours()),r.start.assign("minute",l.getMinutes()),r.start.assign("second",l.getSeconds()),r}}const ET=new RegExp("(?<prefix>上|下|这)(?:个)?(?:星期|礼拜|周)(?<weekday>"+Object.keys(Pi).join("|")+")");class ST extends ke{innerPattern(){return ET}innerExtract(t,n){const r=t.createParsingResult(n.index,n[0]),i=n.groups.weekday,s=Pi[i];if(s===void 0)return null;let a=null;const o=n.groups.prefix;o=="上"?a="last":o=="下"?a="next":o=="这"&&(a="this");const l=new Date(t.refDate.getTime());let u=!1;const c=l.getDay();if(a=="last"||a=="past")l.setDate(l.getDate()+(s-7-c)),u=!0;else if(a=="next")l.setDate(l.getDate()+(s+7-c)),u=!0;else if(a=="this")l.setDate(l.getDate()+(s-c));else{let f=s-c;Math.abs(f-7)<Math.abs(f)&&(f-=7),Math.abs(f+7)<Math.abs(f)&&(f+=7),l.setDate(l.getDate()+f)}return r.start.assign("weekday",s),u?(r.start.assign("day",l.getDate()),r.start.assign("month",l.getMonth()+1),r.start.assign("year",l.getFullYear())):(r.start.imply("day",l.getDate()),r.start.imply("month",l.getMonth()+1),r.start.imply("year",l.getFullYear())),r}}const xT=new RegExp("(?:从|自)?(?:(今|明|前|大前|后|大后|昨)(早|朝|晚)|(上(?:午)|早(?:上)|下(?:午)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|(今|明|前|大前|后|大后|昨)(?:日|天)(?:[\\s,,]*)(?:(上(?:午)|早(?:上)|下(?:午)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?)?(?:[\\s,,]*)(?:(\\d+|["+Object.keys(Ke).join("")+"]+)(?:\\s*)(?:点|时|:|:)(?:\\s*)(\\d+|半|正|整|["+Object.keys(Ke).join("")+"]+)?(?:\\s*)(?:分|:|:)?(?:\\s*)(\\d+|["+Object.keys(Ke).join("")+"]+)?(?:\\s*)(?:秒)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),PT=new RegExp("(?:^\\s*(?:到|至|\\-|\\–|\\~|\\〜)\\s*)(?:(今|明|前|大前|后|大后|昨)(早|朝|晚)|(上(?:午)|早(?:上)|下(?:午)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|(今|明|前|大前|后|大后|昨)(?:日|天)(?:[\\s,,]*)(?:(上(?:午)|早(?:上)|下(?:午)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?)?(?:[\\s,,]*)(?:(\\d+|["+Object.keys(Ke).join("")+"]+)(?:\\s*)(?:点|时|:|:)(?:\\s*)(\\d+|半|正|整|["+Object.keys(Ke).join("")+"]+)?(?:\\s*)(?:分|:|:)?(?:\\s*)(\\d+|["+Object.keys(Ke).join("")+"]+)?(?:\\s*)(?:秒)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),Ai=1,Di=2,$i=3,Ci=4,Oi=5,Ri=6,ht=7,kn=8,Ni=9;class AT extends ke{innerPattern(){return xT}innerExtract(t,n){if(n.index>0&&t.text[n.index-1].match(/\w/))return null;const r=t.createParsingResult(n.index,n[0]),i=new Date(t.refDate.getTime());if(n[Ai]){const c=n[Ai];c=="明"?t.refDate.getHours()>1&&i.setDate(i.getDate()+1):c=="昨"?i.setDate(i.getDate()-1):c=="前"?i.setDate(i.getDate()-2):c=="大前"?i.setDate(i.getDate()-3):c=="后"?i.setDate(i.getDate()+2):c=="大后"&&i.setDate(i.getDate()+3),r.start.assign("day",i.getDate()),r.start.assign("month",i.getMonth()+1),r.start.assign("year",i.getFullYear())}else if(n[Ci]){const c=n[Ci];c=="明"?i.setDate(i.getDate()+1):c=="昨"?i.setDate(i.getDate()-1):c=="前"?i.setDate(i.getDate()-2):c=="大前"?i.setDate(i.getDate()-3):c=="后"?i.setDate(i.getDate()+2):c=="大后"&&i.setDate(i.getDate()+3),r.start.assign("day",i.getDate()),r.start.assign("month",i.getMonth()+1),r.start.assign("year",i.getFullYear())}else r.start.imply("day",i.getDate()),r.start.imply("month",i.getMonth()+1),r.start.imply("year",i.getFullYear());let s=0,a=0,o=-1;if(n[kn]){let c=parseInt(n[kn]);if(isNaN(c)&&(c=Nt(n[kn])),c>=60)return null;r.start.assign("second",c)}if(s=parseInt(n[Ri]),isNaN(s)&&(s=Nt(n[Ri])),n[ht]?n[ht]=="半"?a=30:n[ht]=="正"||n[ht]=="整"?a=0:(a=parseInt(n[ht]),isNaN(a)&&(a=Nt(n[ht]))):s>100&&(a=s%100,s=Math.floor(s/100)),a>=60||s>24)return null;if(s>=12&&(o=1),n[Ni]){if(s>12)return null;const c=n[Ni][0].toLowerCase();c=="a"&&(o=0,s==12&&(s=0)),c=="p"&&(o=1,s!=12&&(s+=12))}else if(n[Di]){const f=n[Di][0];f=="早"?(o=0,s==12&&(s=0)):f=="晚"&&(o=1,s!=12&&(s+=12))}else if(n[$i]){const f=n[$i][0];f=="上"||f=="早"||f=="凌"?(o=0,s==12&&(s=0)):(f=="下"||f=="晚")&&(o=1,s!=12&&(s+=12))}else if(n[Oi]){const f=n[Oi][0];f=="上"||f=="早"||f=="凌"?(o=0,s==12&&(s=0)):(f=="下"||f=="晚")&&(o=1,s!=12&&(s+=12))}r.start.assign("hour",s),r.start.assign("minute",a),o>=0?r.start.assign("meridiem",o):s<12?r.start.imply("meridiem",0):r.start.imply("meridiem",1);const l=PT.exec(t.text.substring(r.index+r.text.length));if(!l)return r.text.match(/^\d+$/)?null:r;const u=new Date(i.getTime());if(r.end=t.createParsingComponents(),l[Ai]){const c=l[Ai];c=="明"?t.refDate.getHours()>1&&u.setDate(u.getDate()+1):c=="昨"?u.setDate(u.getDate()-1):c=="前"?u.setDate(u.getDate()-2):c=="大前"?u.setDate(u.getDate()-3):c=="后"?u.setDate(u.getDate()+2):c=="大后"&&u.setDate(u.getDate()+3),r.end.assign("day",u.getDate()),r.end.assign("month",u.getMonth()+1),r.end.assign("year",u.getFullYear())}else if(l[Ci]){const c=l[Ci];c=="明"?u.setDate(u.getDate()+1):c=="昨"?u.setDate(u.getDate()-1):c=="前"?u.setDate(u.getDate()-2):c=="大前"?u.setDate(u.getDate()-3):c=="后"?u.setDate(u.getDate()+2):c=="大后"&&u.setDate(u.getDate()+3),r.end.assign("day",u.getDate()),r.end.assign("month",u.getMonth()+1),r.end.assign("year",u.getFullYear())}else r.end.imply("day",u.getDate()),r.end.imply("month",u.getMonth()+1),r.end.imply("year",u.getFullYear());if(s=0,a=0,o=-1,l[kn]){let c=parseInt(l[kn]);if(isNaN(c)&&(c=Nt(l[kn])),c>=60)return null;r.end.assign("second",c)}if(s=parseInt(l[Ri]),isNaN(s)&&(s=Nt(l[Ri])),l[ht]?l[ht]=="半"?a=30:l[ht]=="正"||l[ht]=="整"?a=0:(a=parseInt(l[ht]),isNaN(a)&&(a=Nt(l[ht]))):s>100&&(a=s%100,s=Math.floor(s/100)),a>=60||s>24)return null;if(s>=12&&(o=1),l[Ni]){if(s>12)return null;const c=l[Ni][0].toLowerCase();c=="a"&&(o=0,s==12&&(s=0)),c=="p"&&(o=1,s!=12&&(s+=12)),r.start.isCertain("meridiem")||(o==0?(r.start.imply("meridiem",0),r.start.get("hour")==12&&r.start.assign("hour",0)):(r.start.imply("meridiem",1),r.start.get("hour")!=12&&r.start.assign("hour",r.start.get("hour")+12)))}else if(l[Di]){const f=l[Di][0];f=="早"?(o=0,s==12&&(s=0)):f=="晚"&&(o=1,s!=12&&(s+=12))}else if(l[$i]){const f=l[$i][0];f=="上"||f=="早"||f=="凌"?(o=0,s==12&&(s=0)):(f=="下"||f=="晚")&&(o=1,s!=12&&(s+=12))}else if(l[Oi]){const f=l[Oi][0];f=="上"||f=="早"||f=="凌"?(o=0,s==12&&(s=0)):(f=="下"||f=="晚")&&(o=1,s!=12&&(s+=12))}return r.text=r.text+l[0],r.end.assign("hour",s),r.end.assign("minute",a),o>=0?r.end.assign("meridiem",o):r.start.isCertain("meridiem")&&r.start.get("meridiem")==1&&r.start.get("hour")>s?r.end.imply("meridiem",0):s>12&&r.end.imply("meridiem",1),r.end.date().getTime()<r.start.date().getTime()&&r.end.imply("day",r.end.get("day")+1),r}}const DT=new RegExp("(?:星期|礼拜|周)(?<weekday>"+Object.keys(Pi).join("|")+")");class $T extends ke{innerPattern(){return DT}innerExtract(t,n){const r=t.createParsingResult(n.index,n[0]),i=n.groups.weekday,s=Pi[i];if(s===void 0)return null;const a=new Date(t.refDate.getTime()),o=a.getDay();let l=s-o;return Math.abs(l-7)<Math.abs(l)&&(l-=7),Math.abs(l+7)<Math.abs(l)&&(l+=7),a.setDate(a.getDate()+l),r.start.assign("weekday",s),r.start.imply("day",a.getDate()),r.start.imply("month",a.getMonth()+1),r.start.imply("year",a.getFullYear()),r}}const CT=1,Tf=2,OT=3,kf=4,Ef=5,RT=6;class NT extends ke{innerPattern(t){return new RegExp("(而家|立(?:刻|即)|即刻)|(今|明|前|大前|後|大後|聽|昨|尋|琴)(早|朝|晚)|(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|(今|明|前|大前|後|大後|聽|昨|尋|琴)(?:日|天)(?:[\\s|,|,]*)(?:(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?","i")}innerExtract(t,n){const r=n.index,i=t.createParsingResult(r,n[0]),s=t.refDate;let a=new Date(s.getTime());if(n[CT])i.start.imply("hour",s.getHours()),i.start.imply("minute",s.getMinutes()),i.start.imply("second",s.getSeconds()),i.start.imply("millisecond",s.getMilliseconds());else if(n[Tf]){const o=n[Tf],l=n[OT];o=="明"||o=="聽"?s.getHours()>1&&a.setDate(a.getDate()+1):o=="昨"||o=="尋"||o=="琴"?a.setDate(a.getDate()-1):o=="前"?a.setDate(a.getDate()-2):o=="大前"?a.setDate(a.getDate()-3):o=="後"?a.setDate(a.getDate()+2):o=="大後"&&a.setDate(a.getDate()+3),l=="早"||l=="朝"?i.start.imply("hour",6):l=="晚"&&(i.start.imply("hour",22),i.start.imply("meridiem",1))}else if(n[kf]){const l=n[kf][0];l=="早"||l=="朝"||l=="上"?i.start.imply("hour",6):l=="下"||l=="晏"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):l=="中"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):l=="夜"||l=="晚"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):l=="凌"&&i.start.imply("hour",0)}else if(n[Ef]){const o=n[Ef];o=="明"||o=="聽"?s.getHours()>1&&a.setDate(a.getDate()+1):o=="昨"||o=="尋"||o=="琴"?a.setDate(a.getDate()-1):o=="前"?a.setDate(a.getDate()-2):o=="大前"?a.setDate(a.getDate()-3):o=="後"?a.setDate(a.getDate()+2):o=="大後"&&a.setDate(a.getDate()+3);const l=n[RT];if(l){const u=l[0];u=="早"||u=="朝"||u=="上"?i.start.imply("hour",6):u=="下"||u=="晏"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):u=="中"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):u=="夜"||u=="晚"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):u=="凌"&&i.start.imply("hour",0)}}return i.start.assign("day",a.getDate()),i.start.assign("month",a.getMonth()+1),i.start.assign("year",a.getFullYear()),i}}const Ze={零:0,一:1,二:2,兩:2,三:3,四:4,五:5,六:6,七:7,八:8,九:9,十:10,廿:20,卅:30},Mi={天:0,日:0,一:1,二:2,三:3,四:4,五:5,六:6};function Mt(e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];r==="十"?t=t===0?Ze[r]:t*Ze[r]:t+=Ze[r]}return t}function MT(e){let t="";for(let n=0;n<e.length;n++){const r=e[n];t=t+Ze[r]}return parseInt(t)}const $a=1,Sf=2,Ca=3;class IT extends ke{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(Ze).join("")+"]{4}|["+Object.keys(Ze).join("")+"]{2})?(?:\\s*)(?:年)?(?:[\\s|,|,]*)(\\d{1,2}|["+Object.keys(Ze).join("")+"]{1,2})(?:\\s*)(?:月)(?:\\s*)(\\d{1,2}|["+Object.keys(Ze).join("")+"]{1,2})?(?:\\s*)(?:日|號)?")}innerExtract(t,n){const r=t.createParsingResult(n.index,n[0]);let i=parseInt(n[Sf]);if(isNaN(i)&&(i=Mt(n[Sf])),r.start.assign("month",i),n[Ca]){let s=parseInt(n[Ca]);isNaN(s)&&(s=Mt(n[Ca])),r.start.assign("day",s)}else r.start.imply("day",t.refDate.getDate());if(n[$a]){let s=parseInt(n[$a]);isNaN(s)&&(s=MT(n[$a])),r.start.assign("year",s)}else r.start.imply("year",t.refDate.getFullYear());return r}}const LT=new RegExp("(\\d+|["+Object.keys(Ze).join("")+"]+|半|幾)(?:\\s*)(?:個)?(秒(?:鐘)?|分鐘|小時|鐘|日|天|星期|禮拜|月|年)(?:(?:之|過)?後|(?:之)?內)","i"),Oa=1,FT=2;class jT extends ke{innerPattern(){return LT}innerExtract(t,n){const r=t.createParsingResult(n.index,n[0]);let i=parseInt(n[Oa]);if(isNaN(i)&&(i=Mt(n[Oa])),isNaN(i)){const u=n[Oa];if(u==="幾")i=3;else if(u==="半")i=.5;else return null}const s={},o=n[FT][0];if(o.match(/[日天星禮月年]/)){o=="日"||o=="天"?s.day=i:o=="星"||o=="禮"?s.week=i:o=="月"?s.month=i:o=="年"&&(s.year=i);const u=Le(t.refDate,s);return r.start.assign("year",u.getFullYear()),r.start.assign("month",u.getMonth()+1),r.start.assign("day",u.getDate()),r}o=="秒"?s.second=i:o=="分"?s.minute=i:(o=="小"||o=="鐘")&&(s.hour=i);const l=Le(t.refDate,s);return r.start.imply("year",l.getFullYear()),r.start.imply("month",l.getMonth()+1),r.start.imply("day",l.getDate()),r.start.assign("hour",l.getHours()),r.start.assign("minute",l.getMinutes()),r.start.assign("second",l.getSeconds()),r}}const zT=new RegExp("(?<prefix>上|今|下|這|呢)(?:個)?(?:星期|禮拜|週)(?<weekday>"+Object.keys(Mi).join("|")+")");class UT extends ke{innerPattern(){return zT}innerExtract(t,n){const r=t.createParsingResult(n.index,n[0]),i=n.groups.weekday,s=Mi[i];if(s===void 0)return null;let a=null;const o=n.groups.prefix;o=="上"?a="last":o=="下"?a="next":(o=="今"||o=="這"||o=="呢")&&(a="this");const l=new Date(t.refDate.getTime());let u=!1;const c=l.getDay();if(a=="last"||a=="past")l.setDate(l.getDate()+(s-7-c)),u=!0;else if(a=="next")l.setDate(l.getDate()+(s+7-c)),u=!0;else if(a=="this")l.setDate(l.getDate()+(s-c));else{let f=s-c;Math.abs(f-7)<Math.abs(f)&&(f-=7),Math.abs(f+7)<Math.abs(f)&&(f+=7),l.setDate(l.getDate()+f)}return r.start.assign("weekday",s),u?(r.start.assign("day",l.getDate()),r.start.assign("month",l.getMonth()+1),r.start.assign("year",l.getFullYear())):(r.start.imply("day",l.getDate()),r.start.imply("month",l.getMonth()+1),r.start.imply("year",l.getFullYear())),r}}const qT=new RegExp("(?:由|從|自)?(?:(今|明|前|大前|後|大後|聽|昨|尋|琴)(早|朝|晚)|(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|(今|明|前|大前|後|大後|聽|昨|尋|琴)(?:日|天)(?:[\\s,,]*)(?:(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?)?(?:[\\s,,]*)(?:(\\d+|["+Object.keys(Ze).join("")+"]+)(?:\\s*)(?:點|時|:|:)(?:\\s*)(\\d+|半|正|整|["+Object.keys(Ze).join("")+"]+)?(?:\\s*)(?:分|:|:)?(?:\\s*)(\\d+|["+Object.keys(Ze).join("")+"]+)?(?:\\s*)(?:秒)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),HT=new RegExp("(?:^\\s*(?:到|至|\\-|\\–|\\~|\\〜)\\s*)(?:(今|明|前|大前|後|大後|聽|昨|尋|琴)(早|朝|晚)|(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|(今|明|前|大前|後|大後|聽|昨|尋|琴)(?:日|天)(?:[\\s,,]*)(?:(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?)?(?:[\\s,,]*)(?:(\\d+|["+Object.keys(Ze).join("")+"]+)(?:\\s*)(?:點|時|:|:)(?:\\s*)(\\d+|半|正|整|["+Object.keys(Ze).join("")+"]+)?(?:\\s*)(?:分|:|:)?(?:\\s*)(\\d+|["+Object.keys(Ze).join("")+"]+)?(?:\\s*)(?:秒)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),Ii=1,Li=2,Fi=3,ji=4,zi=5,Ui=6,pt=7,En=8,qi=9;class BT extends ke{innerPattern(){return qT}innerExtract(t,n){if(n.index>0&&t.text[n.index-1].match(/\w/))return null;const r=t.createParsingResult(n.index,n[0]),i=new Date(t.refDate.getTime());if(n[Ii]){const p=n[Ii];p=="明"||p=="聽"?t.refDate.getHours()>1&&i.setDate(i.getDate()+1):p=="昨"||p=="尋"||p=="琴"?i.setDate(i.getDate()-1):p=="前"?i.setDate(i.getDate()-2):p=="大前"?i.setDate(i.getDate()-3):p=="後"?i.setDate(i.getDate()+2):p=="大後"&&i.setDate(i.getDate()+3),r.start.assign("day",i.getDate()),r.start.assign("month",i.getMonth()+1),r.start.assign("year",i.getFullYear())}else if(n[ji]){const p=n[ji];p=="明"||p=="聽"?i.setDate(i.getDate()+1):p=="昨"||p=="尋"||p=="琴"?i.setDate(i.getDate()-1):p=="前"?i.setDate(i.getDate()-2):p=="大前"?i.setDate(i.getDate()-3):p=="後"?i.setDate(i.getDate()+2):p=="大後"&&i.setDate(i.getDate()+3),r.start.assign("day",i.getDate()),r.start.assign("month",i.getMonth()+1),r.start.assign("year",i.getFullYear())}else r.start.imply("day",i.getDate()),r.start.imply("month",i.getMonth()+1),r.start.imply("year",i.getFullYear());let s=0,a=0,o=-1;if(n[En]){var l=parseInt(n[En]);if(isNaN(l)&&(l=Mt(n[En])),l>=60)return null;r.start.assign("second",l)}if(s=parseInt(n[Ui]),isNaN(s)&&(s=Mt(n[Ui])),n[pt]?n[pt]=="半"?a=30:n[pt]=="正"||n[pt]=="整"?a=0:(a=parseInt(n[pt]),isNaN(a)&&(a=Mt(n[pt]))):s>100&&(a=s%100,s=Math.floor(s/100)),a>=60||s>24)return null;if(s>=12&&(o=1),n[qi]){if(s>12)return null;var u=n[qi][0].toLowerCase();u=="a"&&(o=0,s==12&&(s=0)),u=="p"&&(o=1,s!=12&&(s+=12))}else if(n[Li]){var c=n[Li],f=c[0];f=="朝"||f=="早"?(o=0,s==12&&(s=0)):f=="晚"&&(o=1,s!=12&&(s+=12))}else if(n[Fi]){var h=n[Fi],d=h[0];d=="上"||d=="朝"||d=="早"||d=="凌"?(o=0,s==12&&(s=0)):(d=="下"||d=="晏"||d=="晚")&&(o=1,s!=12&&(s+=12))}else if(n[zi]){var g=n[zi],T=g[0];T=="上"||T=="朝"||T=="早"||T=="凌"?(o=0,s==12&&(s=0)):(T=="下"||T=="晏"||T=="晚")&&(o=1,s!=12&&(s+=12))}r.start.assign("hour",s),r.start.assign("minute",a),o>=0?r.start.assign("meridiem",o):s<12?r.start.imply("meridiem",0):r.start.imply("meridiem",1);const y=HT.exec(t.text.substring(r.index+r.text.length));if(!y)return r.text.match(/^\d+$/)?null:r;const m=new Date(i.getTime());if(r.end=t.createParsingComponents(),y[Ii]){const p=y[Ii];p=="明"||p=="聽"?t.refDate.getHours()>1&&m.setDate(m.getDate()+1):p=="昨"||p=="尋"||p=="琴"?m.setDate(m.getDate()-1):p=="前"?m.setDate(m.getDate()-2):p=="大前"?m.setDate(m.getDate()-3):p=="後"?m.setDate(m.getDate()+2):p=="大後"&&m.setDate(m.getDate()+3),r.end.assign("day",m.getDate()),r.end.assign("month",m.getMonth()+1),r.end.assign("year",m.getFullYear())}else if(y[ji]){const p=y[ji];p=="明"||p=="聽"?m.setDate(m.getDate()+1):p=="昨"||p=="尋"||p=="琴"?m.setDate(m.getDate()-1):p=="前"?m.setDate(m.getDate()-2):p=="大前"?m.setDate(m.getDate()-3):p=="後"?m.setDate(m.getDate()+2):p=="大後"&&m.setDate(m.getDate()+3),r.end.assign("day",m.getDate()),r.end.assign("month",m.getMonth()+1),r.end.assign("year",m.getFullYear())}else r.end.imply("day",m.getDate()),r.end.imply("month",m.getMonth()+1),r.end.imply("year",m.getFullYear());if(s=0,a=0,o=-1,y[En]){let p=parseInt(y[En]);if(isNaN(p)&&(p=Mt(y[En])),p>=60)return null;r.end.assign("second",p)}if(s=parseInt(y[Ui]),isNaN(s)&&(s=Mt(y[Ui])),y[pt]?y[pt]=="半"?a=30:y[pt]=="正"||y[pt]=="整"?a=0:(a=parseInt(y[pt]),isNaN(a)&&(a=Mt(y[pt]))):s>100&&(a=s%100,s=Math.floor(s/100)),a>=60||s>24)return null;if(s>=12&&(o=1),y[qi]){if(s>12)return null;var u=y[qi][0].toLowerCase();u=="a"&&(o=0,s==12&&(s=0)),u=="p"&&(o=1,s!=12&&(s+=12)),r.start.isCertain("meridiem")||(o==0?(r.start.imply("meridiem",0),r.start.get("hour")==12&&r.start.assign("hour",0)):(r.start.imply("meridiem",1),r.start.get("hour")!=12&&r.start.assign("hour",r.start.get("hour")+12)))}else if(y[Li]){var f=y[Li][0];f=="朝"||f=="早"?(o=0,s==12&&(s=0)):f=="晚"&&(o=1,s!=12&&(s+=12))}else if(y[Fi]){var d=y[Fi][0];d=="上"||d=="朝"||d=="早"||d=="凌"?(o=0,s==12&&(s=0)):(d=="下"||d=="晏"||d=="晚")&&(o=1,s!=12&&(s+=12))}else if(y[zi]){var T=y[zi][0];T=="上"||T=="朝"||T=="早"||T=="凌"?(o=0,s==12&&(s=0)):(T=="下"||T=="晏"||T=="晚")&&(o=1,s!=12&&(s+=12))}return r.text=r.text+y[0],r.end.assign("hour",s),r.end.assign("minute",a),o>=0?r.end.assign("meridiem",o):r.start.isCertain("meridiem")&&r.start.get("meridiem")==1&&r.start.get("hour")>s?r.end.imply("meridiem",0):s>12&&r.end.imply("meridiem",1),r.end.date().getTime()<r.start.date().getTime()&&r.end.imply("day",r.end.get("day")+1),r}}const VT=new RegExp("(?:星期|禮拜|週)(?<weekday>"+Object.keys(Mi).join("|")+")");class WT extends ke{innerPattern(){return VT}innerExtract(t,n){const r=t.createParsingResult(n.index,n[0]),i=n.groups.weekday,s=Mi[i];if(s===void 0)return null;const a=new Date(t.refDate.getTime()),o=a.getDay();let l=s-o;return Math.abs(l-7)<Math.abs(l)&&(l-=7),Math.abs(l+7)<Math.abs(l)&&(l+=7),a.setDate(a.getDate()+l),r.start.assign("weekday",s),r.start.imply("day",a.getDate()),r.start.imply("month",a.getMonth()+1),r.start.imply("year",a.getFullYear()),r}}class YT extends rf{patternBetween(){return/^\s*(至|到|\-|\~|~|-|ー)\s*$/i}}class GT extends of{patternBetween(){return/^\s*$/i}}const KT=new Zn(JT());new Zn(xf());function ZT(e,t,n){return KT.parseDate(e,t,n)}function JT(){const e=xf();return e.parsers.unshift(new NT),e}function xf(){const e=mf({parsers:[new IT,new _T,new UT,new ST,new WT,new $T,new BT,new AT,new jT,new kT],refiners:[new YT,new GT]});return e.refiners=e.refiners.filter(t=>!(t instanceof uf)),e}var Hi={exports:{}},XT=Hi.exports,Pf;function QT(){return Pf||(Pf=1,(function(e,t){(function(n,r){e.exports=r()})(XT,(function(){var n=1e3,r=6e4,i=36e5,s="millisecond",a="second",o="minute",l="hour",u="day",c="week",f="month",h="quarter",d="year",g="date",T="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(H){var j=["th","st","nd","rd"],B=H%100;return"["+H+(j[(B-20)%10]||j[B]||j[0])+"]"}},b=function(H,j,B){var Z=String(H);return!Z||Z.length>=j?H:""+Array(j+1-Z.length).join(B)+H},S={s:b,z:function(H){var j=-H.utcOffset(),B=Math.abs(j),Z=Math.floor(B/60),q=B%60;return(j<=0?"+":"-")+b(Z,2,"0")+":"+b(q,2,"0")},m:function H(j,B){if(j.date()<B.date())return-H(B,j);var Z=12*(B.year()-j.year())+(B.month()-j.month()),q=j.clone().add(Z,f),ee=B-q<0,k=j.clone().add(Z+(ee?-1:1),f);return+(-(Z+(B-q)/(ee?q-k:k-q))||0)},a:function(H){return H<0?Math.ceil(H)||0:Math.floor(H)},p:function(H){return{M:f,y:d,w:c,d:u,D:g,h:l,m:o,s:a,ms:s,Q:h}[H]||String(H||"").toLowerCase().replace(/s$/,"")},u:function(H){return H===void 0}},v="en",w={};w[v]=p;var x="$isDayjsObject",N=function(H){return H instanceof U||!(!H||!H[x])},F=function H(j,B,Z){var q;if(!j)return v;if(typeof j=="string"){var ee=j.toLowerCase();w[ee]&&(q=ee),B&&(w[ee]=B,q=ee);var k=j.split("-");if(!q&&k.length>1)return H(k[0])}else{var D=j.name;w[D]=j,q=D}return!Z&&q&&(v=q),q||!Z&&v},A=function(H,j){if(N(H))return H.clone();var B=typeof j=="object"?j:{};return B.date=H,B.args=arguments,new U(B)},O=S;O.l=F,O.i=N,O.w=function(H,j){return A(H,{locale:j.$L,utc:j.$u,x:j.$x,$offset:j.$offset})};var U=(function(){function H(B){this.$L=F(B.locale,null,!0),this.parse(B),this.$x=this.$x||B.x||{},this[x]=!0}var j=H.prototype;return j.parse=function(B){this.$d=(function(Z){var q=Z.date,ee=Z.utc;if(q===null)return new Date(NaN);if(O.u(q))return new Date;if(q instanceof Date)return new Date(q);if(typeof q=="string"&&!/Z$/i.test(q)){var k=q.match(y);if(k){var D=k[2]-1||0,I=(k[7]||"0").substring(0,3);return ee?new Date(Date.UTC(k[1],D,k[3]||1,k[4]||0,k[5]||0,k[6]||0,I)):new Date(k[1],D,k[3]||1,k[4]||0,k[5]||0,k[6]||0,I)}}return new Date(q)})(B),this.init()},j.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},j.$utils=function(){return O},j.isValid=function(){return this.$d.toString()!==T},j.isSame=function(B,Z){var q=A(B);return this.startOf(Z)<=q&&q<=this.endOf(Z)},j.isAfter=function(B,Z){return A(B)<this.startOf(Z)},j.isBefore=function(B,Z){return this.endOf(Z)<A(B)},j.$g=function(B,Z,q){return O.u(B)?this[Z]:this.set(q,B)},j.unix=function(){return Math.floor(this.valueOf()/1e3)},j.valueOf=function(){return this.$d.getTime()},j.startOf=function(B,Z){var q=this,ee=!!O.u(Z)||Z,k=O.p(B),D=function(ae,ne){var C=O.w(q.$u?Date.UTC(q.$y,ne,ae):new Date(q.$y,ne,ae),q);return ee?C:C.endOf(u)},I=function(ae,ne){return O.w(q.toDate()[ae].apply(q.toDate("s"),(ee?[0,0,0,0]:[23,59,59,999]).slice(ne)),q)},_=this.$W,E=this.$M,P=this.$D,M="set"+(this.$u?"UTC":"");switch(k){case d:return ee?D(1,0):D(31,11);case f:return ee?D(1,E):D(0,E+1);case c:var X=this.$locale().weekStart||0,J=(_<X?_+7:_)-X;return D(ee?P-J:P+(6-J),E);case u:case g:return I(M+"Hours",0);case l:return I(M+"Minutes",1);case o:return I(M+"Seconds",2);case a:return I(M+"Milliseconds",3);default:return this.clone()}},j.endOf=function(B){return this.startOf(B,!1)},j.$set=function(B,Z){var q,ee=O.p(B),k="set"+(this.$u?"UTC":""),D=(q={},q[u]=k+"Date",q[g]=k+"Date",q[f]=k+"Month",q[d]=k+"FullYear",q[l]=k+"Hours",q[o]=k+"Minutes",q[a]=k+"Seconds",q[s]=k+"Milliseconds",q)[ee],I=ee===u?this.$D+(Z-this.$W):Z;if(ee===f||ee===d){var _=this.clone().set(g,1);_.$d[D](I),_.init(),this.$d=_.set(g,Math.min(this.$D,_.daysInMonth())).$d}else D&&this.$d[D](I);return this.init(),this},j.set=function(B,Z){return this.clone().$set(B,Z)},j.get=function(B){return this[O.p(B)]()},j.add=function(B,Z){var q,ee=this;B=Number(B);var k=O.p(Z),D=function(E){var P=A(ee);return O.w(P.date(P.date()+Math.round(E*B)),ee)};if(k===f)return this.set(f,this.$M+B);if(k===d)return this.set(d,this.$y+B);if(k===u)return D(1);if(k===c)return D(7);var I=(q={},q[o]=r,q[l]=i,q[a]=n,q)[k]||1,_=this.$d.getTime()+B*I;return O.w(_,this)},j.subtract=function(B,Z){return this.add(-1*B,Z)},j.format=function(B){var Z=this,q=this.$locale();if(!this.isValid())return q.invalidDate||T;var ee=B||"YYYY-MM-DDTHH:mm:ssZ",k=O.z(this),D=this.$H,I=this.$m,_=this.$M,E=q.weekdays,P=q.months,M=q.meridiem,X=function(ne,C,R,z){return ne&&(ne[C]||ne(Z,ee))||R[C].slice(0,z)},J=function(ne){return O.s(D%12||12,ne,"0")},ae=M||function(ne,C,R){var z=ne<12?"AM":"PM";return R?z.toLowerCase():z};return ee.replace(m,(function(ne,C){return C||(function(R){switch(R){case"YY":return String(Z.$y).slice(-2);case"YYYY":return O.s(Z.$y,4,"0");case"M":return _+1;case"MM":return O.s(_+1,2,"0");case"MMM":return X(q.monthsShort,_,P,3);case"MMMM":return X(P,_);case"D":return Z.$D;case"DD":return O.s(Z.$D,2,"0");case"d":return String(Z.$W);case"dd":return X(q.weekdaysMin,Z.$W,E,2);case"ddd":return X(q.weekdaysShort,Z.$W,E,3);case"dddd":return E[Z.$W];case"H":return String(D);case"HH":return O.s(D,2,"0");case"h":return J(1);case"hh":return J(2);case"a":return ae(D,I,!0);case"A":return ae(D,I,!1);case"m":return String(I);case"mm":return O.s(I,2,"0");case"s":return String(Z.$s);case"ss":return O.s(Z.$s,2,"0");case"SSS":return O.s(Z.$ms,3,"0");case"Z":return k}return null})(ne)||k.replace(":","")}))},j.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},j.diff=function(B,Z,q){var ee,k=this,D=O.p(Z),I=A(B),_=(I.utcOffset()-this.utcOffset())*r,E=this-I,P=function(){return O.m(k,I)};switch(D){case d:ee=P()/12;break;case f:ee=P();break;case h:ee=P()/3;break;case c:ee=(E-_)/6048e5;break;case u:ee=(E-_)/864e5;break;case l:ee=E/i;break;case o:ee=E/r;break;case a:ee=E/n;break;default:ee=E}return q?ee:O.a(ee)},j.daysInMonth=function(){return this.endOf(f).$D},j.$locale=function(){return w[this.$L]},j.locale=function(B,Z){if(!B)return this.$L;var q=this.clone(),ee=F(B,Z,!0);return ee&&(q.$L=ee),q},j.clone=function(){return O.w(this.$d,this)},j.toDate=function(){return new Date(this.valueOf())},j.toJSON=function(){return this.isValid()?this.toISOString():null},j.toISOString=function(){return this.$d.toISOString()},j.toString=function(){return this.$d.toUTCString()},H})(),K=U.prototype;return A.prototype=K,[["$ms",s],["$s",a],["$m",o],["$H",l],["$W",u],["$M",f],["$y",d],["$D",g]].forEach((function(H){K[H[1]]=function(j){return this.$g(j,H[0],H[1])}})),A.extend=function(H,j){return H.$i||(H(j,U,A),H.$i=!0),A},A.locale=F,A.isDayjs=N,A.unix=function(H){return A(1e3*H)},A.en=w[v],A.Ls=w,A.p={},A}))})(Hi)),Hi.exports}var ek=QT();const Bi=Xn(ek);var Vi={exports:{}},tk=Vi.exports,Af;function nk(){return Af||(Af=1,(function(e,t){(function(n,r){e.exports=r()})(tk,(function(){var n="day";return function(r,i,s){var a=function(u){return u.add(4-u.isoWeekday(),n)},o=i.prototype;o.isoWeekYear=function(){return a(this).year()},o.isoWeek=function(u){if(!this.$utils().u(u))return this.add(7*(u-this.isoWeek()),n);var c,f,h,d,g=a(this),T=(c=this.isoWeekYear(),f=this.$u,h=(f?s.utc:s)().year(c).startOf("year"),d=4-h.isoWeekday(),h.isoWeekday()>4&&(d+=7),h.add(d,n));return g.diff(T,"week")+1},o.isoWeekday=function(u){return this.$utils().u(u)?this.day()||7:this.day(this.day()%7?u:u-7)};var l=o.startOf;o.startOf=function(u,c){var f=this.$utils(),h=!!f.u(c)||c;return f.p(u)==="isoweek"?h?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):l.bind(this)(u,c)}}}))})(Vi)),Vi.exports}var rk=nk();const ik=Xn(rk);Bi.extend(ik);function sk(){return Bi().startOf("isoWeek").toDate()}const Ra=/大*后天/g;function ak(e){if(!Ra.test(e))return e;const t=Bi();return Ra.lastIndex=0,e.replace(Ra,n=>{const i=2+(n.length-2);return t.add(i,"day").format("YYYY年MM月DD日")})}function ok(e){const t=ak(e),n=/(?:本|这|上|下)?(?:周|星期)/.test(t),r=ZT(t,{instant:n?sk():new Date});return r?Bi(r).format("YYYY-MM-DD HH:mm:ss"):"无法解析,请输入具体时间"}const lk={parse_relative_date:{def:{type:"function",function:{name:"parse_relative_date",description:"把相对时间转成绝对时间",parameters:{type:"object",properties:{input:{type:"string",description:"相对时间"}},required:["input"]}}},handler:e=>ok(e.input)}};class uk extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot&&this.shadowRoot.appendChild(Fc.content.cloneNode(!0))}connectedCallback(){this.shadowRoot&&E_(this.shadowRoot)}}customElements.define("ai-chat-panel",uk);class ck{on=ga.on;pushMessage=ot.pushMessage;pushMessages=ot.pushMessages;pushLoadingMessage=ot.pushLoadingMessage;updateLoadingMessageReasoningContent=ot.updateLoadingMessageReasoningContent;updateLoadingMessageContent=ot.updateLoadingMessageContent;finishLoadingMessage=ot.finishLoadingMessage;setUserInputValue=Ut.setValue;constructor(t){const{container:n}=t;if(!n)throw new Error("未提供有效的 container");const r=document.createElement("ai-chat-panel");n.appendChild(r)}}$e.AIChatPanel=ck,$e.Agent=b_,$e.tools=lk,Object.defineProperty($e,Symbol.toStringTag,{value:"Module"})}));
|
|
97
|
+
reference: ${JSON.stringify(this.reference)}]`}date(){const t=this.dateWithoutTimezoneAdjustment(),n=this.reference.getSystemTimezoneAdjustmentMinute(t,this.get("timezoneOffset"));return new Date(t.getTime()+n*6e4)}addTag(t){return this._tags.add(t),this}addTags(t){for(const n of t)this._tags.add(n);return this}tags(){return new Set(this._tags)}dateWithoutTimezoneAdjustment(){const t=new Date(this.get("year"),this.get("month")-1,this.get("day"),this.get("hour"),this.get("minute"),this.get("second"),this.get("millisecond"));return t.setFullYear(this.get("year")),t}}class Tn{refDate;index;text;reference;start;end;constructor(t,n,r,i,s){this.reference=t,this.refDate=t.instant,this.index=n,this.text=r,this.start=i||new Te(t),this.end=s}clone(){const t=new Tn(this.reference,this.index,this.text);return t.start=this.start?this.start.clone():null,t.end=this.end?this.end.clone():null,t}date(){return this.start.date()}addTag(t){return this.start.addTag(t),this.end&&this.end.addTag(t),this}addTags(t){return this.start.addTags(t),this.end&&this.end.addTags(t),this}tags(){const t=new Set(this.start.tags());if(this.end)for(const n of this.end.tags())t.add(n);return t}toString(){const t=Array.from(this.tags()).sort();return`[ParsingResult {index: ${this.index}, text: '${this.text}', tags: ${JSON.stringify(t)} ...}]`}}function Hc(e,t,n="\\s{0,5},?\\s{0,5}"){const r=t.replace(/\((?!\?)/g,"(?:");return`${e}${r}(?:${n}${r}){0,10}`}function D_(e){let t;return e instanceof Array?t=[...e]:e instanceof Map?t=Array.from(e.keys()):t=Object.keys(e),t}function xt(e){return`(?:${D_(e).sort((n,r)=>r.length-n.length).join("|").replace(/\./g,"\\.")})`}function Bc(e){return e<100&&(e>50?e=e+1900:e=e+2e3),e}function yi(e,t,n){let r=new Date(e);r.setMonth(n-1),r.setDate(t);const i=Le(r,{year:1}),s=Le(r,{year:-1});return Math.abs(i.getTime()-e.getTime())<Math.abs(r.getTime()-e.getTime())?r=i:Math.abs(s.getTime()-e.getTime())<Math.abs(r.getTime()-e.getTime())&&(r=s),r.getFullYear()}const ba={sunday:0,sun:0,"sun.":0,monday:1,mon:1,"mon.":1,tuesday:2,tue:2,"tue.":2,wednesday:3,wed:3,"wed.":3,thursday:4,thurs:4,"thurs.":4,thur:4,"thur.":4,thu:4,"thu.":4,friday:5,fri:5,"fri.":5,saturday:6,sat:6,"sat.":6},Vc={january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12},Vt={...Vc,jan:1,"jan.":1,feb:2,"feb.":2,mar:3,"mar.":3,apr:4,"apr.":4,jun:6,"jun.":6,jul:7,"jul.":7,aug:8,"aug.":8,sep:9,"sep.":9,sept:9,"sept.":9,oct:10,"oct.":10,nov:11,"nov.":11,dec:12,"dec.":12},wa={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12},_a={first:1,second:2,third:3,fourth:4,fifth:5,sixth:6,seventh:7,eighth:8,ninth:9,tenth:10,eleventh:11,twelfth:12,thirteenth:13,fourteenth:14,fifteenth:15,sixteenth:16,seventeenth:17,eighteenth:18,nineteenth:19,twentieth:20,"twenty first":21,"twenty-first":21,"twenty second":22,"twenty-second":22,"twenty third":23,"twenty-third":23,"twenty fourth":24,"twenty-fourth":24,"twenty fifth":25,"twenty-fifth":25,"twenty sixth":26,"twenty-sixth":26,"twenty seventh":27,"twenty-seventh":27,"twenty eighth":28,"twenty-eighth":28,"twenty ninth":29,"twenty-ninth":29,thirtieth:30,"thirty first":31,"thirty-first":31},Wc={second:"second",seconds:"second",minute:"minute",minutes:"minute",hour:"hour",hours:"hour",day:"day",days:"day",week:"week",weeks:"week",month:"month",months:"month",quarter:"quarter",quarters:"quarter",year:"year",years:"year"},bi={s:"second",sec:"second",second:"second",seconds:"second",m:"minute",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",hour:"hour",hours:"hour",d:"day",day:"day",days:"day",w:"week",week:"week",weeks:"week",mo:"month",mon:"month",mos:"month",month:"month",months:"month",qtr:"quarter",quarter:"quarter",quarters:"quarter",y:"year",yr:"year",year:"year",years:"year",...Wc},Yc=`(?:${xt(wa)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s{0,2}an?)?|an?\\b(?:\\s{0,2}few)?|few|several|the|a?\\s{0,2}couple\\s{0,2}(?:of)?)`;function $_(e){const t=e.toLowerCase();return wa[t]!==void 0?wa[t]:t==="a"||t==="an"||t=="the"?1:t.match(/few/)?3:t.match(/half/)?.5:t.match(/couple/)?2:t.match(/several/)?7:parseFloat(t)}const wi=`(?:${xt(_a)}|[0-9]{1,2}(?:st|nd|rd|th)?)`;function _i(e){let t=e.toLowerCase();return _a[t]!==void 0?_a[t]:(t=t.replace(/(?:st|nd|rd|th)$/i,""),parseInt(t))}const vi="(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-2][0-9]{3}|[5-9][0-9]|2[0-5])";function Ti(e){if(/BE/i.test(e))return e=e.replace(/BE/i,""),parseInt(e)-543;if(/BCE?/i.test(e))return e=e.replace(/BCE?/i,""),-parseInt(e);if(/(AD|CE)/i.test(e))return e=e.replace(/(AD|CE)/i,""),parseInt(e);const t=parseInt(e);return Bc(t)}const Gc=`(${Yc})\\s{0,3}(${xt(bi)})`,Kc=new RegExp(Gc,"i"),C_=`(${Yc})\\s{0,3}(${xt(Wc)})`,Zc="\\s{0,5},?(?:\\s*and)?\\s{0,5}",Zn=Hc("(?:(?:about|around)\\s{0,3})?",Gc,Zc),ki=Hc("(?:(?:about|around)\\s{0,3})?",C_,Zc);function kn(e){const t={};let n=e,r=Kc.exec(n);for(;r;)O_(t,r),n=n.substring(r[0].length).trim(),r=Kc.exec(n);return Object.keys(t).length==0?null:t}function O_(e,t){if(t[0].match(/^[a-zA-Z]+$/))return;const n=$_(t[1]),r=bi[t[2].toLowerCase()];e[r]=n}class ke{innerPatternHasChange(t,n){return this.innerPattern(t)!==n}patternLeftBoundary(){return"(\\W|^)"}cachedInnerPattern=null;cachedPattern=null;pattern(t){return this.cachedInnerPattern&&!this.innerPatternHasChange(t,this.cachedInnerPattern)?this.cachedPattern:(this.cachedInnerPattern=this.innerPattern(t),this.cachedPattern=new RegExp(`${this.patternLeftBoundary()}${this.cachedInnerPattern.source}`,this.cachedInnerPattern.flags),this.cachedPattern)}extract(t,n){const r=n[1]??"";n.index=n.index+r.length,n[0]=n[0].substring(r.length);for(let i=2;i<n.length;i++)n[i-1]=n[i];return this.innerExtract(t,n)}}const R_=new RegExp(`(?:(?:within|in|for)\\s*)?(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Zn})(?=\\W|$)`,"i"),N_=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Zn})(?=\\W|$)`,"i"),M_=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${ki})(?=\\W|$)`,"i");class I_ extends ke{strictMode;constructor(t){super(),this.strictMode=t}innerPattern(t){return this.strictMode?M_:t.option.forwardDate?R_:N_}innerExtract(t,n){if(n[0].match(/^for\s*the\s*\w+/))return null;const r=kn(n[1]);return r?Te.createRelativeFromReference(t.reference,r):null}}const L_=new RegExp(`(?:on\\s{0,3})?(${wi})(?:\\s{0,3}(?:to|\\-|\\–|until|through|till)?\\s{0,3}(${wi}))?(?:-|/|\\s{0,3}(?:of)?\\s{0,3})(${xt(Vt)})(?:(?:-|/|,?\\s{0,3})(${vi}(?!\\w)))?(?=\\W|$)`,"i"),Jc=1,Xc=2,F_=3,Qc=4;class j_ extends ke{innerPattern(){return L_}innerExtract(t,n){const r=t.createParsingResult(n.index,n[0]),i=Vt[n[F_].toLowerCase()],s=_i(n[Jc]);if(s>31)return n.index=n.index+n[Jc].length,null;if(r.start.assign("month",i),r.start.assign("day",s),n[Qc]){const a=Ti(n[Qc]);r.start.assign("year",a)}else{const a=yi(t.refDate,s,i);r.start.imply("year",a)}if(n[Xc]){const a=_i(n[Xc]);r.end=r.start.clone(),r.end.assign("day",a)}return r}}const z_=new RegExp(`(${xt(Vt)})(?:-|/|\\s*,?\\s*)(${wi})(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(${wi})\\s*)?(?:(?:-|/|\\s*,\\s*|\\s+)(${vi}))?(?=\\W|$)(?!\\:\\d)`,"i"),U_=1,ef=2,va=3,Ta=4;class q_ extends ke{shouldSkipYearLikeDate;constructor(t){super(),this.shouldSkipYearLikeDate=t}innerPattern(){return z_}innerExtract(t,n){const r=Vt[n[U_].toLowerCase()],i=_i(n[ef]);if(i>31||this.shouldSkipYearLikeDate&&!n[va]&&!n[Ta]&&n[ef].match(/^2[0-5]$/))return null;const s=t.createParsingComponents({day:i,month:r}).addTag("parser/ENMonthNameMiddleEndianParser");if(n[Ta]){const l=Ti(n[Ta]);s.assign("year",l)}else{const l=yi(t.refDate,i,r);s.imply("year",l)}if(!n[va])return s;const a=_i(n[va]),o=t.createParsingResult(n.index,n[0]);return o.start=s,o.end=s.clone(),o.end.assign("day",a),o}}const H_=new RegExp(`((?:in)\\s*)?(${xt(Vt)})\\s*(?:(?:,|-|of)?\\s*(${vi})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),B_=1,V_=2,tf=3;class W_ extends ke{innerPattern(){return H_}innerExtract(t,n){const r=n[V_].toLowerCase();if(n[0].length<=3&&!Vc[r])return null;const i=t.createParsingResult(n.index+(n[B_]||"").length,n.index+n[0].length);i.start.imply("day",1),i.start.addTag("parser/ENMonthNameParser");const s=Vt[r];if(i.start.assign("month",s),n[tf]){const a=Ti(n[tf]);i.start.assign("year",a)}else{const a=yi(t.refDate,1,s);i.start.imply("year",a)}return i}}const Y_=new RegExp(`([0-9]{4})[-\\.\\/\\s](?:(${xt(Vt)})|([0-9]{1,2}))[-\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),G_=1,K_=2,nf=3,Z_=4;class J_ extends ke{strictMonthDateOrder;constructor(t){super(),this.strictMonthDateOrder=t}innerPattern(){return Y_}innerExtract(t,n){const r=parseInt(n[G_]);let i=parseInt(n[Z_]),s=n[nf]?parseInt(n[nf]):Vt[n[K_].toLowerCase()];if(s<1||s>12){if(this.strictMonthDateOrder)return null;i>=1&&i<=12&&([s,i]=[i,s])}return i<1||i>31?null:{day:i,month:s,year:r}}}const X_=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),Q_=1,ev=2;class tv extends ke{innerPattern(){return X_}innerExtract(t,n){const r=parseInt(n[ev]),i=parseInt(n[Q_]);return t.createParsingComponents().imply("day",1).assign("month",i).assign("year",r)}}function nv(e,t,n,r){return new RegExp(`${e}${t}(\\d{1,4})(?:(?:\\.|:|:)(\\d{1,2})(?:(?::|:)(\\d{2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${n}`,r)}function rv(e,t){return new RegExp(`^(${e})(\\d{1,4})(?:(?:\\.|\\:|\\:)(\\d{1,2})(?:(?:\\.|\\:|\\:)(\\d{1,2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${t}`,"i")}const ka=2,sn=3,Ei=4,Si=5,En=6;class iv{strictMode;constructor(t=!1){this.strictMode=t}patternFlags(){return"i"}primaryPatternLeftBoundary(){return"(^|\\s|T|\\b)"}primarySuffix(){return"(?!/)(?=\\W|$)"}followingSuffix(){return"(?!/)(?=\\W|$)"}pattern(t){return this.getPrimaryTimePatternThroughCache()}extract(t,n){const r=this.extractPrimaryTimeComponents(t,n);if(!r)return n[0].match(/^\d{4}/)?(n.index+=4,null):(n.index+=n[0].length,null);const i=n.index+n[1].length,s=n[0].substring(n[1].length),a=t.createParsingResult(i,s,r);n.index+=n[0].length;const o=t.text.substring(n.index),u=this.getFollowingTimePatternThroughCache().exec(o);return s.match(/^\d{3,4}/)&&u&&(u[0].match(/^\s*([+-])\s*\d{2,4}$/)||u[0].match(/^\s*([+-])\s*\d{2}\W\d{2}/))?null:!u||u[0].match(/^\s*([+-])\s*\d{3,4}$/)?this.checkAndReturnWithoutFollowingPattern(a):(a.end=this.extractFollowingTimeComponents(t,u,a),a.end&&(a.text+=u[0]),this.checkAndReturnWithFollowingPattern(a))}extractPrimaryTimeComponents(t,n,r=!1){const i=t.createParsingComponents();let s=0,a=null,o=parseInt(n[ka]);if(o>100){if(n[ka].length==4&&n[sn]==null&&!n[En]||this.strictMode||n[sn]!=null)return null;s=o%100,o=Math.floor(o/100)}if(o>24)return null;if(n[sn]!=null){if(n[sn].length==1&&!n[En])return null;s=parseInt(n[sn])}if(s>=60)return null;if(o>12&&(a=ye.PM),n[En]!=null){if(o>12)return null;const l=n[En][0].toLowerCase();l=="a"&&(a=ye.AM,o==12&&(o=0)),l=="p"&&(a=ye.PM,o!=12&&(o+=12))}if(i.assign("hour",o),i.assign("minute",s),a!==null?i.assign("meridiem",a):o<12?i.imply("meridiem",ye.AM):i.imply("meridiem",ye.PM),n[Si]!=null){const l=parseInt(n[Si].substring(0,3));if(l>=1e3)return null;i.assign("millisecond",l)}if(n[Ei]!=null){const l=parseInt(n[Ei]);if(l>=60)return null;i.assign("second",l)}return i}extractFollowingTimeComponents(t,n,r){const i=t.createParsingComponents();if(n[Si]!=null){const l=parseInt(n[Si].substring(0,3));if(l>=1e3)return null;i.assign("millisecond",l)}if(n[Ei]!=null){const l=parseInt(n[Ei]);if(l>=60)return null;i.assign("second",l)}let s=parseInt(n[ka]),a=0,o=-1;if(n[sn]!=null?a=parseInt(n[sn]):s>100&&(a=s%100,s=Math.floor(s/100)),a>=60||s>24)return null;if(s>=12&&(o=ye.PM),n[En]!=null){if(s>12)return null;const l=n[En][0].toLowerCase();l=="a"&&(o=ye.AM,s==12&&(s=0,i.isCertain("day")||i.imply("day",i.get("day")+1))),l=="p"&&(o=ye.PM,s!=12&&(s+=12)),r.start.isCertain("meridiem")||(o==ye.AM?(r.start.imply("meridiem",ye.AM),r.start.get("hour")==12&&r.start.assign("hour",0)):(r.start.imply("meridiem",ye.PM),r.start.get("hour")!=12&&r.start.assign("hour",r.start.get("hour")+12)))}return i.assign("hour",s),i.assign("minute",a),o>=0?i.assign("meridiem",o):r.start.isCertain("meridiem")&&r.start.get("hour")>12?r.start.get("hour")-12>s?i.imply("meridiem",ye.AM):s<=12&&(i.assign("hour",s+12),i.assign("meridiem",ye.PM)):s>12?i.imply("meridiem",ye.PM):s<=12&&i.imply("meridiem",ye.AM),i.date().getTime()<r.start.date().getTime()&&i.imply("day",i.get("day")+1),i}checkAndReturnWithoutFollowingPattern(t){if(t.text.match(/^\d$/)||t.text.match(/^\d\d\d+$/)||t.text.match(/\d[apAP]$/))return null;const n=t.text.match(/[^\d:.](\d[\d.]+)$/);if(n){const r=n[1];if(this.strictMode||r.includes(".")&&!r.match(/\d(\.\d{2})+$/)||parseInt(r)>24)return null}return t}checkAndReturnWithFollowingPattern(t){if(t.text.match(/^\d+-\d+$/))return null;const n=t.text.match(/[^\d:.](\d[\d.]+)\s*-\s*(\d[\d.]+)$/);if(n){if(this.strictMode)return null;const r=n[1],i=n[2];if(i.includes(".")&&!i.match(/\d(\.\d{2})+$/))return null;const s=parseInt(i),a=parseInt(r);if(s>24||a>24)return null}return t}cachedPrimaryPrefix=null;cachedPrimarySuffix=null;cachedPrimaryTimePattern=null;getPrimaryTimePatternThroughCache(){const t=this.primaryPrefix(),n=this.primarySuffix();return this.cachedPrimaryPrefix===t&&this.cachedPrimarySuffix===n?this.cachedPrimaryTimePattern:(this.cachedPrimaryTimePattern=nv(this.primaryPatternLeftBoundary(),t,n,this.patternFlags()),this.cachedPrimaryPrefix=t,this.cachedPrimarySuffix=n,this.cachedPrimaryTimePattern)}cachedFollowingPhase=null;cachedFollowingSuffix=null;cachedFollowingTimePatten=null;getFollowingTimePatternThroughCache(){const t=this.followingPhase(),n=this.followingSuffix();return this.cachedFollowingPhase===t&&this.cachedFollowingSuffix===n?this.cachedFollowingTimePatten:(this.cachedFollowingTimePatten=rv(t,n),this.cachedFollowingPhase=t,this.cachedFollowingSuffix=n,this.cachedFollowingTimePatten)}}class sv extends iv{constructor(t){super(t)}followingPhase(){return"\\s*(?:\\-|\\–|\\~|\\〜|to|until|through|till|\\?)\\s*"}primaryPrefix(){return"(?:(?:at|from)\\s*)??"}primarySuffix(){return"(?:\\s*(?:o\\W*clock|at\\s*night|in\\s*the\\s*(?:morning|afternoon)))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(t,n){const r=super.extractPrimaryTimeComponents(t,n);if(!r)return r;if(n[0].endsWith("night")){const i=r.get("hour");i>=6&&i<12?(r.assign("hour",r.get("hour")+12),r.assign("meridiem",ye.PM)):i<6&&r.assign("meridiem",ye.AM)}if(n[0].endsWith("afternoon")){r.assign("meridiem",ye.PM);const i=r.get("hour");i>=0&&i<=6&&r.assign("hour",r.get("hour")+12)}return n[0].endsWith("morning")&&(r.assign("meridiem",ye.AM),r.get("hour")<12&&r.assign("hour",r.get("hour"))),r.addTag("parser/ENTimeExpressionParser")}extractFollowingTimeComponents(t,n,r){const i=super.extractFollowingTimeComponents(t,n,r);return i&&i.addTag("parser/ENTimeExpressionParser"),i}}const av=new RegExp(`(${Zn})\\s{0,5}(?:ago|before|earlier)(?=\\W|$)`,"i"),ov=new RegExp(`(${ki})\\s{0,5}(?:ago|before|earlier)(?=\\W|$)`,"i");class lv extends ke{strictMode;constructor(t){super(),this.strictMode=t}innerPattern(){return this.strictMode?ov:av}innerExtract(t,n){const r=kn(n[1]);return r?Te.createRelativeFromReference(t.reference,gi(r)):null}}const uv=new RegExp(`(${Zn})\\s{0,5}(?:later|after|from now|henceforth|forward|out)(?=(?:\\W|$))`,"i"),cv=new RegExp(`(${ki})\\s{0,5}(later|after|from now)(?=\\W|$)`,"i"),fv=1;class dv extends ke{strictMode;constructor(t){super(),this.strictMode=t}innerPattern(){return this.strictMode?cv:uv}innerExtract(t,n){const r=kn(n[fv]);return r?Te.createRelativeFromReference(t.reference,r):null}}class rf{refine(t,n){return n.filter(r=>this.isValid(t,r))}}class Jn{refine(t,n){if(n.length<2)return n;const r=[];let i=n[0],s=null;for(let a=1;a<n.length;a++){s=n[a];const o=t.text.substring(i.index+i.text.length,s.index);if(!this.shouldMergeResults(o,i,s,t))r.push(i),i=s;else{const l=i,u=s,c=this.mergeResults(o,l,u,t);t.debug(()=>{console.log(`${this.constructor.name} merged ${l} and ${u} into ${c}`)}),i=c}}return i!=null&&r.push(i),r}}class sf extends Jn{shouldMergeResults(t,n,r){return!n.end&&!r.end&&t.match(this.patternBetween())!=null}mergeResults(t,n,r){if(!n.start.isOnlyWeekdayComponent()&&!r.start.isOnlyWeekdayComponent()&&(r.start.getCertainComponents().forEach(s=>{n.start.isCertain(s)||n.start.imply(s,r.start.get(s))}),n.start.getCertainComponents().forEach(s=>{r.start.isCertain(s)||r.start.imply(s,n.start.get(s))})),n.start.date()>r.start.date()){let s=n.start.date(),a=r.start.date();r.start.isOnlyWeekdayComponent()&&Le(a,{day:7})>s?(a=Le(a,{day:7}),r.start.imply("day",a.getDate()),r.start.imply("month",a.getMonth()+1),r.start.imply("year",a.getFullYear())):n.start.isOnlyWeekdayComponent()&&Le(s,{day:-7})<a?(s=Le(s,{day:-7}),n.start.imply("day",s.getDate()),n.start.imply("month",s.getMonth()+1),n.start.imply("year",s.getFullYear())):r.start.isDateWithUnknownYear()&&Le(a,{year:1})>s?(a=Le(a,{year:1}),r.start.imply("year",a.getFullYear())):n.start.isDateWithUnknownYear()&&Le(s,{year:-1})<a?(s=Le(s,{year:-1}),n.start.imply("year",s.getFullYear())):[r,n]=[n,r]}const i=n.clone();return i.start=n.start,i.end=r.start,i.index=Math.min(n.index,r.index),n.index<r.index?i.text=n.text+t+r.text:i.text=r.text+t+n.text,i}}class hv extends sf{patternBetween(){return/^\s*(to|-|–|until|through|till)\s*$/i}}function af(e,t){const n=e.clone(),r=e.start,i=t.start;if(n.start=of(r,i),e.end!=null||t.end!=null){const s=e.end==null?e.start:e.end,a=t.end==null?t.start:t.end,o=of(s,a);if(e.end==null&&o.date().getTime()<n.start.date().getTime()){const l=new Date(o.date().getTime());l.setDate(l.getDate()+1),o.isCertain("day")?nn(o,l):vn(o,l)}n.end=o}return n}function of(e,t){const n=e.clone();return t.isCertain("hour")?(n.assign("hour",t.get("hour")),n.assign("minute",t.get("minute")),t.isCertain("second")?(n.assign("second",t.get("second")),t.isCertain("millisecond")?n.assign("millisecond",t.get("millisecond")):n.imply("millisecond",t.get("millisecond"))):(n.imply("second",t.get("second")),n.imply("millisecond",t.get("millisecond")))):(n.imply("hour",t.get("hour")),n.imply("minute",t.get("minute")),n.imply("second",t.get("second")),n.imply("millisecond",t.get("millisecond"))),t.isCertain("timezoneOffset")&&n.assign("timezoneOffset",t.get("timezoneOffset")),t.isCertain("meridiem")?n.assign("meridiem",t.get("meridiem")):t.get("meridiem")!=null&&n.get("meridiem")==null&&n.imply("meridiem",t.get("meridiem")),n.get("meridiem")==ye.PM&&n.get("hour")<12&&(t.isCertain("hour")?n.assign("hour",n.get("hour")+12):n.imply("hour",n.get("hour")+12)),n.addTags(e.tags()),n.addTags(t.tags()),n}class lf extends Jn{shouldMergeResults(t,n,r){return(n.start.isOnlyDate()&&r.start.isOnlyTime()||r.start.isOnlyDate()&&n.start.isOnlyTime())&&t.match(this.patternBetween())!=null}mergeResults(t,n,r){const i=n.start.isOnlyDate()?af(n,r):af(r,n);return i.index=n.index,i.text=n.text+t+r.text,i}}class uf extends lf{patternBetween(){return new RegExp("^\\s*(T|at|after|before|on|of|,|-|\\.|∙|:)?\\s*$")}}const pv=new RegExp("^\\s*,?\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)","i");class mv{timezoneOverrides;constructor(t){this.timezoneOverrides=t}refine(t,n){const r=t.option.timezones??{};return n.forEach(i=>{const s=t.text.substring(i.index+i.text.length),a=pv.exec(s);if(!a)return;const o=a[1].toUpperCase(),l=i.start.date()??i.refDate??new Date,u={...this.timezoneOverrides,...r},c=qc(o,l,u);if(c==null)return;t.debug(()=>{console.log(`Extracting timezone: '${o}' into: ${c} for: ${i.start}`)});const f=i.start.get("timezoneOffset");f!==null&&c!=f&&(i.start.isCertain("timezoneOffset")||o!=a[1])||i.start.isOnlyDate()&&o!=a[1]||(i.text+=a[0],i.start.isCertain("timezoneOffset")||i.start.assign("timezoneOffset",c),i.end!=null&&!i.end.isCertain("timezoneOffset")&&i.end.assign("timezoneOffset",c))}),n}}const gv=new RegExp("^\\s*(?:\\(?(?:GMT|UTC)\\s?)?([+-])(\\d{1,2})(?::?(\\d{2}))?\\)?","i"),yv=1,bv=2,wv=3;class cf{refine(t,n){return n.forEach(function(r){if(r.start.isCertain("timezoneOffset"))return;const i=t.text.substring(r.index+r.text.length),s=gv.exec(i);if(!s)return;t.debug(()=>{console.log(`Extracting timezone: '${s[0]}' into : ${r}`)});const a=parseInt(s[bv]),o=parseInt(s[wv]||"0");let l=a*60+o;l>840||(s[yv]==="-"&&(l=-l),r.end!=null&&r.end.assign("timezoneOffset",l),r.start.assign("timezoneOffset",l),r.text+=s[0])}),n}}class Ea{refine(t,n){if(n.length<2)return n;const r=[];let i=n[0];for(let s=1;s<n.length;s++){const a=n[s];if(a.index>=i.index+i.text.length){r.push(i),i=a;continue}let o=null,l=null;a.text.length>i.text.length?(o=a,l=i):(o=i,l=a),t.debug(()=>{console.log(`${this.constructor.name} remove ${l} by ${o}`)}),i=o}return i!=null&&r.push(i),r}}class _v{refine(t,n){return t.option.forwardDate&&n.forEach(r=>{let i=t.reference.getDateWithAdjustedTimezone();if(r.start.isOnlyTime()&&t.reference.instant>r.start.date()){const s=t.reference.getDateWithAdjustedTimezone(),a=new Date(s);a.setDate(a.getDate()+1),vn(r.start,a),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} time from the ref date (${s}) to the following day (${a})`)}),r.end&&r.end.isOnlyTime()&&(vn(r.end,a),r.start.date()>r.end.date()&&(a.setDate(a.getDate()+1),vn(r.end,a)))}if(r.start.isOnlyWeekdayComponent()&&i>r.start.date()){let s=r.start.get("weekday")-i.getDay();if(s<=0&&(s+=7),i=Le(i,{day:s}),vn(r.start,i),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} weekday (${r.start})`)}),r.end&&r.end.isOnlyWeekdayComponent()){let a=r.end.get("weekday")-i.getDay();a<=0&&(a+=7),i=Le(i,{day:a}),vn(r.end,i),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} weekday (${r.end})`)})}}if(r.start.isDateWithUnknownYear()&&i>r.start.date())for(let s=0;s<3&&i>r.start.date();s++)r.start.imply("year",r.start.get("year")+1),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} year (${r.start})`)}),r.end&&!r.end.isCertain("year")&&(r.end.imply("year",r.end.get("year")+1),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} month (${r.start})`)}))}),n}}class vv extends rf{strictMode;constructor(t){super(),this.strictMode=t}isValid(t,n){return n.text.replace(" ","").match(/^\d*(\.\d*)?$/)?(t.debug(()=>{console.log(`Removing unlikely result '${n.text}'`)}),!1):n.start.isValidDate()?n.end&&!n.end.isValidDate()?(t.debug(()=>{console.log(`Removing invalid result: ${n} (${n.end})`)}),!1):this.strictMode?this.isStrictModeValid(t,n):!0:(t.debug(()=>{console.log(`Removing invalid result: ${n} (${n.start})`)}),!1)}isStrictModeValid(t,n){return n.start.isOnlyWeekdayComponent()?(t.debug(()=>{console.log(`(Strict) Removing weekday only component: ${n} (${n.end})`)}),!1):!0}}const Tv=new RegExp("([0-9]{4})\\-([0-9]{1,2})\\-([0-9]{1,2})(?:T([0-9]{1,2}):([0-9]{1,2})(?::([0-9]{1,2})(?:\\.(\\d{1,4}))?)?(Z|([+-]\\d{2}):?(\\d{2})?)?)?(?=\\W|$)","i"),kv=1,Ev=2,Sv=3,ff=4,xv=5,df=6,hf=7,Pv=8,pf=9,mf=10;class Av extends ke{innerPattern(){return Tv}innerExtract(t,n){const r=t.createParsingComponents({year:parseInt(n[kv]),month:parseInt(n[Ev]),day:parseInt(n[Sv])});if(n[ff]!=null&&(r.assign("hour",parseInt(n[ff])),r.assign("minute",parseInt(n[xv])),n[df]!=null&&r.assign("second",parseInt(n[df])),n[hf]!=null&&r.assign("millisecond",parseInt(n[hf])),n[Pv]!=null)){let i=0;if(n[pf]){const s=parseInt(n[pf]);let a=0;n[mf]!=null&&(a=parseInt(n[mf])),i=s*60,i<0?i-=a:i+=a}r.assign("timezoneOffset",i)}return r.addTag("parser/ISOFormatParser")}}class Dv extends Jn{mergeResults(t,n,r){const i=r.clone();return i.index=n.index,i.text=n.text+t+i.text,i.start.assign("weekday",n.start.get("weekday")),i.end&&i.end.assign("weekday",n.start.get("weekday")),i}shouldMergeResults(t,n,r){return n.start.isOnlyWeekdayComponent()&&!n.start.isCertain("hour")&&r.start.isCertain("day")&&t.match(/^,?\s*$/)!=null}}function gf(e,t=!1){return e.parsers.unshift(new Av),e.refiners.unshift(new Dv),e.refiners.unshift(new cf),e.refiners.unshift(new Ea),e.refiners.push(new mv),e.refiners.push(new Ea),e.refiners.push(new _v),e.refiners.push(new vv(t)),e}function $v(e){const t=e.getDateWithAdjustedTimezone(),n=new Te(e,{});return nn(n,t),zc(n,t),n.assign("timezoneOffset",e.getTimezoneOffset()),n.addTag("casualReference/now"),n}function Cv(e){const t=e.getDateWithAdjustedTimezone(),n=new Te(e,{});return nn(n,t),ya(n,t),n.delete("meridiem"),n.addTag("casualReference/today"),n}function Ov(e){return Nv(e).addTag("casualReference/yesterday")}function Rv(e){return Sa(e,1).addTag("casualReference/tomorrow")}function Nv(e,t){return Sa(e,-1)}function Sa(e,t){const n=e.getDateWithAdjustedTimezone(),r=new Te(e,{}),i=new Date(n.getTime());return i.setDate(i.getDate()+t),nn(r,i),ya(r,i),r.delete("meridiem"),r}function Mv(e,t=22){const n=e.getDateWithAdjustedTimezone(),r=new Te(e,{});return nn(r,n),r.imply("hour",t),r.imply("meridiem",ye.PM),r.addTag("casualReference/tonight"),r}function Iv(e,t=20){const n=new Te(e,{});return n.imply("meridiem",ye.PM),n.imply("hour",t),n.addTag("casualReference/evening"),n}function Lv(e){const t=new Te(e,{});return e.getDateWithAdjustedTimezone().getHours()>2&&t.addDurationAsImplied({day:1}),t.assign("hour",0),t.imply("minute",0),t.imply("second",0),t.imply("millisecond",0),t.addTag("casualReference/midnight"),t}function Fv(e,t=6){const n=new Te(e,{});return n.imply("meridiem",ye.AM),n.imply("hour",t),n.imply("minute",0),n.imply("second",0),n.imply("millisecond",0),n.addTag("casualReference/morning"),n}function jv(e,t=15){const n=new Te(e,{});return n.imply("meridiem",ye.PM),n.imply("hour",t),n.imply("minute",0),n.imply("second",0),n.imply("millisecond",0),n.addTag("casualReference/afternoon"),n}function zv(e){const t=new Te(e,{});return t.imply("meridiem",ye.AM),t.assign("hour",12),t.imply("minute",0),t.imply("second",0),t.imply("millisecond",0),t.addTag("casualReference/noon"),t}const Uv=/(now|today|tonight|tomorrow|overmorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i;class qv extends ke{innerPattern(t){return Uv}innerExtract(t,n){let r=t.refDate;const i=n[0].toLowerCase();let s=t.createParsingComponents();switch(i){case"now":s=$v(t.reference);break;case"today":s=Cv(t.reference);break;case"yesterday":s=Ov(t.reference);break;case"tomorrow":case"tmr":case"tmrw":s=Rv(t.reference);break;case"tonight":s=Mv(t.reference);break;case"overmorrow":s=Sa(t.reference,2);break;default:if(i.match(/last\s*night/)){if(r.getHours()>6){const a=new Date(r.getTime());a.setDate(a.getDate()-1),r=a}nn(s,r),s.imply("hour",0)}break}return s.addTag("parser/ENCasualDateParser"),s}}const Hv=/(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|midday|noon)(?=\W|$)/i;class Bv extends ke{innerPattern(){return Hv}innerExtract(t,n){let r=null;switch(n[1].toLowerCase()){case"afternoon":r=jv(t.reference);break;case"evening":case"night":r=Iv(t.reference);break;case"midnight":r=Lv(t.reference);break;case"morning":r=Fv(t.reference);break;case"noon":case"midday":r=zv(t.reference);break}return r&&r.addTag("parser/ENCasualTimeParser"),r}}function Vv(e,t,n){const r=e.getDateWithAdjustedTimezone(),i=Wv(r,t,n);let s=new Te(e);return s=s.addDurationAsImplied({day:i}),s.assign("weekday",t),s}function Wv(e,t,n){const r=e.getDay();switch(n){case"this":return xi(e,t);case"last":return yf(e,t);case"next":return r==Ee.SUNDAY?t==Ee.SUNDAY?7:t:r==Ee.SATURDAY?t==Ee.SATURDAY?7:t==Ee.SUNDAY?8:1+t:t<r&&t!=Ee.SUNDAY?xi(e,t):xi(e,t)+7}return Yv(e,t)}function Yv(e,t){const n=yf(e,t),r=xi(e,t);return r<-n?r:n}function xi(e,t){const n=e.getDay();let r=t-n;return r<0&&(r+=7),r}function yf(e,t){const n=e.getDay();let r=t-n;return r>=0&&(r-=7),r}const Gv=new RegExp(`(?:(?:\\,|\\(|\\()\\s*)?(?:on\\s*?)?(?:(this|last|past|next)\\s*)?(${xt(ba)}|weekend|weekday)(?:\\s*(?:\\,|\\)|\\)))?(?:\\s*(this|last|past|next)\\s*week)?(?=\\W|$)`,"i"),Kv=1,Zv=2,Jv=3;class Xv extends ke{innerPattern(){return Gv}innerExtract(t,n){const r=n[Kv],i=n[Jv];let s=r||i;s=s||"",s=s.toLowerCase();let a=null;s=="last"||s=="past"?a="last":s=="next"?a="next":s=="this"&&(a="this");const o=n[Zv].toLowerCase();let l;if(ba[o]!==void 0)l=ba[o];else if(o=="weekend")l=a=="last"?Ee.SUNDAY:Ee.SATURDAY;else if(o=="weekday"){const u=t.reference.getDateWithAdjustedTimezone().getDay();u==Ee.SUNDAY||u==Ee.SATURDAY?l=a=="last"?Ee.FRIDAY:Ee.MONDAY:(l=u-1,l=a=="last"?l-1:l+1,l=l%5+1)}else return null;return Vv(t.reference,l,a)}}const Qv=new RegExp(`(this|last|past|next|after\\s*this)\\s*(${xt(bi)})(?=\\s*)(?=\\W|$)`,"i"),eT=1,tT=2;class nT extends ke{innerPattern(){return Qv}innerExtract(t,n){const r=n[eT].toLowerCase(),i=n[tT].toLowerCase(),s=bi[i];if(r=="next"||r.startsWith("after")){const l={};return l[s]=1,Te.createRelativeFromReference(t.reference,l)}if(r=="last"||r=="past"){const l={};return l[s]=-1,Te.createRelativeFromReference(t.reference,l)}const a=t.createParsingComponents();let o=new Date(t.reference.instant.getTime());return i.match(/week/i)?(o.setDate(o.getDate()-o.getDay()),a.imply("day",o.getDate()),a.imply("month",o.getMonth()+1),a.imply("year",o.getFullYear())):i.match(/month/i)?(o.setDate(1),a.imply("day",o.getDate()),a.assign("year",o.getFullYear()),a.assign("month",o.getMonth()+1)):i.match(/year/i)&&(o.setDate(1),o.setMonth(0),a.imply("day",o.getDate()),a.imply("month",o.getMonth()+1),a.assign("year",o.getFullYear())),a}}const rT=new RegExp("([^\\d]|^)([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})(?:[\\/\\.\\-]([0-9]{4}|[0-9]{2}))?(\\W|$)","i"),iT=1,sT=5,bf=2,wf=3,xa=4;class aT{groupNumberMonth;groupNumberDay;constructor(t){this.groupNumberMonth=t?wf:bf,this.groupNumberDay=t?bf:wf}pattern(){return rT}extract(t,n){const r=n.index+n[iT].length,i=n.index+n[0].length-n[sT].length;if(r>0&&t.text.substring(0,r).match("\\d/?$")||i<t.text.length&&t.text.substring(i).match("^/?\\d"))return;const s=t.text.substring(r,i);if(s.match(/^\d\.\d$/)||s.match(/^\d\.\d{1,2}\.\d{1,2}\s*$/)||!n[xa]&&s.indexOf("/")<0)return;const a=t.createParsingResult(r,s);let o=parseInt(n[this.groupNumberMonth]),l=parseInt(n[this.groupNumberDay]);if((o<1||o>12)&&o>12)if(l>=1&&l<=12&&o<=31)[l,o]=[o,l];else return null;if(l<1||l>31)return null;if(a.start.assign("day",l),a.start.assign("month",o),n[xa]){const u=parseInt(n[xa]),c=Bc(u);a.start.assign("year",c)}else{const u=yi(t.refDate,l,o);a.start.imply("year",u)}return a.addTag("parser/SlashDateFormatParser")}}const oT=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${Zn})(?=\\W|$)`,"i"),lT=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${ki})(?=\\W|$)`,"i");class uT extends ke{allowAbbreviations;constructor(t=!0){super(),this.allowAbbreviations=t}innerPattern(){return this.allowAbbreviations?oT:lT}innerExtract(t,n){const r=n[1].toLowerCase();let i=kn(n[2]);if(!i)return null;switch(r){case"last":case"past":case"-":i=gi(i);break}return Te.createRelativeFromReference(t.reference,i)}}function cT(e){return e.text.match(/^[+-]/i)!=null}function _f(e){return e.text.match(/^-/i)!=null}class fT extends Jn{shouldMergeResults(t,n,r){return t.match(/^\s*$/i)?cT(r)||_f(r):!1}mergeResults(t,n,r,i){let s=kn(r.text);_f(r)&&(s=gi(s));const a=Te.createRelativeFromReference(rn.fromDate(n.start.date()),s);return new Tn(n.reference,n.index,`${n.text}${t}${r.text}`,a)}}function vf(e){return e.text.match(/\s+(before|from)$/i)!=null}function dT(e){return e.text.match(/\s+(after|since)$/i)!=null}class hT extends Jn{patternBetween(){return/^\s*$/i}shouldMergeResults(t,n,r){return!t.match(this.patternBetween())||!vf(n)&&!dT(n)?!1:!!r.start.get("day")&&!!r.start.get("month")&&!!r.start.get("year")}mergeResults(t,n,r){let i=kn(n.text);vf(n)&&(i=gi(i));const s=Te.createRelativeFromReference(rn.fromDate(r.start.date()),i);return new Tn(r.reference,n.index,`${n.text}${t}${r.text}`,s)}}const pT=new RegExp(`^\\s*(${vi})`,"i"),mT=1;class gT{refine(t,n){return n.forEach(function(r){if(!r.start.isDateWithUnknownYear())return;const i=t.text.substring(r.index+r.text.length),s=pT.exec(i);if(!s||s[0].trim().length<=3)return;t.debug(()=>{console.log(`Extracting year: '${s[0]}' into : ${r}`)});const a=Ti(s[mT]);r.end!=null&&r.end.assign("year",a),r.start.assign("year",a),r.text+=s[0]}),n}}class yT extends rf{constructor(){super()}isValid(t,n){const r=n.text.trim();return r===t.text.trim()?!0:r.toLowerCase()==="may"&&!t.text.substring(0,n.index).trim().match(/\b(in)$/i)?(t.debug(()=>{console.log(`Removing unlikely result: ${n}`)}),!1):r.toLowerCase().endsWith("the second")?(t.text.substring(n.index+n.text.length).trim().length>0&&t.debug(()=>{console.log(`Removing unlikely result: ${n}`)}),!1):!0}}class bT{createCasualConfiguration(t=!1){const n=this.createConfiguration(!1,t);return n.parsers.push(new qv),n.parsers.push(new Bv),n.parsers.push(new W_),n.parsers.push(new nT),n.parsers.push(new uT),n.refiners.push(new yT),n}createConfiguration(t=!0,n=!1){const r=gf({parsers:[new aT(n),new I_(t),new j_,new q_(n),new Xv,new tv,new sv(t),new lv(t),new dv(t)],refiners:[new uf]},t);return r.parsers.unshift(new J_(t)),r.refiners.unshift(new hT),r.refiners.unshift(new fT),r.refiners.unshift(new Ea),r.refiners.push(new uf),r.refiners.push(new gT),r.refiners.push(new hv),r}}class Xn{parsers;refiners;defaultConfig=new bT;constructor(t){t=t||this.defaultConfig.createCasualConfiguration(),this.parsers=[...t.parsers],this.refiners=[...t.refiners]}clone(){return new Xn({parsers:[...this.parsers],refiners:[...this.refiners]})}parseDate(t,n,r){const i=this.parse(t,n,r);return i.length>0?i[0].start.date():null}parse(t,n,r){const i=new wT(t,n,r);let s=[];return this.parsers.forEach(a=>{const o=Xn.executeParser(i,a);s=s.concat(o)}),s.sort((a,o)=>a.index-o.index),this.refiners.forEach(function(a){s=a.refine(i,s)}),s}static executeParser(t,n){const r=[],i=n.pattern(t),s=t.text;let a=t.text,o=i.exec(a);for(;o;){const l=o.index+s.length-a.length;o.index=l;const u=n.extract(t,o);if(!u){a=s.substring(o.index+1),o=i.exec(a);continue}let c=null;u instanceof Tn?c=u:u instanceof Te?(c=t.createParsingResult(o.index,o[0]),c.start=u):c=t.createParsingResult(o.index,o[0],u);const f=c.index,h=c.text;t.debug(()=>console.log(`${n.constructor.name} extracted (at index=${f}) '${h}'`)),r.push(c),a=s.substring(f+h.length),o=i.exec(a)}return r}}class wT{text;option;reference;refDate;constructor(t,n,r){this.text=t,this.option=r??{},this.reference=rn.fromInput(n,this.option.timezones),this.refDate=this.reference.instant}createParsingComponents(t){return t instanceof Te?t:new Te(this.reference,t)}createParsingResult(t,n,r,i){const s=typeof n=="string"?n:this.text.substring(t,n),a=r?this.createParsingComponents(r):null,o=i?this.createParsingComponents(i):null;return new Tn(this.reference,t,s,a,o)}debug(t){this.option.debug&&(this.option.debug instanceof Function?this.option.debug(t):this.option.debug.debug(t))}}const Ze={零:0,"〇":0,一:1,二:2,两:2,三:3,四:4,五:5,六:6,七:7,八:8,九:9,十:10},Pi={天:0,日:0,一:1,二:2,三:3,四:4,五:5,六:6};function Mt(e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];r==="十"?t=t===0?Ze[r]:t*Ze[r]:t+=Ze[r]}return t}function _T(e){let t="";for(let n=0;n<e.length;n++){const r=e[n];t=t+Ze[r]}return parseInt(t)}const Pa=1,Tf=2,Aa=3;class vT extends ke{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(Ze).join("")+"]{4}|["+Object.keys(Ze).join("")+"]{2})?(?:\\s*)(?:年)?(?:[\\s|,|,]*)(\\d{1,2}|["+Object.keys(Ze).join("")+"]{1,3})(?:\\s*)(?:月)(?:\\s*)(\\d{1,2}|["+Object.keys(Ze).join("")+"]{1,3})?(?:\\s*)(?:日|号)?")}innerExtract(t,n){const r=t.createParsingResult(n.index,n[0]);let i=parseInt(n[Tf]);if(isNaN(i)&&(i=Mt(n[Tf])),r.start.assign("month",i),n[Aa]){let s=parseInt(n[Aa]);isNaN(s)&&(s=Mt(n[Aa])),r.start.assign("day",s)}else r.start.imply("day",t.refDate.getDate());if(n[Pa]){let s=parseInt(n[Pa]);isNaN(s)&&(s=_T(n[Pa])),r.start.assign("year",s)}else r.start.imply("year",t.refDate.getFullYear());return r}}const TT=new RegExp("(\\d+|["+Object.keys(Ze).join("")+"]+|半|几)(?:\\s*)(?:个)?(秒(?:钟)?|分钟|小时|钟|日|天|星期|礼拜|月|年)(?:(?:之|过)?后|(?:之)?内)","i"),Da=1,kT=2;class ET extends ke{innerPattern(){return TT}innerExtract(t,n){const r=t.createParsingResult(n.index,n[0]);let i=parseInt(n[Da]);if(isNaN(i)&&(i=Mt(n[Da])),isNaN(i)){const u=n[Da];if(u==="几")i=3;else if(u==="半")i=.5;else return null}const s={},o=n[kT][0];if(o.match(/[日天星礼月年]/)){o=="日"||o=="天"?s.day=i:o=="星"||o=="礼"?s.week=i:o=="月"?s.month=i:o=="年"&&(s.year=i);const u=Le(t.refDate,s);return r.start.assign("year",u.getFullYear()),r.start.assign("month",u.getMonth()+1),r.start.assign("day",u.getDate()),r}o=="秒"?s.second=i:o=="分"?s.minute=i:(o=="小"||o=="钟")&&(s.hour=i);const l=Le(t.refDate,s);return r.start.imply("year",l.getFullYear()),r.start.imply("month",l.getMonth()+1),r.start.imply("day",l.getDate()),r.start.assign("hour",l.getHours()),r.start.assign("minute",l.getMinutes()),r.start.assign("second",l.getSeconds()),r}}const ST=new RegExp("(?<prefix>上|下|这)(?:个)?(?:星期|礼拜|周)(?<weekday>"+Object.keys(Pi).join("|")+")");class xT extends ke{innerPattern(){return ST}innerExtract(t,n){const r=t.createParsingResult(n.index,n[0]),i=n.groups.weekday,s=Pi[i];if(s===void 0)return null;let a=null;const o=n.groups.prefix;o=="上"?a="last":o=="下"?a="next":o=="这"&&(a="this");const l=new Date(t.refDate.getTime());let u=!1;const c=l.getDay();if(a=="last"||a=="past")l.setDate(l.getDate()+(s-7-c)),u=!0;else if(a=="next")l.setDate(l.getDate()+(s+7-c)),u=!0;else if(a=="this")l.setDate(l.getDate()+(s-c));else{let f=s-c;Math.abs(f-7)<Math.abs(f)&&(f-=7),Math.abs(f+7)<Math.abs(f)&&(f+=7),l.setDate(l.getDate()+f)}return r.start.assign("weekday",s),u?(r.start.assign("day",l.getDate()),r.start.assign("month",l.getMonth()+1),r.start.assign("year",l.getFullYear())):(r.start.imply("day",l.getDate()),r.start.imply("month",l.getMonth()+1),r.start.imply("year",l.getFullYear())),r}}const PT=new RegExp("(?:从|自)?(?:(今|明|前|大前|后|大后|昨)(早|朝|晚)|(上(?:午)|早(?:上)|下(?:午)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|(今|明|前|大前|后|大后|昨)(?:日|天)(?:[\\s,,]*)(?:(上(?:午)|早(?:上)|下(?:午)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?)?(?:[\\s,,]*)(?:(\\d+|["+Object.keys(Ze).join("")+"]+)(?:\\s*)(?:点|时|:|:)(?:\\s*)(\\d+|半|正|整|["+Object.keys(Ze).join("")+"]+)?(?:\\s*)(?:分|:|:)?(?:\\s*)(\\d+|["+Object.keys(Ze).join("")+"]+)?(?:\\s*)(?:秒)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),AT=new RegExp("(?:^\\s*(?:到|至|\\-|\\–|\\~|\\〜)\\s*)(?:(今|明|前|大前|后|大后|昨)(早|朝|晚)|(上(?:午)|早(?:上)|下(?:午)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|(今|明|前|大前|后|大后|昨)(?:日|天)(?:[\\s,,]*)(?:(上(?:午)|早(?:上)|下(?:午)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?)?(?:[\\s,,]*)(?:(\\d+|["+Object.keys(Ze).join("")+"]+)(?:\\s*)(?:点|时|:|:)(?:\\s*)(\\d+|半|正|整|["+Object.keys(Ze).join("")+"]+)?(?:\\s*)(?:分|:|:)?(?:\\s*)(\\d+|["+Object.keys(Ze).join("")+"]+)?(?:\\s*)(?:秒)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),Ai=1,Di=2,$i=3,Ci=4,Oi=5,Ri=6,ht=7,Sn=8,Ni=9;class DT extends ke{innerPattern(){return PT}innerExtract(t,n){if(n.index>0&&t.text[n.index-1].match(/\w/))return null;const r=t.createParsingResult(n.index,n[0]),i=new Date(t.refDate.getTime());if(n[Ai]){const c=n[Ai];c=="明"?t.refDate.getHours()>1&&i.setDate(i.getDate()+1):c=="昨"?i.setDate(i.getDate()-1):c=="前"?i.setDate(i.getDate()-2):c=="大前"?i.setDate(i.getDate()-3):c=="后"?i.setDate(i.getDate()+2):c=="大后"&&i.setDate(i.getDate()+3),r.start.assign("day",i.getDate()),r.start.assign("month",i.getMonth()+1),r.start.assign("year",i.getFullYear())}else if(n[Ci]){const c=n[Ci];c=="明"?i.setDate(i.getDate()+1):c=="昨"?i.setDate(i.getDate()-1):c=="前"?i.setDate(i.getDate()-2):c=="大前"?i.setDate(i.getDate()-3):c=="后"?i.setDate(i.getDate()+2):c=="大后"&&i.setDate(i.getDate()+3),r.start.assign("day",i.getDate()),r.start.assign("month",i.getMonth()+1),r.start.assign("year",i.getFullYear())}else r.start.imply("day",i.getDate()),r.start.imply("month",i.getMonth()+1),r.start.imply("year",i.getFullYear());let s=0,a=0,o=-1;if(n[Sn]){let c=parseInt(n[Sn]);if(isNaN(c)&&(c=Mt(n[Sn])),c>=60)return null;r.start.assign("second",c)}if(s=parseInt(n[Ri]),isNaN(s)&&(s=Mt(n[Ri])),n[ht]?n[ht]=="半"?a=30:n[ht]=="正"||n[ht]=="整"?a=0:(a=parseInt(n[ht]),isNaN(a)&&(a=Mt(n[ht]))):s>100&&(a=s%100,s=Math.floor(s/100)),a>=60||s>24)return null;if(s>=12&&(o=1),n[Ni]){if(s>12)return null;const c=n[Ni][0].toLowerCase();c=="a"&&(o=0,s==12&&(s=0)),c=="p"&&(o=1,s!=12&&(s+=12))}else if(n[Di]){const f=n[Di][0];f=="早"?(o=0,s==12&&(s=0)):f=="晚"&&(o=1,s!=12&&(s+=12))}else if(n[$i]){const f=n[$i][0];f=="上"||f=="早"||f=="凌"?(o=0,s==12&&(s=0)):(f=="下"||f=="晚")&&(o=1,s!=12&&(s+=12))}else if(n[Oi]){const f=n[Oi][0];f=="上"||f=="早"||f=="凌"?(o=0,s==12&&(s=0)):(f=="下"||f=="晚")&&(o=1,s!=12&&(s+=12))}r.start.assign("hour",s),r.start.assign("minute",a),o>=0?r.start.assign("meridiem",o):s<12?r.start.imply("meridiem",0):r.start.imply("meridiem",1);const l=AT.exec(t.text.substring(r.index+r.text.length));if(!l)return r.text.match(/^\d+$/)?null:r;const u=new Date(i.getTime());if(r.end=t.createParsingComponents(),l[Ai]){const c=l[Ai];c=="明"?t.refDate.getHours()>1&&u.setDate(u.getDate()+1):c=="昨"?u.setDate(u.getDate()-1):c=="前"?u.setDate(u.getDate()-2):c=="大前"?u.setDate(u.getDate()-3):c=="后"?u.setDate(u.getDate()+2):c=="大后"&&u.setDate(u.getDate()+3),r.end.assign("day",u.getDate()),r.end.assign("month",u.getMonth()+1),r.end.assign("year",u.getFullYear())}else if(l[Ci]){const c=l[Ci];c=="明"?u.setDate(u.getDate()+1):c=="昨"?u.setDate(u.getDate()-1):c=="前"?u.setDate(u.getDate()-2):c=="大前"?u.setDate(u.getDate()-3):c=="后"?u.setDate(u.getDate()+2):c=="大后"&&u.setDate(u.getDate()+3),r.end.assign("day",u.getDate()),r.end.assign("month",u.getMonth()+1),r.end.assign("year",u.getFullYear())}else r.end.imply("day",u.getDate()),r.end.imply("month",u.getMonth()+1),r.end.imply("year",u.getFullYear());if(s=0,a=0,o=-1,l[Sn]){let c=parseInt(l[Sn]);if(isNaN(c)&&(c=Mt(l[Sn])),c>=60)return null;r.end.assign("second",c)}if(s=parseInt(l[Ri]),isNaN(s)&&(s=Mt(l[Ri])),l[ht]?l[ht]=="半"?a=30:l[ht]=="正"||l[ht]=="整"?a=0:(a=parseInt(l[ht]),isNaN(a)&&(a=Mt(l[ht]))):s>100&&(a=s%100,s=Math.floor(s/100)),a>=60||s>24)return null;if(s>=12&&(o=1),l[Ni]){if(s>12)return null;const c=l[Ni][0].toLowerCase();c=="a"&&(o=0,s==12&&(s=0)),c=="p"&&(o=1,s!=12&&(s+=12)),r.start.isCertain("meridiem")||(o==0?(r.start.imply("meridiem",0),r.start.get("hour")==12&&r.start.assign("hour",0)):(r.start.imply("meridiem",1),r.start.get("hour")!=12&&r.start.assign("hour",r.start.get("hour")+12)))}else if(l[Di]){const f=l[Di][0];f=="早"?(o=0,s==12&&(s=0)):f=="晚"&&(o=1,s!=12&&(s+=12))}else if(l[$i]){const f=l[$i][0];f=="上"||f=="早"||f=="凌"?(o=0,s==12&&(s=0)):(f=="下"||f=="晚")&&(o=1,s!=12&&(s+=12))}else if(l[Oi]){const f=l[Oi][0];f=="上"||f=="早"||f=="凌"?(o=0,s==12&&(s=0)):(f=="下"||f=="晚")&&(o=1,s!=12&&(s+=12))}return r.text=r.text+l[0],r.end.assign("hour",s),r.end.assign("minute",a),o>=0?r.end.assign("meridiem",o):r.start.isCertain("meridiem")&&r.start.get("meridiem")==1&&r.start.get("hour")>s?r.end.imply("meridiem",0):s>12&&r.end.imply("meridiem",1),r.end.date().getTime()<r.start.date().getTime()&&r.end.imply("day",r.end.get("day")+1),r}}const $T=new RegExp("(?:星期|礼拜|周)(?<weekday>"+Object.keys(Pi).join("|")+")");class CT extends ke{innerPattern(){return $T}innerExtract(t,n){const r=t.createParsingResult(n.index,n[0]),i=n.groups.weekday,s=Pi[i];if(s===void 0)return null;const a=new Date(t.refDate.getTime()),o=a.getDay();let l=s-o;return Math.abs(l-7)<Math.abs(l)&&(l-=7),Math.abs(l+7)<Math.abs(l)&&(l+=7),a.setDate(a.getDate()+l),r.start.assign("weekday",s),r.start.imply("day",a.getDate()),r.start.imply("month",a.getMonth()+1),r.start.imply("year",a.getFullYear()),r}}const OT=1,kf=2,RT=3,Ef=4,Sf=5,NT=6;class MT extends ke{innerPattern(t){return new RegExp("(而家|立(?:刻|即)|即刻)|(今|明|前|大前|後|大後|聽|昨|尋|琴)(早|朝|晚)|(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|(今|明|前|大前|後|大後|聽|昨|尋|琴)(?:日|天)(?:[\\s|,|,]*)(?:(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?","i")}innerExtract(t,n){const r=n.index,i=t.createParsingResult(r,n[0]),s=t.refDate;let a=new Date(s.getTime());if(n[OT])i.start.imply("hour",s.getHours()),i.start.imply("minute",s.getMinutes()),i.start.imply("second",s.getSeconds()),i.start.imply("millisecond",s.getMilliseconds());else if(n[kf]){const o=n[kf],l=n[RT];o=="明"||o=="聽"?s.getHours()>1&&a.setDate(a.getDate()+1):o=="昨"||o=="尋"||o=="琴"?a.setDate(a.getDate()-1):o=="前"?a.setDate(a.getDate()-2):o=="大前"?a.setDate(a.getDate()-3):o=="後"?a.setDate(a.getDate()+2):o=="大後"&&a.setDate(a.getDate()+3),l=="早"||l=="朝"?i.start.imply("hour",6):l=="晚"&&(i.start.imply("hour",22),i.start.imply("meridiem",1))}else if(n[Ef]){const l=n[Ef][0];l=="早"||l=="朝"||l=="上"?i.start.imply("hour",6):l=="下"||l=="晏"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):l=="中"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):l=="夜"||l=="晚"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):l=="凌"&&i.start.imply("hour",0)}else if(n[Sf]){const o=n[Sf];o=="明"||o=="聽"?s.getHours()>1&&a.setDate(a.getDate()+1):o=="昨"||o=="尋"||o=="琴"?a.setDate(a.getDate()-1):o=="前"?a.setDate(a.getDate()-2):o=="大前"?a.setDate(a.getDate()-3):o=="後"?a.setDate(a.getDate()+2):o=="大後"&&a.setDate(a.getDate()+3);const l=n[NT];if(l){const u=l[0];u=="早"||u=="朝"||u=="上"?i.start.imply("hour",6):u=="下"||u=="晏"?(i.start.imply("hour",15),i.start.imply("meridiem",1)):u=="中"?(i.start.imply("hour",12),i.start.imply("meridiem",1)):u=="夜"||u=="晚"?(i.start.imply("hour",22),i.start.imply("meridiem",1)):u=="凌"&&i.start.imply("hour",0)}}return i.start.assign("day",a.getDate()),i.start.assign("month",a.getMonth()+1),i.start.assign("year",a.getFullYear()),i}}const Je={零:0,一:1,二:2,兩:2,三:3,四:4,五:5,六:6,七:7,八:8,九:9,十:10,廿:20,卅:30},Mi={天:0,日:0,一:1,二:2,三:3,四:4,五:5,六:6};function It(e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];r==="十"?t=t===0?Je[r]:t*Je[r]:t+=Je[r]}return t}function IT(e){let t="";for(let n=0;n<e.length;n++){const r=e[n];t=t+Je[r]}return parseInt(t)}const $a=1,xf=2,Ca=3;class LT extends ke{innerPattern(){return new RegExp("(\\d{2,4}|["+Object.keys(Je).join("")+"]{4}|["+Object.keys(Je).join("")+"]{2})?(?:\\s*)(?:年)?(?:[\\s|,|,]*)(\\d{1,2}|["+Object.keys(Je).join("")+"]{1,2})(?:\\s*)(?:月)(?:\\s*)(\\d{1,2}|["+Object.keys(Je).join("")+"]{1,2})?(?:\\s*)(?:日|號)?")}innerExtract(t,n){const r=t.createParsingResult(n.index,n[0]);let i=parseInt(n[xf]);if(isNaN(i)&&(i=It(n[xf])),r.start.assign("month",i),n[Ca]){let s=parseInt(n[Ca]);isNaN(s)&&(s=It(n[Ca])),r.start.assign("day",s)}else r.start.imply("day",t.refDate.getDate());if(n[$a]){let s=parseInt(n[$a]);isNaN(s)&&(s=IT(n[$a])),r.start.assign("year",s)}else r.start.imply("year",t.refDate.getFullYear());return r}}const FT=new RegExp("(\\d+|["+Object.keys(Je).join("")+"]+|半|幾)(?:\\s*)(?:個)?(秒(?:鐘)?|分鐘|小時|鐘|日|天|星期|禮拜|月|年)(?:(?:之|過)?後|(?:之)?內)","i"),Oa=1,jT=2;class zT extends ke{innerPattern(){return FT}innerExtract(t,n){const r=t.createParsingResult(n.index,n[0]);let i=parseInt(n[Oa]);if(isNaN(i)&&(i=It(n[Oa])),isNaN(i)){const u=n[Oa];if(u==="幾")i=3;else if(u==="半")i=.5;else return null}const s={},o=n[jT][0];if(o.match(/[日天星禮月年]/)){o=="日"||o=="天"?s.day=i:o=="星"||o=="禮"?s.week=i:o=="月"?s.month=i:o=="年"&&(s.year=i);const u=Le(t.refDate,s);return r.start.assign("year",u.getFullYear()),r.start.assign("month",u.getMonth()+1),r.start.assign("day",u.getDate()),r}o=="秒"?s.second=i:o=="分"?s.minute=i:(o=="小"||o=="鐘")&&(s.hour=i);const l=Le(t.refDate,s);return r.start.imply("year",l.getFullYear()),r.start.imply("month",l.getMonth()+1),r.start.imply("day",l.getDate()),r.start.assign("hour",l.getHours()),r.start.assign("minute",l.getMinutes()),r.start.assign("second",l.getSeconds()),r}}const UT=new RegExp("(?<prefix>上|今|下|這|呢)(?:個)?(?:星期|禮拜|週)(?<weekday>"+Object.keys(Mi).join("|")+")");class qT extends ke{innerPattern(){return UT}innerExtract(t,n){const r=t.createParsingResult(n.index,n[0]),i=n.groups.weekday,s=Mi[i];if(s===void 0)return null;let a=null;const o=n.groups.prefix;o=="上"?a="last":o=="下"?a="next":(o=="今"||o=="這"||o=="呢")&&(a="this");const l=new Date(t.refDate.getTime());let u=!1;const c=l.getDay();if(a=="last"||a=="past")l.setDate(l.getDate()+(s-7-c)),u=!0;else if(a=="next")l.setDate(l.getDate()+(s+7-c)),u=!0;else if(a=="this")l.setDate(l.getDate()+(s-c));else{let f=s-c;Math.abs(f-7)<Math.abs(f)&&(f-=7),Math.abs(f+7)<Math.abs(f)&&(f+=7),l.setDate(l.getDate()+f)}return r.start.assign("weekday",s),u?(r.start.assign("day",l.getDate()),r.start.assign("month",l.getMonth()+1),r.start.assign("year",l.getFullYear())):(r.start.imply("day",l.getDate()),r.start.imply("month",l.getMonth()+1),r.start.imply("year",l.getFullYear())),r}}const HT=new RegExp("(?:由|從|自)?(?:(今|明|前|大前|後|大後|聽|昨|尋|琴)(早|朝|晚)|(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|(今|明|前|大前|後|大後|聽|昨|尋|琴)(?:日|天)(?:[\\s,,]*)(?:(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?)?(?:[\\s,,]*)(?:(\\d+|["+Object.keys(Je).join("")+"]+)(?:\\s*)(?:點|時|:|:)(?:\\s*)(\\d+|半|正|整|["+Object.keys(Je).join("")+"]+)?(?:\\s*)(?:分|:|:)?(?:\\s*)(\\d+|["+Object.keys(Je).join("")+"]+)?(?:\\s*)(?:秒)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),BT=new RegExp("(?:^\\s*(?:到|至|\\-|\\–|\\~|\\〜)\\s*)(?:(今|明|前|大前|後|大後|聽|昨|尋|琴)(早|朝|晚)|(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|(今|明|前|大前|後|大後|聽|昨|尋|琴)(?:日|天)(?:[\\s,,]*)(?:(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?)?(?:[\\s,,]*)(?:(\\d+|["+Object.keys(Je).join("")+"]+)(?:\\s*)(?:點|時|:|:)(?:\\s*)(\\d+|半|正|整|["+Object.keys(Je).join("")+"]+)?(?:\\s*)(?:分|:|:)?(?:\\s*)(\\d+|["+Object.keys(Je).join("")+"]+)?(?:\\s*)(?:秒)?)(?:\\s*(A.M.|P.M.|AM?|PM?))?","i"),Ii=1,Li=2,Fi=3,ji=4,zi=5,Ui=6,pt=7,xn=8,qi=9;class VT extends ke{innerPattern(){return HT}innerExtract(t,n){if(n.index>0&&t.text[n.index-1].match(/\w/))return null;const r=t.createParsingResult(n.index,n[0]),i=new Date(t.refDate.getTime());if(n[Ii]){const p=n[Ii];p=="明"||p=="聽"?t.refDate.getHours()>1&&i.setDate(i.getDate()+1):p=="昨"||p=="尋"||p=="琴"?i.setDate(i.getDate()-1):p=="前"?i.setDate(i.getDate()-2):p=="大前"?i.setDate(i.getDate()-3):p=="後"?i.setDate(i.getDate()+2):p=="大後"&&i.setDate(i.getDate()+3),r.start.assign("day",i.getDate()),r.start.assign("month",i.getMonth()+1),r.start.assign("year",i.getFullYear())}else if(n[ji]){const p=n[ji];p=="明"||p=="聽"?i.setDate(i.getDate()+1):p=="昨"||p=="尋"||p=="琴"?i.setDate(i.getDate()-1):p=="前"?i.setDate(i.getDate()-2):p=="大前"?i.setDate(i.getDate()-3):p=="後"?i.setDate(i.getDate()+2):p=="大後"&&i.setDate(i.getDate()+3),r.start.assign("day",i.getDate()),r.start.assign("month",i.getMonth()+1),r.start.assign("year",i.getFullYear())}else r.start.imply("day",i.getDate()),r.start.imply("month",i.getMonth()+1),r.start.imply("year",i.getFullYear());let s=0,a=0,o=-1;if(n[xn]){var l=parseInt(n[xn]);if(isNaN(l)&&(l=It(n[xn])),l>=60)return null;r.start.assign("second",l)}if(s=parseInt(n[Ui]),isNaN(s)&&(s=It(n[Ui])),n[pt]?n[pt]=="半"?a=30:n[pt]=="正"||n[pt]=="整"?a=0:(a=parseInt(n[pt]),isNaN(a)&&(a=It(n[pt]))):s>100&&(a=s%100,s=Math.floor(s/100)),a>=60||s>24)return null;if(s>=12&&(o=1),n[qi]){if(s>12)return null;var u=n[qi][0].toLowerCase();u=="a"&&(o=0,s==12&&(s=0)),u=="p"&&(o=1,s!=12&&(s+=12))}else if(n[Li]){var c=n[Li],f=c[0];f=="朝"||f=="早"?(o=0,s==12&&(s=0)):f=="晚"&&(o=1,s!=12&&(s+=12))}else if(n[Fi]){var h=n[Fi],d=h[0];d=="上"||d=="朝"||d=="早"||d=="凌"?(o=0,s==12&&(s=0)):(d=="下"||d=="晏"||d=="晚")&&(o=1,s!=12&&(s+=12))}else if(n[zi]){var g=n[zi],T=g[0];T=="上"||T=="朝"||T=="早"||T=="凌"?(o=0,s==12&&(s=0)):(T=="下"||T=="晏"||T=="晚")&&(o=1,s!=12&&(s+=12))}r.start.assign("hour",s),r.start.assign("minute",a),o>=0?r.start.assign("meridiem",o):s<12?r.start.imply("meridiem",0):r.start.imply("meridiem",1);const y=BT.exec(t.text.substring(r.index+r.text.length));if(!y)return r.text.match(/^\d+$/)?null:r;const m=new Date(i.getTime());if(r.end=t.createParsingComponents(),y[Ii]){const p=y[Ii];p=="明"||p=="聽"?t.refDate.getHours()>1&&m.setDate(m.getDate()+1):p=="昨"||p=="尋"||p=="琴"?m.setDate(m.getDate()-1):p=="前"?m.setDate(m.getDate()-2):p=="大前"?m.setDate(m.getDate()-3):p=="後"?m.setDate(m.getDate()+2):p=="大後"&&m.setDate(m.getDate()+3),r.end.assign("day",m.getDate()),r.end.assign("month",m.getMonth()+1),r.end.assign("year",m.getFullYear())}else if(y[ji]){const p=y[ji];p=="明"||p=="聽"?m.setDate(m.getDate()+1):p=="昨"||p=="尋"||p=="琴"?m.setDate(m.getDate()-1):p=="前"?m.setDate(m.getDate()-2):p=="大前"?m.setDate(m.getDate()-3):p=="後"?m.setDate(m.getDate()+2):p=="大後"&&m.setDate(m.getDate()+3),r.end.assign("day",m.getDate()),r.end.assign("month",m.getMonth()+1),r.end.assign("year",m.getFullYear())}else r.end.imply("day",m.getDate()),r.end.imply("month",m.getMonth()+1),r.end.imply("year",m.getFullYear());if(s=0,a=0,o=-1,y[xn]){let p=parseInt(y[xn]);if(isNaN(p)&&(p=It(y[xn])),p>=60)return null;r.end.assign("second",p)}if(s=parseInt(y[Ui]),isNaN(s)&&(s=It(y[Ui])),y[pt]?y[pt]=="半"?a=30:y[pt]=="正"||y[pt]=="整"?a=0:(a=parseInt(y[pt]),isNaN(a)&&(a=It(y[pt]))):s>100&&(a=s%100,s=Math.floor(s/100)),a>=60||s>24)return null;if(s>=12&&(o=1),y[qi]){if(s>12)return null;var u=y[qi][0].toLowerCase();u=="a"&&(o=0,s==12&&(s=0)),u=="p"&&(o=1,s!=12&&(s+=12)),r.start.isCertain("meridiem")||(o==0?(r.start.imply("meridiem",0),r.start.get("hour")==12&&r.start.assign("hour",0)):(r.start.imply("meridiem",1),r.start.get("hour")!=12&&r.start.assign("hour",r.start.get("hour")+12)))}else if(y[Li]){var f=y[Li][0];f=="朝"||f=="早"?(o=0,s==12&&(s=0)):f=="晚"&&(o=1,s!=12&&(s+=12))}else if(y[Fi]){var d=y[Fi][0];d=="上"||d=="朝"||d=="早"||d=="凌"?(o=0,s==12&&(s=0)):(d=="下"||d=="晏"||d=="晚")&&(o=1,s!=12&&(s+=12))}else if(y[zi]){var T=y[zi][0];T=="上"||T=="朝"||T=="早"||T=="凌"?(o=0,s==12&&(s=0)):(T=="下"||T=="晏"||T=="晚")&&(o=1,s!=12&&(s+=12))}return r.text=r.text+y[0],r.end.assign("hour",s),r.end.assign("minute",a),o>=0?r.end.assign("meridiem",o):r.start.isCertain("meridiem")&&r.start.get("meridiem")==1&&r.start.get("hour")>s?r.end.imply("meridiem",0):s>12&&r.end.imply("meridiem",1),r.end.date().getTime()<r.start.date().getTime()&&r.end.imply("day",r.end.get("day")+1),r}}const WT=new RegExp("(?:星期|禮拜|週)(?<weekday>"+Object.keys(Mi).join("|")+")");class YT extends ke{innerPattern(){return WT}innerExtract(t,n){const r=t.createParsingResult(n.index,n[0]),i=n.groups.weekday,s=Mi[i];if(s===void 0)return null;const a=new Date(t.refDate.getTime()),o=a.getDay();let l=s-o;return Math.abs(l-7)<Math.abs(l)&&(l-=7),Math.abs(l+7)<Math.abs(l)&&(l+=7),a.setDate(a.getDate()+l),r.start.assign("weekday",s),r.start.imply("day",a.getDate()),r.start.imply("month",a.getMonth()+1),r.start.imply("year",a.getFullYear()),r}}class GT extends sf{patternBetween(){return/^\s*(至|到|\-|\~|~|-|ー)\s*$/i}}class KT extends lf{patternBetween(){return/^\s*$/i}}const ZT=new Xn(XT());new Xn(Pf());function JT(e,t,n){return ZT.parseDate(e,t,n)}function XT(){const e=Pf();return e.parsers.unshift(new MT),e}function Pf(){const e=gf({parsers:[new LT,new vT,new qT,new xT,new YT,new CT,new VT,new DT,new zT,new ET],refiners:[new GT,new KT]});return e.refiners=e.refiners.filter(t=>!(t instanceof cf)),e}var Hi={exports:{}},QT=Hi.exports,Af;function ek(){return Af||(Af=1,(function(e,t){(function(n,r){e.exports=r()})(QT,(function(){var n=1e3,r=6e4,i=36e5,s="millisecond",a="second",o="minute",l="hour",u="day",c="week",f="month",h="quarter",d="year",g="date",T="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(H){var j=["th","st","nd","rd"],B=H%100;return"["+H+(j[(B-20)%10]||j[B]||j[0])+"]"}},b=function(H,j,B){var Z=String(H);return!Z||Z.length>=j?H:""+Array(j+1-Z.length).join(B)+H},S={s:b,z:function(H){var j=-H.utcOffset(),B=Math.abs(j),Z=Math.floor(B/60),q=B%60;return(j<=0?"+":"-")+b(Z,2,"0")+":"+b(q,2,"0")},m:function H(j,B){if(j.date()<B.date())return-H(B,j);var Z=12*(B.year()-j.year())+(B.month()-j.month()),q=j.clone().add(Z,f),ee=B-q<0,k=j.clone().add(Z+(ee?-1:1),f);return+(-(Z+(B-q)/(ee?q-k:k-q))||0)},a:function(H){return H<0?Math.ceil(H)||0:Math.floor(H)},p:function(H){return{M:f,y:d,w:c,d:u,D:g,h:l,m:o,s:a,ms:s,Q:h}[H]||String(H||"").toLowerCase().replace(/s$/,"")},u:function(H){return H===void 0}},v="en",w={};w[v]=p;var x="$isDayjsObject",N=function(H){return H instanceof U||!(!H||!H[x])},F=function H(j,B,Z){var q;if(!j)return v;if(typeof j=="string"){var ee=j.toLowerCase();w[ee]&&(q=ee),B&&(w[ee]=B,q=ee);var k=j.split("-");if(!q&&k.length>1)return H(k[0])}else{var D=j.name;w[D]=j,q=D}return!Z&&q&&(v=q),q||!Z&&v},A=function(H,j){if(N(H))return H.clone();var B=typeof j=="object"?j:{};return B.date=H,B.args=arguments,new U(B)},O=S;O.l=F,O.i=N,O.w=function(H,j){return A(H,{locale:j.$L,utc:j.$u,x:j.$x,$offset:j.$offset})};var U=(function(){function H(B){this.$L=F(B.locale,null,!0),this.parse(B),this.$x=this.$x||B.x||{},this[x]=!0}var j=H.prototype;return j.parse=function(B){this.$d=(function(Z){var q=Z.date,ee=Z.utc;if(q===null)return new Date(NaN);if(O.u(q))return new Date;if(q instanceof Date)return new Date(q);if(typeof q=="string"&&!/Z$/i.test(q)){var k=q.match(y);if(k){var D=k[2]-1||0,I=(k[7]||"0").substring(0,3);return ee?new Date(Date.UTC(k[1],D,k[3]||1,k[4]||0,k[5]||0,k[6]||0,I)):new Date(k[1],D,k[3]||1,k[4]||0,k[5]||0,k[6]||0,I)}}return new Date(q)})(B),this.init()},j.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},j.$utils=function(){return O},j.isValid=function(){return this.$d.toString()!==T},j.isSame=function(B,Z){var q=A(B);return this.startOf(Z)<=q&&q<=this.endOf(Z)},j.isAfter=function(B,Z){return A(B)<this.startOf(Z)},j.isBefore=function(B,Z){return this.endOf(Z)<A(B)},j.$g=function(B,Z,q){return O.u(B)?this[Z]:this.set(q,B)},j.unix=function(){return Math.floor(this.valueOf()/1e3)},j.valueOf=function(){return this.$d.getTime()},j.startOf=function(B,Z){var q=this,ee=!!O.u(Z)||Z,k=O.p(B),D=function(ae,ne){var C=O.w(q.$u?Date.UTC(q.$y,ne,ae):new Date(q.$y,ne,ae),q);return ee?C:C.endOf(u)},I=function(ae,ne){return O.w(q.toDate()[ae].apply(q.toDate("s"),(ee?[0,0,0,0]:[23,59,59,999]).slice(ne)),q)},_=this.$W,E=this.$M,P=this.$D,M="set"+(this.$u?"UTC":"");switch(k){case d:return ee?D(1,0):D(31,11);case f:return ee?D(1,E):D(0,E+1);case c:var X=this.$locale().weekStart||0,J=(_<X?_+7:_)-X;return D(ee?P-J:P+(6-J),E);case u:case g:return I(M+"Hours",0);case l:return I(M+"Minutes",1);case o:return I(M+"Seconds",2);case a:return I(M+"Milliseconds",3);default:return this.clone()}},j.endOf=function(B){return this.startOf(B,!1)},j.$set=function(B,Z){var q,ee=O.p(B),k="set"+(this.$u?"UTC":""),D=(q={},q[u]=k+"Date",q[g]=k+"Date",q[f]=k+"Month",q[d]=k+"FullYear",q[l]=k+"Hours",q[o]=k+"Minutes",q[a]=k+"Seconds",q[s]=k+"Milliseconds",q)[ee],I=ee===u?this.$D+(Z-this.$W):Z;if(ee===f||ee===d){var _=this.clone().set(g,1);_.$d[D](I),_.init(),this.$d=_.set(g,Math.min(this.$D,_.daysInMonth())).$d}else D&&this.$d[D](I);return this.init(),this},j.set=function(B,Z){return this.clone().$set(B,Z)},j.get=function(B){return this[O.p(B)]()},j.add=function(B,Z){var q,ee=this;B=Number(B);var k=O.p(Z),D=function(E){var P=A(ee);return O.w(P.date(P.date()+Math.round(E*B)),ee)};if(k===f)return this.set(f,this.$M+B);if(k===d)return this.set(d,this.$y+B);if(k===u)return D(1);if(k===c)return D(7);var I=(q={},q[o]=r,q[l]=i,q[a]=n,q)[k]||1,_=this.$d.getTime()+B*I;return O.w(_,this)},j.subtract=function(B,Z){return this.add(-1*B,Z)},j.format=function(B){var Z=this,q=this.$locale();if(!this.isValid())return q.invalidDate||T;var ee=B||"YYYY-MM-DDTHH:mm:ssZ",k=O.z(this),D=this.$H,I=this.$m,_=this.$M,E=q.weekdays,P=q.months,M=q.meridiem,X=function(ne,C,R,z){return ne&&(ne[C]||ne(Z,ee))||R[C].slice(0,z)},J=function(ne){return O.s(D%12||12,ne,"0")},ae=M||function(ne,C,R){var z=ne<12?"AM":"PM";return R?z.toLowerCase():z};return ee.replace(m,(function(ne,C){return C||(function(R){switch(R){case"YY":return String(Z.$y).slice(-2);case"YYYY":return O.s(Z.$y,4,"0");case"M":return _+1;case"MM":return O.s(_+1,2,"0");case"MMM":return X(q.monthsShort,_,P,3);case"MMMM":return X(P,_);case"D":return Z.$D;case"DD":return O.s(Z.$D,2,"0");case"d":return String(Z.$W);case"dd":return X(q.weekdaysMin,Z.$W,E,2);case"ddd":return X(q.weekdaysShort,Z.$W,E,3);case"dddd":return E[Z.$W];case"H":return String(D);case"HH":return O.s(D,2,"0");case"h":return J(1);case"hh":return J(2);case"a":return ae(D,I,!0);case"A":return ae(D,I,!1);case"m":return String(I);case"mm":return O.s(I,2,"0");case"s":return String(Z.$s);case"ss":return O.s(Z.$s,2,"0");case"SSS":return O.s(Z.$ms,3,"0");case"Z":return k}return null})(ne)||k.replace(":","")}))},j.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},j.diff=function(B,Z,q){var ee,k=this,D=O.p(Z),I=A(B),_=(I.utcOffset()-this.utcOffset())*r,E=this-I,P=function(){return O.m(k,I)};switch(D){case d:ee=P()/12;break;case f:ee=P();break;case h:ee=P()/3;break;case c:ee=(E-_)/6048e5;break;case u:ee=(E-_)/864e5;break;case l:ee=E/i;break;case o:ee=E/r;break;case a:ee=E/n;break;default:ee=E}return q?ee:O.a(ee)},j.daysInMonth=function(){return this.endOf(f).$D},j.$locale=function(){return w[this.$L]},j.locale=function(B,Z){if(!B)return this.$L;var q=this.clone(),ee=F(B,Z,!0);return ee&&(q.$L=ee),q},j.clone=function(){return O.w(this.$d,this)},j.toDate=function(){return new Date(this.valueOf())},j.toJSON=function(){return this.isValid()?this.toISOString():null},j.toISOString=function(){return this.$d.toISOString()},j.toString=function(){return this.$d.toUTCString()},H})(),K=U.prototype;return A.prototype=K,[["$ms",s],["$s",a],["$m",o],["$H",l],["$W",u],["$M",f],["$y",d],["$D",g]].forEach((function(H){K[H[1]]=function(j){return this.$g(j,H[0],H[1])}})),A.extend=function(H,j){return H.$i||(H(j,U,A),H.$i=!0),A},A.locale=F,A.isDayjs=N,A.unix=function(H){return A(1e3*H)},A.en=w[v],A.Ls=w,A.p={},A}))})(Hi)),Hi.exports}var tk=ek();const Bi=er(tk);var Vi={exports:{}},nk=Vi.exports,Df;function rk(){return Df||(Df=1,(function(e,t){(function(n,r){e.exports=r()})(nk,(function(){var n="day";return function(r,i,s){var a=function(u){return u.add(4-u.isoWeekday(),n)},o=i.prototype;o.isoWeekYear=function(){return a(this).year()},o.isoWeek=function(u){if(!this.$utils().u(u))return this.add(7*(u-this.isoWeek()),n);var c,f,h,d,g=a(this),T=(c=this.isoWeekYear(),f=this.$u,h=(f?s.utc:s)().year(c).startOf("year"),d=4-h.isoWeekday(),h.isoWeekday()>4&&(d+=7),h.add(d,n));return g.diff(T,"week")+1},o.isoWeekday=function(u){return this.$utils().u(u)?this.day()||7:this.day(this.day()%7?u:u-7)};var l=o.startOf;o.startOf=function(u,c){var f=this.$utils(),h=!!f.u(c)||c;return f.p(u)==="isoweek"?h?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):l.bind(this)(u,c)}}}))})(Vi)),Vi.exports}var ik=rk();const sk=er(ik);Bi.extend(sk);function ak(){return Bi().startOf("isoWeek").toDate()}const Ra=/大*后天/g;function ok(e){if(!Ra.test(e))return e;const t=Bi();return Ra.lastIndex=0,e.replace(Ra,n=>{const i=2+(n.length-2);return t.add(i,"day").format("YYYY年MM月DD日")})}function lk(e){const t=ok(e),n=/(?:本|这|上|下)?(?:周|星期)/.test(t),r=JT(t,{instant:n?ak():new Date});return r?Bi(r).format("YYYY-MM-DD HH:mm:ss"):"无法解析,请输入具体时间"}const uk={parse_relative_date:{def:{type:"function",function:{name:"parse_relative_date",description:"把相对时间转成绝对时间",parameters:{type:"object",properties:{input:{type:"string",description:"相对时间"}},required:["input"]}}},handler:e=>lk(e.input)}};class ck extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot&&this.shadowRoot.appendChild(jc.content.cloneNode(!0))}connectedCallback(){this.shadowRoot&&S_(this.shadowRoot)}}customElements.define("ai-chat-panel",ck);class fk{on=ga.on;pushMessage=at.pushMessage;pushMessages=at.pushMessages;pushLoadingMessage=at.pushLoadingMessage;updateLoadingMessageReasoningContent=at.updateLoadingMessageReasoningContent;updateLoadingMessageContent=at.updateLoadingMessageContent;finishLoadingMessage=at.finishLoadingMessage;setUserInputValue=Ut.setValue;constructor(t){const{container:n}=t;if(!n)throw new Error("未提供有效的 container");const r=document.createElement("ai-chat-panel");n.appendChild(r)}}$e.AIChatPanel=fk,$e.Agent=w_,$e.tools=uk,Object.defineProperty($e,Symbol.toStringTag,{value:"Module"})}));
|